Auto merge of #38807 - comex:pprint-expr-attr, r=nrc
Print attributes on expressions when pretty printing. Test case: `rustc -Z unstable-options --unpretty=hir <(echo 'fn main() { #[allow()] main() }')`
This commit is contained in:
commit
05383b2765
@ -1210,6 +1210,7 @@ impl<'a> State<'a> {
|
|||||||
|
|
||||||
pub fn print_expr(&mut self, expr: &hir::Expr) -> io::Result<()> {
|
pub fn print_expr(&mut self, expr: &hir::Expr) -> io::Result<()> {
|
||||||
self.maybe_print_comment(expr.span.lo)?;
|
self.maybe_print_comment(expr.span.lo)?;
|
||||||
|
self.print_outer_attributes(&expr.attrs)?;
|
||||||
self.ibox(indent_unit)?;
|
self.ibox(indent_unit)?;
|
||||||
self.ann.pre(self, NodeExpr(expr))?;
|
self.ann.pre(self, NodeExpr(expr))?;
|
||||||
match expr.node {
|
match expr.node {
|
||||||
|
Loading…
Reference in New Issue
Block a user