File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
compiler/rustc_error_codes/src Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -283,6 +283,7 @@ E0537: include_str!("./error_codes/E0537.md"),
283283E0538 : include_str!( "./error_codes/E0538.md" ) ,
284284E0539 : include_str!( "./error_codes/E0539.md" ) ,
285285E0541 : include_str!( "./error_codes/E0541.md" ) ,
286+ E0546 : include_str!( "./error_codes/E0546.md" ) ,
286287E0550 : include_str!( "./error_codes/E0550.md" ) ,
287288E0551 : include_str!( "./error_codes/E0551.md" ) ,
288289E0552 : include_str!( "./error_codes/E0552.md" ) ,
@@ -603,7 +604,6 @@ E0779: include_str!("./error_codes/E0779.md"),
603604 E0543 , // missing 'reason'
604605 E0544 , // multiple stability levels
605606 E0545 , // incorrect 'issue'
606- E0546 , // missing 'feature'
607607 E0547 , // missing 'issue'
608608// E0548, // replaced with a generic attribute input check
609609 // rustc_deprecated attribute must be paired with either stable or unstable
Original file line number Diff line number Diff line change 1+ A feature name is missing.
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 the issue you need to provide a feature name.
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+ ```
You can’t perform that action at this time.
0 commit comments