Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor contrived match. #48727

Merged
merged 1 commit into from
Mar 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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