summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-09-05 15:31:38 -0700
committerBrian Anderson <banderson@mozilla.com>2012-09-05 15:31:38 -0700
commitf7681f9236168cfad661b0ad73798a2d54a941f1 (patch)
tree6278ebff80e0c1f514c68c41dc49faac33cfa2ea /src/libsyntax/parse
parente7fe903d882ba3206016442f2a743ba8369abf97 (diff)
downloadrust-f7681f9236168cfad661b0ad73798a2d54a941f1.tar.gz
rust-f7681f9236168cfad661b0ad73798a2d54a941f1.zip
Accept Copy, Send, Const, Owned, as kind bounds
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 4ec5a57e736..b1205c77fe8 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -2262,6 +2262,30 @@ struct parser {
                     push(bounds, bound_const);
                 } else if self.eat_keyword(~"owned") {
                     push(bounds, bound_owned);
+                } else if is_ident(self.token) {
+                    // XXX: temporary until kinds become traits
+                    let maybe_bound = match self.token {
+                      token::IDENT(sid, _) => {
+                        match *self.id_to_str(sid) {
+                          ~"Send" => Some(bound_send),
+                          ~"Copy" => Some(bound_copy),
+                          ~"Const" => Some(bound_const),
+                          ~"Owned" => Some(bound_owned),
+                          _ => None
+                        }
+                      }
+                      _ => fail
+                    };
+
+                    match maybe_bound {
+                      Some(bound) => {
+                        self.bump();
+                        push(bounds, bound);
+                      }
+                      None => {
+                        push(bounds, bound_trait(self.parse_ty(false)));
+                      }
+                    }
                 } else {
                     push(bounds, bound_trait(self.parse_ty(false)));
                 }