11error[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
33 |
44LL | impl<T, U> Dyn for dyn Foo<T, U> + '_ {
55 | ^^^^^^^^^^^^^^^^^^ `Foo` is not dyn compatible
66 |
77note: for a trait to be dyn compatible it needs to allow building a vtable
88 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
1010 |
1111LL | trait Foo<T, U>: Super<ActuallySuper, Assoc = T>
1212 | --- this trait is not dyn compatible...
@@ -23,7 +23,7 @@ LL | (&PhantomData::<T> as &dyn Foo<T, U>).transmute(t)
2323 |
2424note: for a trait to be dyn compatible it needs to allow building a vtable
2525 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
2727 |
2828LL | trait Foo<T, U>: Super<ActuallySuper, Assoc = T>
2929 | --- this trait is not dyn compatible...
@@ -32,24 +32,6 @@ LL | fn transmute(&self, t: T) -> <Self as Super<NotActuallySuper>>::Assoc;
3232 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...because method `transmute` references the `Self` type in its return type
3333 = help: consider moving `transmute` to another trait
3434
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
5436
5537For more information about this error, try `rustc --explain E0038`.
0 commit comments