From 9a30ecdf1169dd53a1e226cc3523260ef88fd90a Mon Sep 17 00:00:00 2001 From: Tomasz Miąsko Date: Thu, 28 Jan 2016 07:21:32 +0100 Subject: libsyntax: fix pretty printing of macro with braces Pretty printing of macro with braces but without terminated semicolon removed more boxes from stack than it put there, resulting in panic. This fixes the issue #30731. --- src/libsyntax/print/pprust.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index e80297eb797..759b16c5738 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1781,11 +1781,8 @@ impl<'a> State<'a> { token::Paren => try!(self.popen()), token::Bracket => try!(word(&mut self.s, "[")), token::Brace => { - // head-ibox, will be closed by bopen() - try!(self.ibox(0)); - // Don't ask me why the regular bopen() does - // more then just opening a brace... - try!(self.bopen()) + try!(self.head("")); + try!(self.bopen()); } } try!(self.print_tts(&m.node.tts)); -- cgit 1.4.1-3-g733a5