pprust: Do not convert attributes into `MetaItem`s for printing
Fixes https://github.com/rust-lang/rust/issues/62628
This commit is contained in:
parent
160c40bc88
commit
75896011dc
|
@ -617,9 +617,6 @@ pub trait PrintState<'a>: std::ops::Deref<Target=pp::Printer> + std::ops::DerefM
|
||||||
ast::AttrStyle::Outer => self.word("#["),
|
ast::AttrStyle::Outer => self.word("#["),
|
||||||
}
|
}
|
||||||
self.ibox(0);
|
self.ibox(0);
|
||||||
if let Some(mi) = attr.meta() {
|
|
||||||
self.print_meta_item(&mi);
|
|
||||||
} else {
|
|
||||||
match attr.tokens.trees().next() {
|
match attr.tokens.trees().next() {
|
||||||
Some(TokenTree::Delimited(_, delim, tts)) => {
|
Some(TokenTree::Delimited(_, delim, tts)) => {
|
||||||
self.print_mac_common(
|
self.print_mac_common(
|
||||||
|
@ -634,7 +631,6 @@ pub trait PrintState<'a>: std::ops::Deref<Target=pp::Printer> + std::ops::DerefM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
self.end();
|
self.end();
|
||||||
self.word("]");
|
self.word("]");
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
// Keywords in attribute paths are printed as raw idents,
|
||||||
|
// but keywords in attribute arguments are not.
|
||||||
|
|
||||||
|
// pp-exact
|
||||||
|
|
||||||
|
#[rustfmt::r#final(final)]
|
||||||
|
fn main() { }
|
Loading…
Reference in New Issue