Skip to content

Improve long explanation for E0546 #81835

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

Merged
merged 3 commits into from
Feb 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions compiler/rustc_error_codes/src/error_codes/E0546.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
A feature name is missing.
The `feature` value is missing in a stability attribute.

Erroneous code example:

Expand All @@ -13,7 +13,7 @@ fn unstable_fn() {}
fn stable_fn() {}
```

To fix the issue you need to provide a feature name.
To fix the issue you need to provide the `feature` field.

```
#![feature(staged_api)]
Expand All @@ -25,3 +25,10 @@ fn unstable_fn() {}
#[stable(feature = "stable_fn", since = "1.0.0")] // ok!
fn stable_fn() {}
```

See the [How Rust is Made and “Nightly Rust”][how-rust-made-nightly] appendix
of the Book and the [Stability attributes][stability-attributes] section of the
Rustc Dev Guide for more details.

[how-rust-made-nightly]: https://doc.rust-lang.org/book/appendix-07-nightly-rust.html
[stability-attributes]: https://rustc-dev-guide.rust-lang.org/stability.html