File tree 2 files changed +28
-1
lines changed
compiler/rustc_error_codes/src
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"),
283
283
E0538 : include_str!( "./error_codes/E0538.md" ) ,
284
284
E0539 : include_str!( "./error_codes/E0539.md" ) ,
285
285
E0541 : include_str!( "./error_codes/E0541.md" ) ,
286
+ E0546 : include_str!( "./error_codes/E0546.md" ) ,
286
287
E0550 : include_str!( "./error_codes/E0550.md" ) ,
287
288
E0551 : include_str!( "./error_codes/E0551.md" ) ,
288
289
E0552 : include_str!( "./error_codes/E0552.md" ) ,
@@ -603,7 +604,6 @@ E0779: include_str!("./error_codes/E0779.md"),
603
604
E0543 , // missing 'reason'
604
605
E0544 , // multiple stability levels
605
606
E0545 , // incorrect 'issue'
606
- E0546 , // missing 'feature'
607
607
E0547 , // missing 'issue'
608
608
// E0548, // replaced with a generic attribute input check
609
609
// 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