Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store #[stable] attribute's since value in structured form #117148

Merged
merged 7 commits into from
Oct 26, 2023
Prev Previous commit
Next Next commit
Update stability attribute sanity UI test to delete superfluous errors
  • Loading branch information
dtolnay committed Oct 24, 2023
commit 7b0e315ae6784c344d5c19a5bb83d96bc20f518e
3 changes: 1 addition & 2 deletions tests/ui/stability-attribute/stability-attribute-sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ 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
//~^ ERROR deprecated attribute must be paired with either stable or unstable attribute
#[rustc_const_unstable(feature = "c", issue = "none")]
#[rustc_const_unstable(feature = "d", issue = "none")] //~ ERROR multiple stability levels
pub const fn multiple4() { } //~ ERROR function has missing stability attribute
pub const fn multiple4() { }

#[stable(feature = "a", since = "1.0.0")] //~ ERROR invalid deprecation version found
//~^ ERROR feature `a` is declared stable since 1.0.0
Expand Down
22 changes: 5 additions & 17 deletions tests/ui/stability-attribute/stability-attribute-sanity.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,13 @@ LL | #[stable(feature = "e", since = "b")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0544]: multiple stability levels
--> $DIR/stability-attribute-sanity.rs:65:1
--> $DIR/stability-attribute-sanity.rs:64:1
|
LL | #[rustc_const_unstable(feature = "d", issue = "none")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0549]: deprecated attribute must be paired with either stable or unstable attribute
--> $DIR/stability-attribute-sanity.rs:62:1
|
LL | #[deprecated(since = "b", note = "text")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: invalid deprecation version found
--> $DIR/stability-attribute-sanity.rs:68:1
--> $DIR/stability-attribute-sanity.rs:67:1
|
LL | #[stable(feature = "a", since = "1.0.0")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid deprecation version
Expand All @@ -122,24 +116,18 @@ LL | fn invalid_deprecation_version() {}
| ----------------------------------- the stability attribute annotates this item

error[E0549]: deprecated attribute must be paired with either stable or unstable attribute
--> $DIR/stability-attribute-sanity.rs:73:1
--> $DIR/stability-attribute-sanity.rs:72:1
|
LL | #[deprecated(since = "a", note = "text")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: function has missing stability attribute
--> $DIR/stability-attribute-sanity.rs:66:1
|
LL | pub const fn multiple4() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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:68:1
--> $DIR/stability-attribute-sanity.rs:67:1
|
LL | #[stable(feature = "a", since = "1.0.0")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 22 previous errors
error: aborting due to 20 previous errors

Some errors have detailed explanations: E0539, E0541, E0542, E0543, E0544, E0546, E0547, E0549, E0711.
For more information about an error, try `rustc --explain E0539`.
Loading