]>
Commit | Line | Data |
---|---|---|
29967ef6 | 1 | error[E0226]: only a single explicit lifetime bound is permitted |
6a06907d | 2 | --> $DIR/not-on-struct.rs:25:25 |
29967ef6 XL |
3 | | |
4 | LL | fn e() -> 'static + A + 'static { | |
5 | | ^^^^^^^ | |
6 | ||
7 | error[E0226]: only a single explicit lifetime bound is permitted | |
6a06907d | 8 | --> $DIR/not-on-struct.rs:29:53 |
29967ef6 XL |
9 | | |
10 | LL | fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) { | |
11 | | ^^ | |
12 | ||
b7449926 | 13 | error[E0404]: expected trait, found struct `Foo` |
6a06907d | 14 | --> $DIR/not-on-struct.rs:8:16 |
b7449926 | 15 | | |
532ac7d7 | 16 | LL | fn foo(_x: Box<Foo + Send>) { } |
b7449926 | 17 | | ^^^ not a trait |
29967ef6 XL |
18 | | |
19 | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way | |
6a06907d | 20 | --> $DIR/not-on-struct.rs:8:22 |
29967ef6 XL |
21 | | |
22 | LL | fn foo(_x: Box<Foo + Send>) { } | |
23 | | --- ^^^^ ...because of this bound | |
24 | | | | |
25 | | expected this type to be a trait... | |
b7449926 XL |
26 | |
27 | error[E0404]: expected trait, found struct `Vec` | |
6a06907d | 28 | --> $DIR/not-on-struct.rs:10:29 |
29967ef6 XL |
29 | | |
30 | LL | type TypeAlias<T> = Box<dyn Vec<T>>; | |
31 | | ^^^^^^ not a trait | |
32 | ||
33 | error[E0404]: expected trait, found struct `A` | |
6a06907d | 34 | --> $DIR/not-on-struct.rs:13:11 |
29967ef6 XL |
35 | | |
36 | LL | fn a() -> A + 'static { | |
37 | | ^ not a trait | |
38 | | | |
39 | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way | |
6a06907d | 40 | --> $DIR/not-on-struct.rs:13:15 |
29967ef6 XL |
41 | | |
42 | LL | fn a() -> A + 'static { | |
43 | | - ^^^^^^^ ...because of this bound | |
44 | | | | |
45 | | expected this type to be a trait... | |
46 | help: if you meant to use a type and not a trait here, remove the bounds | |
47 | | | |
94222f64 XL |
48 | LL - fn a() -> A + 'static { |
49 | LL + fn a() -> A { | |
923072b8 | 50 | | |
29967ef6 XL |
51 | |
52 | error[E0404]: expected trait, found enum `Result` | |
6a06907d | 53 | --> $DIR/not-on-struct.rs:16:34 |
29967ef6 XL |
54 | | |
55 | LL | fn b<'a,T,E>(iter: Iterator<Item=Result<T,E> + 'a>) { | |
56 | | ^^^^^^^^^^^ not a trait | |
57 | | | |
58 | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way | |
6a06907d | 59 | --> $DIR/not-on-struct.rs:16:48 |
29967ef6 XL |
60 | | |
61 | LL | fn b<'a,T,E>(iter: Iterator<Item=Result<T,E> + 'a>) { | |
62 | | ----------- ^^ ...because of this bound | |
63 | | | | |
64 | | expected this type to be a trait... | |
65 | help: if you meant to use a type and not a trait here, remove the bounds | |
66 | | | |
94222f64 XL |
67 | LL - fn b<'a,T,E>(iter: Iterator<Item=Result<T,E> + 'a>) { |
68 | LL + fn b<'a,T,E>(iter: Iterator<Item=Result<T,E>>) { | |
923072b8 | 69 | | |
29967ef6 XL |
70 | |
71 | error[E0404]: expected trait, found struct `A` | |
6a06907d | 72 | --> $DIR/not-on-struct.rs:19:21 |
29967ef6 XL |
73 | | |
74 | LL | fn c() -> 'static + A { | |
75 | | ^ not a trait | |
76 | | | |
77 | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way | |
6a06907d | 78 | --> $DIR/not-on-struct.rs:19:11 |
29967ef6 XL |
79 | | |
80 | LL | fn c() -> 'static + A { | |
81 | | ^^^^^^^ - expected this type to be a trait... | |
82 | | | | |
83 | | ...because of this bound | |
84 | help: if you meant to use a type and not a trait here, remove the bounds | |
85 | | | |
94222f64 XL |
86 | LL - fn c() -> 'static + A { |
87 | LL + fn c() -> A { | |
923072b8 | 88 | | |
29967ef6 XL |
89 | |
90 | error[E0404]: expected trait, found enum `Result` | |
6a06907d | 91 | --> $DIR/not-on-struct.rs:22:39 |
29967ef6 XL |
92 | | |
93 | LL | fn d<'a,T,E>(iter: Iterator<Item='a + Result<T,E>>) { | |
94 | | ^^^^^^^^^^^ not a trait | |
95 | | | |
96 | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way | |
6a06907d | 97 | --> $DIR/not-on-struct.rs:22:34 |
29967ef6 XL |
98 | | |
99 | LL | fn d<'a,T,E>(iter: Iterator<Item='a + Result<T,E>>) { | |
100 | | ^^ ----------- expected this type to be a trait... | |
101 | | | | |
102 | | ...because of this bound | |
103 | help: if you meant to use a type and not a trait here, remove the bounds | |
104 | | | |
94222f64 XL |
105 | LL - fn d<'a,T,E>(iter: Iterator<Item='a + Result<T,E>>) { |
106 | LL + fn d<'a,T,E>(iter: Iterator<Item=Result<T,E>>) { | |
923072b8 | 107 | | |
29967ef6 XL |
108 | |
109 | error[E0404]: expected trait, found struct `A` | |
6a06907d | 110 | --> $DIR/not-on-struct.rs:25:21 |
29967ef6 XL |
111 | | |
112 | LL | fn e() -> 'static + A + 'static { | |
113 | | ^ not a trait | |
114 | | | |
115 | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way | |
6a06907d | 116 | --> $DIR/not-on-struct.rs:25:11 |
29967ef6 XL |
117 | | |
118 | LL | fn e() -> 'static + A + 'static { | |
119 | | ^^^^^^^ - ^^^^^^^ ...because of these bounds | |
120 | | | | |
121 | | expected this type to be a trait... | |
122 | help: if you meant to use a type and not a trait here, remove the bounds | |
123 | | | |
94222f64 XL |
124 | LL - fn e() -> 'static + A + 'static { |
125 | LL + fn e() -> A { | |
923072b8 | 126 | | |
29967ef6 XL |
127 | |
128 | error[E0404]: expected trait, found enum `Result` | |
6a06907d | 129 | --> $DIR/not-on-struct.rs:29:39 |
29967ef6 XL |
130 | | |
131 | LL | fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) { | |
132 | | ^^^^^^^^^^^ not a trait | |
133 | | | |
134 | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way | |
6a06907d | 135 | --> $DIR/not-on-struct.rs:29:34 |
29967ef6 XL |
136 | | |
137 | LL | fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) { | |
138 | | ^^ ----------- ^^ ...because of these bounds | |
139 | | | | |
140 | | expected this type to be a trait... | |
141 | help: if you meant to use a type and not a trait here, remove the bounds | |
142 | | | |
94222f64 XL |
143 | LL - fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) { |
144 | LL + fn f<'a,T,E>(iter: Iterator<Item=Result<T,E>>) { | |
923072b8 | 145 | | |
29967ef6 XL |
146 | |
147 | error[E0404]: expected trait, found struct `Traitor` | |
6a06907d | 148 | --> $DIR/not-on-struct.rs:35:11 |
29967ef6 XL |
149 | | |
150 | LL | trait Trait {} | |
151 | | ----------- similarly named trait `Trait` defined here | |
152 | LL | fn g() -> Traitor + 'static { | |
153 | | ^^^^^^^ not a trait | |
154 | | | |
155 | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way | |
6a06907d | 156 | --> $DIR/not-on-struct.rs:35:21 |
29967ef6 XL |
157 | | |
158 | LL | fn g() -> Traitor + 'static { | |
159 | | ------- ^^^^^^^ ...because of this bound | |
160 | | | | |
161 | | expected this type to be a trait... | |
162 | help: if you meant to use a type and not a trait here, remove the bounds | |
163 | | | |
94222f64 XL |
164 | LL - fn g() -> Traitor + 'static { |
165 | LL + fn g() -> Traitor { | |
923072b8 | 166 | | |
29967ef6 | 167 | help: a trait with a similar name exists |
b7449926 | 168 | | |
29967ef6 | 169 | LL | fn g() -> Trait + 'static { |
94222f64 | 170 | | ~~~~~ |
b7449926 | 171 | |
29967ef6 | 172 | error: aborting due to 11 previous errors |
b7449926 | 173 | |
29967ef6 XL |
174 | Some errors have detailed explanations: E0226, E0404. |
175 | For more information about an error, try `rustc --explain E0226`. |