os-rust/tests/ui/union/union-inherent-method.rs
Matthew Jasper 982b49494e Remove revisions for THIR unsafeck
This is to make the diff when stabilizing it easier to review.
2024-01-05 09:30:27 +00:00

14 lines
169 B
Rust

// run-pass
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);
}