Skip to content

Resolve the interaction between StorageDead, drops, and unwinding #61015

Closed
@cramertj

Description

@cramertj

#60840 introduces the expectation that once drop runs on a local, it is UB for that local to be accessed, regardless of the success or failure (panic) of the drop. Unfortunately, adding extra StorageDeads for all of these values caused a performance regression, so at the moment we don't do this. #60840 instead uses drop to indicate that a value is implicitly StorageDead. However, this interacts poorly with drop elaboration, which can turn a drop of a structure into drops of its fields.

cc @Zoxc @tmandry @RalfJung

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-coroutinesArea: CoroutinesA-destructorsArea: Destructors (`Drop`, …)C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions