Skip to content

Commit

Permalink
Fill in syntactically valid deprecation version in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 30, 2023
1 parent 1e5b2da commit 5c7cf83
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions tests/ui/stability-attribute/stability-attribute-sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ mod missing_version {
fn f2() { }

#[stable(feature = "a", since = "4.4.4")]
#[deprecated(since = "a")] //~ ERROR missing 'note' [E0543]
#[deprecated(since = "5.5.5")] //~ ERROR missing 'note' [E0543]
fn f3() { }
}

Expand All @@ -58,8 +58,8 @@ fn multiple2() { }
fn multiple3() { }

#[stable(feature = "e", since = "b")] //~ ERROR 'since' must be a Rust version number, such as "1.31.0"
#[deprecated(since = "b", note = "text")]
#[deprecated(since = "b", note = "text")] //~ ERROR multiple `deprecated` attributes
#[deprecated(since = "5.5.5", note = "text")]
#[deprecated(since = "5.5.5", note = "text")] //~ ERROR multiple `deprecated` attributes
#[rustc_const_unstable(feature = "c", issue = "none")]
#[rustc_const_unstable(feature = "d", issue = "none")] //~ ERROR multiple stability levels
pub const fn multiple4() { }
Expand All @@ -69,7 +69,7 @@ pub const fn multiple4() { }
#[deprecated(since = "invalid", note = "text")]
fn invalid_deprecation_version() {}

#[deprecated(since = "a", note = "text")]
#[deprecated(since = "5.5.5", note = "text")]
fn deprecated_without_unstable_or_stable() { }
//~^^ ERROR deprecated attribute must be paired with either stable or unstable attribute

Expand Down
16 changes: 8 additions & 8 deletions tests/ui/stability-attribute/stability-attribute-sanity.stderr
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
error: multiple `deprecated` attributes
--> $DIR/stability-attribute-sanity.rs:62:1
|
LL | #[deprecated(since = "b", note = "text")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
LL | #[deprecated(since = "5.5.5", note = "text")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/stability-attribute-sanity.rs:61:1
|
LL | #[deprecated(since = "b", note = "text")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | #[deprecated(since = "5.5.5", note = "text")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0541]: unknown meta item 'reason'
--> $DIR/stability-attribute-sanity.rs:8:46
Expand Down Expand Up @@ -73,8 +73,8 @@ LL | #[deprecated(note = "a")]
error[E0543]: missing 'note'
--> $DIR/stability-attribute-sanity.rs:44:5
|
LL | #[deprecated(since = "a")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | #[deprecated(since = "5.5.5")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0544]: multiple stability levels
--> $DIR/stability-attribute-sanity.rs:49:1
Expand Down Expand Up @@ -118,8 +118,8 @@ LL | fn invalid_deprecation_version() {}
error[E0549]: deprecated attribute must be paired with either stable or unstable attribute
--> $DIR/stability-attribute-sanity.rs:72:1
|
LL | #[deprecated(since = "a", note = "text")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | #[deprecated(since = "5.5.5", note = "text")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0711]: feature `a` is declared stable since 1.0.0, but was previously declared stable since 4.4.4
--> $DIR/stability-attribute-sanity.rs:67:1
Expand Down

0 comments on commit 5c7cf83

Please sign in to comment.