rustc_const_eval: adopt let else in more places
This commit is contained in:
parent
b8c56fa8c3
commit
5cc292eb1d
13 changed files with 86 additions and 123 deletions
|
@ -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
|
||||
);
|
||||
};
|
||||
|
||||
(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue