summaryrefslogtreecommitdiffstats
path: root/src/test/ui/traits/bound/not-on-struct.stderr
blob: 2de35dc7fc37603a9fdb801d65dc7571f0ee7e78 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
error[E0226]: only a single explicit lifetime bound is permitted
  --> $DIR/not-on-struct.rs:25:25
   |
LL | fn e() -> 'static + A + 'static {
   |                         ^^^^^^^

error[E0226]: only a single explicit lifetime bound is permitted
  --> $DIR/not-on-struct.rs:29:53
   |
LL | fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) {
   |                                                     ^^

error[E0404]: expected trait, found struct `Foo`
  --> $DIR/not-on-struct.rs:8:16
   |
LL | fn foo(_x: Box<Foo + Send>) { }
   |                ^^^ not a trait
   |
help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
  --> $DIR/not-on-struct.rs:8:22
   |
LL | fn foo(_x: Box<Foo + Send>) { }
   |                ---   ^^^^ ...because of this bound
   |                |
   |                expected this type to be a trait...

error[E0404]: expected trait, found struct `Vec`
  --> $DIR/not-on-struct.rs:10:29
   |
LL | type TypeAlias<T> = Box<dyn Vec<T>>;
   |                             ^^^^^^ not a trait

error[E0404]: expected trait, found struct `A`
  --> $DIR/not-on-struct.rs:13:11
   |
LL | fn a() -> A + 'static {
   |           ^ not a trait
   |
help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
  --> $DIR/not-on-struct.rs:13:15
   |
LL | fn a() -> A + 'static {
   |           -   ^^^^^^^ ...because of this bound
   |           |
   |           expected this type to be a trait...
help: if you meant to use a type and not a trait here, remove the bounds
   |
LL - fn a() -> A + 'static {
LL + fn a() -> A {
   |

error[E0404]: expected trait, found enum `Result`
  --> $DIR/not-on-struct.rs:16:34
   |
LL | fn b<'a,T,E>(iter: Iterator<Item=Result<T,E> + 'a>) {
   |                                  ^^^^^^^^^^^ not a trait
   |
help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
  --> $DIR/not-on-struct.rs:16:48
   |
LL | fn b<'a,T,E>(iter: Iterator<Item=Result<T,E> + 'a>) {
   |                                  -----------   ^^ ...because of this bound
   |                                  |
   |                                  expected this type to be a trait...
help: if you meant to use a type and not a trait here, remove the bounds
   |
LL - fn b<'a,T,E>(iter: Iterator<Item=Result<T,E> + 'a>) {
LL + fn b<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
   |

error[E0404]: expected trait, found struct `A`
  --> $DIR/not-on-struct.rs:19:21
   |
LL | fn c() -> 'static + A {
   |                     ^ not a trait
   |
help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
  --> $DIR/not-on-struct.rs:19:11
   |
LL | fn c() -> 'static + A {
   |           ^^^^^^^   - expected this type to be a trait...
   |           |
   |           ...because of this bound
help: if you meant to use a type and not a trait here, remove the bounds
   |
LL - fn c() -> 'static + A {
LL + fn c() -> A {
   |

error[E0404]: expected trait, found enum `Result`
  --> $DIR/not-on-struct.rs:22:39
   |
LL | fn d<'a,T,E>(iter: Iterator<Item='a + Result<T,E>>) {
   |                                       ^^^^^^^^^^^ not a trait
   |
help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
  --> $DIR/not-on-struct.rs:22:34
   |
LL | fn d<'a,T,E>(iter: Iterator<Item='a + Result<T,E>>) {
   |                                  ^^   ----------- expected this type to be a trait...
   |                                  |
   |                                  ...because of this bound
help: if you meant to use a type and not a trait here, remove the bounds
   |
LL - fn d<'a,T,E>(iter: Iterator<Item='a + Result<T,E>>) {
LL + fn d<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
   |

error[E0404]: expected trait, found struct `A`
  --> $DIR/not-on-struct.rs:25:21
   |
LL | fn e() -> 'static + A + 'static {
   |                     ^ not a trait
   |
help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
  --> $DIR/not-on-struct.rs:25:11
   |
LL | fn e() -> 'static + A + 'static {
   |           ^^^^^^^   -   ^^^^^^^ ...because of these bounds
   |                     |
   |                     expected this type to be a trait...
help: if you meant to use a type and not a trait here, remove the bounds
   |
LL - fn e() -> 'static + A + 'static {
LL + fn e() -> A {
   |

error[E0404]: expected trait, found enum `Result`
  --> $DIR/not-on-struct.rs:29:39
   |
LL | fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) {
   |                                       ^^^^^^^^^^^ not a trait
   |
help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
  --> $DIR/not-on-struct.rs:29:34
   |
LL | fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) {
   |                                  ^^   -----------   ^^ ...because of these bounds
   |                                       |
   |                                       expected this type to be a trait...
help: if you meant to use a type and not a trait here, remove the bounds
   |
LL - fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) {
LL + fn f<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
   |

error[E0404]: expected trait, found struct `Traitor`
  --> $DIR/not-on-struct.rs:35:11
   |
LL | trait Trait {}
   | ----------- similarly named trait `Trait` defined here
LL | fn g() -> Traitor + 'static {
   |           ^^^^^^^ not a trait
   |
help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way
  --> $DIR/not-on-struct.rs:35:21
   |
LL | fn g() -> Traitor + 'static {
   |           -------   ^^^^^^^ ...because of this bound
   |           |
   |           expected this type to be a trait...
help: if you meant to use a type and not a trait here, remove the bounds
   |
LL - fn g() -> Traitor + 'static {
LL + fn g() -> Traitor {
   |
help: a trait with a similar name exists
   |
LL | fn g() -> Trait + 'static {
   |           ~~~~~

error: aborting due to 11 previous errors

Some errors have detailed explanations: E0226, E0404.
For more information about an error, try `rustc --explain E0226`.