Skip to content

Commit 6216661

Browse files
committed
auto merge of #9061 : jakub-/rust/pretty-print-empty-impl, r=huonw
2 parents 91ab8a3 + de79972 commit 6216661

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/libsyntax/print/pprust.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,11 +586,13 @@ pub fn print_item(s: @ps, item: &ast::item) {
586586
};
587587

588588
print_type(s, ty);
589-
space(s.s);
590589

591590
if methods.len() == 0 {
592591
word(s.s, ";");
592+
end(s); // end the head-ibox
593+
end(s); // end the outer cbox
593594
} else {
595+
space(s.s);
594596
bopen(s);
595597
for meth in methods.iter() {
596598
print_method(s, *meth);

src/test/pretty/empty-impl.pp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
trait X { }
2+
impl X for uint;
3+
4+
trait Y { }
5+
impl Y for uint;

src/test/pretty/empty-impl.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
trait X { }
2+
impl X for uint;
3+
4+
trait Y { }
5+
impl Y for uint;

0 commit comments

Comments
 (0)