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:
bors 2017-01-08 02:10:26 +00:00
commit 05383b2765

View File

@ -1210,6 +1210,7 @@ impl<'a> State<'a> {
pub fn print_expr(&mut self, expr: &hir::Expr) -> io::Result<()> {
self.maybe_print_comment(expr.span.lo)?;
self.print_outer_attributes(&expr.attrs)?;
self.ibox(indent_unit)?;
self.ann.pre(self, NodeExpr(expr))?;
match expr.node {