]> git.lizzy.rs Git - rust.git/blob - tests/target/struct-field-attributes.rs
Merge pull request #1829 from topecongiro/issue-1046
[rust.git] / tests / target / struct-field-attributes.rs
1 // #1535
2 #![feature(struct_field_attributes)]
3
4 struct Foo {
5     bar: u64,
6
7     #[cfg(test)] qux: u64,
8 }
9
10 fn do_something() -> Foo {
11     Foo {
12         bar: 0,
13
14         #[cfg(test)]
15         qux: 1,
16     }
17 }
18
19 fn main() {
20     do_something();
21 }
22
23 // #1462
24 struct Foo {
25     foo: usize,
26     #[cfg(feature = "include-bar")] bar: usize,
27 }
28
29 fn new_foo() -> Foo {
30     Foo {
31         foo: 0,
32         #[cfg(feature = "include-bar")]
33         bar: 0,
34     }
35 }