diff --git a/src/common.rs b/src/common.rs index eda77bf19d3..466758f2f86 100644 --- a/src/common.rs +++ b/src/common.rs @@ -361,13 +361,11 @@ pub(crate) fn monomorphize(&self, value: &T) -> T where T: TypeFoldable<'tcx> + Copy, { - if let Some(substs) = self.instance.substs_for_mir_body() { - self.tcx - .subst_and_normalize_erasing_regions(substs, ty::ParamEnv::reveal_all(), value) - } else { - self.tcx - .normalize_erasing_regions(ty::ParamEnv::reveal_all(), *value) - } + self.instance.subst_mir_and_normalize_erasing_regions( + self.tcx, + ty::ParamEnv::reveal_all(), + value + ) } pub(crate) fn clif_type(&self, ty: Ty<'tcx>) -> Option {