Skip to content

Commit e541b2e

Browse files
Add E0551 long error explanation
1 parent 702b45e commit e541b2e

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
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
@@ -454,7 +473,6 @@ features in the `-Z allow_features` flag.
454473
// rustc_deprecated attribute must be paired with either stable or unstable
455474
// attribute
456475
E0549,
457-
E0551, // incorrect meta item
458476
E0553, // multiple rustc_const_unstable attributes
459477
// E0555, // replaced with a generic attribute input check
460478
E0556, // malformed feature, expected just one word

0 commit comments

Comments
 (0)