Fix pretty-printing of empty impl items
This commit is contained in:
parent
79e78c4b0c
commit
7173b9d1b8
3 changed files with 13 additions and 1 deletions
|
@ -586,11 +586,13 @@ pub fn print_item(s: @ps, item: &ast::item) {
|
||||||
};
|
};
|
||||||
|
|
||||||
print_type(s, ty);
|
print_type(s, ty);
|
||||||
space(s.s);
|
|
||||||
|
|
||||||
if methods.len() == 0 {
|
if methods.len() == 0 {
|
||||||
word(s.s, ";");
|
word(s.s, ";");
|
||||||
|
end(s); // end the head-ibox
|
||||||
|
end(s); // end the outer cbox
|
||||||
} else {
|
} else {
|
||||||
|
space(s.s);
|
||||||
bopen(s);
|
bopen(s);
|
||||||
for meth in methods.iter() {
|
for meth in methods.iter() {
|
||||||
print_method(s, *meth);
|
print_method(s, *meth);
|
||||||
|
|
5
src/test/pretty/empty-impl.pp
Normal file
5
src/test/pretty/empty-impl.pp
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
trait X { }
|
||||||
|
impl X for T;
|
||||||
|
|
||||||
|
trait Y { }
|
||||||
|
impl Y for T;
|
5
src/test/pretty/empty-impl.rs
Normal file
5
src/test/pretty/empty-impl.rs
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
trait X { }
|
||||||
|
impl X for T;
|
||||||
|
|
||||||
|
trait Y { }
|
||||||
|
impl Y for T;
|
Loading…
Add table
Add a link
Reference in a new issue