Skip to content

[MIR] Mir generation for match statements seems to miss arms with guard clauses #30527

Closed
@michaelwoerister

Description

@michaelwoerister

Example:

#![feature(rustc_attrs)]
#[rustc_mir(graphviz="match.dot")]
fn main() {
    let _abc = match Some(101i8) {
        Some(xyz) if xyz > 100 => xyz,
        Some(_) => -1,
        None => -2
    };
}

The resulting MIR does not contain the Some(xyz) arm: http://i.imgur.com/EF489mM.png

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions