diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index 58d0963274181..ff9370683ea45 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -170,6 +170,30 @@ Since `return;` is just like `return ();`, there is a mismatch between the function's return type and the value being returned. "##, +E0070: r##" +You tried to change the value of a const variable, which is not possible. Bad +example: + +``` +const SOME_CONST : i32 = 12; + +fn some_function() { + SOME_CONST = 14; // error ! +} +``` + +Constant variables' value can be changed once it has been set. Please take a +look to static keyword if you want something similar but mutable: + +``` +static mut SOME_NOT_CONST : i32 = 12; + +fn some_function() { + SOME_NOT_CONST = 14; // that's good ! +} +``` +"##, + E0081: r##" Enum discriminants are used to differentiate enum variants stored in memory. This error indicates that the same value was used for two or more variants, @@ -658,7 +682,6 @@ register_diagnostics! { E0060, E0061, E0068, - E0070, E0071, E0072, E0073,