summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/suggest-field-through-deref.rs
blob: 6e24b425e95658cee957ad1725c4b6869225b4f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// run-rustfix
#![allow(dead_code)]
use std::sync::Arc;
struct S {
    long_name: (),
    foo: (),
}
fn main() {
    let x = Arc::new(S { long_name: (), foo: () });
    let _ = x.longname; //~ ERROR no field `longname`
    let y = S { long_name: (), foo: () };
    let _ = y.longname; //~ ERROR no field `longname`
    let a = Some(Arc::new(S { long_name: (), foo: () }));
    let _ = a.longname; //~ ERROR no field `longname`
    let b = Some(S { long_name: (), foo: () });
    let _ = b.long_name; //~ ERROR no field `long_name`
    let c = Ok::<_, ()>(Arc::new(S { long_name: (), foo: () }));
    let _ = c.longname; //~ ERROR no field `longname`
    let d = Ok::<_, ()>(S { long_name: (), foo: () });
    let _ = d.long_name; //~ ERROR no field `long_name`
}