Skip to content

Conversation

@theemathas
Copy link
Contributor

Also, delete impls on non-Deref types.

Pin doesn't do anything useful for non-Deref types, so PinCoerceUnsized on such types makes no sense.

This is a breaking change, since stable code can observe the deleted PinCoerceUnsized impls by uselessly coercing between such types inside a Pin.

There is still some strange behavior, such as Pin<&mut i32> being able to coerce to Pin<&mut dyn Send>, but not being able to coerce to Pin<&i32>. However, I don't think it's possible to fix this.

Fixes #145081

@theemathas theemathas added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. A-coercions Area: implicit and explicit `expr as Type` coercions needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. A-pin Area: Pin T-types Relevant to the types team, which will review and decide on the PR/issue. needs-crater This change needs a crater run to check for possible breakage in the ecosystem. labels Nov 22, 2025
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 22, 2025

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Also, delete impls on non-Deref types.

Pin doesn't do anything useful for non-Deref types, so PinCoerceUnsized
on such types makes no sense.

This is a breaking change, since stable code can observe the deleted
`PinCoerceUnsized` impls by uselessly coercing between such types
inside a `Pin`.

There is still some strange behavior, such as `Pin<&mut i32>` being
able to coerce to `Pin<&mut dyn Send>`, but not being able to coerce to
`Pin<&i32>`. However, I don't think it's possible to fix this.

Fixes rust-lang#145081
@rust-log-analyzer

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-coercions Area: implicit and explicit `expr as Type` coercions A-pin Area: Pin needs-crater This change needs a crater run to check for possible breakage in the ecosystem. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PinCoerceUnsized has strange impls

4 participants