syntax: Fix parsing global generics (Closes #5572)

This commit is contained in:
Erick Tryzelaar 2013-03-26 21:26:29 -07:00
parent 4e9a63ff91
commit b26ae289d0
2 changed files with 6 additions and 2 deletions

View file

@ -2728,8 +2728,9 @@ pub impl Parser {
}
self.bump();
}
token::IDENT(*) => {
token::MOD_SEP | token::IDENT(*) => {
let maybe_bound = match *self.token {
token::MOD_SEP => None,
token::IDENT(copy sid, _) => {
match *self.id_to_str(sid) {
~"send" |
@ -2757,7 +2758,7 @@ pub impl Parser {
result.push(bound);
}
None => {
let ty = self.parse_ty(false);
let ty = self.parse_ty(true);
result.push(TraitTyParamBound(ty));
}
}

View file

@ -0,0 +1,3 @@
fn foo<T: ::cmp::Eq>(t: T) { }
fn main() { }