1
Fork 0
rust/tests/ui/issues/issue-24365.rs
2025-04-08 23:06:31 +03:00

19 lines
414 B
Rust

pub enum Attribute {
Code {attr_name_idx: u16},
}
pub enum Foo {
Bar
}
fn test(a: Foo) {
println!("{}", a.b); //~ ERROR no field `b` on type `Foo`
}
fn main() {
let x = Attribute::Code {
attr_name_idx: 42,
};
let z = (&x).attr_name_idx; //~ ERROR no field `attr_name_idx` on type `&Attribute`
let y = x.attr_name_idx; //~ ERROR no field `attr_name_idx` on type `Attribute`
}