Adopt let_else across the compiler
This performs a substitution of code following the pattern: let <id> = if let <pat> = ... { identity } else { ... : ! }; To simplify it to: let <pat> = ... { identity } else { ... : ! }; By adopting the let_else feature.
This commit is contained in:
parent
c1026539bd
commit
1418df5888
51 changed files with 69 additions and 137 deletions
|
@ -83,12 +83,9 @@ impl<'tcx> MirPass<'tcx> for UninhabitedEnumBranching {
|
|||
let bb = BasicBlock::from_usize(bb);
|
||||
trace!("processing block {:?}", bb);
|
||||
|
||||
let discriminant_ty =
|
||||
if let Some(ty) = get_switched_on_type(&body.basic_blocks()[bb], tcx, body) {
|
||||
ty
|
||||
} else {
|
||||
continue;
|
||||
};
|
||||
let Some(discriminant_ty) = get_switched_on_type(&body.basic_blocks()[bb], tcx, body) else {
|
||||
continue;
|
||||
};
|
||||
|
||||
let layout = tcx.layout_of(tcx.param_env(body.source.def_id()).and(discriminant_ty));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue