gcc/testsuite/rust/compile/issue-3022.rs
raw| 1 | #[lang = "sized"] |
| 2 | trait Sized {} |
| 3 | |
| 4 | trait Foo<T> { |
| 5 | fn foo(self) -> T; |
| 6 | } |
| 7 | |
| 8 | struct Bar<T, U> { |
| 9 | // { dg-warning "struct is never constructed" "" { target *-*-* } .-1 } |
| 10 | value: U, |
| 11 | valte: T, |
| 12 | } |
| 13 | |
| 14 | impl<T: Foo<U>, U> Foo<U> for Bar<T, U> { |
| 15 | fn foo(self) -> U { |
| 16 | self.value |
| 17 | } |
| 18 | } |