-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Open
Labels
A-DSTsArea: Dynamically-sized types (DSTs)Area: Dynamically-sized types (DSTs)A-coercionsArea: implicit and explicit `expr as Type` coercionsArea: implicit and explicit `expr as Type` coercionsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-coerce_unsizedThe `CoerceUnsized` traitThe `CoerceUnsized` traitT-langRelevant to the language teamRelevant to the language teamT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(pin_coerce_unsized_trait)]
This is a tracking issue for PinCoerceUnsized, which is an unsafe trait that determines whether unsizing coercions are possible when the given type is pinned.
Public API
/// # Safety
/// The impl of `Deref`/`DerefMut` for this type is not malicious.
pub unsafe trait PinCoerceUnsized: Deref {}
impl<Ptr, U> CoerceUnsized<Pin<U>> for Pin<Ptr>
where
Ptr: CoerceUnsized<U> + PinCoerceUnsized,
U: PinCoerceUnsized,
{}
impl<T: ?Sized> PinCoerceUnsized for &'_ T {}
impl<T: ?Sized> PinCoerceUnsized for &'_ mut T {}
impl<T: ?Sized> PinCoerceUnsized for Box<T> {}
impl<T: ?Sized> PinCoerceUnsized for Rc<T> {}
impl<T: ?Sized> PinCoerceUnsized for Arc<T> {}
// and moreSteps
- Implementation
- Stabilize
CoerceUnsizedfirst - Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions
- Decide whether
PinCoerceUnsizedis the correct solution toPinis unsound due to transitive effects ofCoerceUnsized#68015
Implementation history
Metadata
Metadata
Assignees
Labels
A-DSTsArea: Dynamically-sized types (DSTs)Area: Dynamically-sized types (DSTs)A-coercionsArea: implicit and explicit `expr as Type` coercionsArea: implicit and explicit `expr as Type` coercionsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-coerce_unsizedThe `CoerceUnsized` traitThe `CoerceUnsized` traitT-langRelevant to the language teamRelevant to the language teamT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.