Skip to content

Commit 513550c

Browse files
authored
Rollup merge of #78156 - bishtpawan:bugfix/rustfmt-no-longer-builds, r=lcnr
Fixed build failure of `rustfmt` Fixes #78079 r? @eddyb cc @bjorn3
2 parents 59ae795 + 7f58477 commit 513550c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

compiler/rustc_mir_build/src/lints.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@ impl<'mir, 'tcx> Search<'mir, 'tcx> {
7171

7272
let func_ty = func.ty(body, tcx);
7373
if let ty::FnDef(callee, substs) = *func_ty.kind() {
74-
let (callee, call_substs) =
75-
if let Ok(Some(instance)) = Instance::resolve(tcx, param_env, callee, substs) {
76-
(instance.def_id(), instance.substs)
77-
} else {
78-
(callee, substs)
79-
};
74+
let normalized_substs = tcx.normalize_erasing_regions(param_env, substs);
75+
let (callee, call_substs) = if let Ok(Some(instance)) =
76+
Instance::resolve(tcx, param_env, callee, normalized_substs)
77+
{
78+
(instance.def_id(), instance.substs)
79+
} else {
80+
(callee, normalized_substs)
81+
};
8082

8183
// FIXME(#57965): Make this work across function boundaries
8284

0 commit comments

Comments
 (0)