about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2012-06-06 21:52:41 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-06-06 22:09:10 -0700
commit0327dc0b188ee536eb6865cf202f03c88864f4fb (patch)
tree275301ed29bfdfa4092b43d18933484443dd683c /src/libsyntax
parentde4f0b92b631a0a35de6ee118df37102e96e8744 (diff)
downloadrust-0327dc0b188ee536eb6865cf202f03c88864f4fb.tar.gz
rust-0327dc0b188ee536eb6865cf202f03c88864f4fb.zip
Insert missing maybe_print_comment call for class destructors
While it wasn't the original issue, the first program from #2487
failed the pretty-printing test because of this, so it's still a good
test case :-)

It also turns out that the second program from #2487 now triggers a
kind error, so I figured I might as well add it as a test case.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/print/pprust.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index a8df8d85092..d4e66137d67 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -539,6 +539,7 @@ fn print_item(s: ps, &&item: @ast::item) {
           print_block(s, ctor.node.body);
           option::iter(m_dtor) {|dtor|
             hardbreak_if_not_bol(s);
+            maybe_print_comment(s, dtor.span.lo);
             head(s, "drop");
             print_block(s, dtor.node.body);
           }