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

This commit is contained in:
Patrick Walton 2012-11-13 19:08:01 -08:00
parent 3e14ada4f6
commit 32ad4ae4cd
29 changed files with 335 additions and 272 deletions

View file

@ -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.