Skip to content

Commit 4d33d41

Browse files
committed
Add long explanation for E0547
1 parent 921ec4b commit 4d33d41

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

compiler/rustc_error_codes/src/error_codes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ E0539: include_str!("./error_codes/E0539.md"),
287287
E0541: include_str!("./error_codes/E0541.md"),
288288
E0542: include_str!("./error_codes/E0542.md"),
289289
E0546: include_str!("./error_codes/E0546.md"),
290+
E0547: include_str!("./error_codes/E0547.md"),
290291
E0550: include_str!("./error_codes/E0550.md"),
291292
E0551: include_str!("./error_codes/E0551.md"),
292293
E0552: include_str!("./error_codes/E0552.md"),
@@ -606,7 +607,6 @@ E0781: include_str!("./error_codes/E0781.md"),
606607
E0543, // missing 'reason'
607608
E0544, // multiple stability levels
608609
E0545, // incorrect 'issue'
609-
E0547, // missing 'issue'
610610
// E0548, // replaced with a generic attribute input check
611611
// rustc_deprecated attribute must be paired with either stable or unstable
612612
// attribute
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#![stable(since = "1.0.0", feature = "test")]
2+
#[unstable(feature = "_unstable_fn")] // invalid
3+
fn _unstable_fn() {}
4+
#[rustc_const_unstable(feature = "_unstable_const_fn")] // invalid
5+
fn _unstable_const_fn() {}
6+
```
7+
8+
To fix the issue you need to provide the `issue` field.
9+
10+
```
11+
#![feature(staged_api)]
12+
#![stable(since = "1.0.0", feature = "test")]
13+
#[unstable(feature = "_unstable_fn", issue = "none")] // ok!
14+
fn _unstable_fn() {}
15+
#[rustc_const_unstable(
16+
feature = "_unstable_const_fn",
17+
issue = "none"
18+
)] // ok!
19+
fn _unstable_const_fn() {}
20+
```
21+
22+
See the [How Rust is Made and “Nightly Rust”][how-rust-made-nightly] appendix
23+
of the Book and the [Stability attributes][stability-attributes] section of the
24+
Rustc Dev Guide for more details.
25+
26+
[how-rust-made-nightly]: https://doc.rust-lang.org/book/appendix-07-nightly-rust.html
27+
[stability-attributes]: https://rustc-dev-guide.rust-lang.org/stability.html

src/test/ui/stability-attribute/stability-attribute-sanity.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,5 @@ LL | #[rustc_deprecated(since = "a", reason = "text")]
116116

117117
error: aborting due to 19 previous errors
118118

119-
Some errors have detailed explanations: E0539, E0541, E0542, E0546, E0550.
119+
Some errors have detailed explanations: E0539, E0541, E0542, E0546, E0547, E0550.
120120
For more information about an error, try `rustc --explain E0539`.

0 commit comments

Comments
 (0)