gcc/testsuite/rust/compile/issue-2166.rs
raw| 1 | #[lang = "sized"] |
| 2 | pub trait Sized {} |
| 3 | |
| 4 | trait Add { |
| 5 | type Output; |
| 6 | |
| 7 | fn add(self) -> u32; |
| 8 | } |
| 9 | |
| 10 | impl Add for u32 { |
| 11 | type Output = u32; |
| 12 | |
| 13 | fn add(self) -> u32 { |
| 14 | // { dg-warning "unused name" "" { target *-*-* } .-1 } |
| 15 | 0 |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | impl<'a> Add for &'a u32 { |
| 20 | type Output = u32; |
| 21 | |
| 22 | fn add(self) -> <u32 as Add>::Output { |
| 23 | // { dg-warning "unused name" "" { target *-*-* } .-1 } |
| 24 | 0 |
| 25 | } |
| 26 | } |