Skip to content

Commit 05383b2

Browse files
committed
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() }')`
2 parents 47c8d9f + 7883543 commit 05383b2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/librustc/hir/print.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,7 @@ impl<'a> State<'a> {
12101210

12111211
pub fn print_expr(&mut self, expr: &hir::Expr) -> io::Result<()> {
12121212
self.maybe_print_comment(expr.span.lo)?;
1213+
self.print_outer_attributes(&expr.attrs)?;
12131214
self.ibox(indent_unit)?;
12141215
self.ann.pre(self, NodeExpr(expr))?;
12151216
match expr.node {

0 commit comments

Comments
 (0)