censor attribute derive
This commit is contained in:
parent
15d183be79
commit
f499564d0a
@ -7,6 +7,7 @@
|
|||||||
use rustc_hash::FxHashSet;
|
use rustc_hash::FxHashSet;
|
||||||
use span::{AstIdMap, Span, SyntaxContextData, SyntaxContextId};
|
use span::{AstIdMap, Span, SyntaxContextData, SyntaxContextId};
|
||||||
use syntax::{ast, AstNode, Parse, SyntaxElement, SyntaxError, SyntaxNode, SyntaxToken, T};
|
use syntax::{ast, AstNode, Parse, SyntaxElement, SyntaxError, SyntaxNode, SyntaxToken, T};
|
||||||
|
use tracing::debug;
|
||||||
use triomphe::Arc;
|
use triomphe::Arc;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@ -353,7 +354,13 @@ fn smart_macro_arg(db: &dyn ExpandDatabase, id: MacroCallId) -> MacroArgResult {
|
|||||||
// FIXME: We called lookup_intern_macro_call twice.
|
// FIXME: We called lookup_intern_macro_call twice.
|
||||||
match loc.kind {
|
match loc.kind {
|
||||||
// Get the macro arg for the derive macro
|
// 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
|
// Normal macro arg
|
||||||
_ => db.macro_arg(id),
|
_ => db.macro_arg(id),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user