Skip to content

Commit a3bfdc7

Browse files
committed
Add documentation about lifetime_defs
1 parent 9c7de6f commit a3bfdc7

File tree

1 file changed

+3
-0
lines changed
  • compiler/rustc_ast_lowering/src

1 file changed

+3
-0
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,6 +1427,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
14271427

14281428
// Install the remapping from old to new (if any):
14291429
lctx.with_remapping(new_remapping, |lctx| {
1430+
// This creates HIR lifetime definitions as `hir::GenericParam`, in the given
1431+
// example `type TestReturn<'a, T, 'x> = impl Debug + 'x`, it creates a collection
1432+
// containing `&['x]`.
14301433
let lifetime_defs = lctx.arena.alloc_from_iter(collected_lifetimes.iter().map(
14311434
|&(new_node_id, lifetime)| {
14321435
let hir_id = lctx.lower_node_id(new_node_id);

0 commit comments

Comments
 (0)