From 75896011dc2a137d96a4941f5c415c2c108f5cf9 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sat, 13 Jul 2019 23:24:58 +0300 Subject: pprust: Do not convert attributes into `MetaItem`s for printing Fixes https://github.com/rust-lang/rust/issues/62628 --- src/libsyntax/print/pprust.rs | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index e101168a137..a07bba04489 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -617,21 +617,17 @@ pub trait PrintState<'a>: std::ops::Deref + std::ops::DerefM ast::AttrStyle::Outer => self.word("#["), } self.ibox(0); - if let Some(mi) = attr.meta() { - self.print_meta_item(&mi); - } else { - match attr.tokens.trees().next() { - Some(TokenTree::Delimited(_, delim, tts)) => { - self.print_mac_common( - Some(&attr.path), false, None, delim, tts, true, attr.span - ); - } - tree => { - self.print_path(&attr.path, false, 0); - if tree.is_some() { - self.space(); - self.print_tts(attr.tokens.clone(), true); - } + match attr.tokens.trees().next() { + Some(TokenTree::Delimited(_, delim, tts)) => { + self.print_mac_common( + Some(&attr.path), false, None, delim, tts, true, attr.span + ); + } + tree => { + self.print_path(&attr.path, false, 0); + if tree.is_some() { + self.space(); + self.print_tts(attr.tokens.clone(), true); } } } -- cgit 1.4.1-3-g733a5