about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWyatt Herkamp <wherkamp@gmail.com>2024-03-14 09:49:00 -0400
committerWyatt Herkamp <wherkamp@gmail.com>2024-03-21 08:06:43 -0400
commitf499564d0a39eca95b97c16bde8e34324225b1ab (patch)
treec89ca7df1e5e96835c95ed61cd72dae951e01544
parent15d183be79f5d31a46f40b54a8308f13cf2879cd (diff)
downloadrust-f499564d0a39eca95b97c16bde8e34324225b1ab.tar.gz
rust-f499564d0a39eca95b97c16bde8e34324225b1ab.zip
censor attribute derive
-rw-r--r--crates/hir-expand/src/db.rs9
1 files changed, 8 insertions, 1 deletions
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),
     }