Skip to content

MIR drop order is sometimes odd #32433

Closed
Closed
@nikomatsakis

Description

@nikomatsakis

As @eddyb noted on IRC:

15:04 <eddyb> this is weird: http://is.gd/Zjyjmd - it's dropping the outermost temporary, then the innermost, then the middle - shouldn't it be inside-out? or outside-in?
15:04 <eddyb> old trans appears to call them outside-in
15:04 <eddyb> and this drops x before foo(&x) http://is.gd/P1ergF

Related test:

src/test/run-pass/issue-23338-ensure-param-drop-order.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlT-compilerRelevant to the compiler 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