From d032f872b619c651dc66bfd669ef783108fc122c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 12:26:57 +0200 Subject: Finish extern crates grammar --- crates/ra_hir_def/src/body/lower.rs | 2 +- crates/ra_hir_def/src/item_tree.rs | 4 ++-- crates/ra_hir_def/src/item_tree/lower.rs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/ra_hir_def') diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index c33b645f3..bfd574c5d 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs @@ -671,7 +671,7 @@ impl ExprCollector<'_> { ast::Item::ExternBlock(_) => return None, // FIXME: collect from extern blocks ast::Item::ImplDef(_) | ast::Item::UseItem(_) - | ast::Item::ExternCrateItem(_) + | ast::Item::ExternCrate(_) | ast::Item::Module(_) | ast::Item::MacroCall(_) => return None, }; diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index 615c1e14c..4db7b2793 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs @@ -412,7 +412,7 @@ macro_rules! mod_items { mod_items! { Import in imports -> ast::UseItem, - ExternCrate in extern_crates -> ast::ExternCrateItem, + ExternCrate in extern_crates -> ast::ExternCrate, Function in functions -> ast::FnDef, Struct in structs -> ast::StructDef, Union in unions -> ast::UnionDef, @@ -492,7 +492,7 @@ pub struct ExternCrate { pub visibility: RawVisibilityId, /// Whether this is a `#[macro_use] extern crate ...`. pub is_macro_use: bool, - pub ast_id: FileAstId, + pub ast_id: FileAstId, } #[derive(Debug, Clone, Eq, PartialEq)] diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs index 6c58c6378..8a36de311 100644 --- a/crates/ra_hir_def/src/item_tree/lower.rs +++ b/crates/ra_hir_def/src/item_tree/lower.rs @@ -95,7 +95,7 @@ impl Ctx { ast::Item::TraitDef(_) | ast::Item::ImplDef(_) | ast::Item::ExternBlock(_) => {} // These don't have inner items. - ast::Item::Module(_) | ast::Item::ExternCrateItem(_) | ast::Item::UseItem(_) => {} + ast::Item::Module(_) | ast::Item::ExternCrate(_) | ast::Item::UseItem(_) => {} }; let attrs = Attrs::new(item, &self.hygiene); @@ -113,7 +113,7 @@ impl Ctx { ast::Item::UseItem(ast) => Some(ModItems( self.lower_use(ast).into_iter().map(Into::into).collect::>(), )), - ast::Item::ExternCrateItem(ast) => self.lower_extern_crate(ast).map(Into::into), + ast::Item::ExternCrate(ast) => self.lower_extern_crate(ast).map(Into::into), ast::Item::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into), ast::Item::ExternBlock(ast) => { Some(ModItems(self.lower_extern_block(ast).into_iter().collect::>())) @@ -498,7 +498,7 @@ impl Ctx { fn lower_extern_crate( &mut self, - extern_crate: &ast::ExternCrateItem, + extern_crate: &ast::ExternCrate, ) -> Option> { let path = ModPath::from_name_ref(&extern_crate.name_ref()?); let alias = extern_crate.rename().map(|a| { -- cgit v1.2.3