From 2f25a4ab304dbbb17f8cae06025d4e98e8e7198a Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 29 Dec 2021 11:13:33 -0800 Subject: [PATCH] Fix double space in pretty printed TryBlock --- compiler/rustc_ast_pretty/src/pprust/state.rs | 1 - src/test/ui/macros/stringify.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index f0c1d017326..3e22eef08a5 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -2239,7 +2239,6 @@ impl<'a> State<'a> { } ast::ExprKind::TryBlock(ref blk) => { self.head("try"); - self.space(); self.print_block_with_attrs(blk, attrs) } ast::ExprKind::Err => { diff --git a/src/test/ui/macros/stringify.rs b/src/test/ui/macros/stringify.rs index 90bc7dc1da2..e78848f5881 100644 --- a/src/test/ui/macros/stringify.rs +++ b/src/test/ui/macros/stringify.rs @@ -256,7 +256,7 @@ fn test_expr() { assert_eq!(stringify_expr!(expr.await), "expr.await"); // ExprKind::TryBlock - assert_eq!(stringify_expr!(try {}), "try {}"); // FIXME + assert_eq!(stringify_expr!(try {}), "try {}"); // ExprKind::Assign assert_eq!(stringify_expr!(expr = true), "expr = true");