aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-3915.rs
blob: 7132036f92ff50ff711e538a840ffe54b440ca2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// { dg-options "-w" }
#[lang = "sized"]
trait Sized {}

trait Trait {
    fn do_thing();
}

struct MyType;

impl Trait for MyType {
    fn do_thing() {}
}

struct Wrapper<T: Trait> {
    value: T,
}

impl<T: Trait> Wrapper<T> {
    fn call_it() {
        T::do_thing();
    }
}

fn main() {
    let _ = Wrapper::<MyType> { value: MyType };
    Wrapper::<MyType>::call_it();
}