Skip to content

Commit 6a143ad

Browse files
committed
fix comments
1 parent d68b0ec commit 6a143ad

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

src/librustc/middle/resolve_lifetime.rs

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -230,30 +230,31 @@ struct LifetimeContext<'a, 'tcx: 'a> {
230230
tcx: TyCtxt<'a, 'tcx, 'tcx>,
231231
map: &'a mut NamedRegionMap,
232232
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.
248249
trait_ref_hack: bool,
249250

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.
251252
is_in_fn_syntax: bool,
252253

253-
// List of labels in the function/method currently under analysis.
254+
/// List of labels in the function/method currently under analysis.
254255
labels_in_fn: Vec<(ast::Name, Span)>,
255256

256-
// Cache for cross-crate per-definition object lifetime defaults.
257+
/// Cache for cross-crate per-definition object lifetime defaults.
257258
xcrate_object_lifetime_defaults: DefIdMap<Vec<ObjectLifetimeDefault>>,
258259

259260
lifetime_uses: DefIdMap<LifetimeUseSet<'tcx>>,

0 commit comments

Comments
 (0)