syntax: Fix parsing global generics (Closes #5572)
This commit is contained in:
parent
4e9a63ff91
commit
b26ae289d0
2 changed files with 6 additions and 2 deletions
|
@ -2728,8 +2728,9 @@ pub impl Parser {
|
||||||
}
|
}
|
||||||
self.bump();
|
self.bump();
|
||||||
}
|
}
|
||||||
token::IDENT(*) => {
|
token::MOD_SEP | token::IDENT(*) => {
|
||||||
let maybe_bound = match *self.token {
|
let maybe_bound = match *self.token {
|
||||||
|
token::MOD_SEP => None,
|
||||||
token::IDENT(copy sid, _) => {
|
token::IDENT(copy sid, _) => {
|
||||||
match *self.id_to_str(sid) {
|
match *self.id_to_str(sid) {
|
||||||
~"send" |
|
~"send" |
|
||||||
|
@ -2757,7 +2758,7 @@ pub impl Parser {
|
||||||
result.push(bound);
|
result.push(bound);
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
let ty = self.parse_ty(false);
|
let ty = self.parse_ty(true);
|
||||||
result.push(TraitTyParamBound(ty));
|
result.push(TraitTyParamBound(ty));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
3
src/test/run-pass/issue-5572.rs
Normal file
3
src/test/run-pass/issue-5572.rs
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
fn foo<T: ::cmp::Eq>(t: T) { }
|
||||||
|
|
||||||
|
fn main() { }
|
Loading…
Add table
Add a link
Reference in a new issue