2025-01-08 00:28:47 +00:00
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
2025-06-12 20:49:48 +05:00
--> $DIR/dispatch-from-dyn-invalid-impls.rs:19:1
2018-10-03 23:40:21 -04:00
|
2023-10-06 20:35:52 +00:00
LL | / impl<T, U> DispatchFromDyn<WrapperWithExtraField<U>> for WrapperWithExtraField<T>
2025-02-19 19:10:01 +00:00
LL | |
2023-10-06 20:35:52 +00:00
LL | | where
2025-06-12 20:49:48 +05:00
LL | | T: DispatchFromDyn<U>
| |_________________________^
2018-10-03 23:40:21 -04:00
|
= note: extra field `1` of type `i32` is not allowed
2025-02-19 19:10:01 +00:00
error[E0375]: implementing `DispatchFromDyn` does not allow multiple fields to be coerced
2025-06-12 20:49:48 +05:00
--> $DIR/dispatch-from-dyn-invalid-impls.rs:32:1
2018-10-03 23:40:21 -04:00
|
2023-10-06 20:35:52 +00:00
LL | / impl<T: ?Sized, U: ?Sized> DispatchFromDyn<MultiplePointers<U>> for MultiplePointers<T>
2025-02-19 19:10:01 +00:00
LL | |
2023-10-06 20:35:52 +00:00
LL | | where
2025-06-12 20:49:48 +05:00
LL | | T: Unsize<U>
| |________________^
2018-10-03 23:40:21 -04:00
|
2025-02-19 19:10:01 +00:00
note: the trait `DispatchFromDyn` may only be implemented when a single field is being coerced
2025-06-12 20:49:48 +05:00
--> $DIR/dispatch-from-dyn-invalid-impls.rs:28:5
2025-02-19 19:10:01 +00:00
|
LL | ptr1: *const T,
| ^^^^^^^^^^^^^^
LL | ptr2: *const T,
| ^^^^^^^^^^^^^^
2018-10-03 23:40:21 -04:00
2025-02-19 19:10:01 +00:00
error[E0374]: implementing `DispatchFromDyn` requires a field to be coerced
2025-06-12 20:49:48 +05:00
--> $DIR/dispatch-from-dyn-invalid-impls.rs:44:1
2018-10-03 23:40:21 -04:00
|
LL | impl<T: ?Sized, U: ?Sized> DispatchFromDyn<NothingToCoerce<T>> for NothingToCoerce<U> {}
2022-02-13 16:27:59 +01:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-09-13 20:42:56 +03:00
|
= note: expected a single field to be coerced, none found
2018-10-03 23:40:21 -04:00
2018-10-26 01:09:33 -04:00
error[E0378]: structs implementing `DispatchFromDyn` may not have `#[repr(packed)]` or `#[repr(C)]`
2025-06-12 20:49:48 +05:00
--> $DIR/dispatch-from-dyn-invalid-impls.rs:51:1
2018-10-26 01:09:33 -04:00
|
2023-10-06 20:35:52 +00:00
LL | / impl<T: ?Sized, U: ?Sized> DispatchFromDyn<HasReprC<U>> for HasReprC<T>
2025-02-19 19:10:01 +00:00
LL | |
2023-10-06 20:35:52 +00:00
LL | | where
2025-06-12 20:49:48 +05:00
LL | | T: Unsize<U>
| |________________^
2018-10-26 01:09:33 -04:00
2025-01-08 00:28:47 +00:00
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
2025-06-12 20:49:48 +05:00
--> $DIR/dispatch-from-dyn-invalid-impls.rs:64:1
2019-04-30 14:38:17 +02:00
|
2023-10-06 20:35:52 +00:00
LL | / impl<T: ?Sized, U: ?Sized> DispatchFromDyn<OverAligned<U>> for OverAligned<T>
2025-02-19 19:10:01 +00:00
LL | |
2025-06-12 20:49:48 +05:00
LL | | where
LL | | T: Unsize<U>
| |________________^
2019-04-30 14:38:17 +02:00
|
= note: extra field `1` of type `OverAlignedZst` is not allowed
error: aborting due to 5 previous errors
2018-10-03 23:40:21 -04:00
2025-02-19 19:10:01 +00:00
Some errors have detailed explanations: E0374, E0375, E0378.
For more information about an error, try `rustc --explain E0374`.