]> git.lizzy.rs Git - rust.git/blob - src/test/ui/assign-imm-local-twice.rs
Merge commit 'f2cdd4a78d89c009342197cf5844a21f8aa813df' into sync_cg_clif-2022-04-22
[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 }