libsyntax: Pretty print using the new impl syntax. r=brson

This commit is contained in:
Patrick Walton 2013-02-10 23:15:45 -08:00
parent 5e6d7871c6
commit 754718c910
3 changed files with 6 additions and 4 deletions

View file

@ -554,15 +554,17 @@ pub fn print_item(s: @ps, &&item: @ast::item) {
print_type_params(s, tps);
space(s.s);
}
print_type(s, ty);
match opt_trait {
Some(t) => {
word_space(s, ~":");
print_path(s, t.path, false);
space(s.s);
word_space(s, ~"for");
}
None => ()
};
print_type(s, ty);
space(s.s);
if methods.len() == 0 {

View file

@ -14,7 +14,7 @@ struct cat {
name: ~str,
}
impl cat: Drop {
impl Drop for cat {
#[cat_dropper]
fn finalize(&self) { error!("%s landed on hir feet" , self . name); }
}

View file

@ -19,7 +19,7 @@ trait frobable {
}
#[int_frobable]
impl int: frobable {
impl frobable for int {
#[frob_attr1]
fn frob() {
#[frob_attr2];