Skip to content

Commit 3add979

Browse files
authored
Rollup merge of rust-lang#64838 - GuillaumeGomez:long-err-explanation-e0550, r=oli-obk
Add long error explanation for E0550 Part of rust-lang#61137
2 parents 686ad4d + e67ae0e commit 3add979

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
@@ -144,6 +144,25 @@ fn deprecated_function() {}
144144
```
145145
"##,
146146

147+
E0550: r##"
148+
More than one `deprecated` attribute has been put on an item.
149+
150+
Erroneous code example:
151+
152+
```compile_fail,E0550
153+
#[deprecated(note = "because why not?")]
154+
#[deprecated(note = "right?")] // error!
155+
fn the_banished() {}
156+
```
157+
158+
The `deprecated` attribute can only be present **once** on an item.
159+
160+
```
161+
#[deprecated(note = "because why not, right?")]
162+
fn the_banished() {} // ok!
163+
```
164+
"##,
165+
147166
E0552: r##"
148167
A unrecognized representation attribute was used.
149168
@@ -435,7 +454,6 @@ features in the `-Z allow_features` flag.
435454
// rustc_deprecated attribute must be paired with either stable or unstable
436455
// attribute
437456
E0549,
438-
E0550, // multiple deprecated attributes
439457
E0551, // incorrect meta item
440458
E0553, // multiple rustc_const_unstable attributes
441459
// E0555, // replaced with a generic attribute input check

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, E0565.
57+
Some errors have detailed explanations: E0538, E0541, E0550, E0565.
5858
For more information about an error, try `rustc --explain E0538`.

0 commit comments

Comments
 (0)