Skip to content

-Zdump-mir is incomplete for dead functions #43620

Open
@RalfJung

Description

@RalfJung

Given the following program

fn main() {
    let _closure = |x: i32| x+x;
}

I would expect rustc filename.rs -Zdump-mir=all to dump all stages of the MIR of all functions. What happens instead is that for the closure, only the 000-* and 001-* passes are emitted; the 002-* are missing. That's probably because they are not actually emitted into the binary, so they never get generated. I think that's a bug; one should expect -Zdump-mir to generate the MIR of all phases of all code.

(I noticed this because I was adding a mir-opt test and it told me it couldn't find the file.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-needs-decisionIssue: In need of a decision.T-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