@@ -426,21 +426,21 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
426
426
data
427
427
}
428
428
429
- pub fn data ( & self ) -> & RegionConstraintData < ' tcx > {
429
+ pub ( super ) fn data ( & self ) -> & RegionConstraintData < ' tcx > {
430
430
& self . data
431
431
}
432
432
433
- pub fn start_snapshot ( & mut self ) -> RegionSnapshot {
433
+ pub ( super ) fn start_snapshot ( & mut self ) -> RegionSnapshot {
434
434
debug ! ( "RegionConstraintCollector: start_snapshot" ) ;
435
435
RegionSnapshot { any_unifications : self . any_unifications }
436
436
}
437
437
438
- pub fn rollback_to ( & mut self , snapshot : RegionSnapshot ) {
438
+ pub ( super ) fn rollback_to ( & mut self , snapshot : RegionSnapshot ) {
439
439
debug ! ( "RegionConstraintCollector: rollback_to({:?})" , snapshot) ;
440
440
self . any_unifications = snapshot. any_unifications ;
441
441
}
442
442
443
- pub fn new_region_var (
443
+ pub ( super ) fn new_region_var (
444
444
& mut self ,
445
445
universe : ty:: UniverseIndex ,
446
446
origin : RegionVariableOrigin ,
@@ -455,12 +455,12 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
455
455
}
456
456
457
457
/// Returns the universe for the given variable.
458
- pub fn var_universe ( & self , vid : RegionVid ) -> ty:: UniverseIndex {
458
+ pub ( super ) fn var_universe ( & self , vid : RegionVid ) -> ty:: UniverseIndex {
459
459
self . var_infos [ vid] . universe
460
460
}
461
461
462
462
/// Returns the origin for the given variable.
463
- pub fn var_origin ( & self , vid : RegionVid ) -> RegionVariableOrigin {
463
+ pub ( super ) fn var_origin ( & self , vid : RegionVid ) -> RegionVariableOrigin {
464
464
self . var_infos [ vid] . origin
465
465
}
466
466
@@ -492,7 +492,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
492
492
self . undo_log . push ( AddVerify ( index) ) ;
493
493
}
494
494
495
- pub fn add_given ( & mut self , sub : Region < ' tcx > , sup : ty:: RegionVid ) {
495
+ pub ( super ) fn add_given ( & mut self , sub : Region < ' tcx > , sup : ty:: RegionVid ) {
496
496
// cannot add givens once regions are resolved
497
497
if self . data . givens . insert ( ( sub, sup) ) {
498
498
debug ! ( "add_given({:?} <= {:?})" , sub, sup) ;
@@ -501,7 +501,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
501
501
}
502
502
}
503
503
504
- pub fn make_eqregion (
504
+ pub ( super ) fn make_eqregion (
505
505
& mut self ,
506
506
origin : SubregionOrigin < ' tcx > ,
507
507
sub : Region < ' tcx > ,
@@ -530,7 +530,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
530
530
}
531
531
}
532
532
533
- pub fn member_constraint (
533
+ pub ( super ) fn member_constraint (
534
534
& mut self ,
535
535
key : ty:: OpaqueTypeKey < ' tcx > ,
536
536
definition_span : Span ,
@@ -554,7 +554,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
554
554
}
555
555
556
556
#[ instrument( skip( self , origin) , level = "debug" ) ]
557
- pub fn make_subregion (
557
+ pub ( super ) fn make_subregion (
558
558
& mut self ,
559
559
origin : SubregionOrigin < ' tcx > ,
560
560
sub : Region < ' tcx > ,
@@ -585,7 +585,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
585
585
}
586
586
}
587
587
588
- pub fn verify_generic_bound (
588
+ pub ( super ) fn verify_generic_bound (
589
589
& mut self ,
590
590
origin : SubregionOrigin < ' tcx > ,
591
591
kind : GenericKind < ' tcx > ,
@@ -595,7 +595,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
595
595
self . add_verify ( Verify { kind, origin, region : sub, bound } ) ;
596
596
}
597
597
598
- pub fn lub_regions (
598
+ pub ( super ) fn lub_regions (
599
599
& mut self ,
600
600
tcx : TyCtxt < ' tcx > ,
601
601
origin : SubregionOrigin < ' tcx > ,
@@ -613,7 +613,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
613
613
}
614
614
}
615
615
616
- pub fn glb_regions (
616
+ pub ( super ) fn glb_regions (
617
617
& mut self ,
618
618
tcx : TyCtxt < ' tcx > ,
619
619
origin : SubregionOrigin < ' tcx > ,
@@ -634,7 +634,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
634
634
}
635
635
636
636
/// Resolves the passed RegionVid to the root RegionVid in the unification table
637
- pub fn opportunistic_resolve_var ( & mut self , rid : ty:: RegionVid ) -> ty:: RegionVid {
637
+ pub ( super ) fn opportunistic_resolve_var ( & mut self , rid : ty:: RegionVid ) -> ty:: RegionVid {
638
638
self . unification_table ( ) . find ( rid) . vid
639
639
}
640
640
0 commit comments