blob: 86a62ff18cd3d75c841f9c0b831b6595da43c1c4 [file]
//@ run-pass
//@ reference: items.impl.inherent.associated-items.allowed-items
union U {
a: u8,
}
impl U {
fn method(&self) -> u8 { unsafe { self.a } }
}
fn main() {
let u = U { a: 10 };
assert_eq!(u.method(), 10);
}