gcc/testsuite/rust/compile/torture/generics15.rs
raw| 1 | #[lang = "sized"] |
| 2 | pub trait Sized {} |
| 3 | |
| 4 | struct Foo<T>(T, bool); |
| 5 | |
| 6 | impl Foo<i32> { |
| 7 | fn bar(self) -> i32 { |
| 8 | self.0 |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | impl Foo<f32> { |
| 13 | fn bar(self) -> f32 { |
| 14 | self.0 |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | fn main() { |
| 19 | let a = Foo(123, true); |
| 20 | let aa = a.bar(); |
| 21 | // { dg-warning "unused name" "" { target *-*-* } .-1 } |
| 22 | |
| 23 | let b = Foo(456f32, true); |
| 24 | let bb = b.bar(); |
| 25 | // { dg-warning "unused name" "" { target *-*-* } .-1 } |
| 26 | } |