-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingC-questionCategory: QuestionsCategory: QuestionsI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have
Description
Description
I wanted to write a "wrapper" macro around tracing::error
, then disallow tracing::error
itself, but it seems I can't just put an allow
in the "wrapper" macro itself. Here's a sort of "dummy" version of what I'm doing:
macro_rules! my_error {
($($args:tt)+) => {
#[allow(clippy::disallowed_macros)]
if <some logic> {
tracing::error!(<some extra fields>, $($args)+);
} else {
tracing::error!($($args)+)
}
}
}
The allow
seems to have absolutely no effect. Is there a way to do this correctly?
Version
rustc 1.88.0 (6b00bc388 2025-06-23)
binary: rustc
commit-hash: 6b00bc3880198600130e1cf62b8f8a93494488cc
commit-date: 2025-06-23
host: aarch64-apple-darwin
release: 1.88.0
LLVM version: 20.1.5
Additional Labels
@rustbot label +C-question
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingC-questionCategory: QuestionsCategory: QuestionsI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have