From a3bfdc77a7311287e1869c5bee5d9c2213963296 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Thu, 4 Aug 2022 09:52:15 -0300 Subject: [PATCH] Add documentation about lifetime_defs --- compiler/rustc_ast_lowering/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 17e91b22e4b..2608e3a5639 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -1427,6 +1427,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { // Install the remapping from old to new (if any): lctx.with_remapping(new_remapping, |lctx| { + // This creates HIR lifetime definitions as `hir::GenericParam`, in the given + // example `type TestReturn<'a, T, 'x> = impl Debug + 'x`, it creates a collection + // containing `&['x]`. let lifetime_defs = lctx.arena.alloc_from_iter(collected_lifetimes.iter().map( |&(new_node_id, lifetime)| { let hir_id = lctx.lower_node_id(new_node_id);