]> git.lizzy.rs Git - rust.git/commitdiff
Convert all kind bounds to camel case. Remove send, owned keywords.
authorBrian Anderson <banderson@mozilla.com>
Fri, 7 Sep 2012 21:52:28 +0000 (14:52 -0700)
committerBrian Anderson <banderson@mozilla.com>
Sat, 8 Sep 2012 01:10:11 +0000 (18:10 -0700)
167 files changed:
doc/rust.md
doc/tutorial.md
src/fuzzer/fuzzer.rs
src/libcore/at_vec.rs
src/libcore/comm.rs
src/libcore/dlist.rs
src/libcore/dvec.rs
src/libcore/either.rs
src/libcore/future.rs
src/libcore/iter-trait.rs
src/libcore/iter.rs
src/libcore/option.rs
src/libcore/pipes.rs
src/libcore/priv.rs
src/libcore/rand.rs
src/libcore/result.rs
src/libcore/send_map.rs
src/libcore/task.rs
src/libcore/to_str.rs
src/libcore/tuple.rs
src/libcore/unsafe.rs
src/libcore/util.rs
src/libcore/vec.rs
src/libstd/arc.rs
src/libstd/c_vec.rs
src/libstd/comm.rs
src/libstd/deque.rs
src/libstd/fun_treemap.rs
src/libstd/json.rs
src/libstd/list.rs
src/libstd/map.rs
src/libstd/par.rs
src/libstd/serialization.rs
src/libstd/smallintmap.rs
src/libstd/sort.rs
src/libstd/sync.rs
src/libstd/timer.rs
src/libstd/treemap.rs
src/libsyntax/ast_util.rs
src/libsyntax/diagnostic.rs
src/libsyntax/ext/simplext.rs
src/libsyntax/parse/common.rs
src/libsyntax/parse/parser.rs
src/libsyntax/parse/token.rs
src/libsyntax/print/pprust.rs
src/libsyntax/util/interner.rs
src/rustc/driver/session.rs
src/rustc/front/core_inject.rs
src/rustc/front/test.rs
src/rustc/metadata/encoder.rs
src/rustc/metadata/filesearch.rs
src/rustc/middle/borrowck.rs
src/rustc/middle/resolve.rs
src/rustc/middle/trans/debuginfo.rs
src/rustc/middle/trans/shape.rs
src/rustc/middle/ty.rs
src/rustc/middle/typeck/astconv.rs
src/rustc/middle/typeck/check.rs
src/rustc/middle/typeck/collect.rs
src/rustc/middle/typeck/infer.rs
src/rustc/middle/typeck/infer/to_str.rs
src/rustc/middle/typeck/infer/unify.rs
src/rustc/middle/typeck/rscope.rs
src/rustdoc/astsrv.rs
src/rustdoc/attr_pass.rs
src/rustdoc/fold.rs
src/test/auxiliary/cci_capture_clause.rs
src/test/auxiliary/cci_nested_lib.rs
src/test/auxiliary/issue-2526.rs
src/test/auxiliary/issue-2631-a.rs
src/test/auxiliary/static-methods-crate.rs
src/test/auxiliary/test_comm.rs
src/test/bench/pingpong.rs
src/test/bench/shootout-k-nucleotide-pipes.rs
src/test/bench/shootout-k-nucleotide.rs
src/test/bench/task-perf-word-count-generic.rs
src/test/compile-fail/bad-method-typaram-kind.rs
src/test/compile-fail/fn-variance-2.rs
src/test/compile-fail/fn-variance-3.rs
src/test/compile-fail/infinite-instantiation.rs
src/test/compile-fail/issue-2587-2.rs
src/test/compile-fail/issue-2611-3.rs
src/test/compile-fail/issue-2611-4.rs
src/test/compile-fail/issue-2611-5.rs
src/test/compile-fail/issue-2718-a.rs
src/test/compile-fail/issue-2766-a.rs
src/test/compile-fail/kindck-owned-trait-contains.rs
src/test/compile-fail/kindck-owned-trait-scoped.rs
src/test/compile-fail/kindck-owned-trait.rs
src/test/compile-fail/kindck-owned.rs
src/test/compile-fail/liveness-use-after-send.rs
src/test/compile-fail/non-const.rs
src/test/compile-fail/tag-that-dare-not-speak-its-name.rs
src/test/compile-fail/tps-invariant-trait.rs
src/test/compile-fail/unique-unique-kind.rs
src/test/compile-fail/vec-concat-bug.rs
src/test/run-fail/bug-811.rs
src/test/run-fail/issue-2444.rs
src/test/run-fail/port-type.rs
src/test/run-pass/alignment-gep-tup-like-1.rs
src/test/run-pass/alignment-gep-tup-like-2.rs
src/test/run-pass/auto-instantiate.rs
src/test/run-pass/autobind.rs
src/test/run-pass/bounded-fn-type.rs
src/test/run-pass/box-unbox.rs
src/test/run-pass/class-impl-very-parameterized-trait.rs
src/test/run-pass/class-trait-bounded-param.rs
src/test/run-pass/close-over-big-then-small-data.rs
src/test/run-pass/const-bound.rs
src/test/run-pass/expr-alt-generic-box2.rs
src/test/run-pass/expr-alt-generic-unique1.rs
src/test/run-pass/expr-alt-generic-unique2.rs
src/test/run-pass/expr-alt-generic.rs
src/test/run-pass/expr-block-generic-box2.rs
src/test/run-pass/expr-block-generic-unique1.rs
src/test/run-pass/expr-block-generic-unique2.rs
src/test/run-pass/expr-block-generic.rs
src/test/run-pass/expr-fn.rs
src/test/run-pass/expr-if-generic-box2.rs
src/test/run-pass/expr-if-generic.rs
src/test/run-pass/fixed-point-bind-unique.rs
src/test/run-pass/fn-bare-spawn.rs
src/test/run-pass/generic-alias-box.rs
src/test/run-pass/generic-alias-unique.rs
src/test/run-pass/generic-box.rs
src/test/run-pass/generic-derived-type.rs
src/test/run-pass/generic-drop-glue.rs
src/test/run-pass/generic-exterior-box.rs
src/test/run-pass/generic-exterior-unique.rs
src/test/run-pass/generic-fn-infer.rs
src/test/run-pass/generic-fn-unique.rs
src/test/run-pass/generic-fn.rs
src/test/run-pass/generic-tup.rs
src/test/run-pass/generic-unique.rs
src/test/run-pass/issue-2288.rs
src/test/run-pass/issue-2311-2.rs
src/test/run-pass/issue-2445-b.rs
src/test/run-pass/issue-2445.rs
src/test/run-pass/issue-2550.rs
src/test/run-pass/issue-2611.rs
src/test/run-pass/issue-2718.rs
src/test/run-pass/issue-2734.rs
src/test/run-pass/issue-2735.rs
src/test/run-pass/issue-2904.rs
src/test/run-pass/issue-2930.rs
src/test/run-pass/issue-3149.rs
src/test/run-pass/issue-333.rs
src/test/run-pass/ivec-add.rs
src/test/run-pass/kindck-owned-trait-contains-1.rs
src/test/run-pass/monad.rs
src/test/run-pass/newtype-polymorphic.rs
src/test/run-pass/non-boolean-pure-fns.rs
src/test/run-pass/pipe-bank-proto.rs
src/test/run-pass/pipe-select.rs
src/test/run-pass/resource-generic.rs
src/test/run-pass/ret-none.rs
src/test/run-pass/send-type-inference.rs
src/test/run-pass/sendfn-deep-copy.rs
src/test/run-pass/sendfn-generic-fn.rs
src/test/run-pass/static-impl.rs
src/test/run-pass/static-method-test.rs
src/test/run-pass/trait-generic.rs
src/test/run-pass/type-param-constraints.rs
src/test/run-pass/uniq-cc-generic.rs
src/test/run-pass/unique-assign-generic.rs
src/test/run-pass/unique-generic-assign.rs
src/test/run-pass/unique-kinds.rs

index d16c2a6c07296d70bfccd525e7cb5e338d63e0bf..eeedc7473a0a91569bd7fc9fa9fefa8441a199ac 100644 (file)
@@ -449,7 +449,7 @@ Two examples of paths with type arguments:
 ~~~~
 # use std::map;
 # fn f() {
-# fn id<T:copy>(t: T) -> T { t }
+# fn id<T:Copy>(t: T) -> T { t }
 type t = map::hashmap<int,~str>;  // Type arguments used in a type expression
 let x = id::<int>(10);           // Type arguments used in a call expression
 # }
@@ -1056,7 +1056,7 @@ An example of a pure function that uses an unchecked block:
 ~~~~
 # use std::list::*;
 
