summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/suggest-let-for-assignment.fixed
blob: 76dc1dad80a9008c07aa8df341b4f235d369ccca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// run-rustfix

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

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

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

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

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

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