about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs25
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,