expand: Leave traces when expanding cfg attributes

This commit is contained in:
Vadim Petrochenkov 2025-03-22 21:42:34 +03:00
parent 65899c06f1
commit 92d802eda6
24 changed files with 88 additions and 108 deletions

View file

@ -593,7 +593,7 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
}
fn print_attribute_inline(&mut self, attr: &ast::Attribute, is_inline: bool) -> bool {
if attr.has_name(sym::cfg_attr_trace) {
if attr.has_name(sym::cfg_trace) || attr.has_name(sym::cfg_attr_trace) {
// It's not a valid identifier, so avoid printing it
// to keep the printed code reasonably parse-able.
return false;