X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_middle%2Fsrc%2Fty%2Ffold.rs;h=8a0019bc0127c9df4ee2e224d30567bf194d4992;hb=496adf81deaec94015e4cde2165d094eac09a940;hp=6b9a37d848da2966870256959d7e1d10ecb672cc;hpb=5e37043d63bfe2f3be8fa5a05b07d6c0dad5775d;p=rust.git diff --git a/compiler/rustc_middle/src/ty/fold.rs b/compiler/rustc_middle/src/ty/fold.rs index 6b9a37d848d..8a0019bc012 100644 --- a/compiler/rustc_middle/src/ty/fold.rs +++ b/compiler/rustc_middle/src/ty/fold.rs @@ -105,7 +105,7 @@ fn super_fold_with>(self, folder: &mut F) -> Self { /// the infallible methods of this trait to ensure that the two APIs /// are coherent. pub trait TypeFolder<'tcx>: FallibleTypeFolder<'tcx, Error = !> { - fn tcx<'a>(&'a self) -> TyCtxt<'tcx>; + fn tcx(&self) -> TyCtxt<'tcx>; fn fold_binder(&mut self, t: Binder<'tcx, T>) -> Binder<'tcx, T> where @@ -610,7 +610,9 @@ fn replace_ty(&mut self, bt: ty::BoundTy) -> Ty<'tcx> { let index = entry.index(); let var = ty::BoundVar::from_usize(index); let kind = entry - .or_insert_with(|| ty::BoundVariableKind::Ty(ty::BoundTyKind::Anon)) + .or_insert_with(|| { + ty::BoundVariableKind::Ty(ty::BoundTyKind::Anon(index as u32)) + }) .expect_ty(); self.tcx.mk_ty(ty::Bound(ty::INNERMOST, BoundTy { var, kind })) }