From 6eea06415d96012b01204611a65159b1a251a99d Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Thu, 17 Sep 2020 15:28:23 +0200 Subject: Give `ExternCrate` a `Name`, not a `ModPath` --- crates/hir_def/src/item_tree/lower.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/hir_def/src/item_tree/lower.rs') diff --git a/crates/hir_def/src/item_tree/lower.rs b/crates/hir_def/src/item_tree/lower.rs index da62e1297..54814f141 100644 --- a/crates/hir_def/src/item_tree/lower.rs +++ b/crates/hir_def/src/item_tree/lower.rs @@ -503,7 +503,7 @@ impl Ctx { &mut self, extern_crate: &ast::ExternCrate, ) -> Option> { - let path = ModPath::from_name_ref(&extern_crate.name_ref()?); + let name = extern_crate.name_ref()?.as_name(); let alias = extern_crate.rename().map(|a| { a.name().map(|it| it.as_name()).map_or(ImportAlias::Underscore, ImportAlias::Alias) }); @@ -512,7 +512,7 @@ impl Ctx { // FIXME: cfg_attr let is_macro_use = extern_crate.has_atom_attr("macro_use"); - let res = ExternCrate { path, alias, visibility, is_macro_use, ast_id }; + let res = ExternCrate { name, alias, visibility, is_macro_use, ast_id }; Some(id(self.data().extern_crates.alloc(res))) } -- cgit v1.2.3