@@ -27,7 +27,7 @@ use crate::{
27
27
} ,
28
28
diagnostics:: { RegionErrorKind , RegionErrors , UniverseInfo } ,
29
29
member_constraints:: { MemberConstraintSet , NllMemberConstraintIndex } ,
30
- nll:: { PoloniusOutput , ToRegionVid } ,
30
+ nll:: PoloniusOutput ,
31
31
region_infer:: reverse_sccs:: ReverseSccGraph ,
32
32
region_infer:: values:: {
33
33
LivenessValues , PlaceholderIndices , RegionElement , RegionValueElements , RegionValues ,
@@ -593,39 +593,36 @@ impl<'tcx> RegionInferenceContext<'tcx> {
593
593
/// Returns `true` if the region `r` contains the point `p`.
594
594
///
595
595
/// Panics if called before `solve()` executes,
596
- pub ( crate ) fn region_contains ( & self , r : impl ToRegionVid , p : impl ToElementIndex ) -> bool {
597
- let scc = self . constraint_sccs . scc ( r. to_region_vid ( ) ) ;
596
+ pub ( crate ) fn region_contains ( & self , r : RegionVid , p : impl ToElementIndex ) -> bool {
597
+ let scc = self . constraint_sccs . scc ( r) ;
598
598
self . scc_values . contains ( scc, p)
599
599
}
600
600
601
601
/// Returns access to the value of `r` for debugging purposes.
602
602
pub ( crate ) fn region_value_str ( & self , r : RegionVid ) -> String {
603
- let scc = self . constraint_sccs . scc ( r. to_region_vid ( ) ) ;
603
+ let scc = self . constraint_sccs . scc ( r) ;
604
604
self . scc_values . region_value_str ( scc)
605
605
}
606
606
607
607
pub ( crate ) fn placeholders_contained_in < ' a > (
608
608
& ' a self ,
609
609
r : RegionVid ,
610
610
) -> impl Iterator < Item = ty:: PlaceholderRegion > + ' a {
611
- let scc = self . constraint_sccs . scc ( r. to_region_vid ( ) ) ;
611
+ let scc = self . constraint_sccs . scc ( r) ;
612
612
self . scc_values . placeholders_contained_in ( scc)
613
613
}
614
614
615
615
/// Returns access to the value of `r` for debugging purposes.
616
616
pub ( crate ) fn region_universe ( & self , r : RegionVid ) -> ty:: UniverseIndex {
617
- let scc = self . constraint_sccs . scc ( r. to_region_vid ( ) ) ;
617
+ let scc = self . constraint_sccs . scc ( r) ;
618
618
self . scc_universes [ scc]
619
619
}
620
620
621
621
/// Once region solving has completed, this function will return
622
622
/// the member constraints that were applied to the value of a given
623
623
/// region `r`. See `AppliedMemberConstraint`.
624
- pub ( crate ) fn applied_member_constraints (
625
- & self ,
626
- r : impl ToRegionVid ,
627
- ) -> & [ AppliedMemberConstraint ] {
628
- let scc = self . constraint_sccs . scc ( r. to_region_vid ( ) ) ;
624
+ pub ( crate ) fn applied_member_constraints ( & self , r : RegionVid ) -> & [ AppliedMemberConstraint ] {
625
+ let scc = self . constraint_sccs . scc ( r) ;
629
626
binary_search_util:: binary_search_slice (
630
627
& self . member_constraints_applied ,
631
628
|applied| applied. member_region_scc ,
@@ -1133,7 +1130,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1133
1130
let r_vid = self . to_region_vid ( r) ;
1134
1131
let r_scc = self . constraint_sccs . scc ( r_vid) ;
1135
1132
1136
- // The challenge if this. We have some region variable `r`
1133
+ // The challenge is this. We have some region variable `r`
1137
1134
// whose value is a set of CFG points and universal
1138
1135
// regions. We want to find if that set is *equivalent* to
1139
1136
// any of the named regions found in the closure.
@@ -2234,7 +2231,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
2234
2231
r : RegionVid ,
2235
2232
body : & Body < ' _ > ,
2236
2233
) -> Option < Location > {
2237
- let scc = self . constraint_sccs . scc ( r. to_region_vid ( ) ) ;
2234
+ let scc = self . constraint_sccs . scc ( r) ;
2238
2235
let locations = self . scc_values . locations_outlived_by ( scc) ;
2239
2236
for location in locations {
2240
2237
let bb = & body[ location. block ] ;
0 commit comments