Skip to content

Commit 7153c92

Browse files
authored
Rollup merge of rust-lang#64918 - GuillaumeGomez:long-err-explanation-E0551, r=oli-obk
Add long error explanation for E0551 Part of rust-lang#61137
2 parents 6f211f1 + 62f1fb3 commit 7153c92

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/libsyntax/error_codes.rs

+19-1
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,25 @@ fn the_banished() {} // ok!
163163
```
164164
"##,
165165

166+
E0551: r##"
167+
An invalid meta-item was used inside an attribute.
168+
169+
Erroneous code example:
170+
171+
```compile_fail,E0551
172+
#[deprecated(note)] // error!
173+
fn i_am_deprecated() {}
174+
```
175+
176+
Meta items are the key-value pairs inside of an attribute. To fix this issue,
177+
you need to give a value to the `note` key. Example:
178+
179+
```
180+
#[deprecated(note = "because")] // ok!
181+
fn i_am_deprecated() {}
182+
```
183+
"##,
184+
166185
E0552: r##"
167186
A unrecognized representation attribute was used.
168187
@@ -473,7 +492,6 @@ features in the `-Z allow_features` flag.
473492
// rustc_deprecated attribute must be paired with either stable or unstable
474493
// attribute
475494
E0549,
476-
E0551, // incorrect meta item
477495
E0553, // multiple rustc_const_unstable attributes
478496
// E0555, // replaced with a generic attribute input check
479497
E0584, // file for module `..` found at both .. and ..

src/test/ui/deprecation/deprecation-sanity.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ LL | #[deprecated(since = "a", since = "b", note = "c")]
5454

5555
error: aborting due to 9 previous errors
5656

57-
Some errors have detailed explanations: E0538, E0541, E0550, E0565.
57+
Some errors have detailed explanations: E0538, E0541, E0550, E0551, E0565.
5858
For more information about an error, try `rustc --explain E0538`.

0 commit comments

Comments
 (0)