1
Fork 0

expand: Do not report cfg_attr traces on macros as unused attributes

This commit is contained in:
Vadim Petrochenkov 2025-03-21 18:14:27 +03:00
parent 4ac032f857
commit 0ac2801f25
3 changed files with 15 additions and 8 deletions

View file

@ -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,