-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #71481 - estebank:inherit-stability, r=nikomatsakis
Inherit `#[stable(..)]` annotations in enum variants and fields from its item Lint changes for #65515. The stdlib will have to be updated once this lands in beta and that version is promoted in master.
- Loading branch information
Showing
17 changed files
with
290 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#[rustc_const_stable(feature = "foo", since = "0")] | ||
//~^ ERROR macros cannot have const stability attributes | ||
macro_rules! foo { | ||
() => {}; | ||
} | ||
|
||
#[rustc_const_unstable(feature = "bar", issue="none")] | ||
//~^ ERROR macros cannot have const stability attributes | ||
macro_rules! bar { | ||
() => {}; | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error: macros cannot have const stability attributes | ||
--> $DIR/const-stability-on-macro.rs:1:1 | ||
| | ||
LL | #[rustc_const_stable(feature = "foo", since = "0")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid const stability attribute | ||
LL | | ||
LL | macro_rules! foo { | ||
| ---------------- const stability attribute affects this macro | ||
|
||
error: macros cannot have const stability attributes | ||
--> $DIR/const-stability-on-macro.rs:7:1 | ||
| | ||
LL | #[rustc_const_unstable(feature = "bar", issue="none")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid const stability attribute | ||
LL | | ||
LL | macro_rules! bar { | ||
| ---------------- const stability attribute affects this macro | ||
|
||
error: aborting due to 2 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
// #[deprecated] cannot be used in staged API | ||
|
||
#![feature(staged_api)] | ||
|
||
#![stable(feature = "stable_test_feature", since = "1.0.0")] | ||
|
||
#[deprecated] | ||
fn main() { } //~ ERROR `#[deprecated]` cannot be used in staged API | ||
#[deprecated] //~ ERROR `#[deprecated]` cannot be used in staged API | ||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
error: `#[deprecated]` cannot be used in staged API; use `#[rustc_deprecated]` instead | ||
--> $DIR/deprecation-in-staged-api.rs:8:1 | ||
error: `#[deprecated]` cannot be used in staged API | ||
--> $DIR/deprecation-in-staged-api.rs:3:1 | ||
| | ||
LL | fn main() { } | ||
| ^^^^^^^^^^^^^ | ||
LL | #[deprecated] | ||
| ^^^^^^^^^^^^^ use `#[rustc_deprecated]` instead | ||
LL | fn main() {} | ||
| ------------ | ||
|
||
error: aborting due to previous error | ||
|
Oops, something went wrong.