]> git.lizzy.rs Git - rust.git/blob - tests/target/struct-field-attributes.rs
Tidy up and pass tests
[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)]
8     qux: u64,
9 }
10
11 fn do_something() -> Foo {
12     Foo {
13         bar: 0,
14
15         #[cfg(test)]
16         qux: 1,
17     }
18 }
19
20 fn main() {
21     do_something();
22 }
23
24 // #1462
25 struct Foo {
26     foo: usize,
27     #[cfg(feature = "include-bar")]
28     bar: usize,
29 }
30
31 fn new_foo() -> Foo {
32     Foo {
33         foo: 0,
34         #[cfg(feature = "include-bar")]
35         bar: 0,
36     }
37 }
38
39 // #2044
40 pub enum State {
41     Closure(
42         #[cfg_attr(feature = "serde_derive", serde(state_with = "::serialization::closure"))]
43         GcPtr<ClosureData>,
44     ),
45 }
46
47 struct Fields(
48     #[cfg_attr(feature = "serde_derive", serde(state_with = "::base::serialization::shared"))]
49     Arc<Vec<InternedStr>>,
50 );
51
52 // #2309
53 pub struct A {
54     #[doc = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"]
55     pub foos: Vec<bool>,
56 }