1error[E0378]: the trait `DispatchFromDyn` may only be implemented for structs containing the field being coerced, ZST fields with 1 byte alignment, and nothing else
2  --> $DIR/invalid_dispatch_from_dyn_impls.rs:10:1
3   |
4LL | / impl<T, U> DispatchFromDyn<WrapperWithExtraField<U>> for WrapperWithExtraField<T>
5LL | | where
6LL | |     T: DispatchFromDyn<U>,
7LL | | {}
8   | |__^
9   |
10   = note: extra field `1` of type `i32` is not allowed
11
12error[E0378]: implementing the `DispatchFromDyn` trait requires multiple coercions
13  --> $DIR/invalid_dispatch_from_dyn_impls.rs:21:1
14   |
15LL | / impl<T: ?Sized, U: ?Sized> DispatchFromDyn<MultiplePointers<U>> for MultiplePointers<T>
16LL | | where
17LL | |     T: Unsize<U>,
18LL | | {}
19   | |__^
20   |
21   = note: the trait `DispatchFromDyn` may only be implemented for a coercion between structures with a single field being coerced
22   = note: currently, 2 fields need coercions: `ptr1` (`*const T` to `*const U`), `ptr2` (`*const T` to `*const U`)
23
24error[E0378]: the trait `DispatchFromDyn` may only be implemented for a coercion between structures with a single field being coerced, none found
25  --> $DIR/invalid_dispatch_from_dyn_impls.rs:31:1
26   |
27LL | impl<T: ?Sized, U: ?Sized> DispatchFromDyn<NothingToCoerce<T>> for NothingToCoerce<U> {}
28   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29
30error[E0378]: structs implementing `DispatchFromDyn` may not have `#[repr(packed)]` or `#[repr(C)]`
31  --> $DIR/invalid_dispatch_from_dyn_impls.rs:37:1
32   |
33LL | / impl<T: ?Sized, U: ?Sized> DispatchFromDyn<HasReprC<U>> for HasReprC<T>
34LL | | where
35LL | |     T: Unsize<U>,
36LL | | {}
37   | |__^
38
39error[E0378]: the trait `DispatchFromDyn` may only be implemented for structs containing the field being coerced, ZST fields with 1 byte alignment, and nothing else
40  --> $DIR/invalid_dispatch_from_dyn_impls.rs:46:1
41   |
42LL | / impl<T: ?Sized, U: ?Sized> DispatchFromDyn<OverAligned<U>> for OverAligned<T>
43LL | |     where
44LL | |         T: Unsize<U>,
45LL | | {}
46   | |__^
47   |
48   = note: extra field `1` of type `OverAlignedZst` is not allowed
49
50error: aborting due to 5 previous errors
51
52For more information about this error, try `rustc --explain E0378`.
53