Skip to content

Commit ccd8425

Browse files
committed
---
yaml --- r: 13663 b: refs/heads/master c: f60cdf2 h: refs/heads/master i: 13661: 55bcee7 13659: fb154ea 13655: 324e248 13647: 4ef7e4f 13631: 4849b1e v: v3
1 parent 152d681 commit ccd8425

18 files changed

+22
-21
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 3ed8561dea681fe15eac4c12010c6ede0840088c
2+
refs/heads/master: f60cdf27e76f9e8c195246e90bfd944680cd7617
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1979,7 +1979,7 @@ class parser {
19791979
let rp = self.parse_region_param();
19801980
let ty_params = self.parse_ty_params();
19811981
let class_path = self.ident_to_path_tys(class_name, rp, ty_params);
1982-
let ifaces : [@iface_ref] = if self.eat_keyword("implements")
1982+
let ifaces : [@iface_ref] = if self.eat(token::COLON)
19831983
{ self.parse_iface_ref_list() }
19841984
else { [] };
19851985
self.expect(token::LBRACE);

trunk/src/libsyntax/parse/token.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ fn contextual_keyword_table() -> hashmap<str, ()> {
251251
let keys = [
252252
"as",
253253
"else",
254-
"implements",
255254
"move",
256255
"of",
257256
"priv", "pub",

trunk/src/libsyntax/print/pprust.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,9 +527,11 @@ fn print_item(s: ps, &&item: @ast::item) {
527527
word_nbsp(s, *item.ident);
528528
print_region_param(s, rp);
529529
print_type_params(s, tps);
530-
word_space(s, "implements");
531-
commasep(s, inconsistent, ifaces, {|s, p|
532-
print_path(s, p.path, false)});
530+
if vec::len(ifaces) != 0u {
531+
word_space(s, ":");
532+
commasep(s, inconsistent, ifaces, {|s, p|
533+
print_path(s, p.path, false)});
534+
}
533535
bopen(s);
534536
hardbreak_if_not_bol(s);
535537
maybe_print_comment(s, ctor.span.lo);

trunk/src/test/auxiliary/cci_class_cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import to_str::to_str;
33

44
mod kitty {
55

6-
class cat implements to_str {
6+
class cat : to_str {
77
priv {
88
let mut meows : uint;
99
fn meow() {

trunk/src/test/compile-fail/class-cast-to-iface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ iface noisy {
33
fn speak();
44
}
55

6-
class cat implements noisy {
6+
class cat : noisy {
77
priv {
88
let mut meows : uint;
99
fn meow() {

trunk/src/test/compile-fail/class-implements-bad-iface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// error-pattern:unresolved typename: nonexistent
2-
class cat implements nonexistent {
2+
class cat : nonexistent {
33
let meows: uint;
44
new(in_x : uint) { self.meows = in_x; }
55
}

trunk/src/test/compile-fail/class-implements-int.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class cat implements int { //! ERROR can only implement interface types
1+
class cat : int { //! ERROR can only implement interface types
22
let meows: uint;
33
new(in_x : uint) { self.meows = in_x; }
44
}

trunk/src/test/compile-fail/class-method-missing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ iface animal {
33
fn eat();
44
}
55

6-
class cat implements animal {
6+
class cat : animal {
77
let meows: uint;
88
new(in_x : uint) { self.meows = in_x; }
99
}

trunk/src/test/run-pass/class-cast-to-iface-cross-crate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import to_str::*;
22
import to_str::to_str;
33

4-
class cat implements to_str {
4+
class cat : to_str {
55
priv {
66
let mut meows : uint;
77
fn meow() {

trunk/src/test/run-pass/class-cast-to-iface-multiple-types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ iface noisy {
22
fn speak() -> int;
33
}
44

5-
class dog implements noisy {
5+
class dog : noisy {
66
priv {
77
let barks : @mut uint;
88
fn bark() -> int {
@@ -26,7 +26,7 @@ class dog implements noisy {
2626
fn speak() -> int { self.bark() }
2727
}
2828

29-
class cat implements noisy {
29+
class cat : noisy {
3030
priv {
3131
let meows : @mut uint;
3232
fn meow() -> uint {

trunk/src/test/run-pass/class-cast-to-iface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ iface noisy {
22
fn speak();
33
}
44

5-
class cat implements noisy {
5+
class cat : noisy {
66
priv {
77
let mut meows : uint;
88
fn meow() {

trunk/src/test/run-pass/class-iface-bounded-param.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std;
22
import std::map::{map, hashmap, int_hash};
33

44
class keys<K: copy, V: copy, M: copy map<K,V>>
5-
implements iter::base_iter<K> {
5+
: iter::base_iter<K> {
66

77
let map: M;
88

trunk/src/test/run-pass/class-impl-parameterized-iface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use std;
33
import std::map::*;
44

5-
class cat implements map<int, bool> {
5+
class cat : map<int, bool> {
66
priv {
77
// Yes, you can have negative meows
88
let mut meows : int;

trunk/src/test/run-pass/class-impl-very-parameterized-iface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ enum cat_type { tuxedo, tabby, tortoiseshell }
77
// for any int value that's less than the meows field
88

99
// ok: T should be in scope when resolving the iface ref for map
10-
class cat<T: copy> implements map<int, T> {
10+
class cat<T: copy> : map<int, T> {
1111
priv {
1212
// Yes, you can have negative meows
1313
let mut meows : int;

trunk/src/test/run-pass/class-implement-iface-cross-crate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use cci_class_iface;
44
import cci_class_iface::animals::*;
55

6-
class cat implements noisy {
6+
class cat : noisy {
77
priv {
88
let mut meows : uint;
99
fn meow() {

trunk/src/test/run-pass/class-implement-ifaces.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ iface noisy {
22
fn speak();
33
}
44

5-
class cat implements noisy {
5+
class cat : noisy {
66
priv {
77
let mut meows : uint;
88
fn meow() {

trunk/src/test/run-pass/class-implements-multiple-ifaces.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn vec_includes<T>(xs: [T], x: T) -> bool {
2424
}
2525

2626
// vtables other than the 1st one don't seem to work
27-
class cat implements noisy, scratchy, bitey {
27+
class cat : noisy, scratchy, bitey {
2828
priv {
2929
let meows : @mut uint;
3030
let scratched : dvec<furniture>;

0 commit comments

Comments
 (0)