]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
1 | // Copyright 2012-2013-2014 The Rust Project Developers. See the COPYRIGHT |
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 | ||
11 | // compile-flags: --cfg foo | |
12 | ||
c34b1796 AL |
13 | // pretty-expanded FIXME #23616 |
14 | ||
1a4d82fc JJ |
15 | struct Foo { |
16 | #[cfg(fail)] | |
17 | bar: baz, | |
c34b1796 | 18 | foo: isize, |
1a4d82fc JJ |
19 | } |
20 | ||
21 | struct Foo2 { | |
22 | #[cfg(foo)] | |
c34b1796 | 23 | foo: isize, |
1a4d82fc JJ |
24 | } |
25 | ||
26 | enum Bar1 { | |
27 | Bar1_1, | |
28 | #[cfg(fail)] | |
29 | Bar1_2(NotAType), | |
30 | } | |
31 | ||
32 | enum Bar2 { | |
33 | #[cfg(fail)] | |
34 | Bar2_1(NotAType), | |
35 | } | |
36 | ||
37 | enum Bar3 { | |
38 | Bar3_1 { | |
39 | #[cfg(fail)] | |
c34b1796 AL |
40 | foo: isize, |
41 | bar: isize, | |
1a4d82fc JJ |
42 | } |
43 | } | |
44 | ||
45 | pub fn main() { | |
46 | let _f = Foo { foo: 3 }; | |
47 | let _f = Foo2 { foo: 3 }; | |
48 | ||
49 | match Bar1::Bar1_1 { | |
50 | Bar1::Bar1_1 => {} | |
51 | } | |
52 | ||
53 | let _f = Bar3::Bar3_1 { bar: 3 }; | |
54 | } |