]> git.proxmox.com Git - rustc.git/blobdiff - compiler/rustc_mir/src/transform/early_otherwise_branch.rs
New upstream version 1.54.0+dfsg1
[rustc.git] / compiler / rustc_mir / src / transform / early_otherwise_branch.rs
index f7ea9faec47283cf2903062fedd031d0f9c4a440..07127042fa41e82b31ba7b35d7718b6e45480729 100644 (file)
@@ -164,16 +164,13 @@ impl<'tcx> MirPass<'tcx> for EarlyOtherwiseBranch {
         // Since this optimization adds new basic blocks and invalidates others,
         // clean up the cfg to make it nicer for other passes
         if should_cleanup {
-            simplify_cfg(body);
+            simplify_cfg(tcx, body);
         }
     }
 }
 
 fn is_switch<'tcx>(terminator: &Terminator<'tcx>) -> bool {
-    match terminator.kind {
-        TerminatorKind::SwitchInt { .. } => true,
-        _ => false,
-    }
+    matches!(terminator.kind, TerminatorKind::SwitchInt { .. })
 }
 
 struct Helper<'a, 'tcx> {