]> git.proxmox.com Git - rustc.git/blobdiff - compiler/rustc_mir_transform/src/inline/cycle.rs
New upstream version 1.61.0+dfsg1
[rustc.git] / compiler / rustc_mir_transform / src / inline / cycle.rs
index 44ded1647fc28f93aa0f3ff1b07ad4f4560d5f2f..ea1ec6249bca49bf9ee418c9f0f1b21fda25a05b 100644 (file)
@@ -8,7 +8,7 @@ use rustc_middle::ty::{self, subst::SubstsRef, InstanceDef, TyCtxt};
 use rustc_session::Limit;
 
 // FIXME: check whether it is cheaper to precompute the entire call graph instead of invoking
-// this query riddiculously often.
+// this query ridiculously often.
 #[instrument(level = "debug", skip(tcx, root, target))]
 crate fn mir_callgraph_reachable<'tcx>(
     tcx: TyCtxt<'tcx>,
@@ -46,12 +46,9 @@ crate fn mir_callgraph_reachable<'tcx>(
         trace!(%caller);
         for &(callee, substs) in tcx.mir_inliner_callees(caller.def) {
             let substs = caller.subst_mir_and_normalize_erasing_regions(tcx, param_env, substs);
-            let callee = match ty::Instance::resolve(tcx, param_env, callee, substs).unwrap() {
-                Some(callee) => callee,
-                None => {
-                    trace!(?callee, "cannot resolve, skipping");
-                    continue;
-                }
+            let Some(callee) = ty::Instance::resolve(tcx, param_env, callee, substs).unwrap() else {
+                trace!(?callee, "cannot resolve, skipping");
+                continue;
             };
 
             // Found a path.