diff options
Diffstat (limited to 'compiler/rustc_typeck/src/collect.rs')
-rw-r--r-- | compiler/rustc_typeck/src/collect.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_typeck/src/collect.rs b/compiler/rustc_typeck/src/collect.rs index a0cbb7c2c5a..696d8db4e20 100644 --- a/compiler/rustc_typeck/src/collect.rs +++ b/compiler/rustc_typeck/src/collect.rs @@ -393,7 +393,7 @@ impl<'tcx> AstConv<'tcx> for ItemCtxt<'tcx> { } fn ct_infer(&self, ty: Ty<'tcx>, _: Option<&ty::GenericParamDef>, span: Span) -> Const<'tcx> { - let ty = self.tcx.fold_regions(ty, |r, _| match *r { + let ty = self.tcx.fold_regions(ty, &mut false, |r, _| match *r { ty::ReErased => self.tcx.lifetimes.re_static, _ => r, }); @@ -1917,7 +1917,7 @@ fn infer_return_ty_for_fn_sig<'tcx>( Some(ty) => { let fn_sig = tcx.typeck(def_id).liberated_fn_sigs()[hir_id]; // Typeck doesn't expect erased regions to be returned from `type_of`. - let fn_sig = tcx.fold_regions(fn_sig, |r, _| match *r { + let fn_sig = tcx.fold_regions(fn_sig, &mut false, |r, _| match *r { ty::ReErased => tcx.lifetimes.re_static, _ => r, }); |