Skip to content

Commit 754718c

Browse files
committed
libsyntax: Pretty print using the new impl syntax. r=brson
1 parent 5e6d787 commit 754718c

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/libsyntax/print/pprust.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,15 +554,17 @@ pub fn print_item(s: @ps, &&item: @ast::item) {
554554
print_type_params(s, tps);
555555
space(s.s);
556556
}
557-
print_type(s, ty);
558557
559558
match opt_trait {
560559
Some(t) => {
561-
word_space(s, ~":");
562560
print_path(s, t.path, false);
561+
space(s.s);
562+
word_space(s, ~"for");
563563
}
564564
None => ()
565565
};
566+
567+
print_type(s, ty);
566568
space(s.s);
567569
568570
if methods.len() == 0 {

src/test/run-pass/class-attributes-1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct cat {
1414
name: ~str,
1515
}
1616

17-
impl cat: Drop {
17+
impl Drop for cat {
1818
#[cat_dropper]
1919
fn finalize(&self) { error!("%s landed on hir feet" , self . name); }
2020
}

src/test/run-pass/method-attributes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ trait frobable {
1919
}
2020

2121
#[int_frobable]
22-
impl int: frobable {
22+
impl frobable for int {
2323
#[frob_attr1]
2424
fn frob() {
2525
#[frob_attr2];

0 commit comments

Comments
 (0)