From c0dd36fd425416f5465abf7f12f5d3a14b35751d Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 9 Apr 2021 13:38:01 +0200 Subject: Store `#[derive]` attribute ID along macro invoc --- crates/hir_expand/src/builtin_derive.rs | 8 ++++++-- crates/hir_expand/src/lib.rs | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'crates/hir_expand') diff --git a/crates/hir_expand/src/builtin_derive.rs b/crates/hir_expand/src/builtin_derive.rs index 392079ed4..537c03028 100644 --- a/crates/hir_expand/src/builtin_derive.rs +++ b/crates/hir_expand/src/builtin_derive.rs @@ -269,7 +269,7 @@ mod tests { use expect_test::{expect, Expect}; use name::AsName; - use crate::{test_db::TestDB, AstId, MacroCallId, MacroCallKind, MacroCallLoc}; + use crate::{test_db::TestDB, AstId, AttrId, MacroCallId, MacroCallKind, MacroCallLoc}; use super::*; @@ -317,7 +317,11 @@ $0 local_inner: false, }, krate: CrateId(0), - kind: MacroCallKind::Derive { ast_id, derive_name: name.to_string() }, + kind: MacroCallKind::Derive { + ast_id, + derive_name: name.to_string(), + derive_attr: AttrId(0), + }, }; let id: MacroCallId = db.intern_macro(loc).into(); diff --git a/crates/hir_expand/src/lib.rs b/crates/hir_expand/src/lib.rs index 8637abc6a..a0e6aec62 100644 --- a/crates/hir_expand/src/lib.rs +++ b/crates/hir_expand/src/lib.rs @@ -291,7 +291,7 @@ pub struct MacroCallLoc { #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum MacroCallKind { FnLike { ast_id: AstId }, - Derive { ast_id: AstId, derive_name: String }, + Derive { ast_id: AstId, derive_name: String, derive_attr: AttrId }, } #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -- cgit v1.2.3