Skip to content

Tracking Issue for PinCoerceUnsized #150112

@Darksonn

Description

@Darksonn

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 more

Steps

Unresolved Questions

Implementation history

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-DSTsArea: Dynamically-sized types (DSTs)A-coercionsArea: implicit and explicit `expr as Type` coercionsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCF-coerce_unsizedThe `CoerceUnsized` traitT-langRelevant to the language teamT-typesRelevant to the types team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions