aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/struct_expr_field_attributes.rs
blob: b5d65dc4bb65b8f62b05e7f76f204e21363f4ac8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
pub struct Test {
    #[cfg(not(any(
        target_os = "solaris",
        target_os = "illumos",
        target_os = "fuchsia",
        target_os = "redox",
    )))]
    value: bool,
    // { dg-warning "field is never read" "" { target *-*-* } .-1 }
}

pub fn test() -> Test {
    Test {
        #[cfg(not(any(
            target_os = "solaris",
            target_os = "illumos",
            target_os = "fuchsia",
            target_os = "redox",
        )))]
        value: false,
    }
}