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/parse | |
| 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/parse')
| -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 |
4 files changed, 3 insertions, 43 deletions
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, |
