]>
Commit | Line | Data |
---|---|---|
83c7162d | 1 | // Copyright 2018 The Rust Project Developers. See the COPYRIGHT |
223e47cc LB |
2 | // file at the top-level directory of this distribution and at |
3 | // http://rust-lang.org/COPYRIGHT. | |
4 | // | |
5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
8 | // option. This file may not be copied, modified, or distributed | |
9 | // except according to those terms. | |
10 | ||
94b46f34 | 11 | // compile-pass |
1a4d82fc | 12 | |
8faf50e0 XL |
13 | enum Foo { |
14 | A = 5, | |
15 | B = 42, | |
16 | } | |
17 | enum Bar { | |
18 | C = 42, | |
19 | D = 99, | |
20 | } | |
21 | union Union { | |
22 | foo: &'static Foo, | |
23 | bar: &'static Bar, | |
a1dfa0c6 | 24 | u8: &'static u8, |
83c7162d | 25 | } |
a1dfa0c6 | 26 | static BAR: u8 = 42; |
8faf50e0 | 27 | static FOO: (&Foo, &Bar) = unsafe {( |
a1dfa0c6 XL |
28 | Union { u8: &BAR }.foo, |
29 | Union { u8: &BAR }.bar, | |
8faf50e0 | 30 | )}; |
9e0c209e SL |
31 | |
32 | fn main() {} |