1
1
error[E0038]: the trait `Foo` is not dyn compatible
2
- --> $DIR/almost-supertrait-associated-type.rs:21 :20
2
+ --> $DIR/almost-supertrait-associated-type.rs:20 :20
3
3
|
4
4
LL | impl<T, U> Dyn for dyn Foo<T, U> + '_ {
5
5
| ^^^^^^^^^^^^^^^^^^ `Foo` is not dyn compatible
6
6
|
7
7
note: for a trait to be dyn compatible it needs to allow building a vtable
8
8
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
9
- --> $DIR/almost-supertrait-associated-type.rs:33 :34
9
+ --> $DIR/almost-supertrait-associated-type.rs:32 :34
10
10
|
11
11
LL | trait Foo<T, U>: Super<ActuallySuper, Assoc = T>
12
12
| --- this trait is not dyn compatible...
@@ -23,7 +23,7 @@ LL | (&PhantomData::<T> as &dyn Foo<T, U>).transmute(t)
23
23
|
24
24
note: for a trait to be dyn compatible it needs to allow building a vtable
25
25
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
26
- --> $DIR/almost-supertrait-associated-type.rs:33 :34
26
+ --> $DIR/almost-supertrait-associated-type.rs:32 :34
27
27
|
28
28
LL | trait Foo<T, U>: Super<ActuallySuper, Assoc = T>
29
29
| --- this trait is not dyn compatible...
@@ -32,24 +32,6 @@ LL | fn transmute(&self, t: T) -> <Self as Super<NotActuallySuper>>::Assoc;
32
32
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...because method `transmute` references the `Self` type in its return type
33
33
= help: consider moving `transmute` to another trait
34
34
35
- error[E0038]: the trait `Foo` is not dyn compatible
36
- --> $DIR/almost-supertrait-associated-type.rs:7:6
37
- |
38
- LL | (&PhantomData::<T> as &dyn Foo<T, U>).transmute(t)
39
- | ^^^^^^^^^^^^^^^^^ `Foo` is not dyn compatible
40
- |
41
- note: for a trait to be dyn compatible it needs to allow building a vtable
42
- for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
43
- --> $DIR/almost-supertrait-associated-type.rs:33:34
44
- |
45
- LL | trait Foo<T, U>: Super<ActuallySuper, Assoc = T>
46
- | --- this trait is not dyn compatible...
47
- ...
48
- LL | fn transmute(&self, t: T) -> <Self as Super<NotActuallySuper>>::Assoc;
49
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...because method `transmute` references the `Self` type in its return type
50
- = help: consider moving `transmute` to another trait
51
- = note: required for the cast from `&PhantomData<T>` to `&dyn Foo<T, U>`
52
-
53
- error: aborting due to 3 previous errors
35
+ error: aborting due to 2 previous errors
54
36
55
37
For more information about this error, try `rustc --explain E0038`.
0 commit comments