aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/item_tree/lower.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def/src/item_tree/lower.rs')
-rw-r--r--crates/hir_def/src/item_tree/lower.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/crates/hir_def/src/item_tree/lower.rs b/crates/hir_def/src/item_tree/lower.rs
index 798ab46dd..40f3428b7 100644
--- a/crates/hir_def/src/item_tree/lower.rs
+++ b/crates/hir_def/src/item_tree/lower.rs
@@ -864,7 +864,12 @@ impl UseTreeLowering<'_> {
864 let list = 864 let list =
865 use_tree_list.use_trees().filter_map(|tree| self.lower_use_tree(tree)).collect(); 865 use_tree_list.use_trees().filter_map(|tree| self.lower_use_tree(tree)).collect();
866 866
867 Some(self.use_tree(UseTreeKind::Prefixed { prefix, list }, tree)) 867 Some(
868 self.use_tree(
869 UseTreeKind::Prefixed { prefix: prefix.map(Interned::new), list },
870 tree,
871 ),
872 )
868 } else { 873 } else {
869 let is_glob = tree.star_token().is_some(); 874 let is_glob = tree.star_token().is_some();
870 let path = match tree.path() { 875 let path = match tree.path() {
@@ -883,15 +888,15 @@ impl UseTreeLowering<'_> {
883 if path.is_none() { 888 if path.is_none() {
884 cov_mark::hit!(glob_enum_group); 889 cov_mark::hit!(glob_enum_group);
885 } 890 }
886 Some(self.use_tree(UseTreeKind::Glob { path }, tree)) 891 Some(self.use_tree(UseTreeKind::Glob { path: path.map(Interned::new) }, tree))
887 } 892 }
888 // Globs can't be renamed 893 // Globs can't be renamed
889 (_, Some(_), true) | (None, None, false) => None, 894 (_, Some(_), true) | (None, None, false) => None,
890 // `bla::{ as Name}` is invalid 895 // `bla::{ as Name}` is invalid
891 (None, Some(_), false) => None, 896 (None, Some(_), false) => None,
892 (Some(path), alias, false) => { 897 (Some(path), alias, false) => Some(
893 Some(self.use_tree(UseTreeKind::Single { path, alias }, tree)) 898 self.use_tree(UseTreeKind::Single { path: Interned::new(path), alias }, tree),
894 } 899 ),
895 } 900 }
896 } 901 }
897 } 902 }