summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/suggest-let-for-assignment.rs
blob: 67705fe063a79e5e0474fb941cc9a3b155984f6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// run-rustfix

fn main() {
    demo = 1; //~ ERROR cannot find value `demo` in this scope
    dbg!(demo); //~ ERROR cannot find value `demo` in this scope

    x = "x"; //~ ERROR cannot find value `x` in this scope
    println!("x: {}", x); //~ ERROR cannot find value `x` in this scope

    if x == "x" {
        //~^ ERROR cannot find value `x` in this scope
        println!("x is 1");
    }

    y = 1 + 2; //~ ERROR cannot find value `y` in this scope
    println!("y: {}", y); //~ ERROR cannot find value `y` in this scope
}