Skip to content

Commit 67eaa9e

Browse files
Add E0452 error explanation
1 parent 5673a7b commit 67eaa9e

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/librustc/diagnostics.rs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1924,7 +1924,7 @@ fn main() {
19241924
19251925
You cannot directly use a dereference operation whilst initializing a constant
19261926
or a static. To fix this error, restructure your code to avoid this dereference,
1927-
perharps moving it inline:
1927+
perhaps moving it inline:
19281928
19291929
```
19301930
use std::ops::Deref;
@@ -1943,6 +1943,23 @@ fn main() {
19431943
```
19441944
"##,
19451945

1946+
E0452: r##"
1947+
An invalid lint attribute has been given. Erroneous code example:
1948+
1949+
```
1950+
#![allow(foo = "")] // error: malformed lint attribute
1951+
```
1952+
1953+
Lint attributes only accept a list of identifiers (where each identifier is a
1954+
lint name). Ensure the attribute is of this form:
1955+
1956+
```
1957+
#![allow(foo)] // ok!
1958+
// or:
1959+
#![allow(foo, foo2)] // ok!
1960+
```
1961+
"##,
1962+
19461963
E0492: r##"
19471964
A borrow of a constant containing interior mutability was attempted. Erroneous
19481965
code example:
@@ -2219,7 +2236,6 @@ register_diagnostics! {
22192236
E0314, // closure outlives stack frame
22202237
E0315, // cannot invoke closure outside of its lifetime
22212238
E0316, // nested quantification of lifetimes
2222-
E0452, // malformed lint attribute
22232239
E0453, // overruled by outer forbid
22242240
E0471, // constant evaluation error: ..
22252241
E0472, // asm! is unsupported on this target

0 commit comments

Comments
 (0)