blob: 8473d49587ba6d504b675c08433779d64135984b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
struct Foo<T>(T);
struct Bar<T> {
a: Foo<T>,
b: bool,
// { dg-warning "field is never read" "" { target *-*-* } .-1 }
}
fn test<T>(a: Bar<T>) -> Foo<T> {
a.a
}
fn main() {
let a: Bar<i32> = Bar::<i32> {
a: Foo::<i32>(123),
b: true,
};
let b: Foo<i32> = test(a);
// { dg-warning "unused name" "" { target *-*-* } .-1 }
}
|