about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-07-13 23:24:58 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-07-15 12:42:07 +0300
commit75896011dc2a137d96a4941f5c415c2c108f5cf9 (patch)
tree1bca714ed6ec2273edd4415d44399532b28e55df /src/libsyntax
parent160c40bc88706965d268106e02c3d43422114a02 (diff)
downloadrust-75896011dc2a137d96a4941f5c415c2c108f5cf9.tar.gz
rust-75896011dc2a137d96a4941f5c415c2c108f5cf9.zip
pprust: Do not convert attributes into `MetaItem`s for printing
Fixes https://github.com/rust-lang/rust/issues/62628
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/print/pprust.rs26
1 files changed, 11 insertions, 15 deletions
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<Target=pp::Printer> + 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);
                     }
                 }
             }