about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-09-07 14:52:28 -0700
committerBrian Anderson <banderson@mozilla.com>2012-09-07 18:10:11 -0700
commit3bd1f32cd945fab63777b71ef76f23d758e2904c (patch)
tree8035a0aa8bf9fa926484604074427146ec295b1d /src/libsyntax
parent07fe5611ade0e02109a5fa72881c6cd43bacbb29 (diff)
downloadrust-3bd1f32cd945fab63777b71ef76f23d758e2904c.tar.gz
rust-3bd1f32cd945fab63777b71ef76f23d758e2904c.zip
Convert all kind bounds to camel case. Remove send, owned keywords.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast_util.rs2
-rw-r--r--src/libsyntax/diagnostic.rs2
-rw-r--r--src/libsyntax/ext/simplext.rs2
-rw-r--r--src/libsyntax/parse/common.rs28
-rw-r--r--src/libsyntax/parse/parser.rs10
-rw-r--r--src/libsyntax/parse/token.rs3
-rw-r--r--src/libsyntax/print/pprust.rs8
-rw-r--r--src/libsyntax/util/interner.rs10
8 files changed, 28 insertions, 37 deletions
diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs
index 97dcb922c43..474f0ede109 100644
--- a/src/libsyntax/ast_util.rs
+++ b/src/libsyntax/ast_util.rs
@@ -259,7 +259,7 @@ impl def_id : core::to_bytes::IterBytes {
     }
 }
 
-fn new_def_hash<V: copy>() -> std::map::hashmap<ast::def_id, V> {
+fn new_def_hash<V: Copy>() -> std::map::hashmap<ast::def_id, V> {
     return std::map::hashmap::<ast::def_id, V>();
 }
 
diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs
index 99296f72eb7..66553162b25 100644
--- a/src/libsyntax/diagnostic.rs
+++ b/src/libsyntax/diagnostic.rs
@@ -271,7 +271,7 @@ fn print_macro_backtrace(cm: codemap::codemap, sp: span) {
     }
 }
 
