aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_expand/src/lib.rs')
-rw-r--r--crates/hir_expand/src/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/hir_expand/src/lib.rs b/crates/hir_expand/src/lib.rs
index 0a379651f..c958b0865 100644
--- a/crates/hir_expand/src/lib.rs
+++ b/crates/hir_expand/src/lib.rs
@@ -271,21 +271,21 @@ pub struct MacroCallLoc {
271#[derive(Debug, Clone, PartialEq, Eq, Hash)] 271#[derive(Debug, Clone, PartialEq, Eq, Hash)]
272pub enum MacroCallKind { 272pub enum MacroCallKind {
273 FnLike(AstId<ast::MacroCall>), 273 FnLike(AstId<ast::MacroCall>),
274 Attr(AstId<ast::Item>, String), 274 Derive(AstId<ast::Item>, String),
275} 275}
276 276
277impl MacroCallKind { 277impl MacroCallKind {
278 fn file_id(&self) -> HirFileId { 278 fn file_id(&self) -> HirFileId {
279 match self { 279 match self {
280 MacroCallKind::FnLike(ast_id) => ast_id.file_id, 280 MacroCallKind::FnLike(ast_id) => ast_id.file_id,
281 MacroCallKind::Attr(ast_id, _) => ast_id.file_id, 281 MacroCallKind::Derive(ast_id, _) => ast_id.file_id,
282 } 282 }
283 } 283 }
284 284
285 fn node(&self, db: &dyn db::AstDatabase) -> InFile<SyntaxNode> { 285 fn node(&self, db: &dyn db::AstDatabase) -> InFile<SyntaxNode> {
286 match self { 286 match self {
287 MacroCallKind::FnLike(ast_id) => ast_id.with_value(ast_id.to_node(db).syntax().clone()), 287 MacroCallKind::FnLike(ast_id) => ast_id.with_value(ast_id.to_node(db).syntax().clone()),
288 MacroCallKind::Attr(ast_id, _) => { 288 MacroCallKind::Derive(ast_id, _) => {
289 ast_id.with_value(ast_id.to_node(db).syntax().clone()) 289 ast_id.with_value(ast_id.to_node(db).syntax().clone())
290 } 290 }
291 } 291 }
@@ -296,7 +296,7 @@ impl MacroCallKind {
296 MacroCallKind::FnLike(ast_id) => { 296 MacroCallKind::FnLike(ast_id) => {
297 Some(ast_id.to_node(db).token_tree()?.syntax().clone()) 297 Some(ast_id.to_node(db).token_tree()?.syntax().clone())
298 } 298 }
299 MacroCallKind::Attr(ast_id, _) => Some(ast_id.to_node(db).syntax().clone()), 299 MacroCallKind::Derive(ast_id, _) => Some(ast_id.to_node(db).syntax().clone()),
300 } 300 }
301 } 301 }
302} 302}