From 67eaa9e32731d9bf72272ae4ee2bed980f310f1b Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 4 Dec 2015 12:19:58 +0100 Subject: [PATCH] Add E0452 error explanation --- src/librustc/diagnostics.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index 6c0a2eb381ce2..97110dbc92819 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -1924,7 +1924,7 @@ fn main() { You cannot directly use a dereference operation whilst initializing a constant or a static. To fix this error, restructure your code to avoid this dereference, -perharps moving it inline: +perhaps moving it inline: ``` use std::ops::Deref; @@ -1943,6 +1943,23 @@ fn main() { ``` "##, +E0452: r##" +An invalid lint attribute has been given. Erroneous code example: + +``` +#![allow(foo = "")] // error: malformed lint attribute +``` + +Lint attributes only accept a list of identifiers (where each identifier is a +lint name). Ensure the attribute is of this form: + +``` +#![allow(foo)] // ok! +// or: +#![allow(foo, foo2)] // ok! +``` +"##, + E0492: r##" A borrow of a constant containing interior mutability was attempted. Erroneous code example: @@ -2219,7 +2236,6 @@ register_diagnostics! { E0314, // closure outlives stack frame E0315, // cannot invoke closure outside of its lifetime E0316, // nested quantification of lifetimes - E0452, // malformed lint attribute E0453, // overruled by outer forbid E0471, // constant evaluation error: .. E0472, // asm! is unsupported on this target