-
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 #79533 - sasurau4:feature/add-long-explanation-E0546, r…
…=GuillaumeGomez Add long explanation of E0546 Helps with #61137
- Loading branch information
Showing
3 changed files
with
29 additions
and
2 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,27 @@ | ||
A feature name is missing. | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0546 | ||
#![feature(staged_api)] | ||
#![stable(since = "1.0.0", feature = "test")] | ||
#[unstable(issue = "none")] // invalid | ||
fn unstable_fn() {} | ||
#[stable(since = "1.0.0")] // invalid | ||
fn stable_fn() {} | ||
``` | ||
|
||
To fix the issue you need to provide a feature name. | ||
|
||
``` | ||
#![feature(staged_api)] | ||
#![stable(since = "1.0.0", feature = "test")] | ||
#[unstable(feature = "unstable_fn", issue = "none")] // ok! | ||
fn unstable_fn() {} | ||
#[stable(feature = "stable_fn", since = "1.0.0")] // ok! | ||
fn stable_fn() {} | ||
``` |
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