From fa094044a98dade4ac2dffe1f1e4383b34bb03ff Mon Sep 17 00:00:00 2001 From: bishtpawan Date: Tue, 20 Oct 2020 23:13:21 +0530 Subject: [PATCH 1/2] Fix build failure of rustfmt --- compiler/rustc_mir_build/src/lints.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_mir_build/src/lints.rs b/compiler/rustc_mir_build/src/lints.rs index bdef02a011bac..b588bc1ad837e 100644 --- a/compiler/rustc_mir_build/src/lints.rs +++ b/compiler/rustc_mir_build/src/lints.rs @@ -71,11 +71,12 @@ impl<'mir, 'tcx> Search<'mir, 'tcx> { let func_ty = func.ty(body, tcx); if let ty::FnDef(callee, substs) = *func_ty.kind() { + let normalized_substs = tcx.normalize_erasing_regions(param_env, substs); let (callee, call_substs) = - if let Ok(Some(instance)) = Instance::resolve(tcx, param_env, callee, substs) { + if let Ok(Some(instance)) = Instance::resolve(tcx, param_env, callee, normalized_substs) { (instance.def_id(), instance.substs) } else { - (callee, substs) + (callee, normalized_substs) }; // FIXME(#57965): Make this work across function boundaries From 7f5847735a85b474d0ce8627665e2015fb2c7b56 Mon Sep 17 00:00:00 2001 From: bishtpawan Date: Wed, 21 Oct 2020 11:42:52 +0530 Subject: [PATCH 2/2] Fix formatting --- compiler/rustc_mir_build/src/lints.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_mir_build/src/lints.rs b/compiler/rustc_mir_build/src/lints.rs index b588bc1ad837e..a9620b83124e0 100644 --- a/compiler/rustc_mir_build/src/lints.rs +++ b/compiler/rustc_mir_build/src/lints.rs @@ -72,12 +72,13 @@ impl<'mir, 'tcx> Search<'mir, 'tcx> { let func_ty = func.ty(body, tcx); if let ty::FnDef(callee, substs) = *func_ty.kind() { let normalized_substs = tcx.normalize_erasing_regions(param_env, substs); - let (callee, call_substs) = - if let Ok(Some(instance)) = Instance::resolve(tcx, param_env, callee, normalized_substs) { - (instance.def_id(), instance.substs) - } else { - (callee, normalized_substs) - }; + let (callee, call_substs) = if let Ok(Some(instance)) = + Instance::resolve(tcx, param_env, callee, normalized_substs) + { + (instance.def_id(), instance.substs) + } else { + (callee, normalized_substs) + }; // FIXME(#57965): Make this work across function boundaries