gcc/testsuite/rust/compile/torture/generics27.rs
raw| 1 | #[lang = "sized"] |
| 2 | pub trait Sized {} |
| 3 | |
| 4 | // github issue #415 |
| 5 | fn test<A>(a: &A) -> &A { |
| 6 | a |
| 7 | } |
| 8 | |
| 9 | fn main() { |
| 10 | let a = 123; |
| 11 | let b = &a; |
| 12 | let c = test(b); |
| 13 | // { dg-warning "unused name" "" { target *-*-* } .-1 } |
| 14 | |
| 15 | let a = 123f32; |
| 16 | let b = &a; |
| 17 | let c = test(b); |
| 18 | // { dg-warning "unused name" "" { target *-*-* } .-1 } |
| 19 | } |