Fix pretty-printing of empty impl items

This commit is contained in:
Jakub 2013-09-08 22:43:58 +00:00
parent 79e78c4b0c
commit 7173b9d1b8
3 changed files with 13 additions and 1 deletions

View File

@ -586,11 +586,13 @@ pub fn print_item(s: @ps, item: &ast::item) {
};
print_type(s, ty);
space(s.s);
if methods.len() == 0 {
word(s.s, ";");
end(s); // end the head-ibox
end(s); // end the outer cbox
} else {
space(s.s);
bopen(s);
for meth in methods.iter() {
print_method(s, *meth);

View File

@ -0,0 +1,5 @@
trait X { }
impl X for T;
trait Y { }
impl Y for T;

View File

@ -0,0 +1,5 @@
trait X { }
impl X for T;
trait Y { }
impl Y for T;