summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/issue-104086-suggest-let.rs
blob: d22ad27d0e031f066fca66ea24e63348e92ddfd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
fn main() {
    x = x = x;
    //~^ ERROR cannot find value `x` in this scope
    //~| ERROR cannot find value `x` in this scope
    //~| ERROR cannot find value `x` in this scope

    x = y = y = y;
    //~^ ERROR cannot find value `y` in this scope
    //~| ERROR cannot find value `y` in this scope
    //~| ERROR cannot find value `y` in this scope
    //~| ERROR cannot find value `x` in this scope

    x = y = y;
    //~^ ERROR cannot find value `x` in this scope
    //~| ERROR cannot find value `y` in this scope
    //~| ERROR cannot find value `y` in this scope

    x = x = y;
    //~^ ERROR cannot find value `x` in this scope
    //~| ERROR cannot find value `x` in this scope
    //~| ERROR cannot find value `y` in this scope

    x = x; // will suggest add `let`
    //~^ ERROR cannot find value `x` in this scope
    //~| ERROR cannot find value `x` in this scope

    x = y // will suggest add `let`
    //~^ ERROR cannot find value `x` in this scope
    //~| ERROR cannot find value `y` in this scope
}