]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/issue-11085.rs
auto merge of #20154 : P1start/rust/qualified-assoc-type-generics, r=nikomatsakis
[rust.git] / src / test / run-pass / issue-11085.rs
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
13 struct Foo {
14     #[cfg(fail)]
15     bar: baz,
16     foo: int,
17 }
18
19 struct Foo2 {
20     #[cfg(foo)]
21     foo: int,
22 }
23
24 enum Bar1 {
25     Bar1_1,
26     #[cfg(fail)]
27     Bar1_2(NotAType),
28 }
29
30 enum Bar2 {
31     #[cfg(fail)]
32     Bar2_1(NotAType),
33 }
34
35 enum Bar3 {
36     Bar3_1 {
37         #[cfg(fail)]
38         foo: int,
39         bar: int,
40     }
41 }
42
43 pub fn main() {
44     let _f = Foo { foo: 3 };
45     let _f = Foo2 { foo: 3 };
46
47     match Bar1::Bar1_1 {
48         Bar1::Bar1_1 => {}
49     }
50
51     let _f = Bar3::Bar3_1 { bar: 3 };
52 }