Filter out stmts made for the redundant_semicolon lint when pretty-printing
This commit is contained in:
parent
084beb83e0
commit
d35f25cf96
1 changed files with 12 additions and 3 deletions
|
@ -1657,10 +1657,19 @@ impl<'a> State<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ast::StmtKind::Semi(ref expr) => {
|
ast::StmtKind::Semi(ref expr) => {
|
||||||
|
match expr.kind {
|
||||||
|
// Filter out empty `Tup` exprs created for the `redundant_semicolon`
|
||||||
|
// lint, as they shouldn't be visible and interact poorly
|
||||||
|
// with proc macros.
|
||||||
|
ast::ExprKind::Tup(ref exprs) if exprs.is_empty()
|
||||||
|
&& expr.attrs.is_empty() => (),
|
||||||
|
_ => {
|
||||||
self.space_if_not_bol();
|
self.space_if_not_bol();
|
||||||
self.print_expr_outer_attr_style(expr, false);
|
self.print_expr_outer_attr_style(expr, false);
|
||||||
self.s.word(";");
|
self.s.word(";");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
ast::StmtKind::Mac(ref mac) => {
|
ast::StmtKind::Mac(ref mac) => {
|
||||||
let (ref mac, style, ref attrs) = **mac;
|
let (ref mac, style, ref attrs) = **mac;
|
||||||
self.space_if_not_bol();
|
self.space_if_not_bol();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue