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

trait Foo<T> {
    fn foo(self) -> T;
}

struct Bar<T, U> {
    // { dg-warning "struct is never constructed" "" { target *-*-* } .-1 }
    value: U,
    valte: T,
}

impl<T: Foo<U>, U> Foo<U> for Bar<T, U> {
    fn foo(self) -> U {
        self.value
    }
}