diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-11-29 18:37:33 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-11-29 22:07:49 -0800 |
| commit | 3ed9fbd63c6a3c6226bc466786e6d3c1bfec856d (patch) | |
| tree | 3552c8b37426ce0763648cb056f37f03a7b777ed /src/libsyntax | |
| parent | 78ee821154ba6034a86397d8540fec00c94e9282 (diff) | |
| download | rust-3ed9fbd63c6a3c6226bc466786e6d3c1bfec856d.tar.gz rust-3ed9fbd63c6a3c6226bc466786e6d3c1bfec856d.zip | |
impls of traits cannot define methods on the anonymous trait
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/pipes/ast_builder.rs | 3 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/mod.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/parse_proto.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/pipec.rs | 5 | ||||
| -rw-r--r-- | src/libsyntax/ext/trace_macros.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax/parse/common.rs | 36 | ||||
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax/parse/obsolete.rs | 7 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 2 |
9 files changed, 12 insertions, 45 deletions
diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs index 652ad5533c4..e9bb42aa2a1 100644 --- a/src/libsyntax/ext/pipes/ast_builder.rs +++ b/src/libsyntax/ext/pipes/ast_builder.rs @@ -79,7 +79,10 @@ trait ext_ctxt_ast_builder { fn stmt_let(ident: ident, e: @ast::expr) -> @ast::stmt; fn stmt_expr(e: @ast::expr) -> @ast::stmt; fn block_expr(b: ast::blk) -> @ast::expr; + fn move_expr(e: @ast::expr) -> @ast::expr; fn ty_option(ty: @ast::Ty) -> @ast::Ty; + fn ty_infer() -> @ast::Ty; + fn ty_nil_ast_builder() -> @ast::Ty; } impl ext_ctxt: ext_ctxt_ast_builder { diff --git a/src/libsyntax/ext/pipes/mod.rs b/src/libsyntax/ext/pipes/mod.rs index b064f39eb3a..9f5c722afc3 100644 --- a/src/libsyntax/ext/pipes/mod.rs +++ b/src/libsyntax/ext/pipes/mod.rs @@ -38,7 +38,6 @@ use ext::base::ext_ctxt; use ast::tt_delim; use parse::lexer::{new_tt_reader, reader}; use parse::parser::Parser; -use parse::common::parser_common; use pipes::parse_proto::proto_parser; diff --git a/src/libsyntax/ext/pipes/parse_proto.rs b/src/libsyntax/ext/pipes/parse_proto.rs index 8f2b92a720c..9db2c1e6733 100644 --- a/src/libsyntax/ext/pipes/parse_proto.rs +++ b/src/libsyntax/ext/pipes/parse_proto.rs @@ -8,6 +8,7 @@ use pipec::*; trait proto_parser { fn parse_proto(id: ~str) -> protocol; fn parse_state(proto: protocol); + fn parse_message(state: state); } impl parser::Parser: proto_parser { diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs index 907a193d05c..558e7d01259 100644 --- a/src/libsyntax/ext/pipes/pipec.rs +++ b/src/libsyntax/ext/pipes/pipec.rs @@ -24,6 +24,7 @@ mod syntax { trait gen_send { fn gen_send(cx: ext_ctxt, try: bool) -> @ast::item; + fn to_ty(cx: ext_ctxt) -> @ast::Ty; } trait to_type_decls { @@ -34,6 +35,10 @@ trait to_type_decls { trait gen_init { fn gen_init(cx: ext_ctxt) -> @ast::item; fn compile(cx: ext_ctxt) -> @ast::item; + fn buffer_ty_path(cx: ext_ctxt) -> @ast::Ty; + fn gen_buffer_type(cx: ext_ctxt) -> @ast::item; + fn gen_buffer_init(ext_cx: ext_ctxt) -> @ast::expr; + fn gen_init_bounded(ext_cx: ext_ctxt) -> @ast::expr; } impl message: gen_send { diff --git a/src/libsyntax/ext/trace_macros.rs b/src/libsyntax/ext/trace_macros.rs index f8c85fa01b7..fb0d4bb128e 100644 --- a/src/libsyntax/ext/trace_macros.rs +++ b/src/libsyntax/ext/trace_macros.rs @@ -3,7 +3,6 @@ use ext::base::ext_ctxt; use ast::tt_delim; use parse::lexer::{new_tt_reader, reader}; use parse::parser::Parser; -use parse::common::parser_common; fn expand_trace_macros(cx: ext_ctxt, sp: span, tt: ~[ast::token_tree]) -> base::mac_result diff --git a/src/libsyntax/parse/common.rs b/src/libsyntax/parse/common.rs index 1811951fc0e..54ac776fb32 100644 --- a/src/libsyntax/parse/common.rs +++ b/src/libsyntax/parse/common.rs @@ -22,41 +22,7 @@ fn token_to_str(reader: reader, ++token: token::Token) -> ~str { token::to_str(reader.interner(), token) } -trait parser_common { - fn unexpected_last(t: token::Token) -> !; - fn unexpected() -> !; - fn expect(t: token::Token); - fn parse_ident() -> ast::ident; - fn parse_path_list_ident() -> ast::path_list_ident; - fn parse_value_ident() -> ast::ident; - fn eat(tok: token::Token) -> bool; - // A sanity check that the word we are asking for is a known keyword - fn require_keyword(word: ~str); - fn token_is_keyword(word: ~str, ++tok: token::Token) -> bool; - fn is_keyword(word: ~str) -> bool; - fn is_any_keyword(tok: token::Token) -> bool; - fn eat_keyword(word: ~str) -> bool; - fn expect_keyword(word: ~str); - fn expect_gt(); - fn parse_seq_to_before_gt<T: Copy>(sep: Option<token::Token>, - f: fn(Parser) -> T) -> ~[T]; - fn parse_seq_to_gt<T: Copy>(sep: Option<token::Token>, - f: fn(Parser) -> T) -> ~[T]; - fn parse_seq_lt_gt<T: Copy>(sep: Option<token::Token>, - f: fn(Parser) -> T) -> spanned<~[T]>; - fn parse_seq_to_end<T: Copy>(ket: token::Token, sep: seq_sep, - f: fn(Parser) -> T) -> ~[T]; - fn parse_seq_to_before_end<T: Copy>(ket: token::Token, sep: seq_sep, - f: fn(Parser) -> T) -> ~[T]; - fn parse_unspanned_seq<T: Copy>(bra: token::Token, - ket: token::Token, - sep: seq_sep, - f: fn(Parser) -> T) -> ~[T]; - fn parse_seq<T: Copy>(bra: token::Token, ket: token::Token, sep: seq_sep, - f: fn(Parser) -> T) -> spanned<~[T]>; -} - -impl Parser: parser_common { +impl Parser { fn unexpected_last(t: token::Token) -> ! { self.span_fatal( copy self.last_span, diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index c290e7cf307..c1afc43205c 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -27,7 +27,6 @@ export parse_from_source_str; use parser::Parser; use attr::parser_attr; -use common::parser_common; use ast::node_id; use util::interner; use diagnostic::{span_handler, mk_span_handler, mk_handler, emitter}; diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs index 89f2ef4d939..1407b56336c 100644 --- a/src/libsyntax/parse/obsolete.rs +++ b/src/libsyntax/parse/obsolete.rs @@ -52,12 +52,7 @@ impl ObsoleteSyntax: to_bytes::IterBytes { } } -pub trait ObsoleteReporter { - fn obsolete(sp: span, kind: ObsoleteSyntax); - fn obsolete_expr(sp: span, kind: ObsoleteSyntax) -> @expr; -} - -impl Parser : ObsoleteReporter { +impl Parser { /// Reports an obsolete syntax non-fatal error. fn obsolete(sp: span, kind: ObsoleteSyntax) { let (kind_str, desc) = match kind { diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 96364790956..d8fd58b3d50 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -16,7 +16,7 @@ use common::{seq_sep_trailing_disallowed, seq_sep_trailing_allowed, use dvec::DVec; use vec::{push}; use obsolete::{ - ObsoleteReporter, ObsoleteSyntax, + ObsoleteSyntax, ObsoleteLowerCaseKindBounds, ObsoleteLet, ObsoleteFieldTerminator, ObsoleteStructCtor, ObsoleteWith, ObsoleteClassMethod, ObsoleteClassTraits, |
