]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/union-inherent-method.rs
Merge commit 'b20d4c155d2fe3a8391f86dcf9a8c49e17188703' into clippyup
[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 }