Skip to content

Conversation

@frank-king
Copy link
Contributor

@frank-king frank-king commented Jul 27, 2025

This PR is part of the pin_ergonomics experiment (the tracking issue is #130494). It allows implementing Drop with a pinned self receiver, which is required for safe pin-projection.

Implementations:

  • At least and at most one of drop and pin_drop should be implemented.
  • No direct call of drop or pin_drop. They should only be called by the drop glue.
  • pin_drop must and must only be used with types that support pin-projection (i.e. types with #[pin_v2]).
  • Allows writing fn drop(&pin mut self) and desugars to fn pin_drop(&pin mut self). (Will be in the next PRs)

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 27, 2025
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Sep 6, 2025

☔ The latest upstream changes (presumably #146071) made this pull request unmergeable. Please resolve the merge conflicts.

@frank-king frank-king changed the title Implement Drop::pin_drop for !Unpin types Add Drop::pin_drop for pinned drops Sep 20, 2025
@rust-log-analyzer

This comment has been minimized.

@frank-king frank-king force-pushed the feature/pin-drop branch 2 times, most recently from d6ddfcf to 7b4bb5c Compare September 20, 2025 14:42
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@frank-king
Copy link
Contributor Author

The CI failed because Drop::drop becomes a provided method. I'm afraid it might not be a good way to hack into librustdoc. Is there any other good way to fix it?

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Sep 23, 2025

☔ The latest upstream changes (presumably #146938) made this pull request unmergeable. Please resolve the merge conflicts.

@Dylan-DPC Dylan-DPC added S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 7, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@frank-king frank-king force-pushed the feature/pin-drop branch 2 times, most recently from 6303109 to 9618d10 Compare November 7, 2025 12:42
@frank-king frank-king marked this pull request as ready for review November 7, 2025 14:18
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 7, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 7, 2025

r? @petrochenkov

rustbot has assigned @petrochenkov.
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

@rustbot
Copy link
Collaborator

rustbot commented Nov 7, 2025

⚠️ Warning ⚠️

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

Labels

S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants