Implement pinned drop sugar#156452
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Addressed the review feedback and pushed a follow-up CI fix. Summary of the review-response changes:
I also fixed the latest CI failure in I also checked the |
9c61b5e to
9913270
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. |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Implements
fn drop(&pin mut self)as sugar forDrop::pin_drop.The resolver recognizes the sugar only for the actual
#[lang = "drop"]trait, maps accepted impl items to effectivepin_dropresolution, and passes marked impl item IDs to lowering. Lowering then emits HIR with ident pin_drop, so existing type checking, Drop validation, drop glue, and direct-call checks remain unchanged.Drop identity is handled without a hardcoded
core::ops::drop::Droppath check. Local#[lang = "drop"]traits are recorded from raw AST attributes, and external Drop identity is checked through external lang-item metadata via defined_lang_items. This avoids calling the all-cratestcx.lang_items()query from resolver.This intentionally preserves the base pinned-drop behavior where
#[pin_v2]types must usepin_drop, whilenon-#[pin_v2]types may still implementpin_drop.r? @petrochenkov
Related
#144537
#130494