Skip to content

Commit b26ae28

Browse files
committed
syntax: Fix parsing global generics (Closes #5572)
1 parent 4e9a63f commit b26ae28

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2728,8 +2728,9 @@ pub impl Parser {
27282728
}
27292729
self.bump();
27302730
}
2731-
token::IDENT(*) => {
2731+
token::MOD_SEP | token::IDENT(*) => {
27322732
let maybe_bound = match *self.token {
2733+
token::MOD_SEP => None,
27332734
token::IDENT(copy sid, _) => {
27342735
match *self.id_to_str(sid) {
27352736
~"send" |
@@ -2757,7 +2758,7 @@ pub impl Parser {
27572758
result.push(bound);
27582759
}
27592760
None => {
2760-
let ty = self.parse_ty(false);
2761+
let ty = self.parse_ty(true);
27612762
result.push(TraitTyParamBound(ty));
27622763
}
27632764
}

src/test/run-pass/issue-5572.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn foo<T: ::cmp::Eq>(t: T) { }
2+
3+
fn main() { }

0 commit comments

Comments
 (0)