You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 28, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: tests/ui/cast/ptr-to-trait-obj-different-args.stderr
+14-27Lines changed: 14 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -4,53 +4,40 @@ error[E0606]: casting `*const dyn A` as `*const dyn B` is invalid
4
4
LL | let b: *const dyn B = a as _;
5
5
| ^^^^^^
6
6
|
7
-
= note: vtable kinds may not match
7
+
= note: the trait objects may have different vtables
8
8
9
-
error[E0308]: mismatched types
9
+
error[E0606]: casting `*const dyn Trait<X>` as `*const dyn Trait<Y>` is invalid
10
10
--> $DIR/ptr-to-trait-obj-different-args.rs:21:34
11
11
|
12
12
LL | let y: *const dyn Trait<Y> = x as _;
13
-
| ^^^^^^ expected `X`, found `Y`
13
+
| ^^^^^^
14
14
|
15
-
= note: expected trait object `dyn Trait<X>`
16
-
found trait object `dyn Trait<Y>`
17
-
= help: `dyn Trait<Y>` implements `Trait` so you could box the found value and coerce it to the trait object `Box<dyn Trait>`, you will have to change the expected type as well
15
+
= note: the trait objects may have different vtables
18
16
19
-
error[E0308]: mismatched types
17
+
error[E0606]: casting `*const (dyn Trait<X> + 'static)` as `*const dyn Trait<T>` is invalid
= help: `dyn Trait<T>` implements `Trait` so you could box the found value and coerce it to the trait object `Box<dyn Trait>`, you will have to change the expected type as well
23
+
= note: the trait objects may have different vtables
30
24
31
-
error[E0308]: mismatched types
25
+
error[E0606]: casting `*const (dyn Trait<T> + 'static)` as `*const dyn Trait<X>` is invalid
= help: `dyn Trait<X>` implements `Trait` so you could box the found value and coerce it to the trait object `Box<dyn Trait>`, you will have to change the expected type as well
31
+
= note: the trait objects may have different vtables
43
32
44
-
error[E0308]: mismatched types
33
+
error[E0606]: casting `*mut (dyn Assocked<Assoc = u8> + 'static)` as `*mut (dyn Assocked<Assoc = u32> + 'static)` is invalid
0 commit comments