-fn pure_foldl<T, U: copy>(ls: List<T>, u: U, f: fn(&&T, &&U) -> U) -> U {
+fn pure_foldl<T, U: Copy>(ls: List<T>, u: U, f: fn(&&T, &&U) -> U) -> U {
     match ls {
       Nil => u,
       Cons(hd, tl) => f(hd, pure_foldl(*tl, f(hd, u), f))
@@ -1110,7 +1110,7 @@ type can always be moved, but they can only be copied when the
 parameter is given a [`copy` bound](#type-kinds).
 
 ~~~~
-fn id<T: copy>(x: T) -> T { x }
+fn id<T: Copy>(x: T) -> T { x }
 ~~~~
 
 Similarly, [trait](#traits) bounds can be specified for type
@@ -2638,7 +2638,7 @@ Every struct item defines a type.
 Within the body of an item that has type parameter declarations, the names of its type parameters are types:
 
 ~~~~~~~
-fn map<A: copy, B: copy>(f: fn(A) -> B, xs: ~[A]) -> ~[B] {
+fn map<A: Copy, B: Copy>(f: fn(A) -> B, xs: ~[A]) -> ~[B] {
    if xs.len() == 0 { return ~[]; }
    let first: B = f(xs[0]);
    let rest: ~[B] = map(f, xs.slice(1, xs.len()));
@@ -2706,7 +2706,7 @@ Putting `x` into a shared box involves copying, and the `T` parameter
 is assumed to be noncopyable. To change that, a bound is declared:
 
 ~~~~
-fn box<T: copy>(x: T) -> @T { @x }
+fn box<T: Copy>(x: T) -> @T { @x }
 ~~~~
 
 Calling this second version of `box` on a noncopyable type is not
index 8234a8f751807a65e415825a5bd8e288cf86a4ac..25531e5975913ac94549ca768bab0919e237bc4f 100644 (file)
@@ -1583,20 +1583,20 @@ unless you explicitly declare that type parameter to have copyable
 // This does not compile
 fn head_bad<T>(v: ~[T]) -> T { v[0] }
 // This does
-fn head<T: copy>(v: ~[T]) -> T { v[0] }
+fn head<T: Copy>(v: ~[T]) -> T { v[0] }
 ~~~~
 
 When instantiating a generic function, you can only instantiate it
 with types that fit its kinds. So you could not apply `head` to a
 resource type. Rust has several kinds that can be used as type bounds:
 
-* `copy` - Copyable types. All types are copyable unless they
+* `Copy` - Copyable types. All types are copyable unless they
   are classes with destructors or otherwise contain
   classes with destructors.
-* `send` - Sendable types. All types are sendable unless they
+* `Send` - Sendable types. All types are sendable unless they
   contain shared boxes, closures, or other local-heap-allocated
   types.
-* `const` - Constant types. These are types that do not contain
+* `Const` - Constant types. These are types that do not contain
   mutable fields nor shared boxes.
 
 > ***Note:*** Rust type kinds are syntactically very similar to
@@ -2002,7 +2002,7 @@ and one for values. This means that this code is valid:
 ~~~~
 mod buffalo {
     type buffalo = int;
-    fn buffalo<buffalo: copy>(buffalo: buffalo) -> buffalo { buffalo }
+    fn buffalo<buffalo>(+buffalo: buffalo) -> buffalo { buffalo }
 }
 fn main() {
     let buffalo: buffalo::buffalo = 1;
index 0f9df3c98e491daec88b482bc4cb0cb656834050..c4dd4bcf4bc3f133eb5b07359de9ee07a0b7dafb 100644 (file)
@@ -239,7 +239,7 @@ fn check_variants_of_ast(crate: ast::crate, codemap: codemap::codemap,
                      pprust::ty_to_str, replace_ty_in_crate, cx);
 }
 
-fn check_variants_T<T: copy>(
+fn check_variants_T<T: Copy>(
   crate: ast::crate,
   codemap: codemap::codemap,
   filename: &Path,
index 4cf0b8f332dbfa3f4495547ce1994afb6e328764..717993e78c1256ea8306d35bac6915c07aa4d4a3 100644 (file)
@@ -89,7 +89,7 @@ fn vec_reserve_shared_actual(++t: *sys::TypeDesc,
 
 // Appending
 #[inline(always)]
-pure fn append<T: copy>(lhs: @[T], rhs: &[const T]) -> @[T] {
+pure fn append<T: Copy>(lhs: @[T], rhs: &[const T]) -> @[T] {
     do build_sized(lhs.len() + rhs.len()) |push| {
         for vec::each(lhs) |x| { push(x); }
         for uint::range(0, rhs.len()) |i| { push(rhs[i]); }
@@ -125,7 +125,7 @@ fn vec_reserve_shared_actual(++t: *sys::TypeDesc,
  * Creates an immutable vector of size `n_elts` and initializes the elements
  * to the value `t`.
  */
-pure fn from_elem<T: copy>(n_elts: uint, t: T) -> @[T] {
+pure fn from_elem<T: Copy>(n_elts: uint, t: T) -> @[T] {
     do build_sized(n_elts) |push| {
         let mut i: uint = 0u;
         while i < n_elts { push(t); i += 1u; }
@@ -133,7 +133,7 @@ fn vec_reserve_shared_actual(++t: *sys::TypeDesc,
 }
 
 #[cfg(notest)]
-impl<T: copy> @[T]: Add<&[const T],@[T]> {
+impl<T: Copy> @[T]: Add<&[const T],@[T]> {
     #[inline(always)]
     pure fn add(rhs: &[const T]) -> @[T] {
         append(self, rhs)
index f9d689759444482918a444bd7b66888a894cb40a..177ecdca9a2da8c82e0490b0c528b0ff0912796e 100644 (file)
@@ -48,7 +48,7 @@
  * transmitted. If a port value is copied, both copies refer to the same
  * port.  Ports may be associated with multiple `chan`s.
  */
-enum Port<T: send> {
+enum Port<T: Send> {
     Port_(@PortPtr<T>)
 }
 
@@ -64,16 +64,16 @@ enum Port<T: send> {
  * data will be silently dropped.  Channels may be duplicated and
  * themselves transmitted over other channels.
  */
-enum Chan<T: send> {
+enum Chan<T: Send> {
     Chan_(port_id)
 }
 
 /// Constructs a port
-fn Port<T: send>() -> Port<T> {
+fn Port<T: Send>() -> Port<T> {
     Port_(@PortPtr(rustrt::new_port(sys::size_of::<T>() as size_t)))
 }
 
-impl<T: send> Port<T> {
+impl<T: Send> Port<T> {
 
     fn chan() -> Chan<T> { Chan(self) }
     fn send(+v: T) { self.chan().send(v) }
@@ -82,7 +82,7 @@ fn peek() -> bool { peek(self) }
 
 }
 
-impl<T: send> Chan<T> {
+impl<T: Send> Chan<T> {
 
     fn chan() -> Chan<T> { self }
     fn send(+v: T) { send(self, v) }
@@ -92,12 +92,12 @@ fn peek() -> bool { peek_chan(self) }
 }
 
 /// Open a new receiving channel for the duration of a function
-fn listen<T: send, U>(f: fn(Chan<T>) -> U) -> U {
+fn listen<T: Send, U>(f: fn(Chan<T>) -> U) -> U {
     let po = Port();
     f(po.chan())
 }
 
-struct PortPtr<T:send> {
+struct PortPtr<T:Send> {
     po: *rust_port,
   drop unsafe {
       do task::unkillable {
@@ -121,7 +121,7 @@ struct PortPtr<T:send> {
   }
 }
 
-fn PortPtr<T: send>(po: *rust_port) -> PortPtr<T> {
+fn PortPtr<T: Send>(po: *rust_port) -> PortPtr<T> {
     PortPtr {
         po: po
     }
@@ -135,7 +135,7 @@ fn PortPtr<T: send>(po: *rust_port) -> PortPtr<T> {
  * Fails if the port is detached or dead. Fails if the port
  * is owned by a different task.
  */
-fn as_raw_port<T: send, U>(ch: comm::Chan<T>, f: fn(*rust_port) -> U) -> U {
+fn as_raw_port<T: Send, U>(ch: comm::Chan<T>, f: fn(*rust_port) -> U) -> U {
 
     struct PortRef {
         p: *rust_port,
@@ -167,7 +167,7 @@ fn PortRef(p: *rust_port) -> PortRef {
  * Constructs a channel. The channel is bound to the port used to
  * construct it.
  */
-fn Chan<T: send>(p: Port<T>) -> Chan<T> {
+fn Chan<T: Send>(p: Port<T>) -> Chan<T> {
     Chan_(rustrt::get_port_id((**p).po))
 }
 
@@ -175,7 +175,7 @@ fn Chan<T: send>(p: Port<T>) -> Chan<T> {
  * Sends data over a channel. The sent data is moved into the channel,
  * whereupon the caller loses access to it.
  */
-fn send<T: send>(ch: Chan<T>, +data: T) {
+fn send<T: Send>(ch: Chan<T>, +data: T) {
     let Chan_(p) = ch;
     let data_ptr = ptr::addr_of(data) as *();
     let res = rustrt::rust_port_id_send(p, data_ptr);
@@ -190,22 +190,22 @@ fn send<T: send>(ch: Chan<T>, +data: T) {
  * Receive from a port.  If no data is available on the port then the
  * task will block until data becomes available.
  */
-fn recv<T: send>(p: Port<T>) -> T { recv_((**p).po) }
+fn recv<T: Send>(p: Port<T>) -> T { recv_((**p).po) }
 
 /// Returns true if there are messages available
-fn peek<T: send>(p: Port<T>) -> bool { peek_((**p).po) }
+fn peek<T: Send>(p: Port<T>) -> bool { peek_((**p).po) }
 
 #[doc(hidden)]
-fn recv_chan<T: send>(ch: comm::Chan<T>) -> T {
+fn recv_chan<T: Send>(ch: comm::Chan<T>) -> T {
     as_raw_port(ch, |x|recv_(x))
 }
 
-fn peek_chan<T: send>(ch: comm::Chan<T>) -> bool {
+fn peek_chan<T: Send>(ch: comm::Chan<T>) -> bool {
     as_raw_port(ch, |x|peek_(x))
 }
 
 /// Receive on a raw port pointer
-fn recv_<T: send>(p: *rust_port) -> T {
+fn recv_<T: Send>(p: *rust_port) -> T {
     let yield = 0u;
     let yieldp = ptr::addr_of(yield);
     let mut res;
@@ -231,7 +231,7 @@ fn peek_(p: *rust_port) -> bool {
 }
 
 /// Receive on one of two ports
-fn select2<A: send, B: send>(p_a: Port<A>, p_b: Port<B>)
+fn select2<A: Send, B: Send>(p_a: Port<A>, p_b: Port<B>)
     -> Either<A, B> {
     let ports = ~[(**p_a).po, (**p_b).po];
     let yield = 0u, yieldp = ptr::addr_of(yield);
index 1c56587434be6e4231983cbe433ab66bf4455d99..a1973c1d6ef76d09e22debef5481b9b3542ec222 100644 (file)
@@ -96,7 +96,7 @@ impl<T> DListNode<T> {
     list
 }
 
-fn from_vec<T: copy>(+vec: &[T]) -> DList<T> {
+fn from_vec<T: Copy>(+vec: &[T]) -> DList<T> {
     do vec::foldl(DList(), vec) |list,data| {
         list.push(data); // Iterating left-to-right -- add newly to the tail.
         list
@@ -417,7 +417,7 @@ fn assert_consistent() {
     }
 }
 
-impl<T: copy> DList<T> {
+impl<T: Copy> DList<T> {
     /// Remove data from the head of the list. O(1).
     fn pop()       -> Option<T> { self.pop_n().map       (|nobe| nobe.data) }
     /// Remove data from the tail of the list. O(1).
index 153fa69d4b86f090104821e797b9ee4f9ef4ce5b..41f88b72ca1dcdcafcb58a08919cf49c256b8522 100644 (file)
@@ -210,7 +210,7 @@ fn borrow_mut<R>(op: fn(x: &[mut A]) -> R) -> R {
     }
 }
 
-impl<A: copy> DVec<A> {
+impl<A: Copy> DVec<A> {
     /**
      * Append all elements of a vector to the end of the list
      *
@@ -327,7 +327,7 @@ fn reachi(f: fn(uint, A) -> bool) {
     }
 }
 
-impl<A:copy> DVec<A>: Index<uint,A> {
+impl<A:Copy> DVec<A>: Index<uint,A> {
     pure fn index(&&idx: uint) -> A {
         self.get_elt(idx)
     }
index 00706280ebca5d794d79e64eeb08ad66cf20321c..bd68fab3b8e3cd1a82f13574f5415c62ae6e871e 100644 (file)
@@ -29,7 +29,7 @@ fn either<T, U, V>(f_left: fn((&T)) -> V,
     }
 }
 
-fn lefts<T: copy, U>(eithers: &[Either<T, U>]) -> ~[T] {
+fn lefts<T: Copy, U>(eithers: &[Either<T, U>]) -> ~[T] {
     //! Extracts from a vector of either all the left values
 
     let mut result: ~[T] = ~[];
@@ -42,7 +42,7 @@ fn lefts<T: copy, U>(eithers: &[Either<T, U>]) -> ~[T] {
     return result;
 }
 
-fn rights<T, U: copy>(eithers: &[Either<T, U>]) -> ~[U] {
+fn rights<T, U: Copy>(eithers: &[Either<T, U>]) -> ~[U] {
     //! Extracts from a vector of either all the right values
 
     let mut result: ~[U] = ~[];
@@ -55,7 +55,7 @@ fn rights<T, U: copy>(eithers: &[Either<T, U>]) -> ~[U] {
     return result;
 }
 
-fn partition<T: copy, U: copy>(eithers: &[Either<T, U>])
+fn partition<T: Copy, U: Copy>(eithers: &[Either<T, U>])
     -> {lefts: ~[T], rights: ~[U]} {
     /*!
      * Extracts from a vector of either all the left values and right values
@@ -75,7 +75,7 @@ fn partition<T: copy, U: copy>(eithers: &[Either<T, U>])
     return {lefts: lefts, rights: rights};
 }
 
-pure fn flip<T: copy, U: copy>(eith: &Either<T, U>) -> Either<U, T> {
+pure fn flip<T: Copy, U: Copy>(eith: &Either<T, U>) -> Either<U, T> {
     //! Flips between left and right of a given either
 
     match *eith {
@@ -84,7 +84,7 @@ fn partition<T: copy, U: copy>(eithers: &[Either<T, U>])
     }
 }
 
-pure fn to_result<T: copy, U: copy>(eith: &Either<T, U>) -> Result<U, T> {
+pure fn to_result<T: Copy, U: Copy>(eith: &Either<T, U>) -> Result<U, T> {
     /*!
      * Converts either::t to a result::t
      *
index cd0d2b25e95d9359ca136d08028d50ae8ed54543..141fafcf7d7af4a843252eb288eaf0f52e77a678 100644 (file)
@@ -43,7 +43,7 @@ struct Future<A> {
 }
 
 /// Methods on the `future` type
-impl<A:copy> Future<A> {
+impl<A:Copy> Future<A> {
     fn get() -> A {
         //! Get the value of the future
 
@@ -74,7 +74,7 @@ fn from_value<A>(+val: A) -> Future<A> {
     Future {state: Forced(val)}
 }
 
-fn from_port<A:send>(+port: future_pipe::client::waiting<A>) -> Future<A> {
+fn from_port<A:Send>(+port: future_pipe::client::waiting<A>) -> Future<A> {
     /*!
      * Create a future from a port
      *
@@ -105,7 +105,7 @@ fn from_fn<A>(+f: @fn() -> A) -> Future<A> {
     Future {state: Pending(f)}
 }
 
-fn spawn<A:send>(+blk: fn~() -> A) -> Future<A> {
+fn spawn<A:Send>(+blk: fn~() -> A) -> Future<A> {
     /*!
      * Create a future from a unique closure.
      *
@@ -156,7 +156,7 @@ fn get_ref<A>(future: &r/Future<A>) -> &r/A {
     }
 }
 
-fn get<A:copy>(future: &Future<A>) -> A {
+fn get<A:Copy>(future: &Future<A>) -> A {
     //! Get the value of the future
 
     *get_ref(future)
@@ -169,7 +169,7 @@ fn with<A,B>(future: &Future<A>, blk: fn((&A)) -> B) -> B {
 }
 
 proto! future_pipe (
-    waiting:recv<T:send> {
+    waiting:recv<T:Send> {
         completed(T) -> !
     }
 )
index b3f312113408ff2b3c590e229609a8546888acc5..d9e5f3a0aee5f724afadbf8a88f1ea2acf3a0a23 100644 (file)
@@ -28,7 +28,7 @@ impl<A: Eq> IMPL_T<A>: iter::EqIter<A> {
     }
 }
 
-impl<A: copy> IMPL_T<A>: iter::CopyableIter<A> {
+impl<A: Copy> IMPL_T<A>: iter::CopyableIter<A> {
     pure fn filter_to_vec(pred: fn(A) -> bool) -> ~[A] {
         iter::filter_to_vec(self, pred)
     }
@@ -45,7 +45,7 @@ impl<A: copy> IMPL_T<A>: iter::CopyableIter<A> {
     pure fn find(p: fn(A) -> bool) -> Option<A> { iter::find(self, p) }
 }
 
-impl<A: copy Ord> IMPL_T<A>: iter::CopyableOrderedIter<A> {
+impl<A: Copy Ord> IMPL_T<A>: iter::CopyableOrderedIter<A> {
     pure fn min() -> A { iter::min(self) }
     pure fn max() -> A { iter::max(self) }
 }
index e21c9b3c1bb4d0d056f1a9e6cbbee37a004e09f0..30bd66bf9f8367c448b261338196e0677908c321 100644 (file)
@@ -28,14 +28,14 @@ trait TimesIx{
     pure fn timesi(it: fn(uint) -> bool);
 }
 
-trait CopyableIter<A:copy> {
+trait CopyableIter<A:Copy> {
     pure fn filter_to_vec(pred: fn(A) -> bool) -> ~[A];
     pure fn map_to_vec<B>(op: fn(A) -> B) -> ~[B];
     pure fn to_vec() -> ~[A];
     pure fn find(p: fn(A) -> bool) -> Option<A>;
 }
 
-trait CopyableOrderedIter<A:copy Ord> {
+trait CopyableOrderedIter<A:Copy Ord> {
     pure fn min() -> A;
     pure fn max() -> A;
 }
@@ -82,7 +82,7 @@ trait Buildable<A> {
     return false;
 }
 
-pure fn filter_to_vec<A:copy,IA:BaseIter<A>>(self: IA,
+pure fn filter_to_vec<A:Copy,IA:BaseIter<A>>(self: IA,
                                          prd: fn(A) -> bool) -> ~[A] {
     do vec::build_sized_opt(self.size_hint()) |push| {
         for self.each |a| {
@@ -91,7 +91,7 @@ trait Buildable<A> {
     }
 }
 
-pure fn map_to_vec<A:copy,B,IA:BaseIter<A>>(self: IA, op: fn(A) -> B)
+pure fn map_to_vec<A:Copy,B,IA:BaseIter<A>>(self: IA, op: fn(A) -> B)
     -> ~[B] {
     do vec::build_sized_opt(self.size_hint()) |push| {
         for self.each |a| {
@@ -100,7 +100,7 @@ trait Buildable<A> {
     }
 }
 
-pure fn flat_map_to_vec<A:copy,B:copy,IA:BaseIter<A>,IB:BaseIter<B>>(
+pure fn flat_map_to_vec<A:Copy,B:Copy,IA:BaseIter<A>,IB:BaseIter<B>>(
     self: IA, op: fn(A) -> IB) -> ~[B] {
 
     do vec::build |push| {
@@ -120,7 +120,7 @@ trait Buildable<A> {
     return b;
 }
 
-pure fn to_vec<A:copy,IA:BaseIter<A>>(self: IA) -> ~[A] {
+pure fn to_vec<A:Copy,IA:BaseIter<A>>(self: IA) -> ~[A] {
     foldl::<A,~[A],IA>(self, ~[], |r, a| vec::append(copy r, ~[a]))
 }
 
@@ -163,7 +163,7 @@ trait Buildable<A> {
     }
 }
 
-pure fn min<A:copy Ord,IA:BaseIter<A>>(self: IA) -> A {
+pure fn min<A:Copy Ord,IA:BaseIter<A>>(self: IA) -> A {
     match do foldl::<A,Option<A>,IA>(self, None) |a, b| {
         match a {
           Some(a_) if a_ < b => {
@@ -179,7 +179,7 @@ trait Buildable<A> {
     }
 }
 
-pure fn max<A:copy,IA:BaseIter<A>>(self: IA) -> A {
+pure fn max<A:Copy,IA:BaseIter<A>>(self: IA) -> A {
     match do foldl::<A,Option<A>,IA>(self, None) |a, b| {
         match a {
           Some(a_) if a_ > b => {
@@ -195,7 +195,7 @@ trait Buildable<A> {
     }
 }
 
-pure fn find<A: copy,IA:BaseIter<A>>(self: IA,
+pure fn find<A: Copy,IA:BaseIter<A>>(self: IA,
                                      p: fn(A) -> bool) -> Option<A> {
     for self.each |i| {
         if p(i) { return Some(i) }
@@ -271,7 +271,7 @@ fn map<T,IT: BaseIter<T>,U,BU: Buildable<U>>(v: IT, f: fn(T) -> U) -> BU {
  * Creates an immutable vector of size `n_elts` and initializes the elements
  * to the value `t`.
  */
-pure fn from_elem<T: copy,BT: Buildable<T>>(n_elts: uint, t: T) -> BT {
+pure fn from_elem<T: Copy,BT: Buildable<T>>(n_elts: uint, t: T) -> BT {
     do build_sized(n_elts) |push| {
         let mut i: uint = 0u;
         while i < n_elts { push(t); i += 1u; }
@@ -280,7 +280,7 @@ fn map<T,IT: BaseIter<T>,U,BU: Buildable<U>>(v: IT, f: fn(T) -> U) -> BU {
 
 /// Appending two generic sequences
 #[inline(always)]
-pure fn append<T: copy,IT: BaseIter<T>,BT: Buildable<T>>(
+pure fn append<T: Copy,IT: BaseIter<T>,BT: Buildable<T>>(
     lhs: IT, rhs: IT) -> BT {
     let size_opt = lhs.size_hint().chain(
         |sz1| rhs.size_hint().map(|sz2| sz1+sz2));
@@ -293,7 +293,7 @@ fn map<T,IT: BaseIter<T>,U,BU: Buildable<U>>(v: IT, f: fn(T) -> U) -> BU {
 /// Copies a generic sequence, possibly converting it to a different
 /// type of sequence.
 #[inline(always)]
-pure fn copy_seq<T: copy,IT: BaseIter<T>,BT: Buildable<T>>(
+pure fn copy_seq<T: Copy,IT: BaseIter<T>,BT: Buildable<T>>(
     v: IT) -> BT {
     do build_sized_opt(v.size_hint()) |push| {
         for v.each |x| { push(x); }
index 5b7aee4d74c5611cf1a3da16052b45d204eb62cd..980f1899566302e0ea98caa19d1ee26664364d4b 100644 (file)
@@ -16,7 +16,7 @@ enum Option<T> {
     Some(T),
 }
 
-pure fn get<T: copy>(opt: Option<T>) -> T {
+pure fn get<T: Copy>(opt: Option<T>) -> T {
     /*!
      * Gets the value out of an option
      *
@@ -45,7 +45,7 @@ enum Option<T> {
     }
 }
 
-pure fn expect<T: copy>(opt: Option<T>, reason: ~str) -> T {
+pure fn expect<T: Copy>(opt: Option<T>, reason: ~str) -> T {
     /*!
      * Gets the value out of an option, printing a specified message on
      * failure
@@ -128,7 +128,7 @@ enum Option<T> {
     !is_none(opt)
 }
 
-pure fn get_default<T: copy>(opt: Option<T>, def: T) -> T {
+pure fn get_default<T: Copy>(opt: Option<T>, def: T) -> T {
     //! Returns the contained value or a default
 
     match opt { Some(x) => x, None => def }
@@ -226,7 +226,7 @@ impl<T> &Option<T> {
     pure fn get_ref() -> &self/T { get_ref(self) }
 }
 
-impl<T: copy> Option<T> {
+impl<T: Copy> Option<T> {
     /**
      * Gets the value out of an option
      *
index da4b1b046739dae3c364c37d6078780ba14e9f80..27baf3d931e9dd52f770672e170c3676541efce6 100644 (file)
@@ -152,7 +152,7 @@ fn buffer_header() -> BufferHeader { BufferHeader() }
 
 // This is for protocols to associate extra data to thread around.
 #[doc(hidden)]
-type Buffer<T: send> = {
+type Buffer<T: Send> = {
     header: BufferHeader,
     data: T,
 };
@@ -191,7 +191,7 @@ unsafe fn buf_header() -> ~BufferHeader {
         reinterpret_cast(&self.buffer)
     }
 
-    fn set_buffer<T: send>(b: ~Buffer<T>) unsafe {
+    fn set_buffer<T: Send>(b: ~Buffer<T>) unsafe {
         self.buffer = reinterpret_cast(&b);
     }
 }
@@ -205,7 +205,7 @@ fn PacketHeader() -> PacketHeader {
 }
 
 #[doc(hidden)]
-type Packet<T: send> = {
+type Packet<T: Send> = {
     header: PacketHeader,
     mut payload: Option<T>,
 };
@@ -213,7 +213,7 @@ fn PacketHeader() -> PacketHeader {
 // XXX remove me
 #[cfg(stage0)]
 #[allow(non_camel_case_types)]
-type packet<T: send> = Packet<T>;
+type packet<T: Send> = Packet<T>;
 
 #[doc(hidden)]
 trait HasBuffer {
@@ -221,7 +221,7 @@ trait HasBuffer {
     fn set_buffer_(b: *libc::c_void);
 }
 
-impl<T: send> Packet<T>: HasBuffer {
+impl<T: Send> Packet<T>: HasBuffer {
     fn set_buffer_(b: *libc::c_void) {
         self.header.buffer = b;
     }
@@ -235,14 +235,14 @@ trait has_buffer {
 }
 
 #[cfg(stage0)] // XXX remove me
-impl<T: send> packet<T>: has_buffer {
+impl<T: Send> packet<T>: has_buffer {
     fn set_buffer(b: *libc::c_void) {
         self.header.buffer = b;
     }
 }
 
 #[doc(hidden)]
-fn mk_packet<T: send>() -> Packet<T> {
+fn mk_packet<T: Send>() -> Packet<T> {
     {
         header: PacketHeader(),
         mut payload: None
@@ -250,7 +250,7 @@ fn mk_packet<T: send>() -> Packet<T> {
 }
 
 #[doc(hidden)]
-fn unibuffer<T: send>() -> ~Buffer<Packet<T>> {
+fn unibuffer<T: Send>() -> ~Buffer<Packet<T>> {
     let b = ~{
         header: BufferHeader(),
         data: {
@@ -267,7 +267,7 @@ fn unibuffer<T: send>() -> ~Buffer<Packet<T>> {
 }
 
 #[doc(hidden)]
-fn packet<T: send>() -> *Packet<T> {
+fn packet<T: Send>() -> *Packet<T> {
     let b = unibuffer();
     let p = ptr::addr_of(b.data);
     // We'll take over memory management from here.
@@ -276,7 +276,7 @@ fn packet<T: send>() -> *Packet<T> {
 }
 
 #[doc(hidden)]
-fn entangle_buffer<T: send, Tstart: send>(
+fn entangle_buffer<T: Send, Tstart: Send>(
     +buffer: ~Buffer<T>,
     init: fn(*libc::c_void, x: &T) -> *Packet<Tstart>)
     -> (SendPacketBuffered<Tstart, T>, RecvPacketBuffered<Tstart, T>)
@@ -368,12 +368,12 @@ fn swap_state_rel(+dst: &mut State, src: State) -> State {
 }
 
 #[doc(hidden)]
-unsafe fn get_buffer<T: send>(p: *PacketHeader) -> ~Buffer<T> {
+unsafe fn get_buffer<T: Send>(p: *PacketHeader) -> ~Buffer<T> {
     transmute((*p).buf_header())
 }
 
 // This could probably be done with SharedMutableState to avoid move_it!().
-struct BufferResource<T: send> {
+struct BufferResource<T: Send> {
     buffer: ~Buffer<T>,
 
     drop unsafe {
@@ -393,7 +393,7 @@ struct BufferResource<T: send> {
     }
 }
 
-fn BufferResource<T: send>(+b: ~Buffer<T>) -> BufferResource<T> {
+fn BufferResource<T: Send>(+b: ~Buffer<T>) -> BufferResource<T> {
     //let p = ptr::addr_of(*b);
     //error!("take %?", p);
     atomic_add_acq(&mut b.header.ref_count, 1);
@@ -404,7 +404,7 @@ fn BufferResource<T: send>(+b: ~Buffer<T>) -> BufferResource<T> {
 }
 
 #[doc(hidden)]
-fn send<T: send, Tbuffer: send>(+p: SendPacketBuffered<T, Tbuffer>,
+fn send<T: Send, Tbuffer: Send>(+p: SendPacketBuffered<T, Tbuffer>,
                                 +payload: T) -> bool {
     let header = p.header();
     let p_ = p.unwrap();
@@ -448,7 +448,7 @@ fn send<T: send, Tbuffer: send>(+p: SendPacketBuffered<T, Tbuffer>,
 Fails if the sender closes the connection.
 
 */
-fn recv<T: send, Tbuffer: send>(+p: RecvPacketBuffered<T, Tbuffer>) -> T {
+fn recv<T: Send, Tbuffer: Send>(+p: RecvPacketBuffered<T, Tbuffer>) -> T {
     option::unwrap_expect(try_recv(p), "connection closed")
 }
 
@@ -458,7 +458,7 @@ fn recv<T: send, Tbuffer: send>(+p: RecvPacketBuffered<T, Tbuffer>) -> T {
 a message, or `Some(T)` if a message was received.
 
 */
-fn try_recv<T: send, Tbuffer: send>(+p: RecvPacketBuffered<T, Tbuffer>)
+fn try_recv<T: Send, Tbuffer: Send>(+p: RecvPacketBuffered<T, Tbuffer>)
     -> Option<T>
 {
     let p_ = p.unwrap();
@@ -552,7 +552,7 @@ struct DropState {
 }
 
 /// Returns true if messages are available.
-pure fn peek<T: send, Tb: send>(p: &RecvPacketBuffered<T, Tb>) -> bool {
+pure fn peek<T: Send, Tb: Send>(p: &RecvPacketBuffered<T, Tb>) -> bool {
     match unsafe {(*p.header()).state} {
       Empty => false,
       Blocked => fail ~"peeking on blocked packet",
@@ -560,14 +560,14 @@ struct DropState {
     }
 }
 
-impl<T: send, Tb: send> RecvPacketBuffered<T, Tb> {
+impl<T: Send, Tb: Send> RecvPacketBuffered<T, Tb> {
     pure fn peek() -> bool {
         peek(&self)
     }
 }
 
 #[doc(hidden)]
-fn sender_terminate<T: send>(p: *Packet<T>) {
+fn sender_terminate<T: Send>(p: *Packet<T>) {
     let p = unsafe { &*p };
     match swap_state_rel(&mut p.header.state, Terminated) {
       Empty => {
@@ -596,7 +596,7 @@ fn sender_terminate<T: send>(p: *Packet<T>) {
 }
 
 #[doc(hidden)]
-fn receiver_terminate<T: send>(p: *Packet<T>) {
+fn receiver_terminate<T: Send>(p: *Packet<T>) {
     let p = unsafe { &*p };
     match swap_state_rel(&mut p.header.state, Terminated) {
       Empty => {
@@ -704,7 +704,7 @@ fn wait_many<T: Selectable>(pkts: &[T]) -> uint {
 this case, `select2` may return either `left` or `right`.
 
 */
-fn select2<A: send, Ab: send, B: send, Bb: send>(
+fn select2<A: Send, Ab: Send, B: Send, Bb: Send>(
     +a: RecvPacketBuffered<A, Ab>,
     +b: RecvPacketBuffered<B, Bb>)
     -> Either<(Option<A>, RecvPacketBuffered<B, Bb>),
@@ -746,7 +746,7 @@ fn select2i<A: Selectable, B: Selectable>(a: &A, b: &B) -> Either<(), ()> {
  list of the remaining endpoints.
 
 */
-fn select<T: send, Tb: send>(+endpoints: ~[RecvPacketBuffered<T, Tb>])
+fn select<T: Send, Tb: Send>(+endpoints: ~[RecvPacketBuffered<T, Tb>])
     -> (uint, Option<T>, ~[RecvPacketBuffered<T, Tb>])
 {
     let ready = wait_many(endpoints.map(|p| p.header()));
@@ -760,25 +760,25 @@ fn select<T: send, Tb: send>(+endpoints: ~[RecvPacketBuffered<T, Tb>])
 message.
 
 */
-type SendPacket<T: send> = SendPacketBuffered<T, Packet<T>>;
+type SendPacket<T: Send> = SendPacketBuffered<T, Packet<T>>;
 
 #[doc(hidden)]
-fn SendPacket<T: send>(p: *Packet<T>) -> SendPacket<T> {
+fn SendPacket<T: Send>(p: *Packet<T>) -> SendPacket<T> {
     SendPacketBuffered(p)
 }
 
 // XXX remove me
 #[cfg(stage0)]
 #[allow(non_camel_case_types)]
-type send_packet<T: send> = SendPacket<T>;
+type send_packet<T: Send> = SendPacket<T>;
 
 // XXX remove me
 #[cfg(stage0)]
-fn send_packet<T: send>(p: *packet<T>) -> SendPacket<T> {
+fn send_packet<T: Send>(p: *packet<T>) -> SendPacket<T> {
     SendPacket(p)
 }
 
-struct SendPacketBuffered<T: send, Tbuffer: send> {
+struct SendPacketBuffered<T: Send, Tbuffer: Send> {
     mut p: Option<*Packet<T>>,
     mut buffer: Option<BufferResource<Tbuffer>>,
     drop {
@@ -821,7 +821,7 @@ fn reuse_buffer() -> BufferResource<Tbuffer> {
     }
 }
 
-fn SendPacketBuffered<T: send, Tbuffer: send>(p: *Packet<T>)
+fn SendPacketBuffered<T: Send, Tbuffer: Send>(p: *Packet<T>)
     -> SendPacketBuffered<T, Tbuffer> {
         //debug!("take send %?", p);
     SendPacketBuffered {
@@ -836,30 +836,30 @@ fn SendPacketBuffered<T: send, Tbuffer: send>(p: *Packet<T>)
 // XXX remove me
 #[cfg(stage0)]
 #[allow(non_camel_case_types)]
-type send_packet_buffered<T: send, Tbuffer: send> =
+type send_packet_buffered<T: Send, Tbuffer: Send> =
     SendPacketBuffered<T, Tbuffer>;
 
 /// Represents the receive end of a pipe. It can receive exactly one
 /// message.
-type RecvPacket<T: send> = RecvPacketBuffered<T, Packet<T>>;
+type RecvPacket<T: Send> = RecvPacketBuffered<T, Packet<T>>;
 
 #[doc(hidden)]
-fn RecvPacket<T: send>(p: *Packet<T>) -> RecvPacket<T> {
+fn RecvPacket<T: Send>(p: *Packet<T>) -> RecvPacket<T> {
     RecvPacketBuffered(p)
 }
 
 // XXX remove me
 #[cfg(stage0)]
 #[allow(non_camel_case_types)]
-type recv_packet<T: send> = RecvPacket<T>;
+type recv_packet<T: Send> = RecvPacket<T>;
 
 // XXX remove me
 #[cfg(stage0)]
-fn recv_packet<T: send>(p: *packet<T>) -> RecvPacket<T> {
+fn recv_packet<T: Send>(p: *packet<T>) -> RecvPacket<T> {
     RecvPacket(p)
 }
 
-struct RecvPacketBuffered<T: send, Tbuffer: send> : Selectable {
+struct RecvPacketBuffered<T: Send, Tbuffer: Send> : Selectable {
     mut p: Option<*Packet<T>>,
     mut buffer: Option<BufferResource<Tbuffer>>,
     drop {
@@ -902,7 +902,7 @@ fn reuse_buffer() -> BufferResource<Tbuffer> {
     }
 }
 
-fn RecvPacketBuffered<T: send, Tbuffer: send>(p: *Packet<T>)
+fn RecvPacketBuffered<T: Send, Tbuffer: Send>(p: *Packet<T>)
     -> RecvPacketBuffered<T, Tbuffer> {
     //debug!("take recv %?", p);
     RecvPacketBuffered {
@@ -917,11 +917,11 @@ fn RecvPacketBuffered<T: send, Tbuffer: send>(p: *Packet<T>)
 // XXX remove me
 #[cfg(stage0)]
 #[allow(non_camel_case_types)]
-type recv_packet_buffered<T: send, Tbuffer: send> =
+type recv_packet_buffered<T: Send, Tbuffer: Send> =
     RecvPacketBuffered<T, Tbuffer>;
 
 #[doc(hidden)]
-fn entangle<T: send>() -> (SendPacket<T>, RecvPacket<T>) {
+fn entangle<T: Send>() -> (SendPacket<T>, RecvPacket<T>) {
     let p = packet();
     (SendPacket(p), RecvPacket(p))
 }
@@ -933,7 +933,7 @@ fn entangle<T: send>() -> (SendPacket<T>, RecvPacket<T>) {
 endpoint is passed to the new task.
 
 */
-fn spawn_service<T: send, Tb: send>(
+fn spawn_service<T: Send, Tb: Send>(
     init: extern fn() -> (SendPacketBuffered<T, Tb>,
                           RecvPacketBuffered<T, Tb>),
     +service: fn~(+RecvPacketBuffered<T, Tb>))
@@ -957,7 +957,7 @@ fn spawn_service<T: send, Tb: send>(
 receive state.
 
 */
-fn spawn_service_recv<T: send, Tb: send>(
+fn spawn_service_recv<T: Send, Tb: Send>(
     init: extern fn() -> (RecvPacketBuffered<T, Tb>,
                           SendPacketBuffered<T, Tb>),
     +service: fn~(+SendPacketBuffered<T, Tb>))
@@ -980,13 +980,13 @@ fn spawn_service_recv<T: send, Tb: send>(
 // Streams - Make pipes a little easier in general.
 
 proto! streamp (
-    Open:send<T: send> {
+    Open:send<T: Send> {
         data(T) -> Open<T>
     }
 )
 
 /// A trait for things that can send multiple messages.
-trait Channel<T: send> {
+trait Channel<T: Send> {
     // It'd be nice to call this send, but it'd conflict with the
     // built in send kind.
 
@@ -998,7 +998,7 @@ trait Channel<T: send> {
 }
 
 /// A trait for things that can receive multiple messages.
-trait Recv<T: send> {
+trait Recv<T: Send> {
     /// Receives a message, or fails if the connection closes.
     fn recv() -> T;
 
@@ -1016,18 +1016,18 @@ trait Recv<T: send> {
 }
 
 #[doc(hidden)]
-type Chan_<T:send> = { mut endp: Option<streamp::client::Open<T>> };
+type Chan_<T:Send> = { mut endp: Option<streamp::client::Open<T>> };
 
 /// An endpoint that can send many messages.
-enum Chan<T:send> {
+enum Chan<T:Send> {
     Chan_(Chan_<T>)
 }
 
 #[doc(hidden)]
-type Port_<T:send> = { mut endp: Option<streamp::server::Open<T>> };
+type Port_<T:Send> = { mut endp: Option<streamp::server::Open<T>> };
 
 /// An endpoint that can receive many messages.
-enum Port<T:send> {
+enum Port<T:Send> {
     Port_(Port_<T>)
 }
 
@@ -1036,13 +1036,13 @@ enum Port<T:send> {
 These allow sending or receiving an unlimited number of messages.
 
 */
-fn stream<T:send>() -> (Chan<T>, Port<T>) {
+fn stream<T:Send>() -> (Chan<T>, Port<T>) {
     let (c, s) = streamp::init();
 
     (Chan_({ mut endp: Some(c) }), Port_({ mut endp: Some(s) }))
 }
 
-impl<T: send> Chan<T>: Channel<T> {
+impl<T: Send> Chan<T>: Channel<T> {
     fn send(+x: T) {
         let mut endp = None;
         endp <-> self.endp;
@@ -1063,7 +1063,7 @@ fn try_send(+x: T) -> bool {
     }
 }
 
-impl<T: send> Port<T>: Recv<T> {
+impl<T: Send> Port<T>: Recv<T> {
     fn recv() -> T {
         let mut endp = None;
         endp <-> self.endp;
@@ -1097,7 +1097,7 @@ fn try_recv() -> Option<T> {
 }
 
 /// Treat many ports as one.
-struct PortSet<T: send> : Recv<T> {
+struct PortSet<T: Send> : Recv<T> {
     mut ports: ~[pipes::Port<T>],
 
     fn add(+port: pipes::Port<T>) {
@@ -1146,13 +1146,13 @@ fn recv() -> T {
     }
 }
 
-fn PortSet<T: send>() -> PortSet<T>{
+fn PortSet<T: Send>() -> PortSet<T>{
     PortSet {
         ports: ~[]
     }
 }
 
-impl<T: send> Port<T>: Selectable {
+impl<T: Send> Port<T>: Selectable {
     pure fn header() -> *PacketHeader unchecked {
         match self.endp {
           Some(endp) => endp.header(),
@@ -1162,9 +1162,9 @@ impl<T: send> Port<T>: Selectable {
 }
 
 /// A channel that can be shared between many senders.
-type SharedChan<T: send> = unsafe::Exclusive<Chan<T>>;
+type SharedChan<T: Send> = unsafe::Exclusive<Chan<T>>;
 
-impl<T: send> SharedChan<T>: Channel<T> {
+impl<T: Send> SharedChan<T>: Channel<T> {
     fn send(+x: T) {
         let mut xx = Some(x);
         do self.with |chan| {
@@ -1185,19 +1185,19 @@ fn try_send(+x: T) -> bool {
 }
 
 /// Converts a `chan` into a `shared_chan`.
-fn SharedChan<T:send>(+c: Chan<T>) -> SharedChan<T> {
+fn SharedChan<T:Send>(+c: Chan<T>) -> SharedChan<T> {
     unsafe::exclusive(c)
 }
 
 /// Receive a message from one of two endpoints.
-trait Select2<T: send, U: send> {
+trait Select2<T: Send, U: Send> {
     /// Receive a message or return `none` if a connection closes.
     fn try_select() -> Either<Option<T>, Option<U>>;
     /// Receive a message or fail if a connection closes.
     fn select() -> Either<T, U>;
 }
 
-impl<T: send, U: send, Left: Selectable Recv<T>, Right: Selectable Recv<U>>
+impl<T: Send, U: Send, Left: Selectable Recv<T>, Right: Selectable Recv<U>>
     (Left, Right): Select2<T, U> {
 
     fn select() -> Either<T, U> {
@@ -1220,18 +1220,18 @@ fn try_select() -> Either<Option<T>, Option<U>> {
 }
 
 proto! oneshot (
-    Oneshot:send<T:send> {
+    Oneshot:send<T:Send> {
         send(T) -> !
     }
 )
 
 /// The send end of a oneshot pipe.
-type ChanOne<T: send> = oneshot::client::Oneshot<T>;
+type ChanOne<T: Send> = oneshot::client::Oneshot<T>;
 /// The receive end of a oneshot pipe.
-type PortOne<T: send> = oneshot::server::Oneshot<T>;
+type PortOne<T: Send> = oneshot::server::Oneshot<T>;
 
 /// Initialiase a (send-endpoint, recv-endpoint) oneshot pipe pair.
-fn oneshot<T: send>() -> (ChanOne<T>, PortOne<T>) {
+fn oneshot<T: Send>() -> (ChanOne<T>, PortOne<T>) {
     oneshot::init()
 }
 
@@ -1239,13 +1239,13 @@ fn oneshot<T: send>() -> (ChanOne<T>, PortOne<T>) {
  * Receive a message from a oneshot pipe, failing if the connection was
  * closed.
  */
-fn recv_one<T: send>(+port: PortOne<T>) -> T {
+fn recv_one<T: Send>(+port: PortOne<T>) -> T {
     let oneshot::send(message) = recv(port);
     message
 }
 
 /// Receive a message from a oneshot pipe unless the connection was closed.
-fn try_recv_one<T: send> (+port: PortOne<T>) -> Option<T> {
+fn try_recv_one<T: Send> (+port: PortOne<T>) -> Option<T> {
     let message = try_recv(port);
 
     if message.is_none() { None }
@@ -1256,7 +1256,7 @@ fn try_recv_one<T: send> (+port: PortOne<T>) -> Option<T> {
 }
 
 /// Send a message on a oneshot pipe, failing if the connection was closed.
-fn send_one<T: send>(+chan: ChanOne<T>, +data: T) {
+fn send_one<T: Send>(+chan: ChanOne<T>, +data: T) {
     oneshot::client::send(chan, data);
 }
 
@@ -1264,7 +1264,7 @@ fn send_one<T: send>(+chan: ChanOne<T>, +data: T) {
  * Send a message on a oneshot pipe, or return false if the connection was
  * closed.
  */
-fn try_send_one<T: send>(+chan: ChanOne<T>, +data: T)
+fn try_send_one<T: Send>(+chan: ChanOne<T>, +data: T)
         -> bool {
     oneshot::client::try_send(chan, data).is_some()
 }
index 9330d376cad9503721eafafdde2dbaffcaa4635c..046621897f8fce977fd7864b43bf466df9f1633a 100644 (file)
@@ -27,7 +27,7 @@ fn rust_compare_and_swap_ptr(address: *libc::uintptr_t,
  * or, if no channel exists creates and installs a new channel and sets up a
  * new task to receive from it.
  */
-unsafe fn chan_from_global_ptr<T: send>(
+unsafe fn chan_from_global_ptr<T: Send>(
     global: GlobalPtr,
     task_fn: fn() -> task::TaskBuilder,
     +f: fn~(comm::Port<T>)
index 35135b1fd2330f3d14e7a2b337a0826687d3e4f6..77a5dbbc31006280b744cf2398e9875f811d56d0 100644 (file)
@@ -165,12 +165,12 @@ fn gen_bytes(len: uint) -> ~[u8] {
     }
 
     /// Choose an item randomly, failing if values is empty
-    fn choose<T:copy>(values: &[T]) -> T {
+    fn choose<T:Copy>(values: &[T]) -> T {
         self.choose_option(values).get()
     }
 
     /// Choose Some(item) randomly, returning None if values is empty
-    fn choose_option<T:copy>(values: &[T]) -> Option<T> {
+    fn choose_option<T:Copy>(values: &[T]) -> Option<T> {
         if values.is_empty() {
             None
         } else {
@@ -182,7 +182,7 @@ fn choose_option<T:copy>(values: &[T]) -> Option<T> {
      * Choose an item respecting the relative weights, failing if the sum of
      * the weights is 0
      */
-    fn choose_weighted<T: copy>(v : &[Weighted<T>]) -> T {
+    fn choose_weighted<T: Copy>(v : &[Weighted<T>]) -> T {
         self.choose_weighted_option(v).get()
     }
 
@@ -190,7 +190,7 @@ fn choose_weighted<T: copy>(v : &[Weighted<T>]) -> T {
      * Choose Some(item) respecting the relative weights, returning none if
      * the sum of the weights is 0
      */
-    fn choose_weighted_option<T:copy>(v: &[Weighted<T>]) -> Option<T> {
+    fn choose_weighted_option<T:Copy>(v: &[Weighted<T>]) -> Option<T> {
         let mut total = 0u;
         for v.each |item| {
             total += item.weight;
@@ -213,7 +213,7 @@ fn choose_weighted_option<T:copy>(v: &[Weighted<T>]) -> Option<T> {
      * Return a vec containing copies of the items, in order, where
      * the weight of the item determines how many copies there are
      */
-    fn weighted_vec<T:copy>(v: &[Weighted<T>]) -> ~[T] {
+    fn weighted_vec<T:Copy>(v: &[Weighted<T>]) -> ~[T] {
         let mut r = ~[];
         for v.each |item| {
             for uint::range(0u, item.weight) |_i| {
@@ -224,7 +224,7 @@ fn weighted_vec<T:copy>(v: &[Weighted<T>]) -> ~[T] {
     }
 
     /// Shuffle a vec
-    fn shuffle<T:copy>(values: &[T]) -> ~[T] {
+    fn shuffle<T:Copy>(values: &[T]) -> ~[T] {
         let mut m = vec::from_slice(values);
         self.shuffle_mut(m);
         return m;
index e4028a466e0f3b914dd0908c21d80280c780578f..7f3f35acc903546572dda8ac8e8f4ca6624b6c86 100644 (file)
@@ -18,7 +18,7 @@ enum Result<T, U> {
  *
  * If the result is an error
  */
-pure fn get<T: copy, U>(res: Result<T, U>) -> T {
+pure fn get<T: Copy, U>(res: Result<T, U>) -> T {
     match res {
       Ok(t) => t,
       Err(the_err) => unchecked {
@@ -50,7 +50,7 @@ enum Result<T, U> {
  *
  * If the result is not an error
  */
-pure fn get_err<T, U: copy>(res: Result<T, U>) -> U {
+pure fn get_err<T, U: Copy>(res: Result<T, U>) -> U {
     match res {
       Err(u) => u,
       Ok(_) => fail ~"get_err called on ok result"
@@ -76,7 +76,7 @@ enum Result<T, U> {
  * `ok` result variants are converted to `either::right` variants, `err`
  * result variants are converted to `either::left`.
  */
-pure fn to_either<T: copy, U: copy>(res: Result<U, T>) -> Either<T, U> {
+pure fn to_either<T: Copy, U: Copy>(res: Result<U, T>) -> Either<T, U> {
     match res {
       Ok(res) => either::Right(res),
       Err(fail_) => either::Left(fail_)
@@ -97,7 +97,7 @@ enum Result<T, U> {
  *         ok(parse_buf(buf))
  *     }
  */
-fn chain<T, U: copy, V: copy>(res: Result<T, V>, op: fn(T) -> Result<U, V>)
+fn chain<T, U: Copy, V: Copy>(res: Result<T, V>, op: fn(T) -> Result<U, V>)
     -> Result<U, V> {
     match res {
       Ok(t) => op(t),
@@ -113,7 +113,7 @@ fn chain<T, U: copy, V: copy>(res: Result<T, V>, op: fn(T) -> Result<U, V>)
  * immediately returned.  This function can be used to pass through a
  * successful result while handling an error.
  */
-fn chain_err<T: copy, U: copy, V: copy>(
+fn chain_err<T: Copy, U: Copy, V: Copy>(
     res: Result<T, V>,
     op: fn(V) -> Result<T, U>)
     -> Result<T, U> {
@@ -173,7 +173,7 @@ fn iter_err<T, E>(res: Result<T, E>, f: fn(E)) {
  *         parse_buf(buf)
  *     }
  */
-fn map<T, E: copy, U: copy>(res: Result<T, E>, op: fn(T) -> U)
+fn map<T, E: Copy, U: Copy>(res: Result<T, E>, op: fn(T) -> U)
   -> Result<U, E> {
     match res {
       Ok(t) => Ok(op(t)),
@@ -189,7 +189,7 @@ fn map<T, E: copy, U: copy>(res: Result<T, E>, op: fn(T) -> U)
  * is immediately returned.  This function can be used to pass through a
  * successful result while handling an error.
  */
-fn map_err<T: copy, E, F: copy>(res: Result<T, E>, op: fn(E) -> F)
+fn map_err<T: Copy, E, F: Copy>(res: Result<T, E>, op: fn(E) -> F)
   -> Result<T, F> {
     match res {
       Ok(t) => Ok(t),
@@ -217,10 +217,10 @@ fn iter_err(f: fn(E)) {
     }
 }
 
-impl<T: copy, E> Result<T, E> {
+impl<T: Copy, E> Result<T, E> {
     fn get() -> T { get(self) }
 
-    fn map_err<F:copy>(op: fn(E) -> F) -> Result<T,F> {
+    fn map_err<F:Copy>(op: fn(E) -> F) -> Result<T,F> {
         match self {
           Ok(t) => Ok(t),
           Err(e) => Err(op(e))
@@ -228,10 +228,10 @@ fn map_err<F:copy>(op: fn(E) -> F) -> Result<T,F> {
     }
 }
 
-impl<T, E: copy> Result<T, E> {
+impl<T, E: Copy> Result<T, E> {
     fn get_err() -> E { get_err(self) }
 
-    fn map<U:copy>(op: fn(T) -> U) -> Result<U,E> {
+    fn map<U:Copy>(op: fn(T) -> U) -> Result<U,E> {
         match self {
           Ok(t) => Ok(op(t)),
           Err(e) => Err(e)
@@ -239,12 +239,12 @@ fn map<U:copy>(op: fn(T) -> U) -> Result<U,E> {
     }
 }
 
-impl<T: copy, E: copy> Result<T, E> {
-    fn chain<U:copy>(op: fn(T) -> Result<U,E>) -> Result<U,E> {
+impl<T: Copy, E: Copy> Result<T, E> {
+    fn chain<U:Copy>(op: fn(T) -> Result<U,E>) -> Result<U,E> {
         chain(self, op)
     }
 
-    fn chain_err<F:copy>(op: fn(E) -> Result<T,F>) -> Result<T,F> {
+    fn chain_err<F:Copy>(op: fn(E) -> Result<T,F>) -> Result<T,F> {
         chain_err(self, op)
     }
 }
@@ -266,7 +266,7 @@ fn chain_err<F:copy>(op: fn(E) -> Result<T,F>) -> Result<T,F> {
  *         assert incd == ~[2u, 3u, 4u];
  *     }
  */
-fn map_vec<T,U:copy,V:copy>(
+fn map_vec<T,U:Copy,V:Copy>(
     ts: &[T], op: fn(T) -> Result<V,U>) -> Result<~[V],U> {
 
     let mut vs: ~[V] = ~[];
@@ -280,7 +280,7 @@ fn map_vec<T,U:copy,V:copy>(
     return Ok(vs);
 }
 
-fn map_opt<T,U:copy,V:copy>(
+fn map_opt<T,U:Copy,V:Copy>(
     o_t: Option<T>, op: fn(T) -> Result<V,U>) -> Result<Option<V>,U> {
 
     match o_t {
@@ -301,7 +301,7 @@ fn map_opt<T,U:copy,V:copy>(
  * used in 'careful' code contexts where it is both appropriate and easy
  * to accommodate an error like the vectors being of different lengths.
  */
-fn map_vec2<S,T,U:copy,V:copy>(ss: &[S], ts: &[T],
+fn map_vec2<S,T,U:Copy,V:Copy>(ss: &[S], ts: &[T],
                                op: fn(S,T) -> Result<V,U>) -> Result<~[V],U> {
 
     assert vec::same_length(ss, ts);
@@ -324,7 +324,7 @@ fn map_vec2<S,T,U:copy,V:copy>(ss: &[S], ts: &[T],
  * error.  This could be implemented using `map2()` but it is more efficient
  * on its own as no result vector is built.
  */
-fn iter_vec2<S,T,U:copy>(ss: &[S], ts: &[T],
+fn iter_vec2<S,T,U:Copy>(ss: &[S], ts: &[T],
                          op: fn(S,T) -> Result<(),U>) -> Result<(),U> {
 
     assert vec::same_length(ss, ts);
index 3eb8e581cbc422a31496a1c2e4a090d3bf461c90..a292d011644139df4312251d07774b4b81fbbf67 100644 (file)
@@ -8,7 +8,7 @@
 use hash::Hash;
 use to_bytes::IterBytes;
 
-trait SendMap<K:Eq Hash, V: copy> {
+trait SendMap<K:Eq Hash, V: Copy> {
     // FIXME(#3148)  ^^^^ once find_ref() works, we can drop V:copy
 
     fn insert(&mut self, +k: K, +v: V) -> bool;
@@ -315,7 +315,7 @@ fn each_value_ref(&self, blk: fn(v: &V) -> bool) {
         }
     }
 
-    impl<K:Hash IterBytes Eq, V: copy> LinearMap<K,V> {
+    impl<K:Hash IterBytes Eq, V: Copy> LinearMap<K,V> {
         fn find(&const self, k: &K) -> Option<V> {
             match self.bucket_for_key(self.buckets, k) {
               FoundEntry(idx) => {
@@ -342,17 +342,17 @@ fn get(&const self, k: &K) -> V {
 
     }
 
-    impl<K: Hash IterBytes Eq copy, V: copy> LinearMap<K,V> {
+    impl<K: Hash IterBytes Eq Copy, V: Copy> LinearMap<K,V> {
         fn each(&self, blk: fn(+K,+V) -> bool) {
             self.each_ref(|k,v| blk(copy *k, copy *v));
         }
     }
-    impl<K: Hash IterBytes Eq copy, V> LinearMap<K,V> {
+    impl<K: Hash IterBytes Eq Copy, V> LinearMap<K,V> {
         fn each_key(&self, blk: fn(+K) -> bool) {
             self.each_key_ref(|k| blk(copy *k));
         }
     }
-    impl<K: Hash IterBytes Eq, V: copy> LinearMap<K,V> {
+    impl<K: Hash IterBytes Eq, V: Copy> LinearMap<K,V> {
         fn each_value(&self, blk: fn(+V) -> bool) {
             self.each_value_ref(|v| blk(copy *v));
         }
index 6db50291b95f35b9a7f99a2a53486742c3c09d04..32ce963ebbb33aee7b2a56690dd9fa9d02ac0480 100644 (file)
@@ -380,7 +380,7 @@ fn spawn(+f: fn~()) {
         spawn_raw(x.opts, x.gen_body(f));
     }
     /// Runs a task, while transfering ownership of one argument to the child.
-    fn spawn_with<A: send>(+arg: A, +f: fn~(+A)) {
+    fn spawn_with<A: Send>(+arg: A, +f: fn~(+A)) {
         let arg = ~mut Some(arg);
         do self.spawn {
             f(option::swap_unwrap(arg))
@@ -398,7 +398,7 @@ fn spawn_with<A: send>(+arg: A, +f: fn~(+A)) {
      * otherwise be required to establish communication from the parent
      * to the child.
      */
-    fn spawn_listener<A: send>(+f: fn~(comm::Port<A>)) -> comm::Chan<A> {
+    fn spawn_listener<A: Send>(+f: fn~(comm::Port<A>)) -> comm::Chan<A> {
         let setup_po = comm::Port();
         let setup_ch = comm::Chan(setup_po);
         do self.spawn {
@@ -413,7 +413,7 @@ fn spawn_listener<A: send>(+f: fn~(comm::Port<A>)) -> comm::Chan<A> {
     /**
      * Runs a new task, setting up communication in both directions
      */
-    fn spawn_conversation<A: send, B: send>
+    fn spawn_conversation<A: Send, B: Send>
         (+f: fn~(comm::Port<A>, comm::Chan<B>))
         -> (comm::Port<B>, comm::Chan<A>) {
         let from_child = comm::Port();
@@ -437,7 +437,7 @@ fn spawn_conversation<A: send, B: send>
      * # Failure
      * Fails if a future_result was already set for this task.
      */
-    fn try<T: send>(+f: fn~() -> T) -> Result<T,()> {
+    fn try<T: Send>(+f: fn~() -> T) -> Result<T,()> {
         let po = comm::Port();
         let ch = comm::Chan(po);
         let mut result = None;
@@ -504,7 +504,7 @@ fn spawn_supervised(+f: fn~()) {
     task().supervised().spawn(f)
 }
 
-fn spawn_with<A:send>(+arg: A, +f: fn~(+A)) {
+fn spawn_with<A:Send>(+arg: A, +f: fn~(+A)) {
     /*!
      * Runs a task, while transfering ownership of one argument to the
      * child.
@@ -518,7 +518,7 @@ fn spawn_with<A:send>(+arg: A, +f: fn~(+A)) {
     task().spawn_with(arg, f)
 }
 
-fn spawn_listener<A:send>(+f: fn~(comm::Port<A>)) -> comm::Chan<A> {
+fn spawn_listener<A:Send>(+f: fn~(comm::Port<A>)) -> comm::Chan<A> {
     /*!
      * Runs a new task while providing a channel from the parent to the child
      *
@@ -528,7 +528,7 @@ fn spawn_listener<A:send>(+f: fn~(comm::Port<A>)) -> comm::Chan<A> {
     task().spawn_listener(f)
 }
 
-fn spawn_conversation<A: send, B: send>
+fn spawn_conversation<A: Send, B: Send>
     (+f: fn~(comm::Port<A>, comm::Chan<B>))
     -> (comm::Port<B>, comm::Chan<A>) {
     /*!
@@ -557,7 +557,7 @@ fn spawn_sched(mode: SchedMode, +f: fn~()) {
     task().sched_mode(mode).spawn(f)
 }
 
-fn try<T:send>(+f: fn~() -> T) -> Result<T,()> {
+fn try<T:Send>(+f: fn~() -> T) -> Result<T,()> {
     /*!
      * Execute a function in another task and return either the return value
      * of the function or result::err.
@@ -1314,10 +1314,10 @@ fn new_task_in_new_sched(opts: SchedOpts) -> *rust_task {
  *
  * These two cases aside, the interface is safe.
  */
-type LocalDataKey<T: owned> = &fn(+@T);
+type LocalDataKey<T: Owned> = &fn(+@T);
 
 trait LocalData { }
-impl<T: owned> @T: LocalData { }
+impl<T: Owned> @T: LocalData { }
 
 impl LocalData: Eq {
     pure fn eq(&&other: LocalData) -> bool unsafe {
@@ -1365,7 +1365,7 @@ unsafe fn get_task_local_map(task: *rust_task) -> TaskLocalMap {
     }
 }
 
-unsafe fn key_to_key_value<T: owned>(
+unsafe fn key_to_key_value<T: Owned>(
     key: LocalDataKey<T>) -> *libc::c_void {
 
     // Keys are closures, which are (fnptr,envptr) pairs. Use fnptr.
@@ -1375,7 +1375,7 @@ unsafe fn key_to_key_value<T: owned>(
 }
 
 // If returning Some(..), returns with @T with the map's reference. Careful!
-unsafe fn local_data_lookup<T: owned>(
+unsafe fn local_data_lookup<T: Owned>(
     map: TaskLocalMap, key: LocalDataKey<T>)
     -> Option<(uint, *libc::c_void)> {
 
@@ -1393,7 +1393,7 @@ unsafe fn local_data_lookup<T: owned>(
     }
 }
 
-unsafe fn local_get_helper<T: owned>(
+unsafe fn local_get_helper<T: Owned>(
     task: *rust_task, key: LocalDataKey<T>,
     do_pop: bool) -> Option<@T> {
 
@@ -1414,21 +1414,21 @@ unsafe fn local_get_helper<T: owned>(
     }
 }
 
-unsafe fn local_pop<T: owned>(
+unsafe fn local_pop<T: Owned>(
     task: *rust_task,
     key: LocalDataKey<T>) -> Option<@T> {
 
     local_get_helper(task, key, true)
 }
 
-unsafe fn local_get<T: owned>(
+unsafe fn local_get<T: Owned>(
     task: *rust_task,
     key: LocalDataKey<T>) -> Option<@T> {
 
     local_get_helper(task, key, false)
 }
 
-unsafe fn local_set<T: owned>(
+unsafe fn local_set<T: Owned>(
     task: *rust_task, key: LocalDataKey<T>, +data: @T) {
 
     let map = get_task_local_map(task);
@@ -1460,7 +1460,7 @@ unsafe fn local_set<T: owned>(
     }
 }
 
-unsafe fn local_modify<T: owned>(
+unsafe fn local_modify<T: Owned>(
     task: *rust_task, key: LocalDataKey<T>,
     modify_fn: fn(Option<@T>) -> Option<@T>) {
 
@@ -1476,7 +1476,7 @@ unsafe fn local_modify<T: owned>(
  * Remove a task-local data value from the table, returning the
  * reference that was originally created to insert it.
  */
-unsafe fn local_data_pop<T: owned>(
+unsafe fn local_data_pop<T: Owned>(
     key: LocalDataKey<T>) -> Option<@T> {
 
     local_pop(rustrt::rust_get_task(), key)
@@ -1485,7 +1485,7 @@ unsafe fn local_data_pop<T: owned>(
  * Retrieve a task-local data value. It will also be kept alive in the
  * table until explicitly removed.
  */
-unsafe fn local_data_get<T: owned>(
+unsafe fn local_data_get<T: Owned>(
     key: LocalDataKey<T>) -> Option<@T> {
 
     local_get(rustrt::rust_get_task(), key)
@@ -1494,7 +1494,7 @@ unsafe fn local_data_get<T: owned>(
  * Store a value in task-local data. If this key already has a value,
  * that value is overwritten (and its destructor is run).
  */
-unsafe fn local_data_set<T: owned>(
+unsafe fn local_data_set<T: Owned>(
     key: LocalDataKey<T>, +data: @T) {
 
     local_set(rustrt::rust_get_task(), key, data)
@@ -1503,7 +1503,7 @@ unsafe fn local_data_set<T: owned>(
  * Modify a task-local data value. If the function returns 'none', the
  * data is removed (and its reference dropped).
  */
-unsafe fn local_data_modify<T: owned>(
+unsafe fn local_data_modify<T: Owned>(
     key: LocalDataKey<T>,
     modify_fn: fn(Option<@T>) -> Option<@T>) {
 
index 6303bbbf0e590ef4fe7a2faf96b93966814af5df..76d684a16cd97a6669597f180ea12ba74b74494b 100644 (file)
@@ -50,13 +50,13 @@ impl &str: ToStr {
     fn to_str() -> ~str { str::from_slice(self) }
 }
 
-impl<A: ToStr copy, B: ToStr copy> (A, B): ToStr {
+impl<A: ToStr Copy, B: ToStr Copy> (A, B): ToStr {
     fn to_str() -> ~str {
         let (a, b) = self;
         ~"(" + a.to_str() + ~", " + b.to_str() + ~")"
     }
 }
-impl<A: ToStr copy, B: ToStr copy, C: ToStr copy> (A, B, C): ToStr {
+impl<A: ToStr Copy, B: ToStr Copy, C: ToStr Copy> (A, B, C): ToStr {
     fn to_str() -> ~str {
         let (a, b, c) = self;
         ~"(" + a.to_str() + ~", " + b.to_str() + ~", " + c.to_str() + ~")"
index 2ab8af78b8a000e289cc91a8850f74e88e7b8215..4114adef8f0bfe7f7d4aef9c639487dab79a4d6e 100644 (file)
@@ -12,7 +12,7 @@ trait TupleOps<T,U> {
     pure fn swap() -> (U, T);
 }
 
-impl<T: copy, U: copy> (T, U): TupleOps<T,U> {
+impl<T: Copy, U: Copy> (T, U): TupleOps<T,U> {
 
     /// Return the first element of self
     pure fn first() -> T {
@@ -39,7 +39,7 @@ trait ExtendedTupleOps<A,B> {
     fn map<C>(f: fn(A, B) -> C) -> ~[C];
 }
 
-impl<A: copy, B: copy> (&[A], &[B]): ExtendedTupleOps<A,B> {
+impl<A: Copy, B: Copy> (&[A], &[B]): ExtendedTupleOps<A,B> {
 
     fn zip() -> ~[(A, B)] {
         let (a, b) = self;
@@ -52,7 +52,7 @@ fn map<C>(f: fn(A, B) -> C) -> ~[C] {
     }
 }
 
-impl<A: copy, B: copy> (~[A], ~[B]): ExtendedTupleOps<A,B> {
+impl<A: Copy, B: Copy> (~[A], ~[B]): ExtendedTupleOps<A,B> {
 
     fn zip() -> ~[(A, B)] {
         // XXX: Bad copy
index 2b57d694cbf305405e2ddd0c095246cd9f34de5a..5539aa7d89e4133e123ba7b8db2a48b954e8be54 100644 (file)
@@ -137,7 +137,7 @@ fn ArcDestruct<T>(data: *libc::c_void) -> ArcDestruct<T> {
     }
 }
 
-unsafe fn unwrap_shared_mutable_state<T: send>(+rc: SharedMutableState<T>)
+unsafe fn unwrap_shared_mutable_state<T: Send>(+rc: SharedMutableState<T>)
         -> T {
     struct DeathThroes<T> {
         mut ptr:      Option<~ArcData<T>>,
@@ -207,9 +207,9 @@ struct DeathThroes<T> {
  * Data races between tasks can result in crashes and, with sufficient
  * cleverness, arbitrary type coercion.
  */
-type SharedMutableState<T: send> = ArcDestruct<T>;
+type SharedMutableState<T: Send> = ArcDestruct<T>;
 
-unsafe fn shared_mutable_state<T: send>(+data: T) -> SharedMutableState<T> {
+unsafe fn shared_mutable_state<T: Send>(+data: T) -> SharedMutableState<T> {
     let data = ~ArcData { count: 1, unwrapper: 0, data: Some(data) };
     unsafe {
         let ptr = unsafe::transmute(data);
@@ -218,7 +218,7 @@ unsafe fn shared_mutable_state<T: send>(+data: T) -> SharedMutableState<T> {
 }
 
 #[inline(always)]
-unsafe fn get_shared_mutable_state<T: send>(rc: &a/SharedMutableState<T>)
+unsafe fn get_shared_mutable_state<T: Send>(rc: &a/SharedMutableState<T>)
         -> &a/mut T {
     unsafe {
         let ptr: ~ArcData<T> = unsafe::reinterpret_cast(&(*rc).data);
@@ -230,7 +230,7 @@ unsafe fn get_shared_mutable_state<T: send>(rc: &a/SharedMutableState<T>)
     }
 }
 #[inline(always)]
-unsafe fn get_shared_immutable_state<T: send>(rc: &a/SharedMutableState<T>)
+unsafe fn get_shared_immutable_state<T: Send>(rc: &a/SharedMutableState<T>)
         -> &a/T {
     unsafe {
         let ptr: ~ArcData<T> = unsafe::reinterpret_cast(&(*rc).data);
@@ -242,7 +242,7 @@ unsafe fn get_shared_immutable_state<T: send>(rc: &a/SharedMutableState<T>)
     }
 }
 
-unsafe fn clone_shared_mutable_state<T: send>(rc: &SharedMutableState<T>)
+unsafe fn clone_shared_mutable_state<T: Send>(rc: &SharedMutableState<T>)
         -> SharedMutableState<T> {
     unsafe {
         let ptr: ~ArcData<T> = unsafe::reinterpret_cast(&(*rc).data);
@@ -312,20 +312,20 @@ fn Unlock(l: rust_little_lock) -> Unlock {
     }
 }
 
-struct ExData<T: send> { lock: LittleLock, mut failed: bool, mut data: T, }
+struct ExData<T: Send> { lock: LittleLock, mut failed: bool, mut data: T, }
 /**
  * An arc over mutable data that is protected by a lock. For library use only.
  */
-struct Exclusive<T: send> { x: SharedMutableState<ExData<T>> }
+struct Exclusive<T: Send> { x: SharedMutableState<ExData<T>> }
 
-fn exclusive<T:send >(+user_data: T) -> Exclusive<T> {
+fn exclusive<T:Send >(+user_data: T) -> Exclusive<T> {
     let data = ExData {
         lock: LittleLock(), mut failed: false, mut data: user_data
     };
     Exclusive { x: unsafe { shared_mutable_state(data) } }
 }
 
-impl<T: send> Exclusive<T> {
+impl<T: Send> Exclusive<T> {
     // Duplicate an exclusive ARC, as std::arc::clone.
     fn clone() -> Exclusive<T> {
         Exclusive { x: unsafe { clone_shared_mutable_state(&self.x) } }
@@ -353,7 +353,7 @@ unsafe fn with<U>(f: fn(x: &mut T) -> U) -> U {
 }
 
 // FIXME(#2585) make this a by-move method on the exclusive
-fn unwrap_exclusive<T: send>(+arc: Exclusive<T>) -> T {
+fn unwrap_exclusive<T: Send>(+arc: Exclusive<T>) -> T {
     let Exclusive { x: x } = arc;
     let inner = unsafe { unwrap_shared_mutable_state(x) };
     let ExData { data: data, _ } = inner;
index bb33bad1f85e3edb16cd7c137ecf782880e3c017..e2128693ace837befc52db571be851d374e8de05 100644 (file)
@@ -17,7 +17,7 @@
 /// Sets `*ptr` to `new_value`, invokes `op()`, and then restores the
 /// original value of `*ptr`.
 #[inline(always)]
-fn with<T: copy, R>(
+fn with<T: Copy, R>(
     ptr: &mut T,
     +new_value: T,
     op: &fn() -> R) -> R
index 4dedde8e1778fa27e55146eb390eec0c38ab2936..2ae6a7b2780ce6155fa7f432e1df30716185a45d 100644 (file)
@@ -199,7 +199,7 @@ fn reserve_at_least<T>(&v: ~[const T], n: uint) {
  * Creates an immutable vector of size `n_elts` and initializes the elements
  * to the value `t`.
  */
-pure fn from_elem<T: copy>(n_elts: uint, t: T) -> ~[T] {
+pure fn from_elem<T: Copy>(n_elts: uint, t: T) -> ~[T] {
     let mut v = ~[];
     unchecked{reserve(v, n_elts)}
     let mut i: uint = 0u;
@@ -211,7 +211,7 @@ fn reserve_at_least<T>(&v: ~[const T], n: uint) {
 }
 
 /// Creates a new unique vector with the same contents as the slice
-pure fn from_slice<T: copy>(t: &[T]) -> ~[T] {
+pure fn from_slice<T: Copy>(t: &[T]) -> ~[T] {
     from_fn(t.len(), |i| t[i])
 }
 
@@ -281,10 +281,10 @@ fn reserve_at_least<T>(&v: ~[const T], n: uint) {
 // Accessors
 
 /// Returns the first element of a vector
-pure fn head<T: copy>(v: &[const T]) -> T { v[0] }
+pure fn head<T: Copy>(v: &[const T]) -> T { v[0] }
 
 /// Returns a vector containing all but the first element of a slice
-pure fn tail<T: copy>(v: &[const T]) -> ~[T] {
+pure fn tail<T: Copy>(v: &[const T]) -> ~[T] {
     return slice(v, 1u, len(v));
 }
 
@@ -292,18 +292,18 @@ fn reserve_at_least<T>(&v: ~[const T], n: uint) {
  * Returns a vector containing all but the first `n` \
  * elements of a slice
  */
-pure fn tailn<T: copy>(v: &[const T], n: uint) -> ~[T] {
+pure fn tailn<T: Copy>(v: &[const T], n: uint) -> ~[T] {
     slice(v, n, len(v))
 }
 
 /// Returns a vector containing all but the last element of a slice
-pure fn init<T: copy>(v: &[const T]) -> ~[T] {
+pure fn init<T: Copy>(v: &[const T]) -> ~[T] {
     assert len(v) != 0u;
     slice(v, 0u, len(v) - 1u)
 }
 
 /// Returns the last element of the slice `v`, failing if the slice is empty.
-pure fn last<T: copy>(v: &[const T]) -> T {
+pure fn last<T: Copy>(v: &[const T]) -> T {
     if len(v) == 0u { fail ~"last_unsafe: empty vector" }
     v[len(v) - 1u]
 }
@@ -312,13 +312,13 @@ fn reserve_at_least<T>(&v: ~[const T], n: uint) {
  * Returns `Some(x)` where `x` is the last element of the slice `v`,
  * or `none` if the vector is empty.
  */
-pure fn last_opt<T: copy>(v: &[const T]) -> Option<T> {
+pure fn last_opt<T: Copy>(v: &[const T]) -> Option<T> {
     if len(v) == 0u { return None; }
     Some(v[len(v) - 1u])
 }
 
 /// Returns a copy of the elements from [`start`..`end`) from `v`.
-pure fn slice<T: copy>(v: &[const T], start: uint, end: uint) -> ~[T] {
+pure fn slice<T: Copy>(v: &[const T], start: uint, end: uint) -> ~[T] {
     assert (start <= end);
     assert (end <= len(v));
     let mut result = ~[];
@@ -365,7 +365,7 @@ fn reserve_at_least<T>(&v: ~[const T], n: uint) {
 }
 
 /// Split the vector `v` by applying each element against the predicate `f`.
-fn split<T: copy>(v: &[T], f: fn(T) -> bool) -> ~[~[T]] {
+fn split<T: Copy>(v: &[T], f: fn(T) -> bool) -> ~[~[T]] {
     let ln = len(v);
     if (ln == 0u) { return ~[] }
 
@@ -388,7 +388,7 @@ fn split<T: copy>(v: &[T], f: fn(T) -> bool) -> ~[~[T]] {
  * Split the vector `v` by applying each element against the predicate `f` up
  * to `n` times.
  */
-fn splitn<T: copy>(v: &[T], n: uint, f: fn(T) -> bool) -> ~[~[T]] {
+fn splitn<T: Copy>(v: &[T], n: uint, f: fn(T) -> bool) -> ~[~[T]] {
     let ln = len(v);
     if (ln == 0u) { return ~[] }
 
@@ -414,7 +414,7 @@ fn splitn<T: copy>(v: &[T], n: uint, f: fn(T) -> bool) -> ~[~[T]] {
  * Reverse split the vector `v` by applying each element against the predicate
  * `f`.
  */
-fn rsplit<T: copy>(v: &[T], f: fn(T) -> bool) -> ~[~[T]] {
+fn rsplit<T: Copy>(v: &[T], f: fn(T) -> bool) -> ~[~[T]] {
     let ln = len(v);
     if (ln == 0u) { return ~[] }
 
@@ -438,7 +438,7 @@ fn rsplit<T: copy>(v: &[T], f: fn(T) -> bool) -> ~[~[T]] {
  * Reverse split the vector `v` by applying each element against the predicate
  * `f` up to `n times.
  */
-fn rsplitn<T: copy>(v: &[T], n: uint, f: fn(T) -> bool) -> ~[~[T]] {
+fn rsplitn<T: Copy>(v: &[T], n: uint, f: fn(T) -> bool) -> ~[~[T]] {
     let ln = len(v);
     if (ln == 0u) { return ~[] }
 
@@ -589,7 +589,7 @@ fn push_slow<T>(&v: ~[const T], +initval: T) {
 }
 
 #[inline(always)]
-fn push_all<T: copy>(&v: ~[const T], rhs: &[const T]) {
+fn push_all<T: Copy>(&v: ~[const T], rhs: &[const T]) {
     reserve(v, v.len() + rhs.len());
 
     for uint::range(0u, rhs.len()) |i| {
@@ -627,7 +627,7 @@ fn truncate<T>(&v: ~[const T], newlen: uint) {
 
 // Appending
 #[inline(always)]
-pure fn append<T: copy>(+lhs: ~[T], rhs: &[const T]) -> ~[T] {
+pure fn append<T: Copy>(+lhs: ~[T], rhs: &[const T]) -> ~[T] {
     let mut v <- lhs;
     unchecked {
         push_all(v, rhs);
@@ -643,7 +643,7 @@ fn truncate<T>(&v: ~[const T], newlen: uint) {
 }
 
 #[inline(always)]
-pure fn append_mut<T: copy>(lhs: &[mut T], rhs: &[const T]) -> ~[mut T] {
+pure fn append_mut<T: Copy>(lhs: &[mut T], rhs: &[const T]) -> ~[mut T] {
     let mut v = ~[mut];
     let mut i = 0u;
     while i < lhs.len() {
@@ -671,7 +671,7 @@ fn truncate<T>(&v: ~[const T], newlen: uint) {
  * * n - The number of elements to add
  * * initval - The value for the new elements
  */
-fn grow<T: copy>(&v: ~[const T], n: uint, initval: T) {
+fn grow<T: Copy>(&v: ~[const T], n: uint, initval: T) {
     reserve_at_least(v, len(v) + n);
     let mut i: uint = 0u;
 
@@ -705,7 +705,7 @@ fn grow_fn<T>(&v: ~[const T], n: uint, op: iter::InitOp<T>) {
  * of the vector, expands the vector by replicating `initval` to fill the
  * intervening space.
  */
-fn grow_set<T: copy>(&v: ~[mut T], index: uint, initval: T, val: T) {
+fn grow_set<T: Copy>(&v: ~[mut T], index: uint, initval: T, val: T) {
     if index >= len(v) { grow(v, index - len(v) + 1u, initval); }
     v[index] = val;
 }
@@ -747,7 +747,7 @@ fn map_consume<T, U>(+v: ~[T], f: fn(+T) -> U) -> ~[U] {
 }
 
 /// Apply a function to each pair of elements and return the results
-pure fn map2<T: copy, U: copy, V>(v0: &[T], v1: &[U],
+pure fn map2<T: Copy, U: Copy, V>(v0: &[T], v1: &[U],
                                   f: fn(T, U) -> V) -> ~[V] {
     let v0_len = len(v0);
     if v0_len != len(v1) { fail; }
@@ -766,7 +766,7 @@ fn map_consume<T, U>(+v: ~[T], f: fn(+T) -> U) -> ~[U] {
  * If function `f` returns `none` then that element is excluded from
  * the resulting vector.
  */
-pure fn filter_map<T, U: copy>(v: &[T], f: fn(T) -> Option<U>)
+pure fn filter_map<T, U: Copy>(v: &[T], f: fn(T) -> Option<U>)
     -> ~[U] {
     let mut result = ~[];
     for each(v) |elem| {
@@ -785,7 +785,7 @@ fn map_consume<T, U>(+v: ~[T], f: fn(+T) -> U) -> ~[U] {
  * Apply function `f` to each element of `v` and return a vector containing
  * only those elements for which `f` returned true.
  */
-pure fn filter<T: copy>(v: &[T], f: fn(T) -> bool) -> ~[T] {
+pure fn filter<T: Copy>(v: &[T], f: fn(T) -> bool) -> ~[T] {
     let mut result = ~[];
     for each(v) |elem| {
         if f(elem) { unsafe { push(result, elem); } }
@@ -798,14 +798,14 @@ fn map_consume<T, U>(+v: ~[T], f: fn(+T) -> U) -> ~[U] {
  *
  * Flattens a vector of vectors of T into a single vector of T.
  */
-pure fn concat<T: copy>(v: &[~[T]]) -> ~[T] {
+pure fn concat<T: Copy>(v: &[~[T]]) -> ~[T] {
     let mut r = ~[];
     for each(v) |inner| { unsafe { push_all(r, inner); } }
     return r;
 }
 
 /// Concatenate a vector of vectors, placing a given separator between each
-pure fn connect<T: copy>(v: &[~[T]], sep: T) -> ~[T] {
+pure fn connect<T: Copy>(v: &[~[T]], sep: T) -> ~[T] {
     let mut r: ~[T] = ~[];
     let mut first = true;
     for each(v) |inner| {
@@ -816,7 +816,7 @@ fn map_consume<T, U>(+v: ~[T], f: fn(+T) -> U) -> ~[U] {
 }
 
 /// Reduce a vector from left to right
-pure fn foldl<T: copy, U>(z: T, v: &[U], p: fn(T, U) -> T) -> T {
+pure fn foldl<T: Copy, U>(z: T, v: &[U], p: fn(T, U) -> T) -> T {
     let mut accum = z;
     do iter(v) |elt| {
         accum = p(accum, elt);
@@ -825,7 +825,7 @@ fn map_consume<T, U>(+v: ~[T], f: fn(+T) -> U) -> ~[U] {
 }
 
 /// Reduce a vector from right to left
-pure fn foldr<T, U: copy>(v: &[T], z: U, p: fn(T, U) -> U) -> U {
+pure fn foldr<T, U: Copy>(v: &[T], z: U, p: fn(T, U) -> U) -> U {
     let mut accum = z;
     do riter(v) |elt| {
         accum = p(elt, accum);
@@ -914,7 +914,7 @@ fn map_consume<T, U>(+v: ~[T], f: fn(+T) -> U) -> ~[U] {
  * When function `f` returns true then an option containing the element
  * is returned. If `f` matches no elements then none is returned.
  */
-pure fn find<T: copy>(v: &[T], f: fn(T) -> bool) -> Option<T> {
+pure fn find<T: Copy>(v: &[T], f: fn(T) -> bool) -> Option<T> {
     find_between(v, 0u, len(v), f)
 }
 
@@ -925,7 +925,7 @@ fn map_consume<T, U>(+v: ~[T], f: fn(+T) -> U) -> ~[U] {
  * [`start`, `end`). When function `f` returns true then an option containing
  * the element is returned. If `f` matches no elements then none is returned.
  */
-pure fn find_between<T: copy>(v: &[T], start: uint, end: uint,
+pure fn find_between<T: Copy>(v: &[T], start: uint, end: uint,
                       f: fn(T) -> bool) -> Option<T> {
     option::map(position_between(v, start, end, f), |i| v[i])
 }
@@ -937,7 +937,7 @@ fn map_consume<T, U>(+v: ~[T], f: fn(+T) -> U) -> ~[U] {
  * `f` returns true then an option containing the element is returned. If `f`
  * matches no elements then none is returned.
  */
-pure fn rfind<T: copy>(v: &[T], f: fn(T) -> bool) -> Option<T> {
+pure fn rfind<T: Copy>(v: &[T], f: fn(T) -> bool) -> Option<T> {
     rfind_between(v, 0u, len(v), f)
 }
 
@@ -948,7 +948,7 @@ fn map_consume<T, U>(+v: ~[T], f: fn(+T) -> U) -> ~[U] {
  * [`start`, `end`). When function `f` returns true then an option containing
  * the element is returned. If `f` matches no elements then none is returned.
  */
-pure fn rfind_between<T: copy>(v: &[T], start: uint, end: uint,
+pure fn rfind_between<T: Copy>(v: &[T], start: uint, end: uint,
                                f: fn(T) -> bool) -> Option<T> {
     option::map(rposition_between(v, start, end, f), |i| v[i])
 }
@@ -1028,7 +1028,7 @@ fn map_consume<T, U>(+v: ~[T], f: fn(+T) -> U) -> ~[U] {
 /**
  * Convert a vector of pairs into a pair of vectors, by reference. As unzip().
  */
-pure fn unzip_slice<T: copy, U: copy>(v: &[(T, U)]) -> (~[T], ~[U]) {
+pure fn unzip_slice<T: Copy, U: Copy>(v: &[(T, U)]) -> (~[T], ~[U]) {
     let mut as = ~[], bs = ~[];
     for each(v) |p| {
         let (a, b) = p;
@@ -1063,7 +1063,7 @@ fn map_consume<T, U>(+v: ~[T], f: fn(+T) -> U) -> ~[U] {
 /**
  * Convert two vectors to a vector of pairs, by reference. As zip().
  */
-pure fn zip_slice<T: copy, U: copy>(v: &[const T], u: &[const U])
+pure fn zip_slice<T: Copy, U: Copy>(v: &[const T], u: &[const U])
         -> ~[(T, U)] {
     let mut zipped = ~[];
     let sz = len(v);
@@ -1113,7 +1113,7 @@ fn reverse<T>(v: ~[mut T]) {
 
 
 /// Returns a vector with the order of elements reversed
-pure fn reversed<T: copy>(v: &[const T]) -> ~[T] {
+pure fn reversed<T: Copy>(v: &[const T]) -> ~[T] {
     let mut rs: ~[T] = ~[];
     let mut i = len::<T>(v);
     if i == 0u { return rs; } else { i -= 1u; }
@@ -1317,7 +1317,7 @@ fn iter2<U, T>(v1: &[U], v2: &[T], f: fn(U, T)) {
  * The total number of permutations produced is `len(v)!`.  If `v` contains
  * repeated elements, then some permutations are repeated.
  */
-pure fn permute<T: copy>(v: &[const T], put: fn(~[T])) {
+pure fn permute<T: Copy>(v: &[const T], put: fn(~[T])) {
     let ln = len(v);
     if ln == 0u {
         put(~[]);
@@ -1337,7 +1337,7 @@ fn iter2<U, T>(v1: &[U], v2: &[T], f: fn(U, T)) {
     }
 }
 
-pure fn windowed<TT: copy>(nn: uint, xx: &[TT]) -> ~[~[TT]] {
+pure fn windowed<TT: Copy>(nn: uint, xx: &[TT]) -> ~[~[TT]] {
     let mut ww = ~[];
     assert 1u <= nn;
     vec::iteri (xx, |ii, _x| {
@@ -1480,14 +1480,14 @@ impl<T: Ord> @[T]: Ord {
 }
 
 #[cfg(notest)]
-impl<T: copy> ~[T]: Add<&[const T],~[T]> {
+impl<T: Copy> ~[T]: Add<&[const T],~[T]> {
     #[inline(always)]
     pure fn add(rhs: &[const T]) -> ~[T] {
         append(copy self, rhs)
     }
 }
 
-impl<T: copy> ~[mut T]: Add<&[const T],~[mut T]> {
+impl<T: Copy> ~[mut T]: Add<&[const T],~[mut T]> {
     #[inline(always)]
     pure fn add(rhs: &[const T]) -> ~[mut T] {
         append_mut(self, rhs)
@@ -1522,7 +1522,7 @@ trait CopyableVector<T> {
 }
 
 /// Extension methods for vectors
-impl<T: copy> &[const T]: CopyableVector<T> {
+impl<T: Copy> &[const T]: CopyableVector<T> {
     /// Returns the first element of a vector
     #[inline]
     pure fn head() -> T { head(self) }
@@ -1541,7 +1541,7 @@ impl<T: copy> &[const T]: CopyableVector<T> {
 }
 
 trait ImmutableVector<T> {
-    pure fn foldr<U: copy>(z: U, p: fn(T, U) -> U) -> U;
+    pure fn foldr<U: Copy>(z: U, p: fn(T, U) -> U) -> U;
     pure fn iter(f: fn(T));
     pure fn iteri(f: fn(uint, T));
     pure fn riter(f: fn(T));
@@ -1551,7 +1551,7 @@ trait ImmutableVector<T> {
     fn map_r<U>(f: fn(x: &T) -> U) -> ~[U];
     pure fn alli(f: fn(uint, T) -> bool) -> bool;
     pure fn flat_map<U>(f: fn(T) -> ~[U]) -> ~[U];
-    pure fn filter_map<U: copy>(f: fn(T) -> Option<U>) -> ~[U];
+    pure fn filter_map<U: Copy>(f: fn(T) -> Option<U>) -> ~[U];
 }
 
 trait ImmutableEqVector<T: Eq> {
@@ -1565,7 +1565,7 @@ trait ImmutableEqVector<T: Eq> {
 impl<T> &[T]: ImmutableVector<T> {
     /// Reduce a vector from right to left
     #[inline]
-    pure fn foldr<U: copy>(z: U, p: fn(T, U) -> U) -> U { foldr(self, z, p) }
+    pure fn foldr<U: Copy>(z: U, p: fn(T, U) -> U) -> U { foldr(self, z, p) }
     /**
      * Iterates over a vector
      *
@@ -1641,7 +1641,7 @@ fn map_r<U>(f: fn(x: &T) -> U) -> ~[U] {
      * the resulting vector.
      */
     #[inline]
-    pure fn filter_map<U: copy>(f: fn(T) -> Option<U>) -> ~[U] {
+    pure fn filter_map<U: Copy>(f: fn(T) -> Option<U>) -> ~[U] {
         filter_map(self, f)
     }
 }
@@ -1679,7 +1679,7 @@ trait ImmutableCopyableVector<T> {
 }
 
 /// Extension methods for vectors
-impl<T: copy> &[T]: ImmutableCopyableVector<T> {
+impl<T: Copy> &[T]: ImmutableCopyableVector<T> {
     /**
      * Construct a new vector from the elements of a vector for which some
      * predicate holds.
@@ -1785,7 +1785,7 @@ unsafe fn form_slice<T,U>(p: *T, len: uint, f: fn(&& &[T]) -> U) -> U {
      * Unchecked vector indexing.
      */
     #[inline(always)]
-    unsafe fn get<T: copy>(v: &[const T], i: uint) -> T {
+    unsafe fn get<T: Copy>(v: &[const T], i: uint) -> T {
         as_buf(v, |p, _len| *ptr::offset(p, i))
     }
 
@@ -1938,7 +1938,7 @@ impl<A: Eq> &[A]: iter::EqIter<A> {
     }
 }
 
-impl<A: copy> &[A]: iter::CopyableIter<A> {
+impl<A: Copy> &[A]: iter::CopyableIter<A> {
     pure fn filter_to_vec(pred: fn(A) -> bool) -> ~[A] {
         iter::filter_to_vec(self, pred)
     }
@@ -1955,7 +1955,7 @@ impl<A: copy> &[A]: iter::CopyableIter<A> {
     pure fn find(p: fn(A) -> bool) -> Option<A> { iter::find(self, p) }
 }
 
-impl<A: copy Ord> &[A]: iter::CopyableOrderedIter<A> {
+impl<A: Copy Ord> &[A]: iter::CopyableOrderedIter<A> {
     pure fn min() -> A { iter::min(self) }
     pure fn max() -> A { iter::max(self) }
 }
index b5af4af06c34d91d962989d84115dc1302a0bb83..fb9a7e7e489c1de3ea5e7c0836e144a0f80c6e61 100644 (file)
@@ -69,10 +69,10 @@ fn broadcast_on(condvar_id: uint) -> uint {
  ****************************************************************************/
 
 /// An atomically reference counted wrapper for shared immutable state.
-struct ARC<T: const send> { x: SharedMutableState<T> }
+struct ARC<T: Const Send> { x: SharedMutableState<T> }
 
 /// Create an atomically reference counted wrapper.
-fn ARC<T: const send>(+data: T) -> ARC<T> {
+fn ARC<T: Const Send>(+data: T) -> ARC<T> {
     ARC { x: unsafe { shared_mutable_state(data) } }
 }
 
@@ -80,7 +80,7 @@ fn ARC<T: const send>(+data: T) -> ARC<T> {
  * Access the underlying data in an atomically reference counted
  * wrapper.
  */
-fn get<T: const send>(rc: &a/ARC<T>) -> &a/T {
+fn get<T: Const Send>(rc: &a/ARC<T>) -> &a/T {
     unsafe { get_shared_immutable_state(&rc.x) }
 }
 
@@ -91,7 +91,7 @@ fn get<T: const send>(rc: &a/ARC<T>) -> &a/T {
  * object. However, one of the `arc` objects can be sent to another task,
  * allowing them to share the underlying data.
  */
-fn clone<T: const send>(rc: &ARC<T>) -> ARC<T> {
+fn clone<T: Const Send>(rc: &ARC<T>) -> ARC<T> {
     ARC { x: unsafe { clone_shared_mutable_state(&rc.x) } }
 }
 
@@ -104,7 +104,7 @@ fn clone<T: const send>(rc: &ARC<T>) -> ARC<T> {
  * unwrap from a task that holds another reference to the same ARC; it is
  * guaranteed to deadlock.
  */
-fn unwrap<T: const send>(+rc: ARC<T>) -> T {
+fn unwrap<T: Const Send>(+rc: ARC<T>) -> T {
     let ARC { x: x } = rc;
     unsafe { unwrap_shared_mutable_state(x) }
 }
@@ -114,19 +114,19 @@ fn unwrap<T: const send>(+rc: ARC<T>) -> T {
  ****************************************************************************/
 
 #[doc(hidden)]
-struct MutexARCInner<T: send> { lock: Mutex, failed: bool, data: T }
+struct MutexARCInner<T: Send> { lock: Mutex, failed: bool, data: T }
 /// An ARC with mutable data protected by a blocking mutex.
-struct MutexARC<T: send> { x: SharedMutableState<MutexARCInner<T>> }
+struct MutexARC<T: Send> { x: SharedMutableState<MutexARCInner<T>> }
 
 /// Create a mutex-protected ARC with the supplied data.
-fn MutexARC<T: send>(+user_data: T) -> MutexARC<T> {
+fn MutexARC<T: Send>(+user_data: T) -> MutexARC<T> {
     mutex_arc_with_condvars(user_data, 1)
 }
 /**
  * Create a mutex-protected ARC with the supplied data and a specified number
  * of condvars (as sync::mutex_with_condvars).
  */
-fn mutex_arc_with_condvars<T: send>(+user_data: T,
+fn mutex_arc_with_condvars<T: Send>(+user_data: T,
                                     num_condvars: uint) -> MutexARC<T> {
     let data =
         MutexARCInner { lock: mutex_with_condvars(num_condvars),
@@ -134,7 +134,7 @@ fn mutex_arc_with_condvars<T: send>(+user_data: T,
     MutexARC { x: unsafe { shared_mutable_state(data) } }
 }
 
-impl<T: send> &MutexARC<T> {
+impl<T: Send> &MutexARC<T> {
     /// Duplicate a mutex-protected ARC, as arc::clone.
     fn clone() -> MutexARC<T> {
         // NB: Cloning the underlying mutex is not necessary. Its reference
@@ -197,7 +197,7 @@ unsafe fn access_cond<U>(blk: fn(x: &x/mut T, c: &c/Condvar) -> U) -> U {
  * Will additionally fail if another task has failed while accessing the arc.
  */
 // FIXME(#2585) make this a by-move method on the arc
-fn unwrap_mutex_arc<T: send>(+arc: MutexARC<T>) -> T {
+fn unwrap_mutex_arc<T: Send>(+arc: MutexARC<T>) -> T {
     let MutexARC { x: x } = arc;
     let inner = unsafe { unwrap_shared_mutable_state(x) };
     let MutexARCInner { failed: failed, data: data, _ } = inner;
@@ -240,27 +240,27 @@ fn PoisonOnFail(failed: &r/mut bool) -> PoisonOnFail/&r {
  ****************************************************************************/
 
 #[doc(hidden)]
-struct RWARCInner<T: const send> { lock: RWlock, failed: bool, data: T }
+struct RWARCInner<T: Const Send> { lock: RWlock, failed: bool, data: T }
 /**
  * A dual-mode ARC protected by a reader-writer lock. The data can be accessed
  * mutably or immutably, and immutably-accessing tasks may run concurrently.
  *
  * Unlike mutex_arcs, rw_arcs are safe, because they cannot be nested.
  */
-struct RWARC<T: const send> {
+struct RWARC<T: Const Send> {
     x: SharedMutableState<RWARCInner<T>>,
     mut cant_nest: ()
 }
 
 /// Create a reader/writer ARC with the supplied data.
-fn RWARC<T: const send>(+user_data: T) -> RWARC<T> {
+fn RWARC<T: Const Send>(+user_data: T) -> RWARC<T> {
     rw_arc_with_condvars(user_data, 1)
 }
 /**
  * Create a reader/writer ARC with the supplied data and a specified number
  * of condvars (as sync::rwlock_with_condvars).
  */
-fn rw_arc_with_condvars<T: const send>(+user_data: T,
+fn rw_arc_with_condvars<T: Const Send>(+user_data: T,
                                        num_condvars: uint) -> RWARC<T> {
     let data =
         RWARCInner { lock: rwlock_with_condvars(num_condvars),
@@ -268,7 +268,7 @@ fn rw_arc_with_condvars<T: const send>(+user_data: T,
     RWARC { x: unsafe { shared_mutable_state(data) }, cant_nest: () }
 }
 
-impl<T: const send> &RWARC<T> {
+impl<T: Const Send> &RWARC<T> {
     /// Duplicate a rwlock-protected ARC, as arc::clone.
     fn clone() -> RWARC<T> {
         RWARC { x: unsafe { clone_shared_mutable_state(&self.x) },
@@ -375,7 +375,7 @@ fn downgrade(+token: RWWriteMode/&a<T>) -> RWReadMode/&a<T> {
  * in write mode.
  */
 // FIXME(#2585) make this a by-move method on the arc
-fn unwrap_rw_arc<T: const send>(+arc: RWARC<T>) -> T {
+fn unwrap_rw_arc<T: Const Send>(+arc: RWARC<T>) -> T {
     let RWARC { x: x, _ } = arc;
     let inner = unsafe { unwrap_shared_mutable_state(x) };
     let RWARCInner { failed: failed, data: data, _ } = inner;
@@ -389,19 +389,19 @@ fn unwrap_rw_arc<T: const send>(+arc: RWARC<T>) -> T {
 // lock it. This wraps the unsafety, with the justification that the 'lock'
 // field is never overwritten; only 'failed' and 'data'.
 #[doc(hidden)]
-fn borrow_rwlock<T: const send>(state: &r/mut RWARCInner<T>) -> &r/RWlock {
+fn borrow_rwlock<T: Const Send>(state: &r/mut RWARCInner<T>) -> &r/RWlock {
     unsafe { unsafe::transmute_immut(&mut state.lock) }
 }
 
 // FIXME (#3154) ice with struct/&<T> prevents these from being structs.
 
 /// The "write permission" token used for RWARC.write_downgrade().
-enum RWWriteMode<T: const send> =
+enum RWWriteMode<T: Const Send> =
     (&mut T, sync::RWlockWriteMode, PoisonOnFail);
 /// The "read permission" token used for RWARC.write_downgrade().
-enum RWReadMode<T:const send> = (&T, sync::RWlockReadMode);
+enum RWReadMode<T:Const Send> = (&T, sync::RWlockReadMode);
 
-impl<T: const send> &RWWriteMode<T> {
+impl<T: Const Send> &RWWriteMode<T> {
     /// Access the pre-downgrade RWARC in write mode.
     fn write<U>(blk: fn(x: &mut T) -> U) -> U {
         match *self {
@@ -427,7 +427,7 @@ fn write_cond<U>(blk: fn(x: &x/mut T, c: &c/Condvar) -> U) -> U {
     }
 }
 
-impl<T: const send> &RWReadMode<T> {
+impl<T: Const Send> &RWReadMode<T> {
     /// Access the post-downgrade rwlock in read mode.
     fn read<U>(blk: fn(x: &T) -> U) -> U {
         match *self {
index 5b0e9b0ffddeab89314a9851aa4e5d5ab9c5b857..53964fb0ddb56e9a6a6457b0a954e8daa724e6e1 100644 (file)
@@ -107,7 +107,7 @@ unsafe fn c_vec_with_dtor<T>(base: *mut T, len: uint, dtor: fn@())
  *
  * Fails if `ofs` is greater or equal to the length of the vector
  */
-fn get<T: copy>(t: CVec<T>, ofs: uint) -> T {
+fn get<T: Copy>(t: CVec<T>, ofs: uint) -> T {
     assert ofs < len(t);
     return unsafe { *ptr::mut_offset((*t).base, ofs) };
 }
@@ -117,7 +117,7 @@ fn get<T: copy>(t: CVec<T>, ofs: uint) -> T {
  *
  * Fails if `ofs` is greater or equal to the length of the vector
  */
-fn set<T: copy>(t: CVec<T>, ofs: uint, v: T) {
+fn set<T: Copy>(t: CVec<T>, ofs: uint, v: T) {
     assert ofs < len(t);
     unsafe { *ptr::mut_offset((*t).base, ofs) = v };
 }
index d286b496923c3cc4fbe86d064d72d1a145c05bcc..d78e11452bcb861559fae3327a84d35051226554 100644 (file)
@@ -13,7 +13,7 @@
 export DuplexStream;
 
 /// An extension of `pipes::stream` that allows both sending and receiving.
-struct DuplexStream<T: send, U: send> : Channel<T>, Recv<U>, Selectable {
+struct DuplexStream<T: Send, U: Send> : Channel<T>, Recv<U>, Selectable {
     priv chan: Chan<T>,
     priv port: Port <U>,
 
@@ -43,7 +43,7 @@ fn try_recv() -> Option<U> {
 }
 
 /// Creates a bidirectional stream.
-fn DuplexStream<T: send, U: send>()
+fn DuplexStream<T: Send, U: Send>()
     -> (DuplexStream<T, U>, DuplexStream<U, T>)
 {
     let (c2, p1) = pipes::stream();
index 6cd229bc689e8326f56af6a20970355c26505c5e..f9def4b2332f5c6d421f06501541cf270ffccb8d 100644 (file)
@@ -16,7 +16,7 @@ trait Deque<T> {
 
 // FIXME (#2343) eventually, a proper datatype plus an exported impl would
 // be preferrable.
-fn create<T: copy>() -> Deque<T> {
+fn create<T: Copy>() -> Deque<T> {
     type Cell<T> = Option<T>;
 
     let initial_capacity: uint = 32u; // 2^5
@@ -24,7 +24,7 @@ fn create<T: copy>() -> Deque<T> {
       * Grow is only called on full elts, so nelts is also len(elts), unlike
       * elsewhere.
       */
-    fn grow<T: copy>(nelts: uint, lo: uint, -elts: ~[mut Cell<T>]) ->
+    fn grow<T: Copy>(nelts: uint, lo: uint, -elts: ~[mut Cell<T>]) ->
        ~[mut Cell<T>] {
         assert (nelts == vec::len(elts));
         let mut rv = ~[mut];
@@ -40,7 +40,7 @@ fn grow<T: copy>(nelts: uint, lo: uint, -elts: ~[mut Cell<T>]) ->
 
         return rv;
     }
-    fn get<T: copy>(elts: DVec<Cell<T>>, i: uint) -> T {
+    fn get<T: Copy>(elts: DVec<Cell<T>>, i: uint) -> T {
         match elts.get_elt(i) { Some(t) => t, _ => fail }
     }
 
@@ -49,7 +49,7 @@ fn get<T: copy>(elts: DVec<Cell<T>>, i: uint) -> T {
                     mut hi: uint,
                     elts: DVec<Cell<T>>};
 
-    impl <T: copy> Repr<T>: Deque<T> {
+    impl <T: Copy> Repr<T>: Deque<T> {
         fn size() -> uint { return self.nelts; }
         fn add_front(t: T) {
             let oldlo: uint = self.lo;
@@ -193,7 +193,7 @@ fn test_boxes(a: @int, b: @int, c: @int, d: @int) {
 
     type EqFn<T> = fn@(T, T) -> bool;
 
-    fn test_parameterized<T: copy owned>(
+    fn test_parameterized<T: Copy Owned>(
         e: EqFn<T>, a: T, b: T, c: T, d: T) {
 
         let deq: deque::Deque<T> = deque::create::<T>();
index e7a92e5d8ccf5e5d093914ddcfd3b54b06f04005..3761b51140283a735e44ef9504b6d8c62b89bcec 100644 (file)
@@ -33,7 +33,7 @@ enum TreeNode<K, V> {
 fn init<K, V>() -> Treemap<K, V> { @Empty }
 
 /// Insert a value into the map
-fn insert<K: copy Eq Ord, V: copy>(m: Treemap<K, V>, +k: K, +v: V)
+fn insert<K: Copy Eq Ord, V: Copy>(m: Treemap<K, V>, +k: K, +v: V)
   -> Treemap<K, V> {
     @match m {
        @Empty => Node(@k, @v, @Empty, @Empty),
@@ -48,7 +48,7 @@ fn insert<K: copy Eq Ord, V: copy>(m: Treemap<K, V>, +k: K, +v: V)
 }
 
 /// Find a value based on the key
-fn find<K: Eq Ord, V: copy>(m: Treemap<K, V>, +k: K) -> Option<V> {
+fn find<K: Eq Ord, V: Copy>(m: Treemap<K, V>, +k: K) -> Option<V> {
     match *m {
       Empty => None,
       Node(@kk, @v, left, right) => {
@@ -60,7 +60,7 @@ fn find<K: Eq Ord, V: copy>(m: Treemap<K, V>, +k: K) -> Option<V> {
 }
 
 /// Visit all pairs in the map in order.
-fn traverse<K, V: copy>(m: Treemap<K, V>, f: fn(K, V)) {
+fn traverse<K, V: Copy>(m: Treemap<K, V>, f: fn(K, V)) {
     match *m {
       Empty => (),
       /*
index f2207f2a913b8bd460ff60f0c66d4f598fd9737b..1adb41e8d10b8562888f78b4918d0640160b58c7 100644 (file)
@@ -720,7 +720,7 @@ impl <A: ToJson> ~[A]: ToJson {
     fn to_json() -> Json { List(@self.map(|elt| elt.to_json())) }
 }
 
-impl <A: ToJson copy> hashmap<~str, A>: ToJson {
+impl <A: ToJson Copy> hashmap<~str, A>: ToJson {
     fn to_json() -> Json {
         let d = map::str_hash();
         for self.each() |key, value| {
index 71b820b40224ef5065f6d1ac8211f5a760d8c0b1..96d4e32d02befa368f6869683840938c966a7e27 100644 (file)
@@ -13,7 +13,7 @@ enum List<T> {
 }
 
 /// Cregate a list from a vector
-fn from_vec<T: copy>(v: &[T]) -> @List<T> {
+fn from_vec<T: Copy>(v: &[T]) -> @List<T> {
     vec::foldr(v, @Nil::<T>, |h, t| @Cons(h, t))
 }
 
@@ -30,7 +30,7 @@ fn from_vec<T: copy>(v: &[T]) -> @List<T> {
  * * z - The initial value
  * * f - The function to apply
  */
-fn foldl<T: copy, U>(+z: T, ls: @List<U>, f: fn((&T), (&U)) -> T) -> T {
+fn foldl<T: Copy, U>(+z: T, ls: @List<U>, f: fn((&T), (&U)) -> T) -> T {
     let mut accum: T = z;
     do iter(ls) |elt| { accum = f(&accum, &elt);}
     accum
@@ -43,7 +43,7 @@ fn foldl<T: copy, U>(+z: T, ls: @List<U>, f: fn((&T), (&U)) -> T) -> T {
  * When function `f` returns true then an option containing the element
  * is returned. If `f` matches no elements then none is returned.
  */
-fn find<T: copy>(ls: @List<T>, f: fn((&T)) -> bool) -> Option<T> {
+fn find<T: Copy>(ls: @List<T>, f: fn((&T)) -> bool) -> Option<T> {
     let mut ls = ls;
     loop {
         ls = match *ls {
@@ -57,7 +57,7 @@ fn find<T: copy>(ls: @List<T>, f: fn((&T)) -> bool) -> Option<T> {
 }
 
 /// Returns true if a list contains an element with the given value
-fn has<T: copy Eq>(ls: @List<T>, +elt: T) -> bool {
+fn has<T: Copy Eq>(ls: @List<T>, +elt: T) -> bool {
     for each(ls) |e| {
         if e == elt { return true; }
     }
@@ -65,7 +65,7 @@ fn has<T: copy Eq>(ls: @List<T>, +elt: T) -> bool {
 }
 
 /// Returns true if the list is empty
-pure fn is_empty<T: copy>(ls: @List<T>) -> bool {
+pure fn is_empty<T: Copy>(ls: @List<T>) -> bool {
     match *ls {
         Nil => true,
         _ => false
@@ -73,7 +73,7 @@ fn has<T: copy Eq>(ls: @List<T>, +elt: T) -> bool {
 }
 
 /// Returns true if the list is not empty
-pure fn is_not_empty<T: copy>(ls: @List<T>) -> bool {
+pure fn is_not_empty<T: Copy>(ls: @List<T>) -> bool {
     return !is_empty(ls);
 }
 
@@ -85,7 +85,7 @@ fn len<T>(ls: @List<T>) -> uint {
 }
 
 /// Returns all but the first element of a list
-pure fn tail<T: copy>(ls: @List<T>) -> @List<T> {
+pure fn tail<T: Copy>(ls: @List<T>) -> @List<T> {
     match *ls {
         Cons(_, tl) => return tl,
         Nil => fail ~"list empty"
@@ -93,7 +93,7 @@ fn len<T>(ls: @List<T>) -> uint {
 }
 
 /// Returns the first element of a list
-pure fn head<T: copy>(ls: @List<T>) -> T {
+pure fn head<T: Copy>(ls: @List<T>) -> T {
     match *ls {
       Cons(hd, _) => hd,
       // makes me sad
@@ -102,7 +102,7 @@ fn len<T>(ls: @List<T>) -> uint {
 }
 
 /// Appends one list to another
-pure fn append<T: copy>(l: @List<T>, m: @List<T>) -> @List<T> {
+pure fn append<T: Copy>(l: @List<T>, m: @List<T>) -> @List<T> {
     match *l {
       Nil => return m,
       Cons(x, xs) => {
@@ -115,7 +115,7 @@ fn len<T>(ls: @List<T>) -> uint {
 /*
 /// Push one element into the front of a list, returning a new list
 /// THIS VERSION DOESN'T ACTUALLY WORK
-pure fn push<T: copy>(ll: &mut @list<T>, +vv: T) {
+pure fn push<T: Copy>(ll: &mut @list<T>, +vv: T) {
     ll = &mut @cons(vv, *ll)
 }
 */
index 603cff987210d3ebc5a84d0d5ddc69bbe00d0d45..5436ea1a8033035a8c39cb7c6e6a49052615dedd 100644 (file)
@@ -24,7 +24,7 @@
 
 type hashmap<K:Eq IterBytes Hash, V> = chained::t<K, V>;
 
-trait map<K:Eq IterBytes Hash copy, V: copy> {
+trait map<K:Eq IterBytes Hash Copy, V: Copy> {
     /// Return the number of elements in the map
     pure fn size() -> uint;
 
@@ -123,7 +123,7 @@ enum search_result<K, V> {
         found_after(@entry<K,V>, @entry<K,V>)
     }
 
-    priv impl<K:Eq IterBytes Hash, V: copy> t<K, V> {
+    priv impl<K:Eq IterBytes Hash, V: Copy> t<K, V> {
         pure fn search_rem(k: &K, h: uint, idx: uint,
                            e_root: @entry<K,V>) -> search_result<K,V> {
             let mut e0 = e_root;
@@ -207,7 +207,7 @@ fn rehash() {
         }
     }
 
-    impl<K:Eq IterBytes Hash copy, V: copy> t<K, V>: map<K, V> {
+    impl<K:Eq IterBytes Hash Copy, V: Copy> t<K, V>: map<K, V> {
         pure fn size() -> uint { self.count }
 
         fn contains_key(+k: K) -> bool {
@@ -330,7 +330,7 @@ fn clear() {
         }
     }
 
-    impl<K:Eq IterBytes Hash copy ToStr, V: ToStr copy> t<K, V>: ToStr {
+    impl<K:Eq IterBytes Hash Copy ToStr, V: ToStr Copy> t<K, V>: ToStr {
         fn to_writer(wr: io::Writer) {
             if self.count == 0u {
                 wr.write_str(~"{}");
@@ -356,7 +356,7 @@ fn to_str() -> ~str {
         }
     }
 
-    impl<K:Eq IterBytes Hash copy, V: copy> t<K, V>: ops::Index<K, V> {
+    impl<K:Eq IterBytes Hash Copy, V: Copy> t<K, V>: ops::Index<K, V> {
         pure fn index(&&k: K) -> V {
             unchecked {
                 self.get(k)
@@ -368,7 +368,7 @@ fn chains<K,V>(nchains: uint) -> ~[mut Option<@entry<K,V>>] {
         vec::to_mut(vec::from_elem(nchains, None))
     }
 
-    fn mk<K:Eq IterBytes Hash, V: copy>() -> t<K,V> {
+    fn mk<K:Eq IterBytes Hash, V: Copy>() -> t<K,V> {
         let slf: t<K, V> = @hashmap_ {count: 0u,
                                       chains: chains(initial_capacity)};
         slf
@@ -380,48 +380,48 @@ fn mk<K:Eq IterBytes Hash, V: copy>() -> t<K,V> {
 
 Construct a hashmap.
 */
-fn hashmap<K:Eq IterBytes Hash const, V: copy>()
+fn hashmap<K:Eq IterBytes Hash Const, V: Copy>()
         -> hashmap<K, V> {
     chained::mk()
 }
 
 /// Construct a hashmap for string-slice keys
-fn str_slice_hash<V: copy>() -> hashmap<&str, V> {
+fn str_slice_hash<V: Copy>() -> hashmap<&str, V> {
     return hashmap();
 }
 
 /// Construct a hashmap for string keys
-fn str_hash<V: copy>() -> hashmap<~str, V> {
+fn str_hash<V: Copy>() -> hashmap<~str, V> {
     return hashmap();
 }
 
 /// Construct a hashmap for boxed string keys
-fn box_str_hash<V: copy>() -> hashmap<@~str, V> {
+fn box_str_hash<V: Copy>() -> hashmap<@~str, V> {
     hashmap()
 }
 
 /// Construct a hashmap for byte string keys
-fn bytes_hash<V: copy>() -> hashmap<~[u8], V> {
+fn bytes_hash<V: Copy>() -> hashmap<~[u8], V> {
     return hashmap();
 }
 
 /// Construct a hashmap for int keys
-fn int_hash<V: copy>() -> hashmap<int, V> {
+fn int_hash<V: Copy>() -> hashmap<int, V> {
     return hashmap();
 }
 
 /// Construct a hashmap for uint keys
-fn uint_hash<V: copy>() -> hashmap<uint, V> {
+fn uint_hash<V: Copy>() -> hashmap<uint, V> {
     return hashmap();
 }
 
 /// Convenience function for adding keys to a hashmap with nil type keys
-fn set_add<K:Eq IterBytes Hash const copy>(set: set<K>, +key: K) -> bool {
+fn set_add<K:Eq IterBytes Hash Const Copy>(set: set<K>, +key: K) -> bool {
     set.insert(key, ())
 }
 
 /// Convert a set into a vector.
-fn vec_from_set<T:Eq IterBytes Hash copy>(s: set<T>) -> ~[T] {
+fn vec_from_set<T:Eq IterBytes Hash Copy>(s: set<T>) -> ~[T] {
     let mut v = ~[];
     vec::reserve(v, s.size());
     do s.each_key() |k| {
@@ -432,7 +432,7 @@ fn vec_from_set<T:Eq IterBytes Hash copy>(s: set<T>) -> ~[T] {
 }
 
 /// Construct a hashmap from a vector
-fn hash_from_vec<K: Eq IterBytes Hash const copy, V: copy>(
+fn hash_from_vec<K: Eq IterBytes Hash Const Copy, V: Copy>(
     items: &[(K, V)]) -> hashmap<K, V> {
     let map = hashmap();
     do vec::iter(items) |item| {
@@ -443,27 +443,27 @@ fn hash_from_vec<K: Eq IterBytes Hash const copy, V: copy>(
 }
 
 /// Construct a hashmap from a vector with string keys
-fn hash_from_strs<V: copy>(items: &[(~str, V)]) -> hashmap<~str, V> {
+fn hash_from_strs<V: Copy>(items: &[(~str, V)]) -> hashmap<~str, V> {
     hash_from_vec(items)
 }
 
 /// Construct a hashmap from a vector with byte keys
-fn hash_from_bytes<V: copy>(items: &[(~[u8], V)]) -> hashmap<~[u8], V> {
+fn hash_from_bytes<V: Copy>(items: &[(~[u8], V)]) -> hashmap<~[u8], V> {
     hash_from_vec(items)
 }
 
 /// Construct a hashmap from a vector with int keys
-fn hash_from_ints<V: copy>(items: &[(int, V)]) -> hashmap<int, V> {
+fn hash_from_ints<V: Copy>(items: &[(int, V)]) -> hashmap<int, V> {
     hash_from_vec(items)
 }
 
 /// Construct a hashmap from a vector with uint keys
-fn hash_from_uints<V: copy>(items: &[(uint, V)]) -> hashmap<uint, V> {
+fn hash_from_uints<V: Copy>(items: &[(uint, V)]) -> hashmap<uint, V> {
     hash_from_vec(items)
 }
 
 // XXX Transitional
-impl<K: Eq IterBytes Hash copy, V: copy> Managed<LinearMap<K, V>>:
+impl<K: Eq IterBytes Hash Copy, V: Copy> Managed<LinearMap<K, V>>:
     map<K, V> {
     pure fn size() -> uint {
         unchecked {
index 1735765a474a8a22a7a61f59a74f8b09be910d98..d6e498c0a236253c73abbd9cabc9fc0ceb4c6acc 100644 (file)
@@ -18,7 +18,7 @@
  * This is used to build most of the other parallel vector functions,
  * like map or alli.
  */
-fn map_slices<A: copy send, B: copy send>(
+fn map_slices<A: Copy Send, B: Copy Send>(
     xs: &[A],
     f: fn() -> fn~(uint, v: &[A]) -> B)
     -> ~[B] {
@@ -73,7 +73,7 @@ fn map_slices<A: copy send, B: copy send>(
 }
 
 /// A parallel version of map.
-fn map<A: copy send, B: copy send>(xs: ~[A], f: fn~(A) -> B) -> ~[B] {
+fn map<A: Copy Send, B: Copy Send>(xs: ~[A], f: fn~(A) -> B) -> ~[B] {
     vec::concat(map_slices(xs, || {
         fn~(_base: uint, slice : &[A], copy f) -> ~[B] {
             vec::map(slice, |x| f(x))
@@ -82,7 +82,7 @@ fn map<A: copy send, B: copy send>(xs: ~[A], f: fn~(A) -> B) -> ~[B] {
 }
 
 /// A parallel version of mapi.
-fn mapi<A: copy send, B: copy send>(xs: ~[A],
+fn mapi<A: Copy Send, B: Copy Send>(xs: ~[A],
                                     f: fn~(uint, A) -> B) -> ~[B] {
     let slices = map_slices(xs, || {
         fn~(base: uint, slice : &[A], copy f) -> ~[B] {
@@ -103,7 +103,7 @@ fn mapi<A: copy send, B: copy send>(xs: ~[A],
  * In this case, f is a function that creates functions to run over the
  * inner elements. This is to skirt the need for copy constructors.
  */
-fn mapi_factory<A: copy send, B: copy send>(
+fn mapi_factory<A: Copy Send, B: Copy Send>(
     xs: &[A], f: fn() -> fn~(uint, A) -> B) -> ~[B] {
     let slices = map_slices(xs, || {
         let f = f();
@@ -120,7 +120,7 @@ fn mapi_factory<A: copy send, B: copy send>(
 }
 
 /// Returns true if the function holds for all elements in the vector.
-fn alli<A: copy send>(xs: ~[A], f: fn~(uint, A) -> bool) -> bool {
+fn alli<A: Copy Send>(xs: ~[A], f: fn~(uint, A) -> bool) -> bool {
     do vec::all(map_slices(xs, || {
         fn~(base: uint, slice : &[A], copy f) -> bool {
             vec::alli(slice, |i, x| {
@@ -131,7 +131,7 @@ fn alli<A: copy send>(xs: ~[A], f: fn~(uint, A) -> bool) -> bool {
 }
 
 /// Returns true if the function holds for any elements in the vector.
-fn any<A: copy send>(xs: ~[A], f: fn~(A) -> bool) -> bool {
+fn any<A: Copy Send>(xs: ~[A], f: fn~(A) -> bool) -> bool {
     do vec::any(map_slices(xs, || {
         fn~(_base : uint, slice: &[A], copy f) -> bool {
             vec::any(slice, |x| f(x))
index 411d18b72fc0c59c73d01325f874f66f54f3d36f..743e2fc2bf14a4c2017959960249b0069c756910 100644 (file)
@@ -93,7 +93,7 @@ fn emit_from_vec<S: serializer, T>(s: S, v: ~[T], f: fn(T)) {
     }
 }
 
-fn read_to_vec<D: deserializer, T: copy>(d: D, f: fn() -> T) -> ~[T] {
+fn read_to_vec<D: deserializer, T: Copy>(d: D, f: fn() -> T) -> ~[T] {
     do d.read_vec |len| {
         do vec::from_fn(len) |i| {
             d.read_vec_elt(i, || f())
@@ -112,11 +112,11 @@ fn emit_from_vec<T>(v: ~[T], f: fn(T)) {
 }
 
 trait deserializer_helpers {
-    fn read_to_vec<T: copy>(f: fn() -> T) -> ~[T];
+    fn read_to_vec<T: Copy>(f: fn() -> T) -> ~[T];
 }
 
 impl<D: deserializer> D: deserializer_helpers {
-    fn read_to_vec<T: copy>(f: fn() -> T) -> ~[T] {
+    fn read_to_vec<T: Copy>(f: fn() -> T) -> ~[T] {
         read_to_vec(self, f)
     }
 }
@@ -256,7 +256,7 @@ fn serialize_Option<S: serializer,T>(s: S, v: Option<T>, st: fn(T)) {
     }
 }
 
-fn deserialize_Option<D: deserializer,T: copy>(d: D, st: fn() -> T)
+fn deserialize_Option<D: deserializer,T: Copy>(d: D, st: fn() -> T)
     -> Option<T> {
     do d.read_enum(~"option") {
         do d.read_enum_variant |i| {
index 25cb53f7eaa91696b13e4695fcd0441d5365791d..a65d41a2d3240752cf14cbb971b84c15eb243600 100644 (file)
 
 // FIXME (#2347): Should not be @; there's a bug somewhere in rustc that
 // requires this to be.
-type SmallIntMap_<T: copy> = {v: DVec<Option<T>>};
+type SmallIntMap_<T: Copy> = {v: DVec<Option<T>>};
 
-enum SmallIntMap<T:copy> {
+enum SmallIntMap<T:Copy> {
     SmallIntMap_(@SmallIntMap_<T>)
 }
 
 /// Create a smallintmap
-fn mk<T: copy>() -> SmallIntMap<T> {
+fn mk<T: Copy>() -> SmallIntMap<T> {
     let v = DVec();
     return SmallIntMap_(@{v: v});
 }
@@ -29,7 +29,7 @@ fn mk<T: copy>() -> SmallIntMap<T> {
  * the specified key then the original value is replaced.
  */
 #[inline(always)]
-fn insert<T: copy>(self: SmallIntMap<T>, key: uint, +val: T) {
+fn insert<T: Copy>(self: SmallIntMap<T>, key: uint, +val: T) {
     //io::println(fmt!("%?", key));
     self.v.grow_set_elt(key, None, Some(val));
 }
@@ -38,7 +38,7 @@ fn insert<T: copy>(self: SmallIntMap<T>, key: uint, +val: T) {
  * Get the value for the specified key. If the key does not exist
  * in the map then returns none
  */
-pure fn find<T: copy>(self: SmallIntMap<T>, key: uint) -> Option<T> {
+pure fn find<T: Copy>(self: SmallIntMap<T>, key: uint) -> Option<T> {
     if key < self.v.len() { return self.v.get_elt(key); }
     return None::<T>;
 }
@@ -50,7 +50,7 @@ fn insert<T: copy>(self: SmallIntMap<T>, key: uint, +val: T) {
  *
  * If the key does not exist in the map
  */
-pure fn get<T: copy>(self: SmallIntMap<T>, key: uint) -> T {
+pure fn get<T: Copy>(self: SmallIntMap<T>, key: uint) -> T {
     match find(self, key) {
       None => {
         error!("smallintmap::get(): key not present");
@@ -61,12 +61,12 @@ fn insert<T: copy>(self: SmallIntMap<T>, key: uint, +val: T) {
 }
 
 /// Returns true if the map contains a value for the specified key
-fn contains_key<T: copy>(self: SmallIntMap<T>, key: uint) -> bool {
+fn contains_key<T: Copy>(self: SmallIntMap<T>, key: uint) -> bool {
     return !option::is_none(find(self, key));
 }
 
 /// Implements the map::map interface for smallintmap
-impl<V: copy> SmallIntMap<V>: map::map<uint, V> {
+impl<V: Copy> SmallIntMap<V>: map::map<uint, V> {
     pure fn size() -> uint {
         let mut sz = 0u;
         for self.v.each |item| {
@@ -137,7 +137,7 @@ fn rehash() { fail }
     }
 }
 
-impl<V: copy> SmallIntMap<V>: ops::Index<uint, V> {
+impl<V: Copy> SmallIntMap<V>: ops::Index<uint, V> {
     pure fn index(&&key: uint) -> V {
         unchecked {
             get(self, key)
@@ -146,6 +146,6 @@ impl<V: copy> SmallIntMap<V>: ops::Index<uint, V> {
 }
 
 /// Cast the given smallintmap to a map::map
-fn as_map<V: copy>(s: SmallIntMap<V>) -> map::map<uint, V> {
+fn as_map<V: Copy>(s: SmallIntMap<V>) -> map::map<uint, V> {
     s as map::map::<uint, V>
 }
index 64ea19d35f9e1508e153195b3b5688e77d498c5e..488ae16c751f30cb0b44a758261a32557b4efb13 100644 (file)
  * Has worst case O(n log n) performance, best case O(n), but
  * is not space efficient. This is a stable sort.
  */
-fn merge_sort<T: copy>(le: Le<T>, v: &[const T]) -> ~[T] {
+fn merge_sort<T: Copy>(le: Le<T>, v: &[const T]) -> ~[T] {
     type Slice = (uint, uint);
 
     return merge_sort_(le, v, (0u, len(v)));
 
-    fn merge_sort_<T: copy>(le: Le<T>, v: &[const T], slice: Slice)
+    fn merge_sort_<T: Copy>(le: Le<T>, v: &[const T], slice: Slice)
         -> ~[T] {
         let begin = slice.first();
         let end = slice.second();
@@ -39,7 +39,7 @@ fn merge_sort_<T: copy>(le: Le<T>, v: &[const T], slice: Slice)
         return merge(le, merge_sort_(le, v, a), merge_sort_(le, v, b));
     }
 
-    fn merge<T: copy>(le: Le<T>, a: &[T], b: &[T]) -> ~[T] {
+    fn merge<T: Copy>(le: Le<T>, a: &[T], b: &[T]) -> ~[T] {
         let mut rs = ~[];
         vec::reserve(rs, len(a) + len(b));
         let a_len = len(a);
@@ -58,7 +58,7 @@ fn merge<T: copy>(le: Le<T>, a: &[T], b: &[T]) -> ~[T] {
     }
 }
 
-fn part<T: copy>(compare_func: Le<T>, arr: &[mut T], left: uint,
+fn part<T: Copy>(compare_func: Le<T>, arr: &[mut T], left: uint,
                 right: uint, pivot: uint) -> uint {
     let pivot_value = arr[pivot];
     arr[pivot] <-> arr[right];
@@ -75,7 +75,7 @@ fn part<T: copy>(compare_func: Le<T>, arr: &[mut T], left: uint,
     return storage_index;
 }
 
-fn qsort<T: copy>(compare_func: Le<T>, arr: &[mut T], left: uint,
+fn qsort<T: Copy>(compare_func: Le<T>, arr: &[mut T], left: uint,
              right: uint) {
     if right > left {
         let pivot = (left + right) / 2u;
@@ -94,12 +94,12 @@ fn qsort<T: copy>(compare_func: Le<T>, arr: &[mut T], left: uint,
  * Has worst case O(n^2) performance, average case O(n log n).
  * This is an unstable sort.
  */
-fn quick_sort<T: copy>(compare_func: Le<T>, arr: &[mut T]) {
+fn quick_sort<T: Copy>(compare_func: Le<T>, arr: &[mut T]) {
     if len::<T>(arr) == 0u { return; }
     qsort::<T>(compare_func, arr, 0u, len::<T>(arr) - 1u);
 }
 
-fn qsort3<T: copy Ord Eq>(arr: &[mut T], left: int, right: int) {
+fn qsort3<T: Copy Ord Eq>(arr: &[mut T], left: int, right: int) {
     if right <= left { return; }
     let v: T = arr[right];
     let mut i: int = left - 1;
@@ -156,7 +156,7 @@ fn qsort3<T: copy Ord Eq>(arr: &[mut T], left: int, right: int) {
  *
  * This is an unstable sort.
  */
-fn quick_sort3<T: copy Ord Eq>(arr: &[mut T]) {
+fn quick_sort3<T: Copy Ord Eq>(arr: &[mut T]) {
     if arr.len() <= 1 { return; }
     qsort3(arr, 0, (arr.len() - 1) as int);
 }
@@ -165,7 +165,7 @@ trait Sort {
     fn qsort(self);
 }
 
-impl<T: copy Ord Eq> &[mut T] : Sort {
+impl<T: Copy Ord Eq> &[mut T] : Sort {
     fn qsort(self) { quick_sort3(self); }
 }
 
index 45ab8d4c4274a7ebe13ae06893d3dc875d85af73..986a6e0522577a10feb084c816ab4eb75739003a 100644 (file)
@@ -70,10 +70,10 @@ struct SemInner<Q> {
     blocked:   Q
 }
 #[doc(hidden)]
-enum Sem<Q: send> = Exclusive<SemInner<Q>>;
+enum Sem<Q: Send> = Exclusive<SemInner<Q>>;
 
 #[doc(hidden)]
-fn new_sem<Q: send>(count: int, +q: Q) -> Sem<Q> {
+fn new_sem<Q: Send>(count: int, +q: Q) -> Sem<Q> {
     Sem(exclusive(SemInner {
         mut count: count, waiters: new_waitqueue(), blocked: q }))
 }
@@ -88,7 +88,7 @@ fn new_sem_and_signal(count: int, num_condvars: uint)
 }
 
 #[doc(hidden)]
-impl<Q: send> &Sem<Q> {
+impl<Q: Send> &Sem<Q> {
     fn acquire() {
         let mut waiter_nobe = None;
         unsafe {
index 25bc5e58c4e247b31ceeba641fffea74ce36f821..bda489c3ba7eef283f23f973ff8257533753e7af 100644 (file)
@@ -26,7 +26,7 @@
  * * ch - a channel of type T to send a `val` on
  * * val - a value of type T to send over the provided `ch`
  */
-fn delayed_send<T: copy send>(iotask: IoTask,
+fn delayed_send<T: Copy Send>(iotask: IoTask,
                               msecs: uint, ch: comm::Chan<T>, +val: T) {
         unsafe {
             let timer_done_po = core::comm::Port::<()>();
@@ -102,7 +102,7 @@ fn sleep(iotask: IoTask, msecs: uint) {
  * on the provided port in the allotted timeout period, then the result will
  * be a `some(T)`. If not, then `none` will be returned.
  */
-fn recv_timeout<T: copy send>(iotask: IoTask,
+fn recv_timeout<T: Copy Send>(iotask: IoTask,
                               msecs: uint,
                               wait_po: comm::Port<T>) -> Option<T> {
     let timeout_po = comm::Port::<()>();
index 9d6c8dade61f64ac94ef726abef797b8b6e88ecb..a43821a0d37a09b4321904d356c334dffd8bc4a0 100644 (file)
@@ -32,7 +32,7 @@ enum TreeNode<K, V> = {
 fn TreeMap<K, V>() -> TreeMap<K, V> { @mut None }
 
 /// Insert a value into the map
-fn insert<K: copy Eq Ord, V: copy>(m: &mut TreeEdge<K, V>, +k: K, +v: V) {
+fn insert<K: Copy Eq Ord, V: Copy>(m: &mut TreeEdge<K, V>, +k: K, +v: V) {
     match copy *m {
       None => {
         *m = Some(@TreeNode({key: k,
@@ -54,7 +54,7 @@ fn insert<K: copy Eq Ord, V: copy>(m: &mut TreeEdge<K, V>, +k: K, +v: V) {
 }
 
 /// Find a value based on the key
-fn find<K: copy Eq Ord, V: copy>(m: &const TreeEdge<K, V>, +k: K)
+fn find<K: Copy Eq Ord, V: Copy>(m: &const TreeEdge<K, V>, +k: K)
                               -> Option<V> {
     match copy *m {
       None => None,
@@ -73,7 +73,7 @@ fn find<K: copy Eq Ord, V: copy>(m: &const TreeEdge<K, V>, +k: K)
 }
 
 /// Visit all pairs in the map in order.
-fn traverse<K, V: copy>(m: &const TreeEdge<K, V>, f: fn(K, V)) {
+fn traverse<K, V: Copy>(m: &const TreeEdge<K, V>, f: fn(K, V)) {
     match copy *m {
       None => (),
       Some(node) => {
index 97dcb922c4382b808d1f5ca09f4d528917092fa8..474f0ede1091a01c790d0b69fbc0c3b1455fd55a 100644 (file)
@@ -259,7 +259,7 @@ fn iter_bytes(lsb0: bool, f: core::to_bytes::Cb) {
     }
 }
 
-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>();
 }
 
index 99296f72eb7a03541454dc4f983bdcfa04f6fb73..66553162b252054e84741d0d8415286eedbd0a58 100644 (file)
@@ -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,
index 32db095a1df212fb1f560d7983938d96a1004e60..bb5af8402dfe4cd17b5c2579989cca3ad6943809 100644 (file)
@@ -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| {
index 6fc05e1f5bda98ef4ea0adacd3de17691d55a146..478288ba4cd44f6a2d71fd3a4570c3d587647063 100644 (file)
@@ -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 @@ 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] {
         let mut first = true;
         let mut v = ~[];
@@ -217,7 +217,7 @@ fn parse_seq_to_before_gt<T: copy>(sep: Option<token::token>,
         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 @@ fn parse_seq_to_gt<T: copy>(sep: Option<token::token>,
         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 @@ fn parse_seq_lt_gt<T: copy>(sep: Option<token::token>,
         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 @@ fn parse_seq_to_end<T: copy>(ket: token::token, sep: seq_sep,
     }
 
 
-    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 @@ fn parse_seq_to_before_end<T: copy>(ket: token::token, sep: seq_sep,
         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 @@ fn parse_unspanned_seq<T: copy>(bra: token::token,
 
     // 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);
index 03a4c016b50791108e4610c572310cedc1147a8d..a38cc701dc3d96a7c605b5c7876e78816f688a3e 100644 (file)
@@ -2278,15 +2278,7 @@ fn parse_optional_ty_param_bounds() -> @~[ty_param_bound] {
         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, _) => {
index c2099fa447f69e17221720ab4d5adb3333a33042..cd7f75b15be804cfac440c3d8de1d4d00a770149 100644 (file)
@@ -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",
index 3bf9598305361eaac9efbfd78ac37d663c226baa..942963797cb3dfd1f06297da60ec2d927a8c8796 100644 (file)
@@ -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)
             }
         }
index 59cdb6b98a7c96940e9ab21b4365f37c25ff5ef7..ac2af21d087b0019bc628782d4d1639f45f5df7d 100644 (file)
@@ -8,18 +8,18 @@
 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,
index 22946e556e8a8d2e96cb4043d7ded0b425607322..0665c73137c0d938348104a15c981eddce2b0855 100644 (file)
@@ -271,7 +271,7 @@ fn basic_options() -> @options {
 }
 
 // Seems out of place, but it uses session, so I'm putting it here
-fn expect<T: copy>(sess: session, opt: Option<T>, msg: fn() -> ~str) -> T {
+fn expect<T: Copy>(sess: session, opt: Option<T>, msg: fn() -> ~str) -> T {
     diagnostic::expect(sess.diagnostic(), opt, msg)
 }
 
index 7bdd2f064853e99d5443e45da7ae20d87be05ace..f198a2ca79dc3b5bfa00dc69c83d0cfc1025a542 100644 (file)
@@ -22,7 +22,7 @@ fn use_core(crate: @ast::crate) -> bool {
 fn inject_libcore_ref(sess: session,
                       crate: @ast::crate) -> @ast::crate {
 
-    fn spanned<T: copy>(x: T) -> @ast::spanned<T> {
+    fn spanned<T: Copy>(x: T) -> @ast::spanned<T> {
         return @{node: x,
             span: dummy_sp()};
     }
index e5245febbe88e386f28caa3fdb8c46a2f5593de3..5ac62379e763c0515def528b4ecfbc4ed7e8a88b 100644 (file)
@@ -212,7 +212,7 @@ fn mk_test_module(cx: test_ctxt) -> @ast::item {
     return @item;
 }
 
-fn nospan<T: copy>(t: T) -> ast::spanned<T> {
+fn nospan<T: Copy>(t: T) -> ast::spanned<T> {
     return {node: t, span: dummy_sp()};
 }
 
index 41db162b95430ea6b1cf49fa0d1d50ad0c5910e1..560dc384299aafd1c696087d28050828b496ed20 100644 (file)
@@ -866,7 +866,7 @@ fn encode_info_for_items(ecx: @encode_ctxt, ebml_w: ebml::Writer,
 
 // Path and definition ID indexing
 
-fn create_index<T: copy>(index: ~[entry<T>], hash_fn: fn@(T) -> uint) ->
+fn create_index<T: Copy>(index: ~[entry<T>], hash_fn: fn@(T) -> uint) ->
    ~[@~[entry<T>]] {
     let mut buckets: ~[@mut ~[entry<T>]] = ~[];
     for uint::range(0u, 256u) |_i| { vec::push(buckets, @mut ~[]); };
index 26363806da02be2344ca76c91ff329cd65b7ec49..0384225de1215385f9d20901c3732fa73605f811 100644 (file)
@@ -67,7 +67,7 @@ fn get_target_lib_file_path(file: &Path) -> Path {
      target_triple: str::from_slice(target_triple)} as filesearch
 }
 
-fn search<T: copy>(filesearch: filesearch, pick: pick<T>) -> Option<T> {
+fn search<T: Copy>(filesearch: filesearch, pick: pick<T>) -> Option<T> {
     let mut rslt = None;
     for filesearch.lib_search_paths().each |lib_search_path| {
         debug!("searching %s", lib_search_path.to_str());
index 70f1258124565753ba2344276dc63b4c45080b8e..1286a95aa02a92fdb297c971e1dc8daf32743fd8 100644 (file)
@@ -396,7 +396,7 @@ impl bckerr : cmp::Eq {
     pure_map: hashmap<ast::node_id, bckerr>
 };
 
-fn save_and_restore<T:copy,U>(&save_and_restore_t: T, f: fn() -> U) -> U {
+fn save_and_restore<T:Copy,U>(&save_and_restore_t: T, f: fn() -> U) -> U {
     let old_save_and_restore_t = save_and_restore_t;
     let u <- f();
     save_and_restore_t = old_save_and_restore_t;
index 18bbb432e39b1b984786d1cb3e433e959edbd78c..94786aa8a8928d4416e4f1149154c9aa1c8b1e01 100644 (file)
@@ -308,7 +308,7 @@ fn Atom(n: uint) -> Atom {
 }
 
 /// Creates a hash table of atoms.
-fn atom_hashmap<V:copy>() -> hashmap<Atom,V> {
+fn atom_hashmap<V:Copy>() -> hashmap<Atom,V> {
   hashmap::<Atom,V>()
 }
 
index 2e5b06f0a5531583d07fcb55b1b5bb15d774f2e3..056d3598a32f9bca5ec6c589ed1531cb8024d79e 100644 (file)
@@ -129,7 +129,7 @@ enum debug_metadata {
     retval_metadata(@metadata<retval_md>),
 }
 
-fn cast_safely<T: copy, U>(val: T) -> U unsafe {
+fn cast_safely<T: Copy, U>(val: T) -> U unsafe {
     let val2 = val;
     return unsafe::transmute(val2);
 }
@@ -147,7 +147,7 @@ fn md_from_metadata<T>(val: debug_metadata) -> T unsafe {
     }
 }
 
-fn cached_metadata<T: copy>(cache: metadata_cache, mdtag: int,
+fn cached_metadata<T: Copy>(cache: metadata_cache, mdtag: int,
                            eq: fn(md: T) -> bool) -> Option<T> unsafe {
     if cache.contains_key(mdtag) {
         let items = cache.get(mdtag);
index 6fee6f22fe01a7c4b3953cba0c1ad6e4c6b3b426..d65b0e1978c14d01655b562a4a5df13f68bdde47 100644 (file)
@@ -58,7 +58,7 @@ fn mk_nominal_id(tcx: ty::ctxt, did: ast::def_id,
     @{did: did, parent_id: parent_id, tps: tps_norm}
 }
 
-fn new_nominal_id_hash<T: copy>() -> hashmap<nominal_id, T> {
+fn new_nominal_id_hash<T: Copy>() -> hashmap<nominal_id, T> {
     return hashmap();
 }
 
index b8679a3818a30f2acf7adfca46f55fc6c42cfa2d..e6476b57e70d4f501ad1da5a0a81272bb17e223c 100644 (file)
@@ -799,7 +799,7 @@ fn mk_rcache() -> creader_cache {
     return map::hashmap();
 }
 
-fn new_ty_hash<V: copy>() -> map::hashmap<t, V> {
+fn new_ty_hash<V: Copy>() -> map::hashmap<t, V> {
     map::hashmap()
 }
 
@@ -2568,7 +2568,7 @@ fn iter_bytes(lsb0: bool, f: to_bytes::Cb) {
     }
 }
 
-fn br_hashmap<V:copy>() -> hashmap<bound_region, V> {
+fn br_hashmap<V:Copy>() -> hashmap<bound_region, V> {
     map::hashmap()
 }
 
@@ -3081,7 +3081,7 @@ fn vars_in_type(ty: t) -> ~[TyVid] {
 
 // Maintains a little union-set tree for inferred modes.  `canon()` returns
 // the current head value for `m0`.
-fn canon<T:copy>(tbl: hashmap<ast::node_id, ast::inferable<T>>,
+fn canon<T:Copy>(tbl: hashmap<ast::node_id, ast::inferable<T>>,
                  +m0: ast::inferable<T>) -> ast::inferable<T> {
     match m0 {
       ast::infer(id) => match tbl.find(id) {
index 85bac78da973aeb2505cf6b2295ecbdae28de148..2ac872117e3c4318f083e4d5b11c1e0a7a0c1510 100644 (file)
@@ -69,7 +69,7 @@ fn get_region_reporting_err(tcx: ty::ctxt,
     }
 }
 
-fn ast_region_to_region<AC: ast_conv, RS: region_scope copy owned>(
+fn ast_region_to_region<AC: ast_conv, RS: region_scope Copy Owned>(
     self: AC, rscope: RS, span: span, a_r: @ast::region) -> ty::region {
 
     let res = match a_r.node {
@@ -80,7 +80,7 @@ fn ast_region_to_region<AC: ast_conv, RS: region_scope copy owned>(
     get_region_reporting_err(self.tcx(), span, res)
 }
 
-fn ast_path_to_substs_and_ty<AC: ast_conv, RS: region_scope copy owned>(
+fn ast_path_to_substs_and_ty<AC: ast_conv, RS: region_scope Copy Owned>(
     self: AC, rscope: RS, did: ast::def_id,
     path: @ast::path) -> ty_param_substs_and_ty {
 
@@ -129,7 +129,7 @@ fn ast_path_to_substs_and_ty<AC: ast_conv, RS: region_scope copy owned>(
     {substs: substs, ty: ty::subst(tcx, &substs, decl_ty)}
 }
 
-fn ast_path_to_ty<AC: ast_conv, RS: region_scope copy owned>(
+fn ast_path_to_ty<AC: ast_conv, RS: region_scope Copy Owned>(
     self: AC,
     rscope: RS,
     did: ast::def_id,
@@ -152,10 +152,10 @@ fn ast_path_to_ty<AC: ast_conv, RS: region_scope copy owned>(
 // Parses the programmer's textual representation of a type into our
 // internal notion of a type. `getter` is a function that returns the type
 // corresponding to a definition ID:
-fn ast_ty_to_ty<AC: ast_conv, RS: region_scope copy owned>(
+fn ast_ty_to_ty<AC: ast_conv, RS: region_scope Copy Owned>(
     self: AC, rscope: RS, &&ast_ty: @ast::ty) -> ty::t {
 
-    fn ast_mt_to_mt<AC: ast_conv, RS: region_scope copy owned>(
+    fn ast_mt_to_mt<AC: ast_conv, RS: region_scope Copy Owned>(
         self: AC, rscope: RS, mt: ast::mt) -> ty::mt {
 
         return {ty: ast_ty_to_ty(self, rscope, mt.ty), mutbl: mt.mutbl};
@@ -164,7 +164,7 @@ fn ast_mt_to_mt<AC: ast_conv, RS: region_scope copy owned>(
     // Handle @, ~, and & being able to mean estrs and evecs.
     // If a_seq_ty is a str or a vec, make it an estr/evec.
     // Also handle function sigils and first-class trait types.
-    fn mk_maybe_vstore<AC: ast_conv, RS: region_scope copy owned>(
+    fn mk_maybe_vstore<AC: ast_conv, RS: region_scope Copy Owned>(
         self: AC, rscope: RS, a_seq_ty: ast::mt, vst: ty::vstore,
         span: span, constr: fn(ty::mt) -> ty::t) -> ty::t {
 
@@ -400,7 +400,7 @@ fn check_path_args(tcx: ty::ctxt,
     return typ;
 }
 
-fn ty_of_arg<AC: ast_conv, RS: region_scope copy owned>(
+fn ty_of_arg<AC: ast_conv, RS: region_scope Copy Owned>(
     self: AC, rscope: RS, a: ast::arg,
     expected_ty: Option<ty::arg>) -> ty::arg {
 
@@ -445,7 +445,7 @@ fn ty_of_arg<AC: ast_conv, RS: region_scope copy owned>(
     {mode: mode, ty: ty}
 }
 
-fn ast_proto_to_proto<AC: ast_conv, RS: region_scope copy owned>(
+fn ast_proto_to_proto<AC: ast_conv, RS: region_scope Copy Owned>(
     self: AC, rscope: RS, span: span, ast_proto: ast::proto) -> ty::fn_proto {
     match ast_proto {
         ast::proto_bare =>
@@ -465,7 +465,7 @@ fn ast_proto_to_proto<AC: ast_conv, RS: region_scope copy owned>(
 type expected_tys = Option<{inputs: ~[ty::arg],
                             output: ty::t}>;
 
-fn ty_of_fn_decl<AC: ast_conv, RS: region_scope copy owned>(
+fn ty_of_fn_decl<AC: ast_conv, RS: region_scope Copy Owned>(
     self: AC, rscope: RS,
     ast_proto: ast::proto,
     purity: ast::purity,
index 96d9bf1e2e5cd1710424b1fcede49f891e76062f..f63f6f2e1258984a98bc4d5985979b8c42cc29bb 100644 (file)
@@ -1203,7 +1203,7 @@ fn check_user_unop(fcx: @fn_ctxt, op_str: ~str, mname: ~str,
     // through the `unpack` function.  It there is no expected type or
     // resolution is not possible (e.g., no constraints yet present), just
     // returns `none`.
-    fn unpack_expected<O: copy>(fcx: @fn_ctxt, expected: Option<ty::t>,
+    fn unpack_expected<O: Copy>(fcx: @fn_ctxt, expected: Option<ty::t>,
                                 unpack: fn(ty::sty) -> Option<O>)
         -> Option<O> {
         match expected {
index 3206d1709c5e8dfe058edabfe874380b0ead93ec..0a06e55472460ed0e7fb73ae7eaf118e2aa21b22 100644 (file)
@@ -75,7 +75,7 @@ fn collect_item_types(ccx: @crate_ctxt, crate: @ast::crate) {
 }
 
 impl @crate_ctxt {
-    fn to_ty<RS: region_scope copy owned>(
+    fn to_ty<RS: region_scope Copy Owned>(
         rs: RS, ast_ty: @ast::ty) -> ty::t {
 
         ast_ty_to_ty(self, rs, ast_ty)
index cbda05a4012064dc3e46da883dcf44c36a42963f..2aef5ff6b5bae571a7cb2694f430f1f11535416a 100644 (file)
@@ -298,8 +298,8 @@ fn bar() {
 export root, to_str;
 export int_ty_set_all;
 
-type bound<T:copy> = Option<T>;
-type bounds<T:copy> = {lb: bound<T>, ub: bound<T>};
+type bound<T:Copy> = Option<T>;
+type bounds<T:Copy> = {lb: bound<T>, ub: bound<T>};
 
 type cres<T> = Result<T,ty::type_err>; // "combine result"
 type ures = cres<()>; // "unify result"
@@ -348,7 +348,7 @@ fn fixup_err_to_str(f: fixup_err) -> ~str {
     }
 }
 
-fn new_vals_and_bindings<V:copy, T:copy>() -> vals_and_bindings<V, T> {
+fn new_vals_and_bindings<V:Copy, T:Copy>() -> vals_and_bindings<V, T> {
     vals_and_bindings {
         vals: smallintmap::mk(),
         mut bindings: ~[]
@@ -458,12 +458,12 @@ fn resolve_borrowings(cx: infer_ctxt) {
 */
 
 trait then {
-    fn then<T:copy>(f: fn() -> Result<T,ty::type_err>)
+    fn then<T:Copy>(f: fn() -> Result<T,ty::type_err>)
         -> Result<T,ty::type_err>;
 }
 
 impl ures: then {
-    fn then<T:copy>(f: fn() -> Result<T,ty::type_err>)
+    fn then<T:Copy>(f: fn() -> Result<T,ty::type_err>)
         -> Result<T,ty::type_err> {
         self.chain(|_i| f())
     }
@@ -474,7 +474,7 @@ trait cres_helpers<T> {
     fn compare(t: T, f: fn() -> ty::type_err) -> cres<T>;
 }
 
-impl<T:copy Eq> cres<T>: cres_helpers<T> {
+impl<T:Copy Eq> cres<T>: cres_helpers<T> {
     fn to_ures() -> ures {
         match self {
           Ok(_v) => Ok(()),
@@ -497,7 +497,7 @@ fn uok() -> ures {
     Ok(())
 }
 
-fn rollback_to<V:copy vid, T:copy>(
+fn rollback_to<V:Copy vid, T:Copy>(
     vb: &vals_and_bindings<V, T>, len: uint) {
 
     while vb.bindings.len() != len {
index f66685d766b72fefa08d22e01c7fc85f4b31094c..7acfdcac424de47b23dba14ca9d8ceaf179c8eaa 100644 (file)
@@ -23,7 +23,7 @@ fn to_str(cx: infer_ctxt) -> ~str {
     }
 }
 
-impl<V:copy to_str> bound<V>: to_str {
+impl<V:Copy to_str> bound<V>: to_str {
     fn to_str(cx: infer_ctxt) -> ~str {
         match self {
           Some(v) => v.to_str(cx),
@@ -32,7 +32,7 @@ fn to_str(cx: infer_ctxt) -> ~str {
     }
 }
 
-impl<T:copy to_str> bounds<T>: to_str {
+impl<T:Copy to_str> bounds<T>: to_str {
     fn to_str(cx: infer_ctxt) -> ~str {
         fmt!("{%s <: %s}",
              self.lb.to_str(cx),
@@ -48,7 +48,7 @@ fn to_str(_cx: infer_ctxt) -> ~str {
     }
 }
 
-impl<V:copy vid, T:copy to_str> var_value<V, T>: to_str {
+impl<V:Copy vid, T:Copy to_str> var_value<V, T>: to_str {
     fn to_str(cx: infer_ctxt) -> ~str {
         match self {
           redirect(vid) => fmt!("redirect(%s)", vid.to_str()),
index 36c3093874a1c5d74c3de8979d4532e90f882c6a..2793d0e4f5ad126cd30f89394389af140ff497de 100644 (file)
@@ -3,24 +3,24 @@
 use to_str::to_str;
 use std::smallintmap::SmallIntMap;
 
-enum var_value<V:copy, T:copy> {
+enum var_value<V:Copy, T:Copy> {
     redirect(V),
     root(T, uint),
 }
 
-struct vals_and_bindings<V:copy, T:copy> {
+struct vals_and_bindings<V:Copy, T:Copy> {
     vals: SmallIntMap<var_value<V, T>>,
     mut bindings: ~[(V, var_value<V, T>)],
 }
 
-struct node<V:copy, T:copy> {
+struct node<V:Copy, T:Copy> {
     root: V,
     possible_types: T,
     rank: uint,
 }
 
 impl infer_ctxt {
-    fn get<V:copy vid, T:copy>(
+    fn get<V:Copy vid, T:Copy>(
         vb: &vals_and_bindings<V, T>, vid: V) -> node<V, T> {
 
         let vid_u = vid.to_uint();
@@ -46,7 +46,7 @@ fn get<V:copy vid, T:copy>(
         }
     }
 
-    fn set<V:copy vid, T:copy to_str>(
+    fn set<V:Copy vid, T:Copy to_str>(
         vb: &vals_and_bindings<V, T>, vid: V,
         +new_v: var_value<V, T>) {
 
index 3826d3e527c38ee8bc6128051a31b72d68859dad..0224d6933a7a8dd53b04f26240d20cbb54d35e14 100644 (file)
@@ -46,7 +46,7 @@ fn bound_self_region(rp: Option<ty::region_variance>) -> Option<ty::region> {
 }
 
 enum anon_rscope = {anon: ty::region, base: region_scope};
-fn in_anon_rscope<RS: region_scope copy owned>(self: RS, r: ty::region)
+fn in_anon_rscope<RS: region_scope Copy Owned>(self: RS, r: ty::region)
     -> @anon_rscope {
     @anon_rscope({anon: r, base: self as region_scope})
 }
@@ -63,7 +63,7 @@ struct binding_rscope {
     base: region_scope,
     mut anon_bindings: uint,
 }
-fn in_binding_rscope<RS: region_scope copy owned>(self: RS)
+fn in_binding_rscope<RS: region_scope Copy Owned>(self: RS)
     -> @binding_rscope {
     let base = self as region_scope;
     @binding_rscope { base: base, anon_bindings: 0 }
index a68f998e6fe6753d653709492cfa8cd24b7dfd5b..385f76873b36d3ae660927fb80c53fc637a0587e 100644 (file)
@@ -88,7 +88,7 @@ fn act(po: comm::Port<msg>, source: ~str, parse: parser) {
     }
 }
 
-fn exec<T:send>(
+fn exec<T:Send>(
     srv: srv,
     +f: fn~(ctxt: ctxt) -> T
 ) -> T {
index d93e49aa84175d6059d0217d1b239634970b0d32..6244d52c897a6ef9475fae248fac1ff6dc7b5d2b 100644 (file)
@@ -89,7 +89,7 @@ fn fold_item(
     }
 }
 
-fn parse_item_attrs<T:send>(
+fn parse_item_attrs<T:Send>(
     srv: astsrv::srv,
     id: doc::ast_id,
     +parse_attrs: fn~(~[ast::attribute]) -> T) -> T {
index 5dcbfb664eae731595eb2c0f32c51796f23b9fe8..a3a8fa5d6aebad5418d80ef336e6b066371536d4 100644 (file)
@@ -50,7 +50,7 @@
 
 // This exists because fn types don't infer correctly as record
 // initializers, but they do as function arguments
-fn mk_fold<T:copy>(
+fn mk_fold<T:Copy>(
     ctxt: T,
     +fold_doc: fold_doc<T>,
     +fold_crate: fold_crate<T>,
@@ -80,7 +80,7 @@ fn mk_fold<T:copy>(
     })
 }
 
-fn default_any_fold<T:send copy>(ctxt: T) -> fold<T> {
+fn default_any_fold<T:Send Copy>(ctxt: T) -> fold<T> {
     mk_fold(
         ctxt,
         |f, d| default_seq_fold_doc(f, d),
@@ -97,7 +97,7 @@ fn default_any_fold<T:send copy>(ctxt: T) -> fold<T> {
     )
 }
 
-fn default_seq_fold<T:copy>(ctxt: T) -> fold<T> {
+fn default_seq_fold<T:Copy>(ctxt: T) -> fold<T> {
     mk_fold(
         ctxt,
         |f, d| default_seq_fold_doc(f, d),
@@ -114,7 +114,7 @@ fn default_seq_fold<T:copy>(ctxt: T) -> fold<T> {
     )
 }
 
-fn default_par_fold<T:send copy>(ctxt: T) -> fold<T> {
+fn default_par_fold<T:Send Copy>(ctxt: T) -> fold<T> {
     mk_fold(
         ctxt,
         |f, d| default_seq_fold_doc(f, d),
@@ -163,7 +163,7 @@ fn default_seq_fold_item<T>(
     doc
 }
 
-fn default_any_fold_mod<T:send copy>(
+fn default_any_fold_mod<T:Send Copy>(
     fold: fold<T>,
     doc: doc::moddoc
 ) -> doc::moddoc {
@@ -189,7 +189,7 @@ fn default_seq_fold_mod<T>(
     })
 }
 
-fn default_par_fold_mod<T:send copy>(
+fn default_par_fold_mod<T:Send Copy>(
     fold: fold<T>,
     doc: doc::moddoc
 ) -> doc::moddoc {
@@ -202,7 +202,7 @@ fn default_par_fold_mod<T:send copy>(
     })
 }
 
-fn default_any_fold_nmod<T:send copy>(
+fn default_any_fold_nmod<T:Send Copy>(
     fold: fold<T>,
     doc: doc::nmoddoc
 ) -> doc::nmoddoc {
@@ -228,7 +228,7 @@ fn default_seq_fold_nmod<T>(
     }
 }
 
-fn default_par_fold_nmod<T:send copy>(
+fn default_par_fold_nmod<T:Send Copy>(
     fold: fold<T>,
     doc: doc::nmoddoc
 ) -> doc::nmoddoc {
index 27400322e4011d8a2bc0a989441bf5b6948cd951..68d24ed28cbd6847cdce0805f3f884364d9f5c8a 100644 (file)
@@ -2,7 +2,7 @@
 
 use comm::*;
 
-fn foo<T: send copy>(x: T) -> Port<T> {
+fn foo<T: Send Copy>(x: T) -> Port<T> {
     let p = Port();
     let c = Chan(p);
     do task::spawn() |copy c, copy x| {
index 8a714740550a9798473dd1f248ed9e28906d0e85..6ead738753e504ff8ca67a445aba53df5dda96ef 100644 (file)
@@ -3,11 +3,11 @@
 type entry<A,B> = {key: A, value: B};
 type alist<A,B> = { eq_fn: fn@(A,A) -> bool, data: DVec<entry<A,B>> };
 
-fn alist_add<A: copy, B: copy>(lst: alist<A,B>, k: A, v: B) {
+fn alist_add<A: Copy, B: Copy>(lst: alist<A,B>, k: A, v: B) {
     lst.data.push({key:k, value:v});
 }
 
-fn alist_get<A: copy, B: copy>(lst: alist<A,B>, k: A) -> B {
+fn alist_get<A: Copy, B: Copy>(lst: alist<A,B>, k: A) -> B {
     let eq_fn = lst.eq_fn;
     for lst.data.each |entry| {
         if eq_fn(entry.key, k) { return entry.value; }
@@ -16,13 +16,13 @@ fn alist_get<A: copy, B: copy>(lst: alist<A,B>, k: A) -> B {
 }
 
 #[inline]
-fn new_int_alist<B: copy>() -> alist<int, B> {
+fn new_int_alist<B: Copy>() -> alist<int, B> {
     fn eq_int(&&a: int, &&b: int) -> bool { a == b }
     return {eq_fn: eq_int, data: DVec()};
 }
 
 #[inline]
-fn new_int_alist_2<B: copy>() -> alist<int, B> {
+fn new_int_alist_2<B: Copy>() -> alist<int, B> {
     #[inline]
     fn eq_int(&&a: int, &&b: int) -> bool { a == b }
     return {eq_fn: eq_int, data: DVec()};
index 14fe2b8fee9798d46480ac592ed1699e9ebb3e9a..ef977507dd21d840271690b26e366b27530e7a2a 100644 (file)
@@ -7,18 +7,18 @@
 
 export context;
 
-struct arc_destruct<T:const> {
+struct arc_destruct<T:Const> {
   _data: int,
   drop {}
 }
 
-fn arc_destruct<T: const>(data: int) -> arc_destruct<T> {
+fn arc_destruct<T: Const>(data: int) -> arc_destruct<T> {
     arc_destruct {
         _data: data
     }
 }
 
-fn arc<T: const>(_data: T) -> arc_destruct<T> {
+fn arc<T: Const>(_data: T) -> arc_destruct<T> {
     arc_destruct(0)
 }
 
index 35a354206360f2ab86a60e5c914f3e42a307b111..4c3a6ea61210ffdb3aea6858c0bff165bc11486f 100644 (file)
@@ -10,6 +10,6 @@
 type header_map = hashmap<~str, @DVec<@~str>>;
 
 // the unused ty param is necessary so this gets monomorphized
-fn request<T: copy>(req: header_map) {
+fn request<T: Copy>(req: header_map) {
   let _x = *(*req.get(~"METHOD"))[0u];
 }
index 954e1f66f5140f68d692647852f10b2004b665bd..cd011227c840580cd1484f5deb7b302b58e57905 100644 (file)
@@ -25,7 +25,7 @@ impl bool: read {
     }
 }
 
-fn read<T: read copy>(s: ~str) -> T {
+fn read<T: read Copy>(s: ~str) -> T {
     match readMaybe(s) {
       Some(x) => x,
       _ => fail ~"read failed!"
index 20c5579e42774e25d52a21b7f2adadb63c47567c..fed01e6a30e36db50364d08701a7f2fd5e8aa088 100644 (file)
  * transmitted. If a port value is copied, both copies refer to the same
  * port.  Ports may be associated with multiple `chan`s.
  */
-enum port<T: send> {
+enum port<T: Send> {
     port_t(@port_ptr<T>)
 }
 
 /// Constructs a port
-fn port<T: send>() -> port<T> {
+fn port<T: Send>() -> port<T> {
     port_t(@port_ptr(rustrt::new_port(sys::size_of::<T>() as size_t)))
 }
 
-struct port_ptr<T:send> {
+struct port_ptr<T:Send> {
    po: *rust_port,
    drop unsafe {
     debug!("in the port_ptr destructor");
@@ -48,7 +48,7 @@ struct port_ptr<T:send> {
   }
 }
 
-fn port_ptr<T: send>(po: *rust_port) -> port_ptr<T> {
+fn port_ptr<T: Send>(po: *rust_port) -> port_ptr<T> {
     debug!("in the port_ptr constructor");
     port_ptr {
         po: po
@@ -59,11 +59,11 @@ fn port_ptr<T: send>(po: *rust_port) -> port_ptr<T> {
  * Receive from a port.  If no data is available on the port then the
  * task will block until data becomes available.
  */
-fn recv<T: send>(p: port<T>) -> T { recv_((**p).po) }
+fn recv<T: Send>(p: port<T>) -> T { recv_((**p).po) }
 
 
 /// Receive on a raw port pointer
-fn recv_<T: send>(p: *rust_port) -> T {
+fn recv_<T: Send>(p: *rust_port) -> T {
     let yield = 0u;
     let yieldp = ptr::addr_of(yield);
     let mut res;
index 53132293de98a61e86ef872ff228291272182834..5e0f9072f6cb64f6a0ae108a8666ec51209a17b0 100644 (file)
@@ -64,7 +64,7 @@ macro_rules! follow (
     )
 )
 
-fn switch<T: send, Tb: send, U>(+endp: pipes::RecvPacketBuffered<T, Tb>,
+fn switch<T: Send, Tb: Send, U>(+endp: pipes::RecvPacketBuffered<T, Tb>,
                       f: fn(+Option<T>) -> U) -> U {
     f(pipes::try_recv(endp))
 }
index 6d46d2b597eba077c1a0a3bb6cce0808c9f3b8dd..5437de9643ab9651ae469c565c4dff9849cebb57 100644 (file)
@@ -15,14 +15,14 @@ fn pct(xx: uint, yy: uint) -> float {
       return (xx as float) * 100f / (yy as float);
    }
 
-   pure fn le_by_val<TT: copy, UU: copy>(kv0: &(TT,UU),
+   pure fn le_by_val<TT: Copy, UU: Copy>(kv0: &(TT,UU),
                                          kv1: &(TT,UU)) -> bool {
       let (_, v0) = *kv0;
       let (_, v1) = *kv1;
       return v0 >= v1;
    }
 
-   pure fn le_by_key<TT: copy, UU: copy>(kv0: &(TT,UU),
+   pure fn le_by_key<TT: Copy, UU: Copy>(kv0: &(TT,UU),
                                          kv1: &(TT,UU)) -> bool {
       let (k0, _) = *kv0;
       let (k1, _) = *kv1;
@@ -30,7 +30,7 @@ fn pct(xx: uint, yy: uint) -> float {
    }
 
    // sort by key, then by value
-   fn sortKV<TT: copy, UU: copy>(orig: ~[(TT,UU)]) -> ~[(TT,UU)] {
+   fn sortKV<TT: Copy, UU: Copy>(orig: ~[(TT,UU)]) -> ~[(TT,UU)] {
       return sort::merge_sort(le_by_val, sort::merge_sort(le_by_key, orig));
    }
 
index 578e9c433f3288ca98eb1fde62d8aacd3f54d21b..5f907e55a1fc49843e5ac530b89aa7024dc19a0f 100644 (file)
@@ -14,14 +14,14 @@ fn pct(xx: uint, yy: uint) -> float {
       return (xx as float) * 100f / (yy as float);
    }
 
-   pure fn le_by_val<TT: copy, UU: copy>(kv0: &(TT,UU),
+   pure fn le_by_val<TT: Copy, UU: Copy>(kv0: &(TT,UU),
                                          kv1: &(TT,UU)) -> bool {
       let (_, v0) = *kv0;
       let (_, v1) = *kv1;
       return v0 >= v1;
    }
 
-   pure fn le_by_key<TT: copy, UU: copy>(kv0: &(TT,UU),
+   pure fn le_by_key<TT: Copy, UU: Copy>(kv0: &(TT,UU),
                                          kv1: &(TT,UU)) -> bool {
       let (k0, _) = *kv0;
       let (k1, _) = *kv1;
@@ -29,7 +29,7 @@ fn pct(xx: uint, yy: uint) -> float {
    }
 
    // sort by key, then by value
-   fn sortKV<TT: copy, UU: copy>(orig: ~[(TT,UU)]) -> ~[(TT,UU)] {
+   fn sortKV<TT: Copy, UU: Copy>(orig: ~[(TT,UU)]) -> ~[(TT,UU)] {
       return sort::merge_sort(le_by_val, sort::merge_sort(le_by_key, orig));
    }
 
index 646488c61c8b7003d56f9bfd633bffc741f00ac8..0469e7e40bf06678d228e953c1e5796149dfd3f8 100644 (file)
@@ -39,9 +39,9 @@ trait hash_key {
     pure fn eq(&&k: self) -> bool;
 }
 
-fn mk_hash<K: const hash_key, V: copy>() -> map::hashmap<K, V> {
-    pure fn hashfn<K: const hash_key>(k: &K) -> uint { k.hash() }
-    pure fn hasheq<K: const hash_key>(k1: &K, k2: &K) -> bool { k1.eq(*k2) }
+fn mk_hash<K: Const hash_key, V: Copy>() -> map::hashmap<K, V> {
+    pure fn hashfn<K: Const hash_key>(k: &K) -> uint { k.hash() }
+    pure fn hasheq<K: Const hash_key>(k1: &K, k2: &K) -> bool { k1.eq(*k2) }
 
     map::hashmap(hashfn, hasheq)
 }
@@ -125,35 +125,35 @@ mod map_reduce {
     export reducer;
     export map_reduce;
 
-    type putter<K: send, V: send> = fn(K, V);
+    type putter<K: Send, V: Send> = fn(K, V);
 
-    type mapper<K1: send, K2: send, V: send> = fn~(K1, putter<K2, V>);
+    type mapper<K1: Send, K2: Send, V: Send> = fn~(K1, putter<K2, V>);
 
-    type getter<V: send> = fn() -> Option<V>;
+    type getter<V: Send> = fn() -> Option<V>;
 
-    type reducer<K: copy send, V: copy send> = fn~(K, getter<V>);
+    type reducer<K: Copy Send, V: Copy Send> = fn~(K, getter<V>);
 
-    enum ctrl_proto<K: copy send, V: copy send> {
+    enum ctrl_proto<K: Copy Send, V: Copy Send> {
         find_reducer(K, Chan<Chan<reduce_proto<V>>>),
         mapper_done
     }
 
 
     proto! ctrl_proto (
-        open: send<K: copy send, V: copy send> {
+        open: send<K: Copy Send, V: Copy Send> {
             find_reducer(K) -> reducer_response<K, V>,
             mapper_done -> !
         }
 
-        reducer_response: recv<K: copy send, V: copy send> {
+        reducer_response: recv<K: Copy Send, V: Copy Send> {
             reducer(Chan<reduce_proto<V>>) -> open<K, V>
         }
     )
 
-    enum reduce_proto<V: copy send> { emit_val(V), done, addref, release }
+    enum reduce_proto<V: Copy Send> { emit_val(V), done, addref, release }
 
-    fn start_mappers<K1: copy send, K2: const copy send hash_key,
-                     V: copy send>(
+    fn start_mappers<K1: Copy Send, K2: Const Copy Send hash_key,
+                     V: Copy Send>(
         map: mapper<K1, K2, V>,
         &ctrls: ~[ctrl_proto::server::open<K2, V>],
         inputs: ~[K1])
@@ -169,7 +169,7 @@ fn start_mappers<K1: copy send, K2: const copy send hash_key,
         return tasks;
     }
 
-    fn map_task<K1: copy send, K2: const copy send hash_key, V: copy send>(
+    fn map_task<K1: Copy Send, K2: Const Copy Send hash_key, V: Copy Send>(
         map: mapper<K1, K2, V>,
         ctrl: box<ctrl_proto::client::open<K2, V>>,
         input: K1)
@@ -198,7 +198,7 @@ fn map_task<K1: copy send, K2: const copy send hash_key, V: copy send>(
             send(c.get(), emit_val(val));
         }
 
-        fn finish<K: copy send, V: copy send>(_k: K, v: Chan<reduce_proto<V>>)
+        fn finish<K: Copy Send, V: Copy Send>(_k: K, v: Chan<reduce_proto<V>>)
         {
             send(v, release);
         }
@@ -206,7 +206,7 @@ fn finish<K: copy send, V: copy send>(_k: K, v: Chan<reduce_proto<V>>)
         ctrl_proto::client::mapper_done(ctrl.unwrap());
     }
 
-    fn reduce_task<K: copy send, V: copy send>(
+    fn reduce_task<K: Copy Send, V: Copy Send>(
         reduce: reducer<K, V>, 
         key: K,
         out: Chan<Chan<reduce_proto<V>>>)
@@ -218,7 +218,7 @@ fn reduce_task<K: copy send, V: copy send>(
         let mut ref_count = 0;
         let mut is_done = false;
 
-        fn get<V: copy send>(p: Port<reduce_proto<V>>,
+        fn get<V: Copy Send>(p: Port<reduce_proto<V>>,
                              &ref_count: int, &is_done: bool)
            -> Option<V> {
             while !is_done || ref_count > 0 {
@@ -241,7 +241,7 @@ fn get<V: copy send>(p: Port<reduce_proto<V>>,
         reduce(key, || get(p, ref_count, is_done) );
     }
 
-    fn map_reduce<K1: copy send, K2: const copy send hash_key, V: copy send>(
+    fn map_reduce<K1: Copy Send, K2: Const Copy Send hash_key, V: Copy Send>(
         map: mapper<K1, K2, V>,
         reduce: reducer<K2, V>,
         inputs: ~[K1])
index 1da4ec8a62667731972ac1eaaf11cd307f019bc4..8983d42a90bb9c568fe897fb516955e40b953f75 100644 (file)
@@ -3,11 +3,11 @@ fn foo<T>() {
 }
 
 trait bar {
-    fn bar<T:copy>();
+    fn bar<T:Copy>();
 }
 
 impl uint: bar {
-    fn bar<T:copy>() {
+    fn bar<T:Copy>() {
     }
 }
 
index 6d9bdabae86c92774cfc344d87c8afab7a21a293..487860c01b1f5f7cbf1bed2da41ea12d4351f202 100644 (file)
@@ -1,4 +1,4 @@
-fn reproduce<T:copy>(t: T) -> fn@() -> T {
+fn reproduce<T:Copy>(t: T) -> fn@() -> T {
     fn@() -> T { t }
 }
 
index f9fe3d31fccb59696e866028b0a1472ea87fca44..576a9ba7675001604deb2035b528bca79ab34ad5 100644 (file)
@@ -1,4 +1,4 @@
-fn mk_identity<T:copy>() -> fn@(T) -> T {
+fn mk_identity<T:Copy>() -> fn@(T) -> T {
     fn@(t: T) -> T { t }
 }
 
index 090bb5e4f48cfcbea7d1e18473cb2a4f7dad1cc2..682b856afd0b12379ff1d5a4fb66a33382d7be40 100644 (file)
@@ -11,7 +11,7 @@ fn to_option() -> Option<uint> {
     }
 }
 
-impl<T:copy> Option<T>: to_opt {
+impl<T:Copy> Option<T>: to_opt {
     fn to_option() -> Option<Option<T>> {
         Some(self)
     }
index db8d8f9fb7bd1344e21328fbbf544c918a6763ee..36cf99b321c73defde669ecbe3d64a6b2f32c937 100644 (file)
@@ -1,4 +1,4 @@
-fn foo<T: copy>(+_t: T) { fail; }
+fn foo<T: Copy>(+_t: T) { fail; }
 
 fn bar<T>(+_t: T) { fail; }
 
index 9a042fd1d0be8cb5faf21ba09cefc8005180741c..5545c0b2a133d9e277ee0374cf94eae592dcd21e 100644 (file)
@@ -7,7 +7,7 @@
 import iter::BaseIter;
 
 trait A {
-  fn b<C:copy const, D>(x: C) -> C;
+  fn b<C:Copy Const, D>(x: C) -> C;
 }
 
 struct E {
@@ -15,7 +15,7 @@ struct E {
 }
 
 impl E: A {
-  fn b<F:copy, G>(_x: F) -> F { fail } //~ ERROR in method `b`, type parameter 0 has 1 bound, but
+  fn b<F:Copy, G>(_x: F) -> F { fail } //~ ERROR in method `b`, type parameter 0 has 1 bound, but
 }
 
 fn main() {}
\ No newline at end of file
index 977cce73808cc67a7bd0c77a7e12579f65871952..22674c0659503153a13dc5ad071633b00accaaa0 100644 (file)
@@ -4,7 +4,7 @@
 import iter::BaseIter;
 
 trait A {
-  fn b<C:copy, D>(x: C) -> C;
+  fn b<C:Copy, D>(x: C) -> C;
 }
 
 struct E {
@@ -12,7 +12,7 @@ struct E {
 }
 
 impl E: A {
-  fn b<F:copy const, G>(_x: F) -> F { fail } //~ ERROR in method `b`, type parameter 0 has 2 bounds, but
+  fn b<F:Copy Const, G>(_x: F) -> F { fail } //~ ERROR in method `b`, type parameter 0 has 2 bounds, but
 }
 
 fn main() {}
\ No newline at end of file
index 99afe776f866f01f41a72c4872611ec195c08921..b01342282b22bb1a751253a05f8cff01d43e1e39 100644 (file)
@@ -4,7 +4,7 @@
 import iter::BaseIter;
 
 trait A {
-  fn b<C:copy, D>(x: C) -> C;
+  fn b<C:Copy, D>(x: C) -> C;
 }
 
 struct E {
@@ -13,7 +13,7 @@ struct E {
 
 impl E: A {
   // n.b. The error message is awful -- see #3404
-  fn b<F:copy, G>(_x: G) -> G { fail } //~ ERROR method `b` has an incompatible type
+  fn b<F:Copy, G>(_x: G) -> G { fail } //~ ERROR method `b` has an incompatible type
 }
 
 fn main() {}
\ No newline at end of file
index 0feaa9b857e46faa0475615a8f63bd7a7eca7afe..b857af4e2f36070b5feaf5e7e7c208c1033dd2e5 100644 (file)
@@ -1,4 +1,4 @@
-struct send_packet<T: copy> {
+struct send_packet<T: Copy> {
   p: T
 }
 
index f2c6ded88d5120139db02dc9c58178fd2779015e..78225ba15ecb5b22bbc3ba121dd9b2ba93462256 100644 (file)
@@ -1,7 +1,7 @@
 mod stream {
-    enum stream<T: send> { send(T, server::stream<T>), }
+    enum stream<T: Send> { send(T, server::stream<T>), }
     mod server {
-        impl<T: send> stream<T> {
+        impl<T: Send> stream<T> {
             fn recv() -> extern fn(+stream<T>) -> stream::stream<T> {
               // resolve really should report just one error here.
               // Change the test case when it changes.
@@ -14,7 +14,7 @@ fn recv(+pipe: stream<T>) -> stream::stream<T> { //~ ERROR attempt to use a type
                 recv
             }
         }
-        type stream<T: send> = pipes::RecvPacket<stream::stream<T>>;
+        type stream<T: Send> = pipes::RecvPacket<stream::stream<T>>;
     }
 }
 
index 5d12ab9d517220d6a356b56c317c82724c315917..c916bcba7c85cff79edbdee9b26c0c79a8adb6d9 100644 (file)
@@ -1,10 +1,10 @@
 trait repeat<A> { fn get() -> A; }
 
-impl<A:copy> @A: repeat<A> {
+impl<A:Copy> @A: repeat<A> {
     fn get() -> A { *self }
 }
 
-fn repeater<A:copy>(v: @A) -> repeat<A> {
+fn repeater<A:Copy>(v: @A) -> repeat<A> {
     // Note: owned kind is not necessary as A appears in the trait type
     v as repeat::<A> // No
 }
index 80a0e3bc0d50f17a2db89ec77e71d24cb1a5d4ee..5b39d3e46511e44749379b9af3dce436097e30af 100644 (file)
@@ -5,11 +5,11 @@ trait foo {
     fn foo(i: &self/int) -> int;
 }
 
-impl<T:copy> T: foo {
+impl<T:Copy> T: foo {
     fn foo(i: &self/int) -> int {*i}
 }
 
-fn to_foo<T:copy>(t: T) {
+fn to_foo<T:Copy>(t: T) {
     // This version is ok because, although T may contain borrowed
     // pointers, it never escapes the fn body.  We know this because
     // the type of foo includes a region which will be resolved to
@@ -19,13 +19,13 @@ fn to_foo<T:copy>(t: T) {
     assert x.foo(v) == 3;
 }
 
-fn to_foo_2<T:copy>(t: T) -> foo {
+fn to_foo_2<T:Copy>(t: T) -> foo {
     // Not OK---T may contain borrowed ptrs and it is going to escape
     // as part of the returned foo value
     {f:t} as foo //~ ERROR value may contain borrowed pointers; use `owned` bound
 }
 
-fn to_foo_3<T:copy owned>(t: T) -> foo {
+fn to_foo_3<T:Copy Owned>(t: T) -> foo {
     // OK---T may escape as part of the returned foo value, but it is
     // owned and hence does not contain borrowed ptrs
     {f:t} as foo
index 35009847c73b4386b1b12c899700f9553e55be14..ea57fe5a6cf934a10b54b148d785ef9ce2bfda0e 100644 (file)
@@ -1,10 +1,10 @@
 trait foo { fn foo(); }
 
-fn to_foo<T: copy foo>(t: T) -> foo {
+fn to_foo<T: Copy foo>(t: T) -> foo {
     t as foo //~ ERROR value may contain borrowed pointers; use `owned` bound
 }
 
-fn to_foo2<T: copy foo owned>(t: T) -> foo {
+fn to_foo2<T: Copy foo Owned>(t: T) -> foo {
     t as foo
 }
 
index e689292c45ed4558a411f6d5c08f3f23e0b3d0f5..3e6a2f2946db83b26494bccd367e78e35d001e28 100644 (file)
@@ -1,8 +1,8 @@
-fn copy1<T: copy>(t: T) -> fn@() -> T {
+fn copy1<T: Copy>(t: T) -> fn@() -> T {
     fn@() -> T { t } //~ ERROR value may contain borrowed pointers
 }
 
-fn copy2<T: copy owned>(t: T) -> fn@() -> T {
+fn copy2<T: Copy Owned>(t: T) -> fn@() -> T {
     fn@() -> T { t }
 }
 
index 6dfa9a997ff4488ff8642f26b794bca669e39afe..5447c88e56768bbf4f4db11f849fb0f2b4a613ce 100644 (file)
@@ -1,4 +1,4 @@
-fn send<T: send>(ch: _chan<T>, -data: T) {
+fn send<T: Send>(ch: _chan<T>, -data: T) {
     log(debug, ch);
     log(debug, data);
     fail;
index 37ba5830b10c452ff4b51b4cc7932865c174473f..d2cf08fc8471b6939a8d9c8f2475fd0da1715e4a 100644 (file)
@@ -1,6 +1,6 @@
 // Test that various non const things are rejected.
 
-fn foo<T: const>(_x: T) { }
+fn foo<T: Const>(_x: T) { }
 
 struct r {
   x:int,
index 39eb825b80bb9b0c2df40bd339656c8d524b92c3..bd65fa41fd56705066906984a34d1cb27f22c9d2 100644 (file)
@@ -5,7 +5,7 @@
 
 use core;
 
-fn last<T: copy>(v: ~[const T]) -> core::Option<T> {
+fn last<T: Copy>(v: ~[const T]) -> core::Option<T> {
     fail;
 }
 
index 88039f234b51473009fa638ce264b4388291ccf4..b1525229658c3a19fade4de7509e6fdddd1333c6 100644 (file)
@@ -7,7 +7,7 @@ enum box_impl<T> = {
     mut f: T
 };
 
-impl<T:copy> box_impl<T>: box_trait<T> {
+impl<T:Copy> box_impl<T>: box_trait<T> {
     fn get() -> T { return self.f; }
     fn set(t: T) { self.f = t; }
 }
index afa8134e0830569694979b1b5ddc011dde2f197a..eea832c91a474957773bd6fe79f39d11c3ac367a 100644 (file)
@@ -1,4 +1,4 @@
-fn f<T: send>(_i: T) {
+fn f<T: Send>(_i: T) {
 }
 
 fn main() {
index afbb57f58782e7046ad501d77591ebbd648bea00..c21e337af60e8efff2a25deb60723540c85a31cc 100644 (file)
@@ -1,4 +1,4 @@
-fn concat<T: copy>(v: ~[const ~[const T]]) -> ~[T] {
+fn concat<T: Copy>(v: ~[const ~[const T]]) -> ~[T] {
     let mut r = ~[];
 
     // Earlier versions of our type checker accepted this:
index e376085772b42bbf379a7b7d69273bb9d9e5db8c..a657514376569ed8ae8b37ddd4bb711c0cde6de1 100644 (file)
@@ -4,8 +4,8 @@
 type task_id = int;
 type port_id = int;
 
-enum chan_t<T: send> = {task: task_id, port: port_id};
+enum chan_t<T: Send> = {task: task_id, port: port_id};
 
-fn send<T: send>(ch: chan_t<T>, data: T) { fail; }
+fn send<T: Send>(ch: chan_t<T>, data: T) { fail; }
 
 fn main() { fail ~"quux"; }
index ed8bd9173b53a7c9660520c4c9b497abca577997..20620ac62e8e8a31fc19c5e05cf011efa0a21525 100644 (file)
@@ -3,7 +3,7 @@
 use std;
 use std::arc;
 
-enum e<T: const send> { e(arc::ARC<T>) }
+enum e<T: Const Send> { e(arc::ARC<T>) }
 
 fn foo() -> e<int> {fail;}
 
index 40d3067d4df7907098d4242142703307ef8141fa..44ce6e524cafedf2d3c982c982e11e28f3702ec3 100644 (file)
@@ -5,7 +5,7 @@
 use comm::send;
 use comm::recv;
 
-fn echo<T: send>(c: Chan<T>, oc: Chan<Chan<T>>) {
+fn echo<T: Send>(c: Chan<T>, oc: Chan<Chan<T>>) {
     // Tests that the type argument in port gets
     // visited
     let p = Port::<T>();
index 410bc9b570b6161145fd3d687719e7941a096ca5..23cc80233fe220c93c524f67457a1826c31a788d 100644 (file)
@@ -2,7 +2,7 @@
     a: A, b: B
 };
 
-fn f<A:copy owned>(a: A, b: u16) -> fn@() -> (A, u16) {
+fn f<A:Copy Owned>(a: A, b: u16) -> fn@() -> (A, u16) {
     fn@() -> (A, u16) { (a, b) }
 }
 
index dda856efb37d7a1d05fa7621b45b31092f2ee8d3..098c82b18d492580314d595cf5920d50d85ef828 100644 (file)
@@ -8,12 +8,12 @@
     mut rec: Option<@rec<A>>
 };
 
-fn make_cycle<A:copy>(a: A) {
+fn make_cycle<A:Copy>(a: A) {
     let g: @rec<A> = @rec({val: a, mut rec: None});
     g.rec = Some(g);
 }
 
-fn f<A:send copy, B:send copy>(a: A, b: B) -> fn@() -> (A, B) {
+fn f<A:Send Copy, B:Send Copy>(a: A, b: B) -> fn@() -> (A, B) {
     fn@() -> (A, B) { (a, b) }
 }
 
index 522ead87c738b1a6725ec01bb45b9d39051e99e0..941a20f85e07a02eeb34d5e9f330fa03d3279a44 100644 (file)
@@ -2,7 +2,7 @@
 
 
 // -*- rust -*-
-fn f<T: copy, U: copy>(x: T, y: U) -> {a: T, b: U} { return {a: x, b: y}; }
+fn f<T: Copy, U: Copy>(x: T, y: U) -> {a: T, b: U} { return {a: x, b: y}; }
 
 fn main() {
     log(debug, f({x: 3, y: 4, z: 5}, 4).a.x);
index ad3b1366fca3f20218c360170e6008bc1d0842a1..70e513a879d6598f454dc6f817e7c0fb901706fe 100644 (file)
@@ -1,4 +1,4 @@
-fn f<T: copy>(x: ~[T]) -> T { return x[0]; }
+fn f<T: Copy>(x: ~[T]) -> T { return x[0]; }
 
 fn g(act: fn(~[int]) -> int) -> int { return act(~[1, 2, 3]); }
 
index b21050f4d43e99c7ec5e563fe072d9125be766ef..09f05d86d078d72e4d411d9aba8eead575aa074c 100644 (file)
@@ -1,7 +1,7 @@
 fn ignore<T>(_x: T) {}
 
 fn main() {
-    let f: fn@:send() = ||();
+    let f: fn@:Send() = ||();
     ignore(f);
 }
 
index e189066c09f2afb979fa3091a4b2528673b38c56..27cb9846b3d9e5dfd923759498480e34e6878cb3 100644 (file)
@@ -1,8 +1,8 @@
 
 
-type box<T: copy> = {c: @T};
+type box<T: Copy> = {c: @T};
 
-fn unbox<T: copy>(b: box<T>) -> T { return *b.c; }
+fn unbox<T: Copy>(b: box<T>) -> T { return *b.c; }
 
 fn main() {
     let foo: int = 17;
index 316d98cd84a6c58dbfb9745693e6e6fe8a739e3e..665ee3cfe25a82d8bfa83927e904cd6dd803f24e 100644 (file)
@@ -14,7 +14,7 @@ impl cat_type : cmp::Eq {
 // for any int value that's less than the meows field
 
 // ok: T should be in scope when resolving the trait ref for map
-struct cat<T: copy> : map<int, T> {
+struct cat<T: Copy> : map<int, T> {
   priv {
     // Yes, you can have negative meows
     mut meows : int,
@@ -94,7 +94,7 @@ fn remove(+k:int) -> bool {
   fn clear() { }
 }
 
-fn cat<T: copy>(in_x : int, in_y : int, in_name: T) -> cat<T> {
+fn cat<T: Copy>(in_x : int, in_y : int, in_name: T) -> cat<T> {
     cat {
         meows: in_x,
         how_hungry: in_y,
index 91b3f68d5b22ca82c5142eb5fa55774de06e5b3a..2ffd41229a5373f9dc7ace9e65bc6a6e139ad491 100644 (file)
@@ -3,7 +3,7 @@
 use std;
 use std::map::{map, hashmap, int_hash};
 
-class keys<K: copy, V: copy, M: copy map<K,V>>
+class keys<K: Copy, V: Copy, M: Copy map<K,V>>
     : iter::base_iter<K> {
 
     let map: M;
index ed0388b2bcec670b5189ceb95336a3426540592f..83f92e7a72ddf70e96e42434adfeac665b160e5f 100644 (file)
@@ -6,7 +6,7 @@
     a: A, b: B
 };
 
-fn f<A:copy owned>(a: A, b: u16) -> fn@() -> (A, u16) {
+fn f<A:Copy Owned>(a: A, b: u16) -> fn@() -> (A, u16) {
     fn@() -> (A, u16) { (a, b) }
 }
 
index e5e60f184f26316aaf848eb986ba501cfadc697d..9d0d33524ef29dad590c1aedf15b5a680a522caa 100644 (file)
@@ -2,7 +2,7 @@
 // are const.
 
 
-fn foo<T: copy const>(x: T) -> T { x }
+fn foo<T: Copy Const>(x: T) -> T { x }
 
 fn main() {
     foo(1);
index ad3436c2b8f4f1866dae41c9bc9046257bb37a6c..ef0b2c2078d83b09623afa9b59350ac51cdd7a13 100644 (file)
@@ -4,7 +4,7 @@
 // -*- rust -*-
 type compare<T> = fn@(T, T) -> bool;
 
-fn test_generic<T: copy>(expected: T, eq: compare<T>) {
+fn test_generic<T: Copy>(expected: T, eq: compare<T>) {
     let actual: T = match true { true => { expected }, _ => fail ~"wat" };
     assert (eq(expected, actual));
 }
index a227931180f297deab82ad7bca83fa7774dd0a75..264f03ee2c3eb3bd72681a2c809c127e8e786e36 100644 (file)
@@ -3,7 +3,7 @@
 // -*- rust -*-
 type compare<T> = fn@(~T, ~T) -> bool;
 
-fn test_generic<T: copy>(expected: ~T, eq: compare<T>) {
+fn test_generic<T: Copy>(expected: ~T, eq: compare<T>) {
     let actual: ~T = match true { true => { expected }, _ => fail ~"wat" };
     assert (eq(expected, actual));
 }
index d92cde5d82a54251ed5f2c6d36fe49ff1f23eca7..e5c8d2acd874d240b6b7f05a7515b9d5cf5f68c2 100644 (file)
@@ -4,7 +4,7 @@
 // -*- rust -*-
 type compare<T> = fn@(T, T) -> bool;
 
-fn test_generic<T: copy>(expected: T, eq: compare<T>) {
+fn test_generic<T: Copy>(expected: T, eq: compare<T>) {
     let actual: T = match true { true => expected, _ => fail ~"wat" };
     assert (eq(expected, actual));
 }
index 0d1f5e2bbe8795fff285e9cb40d92a5d4daa002e..d17d7db90384d03b803e93dcf7fd913d4fe039fc 100644 (file)
@@ -4,7 +4,7 @@
 // -*- rust -*-
 type compare<T> = fn@(T, T) -> bool;
 
-fn test_generic<T: copy>(expected: T, eq: compare<T>) {
+fn test_generic<T: Copy>(expected: T, eq: compare<T>) {
   let actual: T = match true { true => { expected }, _ => fail ~"wat" };
     assert (eq(expected, actual));
 }
index 7935cec7f5d55292294ed1c492ce9ac6e932758f..8fc566d5843fa67d3cb31edb4658406e04676b69 100644 (file)
@@ -4,7 +4,7 @@
 // -*- rust -*-
 type compare<T> = fn@(T, T) -> bool;
 
-fn test_generic<T: copy>(expected: T, eq: compare<T>) {
+fn test_generic<T: Copy>(expected: T, eq: compare<T>) {
     let actual: T = { expected };
     assert (eq(expected, actual));
 }
index df94544acd1fd974f6f727b4b301694cc023e60f..0ccabb2c0814aca36a9a31cb4c9ebe2c983e7724 100644 (file)
@@ -3,7 +3,7 @@
 // -*- rust -*-
 type compare<T> = fn@(~T, ~T) -> bool;
 
-fn test_generic<T: copy>(expected: ~T, eq: compare<T>) {
+fn test_generic<T: Copy>(expected: ~T, eq: compare<T>) {
     let actual: ~T = { expected };
     assert (eq(expected, actual));
 }
index 51bb0274e7fe68bab0f841d9f15d6e3d409dcd07..cda0148cfe8f157576c1ef1659ce9770d855a8a3 100644 (file)
@@ -4,7 +4,7 @@
 // -*- rust -*-
 type compare<T> = fn@(T, T) -> bool;
 
-fn test_generic<T: copy>(expected: T, eq: compare<T>) {
+fn test_generic<T: Copy>(expected: T, eq: compare<T>) {
     let actual: T = { expected };
     assert (eq(expected, actual));
 }
index 71e6f962e3549872983fcf8049b20b20b816d488..adb49f3142d5b0eb8d2e6c48418931f411312032 100644 (file)
@@ -6,7 +6,7 @@
 // Tests for standalone blocks as expressions with dynamic type sizes
 type compare<T> = fn@(T, T) -> bool;
 
-fn test_generic<T: copy>(expected: T, eq: compare<T>) {
+fn test_generic<T: Copy>(expected: T, eq: compare<T>) {
     let actual: T = { expected };
     assert (eq(expected, actual));
 }
index f181b3f3261b77cc0cbda4ab2d42cb9ab5404737..c2d27cf696c8809b562013f658190e443fff1ea5 100644 (file)
@@ -9,7 +9,7 @@ fn f() -> ~[int] { ~[10, 11] }
 }
 
 fn test_generic() {
-    fn f<T: copy>(t: T) -> T { t }
+    fn f<T: Copy>(t: T) -> T { t }
     assert (f(10) == 10);
 }
 
index ef56bcd41dc3a0c024f86044bb3c846849456744..e5370db83d1d3f66b3f220f96cd751b1aaaabfcd 100644 (file)
@@ -4,7 +4,7 @@
 // -*- rust -*-
 type compare<T> = fn@(T, T) -> bool;
 
-fn test_generic<T: copy>(expected: T, not_expected: T, eq: compare<T>) {
+fn test_generic<T: Copy>(expected: T, not_expected: T, eq: compare<T>) {
     let actual: T = if true { expected } else { not_expected };
     assert (eq(expected, actual));
 }
index 1ad0b006592cd6c9206ccd93931bb8a97c801453..5d7730809d5f4e09ff85d8ad896eb0f041c7309f 100644 (file)
@@ -6,7 +6,7 @@
 // Tests for if as expressions with dynamic type sizes
 type compare<T> = fn@(T, T) -> bool;
 
-fn test_generic<T: copy>(expected: T, not_expected: T, eq: compare<T>) {
+fn test_generic<T: Copy>(expected: T, not_expected: T, eq: compare<T>) {
     let actual: T = if true { expected } else { not_expected };
     assert (eq(expected, actual));
 }
index 95ebd437b889d0c84706e52ed7cdb50c8bca7694..2c7ef7fb12556991403eec23db9d9c7b000c84e7 100644 (file)
@@ -1,8 +1,8 @@
-fn fix_help<A: owned, B: send>(f: extern fn(fn@(A) -> B, A) -> B, x: A) -> B {
+fn fix_help<A: Owned, B: Send>(f: extern fn(fn@(A) -> B, A) -> B, x: A) -> B {
     return f({|a|fix_help(f, a)}, x);
 }
 
-fn fix<A: owned, B: send>(f: extern fn(fn@(A) -> B, A) -> B) -> fn@(A) -> B {
+fn fix<A: Owned, B: Send>(f: extern fn(fn@(A) -> B, A) -> B) -> fn@(A) -> B {
     return {|a|fix_help(f, a)};
 }
 
index 4ad9b5090cc71d904181a7ef1b66d67c11fe7033..cc57ba6a9afd2bb2ff57655e6908a9514ade9e8b 100644 (file)
@@ -1,6 +1,6 @@
 // This is what the signature to spawn should look like with bare functions
 
-fn spawn<T: send>(val: T, f: extern fn(T)) {
+fn spawn<T: Send>(val: T, f: extern fn(T)) {
     f(val);
 }
 
index c273672f7813946e5ff7dab00aafc710bea16b48..f140ad1b9941762cbc462e4c161cf7a46aa8730d 100644 (file)
@@ -1,6 +1,6 @@
 
 
-fn id<T: copy>(t: T) -> T { return t; }
+fn id<T: Copy>(t: T) -> T { return t; }
 
 fn main() {
     let expected = @100;
index 7928558976674216e7c8f182e3d8b59324162c49..9d3ac09de7c0cd1b017e90861713b4dc83a9e9d6 100644 (file)
@@ -1,6 +1,6 @@
 
 
-fn id<T: copy send>(t: T) -> T { return t; }
+fn id<T: Copy Send>(t: T) -> T { return t; }
 
 fn main() {
     let expected = ~100;
index 3d871c896a8ec628c013ea40e155f13ca30d8af1..fed97b99f8eab3025fc57e52ed9c5c97cde5e93e 100644 (file)
@@ -1,6 +1,6 @@
 
 
-fn box<T: copy>(x: {x: T, y: T, z: T}) -> @{x: T, y: T, z: T} { return @x; }
+fn box<T: Copy>(x: {x: T, y: T, z: T}) -> @{x: T, y: T, z: T} { return @x; }
 
 fn main() {
     let x: @{x: int, y: int, z: int} = box::<int>({x: 1, y: 2, z: 3});
index cb406e859802d30dee912996d1755d38056c3aec..f190e72b648119041f7969f992933186c9f53de3 100644 (file)
@@ -1,8 +1,8 @@
 
 
-fn g<X: copy>(x: X) -> X { return x; }
+fn g<X: Copy>(x: X) -> X { return x; }
 
-fn f<T: copy>(t: T) -> {a: T, b: T} {
+fn f<T: Copy>(t: T) -> {a: T, b: T} {
     type pair = {a: T, b: T};
 
     let x: pair = {a: t, b: t};
index 15583f9904b86f8a0e3698284875b51f1c2deed6..c6d16a4127cc1fa476ba2d8d575a0fd21e0f0543 100644 (file)
@@ -1,5 +1,5 @@
 
 
-fn f<T: copy>(t: T) { let t1: T = t; }
+fn f<T: Copy>(t: T) { let t1: T = t; }
 
 fn main() { let x = {x: @10, y: @12}; f(x); }
index c683da09bdf8939e7ee8e79a012d319438c8000c..ff2221aeefbb2dbc6a83a5ac9375b16f46b45890 100644 (file)
@@ -1,8 +1,8 @@
 
 
-type recbox<T: copy> = {x: @T};
+type recbox<T: Copy> = {x: @T};
 
-fn reclift<T: copy>(t: T) -> recbox<T> { return {x: @t}; }
+fn reclift<T: Copy>(t: T) -> recbox<T> { return {x: @t}; }
 
 fn main() {
     let foo: int = 17;
index 227bb7066c4b5d3ec304298a794bb30ad4eb3615..61860d36b5e93972faf4cab3c27b08605ff41dfc 100644 (file)
@@ -1,6 +1,6 @@
-type recbox<T: copy> = {x: ~T};
+type recbox<T: Copy> = {x: ~T};
 
-fn reclift<T: copy>(t: T) -> recbox<T> { return {x: ~t}; }
+fn reclift<T: Copy>(t: T) -> recbox<T> { return {x: ~t}; }
 
 fn main() {
     let foo: int = 17;
index b375752d1a1d299c64a4c9937b01bdfc87edb7c5..c7696259ec2e94e0f8a78f495f5f378c0ec0ff07 100644 (file)
@@ -4,6 +4,6 @@
 // -*- rust -*-
 
 // Issue #45: infer type parameters in function applications
-fn id<T: copy>(x: T) -> T { return x; }
+fn id<T: Copy>(x: T) -> T { return x; }
 
 fn main() { let x: int = 42; let y: int = id(x); assert (x == y); }
index 7d54afd59eb062fd99e61031379b888c70ffe95a..81fbd307d2a87fcb2a90da9e4b544f47c1ef4858 100644 (file)
@@ -1,4 +1,4 @@
 
-fn f<T: copy>(x: ~T) -> ~T { return x; }
+fn f<T: Copy>(x: ~T) -> ~T { return x; }
 
 fn main() { let x = f(~3); log(debug, *x); }
index fae711ae3ad48cd6e73d30059bb13f4b7d90e3bf..c7a38940caf70c791b780ed6108c804783385b08 100644 (file)
@@ -2,7 +2,7 @@
 
 
 // -*- rust -*-
-fn id<T: copy>(x: T) -> T { return x; }
+fn id<T: Copy>(x: T) -> T { return x; }
 
 type triple = {x: int, y: int, z: int};
 
index b660592720cb94b5fdcf932a219fc9061ac0d966..1d37565be315efa99df13d383c3a731e5390462a 100644 (file)
@@ -1,4 +1,4 @@
-fn get_third<T: copy>(t: (T, T, T)) -> T { let (_, _, x) = t; return x; }
+fn get_third<T: Copy>(t: (T, T, T)) -> T { let (_, _, x) = t; return x; }
 
 fn main() {
     log(debug, get_third((1, 2, 3)));
index 0572257a87707182311bfd27aac0274c21579e19..21daeac2ef7c30248e1217e9fa5485481abe120a 100644 (file)
@@ -1,5 +1,5 @@
 
-fn box<T: copy>(x: {x: T, y: T, z: T}) -> ~{x: T, y: T, z: T} { return ~x; }
+fn box<T: Copy>(x: {x: T, y: T, z: T}) -> ~{x: T, y: T, z: T} { return ~x; }
 
 fn main() {
     let x: ~{x: int, y: int, z: int} = box::<int>({x: 1, y: 2, z: 3});
index a01b55f50c623e8320408129b5307b284c420ed5..f4d045bb44417a124a74f21c3cc41744f51948a5 100644 (file)
@@ -1,19 +1,19 @@
-trait clam<A: copy> {
+trait clam<A: Copy> {
   fn chowder(y: A);
 }
-struct foo<A: copy> : clam<A> {
+struct foo<A: Copy> : clam<A> {
   x: A,
   fn chowder(y: A) {
   }
 }
 
-fn foo<A: copy>(b: A) -> foo<A> {
+fn foo<A: Copy>(b: A) -> foo<A> {
     foo {
         x: b
     }
 }
 
-fn f<A: copy>(x: clam<A>, a: A) {
+fn f<A: Copy>(x: clam<A>, a: A) {
   x.chowder(a);
 }
 
index 20c9b9ad947c6863adb75f57c4c7134d61aca803..ef3752d5fa741772a7d38ea8101d91149fc71398 100644 (file)
@@ -1,12 +1,12 @@
-trait clam<A: copy> { }
-struct foo<A: copy> {
+trait clam<A: Copy> { }
+struct foo<A: Copy> {
     x: A,
    fn bar<B,C:clam<A>>(c: C) -> B {
      fail;
    }
 }
 
-fn foo<A: copy>(b: A) -> foo<A> {
+fn foo<A: Copy>(b: A) -> foo<A> {
     foo {
         x: b
     }
index 2318691aebe1c0930b7e9571f9affe150bb63d79..0b6502860204b2b571fdde4348c782648ebe097d 100644 (file)
@@ -1,16 +1,16 @@
-struct c1<T: copy> {
+struct c1<T: Copy> {
     x: T,
     fn f1(x: int) {
     }
 }
 
-fn c1<T: copy>(x: T) -> c1<T> {
+fn c1<T: Copy>(x: T) -> c1<T> {
     c1 {
         x: x
     }
 }
 
-impl<T: copy> c1<T> {
+impl<T: Copy> c1<T> {
     fn f2(x: int) {
     }
 }
index edb0fdf16ae264fb65b0df9aa728523c1adf6455..ae6cdf34e4d329ff367cd3ab08fb4e197697536a 100644 (file)
@@ -1,17 +1,17 @@
 use dvec::DVec;
 
-struct c1<T: copy> {
+struct c1<T: Copy> {
     x: T,
     fn f1(x: T) {}
 }
 
-fn c1<T: copy>(x: T) -> c1<T> {
+fn c1<T: Copy>(x: T) -> c1<T> {
     c1 {
         x: x
     }
 }
 
-impl<T: copy> c1<T> {
+impl<T: Copy> c1<T> {
     fn f2(x: T) {}
 }
 
index 989818ef5948deed97fb46ce38ef60522cac7dd9..496fe3a4798ee300ae7b6240095ff3d3dd52dd39 100644 (file)
@@ -8,7 +8,7 @@ fn C(x: uint) -> C {
     }
 }
 
-fn f<T:copy>(_x: T) {
+fn f<T:Copy>(_x: T) {
 }
 
 #[deny(non_implicitly_copyable_typarams)]
index 94456ecb25bb1eeae952e6ef81650a2472982d87..0d5c244abcbdbbb1ae055c792dea06179846eab9 100644 (file)
@@ -1,11 +1,11 @@
 use iter::BaseIter;
 
 trait FlatMapToVec<A> {
-  fn flat_map_to_vec<B:copy, IB:BaseIter<B>>(op: fn(A) -> IB) -> ~[B];
+  fn flat_map_to_vec<B:Copy, IB:BaseIter<B>>(op: fn(A) -> IB) -> ~[B];
 }
 
-impl<A:copy> BaseIter<A>: FlatMapToVec<A> {
-   fn flat_map_to_vec<B:copy, IB:BaseIter<B>>(op: fn(A) -> IB) -> ~[B] {
+impl<A:Copy> BaseIter<A>: FlatMapToVec<A> {
+   fn flat_map_to_vec<B:Copy, IB:BaseIter<B>>(op: fn(A) -> IB) -> ~[B] {
      iter::flat_map_to_vec(self, op)
    }
 }
index 856e8c2c1740c66947ac4dbacb6d35952c380172..d878d3fcf4b63533197dd936ead360f92531dc9c 100644 (file)
@@ -15,13 +15,13 @@ impl state : cmp::Eq {
         pure fn ne(&&other: state) -> bool { !self.eq(other) }
     }
 
-    type packet<T: send> = {
+    type packet<T: Send> = {
         mut state: state,
         mut blocked_task: Option<task::Task>,
         mut payload: Option<T>
     };
 
-    fn packet<T: send>() -> *packet<T> unsafe {
+    fn packet<T: Send>() -> *packet<T> unsafe {
         let p: *packet<T> = unsafe::transmute(~{
             mut state: empty,
             mut blocked_task: None::<task::Task>,
@@ -55,7 +55,7 @@ fn swap_state_rel(+dst: &mut state, src: state) -> state {
         }
     }
 
-    fn send<T: send>(-p: send_packet<T>, -payload: T) {
+    fn send<T: Send>(-p: send_packet<T>, -payload: T) {
         let p = p.unwrap();
         let p = unsafe { uniquify(p) };
         assert (*p).payload.is_none();
@@ -81,7 +81,7 @@ fn send<T: send>(-p: send_packet<T>, -payload: T) {
         }
     }
 
-    fn recv<T: send>(-p: recv_packet<T>) -> Option<T> {
+    fn recv<T: Send>(-p: recv_packet<T>) -> Option<T> {
         let p = p.unwrap();
         let p = unsafe { uniquify(p) };
         loop {
@@ -102,7 +102,7 @@ fn recv<T: send>(-p: recv_packet<T>) -> Option<T> {
         }
     }
 
-    fn sender_terminate<T: send>(p: *packet<T>) {
+    fn sender_terminate<T: Send>(p: *packet<T>) {
         let p = unsafe { uniquify(p) };
         match swap_state_rel(&mut (*p).state, terminated) {
           empty | blocked => {
@@ -119,7 +119,7 @@ fn sender_terminate<T: send>(p: *packet<T>) {
         }
     }
 
-    fn receiver_terminate<T: send>(p: *packet<T>) {
+    fn receiver_terminate<T: Send>(p: *packet<T>) {
         let p = unsafe { uniquify(p) };
         match swap_state_rel(&mut (*p).state, terminated) {
           empty => {
@@ -136,7 +136,7 @@ fn receiver_terminate<T: send>(p: *packet<T>) {
         }
     }
 
-    struct send_packet<T: send> {
+    struct send_packet<T: Send> {
         mut p: Option<*packet<T>>,
         drop {
             if self.p != None {
@@ -152,13 +152,13 @@ fn unwrap() -> *packet<T> {
         }
     }
 
-    fn send_packet<T: send>(p: *packet<T>) -> send_packet<T> {
+    fn send_packet<T: Send>(p: *packet<T>) -> send_packet<T> {
         send_packet {
             p: Some(p)
         }
     }
 
-    struct recv_packet<T: send> {
+    struct recv_packet<T: Send> {
         mut p: Option<*packet<T>>,
         drop {
             if self.p != None {
@@ -174,13 +174,13 @@ fn unwrap() -> *packet<T> {
         }
     }
 
-    fn recv_packet<T: send>(p: *packet<T>) -> recv_packet<T> {
+    fn recv_packet<T: Send>(p: *packet<T>) -> recv_packet<T> {
         recv_packet {
             p: Some(p)
         }
     }
 
-    fn entangle<T: send>() -> (send_packet<T>, recv_packet<T>) {
+    fn entangle<T: Send>() -> (send_packet<T>, recv_packet<T>) {
         let p = packet();
         (send_packet(p), recv_packet(p))
     }
index a440d4f05d41e83e54ea1cd61090ead6b85e0f27..30a806d165d087df23d95682db7a11a27f7fc312 100644 (file)
@@ -1,7 +1,7 @@
 trait hax { } 
 impl <A> A: hax { } 
 
-fn perform_hax<T: owned>(x: @T) -> hax {
+fn perform_hax<T: Owned>(x: @T) -> hax {
     x as hax 
 }
 
index 81fbae5710547564bc3c829afee30e83f7ed5d74..0c9795cc5c37246f59d43023de2e4cd65516995e 100644 (file)
@@ -1,7 +1,7 @@
 trait hax { } 
 impl <A> A: hax { } 
 
-fn perform_hax<T: owned>(x: @T) -> hax {
+fn perform_hax<T: Owned>(x: @T) -> hax {
     x as hax 
 }
 
index b4ae83bb702b732119d7f78aeb55729cb2896c8b..741235554acad1d5e6f850eb54398664fb342b09 100644 (file)
@@ -45,7 +45,7 @@ fn square_from_char(c: char) -> square {
     }
 }
 
-fn read_board_grid<rdr: owned io::Reader>(+in: rdr) -> ~[~[square]] {
+fn read_board_grid<rdr: Owned io::Reader>(+in: rdr) -> ~[~[square]] {
     let in = in as io::Reader;
     let mut grid = ~[];
     for in.each_line |line| {
index 0d24f72cb238cf52256ca422832370803ea98be7..98cfaded04a985cd1c52cf1252ead72fc4a9ffc8 100644 (file)
@@ -1,5 +1,5 @@
 proto! stream (
-    stream:send<T:send> {
+    stream:send<T:Send> {
         send(T) -> stream<T>
     }
 )
index fe0f646e07d99933d5c337714709cb594de1608d..47d72c53e3bdb06cf619056fc36cf97d091f8838 100644 (file)
@@ -1,4 +1,4 @@
-pure fn Matrix4<T:copy Num>(m11: T, m12: T, m13: T, m14: T,
+pure fn Matrix4<T:Copy Num>(m11: T, m12: T, m13: T, m14: T,
                                      m21: T, m22: T, m23: T, m24: T,
                                      m31: T, m32: T, m33: T, m34: T,
                                      m41: T, m42: T, m43: T, m44: T)
@@ -12,7 +12,7 @@
     }
 }
 
-struct Matrix4<T:copy Num> {
+struct Matrix4<T:Copy Num> {
     m11: T, m12: T, m13: T, m14: T,
     m21: T, m22: T, m23: T, m24: T,
     m31: T, m32: T, m33: T, m34: T,
index 3452beaf7f459b9e77b0bee15b999b2f5137d518..94829fdb7a85cd2f2ce7c150747276e24985c760 100644 (file)
@@ -1,5 +1,5 @@
-fn quux<T: copy>(x: T) -> T { let f = id::<T>; return f(x); }
+fn quux<T: Copy>(x: T) -> T { let f = id::<T>; return f(x); }
 
-fn id<T: copy>(x: T) -> T { return x; }
+fn id<T: Copy>(x: T) -> T { return x; }
 
 fn main() { assert (quux(10) == 10); }
index 652336145f69c547933dfd8c9d861e6204be2a11..9464b6923a943b4d838fa8164a171ce71d5087bd 100644 (file)
@@ -1,4 +1,4 @@
-fn double<T: copy>(a: T) -> ~[T] { return ~[a] + ~[a]; }
+fn double<T: Copy>(a: T) -> ~[T] { return ~[a] + ~[a]; }
 
 fn double_int(a: int) -> ~[int] { return ~[a] + ~[a]; }
 
index 7de63c20e0ce4cd57c08d4eae7d59d8a2fbcea2b..afbc2561d15f682474203dc0aa89a38bae8530d0 100644 (file)
@@ -1,10 +1,10 @@
 trait repeat<A> { fn get() -> A; }
 
-impl<A:copy> @A: repeat<A> {
+impl<A:Copy> @A: repeat<A> {
     fn get() -> A { *self }
 }
 
-fn repeater<A:copy>(v: @A) -> repeat<A> {
+fn repeater<A:Copy>(v: @A) -> repeat<A> {
     // Note: owned kind is not necessary as A appears in the trait type
     v as repeat::<A> // No
 }
index d3f8c668edbf423bb4228fab2346f9851cb00829..36eea6e89d51be98a014615f8161acf01a1ab703 100644 (file)
@@ -1,9 +1,9 @@
 trait vec_monad<A> {
-    fn bind<B: copy>(f: fn(A) -> ~[B]) -> ~[B];
+    fn bind<B: Copy>(f: fn(A) -> ~[B]) -> ~[B];
 }
 
 impl<A> ~[A]: vec_monad<A> {
-    fn bind<B: copy>(f: fn(A) -> ~[B]) -> ~[B] {
+    fn bind<B: Copy>(f: fn(A) -> ~[B]) -> ~[B] {
         let mut r = ~[];
         for self.each |elt| { r += f(elt); }
         r
index fa6b0b86012307c82f3b268bbde60d3882f2b255..18f6557fdac0afc62c554d406874d208ba350193 100644 (file)
@@ -1,8 +1,8 @@
 enum myvec<X> = ~[X];
 
-fn myvec_deref<X: copy>(mv: myvec<X>) -> ~[X] { return *mv; }
+fn myvec_deref<X: Copy>(mv: myvec<X>) -> ~[X] { return *mv; }
 
-fn myvec_elt<X: copy>(mv: myvec<X>) -> X { return mv[0]; }
+fn myvec_elt<X: Copy>(mv: myvec<X>) -> X { return mv[0]; }
 
 fn main() {
     let mv = myvec(~[1, 2, 3]);
index 600afd97a69ac031dd74474765ed2752aa5238db..9b8bbfd9438d3a8c9e2f445f793e9422ee0d2840 100644 (file)
@@ -2,15 +2,15 @@
 
 use std::list::*;
 
-pure fn pure_length_go<T: copy>(ls: @List<T>, acc: uint) -> uint {
+pure fn pure_length_go<T: Copy>(ls: @List<T>, acc: uint) -> uint {
     match *ls { Nil => { acc } Cons(_, tl) => { pure_length_go(tl, acc + 1u) } }
 }
 
-pure fn pure_length<T: copy>(ls: @List<T>) -> uint { pure_length_go(ls, 0u) }
+pure fn pure_length<T: Copy>(ls: @List<T>) -> uint { pure_length_go(ls, 0u) }
 
-pure fn nonempty_list<T: copy>(ls: @List<T>) -> bool { pure_length(ls) > 0u }
+pure fn nonempty_list<T: Copy>(ls: @List<T>) -> bool { pure_length(ls) > 0u }
 
-fn safe_head<T: copy>(ls: @List<T>) -> T {
+fn safe_head<T: Copy>(ls: @List<T>) -> T {
     assert is_not_empty(ls);
     return head(ls);
 }
index fc76487b4360cc3c7f3c6ec662dcabdcb81ba8f9..f484e635e495cc285467fcc654d48e08a1f1c64b 100644 (file)
@@ -36,7 +36,7 @@ macro_rules! move_it (
     { $x:expr } => { unsafe { let y <- *ptr::addr_of($x); y } }
 )
 
-fn switch<T: send, U>(+endp: pipes::RecvPacket<T>,
+fn switch<T: Send, U>(+endp: pipes::RecvPacket<T>,
                       f: fn(+Option<T>) -> U) -> U {
     f(pipes::try_recv(endp))
 }
index 7f36dbe546cf465dce40c62279d523d303c148e9..783febf942c1b5df8682744817d6f885ac0a53d0 100644 (file)
@@ -14,7 +14,7 @@
 )
 
 proto! stream (
-    stream:send<T:send> {
+    stream:send<T:Send> {
         send(T) -> stream<T>
     }
 )
index 1d01de738b563b355465de4513f56e8553ecc7f9..392d68d8763ad1df723370fe806253a82cbef40a 100644 (file)
@@ -1,9 +1,9 @@
-struct finish<T: copy> {
+struct finish<T: Copy> {
   arg: {val: T, fin: extern fn(T)},
   drop { self.arg.fin(self.arg.val); }
 }
 
-fn finish<T: copy>(arg: {val: T, fin: extern fn(T)}) -> finish<T> {
+fn finish<T: Copy>(arg: {val: T, fin: extern fn(T)}) -> finish<T> {
     finish {
         arg: arg
     }
index 1533bb9ef097a5f16217bd87730b97314db79ce2..069618aaa054c82d4b2d7844c87c78e53961ec9d 100644 (file)
@@ -2,6 +2,6 @@
 
 enum option<T> { none, some(T), }
 
-fn f<T: copy>() -> option<T> { return none; }
+fn f<T: Copy>() -> option<T> { return none; }
 
 fn main() { f::<int>(); }
index 67a1b618413b14ff0ff00bba48bbe14a44df3ab5..c642670afbccbab9c3b526c5bbfd3f2d41dc3174 100644 (file)
@@ -4,9 +4,9 @@
 use comm::Port;
 
 // tests that ctrl's type gets inferred properly
-type command<K: send, V: send> = {key: K, val: V};
+type command<K: Send, V: Send> = {key: K, val: V};
 
-fn cache_server<K: send, V: send>(c: Chan<Chan<command<K, V>>>) {
+fn cache_server<K: Send, V: Send>(c: Chan<Chan<command<K, V>>>) {
     let ctrl = Port();
     send(c, Chan(ctrl));
 }
index d5ee2f1aaecbdc8ef6b166e66a173cae73141c1e..d089eb873bdf7417b9d3c1b114623c380905bbec 100644 (file)
@@ -5,7 +5,7 @@
 
 fn main() { test05(); }
 
-fn mk_counter<A:copy>() -> fn~(A) -> (A,uint) {
+fn mk_counter<A:Copy>() -> fn~(A) -> (A,uint) {
     // The only reason that the counter is generic is so that it closes
     // over both a type descriptor and some data.
     let v = ~[mut 0u];
index eece50e757085e722192c4c82adbb7053d7138ff..2fcc6adfce38810302a76bc373feb72149e76678 100644 (file)
@@ -7,7 +7,7 @@
 
 type pair<A,B> = { a: A, b: B };
 
-fn make_generic_record<A: copy, B: copy>(a: A, b: B) -> pair<A,B> {
+fn make_generic_record<A: Copy, B: Copy>(a: A, b: B) -> pair<A,B> {
     return {a: a, b: b};
 }
 
@@ -23,7 +23,7 @@ fn test05_start(&&f: fn~(&&float, &&~str) -> pair<float, ~str>) {
     assert q.b == ~"Ho";
 }
 
-fn spawn<A: copy, B: copy>(f: extern fn(fn~(A,B)->pair<A,B>)) {
+fn spawn<A: Copy, B: Copy>(f: extern fn(fn~(A,B)->pair<A,B>)) {
     let arg = fn~(a: A, b: B) -> pair<A,B> {
         return make_generic_record(a, b);
     };
index f338dcef5771248402eafe7d5383ef3a923589c7..e29f3fdd5e4f2908a523d0c02751d24657294228 100644 (file)
@@ -28,13 +28,13 @@ fn multi(f: fn(uint)) {
 trait vec_utils<T> {
     fn length_() -> uint;
     fn iter_(f: fn(T));
-    fn map_<U: copy>(f: fn(T) -> U) -> ~[U];
+    fn map_<U: Copy>(f: fn(T) -> U) -> ~[U];
 }
 
 impl<T> ~[T]: vec_utils<T> {
     fn length_() -> uint { vec::len(self) }
     fn iter_(f: fn(T)) { for self.each |x| { f(x); } }
-    fn map_<U: copy>(f: fn(T) -> U) -> ~[U] {
+    fn map_<U: Copy>(f: fn(T) -> U) -> ~[U] {
         let mut r = ~[];
         for self.each |elt| { r += ~[f(elt)]; }
         r
index b8832edbad9bed310d5580cf55c00a24f50dab55..1fc930a688ef0f2b2d111a3c348590becfc1c7a9 100644 (file)
@@ -5,7 +5,7 @@ trait bool_like {
     static fn select<A>(b: self, +x1: A, +x2: A) -> A;
 }
 
-fn andand<T: bool_like copy>(x1: T, x2: T) -> T {
+fn andand<T: bool_like Copy>(x1: T, x2: T) -> T {
     select(x1, x2, x1)
 }
 
index 95709971e03d28b14f641d5622304e9b9338c367..4c7d0415d85897c0478cb603b5da668de608c878 100644 (file)
@@ -12,10 +12,10 @@ fn to_str() -> ~str { ~"()" }
 }
 
 trait map<T> {
-    fn map<U: copy>(f: fn(T) -> U) -> ~[U];
+    fn map<U: Copy>(f: fn(T) -> U) -> ~[U];
 }
 impl<T> ~[T]: map<T> {
-    fn map<U: copy>(f: fn(T) -> U) -> ~[U] {
+    fn map<U: Copy>(f: fn(T) -> U) -> ~[U] {
         let mut r = ~[];
         for self.each |x| { r += ~[f(x)]; }
         r
index f9174598cce937c16b4b2c8b21e787217de4b677..f96c2bede61a699c111c13b4deb7b57d12e09d3b 100644 (file)
@@ -1,6 +1,6 @@
 fn p_foo<T>(pinned: T) { }
-fn s_foo<T: copy>(shared: T) { }
-fn u_foo<T: send>(unique: T) { }
+fn s_foo<T: Copy>(shared: T) { }
+fn u_foo<T: Send>(unique: T) { }
 
 struct r {
   i: int,
index 5c7e2228ab4c614826d7144cb4533227efcf5ecb..18c3db591f6534a7842852ca8f63b3338b70f680 100644 (file)
@@ -8,7 +8,7 @@ enum maybe_pointy {
     d : fn~() -> uint,
 };
 
-fn make_uniq_closure<A:send copy>(a: A) -> fn~() -> uint {
+fn make_uniq_closure<A:Send Copy>(a: A) -> fn~() -> uint {
     fn~() -> uint { ptr::addr_of(a) as uint }
 }
 
index 8addb1acaf2cf73e941b05306dd58ba759046cbe..8a36cbd7c7d3e3f498b53c9cbcac8bcedb97bf50 100644 (file)
@@ -1,4 +1,4 @@
-fn f<T: copy>(t: T) -> T {
+fn f<T: Copy>(t: T) -> T {
     let t1 = t;
     t1
 }
index f8fd6f62c2654ff7e3db40749ea2cdeefb856fae..a299e88c344b66a61f1d96c3f60a16b4fde8b022 100644 (file)
@@ -1,6 +1,6 @@
 // Issue #976
 
-fn f<T: copy>(x: ~T) {
+fn f<T: Copy>(x: ~T) {
     let _x2 = x;
 }
 fn main() { }
index c22b529910a47c7c600ec80b387270ae66c52adf..2f6c94f3f34fc9f99398b9917dcddbe1168d5bee 100644 (file)
@@ -2,11 +2,11 @@
 
 fn sendable() {
 
-    fn f<T: send Eq>(i: T, j: T) {
+    fn f<T: Send Eq>(i: T, j: T) {
         assert i == j;
     }
 
-    fn g<T: send Eq>(i: T, j: T) {
+    fn g<T: Send Eq>(i: T, j: T) {
         assert i != j;
     }
 
@@ -20,11 +20,11 @@ fn g<T: send Eq>(i: T, j: T) {
 
 fn copyable() {
 
-    fn f<T: copy Eq>(i: T, j: T) {
+    fn f<T: Copy Eq>(i: T, j: T) {
         assert i == j;
     }
 
-    fn g<T: copy Eq>(i: T, j: T) {
+    fn g<T: Copy Eq>(i: T, j: T) {
         assert i != j;
     }