-fn expect<T: copy>(diag: span_handler,
+fn expect<T: Copy>(diag: span_handler,
                    opt: Option<T>, msg: fn() -> ~str) -> T {
     match opt {
        Some(t) => t,
diff --git a/src/libsyntax/ext/simplext.rs b/src/libsyntax/ext/simplext.rs
index 32db095a1df..bb5af8402df 100644
--- a/src/libsyntax/ext/simplext.rs
+++ b/src/libsyntax/ext/simplext.rs
@@ -88,7 +88,7 @@ fn elts_to_ell(cx: ext_ctxt, elts: ~[@expr]) ->
     }
 }
 
-fn option_flatten_map<T: copy, U: copy>(f: fn@(T) -> Option<U>, v: ~[T]) ->
+fn option_flatten_map<T: Copy, U: Copy>(f: fn@(T) -> Option<U>, v: ~[T]) ->
    Option<~[U]> {
     let mut res = ~[];
     for v.each |elem| {
diff --git a/src/libsyntax/parse/common.rs b/src/libsyntax/parse/common.rs
index 6fc05e1f5bd..478288ba4cd 100644
--- a/src/libsyntax/parse/common.rs
+++ b/src/libsyntax/parse/common.rs
@@ -41,21 +41,21 @@ trait parser_common {
     fn check_restricted_keywords();
     fn check_restricted_keywords_(w: ~str);
     fn expect_gt();
-    fn parse_seq_to_before_gt<T: copy>(sep: Option<token::token>,
+    fn parse_seq_to_before_gt<T: Copy>(sep: Option<token::token>,
                                        f: fn(parser) -> T) -> ~[T];
-    fn parse_seq_to_gt<T: copy>(sep: Option<token::token>,
+    fn parse_seq_to_gt<T: Copy>(sep: Option<token::token>,
                                 f: fn(parser) -> T) -> ~[T];
-    fn parse_seq_lt_gt<T: copy>(sep: Option<token::token>,
+    fn parse_seq_lt_gt<T: Copy>(sep: Option<token::token>,
                                 f: fn(parser) -> T) -> spanned<~[T]>;
-    fn parse_seq_to_end<T: copy>(ket: token::token, sep: seq_sep,
+    fn parse_seq_to_end<T: Copy>(ket: token::token, sep: seq_sep,
                                  f: fn(parser) -> T) -> ~[T];
-    fn parse_seq_to_before_end<T: copy>(ket: token::token, sep: seq_sep,
+    fn parse_seq_to_before_end<T: Copy>(ket: token::token, sep: seq_sep,
                                         f: fn(parser) -> T) -> ~[T];
-    fn parse_unspanned_seq<T: copy>(bra: token::token,
+    fn parse_unspanned_seq<T: Copy>(bra: token::token,
                                     ket: token::token,
                                     sep: seq_sep,
                                     f: fn(parser) -> T) -> ~[T];
-    fn parse_seq<T: copy>(bra: token::token, ket: token::token, sep: seq_sep,
+    fn parse_seq<T: Copy>(bra: token::token, ket: token::token, sep: seq_sep,
                           f: fn(parser) -> T) -> spanned<~[T]>;
 }
 
@@ -198,7 +198,7 @@ impl parser: parser_common {
         }
     }
 
-    fn parse_seq_to_before_gt<T: copy>(sep: Option<token::token>,
+    fn parse_seq_to_before_gt<T: Copy>(sep: Option<token::token>,
                                        f: fn(parser) -> T) -> ~[T] {
         let mut first = true;
         let mut v = ~[];
@@ -217,7 +217,7 @@ impl parser: parser_common {
         return v;
     }
 
-    fn parse_seq_to_gt<T: copy>(sep: Option<token::token>,
+    fn parse_seq_to_gt<T: Copy>(sep: Option<token::token>,
                                 f: fn(parser) -> T) -> ~[T] {
         let v = self.parse_seq_to_before_gt(sep, f);
         self.expect_gt();
@@ -225,7 +225,7 @@ impl parser: parser_common {
         return v;
     }
 
-    fn parse_seq_lt_gt<T: copy>(sep: Option<token::token>,
+    fn parse_seq_lt_gt<T: Copy>(sep: Option<token::token>,
                                 f: fn(parser) -> T) -> spanned<~[T]> {
         let lo = self.span.lo;
         self.expect(token::LT);
@@ -235,7 +235,7 @@ impl parser: parser_common {
         return spanned(lo, hi, result);
     }
 
-    fn parse_seq_to_end<T: copy>(ket: token::token, sep: seq_sep,
+    fn parse_seq_to_end<T: Copy>(ket: token::token, sep: seq_sep,
                                  f: fn(parser) -> T) -> ~[T] {
         let val = self.parse_seq_to_before_end(ket, sep, f);
         self.bump();
@@ -243,7 +243,7 @@ impl parser: parser_common {
     }
 
 
-    fn parse_seq_to_before_end<T: copy>(ket: token::token, sep: seq_sep,
+    fn parse_seq_to_before_end<T: Copy>(ket: token::token, sep: seq_sep,
                                         f: fn(parser) -> T) -> ~[T] {
         let mut first: bool = true;
         let mut v: ~[T] = ~[];
@@ -261,7 +261,7 @@ impl parser: parser_common {
         return v;
     }
 
-    fn parse_unspanned_seq<T: copy>(bra: token::token,
+    fn parse_unspanned_seq<T: Copy>(bra: token::token,
                                     ket: token::token,
                                     sep: seq_sep,
                                     f: fn(parser) -> T) -> ~[T] {
@@ -273,7 +273,7 @@ impl parser: parser_common {
 
     // NB: Do not use this function unless you actually plan to place the
     // spanned list in the AST.
-    fn parse_seq<T: copy>(bra: token::token, ket: token::token, sep: seq_sep,
+    fn parse_seq<T: Copy>(bra: token::token, ket: token::token, sep: seq_sep,
                           f: fn(parser) -> T) -> spanned<~[T]> {
         let lo = self.span.lo;
         self.expect(bra);
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 03a4c016b50..a38cc701dc3 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -2278,15 +2278,7 @@ struct parser {
         let mut bounds = ~[];
         if self.eat(token::COLON) {
             while is_ident(self.token) {
-                if self.eat_keyword(~"send") {
-                    push(bounds, bound_send); }
-                else if self.eat_keyword(~"copy") {
-                    push(bounds, bound_copy) }
-                else if self.eat_keyword(~"const") {
-                    push(bounds, bound_const);
-                } else if self.eat_keyword(~"owned") {
-                    push(bounds, bound_owned);
-                } else if is_ident(self.token) {
+                if is_ident(self.token) {
                     // XXX: temporary until kinds become traits
                     let maybe_bound = match self.token {
                       token::IDENT(sid, _) => {
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index c2099fa447f..cd7f75b15be 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -386,7 +386,7 @@ fn contextual_keyword_table() -> hashmap<~str, ()> {
         ~"else",
         ~"move",
         ~"priv", ~"pub",
-        ~"self", ~"send", ~"static",
+        ~"self", ~"static",
         ~"use"
     ];
     for keys.each |word| {
@@ -421,7 +421,6 @@ fn restricted_keyword_table() -> hashmap<~str, ()> {
         ~"if", ~"impl", ~"import",
         ~"let", ~"log", ~"loop",
         ~"match", ~"mod", ~"move", ~"mut",
-        ~"owned",
         ~"pure",
         ~"ref", ~"return",
         ~"struct",
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 3bf95983053..942963797cb 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -1658,10 +1658,10 @@ fn print_bounds(s: ps, bounds: @~[ast::ty_param_bound]) {
         for vec::each(*bounds) |bound| {
             nbsp(s);
             match bound {
-              ast::bound_copy => word(s.s, ~"copy"),
-              ast::bound_send => word(s.s, ~"send"),
-              ast::bound_const => word(s.s, ~"const"),
-              ast::bound_owned => word(s.s, ~"owned"),
+              ast::bound_copy => word(s.s, ~"Copy"),
+              ast::bound_send => word(s.s, ~"Send"),
+              ast::bound_const => word(s.s, ~"Const"),
+              ast::bound_owned => word(s.s, ~"Owned"),
               ast::bound_trait(t) => print_type(s, t)
             }
         }
diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs
index 59cdb6b98a7..ac2af21d087 100644
--- a/src/libsyntax/util/interner.rs
+++ b/src/libsyntax/util/interner.rs
@@ -8,18 +8,18 @@ use cmp::Eq;
 use hash::Hash;
 use to_bytes::IterBytes;
 
-type hash_interner<T: const> =
+type hash_interner<T: Const> =
     {map: hashmap<T, uint>,
      vect: DVec<T>};
 
-fn mk<T:Eq IterBytes Hash const copy>() -> interner<T> {
+fn mk<T:Eq IterBytes Hash Const Copy>() -> interner<T> {
     let m = map::hashmap::<T, uint>();
     let hi: hash_interner<T> =
         {map: m, vect: DVec()};
     return hi as interner::<T>;
 }
 
-fn mk_prefill<T:Eq IterBytes Hash const copy>(init: ~[T]) -> interner<T> {
+fn mk_prefill<T:Eq IterBytes Hash Const Copy>(init: ~[T]) -> interner<T> {
     let rv = mk();
     for init.each() |v| { rv.intern(v); }
     return rv;
@@ -27,14 +27,14 @@ fn mk_prefill<T:Eq IterBytes Hash const copy>(init: ~[T]) -> interner<T> {
 
 
 /* when traits can extend traits, we should extend index<uint,T> to get [] */
-trait interner<T:Eq IterBytes Hash const copy> {
+trait interner<T:Eq IterBytes Hash Const Copy> {
     fn intern(T) -> uint;
     fn gensym(T) -> uint;
     pure fn get(uint) -> T;
     fn len() -> uint;
 }
 
-impl <T:Eq IterBytes Hash const copy> hash_interner<T>: interner<T> {
+impl <T:Eq IterBytes Hash Const Copy> hash_interner<T>: interner<T> {
     fn intern(val: T) -> uint {
         match self.map.find(val) {
           Some(idx) => return idx,