未验证 提交 57cfbeaf 编写于 作者: K kennytm

Rollup merge of #48727 - leodasvacas:refactor-contrived-match, r=rkruppe

Refactor contrived match.
...@@ -77,19 +77,12 @@ fn lower_128bit_ops<'a, 'tcx>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>, mir: &mut Mir< ...@@ -77,19 +77,12 @@ fn lower_128bit_ops<'a, 'tcx>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>, mir: &mut Mir<
}; };
let bin_statement = block.statements.pop().unwrap(); let bin_statement = block.statements.pop().unwrap();
let (source_info, place, lhs, mut rhs) = match bin_statement { let source_info = bin_statement.source_info;
Statement { let (place, lhs, mut rhs) = match bin_statement.kind {
source_info, StatementKind::Assign(place, Rvalue::BinaryOp(_, lhs, rhs))
kind: StatementKind::Assign( | StatementKind::Assign(place, Rvalue::CheckedBinaryOp(_, lhs, rhs)) => {
place, (place, lhs, rhs)
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),
_ => bug!("Statement doesn't match pattern any more?"), _ => bug!("Statement doesn't match pattern any more?"),
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册