Skip to content

Commit f499564

Browse files
committed
censor attribute derive
1 parent 15d183b commit f499564

File tree

1 file changed

+8
-1
lines changed
  • crates/hir-expand/src

1 file changed

+8
-1
lines changed

crates/hir-expand/src/db.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use mbe::syntax_node_to_token_tree;
77
use rustc_hash::FxHashSet;
88
use span::{AstIdMap, Span, SyntaxContextData, SyntaxContextId};
99
use syntax::{ast, AstNode, Parse, SyntaxElement, SyntaxError, SyntaxNode, SyntaxToken, T};
10+
use tracing::debug;
1011
use triomphe::Arc;
1112

1213
use crate::{
@@ -353,7 +354,13 @@ fn smart_macro_arg(db: &dyn ExpandDatabase, id: MacroCallId) -> MacroArgResult {
353354
// FIXME: We called lookup_intern_macro_call twice.
354355
match loc.kind {
355356
// Get the macro arg for the derive macro
356-
MacroCallKind::Derive { derive_macro_id, .. } => db.macro_arg(derive_macro_id),
357+
MacroCallKind::Derive { derive_macro_id, .. } => {
358+
debug!(
359+
?loc,
360+
"{id:?} is a derive macro. Using the derive macro, id: {derive_macro_id:?}, attribute as the macro arg."
361+
);
362+
db.macro_arg(derive_macro_id)
363+
}
357364
// Normal macro arg
358365
_ => db.macro_arg(id),
359366
}

0 commit comments

Comments
 (0)