From 0ac2801f25335b017da63f3bff1c2b46a39ee12d Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Fri, 21 Mar 2025 18:14:27 +0300 Subject: expand: Do not report `cfg_attr` traces on macros as unused attributes --- compiler/rustc_expand/src/expand.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_expand/src/expand.rs') diff --git a/compiler/rustc_expand/src/expand.rs b/compiler/rustc_expand/src/expand.rs index 87f01be26c2..e2a55752850 100644 --- a/compiler/rustc_expand/src/expand.rs +++ b/compiler/rustc_expand/src/expand.rs @@ -1941,7 +1941,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> { let attr_name = attr.ident().unwrap().name; // `#[cfg]` and `#[cfg_attr]` are special - they are // eagerly evaluated. - if attr_name != sym::cfg && attr_name != sym::cfg_attr { + if attr_name != sym::cfg && attr_name != sym::cfg_attr_trace { self.cx.sess.psess.buffer_lint( UNUSED_ATTRIBUTES, attr.span, -- cgit 1.4.1-3-g733a5