Skip to content

Commit 09978bd

Browse files
committed
Conditionally call normalize_erasing_regions only if polymorhization is enabled
1 parent a9f1e1c commit 09978bd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/rustc_middle/src/ty/layout.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2478,9 +2478,10 @@ impl<'tcx> ty::Instance<'tcx> {
24782478
// `src/test/ui/polymorphization/normalized_sig_types.rs`), and codegen not keeping
24792479
// track of a polymorphization `ParamEnv` to allow normalizing later.
24802480
let mut sig = match *ty.kind() {
2481-
ty::FnDef(def_id, substs) => tcx
2481+
ty::FnDef(def_id, substs) if tcx.sess.opts.debugging_opts.polymorphize => tcx
24822482
.normalize_erasing_regions(tcx.param_env(def_id), tcx.fn_sig(def_id))
24832483
.subst(tcx, substs),
2484+
ty::FnDef(def_id, substs) => tcx.fn_sig(def_id).subst(tcx, substs),
24842485
_ => unreachable!(),
24852486
};
24862487

0 commit comments

Comments
 (0)