Skip to content

Commit

Permalink
Rollup merge of rust-lang#48727 - leodasvacas:refactor-contrived-matc…
Browse files Browse the repository at this point in the history
…h, r=rkruppe

Refactor contrived match.
  • Loading branch information
kennytm committed Mar 6, 2018
2 parents 46d629a + 0b0e1b7 commit 57cfbea
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/librustc_mir/transform/lower_128bit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,12 @@ impl Lower128Bit {
};

let bin_statement = block.statements.pop().unwrap();
let (source_info, place, lhs, mut rhs) = match bin_statement {
Statement {
source_info,
kind: StatementKind::Assign(
place,
Rvalue::BinaryOp(_, lhs, rhs))
} => (source_info, place, lhs, rhs),
Statement {
source_info,
kind: StatementKind::Assign(
place,
Rvalue::CheckedBinaryOp(_, lhs, rhs))
} => (source_info, place, lhs, rhs),
let source_info = bin_statement.source_info;
let (place, lhs, mut rhs) = match bin_statement.kind {
StatementKind::Assign(place, Rvalue::BinaryOp(_, lhs, rhs))
| StatementKind::Assign(place, Rvalue::CheckedBinaryOp(_, lhs, rhs)) => {
(place, lhs, rhs)
}
_ => bug!("Statement doesn't match pattern any more?"),
};

Expand Down

0 comments on commit 57cfbea

Please sign in to comment.