blob: fa230134df5556187c179bdb3d1590b23ba5e080 [file] [log] [blame] [edit]
error[E0384]: cannot assign twice to immutable variable `num`
--> $DIR/borrowck-for-loop-deref-pattern-assignment.rs:7:9
|
LL | for &num in nums {
| --- first assignment to `num`
LL | num *= 2;
| ^^^^^^^^ cannot assign twice to immutable variable
|
help: consider making this binding mutable
|
LL | for &(mut num) num in nums {
| +++++++++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0384`.