@@ -26,13 +26,13 @@ use rustc_span::Span;
26
26
/// Our representation is a bit mixed here -- in some cases, we
27
27
/// include the self type (e.g., `trait_bounds`) but in others we do not
28
28
#[ derive( Default , PartialEq , Eq , Clone , Debug ) ]
29
- pub struct Bounds < ' tcx > {
29
+ pub ( crate ) struct Bounds < ' tcx > {
30
30
clauses : Vec < ( ty:: Clause < ' tcx > , Span ) > ,
31
31
effects_min_tys : FxIndexMap < Ty < ' tcx > , Span > ,
32
32
}
33
33
34
34
impl < ' tcx > Bounds < ' tcx > {
35
- pub fn push_region_bound (
35
+ pub ( crate ) fn push_region_bound (
36
36
& mut self ,
37
37
tcx : TyCtxt < ' tcx > ,
38
38
region : ty:: PolyTypeOutlivesPredicate < ' tcx > ,
@@ -42,7 +42,7 @@ impl<'tcx> Bounds<'tcx> {
42
42
. push ( ( region. map_bound ( |p| ty:: ClauseKind :: TypeOutlives ( p) ) . upcast ( tcx) , span) ) ;
43
43
}
44
44
45
- pub fn push_trait_bound (
45
+ pub ( crate ) fn push_trait_bound (
46
46
& mut self ,
47
47
tcx : TyCtxt < ' tcx > ,
48
48
defining_def_id : DefId ,
@@ -154,7 +154,7 @@ impl<'tcx> Bounds<'tcx> {
154
154
self . clauses . push ( ( bound_trait_ref. rebind ( new_trait_ref) . upcast ( tcx) , span) ) ;
155
155
}
156
156
157
- pub fn push_projection_bound (
157
+ pub ( crate ) fn push_projection_bound (
158
158
& mut self ,
159
159
tcx : TyCtxt < ' tcx > ,
160
160
projection : ty:: PolyProjectionPredicate < ' tcx > ,
@@ -166,22 +166,22 @@ impl<'tcx> Bounds<'tcx> {
166
166
) ) ;
167
167
}
168
168
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 ) {
170
170
let sized_def_id = tcx. require_lang_item ( LangItem :: Sized , Some ( span) ) ;
171
171
let trait_ref = ty:: TraitRef :: new ( tcx, sized_def_id, [ ty] ) ;
172
172
// Preferable to put this obligation first, since we report better errors for sized ambiguity.
173
173
self . clauses . insert ( 0 , ( trait_ref. upcast ( tcx) , span) ) ;
174
174
}
175
175
176
- pub fn clauses (
176
+ pub ( crate ) fn clauses (
177
177
& self ,
178
178
// FIXME(effects): remove tcx
179
179
_tcx : TyCtxt < ' tcx > ,
180
180
) -> impl Iterator < Item = ( ty:: Clause < ' tcx > , Span ) > + ' _ {
181
181
self . clauses . iter ( ) . cloned ( )
182
182
}
183
183
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 > > + ' _ {
185
185
self . effects_min_tys . keys ( ) . copied ( )
186
186
}
187
187
}
0 commit comments