Compiler error messages: reduce assertiveness of message E0384
This message is emitted as guidance by the compiler when a developer attempts to reassign a value to an immutable variable. Following the message will always currently work, but it may not always be the best course of action; following the 'consider ...' messaging pattern provides a hint to the developer that it could be wise to explore other alternatives.
This commit is contained in:
parent
d0695c9081
commit
0174dd6f92
23 changed files with 36 additions and 36 deletions
|
@ -1,6 +1,6 @@
|
|||
fn test() {
|
||||
let v: isize = 1; //~ NOTE first assignment
|
||||
//~| HELP make this binding mutable
|
||||
//~| HELP consider making this binding mutable
|
||||
//~| SUGGESTION mut v
|
||||
v.clone();
|
||||
v = 2; //~ ERROR cannot assign twice to immutable variable `v`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue