summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/bound/on-structs-and-enums.rs
blob: 024084fa724f1efe7f52e2b071361d63e5126d63 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
trait Trait {}

struct Foo<T:Trait> {
    x: T,
}

enum Bar<T:Trait> {
    ABar(isize),
    BBar(T),
    CBar(usize),
}

impl<T> Foo<T> {
//~^ ERROR `T: Trait` is not satisfied
    fn uhoh() {}
}

struct Baz {
    a: Foo<isize>, //~ ERROR E0277
}

enum Boo {
    Quux(Bar<usize>), //~ ERROR E0277
}

struct Badness<U> {
    b: Foo<U>, //~ ERROR E0277
}

enum MoreBadness<V> {
    EvenMoreBadness(Bar<V>), //~ ERROR E0277
}

struct TupleLike(
    Foo<i32>, //~ ERROR E0277
);

enum Enum {
    DictionaryLike { field: Bar<u8> }, //~ ERROR E0277
}

fn main() {
}