Implement CoerceUnsized
and DispatchFromDyn
for ManuallyDrop
#56193
Labels
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
Add the following impls:
And add a test case that is allowed by these impls.
This will allow
ManuallyDrop<Box<T>>
to be unsized toManuallyDrop<Box<dyn Trait>>
, and allowManuallyDrop<Box<Self>>
to be used as a trait-object-safe method receiver with thearbitrary_self_types
feature. And similarly for other pointer types besidesBox
.Example test case:
This affects stable code, by allowing unsize coercions that were not previously allowed (e.g. from
ManuallyDrop<Box<T>
toManuallyDrop<Box<U>>
whereT: Unsize<U>
), so I guess it requires an FCP.The text was updated successfully, but these errors were encountered: