From c40e9cc7ca3001cfd6098d1c2f6bf4e009920358 Mon Sep 17 00:00:00 2001 From: Kyle Matsuda Date: Fri, 26 May 2023 12:14:48 -0600 Subject: Make EarlyBinder's inner value private; and fix all of the resulting errors --- compiler/rustc_middle/src/ty/print/mod.rs | 2 +- compiler/rustc_middle/src/ty/sty.rs | 2 +- compiler/rustc_middle/src/ty/subst.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler/rustc_middle/src/ty') diff --git a/compiler/rustc_middle/src/ty/print/mod.rs b/compiler/rustc_middle/src/ty/print/mod.rs index 64e7480e626..2de0a3f75dc 100644 --- a/compiler/rustc_middle/src/ty/print/mod.rs +++ b/compiler/rustc_middle/src/ty/print/mod.rs @@ -123,7 +123,7 @@ pub trait Printer<'tcx>: Sized { impl_trait_ref.map(|i| i.subst(self.tcx(), substs)), ) } else { - (self_ty.0, impl_trait_ref.map(|i| i.0)) + (self_ty.subst_identity(), impl_trait_ref.map(|i| i.subst_identity())) }; self.print_impl_path(def_id, substs, self_ty, impl_trait_ref) } diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index 945ef6aa251..82f79a0c088 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -2366,7 +2366,7 @@ impl<'tcx> Ty<'tcx> { ty::Tuple(tys) => tys.iter().all(|ty| ty.is_trivially_sized(tcx)), - ty::Adt(def, _substs) => def.sized_constraint(tcx).0.is_empty(), + ty::Adt(def, _substs) => def.sized_constraint(tcx).skip_binder().is_empty(), ty::Alias(..) | ty::Param(_) | ty::Placeholder(..) => false, diff --git a/compiler/rustc_middle/src/ty/subst.rs b/compiler/rustc_middle/src/ty/subst.rs index 43450bda19b..5422ee7db32 100644 --- a/compiler/rustc_middle/src/ty/subst.rs +++ b/compiler/rustc_middle/src/ty/subst.rs @@ -538,7 +538,7 @@ impl<'tcx, T: TypeVisitable>> TypeVisitable> for &'tcx /// [`subst_identity`](EarlyBinder::subst_identity) or [`skip_binder`](EarlyBinder::skip_binder). #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] #[derive(Encodable, Decodable, HashStable)] -pub struct EarlyBinder(pub T); +pub struct EarlyBinder(T); /// For early binders, you should first call `subst` before using any visitors. impl<'tcx, T> !TypeFoldable> for ty::EarlyBinder {} -- cgit 1.4.1-3-g733a5