]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #41316 - suchithjn225:issue-41272, r=eddyb
authorbors <bors@rust-lang.org>
Sat, 15 Apr 2017 12:13:27 +0000 (12:13 +0000)
committerbors <bors@rust-lang.org>
Sat, 15 Apr 2017 12:13:27 +0000 (12:13 +0000)
Do not desugar if-let-else to match arm guards

Fixes #41272
Changed the desugaring code

**Before**
```rust
match <sub_expr> {
     <pat> => <body>,
     [_ if <else_opt_if_cond> => <else_opt_if_body>,]
     _ => [<else_opt> | ()]
}
```

**After**
```rust
match <sub_expr> {
    <pat> => <body>,
     _       => [<else_opt> | ()]
}
```
With this fix, it doesn't cause E0301

1  2 
src/librustc/hir/lowering.rs

Simple merge