Add Drop::pin_drop for pinned drops#144537
Conversation
362f769 to
1497185
Compare
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
1497185 to
9b7201c
Compare
Drop::pin_drop for !Unpin typesDrop::pin_drop for pinned drops
This comment has been minimized.
This comment has been minimized.
d6ddfcf to
7b4bb5c
Compare
This comment has been minimized.
This comment has been minimized.
7b4bb5c to
36ca628
Compare
This comment has been minimized.
This comment has been minimized.
36ca628 to
252d6fc
Compare
This comment has been minimized.
This comment has been minimized.
|
The CI failed because |
252d6fc to
02b0b0d
Compare
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
02b0b0d to
7660d88
Compare
This comment has been minimized.
This comment has been minimized.
7660d88 to
33e3124
Compare
This comment has been minimized.
This comment has been minimized.
9618d10 to
c3e34d5
Compare
I see @carols10cents merged some PRs there recently. Blocked on rust-lang/book#4576. |
|
I've merged the book PR, but I don't understand why the book (and presumably anyone on the internet that links to https://doc.rust-lang.org/std/ops/trait.Drop.html#tymethod.drop can no longer do so? That doesn't seem great. |
This comment has been minimized.
This comment has been minimized.
It's because of this change, where
However, if I change that |
1517565 to
47f3f5a
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
47f3f5a to
8037012
Compare
|
r=me with the submodule set to the book's main branch. |
|
@frank-king: 🔑 Insufficient privileges: not in review users |
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
Add `Drop::pin_drop` for pinned drops 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: - [x] At least and at most one of `drop` and `pin_drop` should be implemented. - [x] No direct call of `drop` or `pin_drop`. They should only be called by the drop glue. - [x] `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)
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test for 1c97c35 failed: CI. Failed job:
|
|
☔ The latest upstream changes (presumably #152213) made this pull request unmergeable. Please resolve the merge conflicts. This pull request was unapproved. |
This PR is part of the
pin_ergonomicsexperiment (the tracking issue is #130494). It allows implementingDropwith a pinnedselfreceiver, which is required for safe pin-projection.Implementations:
dropandpin_dropshould be implemented.droporpin_drop. They should only be called by the drop glue.pin_dropmust and must only be used with types that support pin-projection (i.e. types with#[pin_v2]).fn drop(&pin mut self)and desugars tofn pin_drop(&pin mut self). (Will be in the next PRs)