diff options
| author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2016-01-28 07:21:32 +0100 |
|---|---|---|
| committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2016-01-28 09:19:43 +0100 |
| commit | 9a30ecdf1169dd53a1e226cc3523260ef88fd90a (patch) | |
| tree | dd962b99fc33646737923a472f8c2ef526d52371 /src/libsyntax | |
| parent | b8b18aac12214d7135a083e2e6946aa197185d49 (diff) | |
| download | rust-9a30ecdf1169dd53a1e226cc3523260ef88fd90a.tar.gz rust-9a30ecdf1169dd53a1e226cc3523260ef88fd90a.zip | |
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.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 7 |
1 files changed, 2 insertions, 5 deletions
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)); |
