gcc/testsuite/rust/compile/traits12.rs
raw| 1 | #[lang = "sized"] |
| 2 | pub trait Sized {} |
| 3 | |
| 4 | trait A<T> { |
| 5 | type Output; |
| 6 | |
| 7 | fn test(self, a: &T) -> &Self::Output; |
| 8 | } |
| 9 | |
| 10 | struct Foo<T> { |
| 11 | start: T, |
| 12 | end: T, |
| 13 | } |
| 14 | |
| 15 | impl<T> A for Foo<usize> { |
| 16 | // { dg-error "generic item takes at least 2 type arguments but 1 were supplied" "" { target *-*-* } .-1 } |
| 17 | // { dg-error "unconstrained type parameter" "" { target *-*-* } .-2 } |
| 18 | type Output = T; |
| 19 | |
| 20 | fn test(self, a: &T) -> &Self::Output { |
| 21 | a |
| 22 | } |
| 23 | } |