mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 02:00:00 +03:00
e8f92f5769
Add `Drop::pin_drop` for pinned drops This PR is part of the `pin_ergonomics` experiment (the tracking issue is rust-lang/rust#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)