error[E0378]: the trait `DispatchFromDyn` may only be implemented for structs containing the field being coerced, ZST fields with 1 byte alignment that don't mention type/const generics, and nothing else --> $DIR/invalid_dispatch_from_dyn_impls.rs:10:1 | LL | / impl DispatchFromDyn> for WrapperWithExtraField LL | | LL | | where LL | | T: DispatchFromDyn, | |__________________________^ | = note: extra field `1` of type `i32` is not allowed error[E0375]: implementing `DispatchFromDyn` does not allow multiple fields to be coerced --> $DIR/invalid_dispatch_from_dyn_impls.rs:22:1 | LL | / impl DispatchFromDyn> for MultiplePointers LL | | LL | | where LL | | T: Unsize, | |_________________^ | note: the trait `DispatchFromDyn` may only be implemented when a single field is being coerced --> $DIR/invalid_dispatch_from_dyn_impls.rs:18:5 | LL | ptr1: *const T, | ^^^^^^^^^^^^^^ LL | ptr2: *const T, | ^^^^^^^^^^^^^^ error[E0374]: implementing `DispatchFromDyn` requires a field to be coerced --> $DIR/invalid_dispatch_from_dyn_impls.rs:33:1 | LL | impl DispatchFromDyn> for NothingToCoerce {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: expected a single field to be coerced, none found error[E0378]: structs implementing `DispatchFromDyn` may not have `#[repr(packed)]` or `#[repr(C)]` --> $DIR/invalid_dispatch_from_dyn_impls.rs:39:1 | LL | / impl DispatchFromDyn> for HasReprC LL | | LL | | where LL | | T: Unsize, | |_________________^ error[E0378]: the trait `DispatchFromDyn` may only be implemented for structs containing the field being coerced, ZST fields with 1 byte alignment that don't mention type/const generics, and nothing else --> $DIR/invalid_dispatch_from_dyn_impls.rs:49:1 | LL | / impl DispatchFromDyn> for OverAligned LL | | LL | | where LL | | T: Unsize, | |_____________________^ | = note: extra field `1` of type `OverAlignedZst` is not allowed error: aborting due to 5 previous errors Some errors have detailed explanations: E0374, E0375, E0378. For more information about an error, try `rustc --explain E0374`.