trait Foo { type Output; fn test(self, slice: &T) -> &Self::Output; } struct Bar(T); // { dg-warning "struct is never constructed" "" { target *-*-* } .-1 } impl Foo<[T]> for Bar { type Output = [T]; fn test(self, slice: &[T]) -> &[T] { slice } }