parent
d5d5c5064b
commit
1c648fcea4
2 changed files with 92 additions and 1 deletions
55
src/test/run-pass/issue-11085.rs
Normal file
55
src/test/run-pass/issue-11085.rs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --cfg foo
|
||||
// xfail-fast
|
||||
|
||||
#[feature(struct_variant)];
|
||||
|
||||
struct Foo {
|
||||
#[cfg(fail)]
|
||||
bar: baz,
|
||||
foo: int,
|
||||
}
|
||||
|
||||
struct Foo2 {
|
||||
#[cfg(foo)]
|
||||
foo: int,
|
||||
}
|
||||
|
||||
enum Bar1 {
|
||||
Bar1_1,
|
||||
#[cfg(fail)]
|
||||
Bar1_2(NotAType),
|
||||
}
|
||||
|
||||
enum Bar2 {
|
||||
#[cfg(fail)]
|
||||
Bar2_1(NotAType),
|
||||
}
|
||||
|
||||
enum Bar3 {
|
||||
Bar3_1 {
|
||||
#[cfg(fail)]
|
||||
foo: int,
|
||||
bar: int,
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let _f = Foo { foo: 3 };
|
||||
let _f = Foo2 { foo: 3 };
|
||||
|
||||
match Bar1_1 {
|
||||
Bar1_1 => {}
|
||||
}
|
||||
|
||||
let _f = Bar3_1 { bar: 3 };
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue