@@ -45,7 +45,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
45
45
/// be allowed:
46
46
/// `fn f<'a: 'b, 'b: 'a>(x: *mut &'b i32) -> impl Sized + 'a { x }`
47
47
///
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
49
49
/// `external_name` giving `concrete_type = &'a i32`,
50
50
/// `args = ['static, 'a]`. This will then allow
51
51
/// `infer_opaque_definition_from_instantiation` to determine that
@@ -77,9 +77,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
77
77
let args = opaque_type_key. args ;
78
78
debug ! ( ?concrete_type, ?args) ;
79
79
80
- let mut subst_regions = vec ! [ self . universal_regions. fr_static] ;
80
+ let mut arg_regions = vec ! [ self . universal_regions. fr_static] ;
81
81
82
- let to_universal_region = |vid, subst_regions : & mut Vec < _ > | {
82
+ let to_universal_region = |vid, arg_regions : & mut Vec < _ > | {
83
83
trace ! ( ?vid) ;
84
84
let scc = self . constraint_sccs . scc ( vid) ;
85
85
trace ! ( ?scc) ;
@@ -88,11 +88,11 @@ impl<'tcx> RegionInferenceContext<'tcx> {
88
88
} ) {
89
89
Some ( region) => {
90
90
let vid = self . universal_regions . to_region_vid ( region) ;
91
- subst_regions . push ( vid) ;
91
+ arg_regions . push ( vid) ;
92
92
region
93
93
}
94
94
None => {
95
- subst_regions . push ( vid) ;
95
+ arg_regions . push ( vid) ;
96
96
ty:: Region :: new_error_with_message (
97
97
infcx. tcx ,
98
98
concrete_type. span ,
@@ -106,10 +106,10 @@ impl<'tcx> RegionInferenceContext<'tcx> {
106
106
// This will ensure they get precedence when folding the regions in the concrete type.
107
107
if let Some ( & ci) = member_constraints. get ( & opaque_type_key) {
108
108
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 ) ;
110
110
}
111
111
}
112
- debug ! ( ?subst_regions ) ;
112
+ debug ! ( ?arg_regions ) ;
113
113
114
114
// Next, insert universal regions from args, so we can translate regions that appear
115
115
// in them but are not subject to member constraints, for instance closure args.
@@ -119,18 +119,18 @@ impl<'tcx> RegionInferenceContext<'tcx> {
119
119
return region;
120
120
}
121
121
let vid = self . to_region_vid ( region) ;
122
- to_universal_region ( vid, & mut subst_regions )
122
+ to_universal_region ( vid, & mut arg_regions )
123
123
} ) ;
124
124
debug ! ( ?universal_args) ;
125
- debug ! ( ?subst_regions ) ;
125
+ debug ! ( ?arg_regions ) ;
126
126
127
127
// 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 ) ;
130
130
131
131
let universal_concrete_type =
132
132
infcx. tcx . fold_regions ( concrete_type, |region, _| match * region {
133
- ty:: ReVar ( vid) => subst_regions
133
+ ty:: ReVar ( vid) => arg_regions
134
134
. iter ( )
135
135
. find ( |ur_vid| self . eval_equal ( vid, * * ur_vid) )
136
136
. and_then ( |ur_vid| self . definitions [ * ur_vid] . external_name )
0 commit comments