aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/torture/generics7.rs
blob: 66454d6166dcecda4ef847489d413d19e561a049 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[lang = "sized"]
pub trait Sized {}

struct Foo<T>(T);

struct Bar {
    a: Foo<i32>,
    b: bool,
// { dg-warning "field is never read" "" { target *-*-* } .-1 }
}

fn main() {
    let a = Foo::<i32>(123);
    let b: Bar = Bar { a: a, b: true };
    let c: i32 = b.a.0;
    // { dg-warning "unused name" "" { target *-*-* } .-1 }
}