Skip to content

Commit 160c40b

Browse files
committed
pprust: Remove the box from print_tts
Wrap the whole attribute into a box instead
1 parent 11585b5 commit 160c40b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/libsyntax/print/pprust.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ pub trait PrintState<'a>: std::ops::Deref<Target=pp::Printer> + std::ops::DerefM
616616
ast::AttrStyle::Inner => self.word("#!["),
617617
ast::AttrStyle::Outer => self.word("#["),
618618
}
619+
self.ibox(0);
619620
if let Some(mi) = attr.meta() {
620621
self.print_meta_item(&mi);
621622
} else {
@@ -634,6 +635,7 @@ pub trait PrintState<'a>: std::ops::Deref<Target=pp::Printer> + std::ops::DerefM
634635
}
635636
}
636637
}
638+
self.end();
637639
self.word("]");
638640
}
639641
}
@@ -698,14 +700,12 @@ pub trait PrintState<'a>: std::ops::Deref<Target=pp::Printer> + std::ops::DerefM
698700
}
699701

700702
fn print_tts(&mut self, tts: tokenstream::TokenStream, convert_dollar_crate: bool) {
701-
self.ibox(0);
702703
for (i, tt) in tts.into_trees().enumerate() {
703704
if i != 0 {
704705
self.space();
705706
}
706707
self.print_tt(tt, convert_dollar_crate);
707708
}
708-
self.end();
709709
}
710710

711711
fn print_mac_common(
@@ -738,7 +738,9 @@ pub trait PrintState<'a>: std::ops::Deref<Target=pp::Printer> + std::ops::DerefM
738738
self.bopen();
739739
}
740740
}
741+
self.ibox(0);
741742
self.print_tts(tts, convert_dollar_crate);
743+
self.end();
742744
match delim {
743745
DelimToken::Paren => self.pclose(),
744746
DelimToken::Bracket => self.word("]"),

0 commit comments

Comments
 (0)