]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/union-inherent-method.rs
Don't access pointer element type for nontemporal store
[rust.git] / src / test / ui / union / union-inherent-method.rs
1 // run-pass
2
3 union U {
4     a: u8,
5 }
6
7 impl U {
8     fn method(&self) -> u8 { unsafe { self.a } }
9 }
10
11 fn main() {
12     let u = U { a: 10 };
13     assert_eq!(u.method(), 10);
14 }