From f499564d0a39eca95b97c16bde8e34324225b1ab Mon Sep 17 00:00:00 2001 From: Wyatt Herkamp Date: Thu, 14 Mar 2024 09:49:00 -0400 Subject: [PATCH] censor attribute derive --- crates/hir-expand/src/db.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/hir-expand/src/db.rs b/crates/hir-expand/src/db.rs index d7036788c30..163f05bdabb 100644 --- a/crates/hir-expand/src/db.rs +++ b/crates/hir-expand/src/db.rs @@ -7,6 +7,7 @@ use mbe::syntax_node_to_token_tree; use rustc_hash::FxHashSet; use span::{AstIdMap, Span, SyntaxContextData, SyntaxContextId}; use syntax::{ast, AstNode, Parse, SyntaxElement, SyntaxError, SyntaxNode, SyntaxToken, T}; +use tracing::debug; use triomphe::Arc; use crate::{ @@ -353,7 +354,13 @@ fn smart_macro_arg(db: &dyn ExpandDatabase, id: MacroCallId) -> MacroArgResult { // FIXME: We called lookup_intern_macro_call twice. match loc.kind { // Get the macro arg for the derive macro - MacroCallKind::Derive { derive_macro_id, .. } => db.macro_arg(derive_macro_id), + MacroCallKind::Derive { derive_macro_id, .. } => { + debug!( + ?loc, + "{id:?} is a derive macro. Using the derive macro, id: {derive_macro_id:?}, attribute as the macro arg." + ); + db.macro_arg(derive_macro_id) + } // Normal macro arg _ => db.macro_arg(id), }