From fe5c4eab2dbc646f60f748b4b348acf5202ebf59 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 18 Jan 2022 19:23:22 -0800 Subject: [PATCH] Eliminate a check_stack call on an empty scan stack --- compiler/rustc_ast_pretty/src/pp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_ast_pretty/src/pp.rs b/compiler/rustc_ast_pretty/src/pp.rs index d9832d560a841..21e685fff4a91 100644 --- a/compiler/rustc_ast_pretty/src/pp.rs +++ b/compiler/rustc_ast_pretty/src/pp.rs @@ -315,8 +315,8 @@ impl Printer { } else { self.right += 1; self.buf.advance_right(); + self.check_stack(0); } - self.check_stack(0); self.buf[self.right] = BufEntry { token: Token::Break(b), size: -self.right_total }; self.scan_stack.push_front(self.right); self.right_total += b.blank_space;