Fix pretty printing of parsed attrs in hir_pretty
This commit is contained in:
parent
6a38322d26
commit
279377f87a
8 changed files with 34 additions and 32 deletions
|
@ -125,7 +125,7 @@ macro_rules! print_tup {
|
|||
let ($t, $($ts),*) = self;
|
||||
let parens = print_tup!(num_should_render $t $($ts)*) > 1;
|
||||
if parens {
|
||||
p.word("(");
|
||||
p.popen();
|
||||
}
|
||||
|
||||
let mut printed_anything = $t.should_render();
|
||||
|
@ -134,14 +134,16 @@ macro_rules! print_tup {
|
|||
|
||||
$(
|
||||
if $ts.should_render() {
|
||||
p.word_space(",");
|
||||
if printed_anything {
|
||||
p.word_space(",");
|
||||
}
|
||||
printed_anything = true;
|
||||
}
|
||||
$ts.print_attribute(p);
|
||||
)*
|
||||
|
||||
if parens {
|
||||
p.word(")");
|
||||
p.pclose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -152,8 +154,8 @@ macro_rules! print_tup {
|
|||
|
||||
print_tup!(A B C D E F G H);
|
||||
print_skip!(Span, ());
|
||||
print_disp!(Symbol, u16, bool, NonZero<u32>);
|
||||
print_debug!(UintTy, IntTy, Align, AttrStyle, CommentKind, Transparency);
|
||||
print_disp!(u16, bool, NonZero<u32>);
|
||||
print_debug!(Symbol, UintTy, IntTy, Align, AttrStyle, CommentKind, Transparency);
|
||||
|
||||
/// Finds attributes in sequences of attributes by pattern matching.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue