Add documentation about lifetime_defs

This commit is contained in:
Santiago Pastorino 2022-08-04 09:52:15 -03:00
parent 9c7de6fb3c
commit a3bfdc77a7
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF

View file

@ -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);