summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-24365.rs
blob: eca104b6f1d89236834517e91165530dfe8c2de0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
pub enum Attribute {
    Code {attr_name_idx: u16},
}

pub enum Foo {
    Bar
}

fn test(a: Foo) {
    println!("{}", a.b); //~ no field `b` on type `Foo`
}

fn main() {
    let x = Attribute::Code {
        attr_name_idx: 42,
    };
    let z = (&x).attr_name_idx; //~ no field `attr_name_idx` on type `&Attribute`
    let y = x.attr_name_idx; //~ no field `attr_name_idx` on type `Attribute`
}