From 32ad4ae4cde68fed1b132be79bc9068b020d270b Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 13 Nov 2012 19:08:01 -0800 Subject: 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 --- src/libsyntax/parse/parser.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/libsyntax/parse/parser.rs') 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 with references to as arguments. -- cgit 1.4.1-3-g733a5