]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0546.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0546.md
1 The `feature` value is missing in a stability attribute.
2
3 Erroneous code example:
4
5 ```compile_fail,E0546
6 #![feature(staged_api)]
7 #![stable(since = "1.0.0", feature = "test")]
8
9 #[unstable(issue = "none")] // invalid
10 fn unstable_fn() {}
11
12 #[stable(since = "1.0.0")] // invalid
13 fn stable_fn() {}
14 ```
15
16 To fix this issue, you need to provide the `feature` field. Example:
17
18 ```
19 #![feature(staged_api)]
20 #![stable(since = "1.0.0", feature = "test")]
21
22 #[unstable(feature = "unstable_fn", issue = "none")] // ok!
23 fn unstable_fn() {}
24
25 #[stable(feature = "stable_fn", since = "1.0.0")] // ok!
26 fn stable_fn() {}
27 ```
28
29 See the [How Rust is Made and “Nightly Rust”][how-rust-made-nightly] appendix
30 of the Book and the [Stability attributes][stability-attributes] section of the
31 Rustc Dev Guide for more details.
32
33 [how-rust-made-nightly]: https://doc.rust-lang.org/book/appendix-07-nightly-rust.html
34 [stability-attributes]: https://rustc-dev-guide.rust-lang.org/stability.html