@@ -45,7 +45,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
4545 /// be allowed:
4646 /// `fn f<'a: 'b, 'b: 'a>(x: *mut &'b i32) -> impl Sized + 'a { x }`
4747 ///
48- /// Then we map the regions in both the type and the subst to their
48+ /// Then we map the regions in both the type and the generic parameters to their
4949 /// `external_name` giving `concrete_type = &'a i32`,
5050 /// `args = ['static, 'a]`. This will then allow
5151 /// `infer_opaque_definition_from_instantiation` to determine that
@@ -77,9 +77,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
7777 let args = opaque_type_key. args ;
7878 debug ! ( ?concrete_type, ?args) ;
7979
80- let mut subst_regions = vec ! [ self . universal_regions. fr_static] ;
80+ let mut arg_regions = vec ! [ self . universal_regions. fr_static] ;
8181
82- let to_universal_region = |vid, subst_regions : & mut Vec < _ > | {
82+ let to_universal_region = |vid, arg_regions : & mut Vec < _ > | {
8383 trace ! ( ?vid) ;
8484 let scc = self . constraint_sccs . scc ( vid) ;
8585 trace ! ( ?scc) ;
@@ -88,11 +88,11 @@ impl<'tcx> RegionInferenceContext<'tcx> {
8888 } ) {
8989 Some ( region) => {
9090 let vid = self . universal_regions . to_region_vid ( region) ;
91- subst_regions . push ( vid) ;
91+ arg_regions . push ( vid) ;
9292 region
9393 }
9494 None => {
95- subst_regions . push ( vid) ;
95+ arg_regions . push ( vid) ;
9696 ty:: Region :: new_error_with_message (
9797 infcx. tcx ,
9898 concrete_type. span ,
@@ -106,10 +106,10 @@ impl<'tcx> RegionInferenceContext<'tcx> {
106106 // This will ensure they get precedence when folding the regions in the concrete type.
107107 if let Some ( & ci) = member_constraints. get ( & opaque_type_key) {
108108 for & vid in self . member_constraints . choice_regions ( ci) {
109- to_universal_region ( vid, & mut subst_regions ) ;
109+ to_universal_region ( vid, & mut arg_regions ) ;
110110 }
111111 }
112- debug ! ( ?subst_regions ) ;
112+ debug ! ( ?arg_regions ) ;
113113
114114 // Next, insert universal regions from args, so we can translate regions that appear
115115 // in them but are not subject to member constraints, for instance closure args.
@@ -119,18 +119,18 @@ impl<'tcx> RegionInferenceContext<'tcx> {
119119 return region;
120120 }
121121 let vid = self . to_region_vid ( region) ;
122- to_universal_region ( vid, & mut subst_regions )
122+ to_universal_region ( vid, & mut arg_regions )
123123 } ) ;
124124 debug ! ( ?universal_args) ;
125- debug ! ( ?subst_regions ) ;
125+ debug ! ( ?arg_regions ) ;
126126
127127 // Deduplicate the set of regions while keeping the chosen order.
128- let subst_regions = subst_regions . into_iter ( ) . collect :: < FxIndexSet < _ > > ( ) ;
129- debug ! ( ?subst_regions ) ;
128+ let arg_regions = arg_regions . into_iter ( ) . collect :: < FxIndexSet < _ > > ( ) ;
129+ debug ! ( ?arg_regions ) ;
130130
131131 let universal_concrete_type =
132132 infcx. tcx . fold_regions ( concrete_type, |region, _| match * region {
133- ty:: ReVar ( vid) => subst_regions
133+ ty:: ReVar ( vid) => arg_regions
134134 . iter ( )
135135 . find ( |ur_vid| self . eval_equal ( vid, * * ur_vid) )
136136 . and_then ( |ur_vid| self . definitions [ * ur_vid] . external_name )
0 commit comments