forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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 rust-lang#106627 - Ezrashaw:no-e0711-without-staged-api…
…, r=Mark-Simulacrum fix: don't emit `E0711` if `staged_api` not enabled Fixes rust-lang#106589 Simple fix, added UI test. As an aside, it seems a lot of features are susceptible to this, `E0711` stands out to me because it's perma-unstable and we are effectively exposing an implementation detail.
- Loading branch information
Showing
3 changed files
with
31 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// #![feature(staged_api)] // note: `staged_api` not enabled | ||
|
||
#![stable(feature = "foo", since = "1.0.0")] | ||
//~^ ERROR stability attributes may not be used outside of the standard library | ||
|
||
#[unstable(feature = "foo", issue = "none")] | ||
//~^ ERROR stability attributes may not be used outside of the standard library | ||
fn foo_unstable() {} | ||
|
||
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,15 @@ | ||
error[E0734]: stability attributes may not be used outside of the standard library | ||
--> $DIR/issue-106589.rs:6:1 | ||
| | ||
LL | #[unstable(feature = "foo", issue = "none")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0734]: stability attributes may not be used outside of the standard library | ||
--> $DIR/issue-106589.rs:3:1 | ||
| | ||
LL | #![stable(feature = "foo", since = "1.0.0")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0734`. |