@@ -26,13 +26,13 @@ use rustc_span::Span;
2626/// Our representation is a bit mixed here -- in some cases, we
2727/// include the self type (e.g., `trait_bounds`) but in others we do not
2828#[ derive( Default , PartialEq , Eq , Clone , Debug ) ]
29- pub struct Bounds < ' tcx > {
29+ pub ( crate ) struct Bounds < ' tcx > {
3030 clauses : Vec < ( ty:: Clause < ' tcx > , Span ) > ,
3131 effects_min_tys : FxIndexMap < Ty < ' tcx > , Span > ,
3232}
3333
3434impl < ' tcx > Bounds < ' tcx > {
35- pub fn push_region_bound (
35+ pub ( crate ) fn push_region_bound (
3636 & mut self ,
3737 tcx : TyCtxt < ' tcx > ,
3838 region : ty:: PolyTypeOutlivesPredicate < ' tcx > ,
@@ -42,7 +42,7 @@ impl<'tcx> Bounds<'tcx> {
4242 . push ( ( region. map_bound ( |p| ty:: ClauseKind :: TypeOutlives ( p) ) . upcast ( tcx) , span) ) ;
4343 }
4444
45- pub fn push_trait_bound (
45+ pub ( crate ) fn push_trait_bound (
4646 & mut self ,
4747 tcx : TyCtxt < ' tcx > ,
4848 defining_def_id : DefId ,
@@ -154,7 +154,7 @@ impl<'tcx> Bounds<'tcx> {
154154 self . clauses . push ( ( bound_trait_ref. rebind ( new_trait_ref) . upcast ( tcx) , span) ) ;
155155 }
156156
157- pub fn push_projection_bound (
157+ pub ( crate ) fn push_projection_bound (
158158 & mut self ,
159159 tcx : TyCtxt < ' tcx > ,
160160 projection : ty:: PolyProjectionPredicate < ' tcx > ,
@@ -166,22 +166,22 @@ impl<'tcx> Bounds<'tcx> {
166166 ) ) ;
167167 }
168168
169- pub fn push_sized ( & mut self , tcx : TyCtxt < ' tcx > , ty : Ty < ' tcx > , span : Span ) {
169+ pub ( crate ) fn push_sized ( & mut self , tcx : TyCtxt < ' tcx > , ty : Ty < ' tcx > , span : Span ) {
170170 let sized_def_id = tcx. require_lang_item ( LangItem :: Sized , Some ( span) ) ;
171171 let trait_ref = ty:: TraitRef :: new ( tcx, sized_def_id, [ ty] ) ;
172172 // Preferable to put this obligation first, since we report better errors for sized ambiguity.
173173 self . clauses . insert ( 0 , ( trait_ref. upcast ( tcx) , span) ) ;
174174 }
175175
176- pub fn clauses (
176+ pub ( crate ) fn clauses (
177177 & self ,
178178 // FIXME(effects): remove tcx
179179 _tcx : TyCtxt < ' tcx > ,
180180 ) -> impl Iterator < Item = ( ty:: Clause < ' tcx > , Span ) > + ' _ {
181181 self . clauses . iter ( ) . cloned ( )
182182 }
183183
184- pub fn effects_min_tys ( & self ) -> impl Iterator < Item = Ty < ' tcx > > + ' _ {
184+ pub ( crate ) fn effects_min_tys ( & self ) -> impl Iterator < Item = Ty < ' tcx > > + ' _ {
185185 self . effects_min_tys . keys ( ) . copied ( )
186186 }
187187}
0 commit comments