diff options
Diffstat (limited to 'crates/ra_hir_expand/src')
-rw-r--r-- | crates/ra_hir_expand/src/ast_id_map.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_expand/src/builtin_derive.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_expand/src/lib.rs | 6 |
3 files changed, 5 insertions, 5 deletions
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 { | |||
73 | // change parent's id. This means that, say, adding a new function to a | 73 | // change parent's id. This means that, say, adding a new function to a |
74 | // trait does not change ids of top-level items, which helps caching. | 74 | // trait does not change ids of top-level items, which helps caching. |
75 | bfs(node, |it| { | 75 | bfs(node, |it| { |
76 | if let Some(module_item) = ast::ModuleItem::cast(it) { | 76 | if let Some(module_item) = ast::Item::cast(it) { |
77 | res.alloc(module_item.syntax()); | 77 | res.alloc(module_item.syntax()); |
78 | } | 78 | } |
79 | }); | 79 | }); |
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 { | |||
276 | let file_id = file_pos.file_id; | 276 | let file_id = file_pos.file_id; |
277 | let parsed = db.parse(file_id); | 277 | let parsed = db.parse(file_id); |
278 | let items: Vec<_> = | 278 | let items: Vec<_> = |
279 | parsed.syntax_node().descendants().filter_map(ast::ModuleItem::cast).collect(); | 279 | parsed.syntax_node().descendants().filter_map(ast::Item::cast).collect(); |
280 | 280 | ||
281 | let ast_id_map = db.ast_id_map(file_id.into()); | 281 | let ast_id_map = db.ast_id_map(file_id.into()); |
282 | 282 | ||
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 { | |||
159 | } | 159 | } |
160 | 160 | ||
161 | /// Indicate it is macro file generated for builtin derive | 161 | /// Indicate it is macro file generated for builtin derive |
162 | pub fn is_builtin_derive(&self, db: &dyn db::AstDatabase) -> Option<InFile<ast::ModuleItem>> { | 162 | pub fn is_builtin_derive(&self, db: &dyn db::AstDatabase) -> Option<InFile<ast::Item>> { |
163 | match self.0 { | 163 | match self.0 { |
164 | HirFileIdRepr::FileId(_) => None, | 164 | HirFileIdRepr::FileId(_) => None, |
165 | HirFileIdRepr::MacroFile(macro_file) => { | 165 | HirFileIdRepr::MacroFile(macro_file) => { |
@@ -174,7 +174,7 @@ impl HirFileId { | |||
174 | MacroDefKind::BuiltInDerive(_) => loc.kind.node(db), | 174 | MacroDefKind::BuiltInDerive(_) => loc.kind.node(db), |
175 | _ => return None, | 175 | _ => return None, |
176 | }; | 176 | }; |
177 | Some(item.with_value(ast::ModuleItem::cast(item.value.clone())?)) | 177 | Some(item.with_value(ast::Item::cast(item.value.clone())?)) |
178 | } | 178 | } |
179 | } | 179 | } |
180 | } | 180 | } |
@@ -258,7 +258,7 @@ pub struct MacroCallLoc { | |||
258 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 258 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
259 | pub enum MacroCallKind { | 259 | pub enum MacroCallKind { |
260 | FnLike(AstId<ast::MacroCall>), | 260 | FnLike(AstId<ast::MacroCall>), |
261 | Attr(AstId<ast::ModuleItem>, String), | 261 | Attr(AstId<ast::Item>, String), |
262 | } | 262 | } |
263 | 263 | ||
264 | impl MacroCallKind { | 264 | impl MacroCallKind { |