forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtilde-const-invalid-places.stderr
310 lines (279 loc) · 10.5 KB
/
tilde-const-invalid-places.stderr
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:7:26
|
LL | fn non_const_function<T: ~const Trait>() {}
| ^^^^^^
|
note: this function is not `const`, so it cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:7:4
|
LL | fn non_const_function<T: ~const Trait>() {}
| ^^^^^^^^^^^^^^^^^^
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:9:18
|
LL | struct Struct<T: ~const Trait> { field: T }
| ^^^^^^
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:10:23
|
LL | struct TupleStruct<T: ~const Trait>(T);
| ^^^^^^
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:11:22
|
LL | struct UnitStruct<T: ~const Trait>;
| ^^^^^^
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:14:14
|
LL | enum Enum<T: ~const Trait> { Variant(T) }
| ^^^^^^
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:16:16
|
LL | union Union<T: ~const Trait> { field: T }
| ^^^^^^
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:19:14
|
LL | type Type<T: ~const Trait> = T;
| ^^^^^^
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:21:19
|
LL | const CONSTANT<T: ~const Trait>: () = ();
| ^^^^^^
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:25:18
|
LL | type Type<T: ~const Trait>: ~const Trait;
| ^^^^^^
|
note: associated types in non-`#[const_trait]` traits cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:25:5
|
LL | type Type<T: ~const Trait>: ~const Trait;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:25:33
|
LL | type Type<T: ~const Trait>: ~const Trait;
| ^^^^^^
|
note: associated types in non-`#[const_trait]` traits cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:25:5
|
LL | type Type<T: ~const Trait>: ~const Trait;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:28:30
|
LL | fn non_const_function<T: ~const Trait>();
| ^^^^^^
|
note: this function is not `const`, so it cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:28:8
|
LL | fn non_const_function<T: ~const Trait>();
| ^^^^^^^^^^^^^^^^^^
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:29:23
|
LL | const CONSTANT<T: ~const Trait>: ();
| ^^^^^^
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:34:18
|
LL | type Type<T: ~const Trait> = ();
| ^^^^^^
|
note: associated types in non-const impls cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:34:5
|
LL | type Type<T: ~const Trait> = ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:36:30
|
LL | fn non_const_function<T: ~const Trait>() {}
| ^^^^^^
|
note: this function is not `const`, so it cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:36:8
|
LL | fn non_const_function<T: ~const Trait>() {}
| ^^^^^^^^^^^^^^^^^^
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:37:23
|
LL | const CONSTANT<T: ~const Trait>: () = ();
| ^^^^^^
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:44:18
|
LL | type Type<T: ~const Trait> = ();
| ^^^^^^
|
note: inherent associated types cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:44:5
|
LL | type Type<T: ~const Trait> = ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:46:30
|
LL | fn non_const_function<T: ~const Trait>() {}
| ^^^^^^
|
note: this function is not `const`, so it cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:46:8
|
LL | fn non_const_function<T: ~const Trait>() {}
| ^^^^^^^^^^^^^^^^^^
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:47:23
|
LL | const CONSTANT<T: ~const Trait>: () = ();
| ^^^^^^
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:52:15
|
LL | trait Child0: ~const Trait {}
| ^^^^^^
|
note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:52:1
|
LL | trait Child0: ~const Trait {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:53:26
|
LL | trait Child1 where Self: ~const Trait {}
| ^^^^^^
|
note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:53:1
|
LL | trait Child1 where Self: ~const Trait {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:56:9
|
LL | impl<T: ~const Trait> Trait for T {}
| ^^^^^^
|
note: this impl is not `const`, so it cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:56:1
|
LL | impl<T: ~const Trait> Trait for T {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:59:9
|
LL | impl<T: ~const Trait> Struct<T> {}
| ^^^^^^
|
note: inherent impls cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:59:1
|
LL | impl<T: ~const Trait> Struct<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0658]: generic const items are experimental
--> $DIR/tilde-const-invalid-places.rs:21:15
|
LL | const CONSTANT<T: ~const Trait>: () = ();
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
= help: add `#![feature(generic_const_items)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: generic const items are experimental
--> $DIR/tilde-const-invalid-places.rs:29:19
|
LL | const CONSTANT<T: ~const Trait>: ();
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
= help: add `#![feature(generic_const_items)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: generic const items are experimental
--> $DIR/tilde-const-invalid-places.rs:37:19
|
LL | const CONSTANT<T: ~const Trait>: () = ();
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
= help: add `#![feature(generic_const_items)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: generic const items are experimental
--> $DIR/tilde-const-invalid-places.rs:47:19
|
LL | const CONSTANT<T: ~const Trait>: () = ();
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
= help: add `#![feature(generic_const_items)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0392]: type parameter `T` is never used
--> $DIR/tilde-const-invalid-places.rs:11:19
|
LL | struct UnitStruct<T: ~const Trait>;
| ^ unused type parameter
|
= help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
--> $DIR/tilde-const-invalid-places.rs:16:32
|
LL | union Union<T: ~const Trait> { field: T }
| ^^^^^^^^
|
= note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
help: wrap the field type in `ManuallyDrop<...>`
|
LL | union Union<T: ~const Trait> { field: std::mem::ManuallyDrop<T> }
| +++++++++++++++++++++++ +
error[E0275]: overflow evaluating the requirement `(): Trait`
--> $DIR/tilde-const-invalid-places.rs:34:34
|
LL | type Type<T: ~const Trait> = ();
| ^^
|
note: required by a bound in `NonConstTrait::Type`
--> $DIR/tilde-const-invalid-places.rs:25:33
|
LL | type Type<T: ~const Trait>: ~const Trait;
| ^^^^^^^^^^^^ required by this bound in `NonConstTrait::Type`
error[E0658]: inherent associated types are unstable
--> $DIR/tilde-const-invalid-places.rs:44:5
|
LL | type Type<T: ~const Trait> = ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information
= help: add `#![feature(inherent_associated_types)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error: aborting due to 30 previous errors
Some errors have detailed explanations: E0275, E0392, E0658, E0740.
For more information about an error, try `rustc --explain E0275`.