summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/non-existent-field-present-in-subfield.fixed
blob: e58b4e6ca4d6f8f7f63a7b788ac83218af229243 (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
31
32
33
34
35
36
37
38
39
40
41
42
// run-rustfix

struct Foo {
    first: Bar,
    _second: u32,
    _third: Vec<String>,
}

struct Bar {
    bar: C,
}

struct C {
    c: D,
}

struct D {
    test: E,
}

struct E {
    _e: F,
}

struct F {
    _f: u32,
}

fn main() {
    let f = F { _f: 6 };
    let e = E { _e: f };
    let d = D { test: e };
    let c = C { c: d };
    let bar = Bar { bar: c };
    let fooer = Foo { first: bar, _second: 4, _third: Vec::new() };

    let _test = &fooer.first.bar.c;
    //~^ ERROR no field

    let _test2 = fooer.first.bar.c.test;
    //~^ ERROR no field
}