]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/non-existent-field-present-in-subfield.fixed
Rollup merge of #107595 - michaelwoerister:retry_proc_macro_loading, r=petrochenkov
[rust.git] / tests / ui / suggestions / non-existent-field-present-in-subfield.fixed
1 // run-rustfix
2
3 struct Foo {
4     first: Bar,
5     _second: u32,
6     _third: Vec<String>,
7 }
8
9 struct Bar {
10     bar: C,
11 }
12
13 struct C {
14     c: D,
15 }
16
17 struct D {
18     test: E,
19 }
20
21 struct E {
22     _e: F,
23 }
24
25 struct F {
26     _f: u32,
27 }
28
29 fn main() {
30     let f = F { _f: 6 };
31     let e = E { _e: f };
32     let d = D { test: e };
33     let c = C { c: d };
34     let bar = Bar { bar: c };
35     let fooer = Foo { first: bar, _second: 4, _third: Vec::new() };
36
37     let _test = &fooer.first.bar.c;
38     //~^ ERROR no field
39
40     let _test2 = fooer.first.bar.c.test;
41     //~^ ERROR no field
42 }