summaryrefslogtreecommitdiffstats
path: root/tests/ui/assign-imm-local-twice.rs
blob: b50f6ab5deb1569624f34c9bfddcb90e72be94be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
fn test() {
    let v: isize;
    //~^ HELP consider making this binding mutable
    //~| SUGGESTION mut v
    v = 1; //~ NOTE first assignment
    println!("v={}", v);
    v = 2; //~ ERROR cannot assign twice to immutable variable
           //~| NOTE cannot assign twice to immutable
    println!("v={}", v);
}

fn main() {
}