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

fn main() {
    let a = Foo { a: 1, b: 2 };
    let b = Foo { a: 1, ..a };
    // { dg-warning "unused name" "" { target *-*-* } .-1 }
}