summaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/torture/struct_base_init_1.rs
blob: ee00c2c468b0c6289445230fa5fc9051acb4ada1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
struct Foo {
    a: i32,
// { dg-warning "field is never read" "" { target *-*-* } .-1 }
    b: i32,
}

fn foo() -> Foo {
    Foo { a: 42, b: 32 }
}

fn main() {
    let _f = Foo { a: 10, ..foo() };
}