@@ -88,34 +88,35 @@ pub struct ConstQualifs {
88
88
/// requirements are then verified and proved by the closure's
89
89
/// creating function. This struct encodes those requirements.
90
90
///
91
- /// The requirements are listed as being between various
92
- /// `RegionVid`. The 0th region refers to `'static`; subsequent region
93
- /// vids refer to the free regions that appear in the closure (or
94
- /// generator's) type, in order of appearance. (This numbering is
95
- /// actually defined by the `UniversalRegions` struct in the NLL
96
- /// region checker. See for example
97
- /// `UniversalRegions::closure_mapping`.) Note that we treat the free
98
- /// regions in the closure's type "as if" they were erased, so their
99
- /// precise identity is not important, only their position.
91
+ /// The requirements are listed as being between various `RegionVid`. The 0th
92
+ /// region refers to `'static`; subsequent region vids refer to the free
93
+ /// regions that appear in the closure (or generator's) type, in order of
94
+ /// appearance. (This numbering is actually defined by the `UniversalRegions`
95
+ /// struct in the NLL region checker. See for example
96
+ /// `UniversalRegions::closure_mapping`.) Note the free regions in the
97
+ /// closure's signature and captures are erased.
100
98
///
101
99
/// Example: If type check produces a closure with the closure substs:
102
100
///
103
101
/// ```text
104
102
/// ClosureSubsts = [
105
- /// i8, // the "closure kind"
106
- /// for<'x> fn(&'a &'x u32) -> &'x u32, // the "closure signature"
107
- /// &'a String, // some upvar
103
+ /// 'a, // From the parent.
104
+ /// 'b,
105
+ /// i8, // the "closure kind"
106
+ /// for<'x> fn(&'<erased> &'x u32) -> &'x u32, // the "closure signature"
107
+ /// &'<erased> String, // some upvar
108
108
/// ]
109
109
/// ```
110
110
///
111
- /// here, there is one unique free region (`'a`) but it appears
112
- /// twice. We would "renumber" each occurrence to a unique vid, as follows:
111
+ /// We would "renumber" each free region to a unique vid, as follows:
113
112
///
114
113
/// ```text
115
114
/// ClosureSubsts = [
116
- /// i8, // the "closure kind"
117
- /// for<'x> fn(&'1 &'x u32) -> &'x u32, // the "closure signature"
118
- /// &'2 String, // some upvar
115
+ /// '1, // From the parent.
116
+ /// '2,
117
+ /// i8, // the "closure kind"
118
+ /// for<'x> fn(&'3 &'x u32) -> &'x u32, // the "closure signature"
119
+ /// &'4 String, // some upvar
119
120
/// ]
120
121
/// ```
121
122
///
@@ -124,14 +125,12 @@ pub struct ConstQualifs {
124
125
/// can be extracted from its type and constrained to have the given
125
126
/// outlives relationship.
126
127
///
127
- /// In some cases, we have to record outlives requirements between
128
- /// types and regions as well. In that case, if those types include
129
- /// any regions, those regions are recorded as `ReClosureBound`
130
- /// instances assigned one of these same indices. Those regions will
131
- /// be substituted away by the creator. We use `ReClosureBound` in
132
- /// that case because the regions must be allocated in the global
133
- /// `TyCtxt`, and hence we cannot use `ReVar` (which is what we use
134
- /// internally within the rest of the NLL code).
128
+ /// In some cases, we have to record outlives requirements between types and
129
+ /// regions as well. In that case, if those types include any regions, those
130
+ /// regions are recorded using their external names (`ReStatic`,
131
+ /// `ReEarlyBound`, `ReFree`). We use these because in a query response we
132
+ /// cannot use `ReVar` (which is what we use internally within the rest of the
133
+ /// NLL code).
135
134
#[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable ) ]
136
135
pub struct ClosureRegionRequirements < ' tcx > {
137
136
/// The number of external regions defined on the closure. In our
0 commit comments