You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This patch proposes relaxation on the type unsizing
condition.
`PhantomData` has been in the current type system
exempted from being treated as carrying any data,
including dropck, virtual call dispatch by
`DispatchFromDyn` and unsizing container by
`CoerceUnsize`.
`PhantomData` is a special 1-ZST that really
carries no "data" of the types it captures.
I propose that we should also extend this
interpretation to `Unsize`.
Signed-off-by: Xiangfei Ding <dingxiangfei2009@protonmail.ch>
= note: conflicting implementation in crate `core`:
19
+
- impl<'a, T, U> DispatchFromDyn<&'a U> for &'a T
20
+
where T: Unsize<U>, T: ?Sized, U: ?Sized;
21
+
1
22
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
2
23
--> $DIR/dispatch-from-dyn-invalid-impls.rs:19:1
3
24
|
@@ -54,7 +75,7 @@ LL | | T: Unsize<U>
54
75
|
55
76
= note: extra field `1` of type `OverAlignedZst` is not allowed
56
77
57
-
error: aborting due to 5 previous errors
78
+
error: aborting due to 7 previous errors
58
79
59
-
Some errors have detailed explanations: E0374, E0375, E0378.
60
-
For more information about an error, try `rustc --explain E0374`.
80
+
Some errors have detailed explanations: E0119, E0374, E0375, E0378.
81
+
For more information about an error, try `rustc --explain E0119`.
0 commit comments