mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
Conditionally call normalize_erasing_regions only if polymorhization is enabled
This commit is contained in:
parent
a9f1e1c440
commit
09978bdcd1
@ -2478,9 +2478,10 @@ impl<'tcx> ty::Instance<'tcx> {
|
||||
// `src/test/ui/polymorphization/normalized_sig_types.rs`), and codegen not keeping
|
||||
// track of a polymorphization `ParamEnv` to allow normalizing later.
|
||||
let mut sig = match *ty.kind() {
|
||||
ty::FnDef(def_id, substs) => tcx
|
||||
ty::FnDef(def_id, substs) if tcx.sess.opts.debugging_opts.polymorphize => tcx
|
||||
.normalize_erasing_regions(tcx.param_env(def_id), tcx.fn_sig(def_id))
|
||||
.subst(tcx, substs),
|
||||
ty::FnDef(def_id, substs) => tcx.fn_sig(def_id).subst(tcx, substs),
|
||||
_ => unreachable!(),
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user