]> git.lizzy.rs Git - rust.git/blob - src/test/ui/assign-imm-local-twice.rs
Rollup merge of #95534 - jyn514:std-mem-copy, r=joshtriplett
[rust.git] / src / test / ui / assign-imm-local-twice.rs
1 fn test() {
2     let v: isize;
3     //~^ HELP consider making this binding mutable
4     //~| SUGGESTION mut v
5     v = 1; //~ NOTE first assignment
6     println!("v={}", v);
7     v = 2; //~ ERROR cannot assign twice to immutable variable
8            //~| NOTE cannot assign twice to immutable
9     println!("v={}", v);
10 }
11
12 fn main() {
13 }