summaryrefslogtreecommitdiffstats
path: root/src/test/ui/suggestions/adt-param-with-implicit-sized-bound.rs
blob: ef64d799b65cfcbd374320406dee2b2cd33eef8f (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
trait Trait {
    fn func1() -> Struct1<Self>; //~ ERROR E0277
    fn func2<'a>() -> Struct2<'a, Self>; //~ ERROR E0277
    fn func3() -> Struct3<Self>; //~ ERROR E0277
    fn func4() -> Struct4<Self>; //~ ERROR E0277
}

struct Struct1<T>{
    _t: std::marker::PhantomData<*const T>,
}
struct Struct2<'a, T>{
    _t: &'a T,
}
struct Struct3<T>{
    _t: T,
}

struct X<T>(T);

struct Struct4<T>{
    _t: X<T>,
}

struct Struct5<T: ?Sized>{
    _t: X<T>, //~ ERROR E0277
}

fn main() {}