diff options
| author | bors <bors@rust-lang.org> | 2013-04-05 18:00:52 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-04-05 18:00:52 -0700 |
| commit | 08e2cf846aebf5a9f5e53881814976a3beee89a7 (patch) | |
| tree | ed81332bccf792d086d46c604b724a444f8656d0 /src/libsyntax/parse | |
| parent | babe50633349cd29f0a0757079e0e13bdc0310fa (diff) | |
| parent | 13801f60b26009991cd6880b6b40fae9265a8280 (diff) | |
| download | rust-08e2cf846aebf5a9f5e53881814976a3beee89a7.tar.gz rust-08e2cf846aebf5a9f5e53881814976a3beee89a7.zip | |
auto merge of #5676 : nikomatsakis/rust/issue-4183-trait_ref, r=nikomatsakis
These are a number of incremental steps towards #4183 and #4646.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 1d780c9b806..3a3597828cd 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2750,8 +2750,8 @@ pub impl Parser { self.bump(); } token::MOD_SEP | token::IDENT(*) => { - let maybe_bound = match *self.token { - token::MOD_SEP => None, + let obsolete_bound = match *self.token { + token::MOD_SEP => false, token::IDENT(copy sid, _) => { match *self.id_to_str(sid) { ~"send" | @@ -2761,27 +2761,18 @@ pub impl Parser { self.obsolete( *self.span, ObsoleteLowerCaseKindBounds); - - // Bogus value, but doesn't matter, since - // is an error - Some(TraitTyParamBound( - self.mk_ty_path(sid))) + self.bump(); + true } - _ => None + _ => false } } _ => fail!() }; - match maybe_bound { - Some(bound) => { - self.bump(); - result.push(bound); - } - None => { - let ty = self.parse_ty(true); - result.push(TraitTyParamBound(ty)); - } + if !obsolete_bound { + let tref = self.parse_trait_ref(); + result.push(TraitTyParamBound(tref)); } } _ => break, |
