diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-02-14 21:17:26 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-02-15 16:59:56 -0800 |
| commit | bb833ca0f0e878d381c3dc0c9afe958a810e4427 (patch) | |
| tree | 7766fd3354b2b0f0418c5ff317df0696b41dbcc1 /src/libsyntax/ext | |
| parent | 566bcf2225634ee4d4698247fe89364440eb534c (diff) | |
| download | rust-bb833ca0f0e878d381c3dc0c9afe958a810e4427.tar.gz rust-bb833ca0f0e878d381c3dc0c9afe958a810e4427.zip | |
librustc: Stop parsing `impl Type : Trait` and fix several declarations that slipped through. r=tjc
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/pipes/ast_builder.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/check.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/parse_proto.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/pipec.rs | 7 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/proto.rs | 5 |
5 files changed, 9 insertions, 11 deletions
diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs index 58ab05987a6..12e5f1891aa 100644 --- a/src/libsyntax/ext/pipes/ast_builder.rs +++ b/src/libsyntax/ext/pipes/ast_builder.rs @@ -54,7 +54,7 @@ pub trait append_types { fn add_tys(+tys: ~[@ast::Ty]) -> @ast::path; } -pub impl @ast::path: append_types { +pub impl append_types for @ast::path { fn add_ty(ty: @ast::Ty) -> @ast::path { @ast::path { types: vec::append_one(self.types, ty), .. *self} @@ -112,7 +112,7 @@ pub trait ext_ctxt_ast_builder { fn strip_bounds(bounds: &[ast::ty_param]) -> ~[ast::ty_param]; } -pub impl ext_ctxt: ext_ctxt_ast_builder { +pub impl ext_ctxt_ast_builder for ext_ctxt { fn ty_option(ty: @ast::Ty) -> @ast::Ty { self.ty_path_ast_builder(path_global(~[ self.ident_of(~"core"), diff --git a/src/libsyntax/ext/pipes/check.rs b/src/libsyntax/ext/pipes/check.rs index cde6a581dce..a8e0b3ba934 100644 --- a/src/libsyntax/ext/pipes/check.rs +++ b/src/libsyntax/ext/pipes/check.rs @@ -37,7 +37,7 @@ use ext::base::ext_ctxt; use ext::pipes::proto::{state, protocol, next_state}; use ext::pipes::proto; -pub impl ext_ctxt: proto::visitor<(), (), ()> { +pub impl proto::visitor<(), (), ()> for ext_ctxt { fn visit_proto(_proto: protocol, _states: &[()]) { } diff --git a/src/libsyntax/ext/pipes/parse_proto.rs b/src/libsyntax/ext/pipes/parse_proto.rs index 6a1708b8e2b..87561047470 100644 --- a/src/libsyntax/ext/pipes/parse_proto.rs +++ b/src/libsyntax/ext/pipes/parse_proto.rs @@ -22,7 +22,7 @@ pub trait proto_parser { fn parse_message(state: state); } -pub impl parser::Parser: proto_parser { +pub impl proto_parser for parser::Parser { fn parse_proto(id: ~str) -> protocol { let proto = protocol(id, self.span); diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs index 0f596e66158..68d18a2937c 100644 --- a/src/libsyntax/ext/pipes/pipec.rs +++ b/src/libsyntax/ext/pipes/pipec.rs @@ -45,7 +45,7 @@ pub trait gen_init { fn gen_init_bounded(ext_cx: ext_ctxt) -> @ast::expr; } -pub impl message: gen_send { +pub impl gen_send for message { fn gen_send(cx: ext_ctxt, try: bool) -> @ast::item { debug!("pipec: gen_send"); match self { @@ -201,7 +201,7 @@ pub impl message: gen_send { } } -pub impl state: to_type_decls { +pub impl to_type_decls for state { fn to_type_decls(cx: ext_ctxt) -> ~[@ast::item] { debug!("pipec: to_type_decls"); // This compiles into two different type declarations. Say the @@ -305,8 +305,7 @@ pub impl state: to_type_decls { } } -pub impl protocol: gen_init { - +pub impl gen_init for protocol { fn gen_init(cx: ext_ctxt) -> @ast::item { let ext_cx = cx; diff --git a/src/libsyntax/ext/pipes/proto.rs b/src/libsyntax/ext/pipes/proto.rs index 1d6534aef34..027375b6326 100644 --- a/src/libsyntax/ext/pipes/proto.rs +++ b/src/libsyntax/ext/pipes/proto.rs @@ -21,7 +21,7 @@ use core::to_str::ToStr; pub enum direction { send, recv } -pub impl direction : cmp::Eq { +pub impl cmp::Eq for direction { pure fn eq(&self, other: &direction) -> bool { match ((*self), (*other)) { (send, send) => true, @@ -33,7 +33,7 @@ pub impl direction : cmp::Eq { pure fn ne(&self, other: &direction) -> bool { !(*self).eq(other) } } -pub impl direction: ToStr { +pub impl ToStr for direction { pure fn to_str(&self) -> ~str { match *self { send => ~"Send", @@ -156,7 +156,6 @@ pub struct protocol_ { } pub impl protocol_ { - /// Get a state. fn get_state(name: ~str) -> state { self.states.find(|i| i.name == name).get() |
