diff options
| author | est31 <MTest31@outlook.com> | 2022-02-19 00:48:49 +0100 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2022-02-19 17:27:43 +0100 |
| commit | 2ef8af66196f7cc270a0532ea989f2fc6bc6885d (patch) | |
| tree | e023e65e895d79575848f47b3d00129f9c5a9f0f /compiler/rustc_mir_transform/src/inline | |
| parent | b8c56fa8c30821129b0960180f528d4a1a4f9316 (diff) | |
| download | rust-2ef8af66196f7cc270a0532ea989f2fc6bc6885d.tar.gz rust-2ef8af66196f7cc270a0532ea989f2fc6bc6885d.zip | |
Adopt let else in more places
Diffstat (limited to 'compiler/rustc_mir_transform/src/inline')
| -rw-r--r-- | compiler/rustc_mir_transform/src/inline/cycle.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/rustc_mir_transform/src/inline/cycle.rs b/compiler/rustc_mir_transform/src/inline/cycle.rs index 44ded1647fc..de93ab7059f 100644 --- a/compiler/rustc_mir_transform/src/inline/cycle.rs +++ b/compiler/rustc_mir_transform/src/inline/cycle.rs @@ -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. |
