1
Fork 0

Rollup merge of #94011 - est31:let_else, r=lcnr

Even more let_else adoptions

Continuation of #89933, #91018, #91481, #93046, #93590.
This commit is contained in:
Matthias Krüger 2022-02-17 23:00:59 +01:00 committed by GitHub
commit 637d8b89e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 50 additions and 104 deletions

View file

@ -1241,9 +1241,7 @@ impl<'tcx> MirPass<'tcx> for StateTransform {
}
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
let yield_ty = if let Some(yield_ty) = body.yield_ty() {
yield_ty
} else {
let Some(yield_ty) = body.yield_ty() else {
// This only applies to generators
return;
};

View file

@ -212,12 +212,7 @@ fn normalize_array_len_call<'tcx>(
let Some(local) = place.as_local() else { return };
match operand {
Operand::Copy(place) | Operand::Move(place) => {
let operand_local =
if let Some(local) = place.local_or_deref_local() {
local
} else {
return;
};
let Some(operand_local) = place.local_or_deref_local() else { return; };
if !interesting_locals.contains(operand_local) {
return;
}