From 0377945157da71c05ba52edca2de6f071212338c Mon Sep 17 00:00:00 2001 From: SparrowLii Date: Wed, 19 Jul 2023 16:48:33 +0800 Subject: [PATCH] add comment for lower_use_tree Signed-off-by: SparrowLii --- compiler/rustc_ast_lowering/src/item.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs index d3fc76db1fa..2f58f566c81 100644 --- a/compiler/rustc_ast_lowering/src/item.rs +++ b/compiler/rustc_ast_lowering/src/item.rs @@ -559,6 +559,9 @@ impl<'hir> LoweringContext<'_, 'hir> { self.with_hir_id_owner(id, |this| { let mut ident = *ident; + // `prefix` is lowered multiple times, but in different HIR owners. + // So each segment gets renewed `HirId` with the same + // `ItemLocalId` and the new owner. (See `lower_node_id`) let kind = this.lower_use_tree(use_tree, &prefix, id, vis_span, &mut ident, attrs); if let Some(attrs) = attrs {