1
Fork 0

rustc_const_eval: adopt let else in more places

This commit is contained in:
est31 2022-02-19 00:47:43 +01:00
parent b8c56fa8c3
commit 5cc292eb1d
13 changed files with 86 additions and 123 deletions

View file

@ -747,15 +747,12 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> {
if loc.statement_index < num_stmts {
let (mut rvalue, source_info) = {
let statement = &mut self.source[loc.block].statements[loc.statement_index];
let rhs = match statement.kind {
StatementKind::Assign(box (_, ref mut rhs)) => rhs,
_ => {
span_bug!(
statement.source_info.span,
"{:?} is not an assignment",
statement
);
}
let StatementKind::Assign(box (_, ref mut rhs)) = statement.kind else {
span_bug!(
statement.source_info.span,
"{:?} is not an assignment",
statement
);
};
(