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

trait A<T> {
    type Output;

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

struct Foo<T> {
    // { dg-warning "struct is never constructed" "" { target *-*-* } .-1 }
    start: T,
    end: T,
}

impl<X> A<X> for Foo<usize> {
    type Output = X;

    fn test(self, a: &X) -> &Self::Output {
        a
    }
}