From cd0af4515b6a3e523034c499a820b5f3bf3318cd Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 31 Jul 2015 14:40:27 +0200 Subject: [PATCH] Add E0435 error explanation --- src/librustc_resolve/diagnostics.rs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index e6daee98821..cb14b843522 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -638,6 +638,26 @@ use something_which_doesnt_exist; Please verify you didn't misspell the import's name. "##, +E0435: r##" +A non-constant value was used in a const. Example of erroneous code: + +``` +let foo = 42u32; +const FOO : u32 = foo; // error: attempt to use a non-constant value in a + // constant +``` + +To fix this error, please replace the value by a constant one. Example: + +``` +const FOO : u32 = 42u32; // ok! + +// or: +const OTHER_FOO : u32 = 42u32; +const FOO : u32 = OTHER_FOO; // ok! +``` +"##, + E0437: r##" Trait impls can only implement associated types that are members of the trait in question. This error indicates that you attempted to implement an associated @@ -717,5 +737,4 @@ register_diagnostics! { E0427, // cannot use `ref` binding mode with ... E0429, // `self` imports are only allowed within a { } list E0434, // can't capture dynamic environment in a fn item - E0435, // attempt to use a non-constant value in a constant }