aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-1034.rs
blob: d40005ec5d97e19903d743e8b90c3b4a476bbc19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#[lang = "sized"]
pub trait Sized {}

trait Foo<T> {
    type Output;

    fn test(self, slice: &T) -> &Self::Output;
}

struct Bar<T>(T);
// { dg-warning "struct is never constructed" "" { target *-*-* } .-1 }

impl<T> Foo<[T]> for Bar<usize> {
    type Output = [T];

    fn test(self, slice: &[T]) -> &[T] {
        slice
    }
}