about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSparrowLii <liyuan179@huawei.com>2023-07-19 16:48:33 +0800
committerSparrowLii <liyuan179@huawei.com>2023-07-19 16:48:33 +0800
commit0377945157da71c05ba52edca2de6f071212338c (patch)
tree8bc341ddba3cf9559b2fce69b4aa9c6c7c562b5c
parentc6f0a7c3c3070f90a9e9dcc3e5a91d1183afc978 (diff)
downloadrust-0377945157da71c05ba52edca2de6f071212338c.tar.gz
rust-0377945157da71c05ba52edca2de6f071212338c.zip
add comment for lower_use_tree
Signed-off-by: SparrowLii <liyuan179@huawei.com>
-rw-r--r--compiler/rustc_ast_lowering/src/item.rs3
1 files changed, 3 insertions, 0 deletions
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 {