@@ -74,17 +74,7 @@ impl<'tcx,C> HigherRankedRelations<'tcx> for C
74
74
75
75
// Second, we instantiate each bound region in the supertype with a
76
76
// fresh concrete region.
77
- let ( b_prime, skol_map) = {
78
- replace_late_bound_regions ( self . tcx ( ) , b, |br, _| {
79
- let skol =
80
- self . infcx ( ) . region_vars . new_skolemized (
81
- br, & snapshot. region_vars_snapshot ) ;
82
- debug ! ( "Bound region {} skolemized to {}" ,
83
- bound_region_to_string( self . tcx( ) , "" , false , br) ,
84
- skol) ;
85
- skol
86
- } )
87
- } ;
77
+ let ( b_prime, skol_map) = skolemize_regions ( self . infcx ( ) , b, snapshot) ;
88
78
89
79
debug ! ( "a_prime={}" , a_prime. repr( self . tcx( ) ) ) ;
90
80
debug ! ( "b_prime={}" , b_prime. repr( self . tcx( ) ) ) ;
@@ -538,3 +528,23 @@ impl<'a,'tcx> InferCtxtExt<'tcx> for InferCtxt<'a,'tcx> {
538
528
region_vars
539
529
}
540
530
}
531
+
532
+ fn skolemize_regions < ' a , ' tcx , HR > ( infcx : & InferCtxt < ' a , ' tcx > ,
533
+ value : & HR ,
534
+ snapshot : & CombinedSnapshot )
535
+ -> ( HR , FnvHashMap < ty:: BoundRegion , ty:: Region > )
536
+ where HR : HigherRankedFoldable < ' tcx >
537
+ {
538
+ replace_late_bound_regions ( infcx. tcx , value, |br, _| {
539
+ let skol =
540
+ infcx. region_vars . new_skolemized (
541
+ br,
542
+ & snapshot. region_vars_snapshot ) ;
543
+
544
+ debug ! ( "Bound region {} skolemized to {}" ,
545
+ bound_region_to_string( infcx. tcx, "" , false , br) ,
546
+ skol) ;
547
+
548
+ skol
549
+ } )
550
+ }
0 commit comments