]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_middle/src/ty/fold.rs
Rollup merge of #107553 - edward-shen:edward-shen/suggest-null-ptr, r=WaffleLapkin
[rust.git] / compiler / rustc_middle / src / ty / fold.rs
index 6b9a37d848da2966870256959d7e1d10ecb672cc..8a0019bc0127c9df4ee2e224d30567bf194d4992 100644 (file)
@@ -105,7 +105,7 @@ fn super_fold_with<F: TypeFolder<'tcx>>(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<T>(&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 }))
             }