diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-02-14 11:47:00 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-02-14 11:47:00 -0800 |
| commit | e8f36d5ea0a56250109d93656130b442d2e59e4c (patch) | |
| tree | d8b1be86a79e6b1c0a48141857421386cbbab34a /src/libsyntax | |
| parent | 36edd256397d250ce35204ba1a0954609c25a20a (diff) | |
| download | rust-e8f36d5ea0a56250109d93656130b442d2e59e4c.tar.gz rust-e8f36d5ea0a56250109d93656130b442d2e59e4c.zip | |
librustc: Replace `impl Type : Trait` with `impl Trait for Type`. rs=implflipping
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/attr.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/diagnostic.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/auto_encode.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/base.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/quote.rs | 32 | ||||
| -rw-r--r-- | src/libsyntax/parse/attr.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/comments.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/lexer.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/token.rs | 2 |
9 files changed, 26 insertions, 26 deletions
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index 22f1e2d4753..e3d1fb9781b 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -326,7 +326,7 @@ pub enum inline_attr { ia_never, } -impl inline_attr : cmp::Eq { +impl cmp::Eq for inline_attr { pure fn eq(&self, other: &inline_attr) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index e44ee4eef0a..2b24d03f8e9 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -63,7 +63,7 @@ struct CodemapT { cm: @codemap::CodeMap, } -impl CodemapT: span_handler { +impl span_handler for CodemapT { fn span_fatal(@mut self, sp: span, msg: &str) -> ! { self.handler.emit(Some((self.cm, sp)), msg, fatal); fail!(); @@ -89,7 +89,7 @@ impl CodemapT: span_handler { } } -impl HandlerT: handler { +impl handler for HandlerT { fn fatal(@mut self, msg: &str) -> ! { (self.emit)(None, msg, fatal); fail!(); diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs index c854fca6424..9c0550c9875 100644 --- a/src/libsyntax/ext/auto_encode.rs +++ b/src/libsyntax/ext/auto_encode.rs @@ -23,7 +23,7 @@ For example, a type like: would generate two implementations like: -impl<S: std::serialize::Encoder> Node: Encodable<S> { +impl<S: std::serialize::Encoder> Encodable<S> for Node { fn encode(&self, s: &S) { do s.emit_struct("Node", 1) { s.emit_field("id", 0, || s.emit_uint(self.id)) @@ -31,7 +31,7 @@ impl<S: std::serialize::Encoder> Node: Encodable<S> { } } -impl<D: Decoder> node_id: Decodable { +impl<D: Decoder> Decodable for node_id { static fn decode(d: &D) -> Node { do d.read_struct("Node", 1) { Node { diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index c924acd577d..951e350f8b2 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -197,7 +197,7 @@ pub fn mk_ctxt(parse_sess: parse::parse_sess, mod_path: ~[ast::ident], trace_mac: bool } - impl CtxtRepr: ext_ctxt { + impl ext_ctxt for CtxtRepr { fn codemap(@mut self) -> @CodeMap { self.parse_sess.cm } fn parse_sess(@mut self) -> parse::parse_sess { self.parse_sess } fn cfg(@mut self) -> ast::crate_cfg { self.cfg } diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 4522c7e0fd6..ffa6101d58f 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -53,7 +53,7 @@ pub mod rt { pub fn to_tokens(_cx: ext_ctxt) -> ~[token_tree]; } - impl ~[token_tree]: ToTokens { + impl ToTokens for ~[token_tree] { pub fn to_tokens(_cx: ext_ctxt) -> ~[token_tree] { copy self } @@ -78,43 +78,43 @@ pub mod rt { pub fn to_source(cx: ext_ctxt) -> ~str; } - impl ast::ident: ToSource { + impl ToSource for ast::ident { fn to_source(cx: ext_ctxt) -> ~str { copy *cx.parse_sess().interner.get(self) } } - impl @ast::item: ToSource { + impl ToSource for @ast::item { fn to_source(cx: ext_ctxt) -> ~str { item_to_str(self, cx.parse_sess().interner) } } - impl ~[@ast::item]: ToSource { + impl ToSource for ~[@ast::item] { fn to_source(cx: ext_ctxt) -> ~str { str::connect(self.map(|i| i.to_source(cx)), ~"\n\n") } } - impl @ast::Ty: ToSource { + impl ToSource for @ast::Ty { fn to_source(cx: ext_ctxt) -> ~str { ty_to_str(self, cx.parse_sess().interner) } } - impl ~[@ast::Ty]: ToSource { + impl ToSource for ~[@ast::Ty] { fn to_source(cx: ext_ctxt) -> ~str { str::connect(self.map(|i| i.to_source(cx)), ~", ") } } - impl ~[ast::ty_param]: ToSource { + impl ToSource for ~[ast::ty_param] { fn to_source(cx: ext_ctxt) -> ~str { pprust::typarams_to_str(self, cx.parse_sess().interner) } } - impl @ast::expr: ToSource { + impl ToSource for @ast::expr { fn to_source(cx: ext_ctxt) -> ~str { pprust::expr_to_str(self, cx.parse_sess().interner) } @@ -122,43 +122,43 @@ pub mod rt { // Alas ... we write these out instead. All redundant. - impl ast::ident: ToTokens { + impl ToTokens for ast::ident { fn to_tokens(cx: ext_ctxt) -> ~[token_tree] { cx.parse_tts(self.to_source(cx)) } } - impl @ast::item: ToTokens { + impl ToTokens for @ast::item { fn to_tokens(cx: ext_ctxt) -> ~[token_tree] { cx.parse_tts(self.to_source(cx)) } } - impl ~[@ast::item]: ToTokens { + impl ToTokens for ~[@ast::item] { fn to_tokens(cx: ext_ctxt) -> ~[token_tree] { cx.parse_tts(self.to_source(cx)) } } - impl @ast::Ty: ToTokens { + impl ToTokens for @ast::Ty { fn to_tokens(cx: ext_ctxt) -> ~[token_tree] { cx.parse_tts(self.to_source(cx)) } } - impl ~[@ast::Ty]: ToTokens { + impl ToTokens for ~[@ast::Ty] { fn to_tokens(cx: ext_ctxt) -> ~[token_tree] { cx.parse_tts(self.to_source(cx)) } } - impl ~[ast::ty_param]: ToTokens { + impl ToTokens for ~[ast::ty_param] { fn to_tokens(cx: ext_ctxt) -> ~[token_tree] { cx.parse_tts(self.to_source(cx)) } } - impl @ast::expr: ToTokens { + impl ToTokens for @ast::expr { fn to_tokens(cx: ext_ctxt) -> ~[token_tree] { cx.parse_tts(self.to_source(cx)) } @@ -171,7 +171,7 @@ pub mod rt { fn parse_tts(s: ~str) -> ~[ast::token_tree]; } - impl ext_ctxt: ExtParseUtils { + impl ExtParseUtils for ext_ctxt { fn parse_item(s: ~str) -> @ast::item { let res = parse::parse_item_from_source_str( diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs index e6ba543cf79..e297e33d825 100644 --- a/src/libsyntax/parse/attr.rs +++ b/src/libsyntax/parse/attr.rs @@ -30,7 +30,7 @@ pub trait parser_attr { fn parse_optional_meta() -> ~[@ast::meta_item]; } -impl Parser: parser_attr { +impl parser_attr for Parser { // Parse attributes that appear before an item fn parse_outer_attributes() -> ~[ast::attribute] { diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index 1e17cf3543d..2cadf195778 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -34,7 +34,7 @@ pub enum cmnt_style { blank_line, // Just a manual blank line "\n\n", for layout } -impl cmnt_style : cmp::Eq { +impl cmp::Eq for cmnt_style { pure fn eq(&self, other: &cmnt_style) -> bool { ((*self) as uint) == ((*other) as uint) } diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index 48ba94bdc33..f5fbefdd89b 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -108,7 +108,7 @@ fn dup_string_reader(r: @mut StringReader) -> @mut StringReader { } } -impl StringReader: reader { +impl reader for StringReader { fn is_eof(@mut self) -> bool { is_eof(self) } // return the next token. EFFECT: advances the string_reader. fn next_token(@mut self) -> TokenAndSpan { diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 92d25d5d193..3279c79e5af 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -520,7 +520,7 @@ pub fn reserved_keyword_table() -> HashMap<~str, ()> { } -impl Token : cmp::Eq { +impl cmp::Eq for Token { pure fn eq(&self, other: &Token) -> bool { match (*self) { EQ => { |
