Debian Codegraph @

gcc/testsuite/rust/compile/issue-1034.rs

raw
1 #[lang = "sized"]
2 pub trait Sized {}
3
4 trait Foo<T> {
5 type Output;
6
7 fn test(self, slice: &T) -> &Self::Output;
8 }
9
10 struct Bar<T>(T);
11 // { dg-warning "struct is never constructed" "" { target *-*-* } .-1 }
12
13 impl<T> Foo<[T]> for Bar<usize> {
14 type Output = [T];
15
16 fn test(self, slice: &[T]) -> &[T] {
17 slice
18 }
19 }