@@ -230,30 +230,31 @@ struct LifetimeContext<'a, 'tcx: 'a> {
230
230
tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
231
231
map : & ' a mut NamedRegionMap ,
232
232
scope : ScopeRef < ' a > ,
233
- // Deep breath. Our representation for poly trait refs contains a single
234
- // binder and thus we only allow a single level of quantification. However,
235
- // the syntax of Rust permits quantification in two places, e.g., `T: for <'a> Foo<'a>`
236
- // and `for <'a, 'b> &'b T: Foo<'a>`. In order to get the de Bruijn indices
237
- // correct when representing these constraints, we should only introduce one
238
- // scope. However, we want to support both locations for the quantifier and
239
- // during lifetime resolution we want precise information (so we can't
240
- // desugar in an earlier phase).
241
-
242
- // SO, if we encounter a quantifier at the outer scope, we set
243
- // trait_ref_hack to true (and introduce a scope), and then if we encounter
244
- // a quantifier at the inner scope, we error. If trait_ref_hack is false,
245
- // then we introduce the scope at the inner quantifier.
246
-
247
- // I'm sorry.
233
+
234
+ /// Deep breath. Our representation for poly trait refs contains a single
235
+ /// binder and thus we only allow a single level of quantification. However,
236
+ /// the syntax of Rust permits quantification in two places, e.g., `T: for <'a> Foo<'a>`
237
+ /// and `for <'a, 'b> &'b T: Foo<'a>`. In order to get the de Bruijn indices
238
+ /// correct when representing these constraints, we should only introduce one
239
+ /// scope. However, we want to support both locations for the quantifier and
240
+ /// during lifetime resolution we want precise information (so we can't
241
+ /// desugar in an earlier phase).
242
+ ///
243
+ /// SO, if we encounter a quantifier at the outer scope, we set
244
+ /// trait_ref_hack to true (and introduce a scope), and then if we encounter
245
+ /// a quantifier at the inner scope, we error. If trait_ref_hack is false,
246
+ /// then we introduce the scope at the inner quantifier.
247
+ ///
248
+ /// I'm sorry.
248
249
trait_ref_hack : bool ,
249
250
250
- // Used to disallow the use of in-band lifetimes in `fn` or `Fn` syntax.
251
+ /// Used to disallow the use of in-band lifetimes in `fn` or `Fn` syntax.
251
252
is_in_fn_syntax : bool ,
252
253
253
- // List of labels in the function/method currently under analysis.
254
+ /// List of labels in the function/method currently under analysis.
254
255
labels_in_fn : Vec < ( ast:: Name , Span ) > ,
255
256
256
- // Cache for cross-crate per-definition object lifetime defaults.
257
+ /// Cache for cross-crate per-definition object lifetime defaults.
257
258
xcrate_object_lifetime_defaults : DefIdMap < Vec < ObjectLifetimeDefault > > ,
258
259
259
260
lifetime_uses : DefIdMap < LifetimeUseSet < ' tcx > > ,
0 commit comments