@@ -278,14 +278,30 @@ LL | let _ = cf as *const dyn Bar;
278
278
|
279
279
= note: vtable kinds may not match
280
280
281
- error[E0606]: casting `*const dyn Foo` as `*const dyn Send` is invalid
281
+ error[E0606]: casting `*const dyn Foo` as `*const dyn Foo + Send` is invalid
282
282
--> $DIR/fat-ptr-cast.rs:85:13
283
283
|
284
+ LL | let _ = cf as *const (dyn Foo + Send);
285
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
286
+ |
287
+ = note: vtable kinds may not match
288
+
289
+ error[E0606]: casting `*const dyn Foo` as `*const dyn Send` is invalid
290
+ --> $DIR/fat-ptr-cast.rs:88:13
291
+ |
284
292
LL | let _ = cf as *const dyn Send;
285
293
| ^^^^^^^^^^^^^^^^^^^^^
286
294
|
287
295
= note: vtable kinds may not match
288
296
297
+ error[E0606]: casting `*mut dyn Send` as `*mut dyn Sync` is invalid
298
+ --> $DIR/fat-ptr-cast.rs:93:13
299
+ |
300
+ LL | let _ = unprincipled as *mut dyn Sync;
301
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
302
+ |
303
+ = note: vtable kinds may not match
304
+
289
305
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
290
306
--> $DIR/fat-ptr-cast.rs:66:13
291
307
|
@@ -305,7 +321,7 @@ LL | let _ = a as *const dyn Foo;
305
321
= note: required for the cast from `*const str` to `*const dyn Foo`
306
322
307
323
error[E0606]: casting `&{float}` as `f32` is invalid
308
- --> $DIR/fat-ptr-cast.rs:87 :30
324
+ --> $DIR/fat-ptr-cast.rs:95 :30
309
325
|
310
326
LL | vec![0.0].iter().map(|s| s as f32).collect::<Vec<f32>>();
311
327
| ^^^^^^^^
@@ -316,30 +332,38 @@ LL | vec![0.0].iter().map(|s| *s as f32).collect::<Vec<f32>>();
316
332
| +
317
333
318
334
error[E0606]: cannot cast `usize` to a pointer that may be wide
319
- --> $DIR/fat-ptr-cast.rs:91 :18
335
+ --> $DIR/fat-ptr-cast.rs:99 :18
320
336
|
321
337
LL | let s = 0 as *const T;
322
338
| - ^^^^^^^^ creating a `*const T` requires both an address and type-specific metadata
323
339
| |
324
340
| consider casting this expression to `*const ()`, then using `core::ptr::from_raw_parts`
325
341
326
342
error[E0606]: casting `*const U` as `*const V` is invalid
327
- --> $DIR/fat-ptr-cast.rs:97 :5
343
+ --> $DIR/fat-ptr-cast.rs:105 :5
328
344
|
329
345
LL | u as *const V
330
346
| ^^^^^^^^^^^^^
331
347
|
332
348
= note: vtable kinds may not match
333
349
334
350
error[E0606]: casting `*const U` as `*const str` is invalid
335
- --> $DIR/fat-ptr-cast.rs:102 :5
351
+ --> $DIR/fat-ptr-cast.rs:110 :5
336
352
|
337
353
LL | u as *const str
338
354
| ^^^^^^^^^^^^^^^
339
355
|
340
356
= note: vtable kinds may not match
341
357
342
- error: aborting due to 46 previous errors
358
+ error[E0606]: casting `*const (dyn TypeParam<T> + 'static)` as `*const dyn TypeParam<U>` is invalid
359
+ --> $DIR/fat-ptr-cast.rs:115:5
360
+ |
361
+ LL | ptr as _
362
+ | ^^^^^^^^
363
+ |
364
+ = note: vtable kinds may not match
365
+
366
+ error: aborting due to 49 previous errors
343
367
344
368
Some errors have detailed explanations: E0054, E0277, E0604, E0605, E0606, E0607, E0609.
345
369
For more information about an error, try `rustc --explain E0054`.
0 commit comments