diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2012-11-13 19:08:01 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2012-11-14 11:36:55 -0800 |
| commit | 32ad4ae4cde68fed1b132be79bc9068b020d270b (patch) | |
| tree | 174cee72ef970f110f1cf22a190641b0c834f264 /src/libsyntax/parse | |
| parent | 3e14ada4f6782f1379abe498b2b2d9681f489e26 (diff) | |
| download | rust-32ad4ae4cde68fed1b132be79bc9068b020d270b.tar.gz rust-32ad4ae4cde68fed1b132be79bc9068b020d270b.zip | |
librustc: Require the #[derivable] attribute, remove the significance of "impl Foo : Bar;", and allow only a subset of methods in a trait to be derived. r=brson
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index c5f3b1b5306..49c3d38ce55 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2687,19 +2687,15 @@ impl Parser { None }; - let meths_opt; - if self.eat(token::SEMI) { - meths_opt = None; - } else { - let mut meths = ~[]; + let mut meths = ~[]; + if !self.eat(token::SEMI) { self.expect(token::LBRACE); while !self.eat(token::RBRACE) { meths.push(self.parse_method()); } - meths_opt = Some(move meths); } - (ident, item_impl(tps, opt_trait, ty, meths_opt), None) + (ident, item_impl(tps, opt_trait, ty, meths), None) } // Instantiates ident <i> with references to <typarams> as arguments. |
