File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -73,14 +73,35 @@ fn main() {
7373
7474To fix this, ensure that any declared variables are initialized before being
7575used.
76+ "## ,
77+
78+ E0384 : r##"
79+ This error occurs when an attempt is made to reassign an immutable variable.
80+ For example:
81+
82+ ```
83+ fn main(){
84+ let x = 3;
85+ x = 5; // error, reassignment of immutable variable
86+ }
87+ ```
88+
89+ By default, variables in Rust are immutable. To fix this error, add the keyword
90+ `mut` after the keyword `let` when declaring the variable. For example:
91+
92+ ```
93+ fn main(){
94+ let mut x = 3;
95+ x = 5;
96+ }
97+ ```
7698"##
7799
78100}
79101
80102register_diagnostics ! {
81103 E0382 , // use of partially/collaterally moved value
82104 E0383 , // partial reinitialization of uninitialized structure
83- E0384 , // reassignment of immutable variable
84105 E0385 , // {} in an aliasable location
85106 E0386 , // {} in an immutable container
86107 E0387 , // {} in a captured outer variable in an `Fn` closure
You can’t perform that action at this time.
0 commit comments