]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #30553 - luqmana:mir-match-arm-guards, r=nikomatsakis
authorbors <bors@rust-lang.org>
Mon, 4 Jan 2016 16:54:11 +0000 (16:54 +0000)
committerbors <bors@rust-lang.org>
Mon, 4 Jan 2016 16:54:11 +0000 (16:54 +0000)
Fixes #30527.

```Rust

fn main() {
    let _abc = match Some(101i8) {
        Some(xyz) if xyz > 100 => xyz,
        Some(_) => -1,
        None => -2
    };
}
```

Resulting MIR now includes the `Some(xyz)` arm, guard and all:
![match.dot](https://cloud.githubusercontent.com/assets/287063/11999413/066f7610-aa8b-11e5-927b-24215af57fc4.png)

~~Not quite sure how to write a test for this.~~ Thinking too hard, just tested the end result.

r? @nikomatsakis

1  2 
src/librustc_mir/build/matches/mod.rs

Simple merge