From 6636f56e79b55f22b88094b7edaed6ec88880500 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 00:23:03 +0200 Subject: Rename ModuleItem -> Item --- crates/ra_hir_expand/src/ast_id_map.rs | 2 +- crates/ra_hir_expand/src/builtin_derive.rs | 2 +- crates/ra_hir_expand/src/lib.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/ra_hir_expand') diff --git a/crates/ra_hir_expand/src/ast_id_map.rs b/crates/ra_hir_expand/src/ast_id_map.rs index f4d31526a..8bfe1b4ba 100644 --- a/crates/ra_hir_expand/src/ast_id_map.rs +++ b/crates/ra_hir_expand/src/ast_id_map.rs @@ -73,7 +73,7 @@ impl AstIdMap { // change parent's id. This means that, say, adding a new function to a // trait does not change ids of top-level items, which helps caching. bfs(node, |it| { - if let Some(module_item) = ast::ModuleItem::cast(it) { + if let Some(module_item) = ast::Item::cast(it) { res.alloc(module_item.syntax()); } }); diff --git a/crates/ra_hir_expand/src/builtin_derive.rs b/crates/ra_hir_expand/src/builtin_derive.rs index f2d664863..8f70a3567 100644 --- a/crates/ra_hir_expand/src/builtin_derive.rs +++ b/crates/ra_hir_expand/src/builtin_derive.rs @@ -276,7 +276,7 @@ mod tests { let file_id = file_pos.file_id; let parsed = db.parse(file_id); let items: Vec<_> = - parsed.syntax_node().descendants().filter_map(ast::ModuleItem::cast).collect(); + parsed.syntax_node().descendants().filter_map(ast::Item::cast).collect(); let ast_id_map = db.ast_id_map(file_id.into()); diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs index d9e31ac20..2e8d63691 100644 --- a/crates/ra_hir_expand/src/lib.rs +++ b/crates/ra_hir_expand/src/lib.rs @@ -159,7 +159,7 @@ impl HirFileId { } /// Indicate it is macro file generated for builtin derive - pub fn is_builtin_derive(&self, db: &dyn db::AstDatabase) -> Option> { + pub fn is_builtin_derive(&self, db: &dyn db::AstDatabase) -> Option> { match self.0 { HirFileIdRepr::FileId(_) => None, HirFileIdRepr::MacroFile(macro_file) => { @@ -174,7 +174,7 @@ impl HirFileId { MacroDefKind::BuiltInDerive(_) => loc.kind.node(db), _ => return None, }; - Some(item.with_value(ast::ModuleItem::cast(item.value.clone())?)) + Some(item.with_value(ast::Item::cast(item.value.clone())?)) } } } @@ -258,7 +258,7 @@ pub struct MacroCallLoc { #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum MacroCallKind { FnLike(AstId), - Attr(AstId, String), + Attr(AstId, String), } impl MacroCallKind { -- cgit v1.2.3