]> git.lizzy.rs Git - rust.git/commitdiff
librustc: Separate most trait bounds with '+'. rs=plussing
authorPatrick Walton <pcwalton@mimiga.net>
Thu, 21 Feb 2013 01:07:17 +0000 (17:07 -0800)
committerPatrick Walton <pcwalton@mimiga.net>
Thu, 21 Feb 2013 05:14:20 +0000 (21:14 -0800)
204 files changed:
src/libcore/at_vec.rs
src/libcore/cmp.rs
src/libcore/dlist.rs
src/libcore/dvec.rs
src/libcore/either.rs
src/libcore/hash.rs
src/libcore/hashmap.rs
src/libcore/io.rs
src/libcore/iter-trait.rs
src/libcore/iter.rs
src/libcore/num/num.rs
src/libcore/option.rs
src/libcore/pipes.rs
src/libcore/private.rs
src/libcore/private/global.rs
src/libcore/rand.rs
src/libcore/reflect.rs
src/libcore/result.rs
src/libcore/task/local_data.rs
src/libcore/task/local_data_priv.rs
src/libcore/task/mod.rs
src/libcore/to_bytes.rs
src/libcore/to_str.rs
src/libcore/tuple.rs
src/libcore/util.rs
src/libcore/vec.rs
src/libfuzzer/cycles.rs
src/libfuzzer/ivec_fuzz.rs
src/libfuzzer/rand_util.rs
src/librustc/driver/session.rs
src/librustc/front/core_inject.rs
src/librustc/front/test.rs
src/librustc/metadata/encoder.rs
src/librustc/metadata/filesearch.rs
src/librustc/middle/astencode.rs
src/librustc/middle/borrowck/mod.rs
src/librustc/middle/lint.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/trans/debuginfo.rs
src/librustc/middle/ty.rs
src/librustc/middle/typeck/astconv.rs
src/librustc/middle/typeck/check/mod.rs
src/librustc/middle/typeck/collect.rs
src/librustc/middle/typeck/infer/combine.rs
src/librustc/middle/typeck/infer/lattice.rs
src/librustc/middle/typeck/infer/mod.rs
src/librustc/middle/typeck/infer/to_str.rs
src/librustc/middle/typeck/infer/unify.rs
src/librustc/middle/typeck/mod.rs
src/librustc/middle/typeck/rscope.rs
src/librustdoc/fold.rs
src/librustdoc/util.rs
src/libstd/arc.rs
src/libstd/c_vec.rs
src/libstd/comm.rs
src/libstd/deque.rs
src/libstd/flatpipes.rs
src/libstd/fun_treemap.rs
src/libstd/json.rs
src/libstd/list.rs
src/libstd/oldmap.rs
src/libstd/oldsmallintmap.rs
src/libstd/par.rs
src/libstd/priority_queue.rs
src/libstd/semver.rs
src/libstd/serialize.rs
src/libstd/smallintmap.rs
src/libstd/sort.rs
src/libstd/sync.rs
src/libstd/timer.rs
src/libstd/treemap.rs
src/libstd/workcache.rs
src/libsyntax/ast.rs
src/libsyntax/codemap.rs
src/libsyntax/diagnostic.rs
src/libsyntax/ext/auto_encode.rs
src/libsyntax/ext/pipes/ast_builder.rs
src/libsyntax/parse/common.rs
src/libsyntax/print/pprust.rs
src/libsyntax/util/interner.rs
src/libsyntax/util/testing.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/issue4516_ty_param_lib.rs
src/test/auxiliary/static-methods-crate.rs
src/test/auxiliary/trait_inheritance_auto_xc_aux.rs
src/test/bench/core-set.rs
src/test/bench/pingpong.rs
src/test/bench/shootout-k-nucleotide-pipes.rs
src/test/compile-fail/ambig_impl_bounds.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-2766-a.rs
src/test/compile-fail/issue-3177-mutable-struct.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/obsolete-syntax.rs
src/test/compile-fail/regions-escape-via-trait-or-not.rs
src/test/compile-fail/unique-unique-kind.rs
src/test/compile-fail/vec-concat-bug.rs
src/test/compile-fail/vtable-res-trait-param.rs
src/test/run-fail/bug-811.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-encode.rs
src/test/run-pass/auto-instantiate.rs
src/test/run-pass/autobind.rs
src/test/run-pass/autoderef-method-on-trait-monomorphized.rs
src/test/run-pass/autoref-intermediate-types-issue-3585.rs
src/test/run-pass/borrowed-ptr-pattern.rs
src/test/run-pass/box-unbox.rs
src/test/run-pass/class-cast-to-trait-cross-crate-2.rs
src/test/run-pass/class-cast-to-trait-cross-crate.rs
src/test/run-pass/class-cast-to-trait-multiple-types.rs
src/test/run-pass/class-implement-traits.rs
src/test/run-pass/class-implements-multiple-traits.rs
src/test/run-pass/class-separate-impl.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/explicit-self-objects-ext-1.rs
src/test/run-pass/explicit-self-objects-ext-2.rs
src/test/run-pass/explicit-self-objects-ext-3.rs
src/test/run-pass/explicit-self-objects-ext-4.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-2284.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-2718.rs
src/test/run-pass/issue-2734.rs
src/test/run-pass/issue-2735.rs
src/test/run-pass/issue-2834.rs
src/test/run-pass/issue-3305.rs
src/test/run-pass/issue-333.rs
src/test/run-pass/issue-3480.rs
src/test/run-pass/issue-4016.rs
src/test/run-pass/ivec-add.rs
src/test/run-pass/monad.rs
src/test/run-pass/monomorphized-callees-with-ty-params-3314.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/reflect-visit-data.rs
src/test/run-pass/resource-generic.rs
src/test/run-pass/ret-break-cont-in-block.rs
src/test/run-pass/ret-none.rs
src/test/run-pass/send-type-inference.rs
src/test/run-pass/sendfn-generic-fn.rs
src/test/run-pass/static-impl.rs
src/test/run-pass/static-method-in-trait-with-tps-intracrate.rs
src/test/run-pass/static-method-test.rs
src/test/run-pass/trait-bounds.rs
src/test/run-pass/trait-cast.rs
src/test/run-pass/trait-default-method-bound.rs
src/test/run-pass/trait-generic.rs
src/test/run-pass/trait-inheritance-auto-xc-2.rs
src/test/run-pass/trait-inheritance-auto-xc.rs
src/test/run-pass/trait-inheritance-auto.rs
src/test/run-pass/trait-inheritance-call-bound-inherited2.rs
src/test/run-pass/trait-inheritance-diamond.rs
src/test/run-pass/trait-inheritance-multiple-inheritors.rs
src/test/run-pass/trait-inheritance-multiple-params.rs
src/test/run-pass/trait-inheritance-overloading-xc-exe.rs
src/test/run-pass/trait-inheritance-overloading.rs
src/test/run-pass/trait-inheritance-visibility.rs
src/test/run-pass/trait-inheritance2.rs
src/test/run-pass/trait-to-str.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 565fe11d3f4a8d2e484d158a629a961d683f0b84..1880feaf4967e9fe113715a6fc009a1c01d52a4f 100644 (file)
@@ -101,7 +101,7 @@ pub unsafe fn vec_reserve_shared_actual(++t: *sys::TypeDesc,
 
 // Appending
 #[inline(always)]
-pub pure fn append<T: Copy>(lhs: @[T], rhs: &[const T]) -> @[T] {
+pub 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]); }
@@ -137,7 +137,7 @@ pub unsafe fn vec_reserve_shared_actual(++t: *sys::TypeDesc,
  * Creates an immutable vector of size `n_elts` and initializes the elements
  * to the value `t`.
  */
-pub pure fn from_elem<T: Copy>(n_elts: uint, t: T) -> @[T] {
+pub 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(copy t); i += 1u; }
@@ -173,7 +173,7 @@ pub mod traits {
     use kinds::Copy;
     use ops::Add;
 
-    pub impl<T: Copy> Add<&[const T],@[T]> for @[T] {
+    pub impl<T:Copy> Add<&[const T],@[T]> for @[T] {
         #[inline(always)]
         pure fn add(&self, rhs: & &self/[const T]) -> @[T] {
             append(*self, (*rhs))
index 7cd4d4c9bc3b22335065ebadbc0ff25ddde5760e..fd99235bd270c6150f42d3041b91927fd2dc5dad 100644 (file)
@@ -56,41 +56,41 @@ pub trait Ord {
 }
 
 #[inline(always)]
-pub pure fn lt<T: Ord>(v1: &T, v2: &T) -> bool {
+pub pure fn lt<T:Ord>(v1: &T, v2: &T) -> bool {
     (*v1).lt(v2)
 }
 
 #[inline(always)]
-pub pure fn le<T: Ord>(v1: &T, v2: &T) -> bool {
+pub pure fn le<T:Ord>(v1: &T, v2: &T) -> bool {
     (*v1).le(v2)
 }
 
 #[inline(always)]
-pub pure fn eq<T: Eq>(v1: &T, v2: &T) -> bool {
+pub pure fn eq<T:Eq>(v1: &T, v2: &T) -> bool {
     (*v1).eq(v2)
 }
 
 #[inline(always)]
-pub pure fn ne<T: Eq>(v1: &T, v2: &T) -> bool {
+pub pure fn ne<T:Eq>(v1: &T, v2: &T) -> bool {
     (*v1).ne(v2)
 }
 
 #[inline(always)]
-pub pure fn ge<T: Ord>(v1: &T, v2: &T) -> bool {
+pub pure fn ge<T:Ord>(v1: &T, v2: &T) -> bool {
     (*v1).ge(v2)
 }
 
 #[inline(always)]
-pub pure fn gt<T: Ord>(v1: &T, v2: &T) -> bool {
+pub pure fn gt<T:Ord>(v1: &T, v2: &T) -> bool {
     (*v1).gt(v2)
 }
 
 #[inline(always)]
-pub pure fn min<T: Ord>(v1: T, v2: T) -> T {
+pub pure fn min<T:Ord>(v1: T, v2: T) -> T {
     if v1 < v2 { v1 } else { v2 }
 }
 
 #[inline(always)]
-pub pure fn max<T: Ord>(v1: T, v2: T) -> T {
+pub pure fn max<T:Ord>(v1: T, v2: T) -> T {
     if v1 > v2 { v1 } else { v2 }
 }
index 09de94f1aaf7ddf1a76b5b5abd1b32124b0a0b36..3580736488926fc2d095eb0cafce3b5b1a671d83 100644 (file)
@@ -106,7 +106,7 @@ impl<T> DListNode<T> {
     list
 }
 
-pub fn from_vec<T: Copy>(vec: &[T]) -> @mut DList<T> {
+pub fn from_vec<T:Copy>(vec: &[T]) -> @mut DList<T> {
     do vec::foldl(DList(), vec) |list,data| {
         list.push(*data); // Iterating left-to-right -- add newly to the tail.
         list
@@ -457,7 +457,7 @@ fn assert_consistent(@mut self) {
     }
 }
 
-impl<T: Copy> DList<T> {
+impl<T:Copy> DList<T> {
     /// Remove data from the head of the list. O(1).
     fn pop(@mut self) -> Option<T> {
         self.pop_n().map(|nobe| nobe.data)
index 03a921d7ea504f8d2c20673fc15b13663bccc544..7651b737bf34ea62d9319e140bd6d384bbaf025a 100644 (file)
@@ -227,7 +227,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
      *
index 72aecdd82954fe18e42ab2a25849d80d119c5e89..93b28233acdd8ac818a922d42e5ac04de0736259 100644 (file)
@@ -41,7 +41,7 @@ pub fn either<T, U, V>(f_left: fn(&T) -> V,
     }
 }
 
-pub fn lefts<T: Copy, U>(eithers: &[Either<T, U>]) -> ~[T] {
+pub fn lefts<T:Copy,U>(eithers: &[Either<T, U>]) -> ~[T] {
     //! Extracts from a vector of either all the left values
 
     do vec::build_sized(eithers.len()) |push| {
index 40a9de0cea349405e36a290d3850450e43d4488c..7c1448c88eef7b148ae1d732931e302021cb7555 100644 (file)
@@ -59,7 +59,7 @@ pub trait HashUtil {
     pure fn hash() -> u64;
 }
 
-impl<A: Hash> HashUtil for A {
+impl<A:Hash> HashUtil for A {
     #[inline(always)]
     pure fn hash() -> u64 { self.hash_keyed(0,0) }
 }
@@ -74,7 +74,7 @@ pub trait Streaming {
     fn reset();
 }
 
-impl<A: IterBytes> Hash for A {
+impl<A:IterBytes> Hash for A {
     #[inline(always)]
     pure fn hash_keyed(k0: u64, k1: u64) -> u64 {
         unsafe {
index 9cc7c2b760c5590b4f3c37afb8c67f90cd73c21d..07c7780898f96436fadd16a3358605f5319c8a33 100644 (file)
@@ -56,14 +56,14 @@ enum SearchResult {
         ((capacity as float) * 3. / 4.) as uint
     }
 
-    pub fn linear_map_with_capacity<K: Eq Hash, V>(
+    pub fn linear_map_with_capacity<K:Eq + Hash,V>(
         initial_capacity: uint) -> LinearMap<K, V> {
         let r = rand::task_rng();
         linear_map_with_capacity_and_keys(r.gen_u64(), r.gen_u64(),
                                           initial_capacity)
     }
 
-    pure fn linear_map_with_capacity_and_keys<K: Eq Hash, V>(
+    pure fn linear_map_with_capacity_and_keys<K:Eq + Hash,V>(
         k0: u64, k1: u64,
         initial_capacity: uint) -> LinearMap<K, V> {
         LinearMap {
@@ -74,7 +74,7 @@ pub fn linear_map_with_capacity<K: Eq Hash, V>(
         }
     }
 
-    priv impl<K: Hash IterBytes Eq, V> LinearMap<K, V> {
+    priv impl<K:Hash + IterBytes + Eq,V> LinearMap<K, V> {
         #[inline(always)]
         pure fn to_bucket(&self, h: uint) -> uint {
             // A good hash function with entropy spread over all of the
@@ -246,7 +246,7 @@ fn search(&self, hash: uint,
         }
     }
 
-    impl<K: Hash IterBytes Eq, V> BaseIter<(&K, &V)> for LinearMap<K, V> {
+    impl<K:Hash + IterBytes + Eq,V> BaseIter<(&K, &V)> for LinearMap<K, V> {
         /// Visit all key-value pairs
         pure fn each(&self, blk: fn(&(&self/K, &self/V)) -> bool) {
             for uint::range(0, self.buckets.len()) |i| {
@@ -263,7 +263,7 @@ impl<K: Hash IterBytes Eq, V> BaseIter<(&K, &V)> for LinearMap<K, V> {
     }
 
 
-    impl<K: Hash IterBytes Eq, V> Container for LinearMap<K, V> {
+    impl<K:Hash + IterBytes + Eq,V> Container for LinearMap<K, V> {
         /// Return the number of elements in the map
         pure fn len(&self) -> uint { self.size }
 
@@ -271,7 +271,7 @@ impl<K: Hash IterBytes Eq, V> Container for LinearMap<K, V> {
         pure fn is_empty(&self) -> bool { self.len() == 0 }
     }
 
-    impl<K: Hash IterBytes Eq, V> Mutable for LinearMap<K, V> {
+    impl<K:Hash + IterBytes + Eq,V> Mutable for LinearMap<K, V> {
         /// Clear the map, removing all key-value pairs.
         fn clear(&mut self) {
             for uint::range(0, self.buckets.len()) |idx| {
@@ -281,7 +281,7 @@ fn clear(&mut self) {
         }
     }
 
-    impl<K: Hash IterBytes Eq, V> Map<K, V> for LinearMap<K, V> {
+    impl<K:Hash + IterBytes + Eq,V> Map<K, V> for LinearMap<K, V> {
         /// Return true if the map contains a value for the specified key
         pure fn contains_key(&self, k: &K) -> bool {
             match self.bucket_for_key(k) {
@@ -333,7 +333,7 @@ fn remove(&mut self, k: &K) -> bool {
         }
     }
 
-    pub impl<K:Hash IterBytes Eq, V> LinearMap<K, V> {
+    pub impl<K:Hash + IterBytes + Eq,V> LinearMap<K, V> {
         /// Create an empty LinearMap
         static fn new() -> LinearMap<K, V> {
             linear_map_with_capacity(INITIAL_CAPACITY)
@@ -457,7 +457,7 @@ fn consume(&mut self, f: fn(K, V)) {
         }
     }
 
-    impl<K: Hash IterBytes Eq, V: Eq> Eq for LinearMap<K, V> {
+    impl<K:Hash + IterBytes + Eq,V:Eq> Eq for LinearMap<K, V> {
         pure fn eq(&self, other: &LinearMap<K, V>) -> bool {
             if self.len() != other.len() { return false; }
 
@@ -478,13 +478,13 @@ pub struct LinearSet<T> {
         priv map: LinearMap<T, ()>
     }
 
-    impl<T: Hash IterBytes Eq> BaseIter<T> for LinearSet<T> {
+    impl<T:Hash + IterBytes + Eq> BaseIter<T> for LinearSet<T> {
         /// Visit all values in order
         pure fn each(&self, f: fn(&T) -> bool) { self.map.each_key(f) }
         pure fn size_hint(&self) -> Option<uint> { Some(self.len()) }
     }
 
-    impl<T: Hash IterBytes Eq> Eq for LinearSet<T> {
+    impl<T:Hash + IterBytes + Eq> Eq for LinearSet<T> {
         pure fn eq(&self, other: &LinearSet<T>) -> bool {
             self.map == other.map
         }
@@ -493,7 +493,7 @@ impl<T: Hash IterBytes Eq> Eq for LinearSet<T> {
         }
     }
 
-    impl<T: Hash IterBytes Eq> Container for LinearSet<T> {
+    impl<T:Hash + IterBytes + Eq> Container for LinearSet<T> {
         /// Return the number of elements in the set
         pure fn len(&self) -> uint { self.map.len() }
 
@@ -501,12 +501,12 @@ impl<T: Hash IterBytes Eq> Container for LinearSet<T> {
         pure fn is_empty(&self) -> bool { self.map.is_empty() }
     }
 
-    impl<T: Hash IterBytes Eq> Mutable for LinearSet<T> {
+    impl<T:Hash + IterBytes + Eq> Mutable for LinearSet<T> {
         /// Clear the set, removing all values.
         fn clear(&mut self) { self.map.clear() }
     }
 
-    impl<T: Hash IterBytes Eq> Set<T> for LinearSet<T> {
+    impl<T:Hash + IterBytes + Eq> Set<T> for LinearSet<T> {
         /// Return true if the set contains a value
         pure fn contains(&self, value: &T) -> bool {
             self.map.contains_key(value)
@@ -575,7 +575,7 @@ fn remove(&mut self, value: &T) -> bool { self.map.remove(value) }
         }
     }
 
-    pub impl <T: Hash IterBytes Eq> LinearSet<T> {
+    pub impl <T:Hash + IterBytes + Eq> LinearSet<T> {
         /// Create an empty LinearSet
         static fn new() -> LinearSet<T> { LinearSet{map: LinearMap::new()} }
 
index 6739c5b852e1d13860a71c689d3c5c211006ecee..421eb94a29128e0ee631426987baa04e37224d9c 100644 (file)
@@ -169,7 +169,7 @@ pub trait ReaderUtil {
     fn read_i8(&self) -> i8;
 }
 
-impl<T: Reader> ReaderUtil for T {
+impl<T:Reader> ReaderUtil for T {
 
     fn read_bytes(&self,len: uint) -> ~[u8] {
         let mut bytes = vec::with_capacity(len);
@@ -193,7 +193,7 @@ fn read_line(&self) -> ~str {
 
     fn read_chars(&self, n: uint) -> ~[char] {
         // returns the (consumed offset, n_req), appends characters to &chars
-        fn chars_from_bytes<T: Reader>(bytes: &~[u8], chars: &mut ~[char])
+        fn chars_from_bytes<T:Reader>(bytes: &~[u8], chars: &mut ~[char])
             -> (uint, uint) {
             let mut i = 0;
             let bytes_len = bytes.len();
@@ -460,7 +460,7 @@ struct Wrapper<T, C> {
 // A forwarding impl of reader that also holds on to a resource for the
 // duration of its lifetime.
 // FIXME there really should be a better way to do this // #2004
-impl<R: Reader, C> Reader for Wrapper<R, C> {
+impl<R:Reader,C> Reader for Wrapper<R, C> {
     fn read(&self, bytes: &mut [u8], len: uint) -> uint {
         self.base.read(bytes, len)
     }
@@ -589,7 +589,7 @@ pub trait Writer {
     fn get_type(&self) -> WriterType;
 }
 
-impl<W: Writer, C> Writer for Wrapper<W, C> {
+impl<W:Writer,C> Writer for Wrapper<W, C> {
     fn write(&self, bs: &[const u8]) { self.base.write(bs); }
     fn seek(&self, off: int, style: SeekStyle) { self.base.seek(off, style); }
     fn tell(&self) -> uint { self.base.tell() }
@@ -890,7 +890,7 @@ pub trait WriterUtil {
     fn write_i8(&self, n: i8);
 }
 
-impl<T: Writer> WriterUtil for T {
+impl<T:Writer> WriterUtil for T {
     fn write_char(&self, ch: char) {
         if ch as uint < 128u {
             self.write(&[ch as u8]);
@@ -1112,7 +1112,7 @@ pub struct Res<t> {
         arg: Arg<t>,
     }
 
-    impl<T: Copy> Drop for Res<T> {
+    impl<T:Copy> Drop for Res<T> {
         fn finalize(&self) {
           match self.arg.opt_level {
             None => (),
index 9a8f01baed1ebd8ea7eb9b5b615d28addd49e09d..7c4a99133bbdbff0fcc34e1884367e850ddab17a 100644 (file)
@@ -60,14 +60,14 @@ impl<A> iter::ExtendedIter<A> for IMPL_T<A> {
 
 }
 
-impl<A: Eq> iter::EqIter<A> for IMPL_T<A> {
+impl<A:Eq> iter::EqIter<A> for IMPL_T<A> {
     #[inline(always)]
     pure fn contains(&self, x: &A) -> bool { iter::contains(self, x) }
     #[inline(always)]
     pure fn count(&self, x: &A) -> uint { iter::count(self, x) }
 }
 
-impl<A: Copy> iter::CopyableIter<A> for IMPL_T<A> {
+impl<A:Copy> iter::CopyableIter<A> for IMPL_T<A> {
     #[inline(always)]
     pure fn filter_to_vec(&self, pred: fn(&A) -> bool) -> ~[A] {
         iter::filter_to_vec(self, pred)
@@ -80,7 +80,7 @@ impl<A: Copy> iter::CopyableIter<A> for IMPL_T<A> {
     }
 }
 
-impl<A: Copy Ord> iter::CopyableOrderedIter<A> for IMPL_T<A> {
+impl<A:Copy + Ord> iter::CopyableOrderedIter<A> for IMPL_T<A> {
     #[inline(always)]
     pure fn min(&self) -> A { iter::min(self) }
     #[inline(always)]
index 25cdb11456a06a3ab043879fabb197b828034ca0..e48edc9c1735bf369e985c0f9ff1ac6d606b71b7 100644 (file)
@@ -57,7 +57,7 @@ pub trait CopyableIter<A:Copy> {
     pure fn find(&self, p: fn(&A) -> bool) -> Option<A>;
 }
 
-pub trait CopyableOrderedIter<A:Copy Ord> {
+pub trait CopyableOrderedIter<A:Copy Ord> {
     pure fn min(&self) -> A;
     pure fn max(&self) -> A;
 }
@@ -211,7 +211,7 @@ pub trait Buildable<A> {
 }
 
 #[inline(always)]
-pub pure fn min<A:Copy Ord,IA:BaseIter<A>>(self: &IA) -> A {
+pub 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(ref a_) if *a_ < *b => {
@@ -226,7 +226,7 @@ pub trait Buildable<A> {
 }
 
 #[inline(always)]
-pub pure fn max<A:Copy Ord,IA:BaseIter<A>>(self: &IA) -> A {
+pub pure fn max<A:Copy Ord,IA:BaseIter<A>>(self: &IA) -> A {
     match do foldl::<A,Option<A>,IA>(self, None) |a, b| {
         match a {
           &Some(ref a_) if *a_ > *b => {
@@ -241,7 +241,7 @@ pub trait Buildable<A> {
 }
 
 #[inline(always)]
-pub pure fn find<A: Copy,IA:BaseIter<A>>(self: &IA,
+pub pure fn find<A:Copy,IA:BaseIter<A>>(self: &IA,
                                    f: fn(&A) -> bool) -> Option<A> {
     for self.each |i| {
         if f(i) { return Some(*i) }
@@ -323,7 +323,7 @@ pub fn map<T,IT: BaseIter<T>,U,BU: Buildable<U>>(v: &IT, f: fn(&T) -> U)
  * to the value `t`.
  */
 #[inline(always)]
-pub pure fn from_elem<T: Copy,BT: Buildable<T>>(n_elts: uint,
+pub pure fn from_elem<T:Copy,BT:Buildable<T>>(n_elts: uint,
                                                 t: T) -> BT {
     do Buildable::build_sized(n_elts) |push| {
         let mut i: uint = 0;
@@ -333,7 +333,7 @@ pub fn map<T,IT: BaseIter<T>,U,BU: Buildable<U>>(v: &IT, f: fn(&T) -> U)
 
 /// Appending two generic sequences
 #[inline(always)]
-pub pure fn append<T: Copy,IT: BaseIter<T>,BT: Buildable<T>>(
+pub pure fn append<T:Copy,IT:BaseIter<T>,BT:Buildable<T>>(
     lhs: &IT, rhs: &IT) -> BT {
     let size_opt = lhs.size_hint().chain_ref(
         |sz1| rhs.size_hint().map(|sz2| *sz1+*sz2));
@@ -346,7 +346,7 @@ pub fn map<T,IT: BaseIter<T>,U,BU: Buildable<U>>(v: &IT, f: fn(&T) -> U)
 /// Copies a generic sequence, possibly converting it to a different
 /// type of sequence.
 #[inline(always)]
-pub pure fn copy_seq<T: Copy,IT: BaseIter<T>,BT: Buildable<T>>(
+pub 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 e720c2fa108aee553d3c9aee985fedfca82f780b..7038ba07c0dea791394407dc8f8422c2edbaa5c2 100644 (file)
@@ -62,7 +62,7 @@ pub enum RoundMode {
  * ~~~
  */
 #[inline(always)]
-pub pure fn cast<T:NumCast, U:NumCast>(n: T) -> U {
+pub pure fn cast<T:NumCast,U:NumCast>(n: T) -> U {
     NumCast::from(n)
 }
 
index 13d4ec6e10df66c9dc6daadc2f2811a89fd08b7a..e27b7086bc45bb53d0d5cc0279c639154f8ca2a0 100644 (file)
@@ -85,7 +85,7 @@ pub impl<T:Ord> Ord for Option<T> {
 }
 
 #[inline(always)]
-pub pure fn get<T: Copy>(opt: Option<T>) -> T {
+pub pure fn get<T:Copy>(opt: Option<T>) -> T {
     /*!
     Gets the value out of an option
 
@@ -207,14 +207,14 @@ pub impl<T:Ord> Ord for Option<T> {
 }
 
 #[inline(always)]
-pub pure fn get_or_zero<T: Copy Zero>(opt: Option<T>) -> T {
+pub pure fn get_or_zero<T:Copy + Zero>(opt: Option<T>) -> T {
     //! Returns the contained value or zero (for this type)
 
     match opt { Some(copy x) => x, None => Zero::zero() }
 }
 
 #[inline(always)]
-pub pure fn get_or_default<T: Copy>(opt: Option<T>, def: T) -> T {
+pub pure fn get_or_default<T:Copy>(opt: Option<T>, def: T) -> T {
     //! Returns the contained value or a default
 
     match opt { Some(copy x) => x, None => def }
@@ -393,7 +393,7 @@ fn swap_unwrap(&mut self) -> T { swap_unwrap(self) }
     pure fn expect(self, reason: &str) -> T { expect(self, reason) }
 }
 
-impl<T: Copy> Option<T> {
+impl<T:Copy> Option<T> {
     /**
     Gets the value out of an option
 
@@ -421,7 +421,7 @@ impl<T: Copy> Option<T> {
     }
 }
 
-impl<T: Copy Zero> Option<T> {
+impl<T:Copy + Zero> Option<T> {
     #[inline(always)]
     pure fn get_or_zero(self) -> T { get_or_zero(self) }
 }
index f0108fe85b7572f9808439de2acd6055b75f9472..b3e32fc6b6c0652d24f887b9a7d41d07bb191081 100644 (file)
@@ -189,7 +189,7 @@ unsafe fn buf_header() -> ~BufferHeader {
         reinterpret_cast(&self.buffer)
     }
 
-    fn set_buffer<T: Owned>(b: ~Buffer<T>) {
+    fn set_buffer<T:Owned>(b: ~Buffer<T>) {
         unsafe {
             self.buffer = reinterpret_cast(&b);
         }
@@ -207,14 +207,14 @@ pub trait HasBuffer {
     fn set_buffer(b: *libc::c_void);
 }
 
-impl<T: Owned> HasBuffer for Packet<T> {
+impl<T:Owned> HasBuffer for Packet<T> {
     fn set_buffer(b: *libc::c_void) {
         self.header.buffer = b;
     }
 }
 
 #[doc(hidden)]
-pub fn mk_packet<T: Owned>() -> Packet<T> {
+pub fn mk_packet<T:Owned>() -> Packet<T> {
     Packet {
         header: PacketHeader(),
         payload: None,
@@ -246,7 +246,7 @@ pub fn packet<T>() -> *Packet<T> {
 }
 
 #[doc(hidden)]
-pub fn entangle_buffer<T: Owned, Tstart: Owned>(
+pub fn entangle_buffer<T:Owned,Tstart:Owned>(
     buffer: ~Buffer<T>,
     init: fn(*libc::c_void, x: &T) -> *Packet<Tstart>)
     -> (SendPacketBuffered<Tstart, T>, RecvPacketBuffered<Tstart, T>)
@@ -432,7 +432,7 @@ pub fn send<T,Tbuffer>(p: SendPacketBuffered<T,Tbuffer>, payload: T) -> bool {
 Fails if the sender closes the connection.
 
 */
-pub fn recv<T: Owned, Tbuffer: Owned>(
+pub fn recv<T:Owned,Tbuffer:Owned>(
     p: RecvPacketBuffered<T, Tbuffer>) -> T {
     try_recv(p).expect("connection closed")
 }
@@ -443,7 +443,7 @@ pub fn recv<T: Owned, Tbuffer: Owned>(
 a message, or `Some(T)` if a message was received.
 
 */
-pub fn try_recv<T: Owned, Tbuffer: Owned>(p: RecvPacketBuffered<T, Tbuffer>)
+pub fn try_recv<T:Owned,Tbuffer:Owned>(p: RecvPacketBuffered<T, Tbuffer>)
     -> Option<T>
 {
     let p_ = p.unwrap();
@@ -553,7 +553,7 @@ struct DropState {
 }
 
 /// Returns true if messages are available.
-pub pure fn peek<T: Owned, Tb: Owned>(p: &RecvPacketBuffered<T, Tb>) -> bool {
+pub pure fn peek<T:Owned,Tb:Owned>(p: &RecvPacketBuffered<T, Tb>) -> bool {
     match unsafe {(*p.header()).state} {
       Empty | Terminated => false,
       Blocked => fail!(~"peeking on blocked packet"),
@@ -561,14 +561,14 @@ struct DropState {
     }
 }
 
-impl<T: Owned, Tb: Owned> Peekable<T> for RecvPacketBuffered<T, Tb> {
+impl<T:Owned,Tb:Owned> Peekable<T> for RecvPacketBuffered<T, Tb> {
     pure fn peek() -> bool {
         peek(&self)
     }
 }
 
 #[doc(hidden)]
-fn sender_terminate<T: Owned>(p: *Packet<T>) {
+fn sender_terminate<T:Owned>(p: *Packet<T>) {
     let p = unsafe { &*p };
     match swap_state_rel(&mut p.header.state, Terminated) {
       Empty => {
@@ -599,7 +599,7 @@ fn sender_terminate<T: Owned>(p: *Packet<T>) {
 }
 
 #[doc(hidden)]
-fn receiver_terminate<T: Owned>(p: *Packet<T>) {
+fn receiver_terminate<T:Owned>(p: *Packet<T>) {
     let p = unsafe { &*p };
     match swap_state_rel(&mut p.header.state, Terminated) {
       Empty => {
@@ -632,7 +632,7 @@ fn receiver_terminate<T: Owned>(p: *Packet<T>) {
 closed by the sender or has a message waiting to be received.
 
 */
-fn wait_many<T: Selectable>(pkts: &[T]) -> uint {
+fn wait_many<T:Selectable>(pkts: &[T]) -> uint {
     let this = unsafe { rustrt::rust_get_task() };
 
     unsafe {
@@ -714,7 +714,7 @@ fn wait_many<T: Selectable>(pkts: &[T]) -> uint {
 this case, `select2` may return either `left` or `right`.
 
 */
-pub fn select2<A: Owned, Ab: Owned, B: Owned, Bb: Owned>(
+pub fn select2<A:Owned,Ab:Owned,B:Owned,Bb:Owned>(
     a: RecvPacketBuffered<A, Ab>,
     b: RecvPacketBuffered<B, Bb>)
     -> Either<(Option<A>, RecvPacketBuffered<B, Bb>),
@@ -739,12 +739,12 @@ impl Selectable for *PacketHeader {
 }
 
 /// Returns the index of an endpoint that is ready to receive.
-pub fn selecti<T: Selectable>(endpoints: &[T]) -> uint {
+pub fn selecti<T:Selectable>(endpoints: &[T]) -> uint {
     wait_many(endpoints)
 }
 
 /// Returns 0 or 1 depending on which endpoint is ready to receive
-pub fn select2i<A: Selectable, B: Selectable>(a: &A, b: &B) ->
+pub fn select2i<A:Selectable,B:Selectable>(a: &A, b: &B) ->
         Either<(), ()> {
     match wait_many([a.header(), b.header()]) {
       0 => Left(()),
@@ -757,7 +757,7 @@ pub fn select2i<A: Selectable, B: Selectable>(a: &A, b: &B) ->
  list of the remaining endpoints.
 
 */
-pub fn select<T: Owned, Tb: Owned>(endpoints: ~[RecvPacketBuffered<T, Tb>])
+pub fn select<T:Owned,Tb:Owned>(endpoints: ~[RecvPacketBuffered<T, Tb>])
     -> (uint, Option<T>, ~[RecvPacketBuffered<T, Tb>])
 {
     let ready = wait_many(endpoints.map(|p| p.header()));
@@ -852,7 +852,7 @@ pub struct RecvPacketBuffered<T, Tbuffer> {
     mut buffer: Option<BufferResource<Tbuffer>>,
 }
 
-impl<T:Owned, Tbuffer:Owned> ::ops::Drop for RecvPacketBuffered<T,Tbuffer> {
+impl<T:Owned,Tbuffer:Owned> ::ops::Drop for RecvPacketBuffered<T,Tbuffer> {
     fn finalize(&self) {
         //if self.p != none {
         //    debug!("drop recv %?", option::get(self.p));
@@ -869,7 +869,7 @@ fn finalize(&self) {
     }
 }
 
-impl<T: Owned, Tbuffer: Owned> RecvPacketBuffered<T, Tbuffer> {
+impl<T:Owned,Tbuffer:Owned> RecvPacketBuffered<T, Tbuffer> {
     fn unwrap() -> *Packet<T> {
         let mut p = None;
         p <-> self.p;
@@ -884,7 +884,7 @@ fn reuse_buffer() -> BufferResource<Tbuffer> {
     }
 }
 
-impl<T: Owned, Tbuffer: Owned> Selectable for RecvPacketBuffered<T, Tbuffer> {
+impl<T:Owned,Tbuffer:Owned> Selectable for RecvPacketBuffered<T, Tbuffer> {
     pure fn header() -> *PacketHeader {
         match self.p {
           Some(packet) => unsafe {
@@ -923,7 +923,7 @@ pub fn entangle<T>() -> (SendPacket<T>, RecvPacket<T>) {
 endpoint is passed to the new task.
 
 */
-pub fn spawn_service<T: Owned, Tb: Owned>(
+pub fn spawn_service<T:Owned,Tb:Owned>(
     init: extern fn() -> (SendPacketBuffered<T, Tb>,
                           RecvPacketBuffered<T, Tb>),
     service: fn~(v: RecvPacketBuffered<T, Tb>))
@@ -947,7 +947,7 @@ pub fn spawn_service<T: Owned, Tb: Owned>(
 receive state.
 
 */
-pub fn spawn_service_recv<T: Owned, Tb: Owned>(
+pub fn spawn_service_recv<T:Owned,Tb:Owned>(
     init: extern fn() -> (RecvPacketBuffered<T, Tb>,
                           SendPacketBuffered<T, Tb>),
     service: fn~(v: SendPacketBuffered<T, Tb>))
@@ -970,7 +970,7 @@ pub fn spawn_service_recv<T: Owned, Tb: Owned>(
 // Streams - Make pipes a little easier in general.
 
 proto! streamp (
-    Open:send<T: Owned> {
+    Open:send<T:Owned> {
         data(T) -> Open<T>
     }
 )
@@ -1036,7 +1036,7 @@ pub fn stream<T:Owned>() -> (Port<T>, Chan<T>) {
     (Port_(Port_ { endp: Some(s) }), Chan_(Chan_{ endp: Some(c) }))
 }
 
-impl<T: Owned> GenericChan<T> for Chan<T> {
+impl<T:Owned> GenericChan<T> for Chan<T> {
     fn send(x: T) {
         let mut endp = None;
         endp <-> self.endp;
@@ -1045,7 +1045,7 @@ fn send(x: T) {
     }
 }
 
-impl<T: Owned> GenericSmartChan<T> for Chan<T> {
+impl<T:Owned> GenericSmartChan<T> for Chan<T> {
 
     fn try_send(x: T) -> bool {
         let mut endp = None;
@@ -1060,7 +1060,7 @@ fn try_send(x: T) -> bool {
     }
 }
 
-impl<T: Owned> GenericPort<T> for Port<T> {
+impl<T:Owned> GenericPort<T> for Port<T> {
     fn recv() -> T {
         let mut endp = None;
         endp <-> self.endp;
@@ -1082,7 +1082,7 @@ fn try_recv() -> Option<T> {
     }
 }
 
-impl<T: Owned> Peekable<T> for Port<T> {
+impl<T:Owned> Peekable<T> for Port<T> {
     pure fn peek() -> bool {
         unsafe {
             let mut endp = None;
@@ -1097,7 +1097,7 @@ impl<T: Owned> Peekable<T> for Port<T> {
     }
 }
 
-impl<T: Owned> Selectable for Port<T> {
+impl<T:Owned> Selectable for Port<T> {
     pure fn header() -> *PacketHeader {
         unsafe {
             match self.endp {
@@ -1113,13 +1113,13 @@ pub struct PortSet<T> {
     mut ports: ~[pipes::Port<T>],
 }
 
-pub fn PortSet<T: Owned>() -> PortSet<T>{
+pub fn PortSet<T:Owned>() -> PortSet<T>{
     PortSet {
         ports: ~[]
     }
 }
 
-impl<T: Owned> PortSet<T> {
+impl<T:Owned> PortSet<T> {
 
     fn add(port: pipes::Port<T>) {
         self.ports.push(port)
@@ -1132,7 +1132,7 @@ fn chan() -> Chan<T> {
     }
 }
 
-impl<T: Owned> GenericPort<T> for PortSet<T> {
+impl<T:Owned> GenericPort<T> for PortSet<T> {
 
     fn try_recv() -> Option<T> {
         let mut result = None;
@@ -1162,7 +1162,7 @@ fn recv() -> T {
 
 }
 
-impl<T: Owned> Peekable<T> for PortSet<T> {
+impl<T:Owned> Peekable<T> for PortSet<T> {
     pure fn peek() -> bool {
         // It'd be nice to use self.port.each, but that version isn't
         // pure.
@@ -1176,7 +1176,7 @@ impl<T: Owned> Peekable<T> for PortSet<T> {
 /// A channel that can be shared between many senders.
 pub type SharedChan<T> = private::Exclusive<Chan<T>>;
 
-impl<T: Owned> GenericChan<T> for SharedChan<T> {
+impl<T:Owned> GenericChan<T> for SharedChan<T> {
     fn send(x: T) {
         let mut xx = Some(x);
         do self.with_imm |chan| {
@@ -1187,7 +1187,7 @@ fn send(x: T) {
     }
 }
 
-impl<T: Owned> GenericSmartChan<T> for SharedChan<T> {
+impl<T:Owned> GenericSmartChan<T> for SharedChan<T> {
     fn try_send(x: T) -> bool {
         let mut xx = Some(x);
         do self.with_imm |chan| {
@@ -1204,7 +1204,7 @@ pub fn SharedChan<T:Owned>(c: Chan<T>) -> SharedChan<T> {
 }
 
 /// Receive a message from one of two endpoints.
-pub trait Select2<T: Owned, U: Owned> {
+pub trait Select2<T:Owned,U:Owned> {
     /// 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.
@@ -1247,17 +1247,17 @@ fn try_select() -> Either<Option<T>, Option<U>> {
 pub type PortOne<T> = oneshot::server::Oneshot<T>;
 
 /// Initialiase a (send-endpoint, recv-endpoint) oneshot pipe pair.
-pub fn oneshot<T: Owned>() -> (PortOne<T>, ChanOne<T>) {
+pub fn oneshot<T:Owned>() -> (PortOne<T>, ChanOne<T>) {
     let (chan, port) = oneshot::init();
     (port, chan)
 }
 
-impl<T: Owned> PortOne<T> {
+impl<T:Owned> PortOne<T> {
     fn recv(self) -> T { recv_one(self) }
     fn try_recv(self) -> Option<T> { try_recv_one(self) }
 }
 
-impl<T: Owned> ChanOne<T> {
+impl<T:Owned> ChanOne<T> {
     fn send(self, data: T) { send_one(self, data) }
     fn try_send(self, data: T) -> bool { try_send_one(self, data) }
 }
@@ -1266,13 +1266,13 @@ fn try_send(self, data: T) -> bool { try_send_one(self, data) }
  * Receive a message from a oneshot pipe, failing if the connection was
  * closed.
  */
-pub fn recv_one<T: Owned>(port: PortOne<T>) -> T {
+pub fn recv_one<T:Owned>(port: PortOne<T>) -> T {
     let oneshot::send(message) = recv(port);
     message
 }
 
 /// Receive a message from a oneshot pipe unless the connection was closed.
-pub fn try_recv_one<T: Owned> (port: PortOne<T>) -> Option<T> {
+pub fn try_recv_one<T:Owned> (port: PortOne<T>) -> Option<T> {
     let message = try_recv(port);
 
     if message.is_none() { None }
@@ -1283,7 +1283,7 @@ pub fn try_recv_one<T: Owned> (port: PortOne<T>) -> Option<T> {
 }
 
 /// Send a message on a oneshot pipe, failing if the connection was closed.
-pub fn send_one<T: Owned>(chan: ChanOne<T>, data: T) {
+pub fn send_one<T:Owned>(chan: ChanOne<T>, data: T) {
     oneshot::client::send(chan, data);
 }
 
@@ -1291,7 +1291,7 @@ pub fn send_one<T: Owned>(chan: ChanOne<T>, data: T) {
  * Send a message on a oneshot pipe, or return false if the connection was
  * closed.
  */
-pub fn try_send_one<T: Owned>(chan: ChanOne<T>, data: T)
+pub fn try_send_one<T:Owned>(chan: ChanOne<T>, data: T)
         -> bool {
     oneshot::client::try_send(chan, data).is_some()
 }
index 5b69c348c1591174544e3731734c7162519641a5..465ddb361abf92c2a92fb89556c3eb0afba90f39 100644 (file)
@@ -170,7 +170,7 @@ fn ArcDestruct<T>(data: *libc::c_void) -> ArcDestruct<T> {
     }
 }
 
-pub unsafe fn unwrap_shared_mutable_state<T: Owned>(rc: SharedMutableState<T>)
+pub unsafe fn unwrap_shared_mutable_state<T:Owned>(rc: SharedMutableState<T>)
         -> T {
     struct DeathThroes<T> {
         mut ptr:      Option<~ArcData<T>>,
@@ -246,7 +246,7 @@ struct DeathThroes<T> {
  */
 pub type SharedMutableState<T> = ArcDestruct<T>;
 
-pub unsafe fn shared_mutable_state<T: Owned>(data: T) ->
+pub unsafe fn shared_mutable_state<T:Owned>(data: T) ->
         SharedMutableState<T> {
     let data = ~ArcData { count: 1, unwrapper: 0, data: Some(data) };
     unsafe {
@@ -256,7 +256,7 @@ pub unsafe fn shared_mutable_state<T: Owned>(data: T) ->
 }
 
 #[inline(always)]
-pub unsafe fn get_shared_mutable_state<T: Owned>(
+pub unsafe fn get_shared_mutable_state<T:Owned>(
     rc: *SharedMutableState<T>) -> *mut T
 {
     unsafe {
@@ -268,7 +268,7 @@ pub unsafe fn get_shared_mutable_state<T: Owned>(
     }
 }
 #[inline(always)]
-pub unsafe fn get_shared_immutable_state<T: Owned>(
+pub unsafe fn get_shared_immutable_state<T:Owned>(
         rc: &a/SharedMutableState<T>) -> &a/T {
     unsafe {
         let ptr: ~ArcData<T> = cast::reinterpret_cast(&(*rc).data);
@@ -280,7 +280,7 @@ pub unsafe fn get_shared_immutable_state<T: Owned>(
     }
 }
 
-pub unsafe fn clone_shared_mutable_state<T: Owned>(rc: &SharedMutableState<T>)
+pub unsafe fn clone_shared_mutable_state<T:Owned>(rc: &SharedMutableState<T>)
         -> SharedMutableState<T> {
     unsafe {
         let ptr: ~ArcData<T> = cast::reinterpret_cast(&(*rc).data);
@@ -291,7 +291,7 @@ pub unsafe fn clone_shared_mutable_state<T: Owned>(rc: &SharedMutableState<T>)
     ArcDestruct((*rc).data)
 }
 
-impl<T: Owned> Clone for SharedMutableState<T> {
+impl<T:Owned> Clone for SharedMutableState<T> {
     fn clone(&self) -> SharedMutableState<T> {
         unsafe {
             clone_shared_mutable_state(self)
@@ -353,21 +353,21 @@ struct ExData<T> { lock: LittleLock, mut failed: bool, mut data: T, }
  */
 pub struct Exclusive<T> { x: SharedMutableState<ExData<T>> }
 
-pub fn exclusive<T:Owned >(user_data: T) -> Exclusive<T> {
+pub fn exclusive<T:Owned>(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: Owned> Clone for Exclusive<T> {
+impl<T:Owned> Clone for Exclusive<T> {
     // Duplicate an exclusive ARC, as std::arc::clone.
     fn clone(&self) -> Exclusive<T> {
         Exclusive { x: unsafe { clone_shared_mutable_state(&self.x) } }
     }
 }
 
-impl<T: Owned> Exclusive<T> {
+impl<T:Owned> Exclusive<T> {
     // Exactly like std::arc::mutex_arc,access(), but with the little_lock
     // instead of a proper mutex. Same reason for being unsafe.
     //
@@ -400,7 +400,7 @@ unsafe fn with_imm<U>(f: fn(x: &T) -> U) -> U {
 }
 
 // FIXME(#3724) make this a by-move method on the exclusive
-pub fn unwrap_exclusive<T: Owned>(arc: Exclusive<T>) -> T {
+pub fn unwrap_exclusive<T:Owned>(arc: Exclusive<T>) -> T {
     let Exclusive { x: x } = arc;
     let inner = unsafe { unwrap_shared_mutable_state(x) };
     let ExData { data: data, _ } = inner;
index 621ead48abc1a803fdb63aeab177f916ef35aa67..10e4cd9ddb053f7d3fc033155bcf4ebba78b3aa6 100644 (file)
@@ -43,7 +43,7 @@
 
 pub type GlobalDataKey<T> = &fn(v: T);
 
-pub unsafe fn global_data_clone_create<T: Owned Clone>(
+pub unsafe fn global_data_clone_create<T:Owned + Clone>(
     key: GlobalDataKey<T>, create: &fn() -> ~T) -> T {
     /*!
      * Clone a global value or, if it has not been created,
@@ -59,7 +59,7 @@ pub unsafe fn global_data_clone_create<T: Owned Clone>(
     global_data_clone_create_(key_ptr(key), create)
 }
 
-unsafe fn global_data_clone_create_<T: Owned Clone>(
+unsafe fn global_data_clone_create_<T:Owned + Clone>(
     key: uint, create: &fn() -> ~T) -> T {
 
     let mut clone_value: Option<T> = None;
@@ -79,13 +79,13 @@ unsafe fn global_data_clone_create_<T: Owned Clone>(
     return clone_value.unwrap();
 }
 
-unsafe fn global_data_modify<T: Owned>(
+unsafe fn global_data_modify<T:Owned>(
     key: GlobalDataKey<T>, op: &fn(Option<~T>) -> Option<~T>) {
 
     global_data_modify_(key_ptr(key), op)
 }
 
-unsafe fn global_data_modify_<T: Owned>(
+unsafe fn global_data_modify_<T:Owned>(
     key: uint, op: &fn(Option<~T>) -> Option<~T>) {
 
     let mut old_dtor = None;
@@ -124,7 +124,7 @@ unsafe fn global_data_modify_<T: Owned>(
     }
 }
 
-pub unsafe fn global_data_clone<T: Owned Clone>(
+pub unsafe fn global_data_clone<T:Owned + Clone>(
     key: GlobalDataKey<T>) -> Option<T> {
     let mut maybe_clone: Option<T> = None;
     do global_data_modify(key) |current| {
@@ -220,7 +220,7 @@ fn get_global_state() -> Exclusive<GlobalState> {
     }
 }
 
-fn key_ptr<T: Owned>(key: GlobalDataKey<T>) -> uint {
+fn key_ptr<T:Owned>(key: GlobalDataKey<T>) -> uint {
     unsafe {
         let closure: Closure = reinterpret_cast(&key);
         return transmute(closure.code);
index 79dd29604e42e2c0e157aa2beb82cd25dc91de78..a88b83465161da8b4ee58ddefee7c82666ca309e 100644 (file)
@@ -109,7 +109,7 @@ impl Rand for bool {
     }
 }
 
-impl<T: Rand> Rand for Option<T> {
+impl<T:Rand> Rand for Option<T> {
     static fn rand(rng: rand::Rng) -> Option<T> {
         if rng.gen_bool() { Some(Rand::rand(rng)) }
         else { None }
@@ -143,7 +143,7 @@ pub struct Weighted<T> {
 /// Extension methods for random number generators
 impl Rng {
     /// Return a random value for a Rand type
-    fn gen<T: Rand>() -> T {
+    fn gen<T:Rand>() -> T {
         Rand::rand(self)
     }
 
@@ -302,7 +302,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()
     }
 
index 8983c63f42a1ff2e779d2a80a556ac53b96011a4..ed7e485678e10dcefb9ada7362d21e332ebdc900 100644 (file)
@@ -41,11 +41,11 @@ pub fn align(size: uint, align: uint) -> uint {
 pub struct MovePtrAdaptor<V> {
     inner: V
 }
-pub fn MovePtrAdaptor<V: TyVisitor MovePtr>(v: V) -> MovePtrAdaptor<V> {
+pub fn MovePtrAdaptor<V:TyVisitor + MovePtr>(v: V) -> MovePtrAdaptor<V> {
     MovePtrAdaptor { inner: v }
 }
 
-impl<V: TyVisitor MovePtr> MovePtrAdaptor<V> {
+impl<V:TyVisitor + MovePtr> MovePtrAdaptor<V> {
     #[inline(always)]
     fn bump(sz: uint) {
       do self.inner.move_ptr() |p| {
@@ -72,7 +72,7 @@ fn bump_past<T>() {
 }
 
 /// Abstract type-directed pointer-movement using the MovePtr trait
-impl<V: TyVisitor MovePtr> TyVisitor for MovePtrAdaptor<V> {
+impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
     fn visit_bot(&self) -> bool {
         self.align_to::<()>();
         if ! self.inner.visit_bot() { return false; }
index 64c62c925849fa87f98993c5414086ec3e04d1ac..b03eaeab3e0cc510a082711a73d6c4a1344dbf47 100644 (file)
@@ -37,7 +37,7 @@ pub enum Result<T, U> {
  * If the result is an error
  */
 #[inline(always)]
-pub pure fn get<T: Copy, U>(res: &Result<T, U>) -> T {
+pub pure fn get<T:Copy,U>(res: &Result<T, U>) -> T {
     match *res {
       Ok(copy t) => t,
       Err(ref the_err) => unsafe {
@@ -100,7 +100,7 @@ pub enum Result<T, U> {
  * result variants are converted to `either::left`.
  */
 #[inline(always)]
-pub pure fn to_either<T: Copy, U: Copy>(res: &Result<U, T>)
+pub pure fn to_either<T:Copy,U:Copy>(res: &Result<U, T>)
     -> Either<T, U> {
     match *res {
       Ok(copy res) => either::Right(res),
@@ -220,7 +220,7 @@ pub enum Result<T, U> {
  * successful result while handling an error.
  */
 #[inline(always)]
-pub pure fn map_err<T: Copy, E, F: Copy>(res: &Result<T, E>, op: fn(&E) -> F)
+pub pure fn map_err<T:Copy,E,F:Copy>(res: &Result<T, E>, op: fn(&E) -> F)
   -> Result<T, F> {
     match *res {
       Ok(copy t) => Ok(t),
@@ -261,7 +261,7 @@ impl<T, E> Result<T, E> {
     }
 }
 
-impl<T: Copy, E> Result<T, E> {
+impl<T:Copy,E> Result<T, E> {
     #[inline(always)]
     pure fn get(&self) -> T { get(self) }
 
index fe37a2e155f0bb693075d1ae8601fe257892c097..ae101faaf0264f4f3cf1cc77e17c0e31aa0eb9e6 100644 (file)
@@ -51,7 +51,7 @@
  * Remove a task-local data value from the table, returning the
  * reference that was originally created to insert it.
  */
-pub unsafe fn local_data_pop<T: Durable>(
+pub unsafe fn local_data_pop<T:Durable>(
     key: LocalDataKey<T>) -> Option<@T> {
 
     local_pop(rt::rust_get_task(), key)
@@ -60,7 +60,7 @@ pub unsafe fn local_data_pop<T: Durable>(
  * Retrieve a task-local data value. It will also be kept alive in the
  * table until explicitly removed.
  */
-pub unsafe fn local_data_get<T: Durable>(
+pub unsafe fn local_data_get<T:Durable>(
     key: LocalDataKey<T>) -> Option<@T> {
 
     local_get(rt::rust_get_task(), key)
@@ -69,7 +69,7 @@ pub unsafe fn local_data_get<T: Durable>(
  * Store a value in task-local data. If this key already has a value,
  * that value is overwritten (and its destructor is run).
  */
-pub unsafe fn local_data_set<T: Durable>(
+pub unsafe fn local_data_set<T:Durable>(
     key: LocalDataKey<T>, data: @T) {
 
     local_set(rt::rust_get_task(), key, data)
@@ -78,7 +78,7 @@ pub unsafe fn local_data_set<T: Durable>(
  * Modify a task-local data value. If the function returns 'None', the
  * data is removed (and its reference dropped).
  */
-pub unsafe fn local_data_modify<T: Durable>(
+pub unsafe fn local_data_modify<T:Durable>(
     key: LocalDataKey<T>,
     modify_fn: fn(Option<@T>) -> Option<@T>) {
 
index 949c36545dd0341027b17fdc8c02cc0adf452fbd..3ac457b23d16eaefc53de7910abf08e9dde18d5b 100644 (file)
@@ -26,7 +26,7 @@
 type rust_task = libc::c_void;
 
 pub trait LocalData { }
-impl<T: Durable> LocalData for @T { }
+impl<T:Durable> LocalData for @T { }
 
 impl Eq for LocalData {
     pure fn eq(&self, other: &@LocalData) -> bool {
@@ -79,7 +79,7 @@ unsafe fn get_task_local_map(task: *rust_task) -> TaskLocalMap {
     }
 }
 
-unsafe fn key_to_key_value<T: Durable>(
+unsafe fn key_to_key_value<T:Durable>(
     key: LocalDataKey<T>) -> *libc::c_void {
 
     // Keys are closures, which are (fnptr,envptr) pairs. Use fnptr.
@@ -89,7 +89,7 @@ unsafe fn key_to_key_value<T: Durable>(
 }
 
 // If returning Some(..), returns with @T with the map's reference. Careful!
-unsafe fn local_data_lookup<T: Durable>(
+unsafe fn local_data_lookup<T:Durable>(
     map: TaskLocalMap, key: LocalDataKey<T>)
     -> Option<(uint, *libc::c_void)> {
 
@@ -107,7 +107,7 @@ unsafe fn local_data_lookup<T: Durable>(
     }
 }
 
-unsafe fn local_get_helper<T: Durable>(
+unsafe fn local_get_helper<T:Durable>(
     task: *rust_task, key: LocalDataKey<T>,
     do_pop: bool) -> Option<@T> {
 
@@ -129,21 +129,21 @@ unsafe fn local_get_helper<T: Durable>(
 }
 
 
-pub unsafe fn local_pop<T: Durable>(
+pub unsafe fn local_pop<T:Durable>(
     task: *rust_task,
     key: LocalDataKey<T>) -> Option<@T> {
 
     local_get_helper(task, key, true)
 }
 
-pub unsafe fn local_get<T: Durable>(
+pub unsafe fn local_get<T:Durable>(
     task: *rust_task,
     key: LocalDataKey<T>) -> Option<@T> {
 
     local_get_helper(task, key, false)
 }
 
-pub unsafe fn local_set<T: Durable>(
+pub unsafe fn local_set<T:Durable>(
     task: *rust_task, key: LocalDataKey<T>, data: @T) {
 
     let map = get_task_local_map(task);
@@ -175,7 +175,7 @@ pub unsafe fn local_set<T: Durable>(
     }
 }
 
-pub unsafe fn local_modify<T: Durable>(
+pub unsafe fn local_modify<T:Durable>(
     task: *rust_task, key: LocalDataKey<T>,
     modify_fn: fn(Option<@T>) -> Option<@T>) {
 
index 4b15d1f76c98a70e096734b01fef5dd3b05d2302..54dfa7459a1e7b94222388576b39784ffa1f1193 100644 (file)
@@ -396,7 +396,7 @@ fn spawn(f: fn~()) {
         spawn::spawn_raw(opts, (x.gen_body)(f));
     }
     /// Runs a task, while transfering ownership of one argument to the child.
-    fn spawn_with<A: Owned>(arg: A, f: fn~(v: A)) {
+    fn spawn_with<A:Owned>(arg: A, f: fn~(v: A)) {
         let arg = ~mut Some(arg);
         do self.spawn || {
             f(option::swap_unwrap(arg))
@@ -416,7 +416,7 @@ fn spawn_with<A: Owned>(arg: A, f: fn~(v: A)) {
      * # Failure
      * Fails if a future_result was already set for this task.
      */
-    fn try<T: Owned>(f: fn~() -> T) -> Result<T,()> {
+    fn try<T:Owned>(f: fn~() -> T) -> Result<T,()> {
         let (po, ch) = stream::<T>();
         let mut result = None;
 
index 10efa9196a7bb585ab6f07435b36870fa2f571ca..4b2cd3c2fab5bb6222821fae936e8c4ff717059b 100644 (file)
@@ -197,7 +197,7 @@ impl IterBytes for int {
     }
 }
 
-impl<A: IterBytes> IterBytes for &[A] {
+impl<A:IterBytes> IterBytes for &[A] {
     #[inline(always)]
     pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
         for (*self).each |elt| {
@@ -208,7 +208,7 @@ impl<A: IterBytes> IterBytes for &[A] {
     }
 }
 
-impl<A: IterBytes, B: IterBytes> IterBytes for (A,B) {
+impl<A:IterBytes,B:IterBytes> IterBytes for (A,B) {
   #[inline(always)]
   pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
     match *self {
@@ -219,7 +219,7 @@ impl<A: IterBytes, B: IterBytes> IterBytes for (A,B) {
   }
 }
 
-impl<A: IterBytes, B: IterBytes, C: IterBytes> IterBytes for (A,B,C) {
+impl<A:IterBytes,B:IterBytes,C:IterBytes> IterBytes for (A,B,C) {
   #[inline(always)]
   pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
     match *self {
@@ -235,21 +235,21 @@ impl<A: IterBytes, B: IterBytes, C: IterBytes> IterBytes for (A,B,C) {
     a
 }
 
-impl<A: IterBytes> IterBytes for ~[A] {
+impl<A:IterBytes> IterBytes for ~[A] {
     #[inline(always)]
     pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
         borrow(*self).iter_bytes(lsb0, f)
     }
 }
 
-impl<A: IterBytes> IterBytes for @[A] {
+impl<A:IterBytes> IterBytes for @[A] {
     #[inline(always)]
     pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
         borrow(*self).iter_bytes(lsb0, f)
     }
 }
 
-pub pure fn iter_bytes_2<A: IterBytes, B: IterBytes>(a: &A, b: &B,
+pub pure fn iter_bytes_2<A:IterBytes,B:IterBytes>(a: &A, b: &B,
                                             lsb0: bool, z: Cb) {
     let mut flag = true;
     a.iter_bytes(lsb0, |bytes| {flag = z(bytes); flag});
@@ -379,7 +379,7 @@ impl IterBytes for @str {
     }
 }
 
-impl<A: IterBytes> IterBytes for Option<A> {
+impl<A:IterBytes> IterBytes for Option<A> {
     #[inline(always)]
     pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
         match *self {
@@ -389,21 +389,21 @@ impl<A: IterBytes> IterBytes for Option<A> {
     }
 }
 
-impl<A: IterBytes> IterBytes for &A {
+impl<A:IterBytes> IterBytes for &A {
     #[inline(always)]
     pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
         (**self).iter_bytes(lsb0, f);
     }
 }
 
-impl<A: IterBytes> IterBytes for @A {
+impl<A:IterBytes> IterBytes for @A {
     #[inline(always)]
     pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
         (**self).iter_bytes(lsb0, f);
     }
 }
 
-impl<A: IterBytes> IterBytes for ~A {
+impl<A:IterBytes> IterBytes for ~A {
     #[inline(always)]
     pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
         (**self).iter_bytes(lsb0, f);
@@ -424,7 +424,7 @@ trait ToBytes {
     fn to_bytes(&self, lsb0: bool) -> ~[u8];
 }
 
-impl<A: IterBytes> ToBytes for A {
+impl<A:IterBytes> ToBytes for A {
     fn to_bytes(&self, lsb0: bool) -> ~[u8] {
         do io::with_bytes_writer |wr| {
             for self.iter_bytes(lsb0) |bytes| {
index 4cccc1d26382c01fb2d1a28cd19ef1b1f3af6f68..0145adc77b826d992d0f2f3d69b576bcd0fd2262 100644 (file)
@@ -45,7 +45,7 @@ impl ToStr for @str {
 
 // FIXME #4898: impl for one-tuples
 
-impl<A: ToStr, B: ToStr> ToStr for (A, B) {
+impl<A:ToStr,B:ToStr> ToStr for (A, B) {
     #[inline(always)]
     pure fn to_str(&self) -> ~str {
         // FIXME(#4760): this causes an llvm assertion
@@ -57,7 +57,7 @@ impl<A: ToStr, B: ToStr> ToStr for (A, B) {
         }
     }
 }
-impl<A: ToStr, B: ToStr, C: ToStr> ToStr for (A, B, C) {
+impl<A:ToStr,B:ToStr,C:ToStr> ToStr for (A, B, C) {
     #[inline(always)]
     pure fn to_str(&self) -> ~str {
         // FIXME(#4760): this causes an llvm assertion
@@ -74,7 +74,7 @@ impl<A: ToStr, B: ToStr, C: ToStr> ToStr for (A, B, C) {
     }
 }
 
-impl<A: ToStr> ToStr for ~[A] {
+impl<A:ToStr> ToStr for ~[A] {
     #[inline(always)]
     pure fn to_str(&self) -> ~str {
         unsafe {
@@ -94,11 +94,11 @@ impl<A: ToStr> ToStr for ~[A] {
     }
 }
 
-impl<A: ToStr> ToStr for @A {
+impl<A:ToStr> ToStr for @A {
     #[inline(always)]
     pure fn to_str(&self) -> ~str { ~"@" + (**self).to_str() }
 }
-impl<A: ToStr> ToStr for ~A {
+impl<A:ToStr> ToStr for ~A {
     #[inline(always)]
     pure fn to_str(&self) -> ~str { ~"~" + (**self).to_str() }
 }
index e49c1d26a06300fcaab7288339273975d42adaa9..dde7d718c13d5d41d8213933ca0c97d0daceb946 100644 (file)
@@ -20,7 +20,7 @@ pub trait CopyableTuple<T, U> {
     pure fn swap() -> (U, T);
 }
 
-impl<T: Copy, U: Copy> CopyableTuple<T, U> for (T, U) {
+impl<T:Copy,U:Copy> CopyableTuple<T, U> for (T, U) {
 
     /// Return the first element of self
     #[inline(always)]
@@ -70,7 +70,7 @@ pub trait ExtendedTupleOps<A,B> {
     fn map<C>(&self, f: &fn(a: &A, b: &B) -> C) -> ~[C];
 }
 
-impl<A: Copy, B: Copy> ExtendedTupleOps<A,B> for (&[A], &[B]) {
+impl<A:Copy,B:Copy> ExtendedTupleOps<A,B> for (&[A], &[B]) {
     #[inline(always)]
     fn zip(&self) -> ~[(A, B)] {
         match *self {
@@ -90,7 +90,7 @@ fn map<C>(&self, f: &fn(a: &A, b: &B) -> C) -> ~[C] {
     }
 }
 
-impl<A: Copy, B: Copy> ExtendedTupleOps<A,B> for (~[A], ~[B]) {
+impl<A:Copy,B:Copy> ExtendedTupleOps<A,B> for (~[A], ~[B]) {
 
     #[inline(always)]
     fn zip(&self) -> ~[(A, B)] {
@@ -114,7 +114,7 @@ fn map<C>(&self, f: &fn(a: &A, b: &B) -> C) -> ~[C] {
 // FIXME #4898: impl for one-tuples
 
 #[cfg(notest)]
-impl<A: Eq, B: Eq> Eq for (A, B) {
+impl<A:Eq,B:Eq> Eq for (A, B) {
     #[inline(always)]
     pure fn eq(&self, other: &(A, B)) -> bool {
         match (*self) {
@@ -130,7 +130,7 @@ impl<A: Eq, B: Eq> Eq for (A, B) {
 }
 
 #[cfg(notest)]
-impl<A: Ord, B: Ord> Ord for (A, B) {
+impl<A:Ord,B:Ord> Ord for (A, B) {
     #[inline(always)]
     pure fn lt(&self, other: &(A, B)) -> bool {
         match (*self) {
@@ -155,7 +155,7 @@ impl<A: Ord, B: Ord> Ord for (A, B) {
 }
 
 #[cfg(notest)]
-impl<A: Eq, B: Eq, C: Eq> Eq for (A, B, C) {
+impl<A:Eq,B:Eq,C:Eq> Eq for (A, B, C) {
     #[inline(always)]
     pure fn eq(&self, other: &(A, B, C)) -> bool {
         match (*self) {
@@ -172,7 +172,7 @@ impl<A: Eq, B: Eq, C: Eq> Eq for (A, B, C) {
 }
 
 #[cfg(notest)]
-impl<A: Ord, B: Ord, C: Ord> Ord for (A, B, C) {
+impl<A:Ord,B:Ord,C:Ord> Ord for (A, B, C) {
     #[inline(always)]
     pure fn lt(&self, other: &(A, B, C)) -> bool {
         match (*self) {
index eea172a43ced1e1ca440897b36fdf006f3365b48..629c4a3291ce0e5cd9f3b6d7f05e997de4c98a47 100644 (file)
@@ -28,7 +28,7 @@
 /// Sets `*ptr` to `new_value`, invokes `op()`, and then restores the
 /// original value of `*ptr`.
 #[inline(always)]
-pub fn with<T: Copy, R>(
+pub fn with<T:Copy,R>(
     ptr: &mut T,
     new_value: T,
     op: &fn() -> R) -> R
index b55a3bee8b0e0e5a90d7b05de296239e251b9c88..a7edd0ea9c353dbea6df965aa77c46ca8717c829 100644 (file)
@@ -135,12 +135,12 @@ pub fn reserve_at_least<T>(v: &mut ~[T], n: uint) {
  * Creates an immutable vector of size `n_elts` and initializes the elements
  * to the value `t`.
  */
-pub pure fn from_elem<T: Copy>(n_elts: uint, t: T) -> ~[T] {
+pub pure fn from_elem<T:Copy>(n_elts: uint, t: T) -> ~[T] {
     from_fn(n_elts, |_i| copy t)
 }
 
 /// Creates a new unique vector with the same contents as the slice
-pub pure fn from_slice<T: Copy>(t: &[T]) -> ~[T] {
+pub pure fn from_slice<T:Copy>(t: &[T]) -> ~[T] {
     from_fn(t.len(), |i| t[i])
 }
 
@@ -216,10 +216,10 @@ pub fn reserve_at_least<T>(v: &mut ~[T], n: uint) {
 // Accessors
 
 /// Returns the first element of a vector
-pub pure fn head<T: Copy>(v: &[const T]) -> T { v[0] }
+pub pure fn head<T:Copy>(v: &[const T]) -> T { v[0] }
 
 /// Returns a vector containing all but the first element of a slice
-pub pure fn tail<T: Copy>(v: &[const T]) -> ~[T] {
+pub pure fn tail<T:Copy>(v: &[const T]) -> ~[T] {
     slice(v, 1u, len(v)).to_vec()
 }
 
@@ -227,18 +227,18 @@ pub fn reserve_at_least<T>(v: &mut ~[T], n: uint) {
  * Returns a vector containing all but the first `n` \
  * elements of a slice
  */
-pub pure fn tailn<T: Copy>(v: &[const T], n: uint) -> ~[T] {
+pub pure fn tailn<T:Copy>(v: &[const T], n: uint) -> ~[T] {
     slice(v, n, len(v)).to_vec()
 }
 
 /// Returns a vector containing all but the last element of a slice
-pub pure fn init<T: Copy>(v: &[const T]) -> ~[T] {
+pub pure fn init<T:Copy>(v: &[const T]) -> ~[T] {
     assert len(v) != 0u;
     slice(v, 0u, len(v) - 1u).to_vec()
 }
 
 /// Returns the last element of the slice `v`, failing if the slice is empty.
-pub pure fn last<T: Copy>(v: &[const T]) -> T {
+pub pure fn last<T:Copy>(v: &[const T]) -> T {
     if len(v) == 0u { fail!(~"last_unsafe: empty vector") }
     v[len(v) - 1u]
 }
@@ -247,7 +247,7 @@ pub fn reserve_at_least<T>(v: &mut ~[T], n: uint) {
  * Returns `Some(x)` where `x` is the last element of the slice `v`,
  * or `none` if the vector is empty.
  */
-pub pure fn last_opt<T: Copy>(v: &[const T]) -> Option<T> {
+pub pure fn last_opt<T:Copy>(v: &[const T]) -> Option<T> {
     if len(v) == 0u { return None; }
     Some(v[len(v) - 1u])
 }
@@ -300,7 +300,7 @@ pub fn reserve_at_least<T>(v: &mut ~[T], n: uint) {
 /// Copies
 
 /// Split the vector `v` by applying each element against the predicate `f`.
-pub fn split<T: Copy>(v: &[T], f: fn(t: &T) -> bool) -> ~[~[T]] {
+pub fn split<T:Copy>(v: &[T], f: fn(t: &T) -> bool) -> ~[~[T]] {
     let ln = len(v);
     if (ln == 0u) { return ~[] }
 
@@ -323,7 +323,7 @@ pub fn split<T: Copy>(v: &[T], f: fn(t: &T) -> bool) -> ~[~[T]] {
  * Split the vector `v` by applying each element against the predicate `f` up
  * to `n` times.
  */
-pub fn splitn<T: Copy>(v: &[T], n: uint, f: fn(t: &T) -> bool) -> ~[~[T]] {
+pub fn splitn<T:Copy>(v: &[T], n: uint, f: fn(t: &T) -> bool) -> ~[~[T]] {
     let ln = len(v);
     if (ln == 0u) { return ~[] }
 
@@ -349,7 +349,7 @@ pub fn splitn<T: Copy>(v: &[T], n: uint, f: fn(t: &T) -> bool) -> ~[~[T]] {
  * Reverse split the vector `v` by applying each element against the predicate
  * `f`.
  */
-pub fn rsplit<T: Copy>(v: &[T], f: fn(t: &T) -> bool) -> ~[~[T]] {
+pub fn rsplit<T:Copy>(v: &[T], f: fn(t: &T) -> bool) -> ~[~[T]] {
     let ln = len(v);
     if (ln == 0) { return ~[] }
 
@@ -373,7 +373,7 @@ pub fn rsplit<T: Copy>(v: &[T], f: fn(t: &T) -> bool) -> ~[~[T]] {
  * Reverse split the vector `v` by applying each element against the predicate
  * `f` up to `n times.
  */
-pub fn rsplitn<T: Copy>(v: &[T], n: uint, f: fn(t: &T) -> bool) -> ~[~[T]] {
+pub fn rsplitn<T:Copy>(v: &[T], n: uint, f: fn(t: &T) -> bool) -> ~[~[T]] {
     let ln = len(v);
     if (ln == 0u) { return ~[] }
 
@@ -421,7 +421,7 @@ pub fn partition<T>(v: ~[T], f: fn(&T) -> bool) -> (~[T], ~[T]) {
  * Partitions a vector into two new vectors: those that satisfies the
  * predicate, and those that do not.
  */
-pub pure fn partitioned<T: Copy>(v: &[T], f: fn(&T) -> bool) -> (~[T], ~[T]) {
+pub pure fn partitioned<T:Copy>(v: &[T], f: fn(&T) -> bool) -> (~[T], ~[T]) {
     let mut lefts  = ~[];
     let mut rights = ~[];
 
@@ -616,7 +616,7 @@ fn push_slow<T>(v: &mut ~[T], initval: T) {
 }
 
 #[inline(always)]
-pub fn push_all<T: Copy>(v: &mut ~[T], rhs: &[const T]) {
+pub fn push_all<T:Copy>(v: &mut ~[T], rhs: &[const T]) {
     let new_len = v.len() + rhs.len();
     reserve(&mut *v, new_len);
 
@@ -662,7 +662,7 @@ pub fn truncate<T>(v: &mut ~[T], newlen: uint) {
  * Remove consecutive repeated elements from a vector; if the vector is
  * sorted, this removes all duplicates.
  */
-pub fn dedup<T: Eq>(v: &mut ~[T]) {
+pub fn dedup<T:Eq>(v: &mut ~[T]) {
     unsafe {
         if v.len() < 1 { return; }
         let mut last_written = 0, next_to_read = 1;
@@ -700,7 +700,7 @@ pub fn dedup<T: Eq>(v: &mut ~[T]) {
 
 // Appending
 #[inline(always)]
-pub pure fn append<T: Copy>(lhs: ~[T], rhs: &[const T]) -> ~[T] {
+pub pure fn append<T:Copy>(lhs: ~[T], rhs: &[const T]) -> ~[T] {
     let mut v = lhs;
     unsafe {
         v.push_all(rhs);
@@ -724,7 +724,7 @@ pub fn dedup<T: Eq>(v: &mut ~[T]) {
  * * n - The number of elements to add
  * * initval - The value for the new elements
  */
-pub fn grow<T: Copy>(v: &mut ~[T], n: uint, initval: &T) {
+pub fn grow<T:Copy>(v: &mut ~[T], n: uint, initval: &T) {
     let new_len = v.len() + n;
     reserve_at_least(&mut *v, new_len);
     let mut i: uint = 0u;
@@ -766,7 +766,7 @@ pub fn grow_fn<T>(v: &mut ~[T], n: uint, op: iter::InitOp<T>) {
  * of the vector, expands the vector by replicating `initval` to fill the
  * intervening space.
  */
-pub fn grow_set<T: Copy>(v: &mut ~[T], index: uint, initval: &T, val: T) {
+pub fn grow_set<T:Copy>(v: &mut ~[T], index: uint, initval: &T, val: T) {
     let l = v.len();
     if index >= l { grow(&mut *v, index - l + 1u, initval); }
     v[index] = val;
@@ -813,7 +813,7 @@ pub fn map_consume<T, U>(v: ~[T], f: fn(v: T) -> U) -> ~[U] {
 }
 
 /// Apply a function to each pair of elements and return the results
-pub pure fn map2<T: Copy, U: Copy, V>(v0: &[T], v1: &[U],
+pub pure fn map2<T:Copy,U:Copy,V>(v0: &[T], v1: &[U],
                                   f: fn(t: &T, v: &U) -> V) -> ~[V] {
     let v0_len = len(v0);
     if v0_len != len(v1) { fail!(); }
@@ -891,7 +891,7 @@ pub fn filter<T>(v: ~[T], f: fn(t: &T) -> bool) -> ~[T] {
  * Apply function `f` to each element of `v` and return a vector containing
  * only those elements for which `f` returned true.
  */
-pub pure fn filtered<T: Copy>(v: &[T], f: fn(t: &T) -> bool) -> ~[T] {
+pub pure fn filtered<T:Copy>(v: &[T], f: fn(t: &T) -> bool) -> ~[T] {
     let mut result = ~[];
     for each(v) |elem| {
         if f(elem) { unsafe { result.push(*elem); } }
@@ -924,14 +924,14 @@ pub fn retain<T>(v: &mut ~[T], f: pure fn(t: &T) -> bool) {
  *
  * Flattens a vector of vectors of T into a single vector of T.
  */
-pub pure fn concat<T: Copy>(v: &[~[T]]) -> ~[T] {
+pub pure fn concat<T:Copy>(v: &[~[T]]) -> ~[T] {
     let mut r = ~[];
     for each(v) |inner| { unsafe { r.push_all(*inner); } }
     r
 }
 
 /// Concatenate a vector of vectors, placing a given separator between each
-pub pure fn connect<T: Copy>(v: &[~[T]], sep: &T) -> ~[T] {
+pub pure fn connect<T:Copy>(v: &[~[T]], sep: &T) -> ~[T] {
     let mut r: ~[T] = ~[];
     let mut first = true;
     for each(v) |inner| {
@@ -1060,13 +1060,13 @@ pub fn retain<T>(v: &mut ~[T], f: pure fn(t: &T) -> bool) {
 }
 
 /// Return true if a vector contains an element with the given value
-pub pure fn contains<T: Eq>(v: &[T], x: &T) -> bool {
+pub pure fn contains<T:Eq>(v: &[T], x: &T) -> bool {
     for each(v) |elt| { if *x == *elt { return true; } }
     return false;
 }
 
 /// Returns the number of elements that are equal to a given value
-pub pure fn count<T: Eq>(v: &[T], x: &T) -> uint {
+pub pure fn count<T:Eq>(v: &[T], x: &T) -> uint {
     let mut cnt = 0u;
     for each(v) |elt| { if *x == *elt { cnt += 1u; } }
     return cnt;
@@ -1079,7 +1079,7 @@ pub fn retain<T>(v: &mut ~[T], f: pure fn(t: &T) -> bool) {
  * When function `f` returns true then an option containing the element
  * is returned. If `f` matches no elements then none is returned.
  */
-pub pure fn find<T: Copy>(v: &[T], f: fn(t: &T) -> bool) -> Option<T> {
+pub pure fn find<T:Copy>(v: &[T], f: fn(t: &T) -> bool) -> Option<T> {
     find_between(v, 0u, len(v), f)
 }
 
@@ -1090,7 +1090,7 @@ pub fn retain<T>(v: &mut ~[T], f: pure fn(t: &T) -> bool) {
  * [`start`, `end`). When function `f` returns true then an option containing
  * the element is returned. If `f` matches no elements then none is returned.
  */
-pub pure fn find_between<T: Copy>(v: &[T], start: uint, end: uint,
+pub pure fn find_between<T:Copy>(v: &[T], start: uint, end: uint,
                       f: fn(t: &T) -> bool) -> Option<T> {
     position_between(v, start, end, f).map(|i| v[*i])
 }
@@ -1102,7 +1102,7 @@ pub fn retain<T>(v: &mut ~[T], f: pure fn(t: &T) -> bool) {
  * `f` returns true then an option containing the element is returned. If `f`
  * matches no elements then none is returned.
  */
-pub pure fn rfind<T: Copy>(v: &[T], f: fn(t: &T) -> bool) -> Option<T> {
+pub pure fn rfind<T:Copy>(v: &[T], f: fn(t: &T) -> bool) -> Option<T> {
     rfind_between(v, 0u, len(v), f)
 }
 
@@ -1113,13 +1113,13 @@ pub fn retain<T>(v: &mut ~[T], f: pure fn(t: &T) -> bool) {
  * [`start`, `end`). When function `f` returns true then an option containing
  * the element is returned. If `f` matches no elements then none is return.
  */
-pub pure fn rfind_between<T: Copy>(v: &[T], start: uint, end: uint,
+pub pure fn rfind_between<T:Copy>(v: &[T], start: uint, end: uint,
                                f: fn(t: &T) -> bool) -> Option<T> {
     rposition_between(v, start, end, f).map(|i| v[*i])
 }
 
 /// Find the first index containing a matching value
-pub pure fn position_elem<T: Eq>(v: &[T], x: &T) -> Option<uint> {
+pub pure fn position_elem<T:Eq>(v: &[T], x: &T) -> Option<uint> {
     position(v, |y| *x == *y)
 }
 
@@ -1151,7 +1151,7 @@ pub fn retain<T>(v: &mut ~[T], f: pure fn(t: &T) -> bool) {
 }
 
 /// Find the last index containing a matching value
-pure fn rposition_elem<T: Eq>(v: &[T], x: &T) -> Option<uint> {
+pure fn rposition_elem<T:Eq>(v: &[T], x: &T) -> Option<uint> {
     rposition(v, |y| *x == *y)
 }
 
@@ -1193,7 +1193,7 @@ pub fn retain<T>(v: &mut ~[T], f: pure fn(t: &T) -> bool) {
 /**
  * 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 ts = ~[], us = ~[];
     for each(v) |p| {
         let (t, u) = *p;
@@ -1228,7 +1228,7 @@ pub fn retain<T>(v: &mut ~[T], f: pure fn(t: &T) -> bool) {
 /**
  * Convert two vectors to a vector of pairs, by reference. As zip().
  */
-pub pure fn zip_slice<T: Copy, U: Copy>(v: &[const T], u: &[const U])
+pub pure fn zip_slice<T:Copy,U:Copy>(v: &[const T], u: &[const U])
         -> ~[(T, U)] {
     let mut zipped = ~[];
     let sz = len(v);
@@ -1279,7 +1279,7 @@ pub fn reverse<T>(v: &mut [T]) {
 }
 
 /// Returns a vector with the order of elements reversed
-pub pure fn reversed<T: Copy>(v: &[const T]) -> ~[T] {
+pub pure fn reversed<T:Copy>(v: &[const T]) -> ~[T] {
     let mut rs: ~[T] = ~[];
     let mut i = len::<T>(v);
     if i == 0 { return (rs); } else { i -= 1; }
@@ -1445,7 +1445,7 @@ pub fn each2<U, T>(v1: &[U], v2: &[T], f: fn(u: &U, t: &T) -> bool) {
  * The total number of permutations produced is `len(v)!`.  If `v` contains
  * repeated elements, then some permutations are repeated.
  */
-pure fn each_permutation<T: Copy>(v: &[T], put: fn(ts: &[T]) -> bool) {
+pure fn each_permutation<T:Copy>(v: &[T], put: fn(ts: &[T]) -> bool) {
     let ln = len(v);
     if ln <= 1 {
         put(v);
@@ -1469,7 +1469,7 @@ pub fn each2<U, T>(v1: &[U], v2: &[T], f: fn(u: &U, t: &T) -> bool) {
     }
 }
 
-pub pure fn windowed<TT: Copy>(nn: uint, xx: &[TT]) -> ~[~[TT]] {
+pub pure fn windowed<TT:Copy>(nn: uint, xx: &[TT]) -> ~[~[TT]] {
     let mut ww = ~[];
     assert 1u <= nn;
     for vec::eachi (xx) |ii, _x| {
@@ -1536,7 +1536,7 @@ pub fn each2<U, T>(v1: &[U], v2: &[T], f: fn(u: &U, t: &T) -> bool) {
 
 // Equality
 
-pure fn eq<T: Eq>(a: &[T], b: &[T]) -> bool {
+pure fn eq<T:Eq>(a: &[T], b: &[T]) -> bool {
     let (a_len, b_len) = (a.len(), b.len());
     if a_len != b_len { return false; }
 
@@ -1550,7 +1550,7 @@ pub fn each2<U, T>(v1: &[U], v2: &[T], f: fn(u: &U, t: &T) -> bool) {
 }
 
 #[cfg(notest)]
-impl<T: Eq> Eq for &[T] {
+impl<T:Eq> Eq for &[T] {
     #[inline(always)]
     pure fn eq(&self, other: & &self/[T]) -> bool { eq((*self), (*other)) }
     #[inline(always)]
@@ -1559,7 +1559,7 @@ impl<T: Eq> Eq for &[T] {
 
 
 #[cfg(notest)]
-impl<T: Eq> Eq for ~[T] {
+impl<T:Eq> Eq for ~[T] {
     #[inline(always)]
     pure fn eq(&self, other: &~[T]) -> bool { eq((*self), (*other)) }
     #[inline(always)]
@@ -1567,7 +1567,7 @@ impl<T: Eq> Eq for ~[T] {
 }
 
 #[cfg(notest)]
-impl<T: Eq> Eq for @[T] {
+impl<T:Eq> Eq for @[T] {
     #[inline(always)]
     pure fn eq(&self, other: &@[T]) -> bool { eq((*self), (*other)) }
     #[inline(always)]
@@ -1576,7 +1576,7 @@ impl<T: Eq> Eq for @[T] {
 
 // Lexicographical comparison
 
-pure fn lt<T: Ord>(a: &[T], b: &[T]) -> bool {
+pure fn lt<T:Ord>(a: &[T], b: &[T]) -> bool {
     let (a_len, b_len) = (a.len(), b.len());
     let mut end = uint::min(a_len, b_len);
 
@@ -1591,12 +1591,12 @@ impl<T: Eq> Eq for @[T] {
     return a_len < b_len;
 }
 
-pure fn le<T: Ord>(a: &[T], b: &[T]) -> bool { !lt(b, a) }
-pure fn ge<T: Ord>(a: &[T], b: &[T]) -> bool { !lt(a, b) }
-pure fn gt<T: Ord>(a: &[T], b: &[T]) -> bool { lt(b, a)  }
+pure fn le<T:Ord>(a: &[T], b: &[T]) -> bool { !lt(b, a) }
+pure fn ge<T:Ord>(a: &[T], b: &[T]) -> bool { !lt(a, b) }
+pure fn gt<T:Ord>(a: &[T], b: &[T]) -> bool { lt(b, a)  }
 
 #[cfg(notest)]
-impl<T: Ord> Ord for &[T] {
+impl<T:Ord> Ord for &[T] {
     #[inline(always)]
     pure fn lt(&self, other: & &self/[T]) -> bool { lt((*self), (*other)) }
     #[inline(always)]
@@ -1608,7 +1608,7 @@ impl<T: Ord> Ord for &[T] {
 }
 
 #[cfg(notest)]
-impl<T: Ord> Ord for ~[T] {
+impl<T:Ord> Ord for ~[T] {
     #[inline(always)]
     pure fn lt(&self, other: &~[T]) -> bool { lt((*self), (*other)) }
     #[inline(always)]
@@ -1620,7 +1620,7 @@ impl<T: Ord> Ord for ~[T] {
 }
 
 #[cfg(notest)]
-impl<T: Ord> Ord for @[T] {
+impl<T:Ord> Ord for @[T] {
     #[inline(always)]
     pure fn lt(&self, other: &@[T]) -> bool { lt((*self), (*other)) }
     #[inline(always)]
@@ -1637,7 +1637,7 @@ pub mod traits {
     use ops::Add;
     use vec::append;
 
-    impl<T: Copy> Add<&[const T],~[T]> for ~[T] {
+    impl<T:Copy> Add<&[const T],~[T]> for ~[T] {
         #[inline(always)]
         pure fn add(&self, rhs: & &self/[const T]) -> ~[T] {
             append(copy *self, (*rhs))
@@ -1664,7 +1664,7 @@ pub trait CopyableVector<T> {
 }
 
 /// Extension methods for vectors
-impl<T: Copy> CopyableVector<T> for &[const T] {
+impl<T:Copy> CopyableVector<T> for &[const T] {
     /// Returns the first element of a vector
     #[inline]
     pure fn head(&self) -> T { head(*self) }
@@ -1690,13 +1690,13 @@ impl<T: Copy> CopyableVector<T> for &[const T] {
 
 pub trait ImmutableVector<T> {
     pure fn view(&self, start: uint, end: uint) -> &self/[T];
-    pure fn foldr<U: Copy>(&self, z: U, p: fn(t: &T, u: U) -> U) -> U;
+    pure fn foldr<U:Copy>(&self, z: U, p: fn(t: &T, u: U) -> U) -> U;
     pure fn map<U>(&self, f: fn(t: &T) -> U) -> ~[U];
     pure fn mapi<U>(&self, f: fn(uint, t: &T) -> U) -> ~[U];
     fn map_r<U>(&self, f: fn(x: &T) -> U) -> ~[U];
     pure fn alli(&self, f: fn(uint, t: &T) -> bool) -> bool;
     pure fn flat_map<U>(&self, f: fn(t: &T) -> ~[U]) -> ~[U];
-    pure fn filter_mapped<U: Copy>(&self, f: fn(t: &T) -> Option<U>) -> ~[U];
+    pure fn filter_mapped<U:Copy>(&self, f: fn(t: &T) -> Option<U>) -> ~[U];
 }
 
 /// Extension methods for vectors
@@ -1709,7 +1709,7 @@ impl<T> ImmutableVector<T> for &[T] {
 
     /// Reduce a vector from right to left
     #[inline]
-    pure fn foldr<U: Copy>(&self, z: U, p: fn(t: &T, u: U) -> U) -> U {
+    pure fn foldr<U:Copy>(&self, z: U, p: fn(t: &T, u: U) -> U) -> U {
         foldr(*self, z, p)
     }
 
@@ -1759,19 +1759,19 @@ fn map_r<U>(&self, f: fn(x: &T) -> U) -> ~[U] {
      * the resulting vector.
      */
     #[inline]
-    pure fn filter_mapped<U: Copy>(&self, f: fn(t: &T) -> Option<U>) -> ~[U] {
+    pure fn filter_mapped<U:Copy>(&self, f: fn(t: &T) -> Option<U>) -> ~[U] {
         filter_mapped(*self, f)
     }
 }
 
-pub trait ImmutableEqVector<T: Eq> {
+pub trait ImmutableEqVector<T:Eq> {
     pure fn position(&self, f: fn(t: &T) -> bool) -> Option<uint>;
     pure fn position_elem(&self, t: &T) -> Option<uint>;
     pure fn rposition(&self, f: fn(t: &T) -> bool) -> Option<uint>;
     pure fn rposition_elem(&self, t: &T) -> Option<uint>;
 }
 
-impl<T: Eq> ImmutableEqVector<T> for &[T] {
+impl<T:Eq> ImmutableEqVector<T> for &[T] {
     /**
      * Find the first index matching some predicate
      *
@@ -1816,7 +1816,7 @@ pub trait ImmutableCopyableVector<T> {
 }
 
 /// Extension methods for vectors
-impl<T: Copy> ImmutableCopyableVector<T> for &[T] {
+impl<T:Copy> ImmutableCopyableVector<T> for &[T] {
     /**
      * Construct a new vector from the elements of a vector for which some
      * predicate holds.
@@ -1949,13 +1949,13 @@ impl<T> Mutable for ~[T] {
     fn clear(&mut self) { self.truncate(0) }
 }
 
-pub trait OwnedCopyableVector<T: Copy> {
+pub trait OwnedCopyableVector<T:Copy> {
     fn push_all(&mut self, rhs: &[const T]);
     fn grow(&mut self, n: uint, initval: &T);
     fn grow_set(&mut self, index: uint, initval: &T, val: T);
 }
 
-impl<T: Copy> OwnedCopyableVector<T> for ~[T] {
+impl<T:Copy> OwnedCopyableVector<T> for ~[T] {
     #[inline]
     fn push_all(&mut self, rhs: &[const T]) {
         push_all(self, rhs);
@@ -1972,11 +1972,11 @@ fn grow_set(&mut self, index: uint, initval: &T, val: T) {
     }
 }
 
-trait OwnedEqVector<T: Eq> {
+trait OwnedEqVector<T:Eq> {
     fn dedup(&mut self);
 }
 
-impl<T: Eq> OwnedEqVector<T> for ~[T] {
+impl<T:Eq> OwnedEqVector<T> for ~[T] {
     #[inline]
     fn dedup(&mut self) {
         dedup(self)
@@ -2086,7 +2086,7 @@ pub unsafe fn buf_as_slice<T,U>(p: *T,
      * Unchecked vector indexing.
      */
     #[inline(always)]
-    pub unsafe fn get<T: Copy>(v: &[const T], i: uint) -> T {
+    pub unsafe fn get<T:Copy>(v: &[const T], i: uint) -> T {
         as_const_buf(v, |p, _len| *ptr::const_offset(p, i))
     }
 
@@ -2324,24 +2324,24 @@ impl<A> iter::ExtendedIter<A> for @[A] {
     }
 }
 
-impl<A: Eq> iter::EqIter<A> for &[A] {
+impl<A:Eq> iter::EqIter<A> for &[A] {
     pub pure fn contains(&self, x: &A) -> bool { iter::contains(self, x) }
     pub pure fn count(&self, x: &A) -> uint { iter::count(self, x) }
 }
 
 // FIXME(#4148): This should be redundant
-impl<A: Eq> iter::EqIter<A> for ~[A] {
+impl<A:Eq> iter::EqIter<A> for ~[A] {
     pub pure fn contains(&self, x: &A) -> bool { iter::contains(self, x) }
     pub pure fn count(&self, x: &A) -> uint { iter::count(self, x) }
 }
 
 // FIXME(#4148): This should be redundant
-impl<A: Eq> iter::EqIter<A> for @[A] {
+impl<A:Eq> iter::EqIter<A> for @[A] {
     pub pure fn contains(&self, x: &A) -> bool { iter::contains(self, x) }
     pub pure fn count(&self, x: &A) -> uint { iter::count(self, x) }
 }
 
-impl<A: Copy> iter::CopyableIter<A> for &[A] {
+impl<A:Copy> iter::CopyableIter<A> for &[A] {
     pure fn filter_to_vec(&self, pred: fn(&A) -> bool) -> ~[A] {
         iter::filter_to_vec(self, pred)
     }
@@ -2352,7 +2352,7 @@ impl<A: Copy> iter::CopyableIter<A> for &[A] {
 }
 
 // FIXME(#4148): This should be redundant
-impl<A: Copy> iter::CopyableIter<A> for ~[A] {
+impl<A:Copy> iter::CopyableIter<A> for ~[A] {
     pure fn filter_to_vec(&self, pred: fn(&A) -> bool) -> ~[A] {
         iter::filter_to_vec(self, pred)
     }
@@ -2363,7 +2363,7 @@ impl<A: Copy> iter::CopyableIter<A> for ~[A] {
 }
 
 // FIXME(#4148): This should be redundant
-impl<A: Copy> iter::CopyableIter<A> for @[A] {
+impl<A:Copy> iter::CopyableIter<A> for @[A] {
     pure fn filter_to_vec(&self, pred: fn(&A) -> bool) -> ~[A] {
         iter::filter_to_vec(self, pred)
     }
@@ -2373,19 +2373,19 @@ impl<A: Copy> iter::CopyableIter<A> for @[A] {
     }
 }
 
-impl<A: Copy Ord> iter::CopyableOrderedIter<A> for &[A] {
+impl<A:Copy + Ord> iter::CopyableOrderedIter<A> for &[A] {
     pure fn min(&self) -> A { iter::min(self) }
     pure fn max(&self) -> A { iter::max(self) }
 }
 
 // FIXME(#4148): This should be redundant
-impl<A: Copy Ord> iter::CopyableOrderedIter<A> for ~[A] {
+impl<A:Copy + Ord> iter::CopyableOrderedIter<A> for ~[A] {
     pure fn min(&self) -> A { iter::min(self) }
     pure fn max(&self) -> A { iter::max(self) }
 }
 
 // FIXME(#4148): This should be redundant
-impl<A: Copy Ord> iter::CopyableOrderedIter<A> for @[A] {
+impl<A:Copy + Ord> iter::CopyableOrderedIter<A> for @[A] {
     pure fn min(&self) -> A { iter::min(self) }
     pure fn max(&self) -> A { iter::max(self) }
 }
index a64700494c8975c7070242d0253674596f755033..7288b6d261d2c605686f38bd0f3ffb0d3727203a 100644 (file)
@@ -18,7 +18,7 @@ fn under(r : rand::rng, n : uint) -> uint {
 }
 
 // random choice from a vec
-fn choice<T: copy>(r : rand::rng, v : ~[const T]) -> T {
+fn choice<T:copy>(r : rand::rng, v : ~[const T]) -> T {
     assert vec::len(v) != 0u; v[under(r, vec::len(v))]
 }
 
index eadc706fe13b27eceddf30086286af00de6551c9..25dc14c3d788881832833f1ae9c8183e0c0d9425 100644 (file)
 use vec::slice;
 use vec::len;
 
-fn vec_omit<T: copy>(v: ~[T], i: uint) -> ~[T] {
+fn vec_omit<T:copy>(v: ~[T], i: uint) -> ~[T] {
     slice(v, 0u, i) + slice(v, i + 1u, len(v))
 }
-fn vec_dup<T: copy>(v: ~[T], i: uint) -> ~[T] {
+fn vec_dup<T:copy>(v: ~[T], i: uint) -> ~[T] {
     slice(v, 0u, i) + [v[i]] + slice(v, i, len(v))
 }
-fn vec_swadj<T: copy>(v: ~[T], i: uint) -> ~[T] {
+fn vec_swadj<T:copy>(v: ~[T], i: uint) -> ~[T] {
     slice(v, 0u, i) + [v[i + 1u], v[i]] + slice(v, i + 2u, len(v))
 }
-fn vec_prefix<T: copy>(v: ~[T], i: uint) -> ~[T] { slice(v, 0u, i) }
-fn vec_suffix<T: copy>(v: ~[T], i: uint) -> ~[T] { slice(v, i, len(v)) }
+fn vec_prefix<T:copy>(v: ~[T], i: uint) -> ~[T] { slice(v, 0u, i) }
+fn vec_suffix<T:copy>(v: ~[T], i: uint) -> ~[T] { slice(v, i, len(v)) }
 
-fn vec_poke<T: copy>(v: ~[T], i: uint, x: T) -> ~[T] {
+fn vec_poke<T:copy>(v: ~[T], i: uint, x: T) -> ~[T] {
     slice(v, 0u, i) + ~[x] + slice(v, i + 1u, len(v))
 }
-fn vec_insert<T: copy>(v: ~[T], i: uint, x: T) -> ~[T] {
+fn vec_insert<T:copy>(v: ~[T], i: uint, x: T) -> ~[T] {
     slice(v, 0u, i) + ~[x] + slice(v, i, len(v))
 }
 
@@ -59,7 +59,7 @@ fn ix(skip_low: uint, skip_high: uint, length: uint, it: block(uint)) {
 
 // Returns a bunch of modified versions of v, some of which introduce
 // new elements (borrowed from xs).
-fn vec_edits<T: copy>(v: ~[T], xs: ~[T]) -> ~[~[T]] {
+fn vec_edits<T:copy>(v: ~[T], xs: ~[T]) -> ~[~[T]] {
     let edits: ~[~[T]] = ~[];
     let Lv: uint = len(v);
 
index cb074eecd6db4ba0687cd0fa3df1321e60c11716..507d0666da0297a0d77ad6a3a4fd68ff081f8dbf 100644 (file)
@@ -17,7 +17,7 @@ fn under(r : rand::rng, n : uint) -> uint {
 }
 
 // random choice from a vec
-fn choice<T: copy>(r : rand::rng, v : ~[T]) -> T {
+fn choice<T:copy>(r : rand::rng, v : ~[T]) -> T {
     assert vec::len(v) != 0u; v[under(r, vec::len(v))]
 }
 
@@ -35,7 +35,7 @@ fn shuffle<T>(r : rand::rng, &v : ~[T]) {
 }
 
 // create a shuffled copy of a vec
-fn shuffled<T: copy>(r : rand::rng, v : ~[T]) -> ~[T] {
+fn shuffled<T:copy>(r : rand::rng, v : ~[T]) -> ~[T] {
     let w = vec::to_mut(v);
     shuffle(r, w);
     vec::from_mut(w) // Shouldn't this happen automatically?
@@ -48,7 +48,7 @@ fn shuffled<T: copy>(r : rand::rng, v : ~[T]) -> ~[T] {
 // * weighted_choice is O(number of choices) time
 // * weighted_vec is O(total weight) space
 type weighted<T> = { weight: uint, item: T };
-fn weighted_choice<T: copy>(r : rand::rng, v : ~[weighted<T>]) -> T {
+fn weighted_choice<T:copy>(r : rand::rng, v : ~[weighted<T>]) -> T {
     assert vec::len(v) != 0u;
     let total = 0u;
     for {weight: weight, item: _} in v {
@@ -66,7 +66,7 @@ fn weighted_choice<T: copy>(r : rand::rng, v : ~[weighted<T>]) -> T {
     core::unreachable();
 }
 
-fn weighted_vec<T: copy>(v : ~[weighted<T>]) -> ~[T] {
+fn weighted_vec<T:copy>(v : ~[weighted<T>]) -> ~[T] {
     let r = ~[];
     for {weight: weight, item: item} in v {
         let i = 0u;
index b91cc86eb26303230b80d98acb3e8da19686aaf7..c783e1d616132e8acb004dfb33e4c3679664aaf1 100644 (file)
@@ -294,7 +294,7 @@ pub fn basic_options() -> @options {
 }
 
 // Seems out of place, but it uses session, so I'm putting it here
-pub fn expect<T: Copy>(sess: Session,
+pub fn expect<T:Copy>(sess: Session,
                        opt: Option<T>,
                        msg: fn() -> ~str)
                     -> T {
index 281d1ea7305926ce96ad5f885cf1914f6ae57622..51b25854bc751ee5cf46eba55eaaf1120b85daae 100644 (file)
@@ -37,7 +37,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) -> codemap::spanned<T> {
+    fn spanned<T:Copy>(x: T) -> codemap::spanned<T> {
         codemap::spanned { node: x, span: dummy_sp() }
     }
 
index 1d396983f4e90f58b2dd0dead38cd7a6c04eb8bb..757c6233ba44419c1048f89b0a36891ca4efdcf7 100644 (file)
@@ -335,7 +335,7 @@ pub fn main() {
     return @item;
 }
 
-fn nospan<T: Copy>(t: T) -> codemap::spanned<T> {
+fn nospan<T:Copy>(t: T) -> codemap::spanned<T> {
     codemap::spanned { node: t, span: dummy_sp() }
 }
 
index 5343b832de503d3fd0ce52f69a62a28a396423f7..86b07abffc2e995c9309fd1be9e9060caaa3a4d3 100644 (file)
@@ -969,7 +969,7 @@ fn encode_info_for_items(ecx: @EncodeContext, ebml_w: writer::Encoder,
 
 // Path and definition ID indexing
 
-fn create_index<T: Copy Hash IterBytes>(index: ~[entry<T>]) ->
+fn create_index<T:Copy + Hash + IterBytes>(index: ~[entry<T>]) ->
    ~[@~[entry<T>]] {
     let mut buckets: ~[@mut ~[entry<T>]] = ~[];
     for uint::range(0u, 256u) |_i| { buckets.push(@mut ~[]); };
index 664a5e861af72558a0bfaf65d12d444f6741b37a..2175d0f074c60da596c0d85c7a568595345198a4 100644 (file)
@@ -78,7 +78,7 @@ fn get_target_lib_file_path(file: &Path) -> Path {
     } as FileSearch
 }
 
-pub fn search<T: Copy>(filesearch: FileSearch, pick: pick<T>) -> Option<T> {
+pub 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 9440c951be5e910d2c03e32c03c4671d3febe432..71de59391edba3ee7c577e422295e422c469b833 100644 (file)
@@ -248,7 +248,7 @@ trait def_id_encoder_helpers {
     fn emit_def_id(did: ast::def_id);
 }
 
-impl<S: serialize::Encoder> def_id_encoder_helpers for S {
+impl<S:serialize::Encoder> def_id_encoder_helpers for S {
     fn emit_def_id(did: ast::def_id) {
         did.encode(&self)
     }
@@ -258,7 +258,7 @@ trait def_id_decoder_helpers {
     fn read_def_id(xcx: @ExtendedDecodeContext) -> ast::def_id;
 }
 
-impl<D: serialize::Decoder> def_id_decoder_helpers for D {
+impl<D:serialize::Decoder> def_id_decoder_helpers for D {
 
     fn read_def_id(xcx: @ExtendedDecodeContext) -> ast::def_id {
         let did: ast::def_id = Decodable::decode(&self);
@@ -1276,14 +1276,14 @@ fn foo(x: uint, y: uint) -> uint {
 fn test_simplification() {
     let ext_cx = mk_ctxt();
     let item_in = ast::ii_item(quote_item!(
-        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: ~[]};
         }
     ).get());
     let item_out = simplify_ast(item_in);
     let item_exp = ast::ii_item(quote_item!(
-        fn new_int_alist<B: Copy>() -> alist<int, B> {
+        fn new_int_alist<B:Copy>() -> alist<int, B> {
             return {eq_fn: eq_int, data: ~[]};
         }
     ).get());
index 2c72544845728d1b49d2c75fdf4bbc254c228911..568bc5b5e70f60c167b1b2a918aabe1969d8b6e1 100644 (file)
@@ -491,7 +491,7 @@ fn cat_def(&self,
         cat_def(self.tcx, self.method_map, id, span, ty, def)
     }
 
-    fn cat_variant<N: ast_node>(&self,
+    fn cat_variant<N:ast_node>(&self,
                                 arg: N,
                                 enum_did: ast::def_id,
                                 cmt: cmt) -> cmt {
index 61eff69d979e0464ea71124e9b04103b08a1dd47..a88f478dd4b7e4a7f416d34c013e16b9f5c1a359 100644 (file)
@@ -526,7 +526,7 @@ fn check_item_while_true(cx: ty::ctxt, it: @ast::item) {
 }
 
 fn check_item_type_limits(cx: ty::ctxt, it: @ast::item) {
-    pure fn is_valid<T: cmp::Ord>(binop: ast::binop, v: T,
+    pure fn is_valid<T:cmp::Ord>(binop: ast::binop, v: T,
             min: T, max: T) -> bool {
         match binop {
             ast::lt => v <= max,
index 1c48df115e544dd4af6f8b3218fafb239217846f..0621beb43a3d5a8f17fc9e41f01b8ac40d06308f 100644 (file)
@@ -263,7 +263,7 @@ pub fn cat_def(
     return mcx.cat_def(expr_id, expr_span, expr_ty, def);
 }
 
-pub fn cat_variant<N: ast_node>(
+pub fn cat_variant<N:ast_node>(
     tcx: ty::ctxt,
     method_map: typeck::method_map,
     arg: N,
@@ -292,11 +292,11 @@ fn span() -> span { self.span }
 }
 
 pub trait get_type_for_node {
-    fn ty<N: ast_node>(node: N) -> ty::t;
+    fn ty<N:ast_node>(node: N) -> ty::t;
 }
 
 pub impl get_type_for_node for ty::ctxt {
-    fn ty<N: ast_node>(node: N) -> ty::t {
+    fn ty<N:ast_node>(node: N) -> ty::t {
         ty::node_id_to_type(self, node.id())
     }
 }
@@ -575,7 +575,7 @@ fn cat_def(&self,
         }
     }
 
-    fn cat_variant<N: ast_node>(&self,
+    fn cat_variant<N:ast_node>(&self,
                                 arg: N,
                                 enum_did: ast::def_id,
                                 cmt: cmt) -> cmt {
@@ -589,7 +589,7 @@ fn cat_variant<N: ast_node>(&self,
         }
     }
 
-    fn cat_rvalue<N: ast_node>(&self, elt: N, expr_ty: ty::t) -> cmt {
+    fn cat_rvalue<N:ast_node>(&self, elt: N, expr_ty: ty::t) -> cmt {
         @cmt_ {
             id:elt.id(),
             span:elt.span(),
@@ -739,7 +739,7 @@ fn cat_deref_common<N:ast_node>(&self,
         }
     }
 
-    fn cat_index<N: ast_node>(&self,
+    fn cat_index<N:ast_node>(&self,
                               elt: N,
                               base_cmt: cmt) -> cmt {
         let mt = match ty::index(self.tcx, base_cmt.ty) {
@@ -792,7 +792,7 @@ fn cat_index<N: ast_node>(&self,
           }
         };
 
-        fn comp<N: ast_node>(elt: N, of_cmt: cmt,
+        fn comp<N:ast_node>(elt: N, of_cmt: cmt,
                              vect: ty::t, mutbl: MutabilityCategory,
                              mt: ty::mt) -> cmt
         {
@@ -809,7 +809,7 @@ fn comp<N: ast_node>(elt: N, of_cmt: cmt,
         }
     }
 
-    fn cat_tuple_elt<N: ast_node>(&self,
+    fn cat_tuple_elt<N:ast_node>(&self,
                                   elt: N,
                                   cmt: cmt) -> cmt {
         @cmt_ {
@@ -822,7 +822,7 @@ fn cat_tuple_elt<N: ast_node>(&self,
         }
     }
 
-    fn cat_anon_struct_field<N: ast_node>(&self,
+    fn cat_anon_struct_field<N:ast_node>(&self,
                                           elt: N,
                                           cmt: cmt) -> cmt {
         @cmt_ {
index 641c3e6b0a38d193d20df664ba71923e23d92a2d..606f7ce7259399eb031a61485d588c1d807c0033 100644 (file)
@@ -170,7 +170,7 @@ enum debug_metadata {
     retval_metadata(@Metadata<RetvalMetadata>),
 }
 
-fn cast_safely<T: Copy, U>(val: T) -> U {
+fn cast_safely<T:Copy,U>(val: T) -> U {
     unsafe {
         let val2 = val;
         return cast::transmute(val2);
@@ -192,7 +192,7 @@ fn md_from_metadata<T>(val: debug_metadata) -> T {
     }
 }
 
-fn cached_metadata<T: Copy>(cache: metadata_cache,
+fn cached_metadata<T:Copy>(cache: metadata_cache,
                             mdtag: int,
                             eq_fn: fn(md: T) -> bool)
                          -> Option<T> {
index 96107c141bec7e4c4dd3d24571a6278e9c266f32..413ec9fcdf389d9b3bc2d6505b7d4f636b8a0a01 100644 (file)
@@ -775,7 +775,7 @@ fn mk_rcache() -> creader_cache {
     return oldmap::HashMap();
 }
 
-pub fn new_ty_hash<V: Copy>() -> oldmap::HashMap<t, V> {
+pub fn new_ty_hash<V:Copy>() -> oldmap::HashMap<t, V> {
     oldmap::HashMap()
 }
 
@@ -3326,7 +3326,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 cmp::Eq>(tbl: HashMap<ast::node_id, ast::inferable<T>>,
+fn canon<T:Copy cmp::Eq>(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 c04141b25968170f54d6c2f8b83f09dfb6d92577..9269752b8ecf412a0f70a41039037ef4671f6204 100644 (file)
@@ -94,7 +94,7 @@ pub fn get_region_reporting_err(tcx: ty::ctxt,
     }
 }
 
-pub fn ast_region_to_region<AC: AstConv, RS: region_scope Copy Durable>(
+pub fn ast_region_to_region<AC:AstConv,RS:region_scope + Copy + Durable>(
         self: @mut AC,
         rscope: RS,
         span: span,
@@ -110,7 +110,7 @@ pub fn ast_region_to_region<AC: AstConv, RS: region_scope Copy Durable>(
     get_region_reporting_err(self.tcx(), span, res)
 }
 
-pub fn ast_path_to_substs_and_ty<AC: AstConv, RS: region_scope Copy Durable>(
+pub fn ast_path_to_substs_and_ty<AC:AstConv,RS:region_scope + Copy + Durable>(
         self: @mut AC,
         rscope: RS,
         did: ast::def_id,
@@ -166,7 +166,7 @@ pub fn ast_path_to_substs_and_ty<AC: AstConv, RS: region_scope Copy Durable>(
     ty_param_substs_and_ty { substs: substs, ty: ty }
 }
 
-pub fn ast_path_to_ty<AC: AstConv, RS: region_scope Copy Durable>(
+pub fn ast_path_to_ty<AC:AstConv,RS:region_scope + Copy + Durable>(
         self: @mut AC,
         rscope: RS,
         did: ast::def_id,
@@ -192,10 +192,10 @@ pub fn ast_path_to_ty<AC: AstConv, RS: region_scope Copy Durable>(
 // 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:
-pub fn ast_ty_to_ty<AC: AstConv, RS: region_scope Copy Durable>(
+pub fn ast_ty_to_ty<AC:AstConv,RS:region_scope + Copy + Durable>(
     self: @mut AC, rscope: RS, &&ast_ty: @ast::Ty) -> ty::t {
 
-    fn ast_mt_to_mt<AC: AstConv, RS: region_scope Copy Durable>(
+    fn ast_mt_to_mt<AC:AstConv,RS:region_scope + Copy + Durable>(
         self: @mut AC, rscope: RS, mt: ast::mt) -> ty::mt {
 
         ty::mt {ty: ast_ty_to_ty(self, rscope, mt.ty), mutbl: mt.mutbl}
@@ -204,7 +204,7 @@ fn ast_mt_to_mt<AC: AstConv, RS: region_scope Copy Durable>(
     // 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_pointer<AC: AstConv, RS: region_scope Copy Durable>(
+    fn mk_pointer<AC:AstConv,RS:region_scope + Copy + Durable>(
         self: @mut AC,
         rscope: RS,
         a_seq_ty: ast::mt,
@@ -420,7 +420,7 @@ fn check_path_args(tcx: ty::ctxt,
     return typ;
 }
 
-pub fn ty_of_arg<AC: AstConv, RS: region_scope Copy Durable>(
+pub fn ty_of_arg<AC:AstConv,RS:region_scope + Copy + Durable>(
         self: @mut AC,
         rscope: RS,
         a: ast::arg,
@@ -468,7 +468,7 @@ pub fn ty_of_arg<AC: AstConv, RS: region_scope Copy Durable>(
     arg {mode: mode, ty: ty}
 }
 
-pub fn ty_of_bare_fn<AC: AstConv, RS: region_scope Copy Durable>(
+pub fn ty_of_bare_fn<AC:AstConv,RS:region_scope + Copy + Durable>(
         self: @mut AC,
         rscope: RS,
         purity: ast::purity,
@@ -494,7 +494,7 @@ pub fn ty_of_bare_fn<AC: AstConv, RS: region_scope Copy Durable>(
     }
 }
 
-pub fn ty_of_closure<AC: AstConv, RS: region_scope Copy Durable>(
+pub fn ty_of_closure<AC:AstConv,RS:region_scope + Copy + Durable>(
         self: @mut AC,
         rscope: RS,
         sigil: ast::Sigil,
index 16846f6c2d01b763800b7ad8a78d9dadfb28ff2e..3553caf5c33f79add29b217c1d7fb0a371eb0bcf 100644 (file)
@@ -1590,7 +1590,7 @@ fn check_user_unop(fcx: @mut FnCtxt,
     // 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: @mut FnCtxt,
+    fn unpack_expected<O:Copy>(fcx: @mut FnCtxt,
                                 expected: Option<ty::t>,
                                 unpack: fn(&ty::sty) -> Option<O>)
                              -> Option<O> {
index 3f2b5ea56b1005ef29a84ebe74eb3a00d2833ef7..96c76b52181c13732d385870a9156d95dc528ebf 100644 (file)
@@ -115,7 +115,7 @@ pub fn collect_item_types(ccx: @mut CrateCtxt, crate: @ast::crate) {
 }
 
 pub impl @mut CrateCtxt {
-    fn to_ty<RS: region_scope Copy Durable>(rs: RS, ast_ty: @ast::Ty)
+    fn to_ty<RS:region_scope + Copy + Durable>(rs: RS, ast_ty: @ast::Ty)
                                          -> ty::t {
         ast_ty_to_ty(self, rs, ast_ty)
     }
index 89719564adaa61d8343ea5088252afd66cba355c..34068a5eb0d431eabbe83d529a677d04d69e9b84 100644 (file)
@@ -290,7 +290,7 @@ pub fn super_self_tys<C:Combine>(
     }
 }
 
-pub fn super_sigils<C: Combine>(
+pub fn super_sigils<C:Combine>(
     self: &C, p1: ast::Sigil, p2: ast::Sigil) -> cres<ast::Sigil> {
     if p1 == p2 {
         Ok(p1)
index 0d342e338ec23753ddd0cbf23d8c62aa4b3e3ef5..3998967dc984246a1d52be1f72cd436a035d7d7a 100644 (file)
@@ -173,7 +173,7 @@ fn t_sub_var<T:Copy InferStr LatticeValue,
             b_id, a_bounds, b_bounds, node_b.rank)
     }
 
-    fn merge_bnd<T:Copy InferStr LatticeValue>(
+    fn merge_bnd<T:Copy + InferStr + LatticeValue>(
         &self,
         a: &Bound<T>,
         b: &Bound<T>,
@@ -263,7 +263,7 @@ fn set_var_to_merged_bounds<T:Copy InferStr LatticeValue,
         uok()
     }
 
-    fn bnds<T:Copy InferStr LatticeValue>(
+    fn bnds<T:Copy + InferStr + LatticeValue>(
         &self,
         a: &Bound<T>,
         b: &Bound<T>) -> ures
@@ -329,7 +329,7 @@ fn ty_bot(_t: ty::t) -> cres<ty::t> {
     }
 }
 
-pub fn super_lattice_tys<L:LatticeDir TyLatticeDir Combine>(
+pub fn super_lattice_tys<L:LatticeDir + TyLatticeDir + Combine>(
     self: &L,
     a: ty::t,
     b: ty::t) -> cres<ty::t> {
@@ -485,7 +485,7 @@ pub fn lattice_var_and_t<L:LatticeDir Combine,
 // Random utility functions used by LUB/GLB when computing LUB/GLB of
 // fn types
 
-pub fn var_ids<T: Combine>(self: &T, isr: isr_alist) -> ~[RegionVid] {
+pub fn var_ids<T:Combine>(self: &T, isr: isr_alist) -> ~[RegionVid] {
     let mut result = ~[];
     for list::each(isr) |pair| {
         match pair.second() {
index 4c6fb721956eb83fb592004b3c13c968083d48a3..7d799b7ea2fb6c6de5bf774d2efdf69b0010496d 100644 (file)
@@ -351,7 +351,7 @@ pub fn fixup_err_to_str(f: fixup_err) -> ~str {
     }
 }
 
-fn new_ValsAndBindings<V:Copy, T:Copy>() -> ValsAndBindings<V, T> {
+fn new_ValsAndBindings<V:Copy,T:Copy>() -> ValsAndBindings<V, T> {
     ValsAndBindings {
         vals: oldsmallintmap::mk(),
         bindings: ~[]
@@ -517,7 +517,7 @@ trait CresCompare<T> {
     fn compare(t: T, f: fn() -> ty::type_err) -> cres<T>;
 }
 
-impl<T:Copy Eq> CresCompare<T> for cres<T> {
+impl<T:Copy Eq> CresCompare<T> for cres<T> {
     fn compare(t: T, f: fn() -> ty::type_err) -> cres<T> {
         do self.chain |s| {
             if s == t {
@@ -533,7 +533,7 @@ pub fn uok() -> ures {
     Ok(())
 }
 
-fn rollback_to<V:Copy Vid, T:Copy>(
+fn rollback_to<V:Copy + Vid,T:Copy>(
     vb: &mut ValsAndBindings<V, T>,
     len: uint)
 {
@@ -632,7 +632,7 @@ fn probe<T,E>(f: fn() -> Result<T,E>) -> Result<T,E> {
     }
 }
 
-fn next_simple_var<V: Copy,T: Copy>(
+fn next_simple_var<V:Copy,T:Copy>(
         +counter: &mut uint,
         +bindings: &mut ValsAndBindings<V,Option<T>>)
      -> uint {
index 89de219f7f638da21640f3ccf2f5b53a33794c34..0013b417f7a31d66130a14bfe6a2b7f79fb70a1d 100644 (file)
@@ -71,7 +71,7 @@ fn inf_str(&self, cx: &InferCtxt) -> ~str {
     }
 }
 
-pub impl<V:Vid ToStr, T:InferStr> InferStr for VarValue<V, T> {
+pub impl<V:Vid + ToStr,T:InferStr> InferStr for VarValue<V, T> {
     fn inf_str(&self, cx: &InferCtxt) -> ~str {
         match *self {
           Redirect(ref vid) => fmt!("Redirect(%s)", vid.to_str()),
index b2aac9192f3058b5182ec2cd1831a14575afaff2..6abf2e5709b1c7dc38d353cb4d46daeb34e02ed9 100644 (file)
@@ -89,7 +89,7 @@ fn helper<T:Copy, V:Copy+Eq+Vid>(
         }
     }
 
-    fn set<T:Copy InferStr, V:Copy Vid ToStr UnifyVid<T>>(
+    fn set<T:Copy + InferStr,V:Copy + Vid + ToStr + UnifyVid<T>>(
             &mut self,
             +vid: V,
             +new_v: VarValue<V, T>) {
@@ -109,7 +109,7 @@ fn set<T:Copy InferStr, V:Copy Vid ToStr UnifyVid<T>>(
         }
     }
 
-    fn unify<T:Copy InferStr, V:Copy Vid ToStr UnifyVid<T>>(
+    fn unify<T:Copy + InferStr,V:Copy + Vid + ToStr + UnifyVid<T>>(
         &mut self,
         node_a: &Node<V, T>,
         node_b: &Node<V, T>) -> (V, uint)
@@ -150,7 +150,7 @@ pub trait SimplyUnifiable {
     static fn to_type_err(expected_found<Self>) -> ty::type_err;
 }
 
-pub fn mk_err<T: SimplyUnifiable>(+a_is_expected: bool,
+pub fn mk_err<T:SimplyUnifiable>(+a_is_expected: bool,
                                   +a_t: T,
                                   +b_t: T) -> ures {
     if a_is_expected {
index 1fe8b9b51a0c3913f8ae8467dad7951a54cde3d6..05820bed0d036edd6dad3a6d02bc3f3237a7030d 100644 (file)
@@ -157,7 +157,7 @@ pub enum vtable_origin {
     vtable_static(ast::def_id, ~[ty::t], vtable_res),
     /*
       Dynamic vtable, comes from a parameter that has a bound on it:
-      fn foo<T: quux, baz, bar>(a: T) -- a's vtable would have a
+      fn foo<T:quux,baz,bar>(a: T) -- a's vtable would have a
       vtable_param origin
 
       The first uint is the param number (identifying T in the example),
index 046c2a025beeef9c3e1b29d26cc5452360e597c1..d5834af3a574adfcc40f15cd8770bb84b0153d1a 100644 (file)
@@ -69,9 +69,10 @@ pub fn bound_self_region(rp: Option<ty::region_variance>)
 }
 
 pub struct anon_rscope { anon: ty::Region, base: region_scope }
-pub fn in_anon_rscope<RS: region_scope Copy Durable>(self: RS, r: ty::Region)
-    -> @anon_rscope {
-    @anon_rscope { anon: r, base: self as region_scope }
+pub fn in_anon_rscope<RS:region_scope + Copy + Durable>(self: RS,
+                                                        r: ty::Region)
+                                                     -> @anon_rscope {
+    @anon_rscope {anon: r, base: self as region_scope}
 }
 pub impl region_scope for @anon_rscope {
     pure fn anon_region(_span: span) -> Result<ty::Region, ~str> {
@@ -91,7 +92,7 @@ pub struct binding_rscope {
     anon_bindings: uint,
 }
 
-pub fn in_binding_rscope<RS: region_scope Copy Durable>(self: RS)
+pub fn in_binding_rscope<RS:region_scope + Copy + Durable>(self: RS)
     -> @mut binding_rscope {
     let base = self as region_scope;
     @mut binding_rscope { base: base, anon_bindings: 0 }
index 113cce422c474259ab4ffb5c057cb2e230a29e3d..d03af547af094c02384f58cd1a1f30c39004856e 100644 (file)
@@ -35,7 +35,7 @@ pub struct Fold<T> {
     fold_struct: FoldStruct<T>
 }
 
-impl<T: Clone> Clone for Fold<T> {
+impl<T:Clone> Clone for Fold<T> {
     fn clone(&self) -> Fold<T> {
         Fold {
             ctxt: self.ctxt.clone(),
@@ -103,7 +103,7 @@ fn mk_fold<T>(
     }
 }
 
-pub fn default_any_fold<T: Clone>(ctxt: T) -> Fold<T> {
+pub fn default_any_fold<T:Clone>(ctxt: T) -> Fold<T> {
     mk_fold(
         ctxt,
         |f, d| default_seq_fold_doc(f, d),
@@ -121,7 +121,7 @@ pub fn default_any_fold<T: Clone>(ctxt: T) -> Fold<T> {
     )
 }
 
-pub fn default_seq_fold<T: Clone>(ctxt: T) -> Fold<T> {
+pub fn default_seq_fold<T:Clone>(ctxt: T) -> Fold<T> {
     mk_fold(
         ctxt,
         |f, d| default_seq_fold_doc(f, d),
@@ -139,7 +139,7 @@ pub fn default_seq_fold<T: Clone>(ctxt: T) -> Fold<T> {
     )
 }
 
-pub fn default_par_fold<T: Clone>(ctxt: T) -> Fold<T> {
+pub fn default_par_fold<T:Clone>(ctxt: T) -> Fold<T> {
     mk_fold(
         ctxt,
         |f, d| default_seq_fold_doc(f, d),
index 3ec9d17c854bec0e4d6e0a5a475d4b43b3c1c6bd..61c02bf684938de032f9a39d6c6e1da53bcf1b3e 100644 (file)
@@ -17,6 +17,6 @@ pub struct NominalOp<T> {
     op: T
 }
 
-impl<T: Copy> Clone for NominalOp<T> {
+impl<T:Copy> Clone for NominalOp<T> {
     fn clone(&self) -> NominalOp<T> { copy *self }
 }
index 66b02ae553c4e7d9eb1d0c3e301094594ba9ace5..50f40559807ab36b71f215097cb58ce11753db9b 100644 (file)
@@ -80,7 +80,7 @@ fn broadcast_on(condvar_id: uint) -> uint {
 struct ARC<T> { x: SharedMutableState<T> }
 
 /// Create an atomically reference counted wrapper.
-pub fn ARC<T: Const Owned>(data: T) -> ARC<T> {
+pub fn ARC<T:Const + Owned>(data: T) -> ARC<T> {
     ARC { x: unsafe { shared_mutable_state(data) } }
 }
 
@@ -88,7 +88,7 @@ pub fn ARC<T: Const Owned>(data: T) -> ARC<T> {
  * Access the underlying data in an atomically reference counted
  * wrapper.
  */
-pub fn get<T: Const Owned>(rc: &a/ARC<T>) -> &a/T {
+pub fn get<T:Const + Owned>(rc: &a/ARC<T>) -> &a/T {
     unsafe { get_shared_immutable_state(&rc.x) }
 }
 
@@ -99,7 +99,7 @@ pub fn get<T: Const Owned>(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.
  */
-pub fn clone<T: Const Owned>(rc: &ARC<T>) -> ARC<T> {
+pub fn clone<T:Const + Owned>(rc: &ARC<T>) -> ARC<T> {
     ARC { x: unsafe { clone_shared_mutable_state(&rc.x) } }
 }
 
@@ -112,12 +112,12 @@ pub fn clone<T: Const Owned>(rc: &ARC<T>) -> ARC<T> {
  * unwrap from a task that holds another reference to the same ARC; it is
  * guaranteed to deadlock.
  */
-pub fn unwrap<T: Const Owned>(rc: ARC<T>) -> T {
+pub fn unwrap<T:Const + Owned>(rc: ARC<T>) -> T {
     let ARC { x: x } = rc;
     unsafe { unwrap_shared_mutable_state(x) }
 }
 
-impl<T: Const Owned> Clone for ARC<T> {
+impl<T:Const + Owned> Clone for ARC<T> {
     fn clone(&self) -> ARC<T> {
         clone(self)
     }
@@ -133,14 +133,14 @@ struct MutexARCInner<T> { lock: Mutex, failed: bool, data: T }
 struct MutexARC<T> { x: SharedMutableState<MutexARCInner<T>> }
 
 /// Create a mutex-protected ARC with the supplied data.
-pub fn MutexARC<T: Owned>(user_data: T) -> MutexARC<T> {
+pub fn MutexARC<T:Owned>(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).
  */
-pub fn mutex_arc_with_condvars<T: Owned>(user_data: T,
+pub fn mutex_arc_with_condvars<T:Owned>(user_data: T,
                                     num_condvars: uint) -> MutexARC<T> {
     let data =
         MutexARCInner { lock: mutex_with_condvars(num_condvars),
@@ -148,7 +148,7 @@ pub fn mutex_arc_with_condvars<T: Owned>(user_data: T,
     MutexARC { x: unsafe { shared_mutable_state(data) } }
 }
 
-impl<T: Owned> Clone for MutexARC<T> {
+impl<T:Owned> Clone for MutexARC<T> {
     /// Duplicate a mutex-protected ARC, as arc::clone.
     fn clone(&self) -> MutexARC<T> {
         // NB: Cloning the underlying mutex is not necessary. Its reference
@@ -157,7 +157,7 @@ fn clone(&self) -> MutexARC<T> {
     }
 }
 
-impl<T: Owned> &MutexARC<T> {
+impl<T:Owned> &MutexARC<T> {
 
     /**
      * Access the underlying mutable data with mutual exclusion from other
@@ -219,7 +219,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(#3724) make this a by-move method on the arc
-pub fn unwrap_mutex_arc<T: Owned>(arc: MutexARC<T>) -> T {
+pub fn unwrap_mutex_arc<T:Owned>(arc: MutexARC<T>) -> T {
     let MutexARC { x: x } = arc;
     let inner = unsafe { unwrap_shared_mutable_state(x) };
     let MutexARCInner { failed: failed, data: data, _ } = inner;
@@ -283,14 +283,14 @@ struct RWARC<T> {
 }
 
 /// Create a reader/writer ARC with the supplied data.
-pub fn RWARC<T: Const Owned>(user_data: T) -> RWARC<T> {
+pub fn RWARC<T:Const + Owned>(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).
  */
-pub fn rw_arc_with_condvars<T: Const Owned>(
+pub fn rw_arc_with_condvars<T:Const + Owned>(
     user_data: T,
     num_condvars: uint) -> RWARC<T>
 {
@@ -300,7 +300,7 @@ pub fn rw_arc_with_condvars<T: Const Owned>(
     RWARC { x: unsafe { shared_mutable_state(data) }, cant_nest: () }
 }
 
-impl<T: Const Owned> RWARC<T> {
+impl<T:Const + Owned> RWARC<T> {
     /// Duplicate a rwlock-protected ARC, as arc::clone.
     fn clone(&self) -> RWARC<T> {
         RWARC { x: unsafe { clone_shared_mutable_state(&self.x) },
@@ -309,7 +309,7 @@ fn clone(&self) -> RWARC<T> {
 
 }
 
-impl<T: Const Owned> &RWARC<T> {
+impl<T:Const + Owned> &RWARC<T> {
     /**
      * Access the underlying data mutably. Locks the rwlock in write mode;
      * other readers and writers will block.
@@ -418,7 +418,7 @@ fn downgrade(token: RWWriteMode/&a<T>) -> RWReadMode/&a<T> {
  * in write mode.
  */
 // FIXME(#3724) make this a by-move method on the arc
-pub fn unwrap_rw_arc<T: Const Owned>(arc: RWARC<T>) -> T {
+pub fn unwrap_rw_arc<T:Const + Owned>(arc: RWARC<T>) -> T {
     let RWARC { x: x, _ } = arc;
     let inner = unsafe { unwrap_shared_mutable_state(x) };
     let RWARCInner { failed: failed, data: data, _ } = inner;
@@ -432,7 +432,7 @@ pub fn unwrap_rw_arc<T: Const Owned>(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 Owned>(state: *const RWARCInner<T>) -> *RWlock {
+fn borrow_rwlock<T:Const + Owned>(state: *const RWARCInner<T>) -> *RWlock {
     unsafe { cast::transmute(&const (*state).lock) }
 }
 
@@ -444,7 +444,7 @@ pub enum RWWriteMode<T> =
 /// The "read permission" token used for RWARC.write_downgrade().
 pub enum RWReadMode<T> = (&T, sync::RWlockReadMode);
 
-impl<T: Const Owned> &RWWriteMode<T> {
+impl<T:Const + Owned> &RWWriteMode<T> {
     /// Access the pre-downgrade RWARC in write mode.
     fn write<U>(blk: fn(x: &mut T) -> U) -> U {
         match *self {
@@ -474,7 +474,7 @@ fn write_cond<U>(blk: fn(x: &x/mut T, c: &c/Condvar) -> U) -> U {
     }
 }
 
-impl<T: Const Owned> &RWReadMode<T> {
+impl<T:Const + Owned> &RWReadMode<T> {
     /// Access the post-downgrade rwlock in read mode.
     fn read<U>(blk: fn(x: &T) -> U) -> U {
         match *self {
index 696b2753ea44b9d2de30576d2918e32e21115e60..5af596c1f84e41fdfc43bc84c00f8e0bd45e01ae 100644 (file)
@@ -120,7 +120,7 @@ pub 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
  */
-pub fn get<T: Copy>(t: CVec<T>, ofs: uint) -> T {
+pub fn get<T:Copy>(t: CVec<T>, ofs: uint) -> T {
     assert ofs < len(t);
     return unsafe { *ptr::mut_offset(t.base, ofs) };
 }
@@ -130,7 +130,7 @@ pub fn get<T: Copy>(t: CVec<T>, ofs: uint) -> T {
  *
  * Fails if `ofs` is greater or equal to the length of the vector
  */
-pub fn set<T: Copy>(t: CVec<T>, ofs: uint, v: T) {
+pub fn set<T:Copy>(t: CVec<T>, ofs: uint, v: T) {
     assert ofs < len(t);
     unsafe { *ptr::mut_offset(t.base, ofs) = v };
 }
index c2c21002b195da3373a7c4573363a3c4437e48a1..9478a39279673cc21a120d62f2d110d39f90d16d 100644 (file)
@@ -25,19 +25,19 @@ pub struct DuplexStream<T, U> {
     priv port: Port<U>,
 }
 
-impl<T: Owned, U: Owned> GenericChan<T> for DuplexStream<T, U> {
+impl<T:Owned,U:Owned> GenericChan<T> for DuplexStream<T, U> {
     fn send(x: T) {
         self.chan.send(x)
     }
 }
 
-impl<T: Owned, U: Owned> GenericSmartChan<T> for DuplexStream<T, U> {
+impl<T:Owned,U:Owned> GenericSmartChan<T> for DuplexStream<T, U> {
     fn try_send(x: T) -> bool {
         self.chan.try_send(x)
     }
 }
 
-impl<T: Owned, U: Owned> GenericPort<U> for DuplexStream<T, U> {
+impl<T:Owned,U:Owned> GenericPort<U> for DuplexStream<T, U> {
     fn recv() -> U {
         self.port.recv()
     }
@@ -47,20 +47,20 @@ fn try_recv() -> Option<U> {
     }
 }
 
-impl<T: Owned, U: Owned> Peekable<U> for DuplexStream<T, U> {
+impl<T:Owned,U:Owned> Peekable<U> for DuplexStream<T, U> {
     pure fn peek() -> bool {
         self.port.peek()
     }
 }
 
-impl<T: Owned, U: Owned> Selectable for DuplexStream<T, U> {
+impl<T:Owned,U:Owned> Selectable for DuplexStream<T, U> {
     pure fn header() -> *pipes::PacketHeader {
         self.port.header()
     }
 }
 
 /// Creates a bidirectional stream.
-pub fn DuplexStream<T: Owned, U: Owned>()
+pub fn DuplexStream<T:Owned,U:Owned>()
     -> (DuplexStream<T, U>, DuplexStream<U, T>)
 {
     let (p1, c2) = pipes::stream();
index b1285dac9f401b6a9af78eff4ec497c6f7d79f88..0ac76cefd6b36480cb47cbcbfce86e08b3f0f8e0 100644 (file)
@@ -198,7 +198,7 @@ fn test_boxes() {
         assert *deq.get(3) == d;
     }
 
-    fn test_parameterized<T: Copy Eq Durable>(a: T, b: T, c: T, d: T) {
+    fn test_parameterized<T:Copy + Eq + Durable>(a: T, b: T, c: T, d: T) {
         let mut deq = Deque::new();
         assert deq.len() == 0;
         deq.add_front(a);
index cff30587607f522f115530c0e0917a33ceb388d0..f97e5ee6800671777500e18e654fdfe96d5b2a62 100644 (file)
@@ -129,7 +129,7 @@ pub fn writer_chan<T: Encodable<DefaultEncoder>,
     }
 
     /// Create a `FlatPort` from a `Port<~[u8]>`
-    pub fn pipe_port<T: Decodable<DefaultDecoder>>(
+    pub fn pipe_port<T:Decodable<DefaultDecoder>>(
         port: Port<~[u8]>
     ) -> PipePort<T> {
         let unflat: DeserializingUnflattener<DefaultDecoder, T> =
@@ -140,7 +140,7 @@ pub fn pipe_port<T: Decodable<DefaultDecoder>>(
     }
 
     /// Create a `FlatChan` from a `Chan<~[u8]>`
-    pub fn pipe_chan<T: Encodable<DefaultEncoder>>(
+    pub fn pipe_chan<T:Encodable<DefaultEncoder>>(
         chan: Chan<~[u8]>
     ) -> PipeChan<T> {
         let flat: SerializingFlattener<DefaultEncoder, T> =
@@ -189,7 +189,7 @@ pub mod pod {
     pub type PipeChan<T> = FlatChan<T, PodFlattener<T>, PipeByteChan>;
 
     /// Create a `FlatPort` from a `Reader`
-    pub fn reader_port<T: Copy Owned, R: Reader>(
+    pub fn reader_port<T:Copy + Owned,R:Reader>(
         reader: R
     ) -> ReaderPort<T, R> {
         let unflat: PodUnflattener<T> = PodUnflattener::new();
@@ -198,7 +198,7 @@ pub fn reader_port<T: Copy Owned, R: Reader>(
     }
 
     /// Create a `FlatChan` from a `Writer`
-    pub fn writer_chan<T: Copy Owned, W: Writer>(
+    pub fn writer_chan<T:Copy + Owned,W:Writer>(
         writer: W
     ) -> WriterChan<T, W> {
         let flat: PodFlattener<T> = PodFlattener::new();
@@ -207,21 +207,21 @@ pub fn writer_chan<T: Copy Owned, W: Writer>(
     }
 
     /// Create a `FlatPort` from a `Port<~[u8]>`
-    pub fn pipe_port<T: Copy Owned>(port: Port<~[u8]>) -> PipePort<T> {
+    pub fn pipe_port<T:Copy + Owned>(port: Port<~[u8]>) -> PipePort<T> {
         let unflat: PodUnflattener<T> = PodUnflattener::new();
         let byte_port = PipeBytePort::new(port);
         FlatPort::new(unflat, byte_port)
     }
 
     /// Create a `FlatChan` from a `Chan<~[u8]>`
-    pub fn pipe_chan<T: Copy Owned>(chan: Chan<~[u8]>) -> PipeChan<T> {
+    pub fn pipe_chan<T:Copy + Owned>(chan: Chan<~[u8]>) -> PipeChan<T> {
         let flat: PodFlattener<T> = PodFlattener::new();
         let byte_chan = PipeByteChan::new(chan);
         FlatChan::new(flat, byte_chan)
     }
 
     /// Create a pair of `FlatChan` and `FlatPort`, backed by pipes
-    pub fn pipe_stream<T: Copy Owned>() -> (PipePort<T>, PipeChan<T>) {
+    pub fn pipe_stream<T:Copy + Owned>() -> (PipePort<T>, PipeChan<T>) {
         let (port, chan) = pipes::stream();
         return (pipe_port(port), pipe_chan(chan));
     }
@@ -358,7 +358,7 @@ pub struct PodFlattener<T> {
         bogus: ()
     }
 
-    pub impl<T: Copy Owned> Unflattener<T> for PodUnflattener<T> {
+    pub impl<T:Copy + Owned> Unflattener<T> for PodUnflattener<T> {
         fn unflatten(&self, buf: ~[u8]) -> T {
             assert size_of::<T>() != 0;
             assert size_of::<T>() == buf.len();
@@ -368,7 +368,7 @@ fn unflatten(&self, buf: ~[u8]) -> T {
         }
     }
 
-    pub impl<T: Copy Owned> Flattener<T> for PodFlattener<T> {
+    pub impl<T:Copy + Owned> Flattener<T> for PodFlattener<T> {
         fn flatten(&self, val: T) -> ~[u8] {
             assert size_of::<T>() != 0;
             let val: *T = ptr::to_unsafe_ptr(&val);
@@ -377,7 +377,7 @@ fn flatten(&self, val: T) -> ~[u8] {
         }
     }
 
-    pub impl<T: Copy Owned> PodUnflattener<T> {
+    pub impl<T:Copy + Owned> PodUnflattener<T> {
         static fn new() -> PodUnflattener<T> {
             PodUnflattener {
                 bogus: ()
@@ -385,7 +385,7 @@ pub impl<T: Copy Owned> PodUnflattener<T> {
         }
     }
 
-    pub impl<T: Copy Owned> PodFlattener<T> {
+    pub impl<T:Copy + Owned> PodFlattener<T> {
         static fn new() -> PodFlattener<T> {
             PodFlattener {
                 bogus: ()
@@ -406,21 +406,21 @@ pub struct SerializingFlattener<S, T> {
         serialize_value: SerializeValue<T>
     }
 
-    pub impl<D: Decoder, T: Decodable<D>> Unflattener<T>
+    pub impl<D:Decoder,T:Decodable<D>> Unflattener<T>
             for DeserializingUnflattener<D, T> {
         fn unflatten(&self, buf: ~[u8]) -> T {
             (self.deserialize_buffer)(buf)
         }
     }
 
-    pub impl<S: Encoder, T: Encodable<S>> Flattener<T>
+    pub impl<S:Encoder,T:Encodable<S>> Flattener<T>
             for SerializingFlattener<S, T> {
         fn flatten(&self, val: T) -> ~[u8] {
             (self.serialize_value)(&val)
         }
     }
 
-    pub impl<D: Decoder, T: Decodable<D>> DeserializingUnflattener<D, T> {
+    pub impl<D:Decoder,T:Decodable<D>> DeserializingUnflattener<D, T> {
         static fn new(deserialize_buffer: DeserializeBuffer<T>)
                    -> DeserializingUnflattener<D, T> {
             DeserializingUnflattener {
@@ -429,7 +429,7 @@ pub impl<D: Decoder, T: Decodable<D>> DeserializingUnflattener<D, T> {
         }
     }
 
-    pub impl<S: Encoder, T: Encodable<S>> SerializingFlattener<S, T> {
+    pub impl<S:Encoder,T:Encodable<S>> SerializingFlattener<S, T> {
         static fn new(serialize_value: SerializeValue<T>)
                    -> SerializingFlattener<S, T> {
             SerializingFlattener {
@@ -519,7 +519,7 @@ pub struct WriterByteChan<W> {
         writer: W
     }
 
-    pub impl<R: Reader> BytePort for ReaderBytePort<R> {
+    pub impl<R:Reader> BytePort for ReaderBytePort<R> {
         fn try_recv(&self, count: uint) -> Option<~[u8]> {
             let mut left = count;
             let mut bytes = ~[];
@@ -541,13 +541,13 @@ fn try_recv(&self, count: uint) -> Option<~[u8]> {
         }
     }
 
-    pub impl<W: Writer> ByteChan for WriterByteChan<W> {
+    pub impl<W:Writer> ByteChan for WriterByteChan<W> {
         fn send(&self, val: ~[u8]) {
             self.writer.write(val);
         }
     }
 
-    pub impl<R: Reader> ReaderBytePort<R> {
+    pub impl<R:Reader> ReaderBytePort<R> {
         static fn new(r: R) -> ReaderBytePort<R> {
             ReaderBytePort {
                 reader: r
@@ -555,7 +555,7 @@ pub impl<R: Reader> ReaderBytePort<R> {
         }
     }
 
-    pub impl<W: Writer> WriterByteChan<W> {
+    pub impl<W:Writer> WriterByteChan<W> {
         static fn new(w: W) -> WriterByteChan<W> {
             WriterByteChan {
                 writer: w
@@ -765,7 +765,7 @@ fn writer_chan(buf: TcpSocketBuf
     type WriterChanFactory<F> =
         ~fn(TcpSocketBuf) -> FlatChan<int, F, WriterByteChan<TcpSocketBuf>>;
 
-    fn test_some_tcp_stream<U: Unflattener<int>, F: Flattener<int>>(
+    fn test_some_tcp_stream<U:Unflattener<int>,F:Flattener<int>>(
         reader_port: ReaderPortFactory<U>,
         writer_chan: WriterChanFactory<F>,
         port: uint) {
@@ -901,7 +901,7 @@ fn pipe_port_loader(bytes: ~[u8]
             pod::pipe_port(port)
         }
 
-        fn test_try_recv_none1<P: BytePort>(loader: PortLoader<P>) {
+        fn test_try_recv_none1<P:BytePort>(loader: PortLoader<P>) {
             let bytes = ~[];
             let port = loader(bytes);
             let res: Option<int> = port.try_recv();
@@ -917,7 +917,7 @@ fn test_try_recv_none1_pipe() {
             test_try_recv_none1(pipe_port_loader);
         }
 
-        fn test_try_recv_none2<P: BytePort>(loader: PortLoader<P>) {
+        fn test_try_recv_none2<P:BytePort>(loader: PortLoader<P>) {
             // The control word in the protocol is interrupted
             let bytes = ~[0];
             let port = loader(bytes);
@@ -934,7 +934,7 @@ fn test_try_recv_none2_pipe() {
             test_try_recv_none2(pipe_port_loader);
         }
 
-        fn test_try_recv_none3<P: BytePort>(loader: PortLoader<P>) {
+        fn test_try_recv_none3<P:BytePort>(loader: PortLoader<P>) {
             const CONTINUE: [u8 * 4] = [0xAA, 0xBB, 0xCC, 0xDD];
             // The control word is followed by garbage
             let bytes = CONTINUE.to_vec() + ~[0];
@@ -952,7 +952,7 @@ fn test_try_recv_none3_pipe() {
             test_try_recv_none3(pipe_port_loader);
         }
 
-        fn test_try_recv_none4<P: BytePort>(+loader: PortLoader<P>) {
+        fn test_try_recv_none4<P:BytePort>(+loader: PortLoader<P>) {
             assert do task::try || {
                 const CONTINUE: [u8 * 4] = [0xAA, 0xBB, 0xCC, 0xDD];
                 // The control word is followed by a valid length,
index 8af2f350e51f7276dbe3e99ce638407602ef6415..0729987958a06cd5a0f5f5a9d8af821a6330a547 100644 (file)
@@ -34,7 +34,7 @@ enum TreeNode<K, V> {
 pub fn init<K, V>() -> Treemap<K, V> { @Empty }
 
 /// Insert a value into the map
-pub fn insert<K: Copy Eq Ord, V: Copy>(m: Treemap<K, V>, k: K, v: V)
+pub 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),
@@ -49,7 +49,7 @@ pub fn insert<K: Copy Eq Ord, V: Copy>(m: Treemap<K, V>, k: K, v: V)
 }
 
 /// Find a value based on the key
-pub fn find<K: Eq Ord, V: Copy>(m: Treemap<K, V>, k: K) -> Option<V> {
+pub fn find<K:Eq + Ord,V:Copy>(m: Treemap<K, V>, k: K) -> Option<V> {
     match *m {
       Empty => None,
       Node(@ref kk, @copy v, left, right) => {
index e8278bb1b356357c59e1440fdba03adcf1a46e6f..8d0daa323ad7c9250a8437f6ded4831da4772891 100644 (file)
@@ -323,7 +323,7 @@ fn emit_tup_elt(&self, idx: uint, f: fn()) {
     }
 }
 
-pub impl<S: serialize::Encoder> serialize::Encodable<S> for Json {
+pub impl<S:serialize::Encoder> serialize::Encodable<S> for Json {
     fn encode(&self, s: &S) {
         match *self {
             Number(v) => v.encode(s),
@@ -1150,7 +1150,7 @@ impl ToJson for @~str {
     fn to_json() -> Json { String(copy *self) }
 }
 
-impl<A: ToJson, B: ToJson> ToJson for (A, B) {
+impl<A:ToJson,B:ToJson> ToJson for (A, B) {
     fn to_json() -> Json {
         match self {
           (ref a, ref b) => {
@@ -1160,7 +1160,7 @@ fn to_json() -> Json {
     }
 }
 
-impl<A: ToJson, B: ToJson, C: ToJson> ToJson for (A, B, C) {
+impl<A:ToJson,B:ToJson,C:ToJson> ToJson for (A, B, C) {
     fn to_json() -> Json {
         match self {
           (ref a, ref b, ref c) => {
@@ -1170,11 +1170,11 @@ fn to_json() -> Json {
     }
 }
 
-impl<A: ToJson> ToJson for ~[A] {
+impl<A:ToJson> ToJson for ~[A] {
     fn to_json() -> Json { List(self.map(|elt| elt.to_json())) }
 }
 
-impl<A: ToJson Copy> ToJson for LinearMap<~str, A> {
+impl<A:ToJson + Copy> ToJson for LinearMap<~str, A> {
     fn to_json() -> Json {
         let mut d = LinearMap::new();
         for self.each |&(key, value)| {
@@ -1184,7 +1184,7 @@ fn to_json() -> Json {
     }
 }
 
-impl<A: ToJson> ToJson for Option<A> {
+impl<A:ToJson> ToJson for Option<A> {
     fn to_json() -> Json {
         match self {
           None => Null,
@@ -1282,13 +1282,13 @@ fn test_write_object() {
 
     // two fns copied from libsyntax/util/testing.rs.
     // Should they be in their own crate?
-    pub pure fn check_equal_ptr<T : cmp::Eq> (given : &T, expected: &T) {
+    pub pure fn check_equal_ptr<T:cmp::Eq> (given : &T, expected: &T) {
         if !((given == expected) && (expected == given )) {
             fail!(fmt!("given %?, expected %?",given,expected));
         }
     }
 
-    pub pure fn check_equal<T : cmp::Eq> (given : T, expected: T) {
+    pub pure fn check_equal<T:cmp::Eq> (given : T, expected: T) {
         if !((given == expected) && (expected == given )) {
             fail!(fmt!("given %?, expected %?",given,expected));
         }
index 5feac4ad454cdb62c1992f057453c24b13b80866..f6cbd9a099b6aed4efa59004fc9302333ea11efc 100644 (file)
@@ -23,7 +23,7 @@ pub enum List<T> {
 }
 
 /// Create a list from a vector
-pub pure fn from_vec<T: Copy>(v: &[T]) -> @List<T> {
+pub pure fn from_vec<T:Copy>(v: &[T]) -> @List<T> {
     vec::foldr(v, @Nil::<T>, |h, t| @Cons(*h, t))
 }
 
@@ -40,7 +40,7 @@ pub enum List<T> {
  * * z - The initial value
  * * f - The function to apply
  */
-pub fn foldl<T: Copy, U>(z: T, ls: @List<U>, f: fn(&T, &U) -> T) -> T {
+pub 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
@@ -53,7 +53,7 @@ pub 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.
  */
-pub pure fn find<T: Copy>(ls: @List<T>, f: fn(&T) -> bool) -> Option<T> {
+pub pure fn find<T:Copy>(ls: @List<T>, f: fn(&T) -> bool) -> Option<T> {
     let mut ls = ls;
     loop {
         ls = match *ls {
@@ -67,7 +67,7 @@ pub fn foldl<T: Copy, U>(z: T, ls: @List<U>, f: fn(&T, &U) -> T) -> T {
 }
 
 /// Returns true if a list contains an element with the given value
-pub fn has<T: Copy Eq>(ls: @List<T>, elt: T) -> bool {
+pub fn has<T:Copy + Eq>(ls: @List<T>, elt: T) -> bool {
     for each(ls) |e| {
         if *e == elt { return true; }
     }
@@ -75,7 +75,7 @@ pub fn has<T: Copy Eq>(ls: @List<T>, elt: T) -> bool {
 }
 
 /// Returns true if the list is empty
-pub pure fn is_empty<T: Copy>(ls: @List<T>) -> bool {
+pub pure fn is_empty<T:Copy>(ls: @List<T>) -> bool {
     match *ls {
         Nil => true,
         _ => false
@@ -90,7 +90,7 @@ pub fn has<T: Copy Eq>(ls: @List<T>, elt: T) -> bool {
 }
 
 /// Returns all but the first element of a list
-pub pure fn tail<T: Copy>(ls: @List<T>) -> @List<T> {
+pub pure fn tail<T:Copy>(ls: @List<T>) -> @List<T> {
     match *ls {
         Cons(_, tl) => return tl,
         Nil => fail!(~"list empty")
@@ -98,7 +98,7 @@ pub fn has<T: Copy Eq>(ls: @List<T>, elt: T) -> bool {
 }
 
 /// Returns the first element of a list
-pub pure fn head<T: Copy>(ls: @List<T>) -> T {
+pub pure fn head<T:Copy>(ls: @List<T>) -> T {
     match *ls {
       Cons(copy hd, _) => hd,
       // makes me sad
@@ -107,7 +107,7 @@ pub fn has<T: Copy Eq>(ls: @List<T>, elt: T) -> bool {
 }
 
 /// Appends one list to another
-pub pure fn append<T: Copy>(l: @List<T>, m: @List<T>) -> @List<T> {
+pub pure fn append<T:Copy>(l: @List<T>, m: @List<T>) -> @List<T> {
     match *l {
       Nil => return m,
       Cons(copy x, xs) => {
@@ -120,7 +120,7 @@ pub fn has<T: Copy Eq>(ls: @List<T>, elt: T) -> bool {
 /*
 /// 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 701268e044ae393515b946c0c21d3b8a9a6fef0b..53692cd3be5706bcfeffda5862935e065c866e33 100644 (file)
@@ -76,7 +76,7 @@ enum SearchResult<K, V> {
         FoundAfter(@Entry<K,V>, @Entry<K,V>)
     }
 
-    priv impl<K:Eq IterBytes Hash, V> T<K, V> {
+    priv impl<K:Eq + IterBytes + Hash,V> T<K, V> {
         pure fn search_rem(k: &K, h: uint, idx: uint,
                            e_root: @Entry<K,V>) -> SearchResult<K,V> {
             let mut e0 = e_root;
@@ -156,19 +156,19 @@ fn rehash() {
         }
     }
 
-    impl<K: Eq IterBytes Hash, V> Container for T<K, V> {
+    impl<K:Eq + IterBytes + Hash,V> Container for T<K, V> {
         pure fn len(&self) -> uint { self.count }
         pure fn is_empty(&self) -> bool { self.count == 0 }
     }
 
-    impl<K: Eq IterBytes Hash, V> Mutable for T<K, V> {
+    impl<K:Eq + IterBytes + Hash,V> Mutable for T<K, V> {
         fn clear(&mut self) {
             self.count = 0u;
             self.chains = chains(initial_capacity);
         }
     }
 
-    impl<K: Eq IterBytes Hash, V> T<K, V> {
+    impl<K:Eq + IterBytes + Hash,V> T<K, V> {
         pure fn contains_key(&self, k: &K) -> bool {
             let hash = k.hash_keyed(0,0) as uint;
             match self.search_tbl(k, hash) {
@@ -252,7 +252,7 @@ fn remove(k: &K) -> bool {
         }
     }
 
-    impl<K: Eq IterBytes Hash Copy, V: Copy> T<K, V> {
+    impl<K:Eq + IterBytes + Hash + Copy,V:Copy> T<K, V> {
         pure fn find(&self, k: &K) -> Option<V> {
             match self.search_tbl(k, k.hash_keyed(0,0) as uint) {
               NotFound => None,
@@ -325,7 +325,7 @@ fn update(key: K, newval: V, ff: fn(V, V) -> V) -> bool {
         }
     }
 
-    impl<K:Eq IterBytes Hash Copy ToStr, V: ToStr Copy> T<K, V> {
+    impl<K:Eq + IterBytes + Hash + Copy + ToStr,V:ToStr + Copy> T<K, V> {
         fn to_writer(wr: io::Writer) {
             if self.count == 0u {
                 wr.write_str(~"{}");
@@ -347,7 +347,8 @@ fn to_writer(wr: io::Writer) {
         }
     }
 
-    impl<K:Eq IterBytes Hash Copy ToStr, V: ToStr Copy> ToStr for T<K, V> {
+    impl<K:Eq + IterBytes + Hash + Copy + ToStr,V:ToStr + Copy> ToStr
+            for T<K, V> {
         pure fn to_str(&self) -> ~str {
             unsafe {
                 // Meh -- this should be safe
@@ -356,7 +357,7 @@ impl<K:Eq IterBytes Hash Copy ToStr, V: ToStr Copy> ToStr for T<K, V> {
         }
     }
 
-    impl<K:Eq IterBytes Hash Copy, V: Copy> ops::Index<K, V> for T<K, V> {
+    impl<K:Eq + IterBytes + Hash + Copy,V:Copy> ops::Index<K, V> for T<K, V> {
         pure fn index(&self, k: K) -> V {
             self.get(&k)
         }
@@ -366,7 +367,7 @@ fn chains<K,V>(nchains: uint) -> ~[Option<@Entry<K,V>>] {
         vec::from_elem(nchains, None)
     }
 
-    pub fn mk<K:Eq IterBytes Hash, V: Copy>() -> T<K,V> {
+    pub fn mk<K:Eq + IterBytes + Hash,V:Copy>() -> T<K,V> {
         let slf: T<K, V> = @HashMap_ {count: 0u,
                                       chains: chains(initial_capacity)};
         slf
@@ -378,18 +379,19 @@ pub fn mk<K:Eq IterBytes Hash, V: Copy>() -> T<K,V> {
 
 Construct a hashmap.
 */
-pub fn HashMap<K:Eq IterBytes Hash Const, V: Copy>()
+pub fn HashMap<K:Eq + IterBytes + Hash + Const,V:Copy>()
         -> HashMap<K, V> {
     chained::mk()
 }
 
 /// Convenience function for adding keys to a hashmap with nil type keys
-pub fn set_add<K:Eq IterBytes Hash Const Copy>(set: Set<K>, key: K) -> bool {
+pub fn set_add<K:Eq + IterBytes + Hash + Const + Copy>(set: Set<K>, key: K)
+                                                    -> bool {
     set.insert(key, ())
 }
 
 /// Convert a set into a vector.
-pub pure fn vec_from_set<T:Eq IterBytes Hash Copy>(s: Set<T>) -> ~[T] {
+pub pure fn vec_from_set<T:Eq + IterBytes + Hash + Copy>(s: Set<T>) -> ~[T] {
     do vec::build_sized(s.len()) |push| {
         for s.each_key() |&k| {
             push(k);
@@ -398,7 +400,7 @@ pub fn set_add<K:Eq IterBytes Hash Const Copy>(set: Set<K>, key: K) -> bool {
 }
 
 /// Construct a hashmap from a vector
-pub fn hash_from_vec<K: Eq IterBytes Hash Const Copy, V: Copy>(
+pub fn hash_from_vec<K:Eq + IterBytes + Hash + Const + Copy,V:Copy>(
     items: &[(K, V)]) -> HashMap<K, V> {
     let map = HashMap();
     for vec::each(items) |item| {
index c4ba465acea94f1833b54cf6f5a03296aa0e9e21..a31309d7980dcde46e70257a1e70eccbcbc80956 100644 (file)
@@ -32,7 +32,7 @@ pub enum SmallIntMap<T> {
 }
 
 /// Create a smallintmap
-pub fn mk<T: Copy>() -> SmallIntMap<T> {
+pub fn mk<T:Copy>() -> SmallIntMap<T> {
     let v = DVec();
     SmallIntMap_(@SmallIntMap_ { v: v } )
 }
@@ -42,7 +42,7 @@ pub fn mk<T: Copy>() -> SmallIntMap<T> {
  * the specified key then the original value is replaced.
  */
 #[inline(always)]
-pub fn insert<T: Copy>(self: SmallIntMap<T>, key: uint, val: T) {
+pub fn insert<T:Copy>(self: SmallIntMap<T>, key: uint, val: T) {
     //io::println(fmt!("%?", key));
     self.v.grow_set_elt(key, &None, Some(val));
 }
@@ -51,7 +51,7 @@ pub 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
  */
-pub pure fn find<T: Copy>(self: SmallIntMap<T>, key: uint) -> Option<T> {
+pub 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>;
 }
@@ -63,7 +63,7 @@ pub fn insert<T: Copy>(self: SmallIntMap<T>, key: uint, val: T) {
  *
  * If the key does not exist in the map
  */
-pub pure fn get<T: Copy>(self: SmallIntMap<T>, key: uint) -> T {
+pub pure fn get<T:Copy>(self: SmallIntMap<T>, key: uint) -> T {
     match find(self, key) {
       None => {
         error!("smallintmap::get(): key not present");
@@ -74,7 +74,7 @@ pub fn insert<T: Copy>(self: SmallIntMap<T>, key: uint, val: T) {
 }
 
 /// Returns true if the map contains a value for the specified key
-pub pure fn contains_key<T: Copy>(self: SmallIntMap<T>, key: uint) -> bool {
+pub pure fn contains_key<T:Copy>(self: SmallIntMap<T>, key: uint) -> bool {
     return !find(self, key).is_none();
 }
 
@@ -100,7 +100,7 @@ fn clear(&mut self) { self.v.set(~[]) }
 }
 
 /// Implements the map::map interface for smallintmap
-impl<V: Copy> SmallIntMap<V> {
+impl<V:Copy> SmallIntMap<V> {
     #[inline(always)]
     fn insert(key: uint, value: V) -> bool {
         let exists = contains_key(self, key);
@@ -162,7 +162,7 @@ fn update(key: uint, newval: V, ff: fn(V, V) -> V) -> bool {
     }
 }
 
-impl<V: Copy> ops::Index<uint, V> for SmallIntMap<V> {
+impl<V:Copy> ops::Index<uint, V> for SmallIntMap<V> {
     pure fn index(&self, key: uint) -> V {
         unsafe {
             get(*self, key)
index c48f56dd143bbe76486c7a1de5416708c8243670..0839ce181235572b8604b16f3d20b9d29c9cfb3c 100644 (file)
@@ -34,7 +34,7 @@
  * This is used to build most of the other parallel vector functions,
  * like map or alli.
  */
-fn map_slices<A: Copy Owned, B: Copy Owned>(
+fn map_slices<A:Copy + Owned,B:Copy + Owned>(
     xs: &[A],
     f: &fn() -> ~fn(uint, v: &[A]) -> B)
     -> ~[B] {
@@ -90,7 +90,7 @@ fn map_slices<A: Copy Owned, B: Copy Owned>(
 }
 
 /// A parallel version of map.
-pub fn map<A: Copy Owned, B: Copy Owned>(
+pub fn map<A:Copy + Owned,B:Copy + Owned>(
     xs: &[A], fn_factory: &fn() -> ~fn(&A) -> B) -> ~[B] {
     vec::concat(map_slices(xs, || {
         let f = fn_factory();
@@ -101,7 +101,7 @@ pub fn map<A: Copy Owned, B: Copy Owned>(
 }
 
 /// A parallel version of mapi.
-pub fn mapi<A: Copy Owned, B: Copy Owned>(
+pub fn mapi<A:Copy + Owned,B:Copy + Owned>(
     xs: &[A],
     fn_factory: &fn() -> ~fn(uint, &A) -> B) -> ~[B]
 {
@@ -120,7 +120,7 @@ pub fn mapi<A: Copy Owned, B: Copy Owned>(
 }
 
 /// Returns true if the function holds for all elements in the vector.
-pub fn alli<A: Copy Owned>(
+pub fn alli<A:Copy + Owned>(
     xs: &[A],
     fn_factory: &fn() -> ~fn(uint, &A) -> bool) -> bool
 {
@@ -135,7 +135,7 @@ pub fn alli<A: Copy Owned>(
 }
 
 /// Returns true if the function holds for any elements in the vector.
-pub fn any<A: Copy Owned>(
+pub fn any<A:Copy + Owned>(
     xs: &[A],
     fn_factory: &fn() -> ~fn(&A) -> bool) -> bool {
     do vec::any(map_slices(xs, || {
index b216834a20500cd370d406a016435bd9718c9bc1..f642bf52f659ab718930a6e093236ea71b105ec0 100644 (file)
@@ -27,7 +27,7 @@ pub struct PriorityQueue<T> {
     priv data: ~[T],
 }
 
-impl<T: Ord> BaseIter<T> for PriorityQueue<T> {
+impl<T:Ord> BaseIter<T> for PriorityQueue<T> {
     /// Visit all values in the underlying vector.
     ///
     /// The values are **not** visited in order.
@@ -35,7 +35,7 @@ impl<T: Ord> BaseIter<T> for PriorityQueue<T> {
     pure fn size_hint(&self) -> Option<uint> { self.data.size_hint() }
 }
 
-impl<T: Ord> Container for PriorityQueue<T> {
+impl<T:Ord> Container for PriorityQueue<T> {
     /// Returns the length of the queue
     pure fn len(&self) -> uint { self.data.len() }
 
@@ -43,12 +43,12 @@ impl<T: Ord> Container for PriorityQueue<T> {
     pure fn is_empty(&self) -> bool { self.data.is_empty() }
 }
 
-impl<T: Ord> Mutable for PriorityQueue<T> {
+impl<T:Ord> Mutable for PriorityQueue<T> {
     /// Drop all items from the queue
     fn clear(&mut self) { self.data.truncate(0) }
 }
 
-impl <T: Ord> PriorityQueue<T> {
+impl <T:Ord> PriorityQueue<T> {
     /// Returns the greatest item in the queue - fails if empty
     pure fn top(&self) -> &self/T { &self.data[0] }
 
index 97c60330a7e31d60f290e73ec0a4340678074b03..5f96687127cad66d7baa8fd6ef0683cc534a67b5 100644 (file)
@@ -392,4 +392,4 @@ fn test_spec_order() {
         assert a < b;
         i += 1;
     }
-}
\ No newline at end of file
+}
index 9b7cf8adce553855c05a6483130165df2449534f..3178e141097f9dc58e7b9d10013703e753141e1d 100644 (file)
@@ -105,218 +105,218 @@ pub trait Decoder {
     fn read_tup_elt<T>(&self, idx: uint, f: fn() -> T) -> T;
 }
 
-pub trait Encodable<S: Encoder> {
+pub trait Encodable<S:Encoder> {
     fn encode(&self, s: &S);
 }
 
-pub trait Decodable<D: Decoder> {
+pub trait Decodable<D:Decoder> {
     static fn decode(&self, d: &D) -> Self;
 }
 
-pub impl<S: Encoder> Encodable<S> for uint {
+pub impl<S:Encoder> Encodable<S> for uint {
     fn encode(&self, s: &S) { s.emit_uint(*self) }
 }
 
-pub impl<D: Decoder> Decodable<D> for uint {
+pub impl<D:Decoder> Decodable<D> for uint {
     static fn decode(&self, d: &D) -> uint {
         d.read_uint()
     }
 }
 
-pub impl<S: Encoder> Encodable<S> for u8 {
+pub impl<S:Encoder> Encodable<S> for u8 {
     fn encode(&self, s: &S) { s.emit_u8(*self) }
 }
 
-pub impl<D: Decoder> Decodable<D> for u8 {
+pub impl<D:Decoder> Decodable<D> for u8 {
     static fn decode(&self, d: &D) -> u8 {
         d.read_u8()
     }
 }
 
-pub impl<S: Encoder> Encodable<S> for u16 {
+pub impl<S:Encoder> Encodable<S> for u16 {
     fn encode(&self, s: &S) { s.emit_u16(*self) }
 }
 
-pub impl<D: Decoder> Decodable<D> for u16 {
+pub impl<D:Decoder> Decodable<D> for u16 {
     static fn decode(&self, d: &D) -> u16 {
         d.read_u16()
     }
 }
 
-pub impl<S: Encoder> Encodable<S> for u32 {
+pub impl<S:Encoder> Encodable<S> for u32 {
     fn encode(&self, s: &S) { s.emit_u32(*self) }
 }
 
-pub impl<D: Decoder> Decodable<D> for u32 {
+pub impl<D:Decoder> Decodable<D> for u32 {
     static fn decode(&self, d: &D) -> u32 {
         d.read_u32()
     }
 }
 
-pub impl<S: Encoder> Encodable<S> for u64 {
+pub impl<S:Encoder> Encodable<S> for u64 {
     fn encode(&self, s: &S) { s.emit_u64(*self) }
 }
 
-pub impl<D: Decoder> Decodable<D> for u64 {
+pub impl<D:Decoder> Decodable<D> for u64 {
     static fn decode(&self, d: &D) -> u64 {
         d.read_u64()
     }
 }
 
-pub impl<S: Encoder> Encodable<S> for int {
+pub impl<S:Encoder> Encodable<S> for int {
     fn encode(&self, s: &S) { s.emit_int(*self) }
 }
 
-pub impl<D: Decoder> Decodable<D> for int {
+pub impl<D:Decoder> Decodable<D> for int {
     static fn decode(&self, d: &D) -> int {
         d.read_int()
     }
 }
 
-pub impl<S: Encoder> Encodable<S> for i8 {
+pub impl<S:Encoder> Encodable<S> for i8 {
     fn encode(&self, s: &S) { s.emit_i8(*self) }
 }
 
-pub impl<D: Decoder> Decodable<D> for i8 {
+pub impl<D:Decoder> Decodable<D> for i8 {
     static fn decode(&self, d: &D) -> i8 {
         d.read_i8()
     }
 }
 
-pub impl<S: Encoder> Encodable<S> for i16 {
+pub impl<S:Encoder> Encodable<S> for i16 {
     fn encode(&self, s: &S) { s.emit_i16(*self) }
 }
 
-pub impl<D: Decoder> Decodable<D> for i16 {
+pub impl<D:Decoder> Decodable<D> for i16 {
     static fn decode(&self, d: &D) -> i16 {
         d.read_i16()
     }
 }
 
-pub impl<S: Encoder> Encodable<S> for i32 {
+pub impl<S:Encoder> Encodable<S> for i32 {
     fn encode(&self, s: &S) { s.emit_i32(*self) }
 }
 
-pub impl<D: Decoder> Decodable<D> for i32 {
+pub impl<D:Decoder> Decodable<D> for i32 {
     static fn decode(&self, d: &D) -> i32 {
         d.read_i32()
     }
 }
 
-pub impl<S: Encoder> Encodable<S> for i64 {
+pub impl<S:Encoder> Encodable<S> for i64 {
     fn encode(&self, s: &S) { s.emit_i64(*self) }
 }
 
-pub impl<D: Decoder> Decodable<D> for i64 {
+pub impl<D:Decoder> Decodable<D> for i64 {
     static fn decode(&self, d: &D) -> i64 {
         d.read_i64()
     }
 }
 
-pub impl<S: Encoder> Encodable<S> for &str {
+pub impl<S:Encoder> Encodable<S> for &str {
     fn encode(&self, s: &S) { s.emit_borrowed_str(*self) }
 }
 
-pub impl<S: Encoder> Encodable<S> for ~str {
+pub impl<S:Encoder> Encodable<S> for ~str {
     fn encode(&self, s: &S) { s.emit_owned_str(*self) }
 }
 
-pub impl<D: Decoder> Decodable<D> for ~str {
+pub impl<D:Decoder> Decodable<D> for ~str {
     static fn decode(&self, d: &D) -> ~str {
         d.read_owned_str()
     }
 }
 
-pub impl<S: Encoder> Encodable<S> for @str {
+pub impl<S:Encoder> Encodable<S> for @str {
     fn encode(&self, s: &S) { s.emit_managed_str(*self) }
 }
 
-pub impl<D: Decoder> Decodable<D> for @str {
+pub impl<D:Decoder> Decodable<D> for @str {
     static fn decode(&self, d: &D) -> @str {
         d.read_managed_str()
     }
 }
 
-pub impl<S: Encoder> Encodable<S> for float {
+pub impl<S:Encoder> Encodable<S> for float {
     fn encode(&self, s: &S) { s.emit_float(*self) }
 }
 
-pub impl<D: Decoder> Decodable<D> for float {
+pub impl<D:Decoder> Decodable<D> for float {
     static fn decode(&self, d: &D) -> float {
         d.read_float()
     }
 }
 
-pub impl<S: Encoder> Encodable<S> for f32 {
+pub impl<S:Encoder> Encodable<S> for f32 {
     fn encode(&self, s: &S) { s.emit_f32(*self) }
 }
 
-pub impl<D: Decoder> Decodable<D> for f32 {
+pub impl<D:Decoder> Decodable<D> for f32 {
     static fn decode(&self, d: &D) -> f32 {
         d.read_f32() }
 }
 
-pub impl<S: Encoder> Encodable<S> for f64 {
+pub impl<S:Encoder> Encodable<S> for f64 {
     fn encode(&self, s: &S) { s.emit_f64(*self) }
 }
 
-pub impl<D: Decoder> Decodable<D> for f64 {
+pub impl<D:Decoder> Decodable<D> for f64 {
     static fn decode(&self, d: &D) -> f64 {
         d.read_f64()
     }
 }
 
-pub impl<S: Encoder> Encodable<S> for bool {
+pub impl<S:Encoder> Encodable<S> for bool {
     fn encode(&self, s: &S) { s.emit_bool(*self) }
 }
 
-pub impl<D: Decoder> Decodable<D> for bool {
+pub impl<D:Decoder> Decodable<D> for bool {
     static fn decode(&self, d: &D) -> bool {
         d.read_bool()
     }
 }
 
-pub impl<S: Encoder> Encodable<S> for () {
+pub impl<S:Encoder> Encodable<S> for () {
     fn encode(&self, s: &S) { s.emit_nil() }
 }
 
-pub impl<D: Decoder> Decodable<D> for () {
+pub impl<D:Decoder> Decodable<D> for () {
     static fn decode(&self, d: &D) -> () {
         d.read_nil()
     }
 }
 
-pub impl<S: Encoder, T: Encodable<S>> Encodable<S> for &T {
+pub impl<S:Encoder,T:Encodable<S>> Encodable<S> for &T {
     fn encode(&self, s: &S) {
         s.emit_borrowed(|| (**self).encode(s))
     }
 }
 
-pub impl<S: Encoder, T: Encodable<S>> Encodable<S> for ~T {
+pub impl<S:Encoder,T:Encodable<S>> Encodable<S> for ~T {
     fn encode(&self, s: &S) {
         s.emit_owned(|| (**self).encode(s))
     }
 }
 
-pub impl<D: Decoder, T: Decodable<D>> Decodable<D> for ~T {
+pub impl<D:Decoder,T:Decodable<D>> Decodable<D> for ~T {
     static fn decode(&self, d: &D) -> ~T {
         d.read_owned(|| ~Decodable::decode(d))
     }
 }
 
-pub impl<S: Encoder, T: Encodable<S>> Encodable<S> for @T {
+pub impl<S:Encoder,T:Encodable<S>> Encodable<S> for @T {
     fn encode(&self, s: &S) {
         s.emit_managed(|| (**self).encode(s))
     }
 }
 
-pub impl<D: Decoder, T: Decodable<D>> Decodable<D> for @T {
+pub impl<D:Decoder,T:Decodable<D>> Decodable<D> for @T {
     static fn decode(&self, d: &D) -> @T {
         d.read_managed(|| @Decodable::decode(d))
     }
 }
 
-pub impl<S: Encoder, T: Encodable<S>> Encodable<S> for &[T] {
+pub impl<S:Encoder,T:Encodable<S>> Encodable<S> for &[T] {
     fn encode(&self, s: &S) {
         do s.emit_borrowed_vec(self.len()) {
             for self.eachi |i, e| {
@@ -326,7 +326,7 @@ fn encode(&self, s: &S) {
     }
 }
 
-pub impl<S: Encoder, T: Encodable<S>> Encodable<S> for ~[T] {
+pub impl<S:Encoder,T:Encodable<S>> Encodable<S> for ~[T] {
     fn encode(&self, s: &S) {
         do s.emit_owned_vec(self.len()) {
             for self.eachi |i, e| {
@@ -336,7 +336,7 @@ fn encode(&self, s: &S) {
     }
 }
 
-pub impl<D: Decoder, T: Decodable<D>> Decodable<D> for ~[T] {
+pub impl<D:Decoder,T:Decodable<D>> Decodable<D> for ~[T] {
     static fn decode(&self, d: &D) -> ~[T] {
         do d.read_owned_vec |len| {
             do vec::from_fn(len) |i| {
@@ -346,7 +346,7 @@ pub impl<D: Decoder, T: Decodable<D>> Decodable<D> for ~[T] {
     }
 }
 
-pub impl<S: Encoder, T: Encodable<S>> Encodable<S> for @[T] {
+pub impl<S:Encoder,T:Encodable<S>> Encodable<S> for @[T] {
     fn encode(&self, s: &S) {
         do s.emit_managed_vec(self.len()) {
             for self.eachi |i, e| {
@@ -356,7 +356,7 @@ fn encode(&self, s: &S) {
     }
 }
 
-pub impl<D: Decoder, T: Decodable<D>> Decodable<D> for @[T] {
+pub impl<D:Decoder,T:Decodable<D>> Decodable<D> for @[T] {
     static fn decode(&self, d: &D) -> @[T] {
         do d.read_managed_vec |len| {
             do at_vec::from_fn(len) |i| {
@@ -366,7 +366,7 @@ pub impl<D: Decoder, T: Decodable<D>> Decodable<D> for @[T] {
     }
 }
 
-pub impl<S: Encoder, T: Encodable<S>> Encodable<S> for Option<T> {
+pub impl<S:Encoder,T:Encodable<S>> Encodable<S> for Option<T> {
     fn encode(&self, s: &S) {
         do s.emit_enum(~"option") {
             match *self {
@@ -381,7 +381,7 @@ fn encode(&self, s: &S) {
     }
 }
 
-pub impl<D: Decoder, T: Decodable<D>> Decodable<D> for Option<T> {
+pub impl<D:Decoder,T:Decodable<D>> Decodable<D> for Option<T> {
     static fn decode(&self, d: &D) -> Option<T> {
         do d.read_enum(~"option") {
             do d.read_enum_variant |i| {
@@ -396,7 +396,7 @@ pub impl<D: Decoder, T: Decodable<D>> Decodable<D> for Option<T> {
     }
 }
 
-pub impl<S: Encoder, T0: Encodable<S>, T1: Encodable<S>> Encodable<S>
+pub impl<S:Encoder,T0:Encodable<S>,T1:Encodable<S>> Encodable<S>
         for (T0, T1) {
     fn encode(&self, s: &S) {
         match *self {
@@ -410,7 +410,7 @@ fn encode(&self, s: &S) {
     }
 }
 
-pub impl<D: Decoder, T0: Decodable<D>, T1: Decodable<D>> Decodable<D>
+pub impl<D:Decoder,T0:Decodable<D>,T1:Decodable<D>> Decodable<D>
         for (T0, T1) {
     static fn decode(&self, d: &D) -> (T0, T1) {
         do d.read_tup(2) {
@@ -552,7 +552,7 @@ pub trait EncoderHelpers {
     fn emit_from_vec<T>(&self, v: &[T], f: fn(v: &T));
 }
 
-pub impl<S: Encoder> EncoderHelpers for S {
+pub impl<S:Encoder> EncoderHelpers for S {
     fn emit_from_vec<T>(&self, v: &[T], f: fn(v: &T)) {
         do self.emit_owned_vec(v.len()) {
             for v.eachi |i, e| {
@@ -568,7 +568,7 @@ pub trait DecoderHelpers {
     fn read_to_vec<T>(&self, f: fn() -> T) -> ~[T];
 }
 
-pub impl<D: Decoder> DecoderHelpers for D {
+pub impl<D:Decoder> DecoderHelpers for D {
     fn read_to_vec<T>(&self, f: fn() -> T) -> ~[T] {
         do self.read_owned_vec |len| {
             do vec::from_fn(len) |i| {
index 382cd658663dc8097b8673eb5557d852018c2ce3..68d22f7c919a67f895ad45b91ad9db61e2ab17e2 100644 (file)
@@ -131,7 +131,7 @@ pub impl<V> SmallIntMap<V> {
     }
 }
 
-pub impl<V: Copy> SmallIntMap<V> {
+pub impl<V:Copy> SmallIntMap<V> {
     fn update_with_key(&mut self, key: uint, val: V,
                        ff: fn(uint, V, V) -> V) -> bool {
         let new_val = match self.find(&key) {
index 3450205aa9569d6ddb3adb55a1ab45ade19aa93e..d2515df3e1b4005f16831ea6a96af49453486dcf 100644 (file)
  * Has worst case O(n log n) performance, best case O(n), but
  * is not space efficient. This is a stable sort.
  */
-pub pure fn merge_sort<T: Copy>(v: &[const T], le: Le<T>) -> ~[T] {
+pub pure fn merge_sort<T:Copy>(v: &[const T], le: Le<T>) -> ~[T] {
     type Slice = (uint, uint);
 
     unsafe {return merge_sort_(v, (0u, len(v)), le);}
 
-    fn merge_sort_<T: Copy>(v: &[const T], slice: Slice, le: Le<T>)
+    fn merge_sort_<T:Copy>(v: &[const T], slice: Slice, le: Le<T>)
         -> ~[T] {
         let begin = slice.first();
         let end = slice.second();
@@ -45,7 +45,7 @@ fn merge_sort_<T: Copy>(v: &[const T], slice: Slice, le: Le<T>)
         return merge(le, merge_sort_(v, a, le), merge_sort_(v, b, le));
     }
 
-    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::with_capacity(len(a) + len(b));
         let a_len = len(a);
         let mut a_ix = 0;
@@ -103,7 +103,7 @@ pub fn quick_sort<T>(arr: &mut [T], compare_func: Le<T>) {
     qsort::<T>(arr, 0u, len::<T>(arr) - 1u, compare_func);
 }
 
-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;
@@ -160,7 +160,7 @@ fn qsort3<T: Copy Ord Eq>(arr: &mut [T], left: int, right: int) {
  *
  * This is an unstable sort.
  */
-pub fn quick_sort3<T: Copy Ord Eq>(arr: &mut [T]) {
+pub fn quick_sort3<T:Copy + Ord + Eq>(arr: &mut [T]) {
     if arr.len() <= 1 { return; }
     qsort3(arr, 0, (arr.len() - 1) as int);
 }
@@ -169,7 +169,7 @@ pub trait Sort {
     fn qsort(self);
 }
 
-impl<T: Copy Ord Eq> Sort for &mut [T] {
+impl<T:Copy + Ord + Eq> Sort for &mut [T] {
     fn qsort(self) { quick_sort3(self); }
 }
 
@@ -177,7 +177,7 @@ impl<T: Copy Ord Eq> Sort for &mut [T] {
 const MIN_GALLOP: uint = 7;
 const INITIAL_TMP_STORAGE: uint = 128;
 
-pub fn tim_sort<T: Copy Ord>(array: &mut [T]) {
+pub fn tim_sort<T:Copy + Ord>(array: &mut [T]) {
     let size = array.len();
     if size < 2 {
         return;
@@ -216,7 +216,7 @@ pub fn tim_sort<T: Copy Ord>(array: &mut [T]) {
     ms.merge_force_collapse(array);
 }
 
-fn binarysort<T: Copy Ord>(array: &mut [T], start: uint) {
+fn binarysort<T:Copy + Ord>(array: &mut [T], start: uint) {
     let size = array.len();
     let mut start = start;
     assert start <= size;
@@ -266,7 +266,7 @@ fn reverse_slice<T>(v: &mut [T], start: uint, end:uint) {
     return n + r;
 }
 
-fn count_run_ascending<T: Copy Ord>(array: &mut [T]) -> uint {
+fn count_run_ascending<T:Copy + Ord>(array: &mut [T]) -> uint {
     let size = array.len();
     assert size > 0;
     if size == 1 { return 1; }
@@ -286,7 +286,7 @@ fn count_run_ascending<T: Copy Ord>(array: &mut [T]) -> uint {
     return run;
 }
 
-pure fn gallop_left<T: Copy Ord>(key: &const T, array: &[const T],
+pure fn gallop_left<T:Copy + Ord>(key: &const T, array: &[const T],
                             hint: uint) -> uint {
     let size = array.len();
     assert size != 0 && hint < size;
@@ -335,7 +335,7 @@ fn count_run_ascending<T: Copy Ord>(array: &mut [T]) -> uint {
     return ofs;
 }
 
-pure fn gallop_right<T: Copy Ord>(key: &const T, array: &[const T],
+pure fn gallop_right<T:Copy + Ord>(key: &const T, array: &[const T],
                             hint: uint) -> uint {
     let size = array.len();
     assert size != 0 && hint < size;
@@ -404,7 +404,7 @@ fn MergeState<T>() -> MergeState<T> {
     }
 }
 
-impl<T: Copy Ord> MergeState<T> {
+impl<T:Copy + Ord> MergeState<T> {
     fn push_run(&self, run_base: uint, run_len: uint) {
         let tmp = RunState{base: run_base, len: run_len};
         self.runs.push(tmp);
@@ -708,7 +708,7 @@ fn merge_force_collapse(&self, array: &mut [T]) {
 }
 
 #[inline(always)]
-fn copy_vec<T: Copy>(dest: &mut [T], s1: uint,
+fn copy_vec<T:Copy>(dest: &mut [T], s1: uint,
                     from: &[const T], s2: uint, len: uint) {
     assert s1+len <= dest.len() && s2+len <= from.len();
 
@@ -1019,7 +1019,7 @@ fn test_managed() {
         tabulate_managed(low, high);
     }
 
-    fn multiplyVec<T: Copy>(arr: &[const T], num: uint) -> ~[T] {
+    fn multiplyVec<T:Copy>(arr: &[const T], num: uint) -> ~[T] {
         let size = arr.len();
         let res = do vec::from_fn(num) |i| {
             arr[i % size]
@@ -1035,7 +1035,7 @@ fn makeRange(n: uint) -> ~[uint] {
     }
 
     fn tabulate_unique(lo: uint, hi: uint) {
-        fn isSorted<T: Ord>(arr: &[const T]) {
+        fn isSorted<T:Ord>(arr: &[const T]) {
             for uint::range(0, arr.len()-1) |i| {
                 if arr[i] > arr[i+1] {
                     fail!(~"Array not sorted");
@@ -1107,7 +1107,7 @@ fn isSorted<T: Ord>(arr: &[const T]) {
     }
 
     fn tabulate_managed(lo: uint, hi: uint) {
-        fn isSorted<T: Ord>(arr: &[const @T]) {
+        fn isSorted<T:Ord>(arr: &[const @T]) {
             for uint::range(0, arr.len()-1) |i| {
                 if arr[i] > arr[i+1] {
                     fail!(~"Array not sorted");
index fd0b0d6be3a2dd67d236bacdf384edb006667110..66d17392417888cff9f1dcae8226a13384c924b5 100644 (file)
@@ -84,7 +84,7 @@ struct SemInner<Q> {
 enum Sem<Q> = Exclusive<SemInner<Q>>;
 
 #[doc(hidden)]
-fn new_sem<Q: Owned>(count: int, q: Q) -> Sem<Q> {
+fn new_sem<Q:Owned>(count: int, q: Q) -> Sem<Q> {
     Sem(exclusive(SemInner {
         mut count: count, waiters: new_waitqueue(), blocked: q }))
 }
@@ -99,7 +99,7 @@ fn new_sem_and_signal(count: int, num_condvars: uint)
 }
 
 #[doc(hidden)]
-impl<Q: Owned> &Sem<Q> {
+impl<Q:Owned> &Sem<Q> {
     fn acquire() {
         let mut waiter_nobe = None;
         unsafe {
@@ -167,7 +167,7 @@ fn access<U>(blk: fn() -> U) -> U {
 type SemAndSignalRelease = SemReleaseGeneric<~[Waitqueue]>;
 struct SemReleaseGeneric<Q> { sem: &Sem<Q> }
 
-impl<Q: Owned> Drop for SemReleaseGeneric<Q> {
+impl<Q:Owned> Drop for SemReleaseGeneric<Q> {
     fn finalize(&self) {
         self.sem.release();
     }
index 6e1e6a331a29667a611ccf84a4cf91dd16a1222b..6768ff232487740a731c695b34cc7dcc21d7d33c 100644 (file)
@@ -39,7 +39,7 @@
  * * ch - a channel of type T to send a `val` on
  * * val - a value of type T to send over the provided `ch`
  */
-pub fn delayed_send<T: Owned>(iotask: &IoTask,
+pub fn delayed_send<T:Owned>(iotask: &IoTask,
                               msecs: uint,
                               ch: &Chan<T>,
                               val: T) {
@@ -123,7 +123,7 @@ pub 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.
  */
-pub fn recv_timeout<T: Copy Owned>(iotask: &IoTask,
+pub fn recv_timeout<T:Copy + Owned>(iotask: &IoTask,
                                    msecs: uint,
                                    wait_po: &Port<T>)
                                 -> Option<T> {
index e4279a57ad5cd6917c3270d25d60984df8ed51d0..eb3093a27451f02f08ad50d5f2a86d4ed0ffea59 100644 (file)
@@ -39,7 +39,7 @@ pub struct TreeMap<K, V> {
     priv length: uint
 }
 
-impl<K: Eq Ord, V: Eq> Eq for TreeMap<K, V> {
+impl<K:Eq + Ord,V:Eq> Eq for TreeMap<K, V> {
     pure fn eq(&self, other: &TreeMap<K, V>) -> bool {
         if self.len() != other.len() {
             false
@@ -66,7 +66,7 @@ impl<K: Eq Ord, V: Eq> Eq for TreeMap<K, V> {
 }
 
 // Lexicographical comparison
-pure fn lt<K: Ord, V>(a: &TreeMap<K, V>, b: &TreeMap<K, V>) -> bool {
+pure fn lt<K:Ord,V>(a: &TreeMap<K, V>, b: &TreeMap<K, V>) -> bool {
     let mut x = a.iter();
     let mut y = b.iter();
 
@@ -85,7 +85,7 @@ impl<K: Eq Ord, V: Eq> Eq for TreeMap<K, V> {
     return a_len < b_len;
 }
 
-impl<K: Ord, V> Ord for TreeMap<K, V> {
+impl<K:Ord,V> Ord for TreeMap<K, V> {
     #[inline(always)]
     pure fn lt(&self, other: &TreeMap<K, V>) -> bool {
         lt(self, other)
@@ -104,7 +104,7 @@ impl<K: Ord, V> Ord for TreeMap<K, V> {
     }
 }
 
-impl<K: Ord, V> BaseIter<(&K, &V)> for TreeMap<K, V> {
+impl<K:Ord,V> BaseIter<(&K, &V)> for TreeMap<K, V> {
     /// Visit all key-value pairs in order
     pure fn each(&self, f: fn(&(&self/K, &self/V)) -> bool) {
         each(&self.root, f)
@@ -112,14 +112,14 @@ impl<K: Ord, V> BaseIter<(&K, &V)> for TreeMap<K, V> {
     pure fn size_hint(&self) -> Option<uint> { Some(self.len()) }
 }
 
-impl<K: Ord, V> ReverseIter<(&K, &V)> for TreeMap<K, V> {
+impl<K:Ord,V> ReverseIter<(&K, &V)> for TreeMap<K, V> {
     /// Visit all key-value pairs in reverse order
     pure fn each_reverse(&self, f: fn(&(&self/K, &self/V)) -> bool) {
         each_reverse(&self.root, f);
     }
 }
 
-impl<K: Ord, V> Container for TreeMap<K, V> {
+impl<K:Ord,V> Container for TreeMap<K, V> {
     /// Return the number of elements in the map
     pure fn len(&self) -> uint { self.length }
 
@@ -127,7 +127,7 @@ impl<K: Ord, V> Container for TreeMap<K, V> {
     pure fn is_empty(&self) -> bool { self.root.is_none() }
 }
 
-impl<K: Ord, V> Mutable for TreeMap<K, V> {
+impl<K:Ord,V> Mutable for TreeMap<K, V> {
     /// Clear the map, removing all key-value pairs.
     fn clear(&mut self) {
         self.root = None;
@@ -135,7 +135,7 @@ fn clear(&mut self) {
     }
 }
 
-impl<K: Ord, V> Map<K, V> for TreeMap<K, V> {
+impl<K:Ord,V> Map<K, V> for TreeMap<K, V> {
     /// Return true if the map contains a value for the specified key
     pure fn contains_key(&self, key: &K) -> bool {
         self.find(key).is_some()
@@ -184,7 +184,7 @@ fn remove(&mut self, key: &K) -> bool {
     }
 }
 
-impl <K: Ord, V> TreeMap<K, V> {
+impl <K:Ord,V> TreeMap<K, V> {
     /// Create an empty TreeMap
     static pure fn new() -> TreeMap<K, V> { TreeMap{root: None, length: 0} }
 
@@ -212,7 +212,7 @@ pub struct TreeMapIterator<K, V> {
     priv current: Option<&~TreeNode<K, V>>
 }
 
-impl <K: Ord, V> TreeMapIterator<K, V> {
+impl <K:Ord,V> TreeMapIterator<K, V> {
     // Returns the current node, or None if this iterator is at the end.
     fn get(&const self) -> Option<(&self/K, &self/V)> {
         match self.current {
@@ -224,7 +224,7 @@ fn get(&const self) -> Option<(&self/K, &self/V)> {
 
 /// Advance the iterator to the next node (in order). If this iterator
 /// is finished, does nothing.
-pub fn map_next<K: Ord, V>(iter: &mut TreeMapIterator/&a<K, V>) {
+pub fn map_next<K:Ord,V>(iter: &mut TreeMapIterator/&a<K, V>) {
     while !iter.stack.is_empty() || iter.node.is_some() {
         match *iter.node {
           Some(ref x) => {
@@ -246,25 +246,25 @@ pub struct TreeSet<T> {
     priv map: TreeMap<T, ()>
 }
 
-impl<T: Ord> BaseIter<T> for TreeSet<T> {
+impl<T:Ord> BaseIter<T> for TreeSet<T> {
     /// Visit all values in order
     pure fn each(&self, f: fn(&T) -> bool) { self.map.each_key(f) }
     pure fn size_hint(&self) -> Option<uint> { Some(self.len()) }
 }
 
-impl<T: Ord> ReverseIter<T> for TreeSet<T> {
+impl<T:Ord> ReverseIter<T> for TreeSet<T> {
     /// Visit all values in reverse order
     pure fn each_reverse(&self, f: fn(&T) -> bool) {
         self.map.each_key_reverse(f)
     }
 }
 
-impl<T: Eq Ord> Eq for TreeSet<T> {
+impl<T:Eq + Ord> Eq for TreeSet<T> {
     pure fn eq(&self, other: &TreeSet<T>) -> bool { self.map == other.map }
     pure fn ne(&self, other: &TreeSet<T>) -> bool { self.map != other.map }
 }
 
-impl<T: Ord> Ord for TreeSet<T> {
+impl<T:Ord> Ord for TreeSet<T> {
     #[inline(always)]
     pure fn lt(&self, other: &TreeSet<T>) -> bool { self.map < other.map }
     #[inline(always)]
@@ -275,7 +275,7 @@ impl<T: Ord> Ord for TreeSet<T> {
     pure fn gt(&self, other: &TreeSet<T>) -> bool { self.map > other.map }
 }
 
-impl<T: Ord> Container for TreeSet<T> {
+impl<T:Ord> Container for TreeSet<T> {
     /// Return the number of elements in the set
     pure fn len(&self) -> uint { self.map.len() }
 
@@ -283,12 +283,12 @@ impl<T: Ord> Container for TreeSet<T> {
     pure fn is_empty(&self) -> bool { self.map.is_empty() }
 }
 
-impl<T: Ord> Mutable for TreeSet<T> {
+impl<T:Ord> Mutable for TreeSet<T> {
     /// Clear the set, removing all values.
     fn clear(&mut self) { self.map.clear() }
 }
 
-impl<T: Ord> Set<T> for TreeSet<T> {
+impl<T:Ord> Set<T> for TreeSet<T> {
     /// Return true if the set contains a value
     pure fn contains(&self, value: &T) -> bool {
         self.map.contains_key(value)
@@ -510,7 +510,7 @@ fn remove(&mut self, value: &T) -> bool { self.map.remove(value) }
     }
 }
 
-impl <T: Ord> TreeSet<T> {
+impl <T:Ord> TreeSet<T> {
     /// Create an empty TreeSet
     static pure fn new() -> TreeSet<T> { TreeSet{map: TreeMap::new()} }
 
@@ -526,7 +526,7 @@ pub struct TreeSetIterator<T> {
     priv iter: TreeMapIterator<T, ()>
 }
 
-impl <T: Ord> TreeSetIterator<T> {
+impl <T:Ord> TreeSetIterator<T> {
     /// Returns the current node, or None if this iterator is at the end.
     fn get(&const self) -> Option<&self/T> {
         match self.iter.get() {
@@ -538,7 +538,7 @@ fn get(&const self) -> Option<&self/T> {
 
 /// Advance the iterator to the next node (in order). If this iterator is
 /// finished, does nothing.
-pub fn set_next<T: Ord>(iter: &mut TreeSetIterator/&a<T>) {
+pub fn set_next<T:Ord>(iter: &mut TreeSetIterator/&a<T>) {
     map_next(&mut iter.iter);
 }
 
@@ -552,14 +552,14 @@ struct TreeNode<K, V> {
     level: uint
 }
 
-impl <K: Ord, V> TreeNode<K, V> {
+impl <K:Ord,V> TreeNode<K, V> {
     #[inline(always)]
     static pure fn new(key: K, value: V) -> TreeNode<K, V> {
         TreeNode{key: key, value: value, left: None, right: None, level: 1}
     }
 }
 
-pure fn each<K: Ord, V>(node: &r/Option<~TreeNode<K, V>>,
+pure fn each<K:Ord,V>(node: &r/Option<~TreeNode<K, V>>,
                         f: fn(&(&r/K, &r/V)) -> bool) {
     do node.iter |x| {
         each(&x.left, f);
@@ -567,7 +567,7 @@ impl <K: Ord, V> TreeNode<K, V> {
     }
 }
 
-pure fn each_reverse<K: Ord, V>(node: &r/Option<~TreeNode<K, V>>,
+pure fn each_reverse<K:Ord,V>(node: &r/Option<~TreeNode<K, V>>,
                                 f: fn(&(&r/K, &r/V)) -> bool) {
     do node.iter |x| {
         each_reverse(&x.right, f);
@@ -576,7 +576,7 @@ impl <K: Ord, V> TreeNode<K, V> {
 }
 
 // Remove left horizontal link by rotating right
-fn skew<K: Ord, V>(node: &mut ~TreeNode<K, V>) {
+fn skew<K:Ord,V>(node: &mut ~TreeNode<K, V>) {
     if node.left.map_default(false, |x| x.level == node.level) {
         let mut save = node.left.swap_unwrap();
         node.left <-> save.right; // save.right now None
@@ -587,7 +587,7 @@ fn skew<K: Ord, V>(node: &mut ~TreeNode<K, V>) {
 
 // Remove dual horizontal link by rotating left and increasing level of
 // the parent
-fn split<K: Ord, V>(node: &mut ~TreeNode<K, V>) {
+fn split<K:Ord,V>(node: &mut ~TreeNode<K, V>) {
     if node.right.map_default(false,
       |x| x.right.map_default(false, |y| y.level == node.level)) {
         let mut save = node.right.swap_unwrap();
@@ -598,7 +598,7 @@ fn split<K: Ord, V>(node: &mut ~TreeNode<K, V>) {
     }
 }
 
-fn insert<K: Ord, V>(node: &mut Option<~TreeNode<K, V>>, key: K,
+fn insert<K:Ord,V>(node: &mut Option<~TreeNode<K, V>>, key: K,
                      value: V) -> bool {
     match *node {
       Some(ref mut save) => {
@@ -625,8 +625,8 @@ fn insert<K: Ord, V>(node: &mut Option<~TreeNode<K, V>>, key: K,
     }
 }
 
-fn remove<K: Ord, V>(node: &mut Option<~TreeNode<K, V>>, key: &K) -> bool {
-    fn heir_swap<K: Ord, V>(node: &mut ~TreeNode<K, V>,
+fn remove<K:Ord,V>(node: &mut Option<~TreeNode<K, V>>, key: &K) -> bool {
+    fn heir_swap<K:Ord,V>(node: &mut ~TreeNode<K, V>,
                             child: &mut Option<~TreeNode<K, V>>) {
         // *could* be done without recursion, but it won't borrow check
         do child.mutate |mut child| {
@@ -772,7 +772,7 @@ fn u8_map() {
         assert m.find(&k1) == Some(&v1);
     }
 
-    fn check_equal<K: Eq Ord, V: Eq>(ctrl: &[(K, V)], map: &TreeMap<K, V>) {
+    fn check_equal<K:Eq + Ord,V:Eq>(ctrl: &[(K, V)], map: &TreeMap<K, V>) {
         assert ctrl.is_empty() == map.is_empty();
         for ctrl.each |x| {
             let &(k, v) = x;
@@ -792,7 +792,7 @@ fn check_equal<K: Eq Ord, V: Eq>(ctrl: &[(K, V)], map: &TreeMap<K, V>) {
         }
     }
 
-    fn check_left<K: Ord, V>(node: &Option<~TreeNode<K, V>>,
+    fn check_left<K:Ord,V>(node: &Option<~TreeNode<K, V>>,
                              parent: &~TreeNode<K, V>) {
         match *node {
           Some(ref r) => {
@@ -805,7 +805,7 @@ fn check_left<K: Ord, V>(node: &Option<~TreeNode<K, V>>,
         }
     }
 
-    fn check_right<K: Ord, V>(node: &Option<~TreeNode<K, V>>,
+    fn check_right<K:Ord,V>(node: &Option<~TreeNode<K, V>>,
                               parent: &~TreeNode<K, V>, parent_red: bool) {
         match *node {
           Some(ref r) => {
@@ -820,7 +820,7 @@ fn check_right<K: Ord, V>(node: &Option<~TreeNode<K, V>>,
         }
     }
 
-    fn check_structure<K: Ord, V>(map: &TreeMap<K, V>) {
+    fn check_structure<K:Ord,V>(map: &TreeMap<K, V>) {
         match map.root {
           Some(ref r) => {
             check_left(&r.left, r);
index 70c03c69d2db3540018ebe4947ca4a1834e4874b..4de7c1b99252655cce3f69f916c70a792b77d222 100644 (file)
@@ -138,7 +138,7 @@ impl WorkKey {
 
 type WorkMap = LinearMap<WorkKey, ~str>;
 
-pub impl<S: Encoder> Encodable<S> for WorkMap {
+pub impl<S:Encoder> Encodable<S> for WorkMap {
     fn encode(&self, s: &S) {
         let mut d = ~[];
         for self.each |&(k, v)| {
@@ -149,7 +149,7 @@ fn encode(&self, s: &S) {
     }
 }
 
-pub impl<D: Decoder> Decodable<D> for WorkMap {
+pub impl<D:Decoder> Decodable<D> for WorkMap {
     static fn decode(&self, d: &D) -> WorkMap {
         let v : ~[(WorkKey,~str)] = Decodable::decode(d);
         let mut w = LinearMap::new();
index 234cef5f6eb4da5ed1b95d119251cdc7ae076c54..6befb2f1880426ec1d272a9346ae280552944172 100644 (file)
@@ -32,7 +32,7 @@ macro_rules! interner_key (
 #[deriving_eq]
 pub struct ident { repr: uint }
 
-pub impl<S: Encoder> Encodable<S> for ident {
+pub impl<S:Encoder> Encodable<S> for ident {
     fn encode(&self, s: &S) {
         let intr = match unsafe {
             task::local_data::local_data_get(interner_key!())
@@ -45,7 +45,7 @@ fn encode(&self, s: &S) {
     }
 }
 
-pub impl<D: Decoder> Decodable<D> for ident {
+pub impl<D:Decoder> Decodable<D> for ident {
     static fn decode(d: &D) -> ident {
         let intr = match unsafe {
             task::local_data::local_data_get(interner_key!())
@@ -383,7 +383,7 @@ pub enum inferable<T> {
     infer(node_id)
 }
 
-pub impl<T: to_bytes::IterBytes> to_bytes::IterBytes for inferable<T> {
+pub impl<T:to_bytes::IterBytes> to_bytes::IterBytes for inferable<T> {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         match *self {
           expl(ref t) =>
index 851b35ca3bd3ff1f5555b9b16eb95eeeab43eada..c9bc41ed61e9b3efe9cc1fa5149b26ae210d3445 100644 (file)
@@ -140,12 +140,12 @@ pub impl cmp::Eq for span {
     pure fn ne(&self, other: &span) -> bool { !(*self).eq(other) }
 }
 
-pub impl<S: Encoder> Encodable<S> for span {
+pub impl<S:Encoder> Encodable<S> for span {
     /* Note #1972 -- spans are encoded but not decoded */
     fn encode(&self, _s: &S) { }
 }
 
-pub impl<D: Decoder> Decodable<D> for span {
+pub impl<D:Decoder> Decodable<D> for span {
     static fn decode(_d: &D) -> span {
         dummy_sp()
     }
index ad0998d503a3642dd94733c05fe2736c17327c97..f378325d0abd539d07c9b3f8caffdde83becf251 100644 (file)
@@ -300,7 +300,7 @@ fn print_macro_backtrace(cm: @codemap::CodeMap, sp: span) {
     }
 }
 
-pub fn expect<T: Copy>(diag: span_handler,
+pub fn expect<T:Copy>(diag: span_handler,
                        opt: Option<T>,
                        msg: fn() -> ~str) -> T {
     match opt {
index 9ceaebe6dd1de00b09aa9b2f6c693abc654a24b2..7fbba987cc7dff6a1228a319ce46953b453b15a9 100644 (file)
@@ -23,7 +23,7 @@ struct Node {id: uint}
 
 would generate two implementations like:
 
-impl<S: std::serialize::Encoder> Encodable<S> for Node {
+impl<S:std::serialize::Encoder> Encodable<S> for Node {
     fn encode(&self, s: &S) {
         do s.emit_struct("Node", 1) {
             s.emit_field("id", 0, || s.emit_uint(self.id))
@@ -31,7 +31,7 @@ fn encode(&self, s: &S) {
     }
 }
 
-impl<D: Decoder> Decodable for node_id {
+impl<D:Decoder> Decodable for node_id {
     static fn decode(d: &D) -> Node {
         do d.read_struct("Node", 1) {
             Node {
@@ -54,7 +54,7 @@ impl<
         S: Encoder,
         T: Encodable<S>
     > spanned<T>: Encodable<S> {
-        fn encode<S: Encoder>(s: &S) {
+        fn encode<S:Encoder>(s: &S) {
             do s.emit_rec {
                 s.emit_field("node", 0, || self.node.encode(s));
                 s.emit_field("span", 1, || self.span.encode(s));
index f4d0e57c5958d2d5faf60e7e305720144e76f3ff..49f7fe5853e7bc4da0418111763662066333cc0d 100644 (file)
@@ -319,7 +319,7 @@ fn item_mod(&self, name: ident, span: span,
                 +items: ~[@ast::item]) -> @ast::item {
 
         // XXX: Total hack: import `core::kinds::Owned` to work around a
-        // parser bug whereby `fn f<T: ::kinds::Owned>` doesn't parse.
+        // parser bug whereby `fn f<T:::kinds::Owned>` doesn't parse.
         let vi = ast::view_item_use(~[
             @codemap::spanned {
                 node: ast::view_path_simple(
index e7b5005d8dbf4899050f29f3e1c04746ed4d4174..4c9c9a5e52a83ed3f36bc25052bfec9a6ea775fc 100644 (file)
@@ -212,7 +212,7 @@ fn expect_gt() {
 
     // parse a sequence bracketed by '<' and '>', stopping
     // before the '>'.
-    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 = ~[];
@@ -231,7 +231,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();
@@ -240,7 +240,7 @@ fn parse_seq_to_gt<T: Copy>(sep: Option<token::Token>,
     }
 
     // parse a sequence bracketed by '<' and '>'
-    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);
@@ -253,7 +253,7 @@ fn parse_seq_lt_gt<T: Copy>(sep: Option<token::Token>,
     // parse a sequence, including the closing delimiter. The function
     // f must consume tokens until reaching the next separator or
     // closing bracket.
-    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();
@@ -263,7 +263,7 @@ fn parse_seq_to_end<T: Copy>(ket: token::Token, sep: seq_sep,
     // parse a sequence, not including the closing delimiter. The function
     // f must consume tokens until reaching the next separator or
     // closing bracket.
-    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] = ~[];
@@ -284,7 +284,7 @@ fn parse_seq_to_before_end<T: Copy>(ket: token::Token, sep: seq_sep,
     // parse a sequence, including the closing delimiter. The function
     // f must consume tokens until reaching the next separator or
     // closing bracket.
-    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] {
@@ -296,7 +296,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 eeba00be7046110d1c37d3798546b88ef77d222d..ab7e3204b7b310030fc942af8c3ef25bdf060603 100644 (file)
@@ -2282,7 +2282,7 @@ pub mod test {
     //use util;
     use util::testing::check_equal;
 
-    fn string_check<T : Eq> (given : &T, expected: &T) {
+    fn string_check<T:Eq> (given : &T, expected: &T) {
         if !(given == expected) {
             fail!(fmt!("given %?, expected %?",given,expected));
         }
index dcb3261169be4b094b69e82e51c6d9fce9bd13ce..4b13818974c3045605107debe62064b7e7772152 100644 (file)
@@ -23,7 +23,7 @@ pub struct Interner<T> {
 }
 
 // when traits can extend traits, we should extend index<uint,T> to get []
-pub impl<T: Eq IterBytes Hash Const Copy> Interner<T> {
+pub impl<T:Eq + IterBytes + Hash + Const + Copy> Interner<T> {
     static fn new() -> Interner<T> {
         Interner {
             map: LinearMap::new(),
index b6d333349a091ec8b44ce8af73382baf7d62043e..78a175df29f276a59e015d9cb6d572ac621bbfc5 100644 (file)
 // support for test cases.
 use core::cmp;
 
-pub pure fn check_equal_ptr<T : cmp::Eq> (given : &T, expected: &T) {
+pub pure fn check_equal_ptr<T:cmp::Eq> (given : &T, expected: &T) {
     if !((given == expected) && (expected == given )) {
         fail!(fmt!("given %?, expected %?",given,expected));
     }
 }
 
-pub pure fn check_equal<T : cmp::Eq> (given : T, expected: T) {
+pub pure fn check_equal<T:cmp::Eq> (given : T, expected: T) {
     if !((given == expected) && (expected == given )) {
         fail!(fmt!("given %?, expected %?",given,expected));
     }
index 70a2b8f680a5c5f5025e7d3c1460d0dbeaff8d8e..8038c5fc41ac4c800b8aecd02ccf3be72c8cff71 100644 (file)
@@ -10,7 +10,7 @@
 
 use core::pipes::*;
 
-pub fn foo<T: Owned Copy>(x: T) -> Port<T> {
+pub fn foo<T:Owned + Copy>(x: T) -> Port<T> {
     let (p, c) = stream();
     do task::spawn() {
         c.send(x);
index 8f1c3d5bb5f52b17c93693107dc70cb88027b57b..1be18459e407c5ba4be64ba5fe2c089a40f5b417 100644 (file)
@@ -16,11 +16,11 @@ pub struct Entry<A,B> {key: A, value: B}
 
 pub struct alist<A,B> { eq_fn: fn@(A,A) -> bool, data: DVec<Entry<A,B>> }
 
-pub fn alist_add<A: Copy, B: Copy>(lst: alist<A,B>, k: A, v: B) {
+pub fn alist_add<A:Copy,B:Copy>(lst: alist<A,B>, k: A, v: B) {
     lst.data.push(Entry{key:k, value:v});
 }
 
-pub fn alist_get<A: Copy, B: Copy>(lst: alist<A,B>, k: A) -> B {
+pub 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; }
@@ -29,13 +29,13 @@ pub fn alist_get<A: Copy, B: Copy>(lst: alist<A,B>, k: A) -> B {
 }
 
 #[inline]
-pub fn new_int_alist<B: Copy>() -> alist<int, B> {
+pub fn new_int_alist<B:Copy>() -> alist<int, B> {
     fn eq_int(&&a: int, &&b: int) -> bool { a == b }
     return alist {eq_fn: eq_int, data: DVec()};
 }
 
 #[inline]
-pub fn new_int_alist_2<B: Copy>() -> alist<int, B> {
+pub fn new_int_alist_2<B:Copy>() -> alist<int, B> {
     #[inline]
     fn eq_int(&&a: int, &&b: int) -> bool { a == b }
     return alist {eq_fn: eq_int, data: DVec()};
index f9d08713852e402265c5e1825e11241dcf01f882..958fb75b9d233af11925bb3cf281196a2e78f358 100644 (file)
@@ -23,13 +23,13 @@ impl<T:Const> Drop for arc_destruct<T> {
     fn finalize(&self) {}
 }
 
-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 8679d3a778607ee8b088b7cb8306ebb7e093cd52..b1fb7a82c5c8b764f08cd6f919b1cbc966f4d3b3 100644 (file)
@@ -19,6 +19,6 @@
 pub type header_map = HashMap<~str, @DVec<@~str>>;
 
 // the unused ty param is necessary so this gets monomorphized
-pub fn request<T: Copy>(req: header_map) {
+pub fn request<T:Copy>(req: header_map) {
   let _x = copy *(copy *req.get(&~"METHOD"))[0u];
 }
index 2e3c7eedfcc3829e5d4d5af041274c2e428dabb1..0e2105243e70308eb0f4580d5d9b957096c52657 100644 (file)
@@ -8,6 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-pub fn to_closure<A: Durable Copy>(x: A) -> @fn() -> A {
+pub fn to_closure<A:Durable + Copy>(x: A) -> @fn() -> A {
     fn@() -> A { copy x }
 }
index f06f2e31b710f47cb8945b6aa8eb79dbabebda63..dbfff4e8acaaf7b764b975429d151ce7754e0a61 100644 (file)
@@ -33,7 +33,7 @@ impl read for bool {
     }
 }
 
-pub fn read<T: read Copy>(s: ~str) -> T {
+pub fn read<T:read + Copy>(s: ~str) -> T {
     match read::readMaybe(s) {
       Some(x) => x,
       _ => fail!(~"read failed!")
index 97a363f6b0c45a8e77cb6ac7f157e36cf44d1572..3e26a09fb8f0d47897f849ad63171eab5a016752 100644 (file)
@@ -14,4 +14,4 @@
 
 trait Quux: Foo Bar Baz { }
 
-impl<T: Foo Bar Baz> Quux for T { }
+impl<T:Foo + Bar + Baz> Quux for T { }
index 65bb9fc1e9009ab45989ef129adc5f8e6cd3fdda..2845596e780079956767992d27140fd5ce05af09 100644 (file)
@@ -32,7 +32,7 @@ fn timed(result: &mut float, op: fn()) {
 }
 
 impl Results {
-    fn bench_int<T: Set<uint>>(&mut self, rng: @rand::Rng, num_keys: uint,
+    fn bench_int<T:Set<uint>>(&mut self, rng: @rand::Rng, num_keys: uint,
                                rand_cap: uint, f: fn() -> T) {
         {
             let mut set = f();
@@ -70,7 +70,7 @@ fn bench_int<T: Set<uint>>(&mut self, rng: @rand::Rng, num_keys: uint,
         }
     }
 
-    fn bench_str<T: Set<~str>>(&mut self, rng: @rand::Rng, num_keys: uint,
+    fn bench_str<T:Set<~str>>(&mut self, rng: @rand::Rng, num_keys: uint,
                                f: fn() -> T) {
         {
             let mut set = f();
index 11a127b9722f407c2a624cc16e13062883ba7bb6..16f44b88793c80f1de5b08411d6a1fe4b98cf4af 100644 (file)
@@ -72,7 +72,7 @@ macro_rules! follow (
     )
 )
 
-fn switch<T: Owned, Tb: Owned, U>(+endp: pipes::RecvPacketBuffered<T, Tb>,
+fn switch<T:Owned,Tb:Owned,U>(+endp: pipes::RecvPacketBuffered<T, Tb>,
                       f: fn(+v: Option<T>) -> U) -> U {
     f(pipes::try_recv(endp))
 }
index 78ae31570b335d555ba4e30ac793de131a915162..a887a13bf3802b39106aaa34086900d00a6c1eb6 100644 (file)
@@ -27,14 +27,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 Ord>(kv0: &(TT,UU),
+   pure fn le_by_val<TT:Copy,UU:Copy + Ord>(kv0: &(TT,UU),
                                          kv1: &(TT,UU)) -> bool {
       let (_, v0) = *kv0;
       let (_, v1) = *kv1;
       return v0 >= v1;
    }
 
-   pure fn le_by_key<TT: Copy Ord, UU: Copy>(kv0: &(TT,UU),
+   pure fn le_by_key<TT:Copy + Ord,UU:Copy>(kv0: &(TT,UU),
                                          kv1: &(TT,UU)) -> bool {
       let (k0, _) = *kv0;
       let (k1, _) = *kv1;
@@ -42,7 +42,7 @@ fn pct(xx: uint, yy: uint) -> float {
    }
 
    // sort by key, then by value
-   fn sortKV<TT: Copy Ord, UU: Copy Ord>(orig: ~[(TT,UU)]) -> ~[(TT,UU)] {
+   fn sortKV<TT:Copy + Ord,UU:Copy + Ord>(orig: ~[(TT,UU)]) -> ~[(TT,UU)] {
       return sort::merge_sort(sort::merge_sort(orig, le_by_key), le_by_val);
    }
 
index d4fe51835aee58db60e2a50096bdddcf4afe59be..92581d756db030f09ce3bd7aaa5a11354bbb942a 100644 (file)
@@ -11,7 +11,7 @@
 trait A { fn foo(); }
 trait B { fn foo(); }
 
-fn foo<T: A B>(t: T) {
+fn foo<T:A + B>(t: T) {
     t.foo(); //~ ERROR multiple applicable methods in scope
     //~^ NOTE candidate #1 derives from the bound `A`
     //~^^ NOTE candidate #2 derives from the bound `B`
index 5da3d08e34c56984626e5b66fb339e89b4b8b0b6..c9aeaae0ff934e596bc94abe120ce74f3a4c454c 100644 (file)
@@ -16,7 +16,7 @@
 use iter::BaseIter;
 
 trait A {
-  fn b<C:Copy Const, D>(x: C) -> C;
+  fn b<C:Copy + Const,D>(x: C) -> C;
 }
 
 struct E {
@@ -24,7 +24,7 @@ struct E {
 }
 
 impl A for E {
-  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() {}
index c8f3f9a4a5a3d39e2366ddac1a340520b8dc5eb7..fb7c5bd6cb87b21c49e327f91676e5547ea083b6 100644 (file)
@@ -13,7 +13,7 @@
 use iter::BaseIter;
 
 trait A {
-  fn b<C:Copy, D>(x: C) -> C;
+  fn b<C:Copy,D>(x: C) -> C;
 }
 
 struct E {
@@ -21,7 +21,7 @@ struct E {
 }
 
 impl A for E {
-  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() {}
index f8f7704bcd9d00475bc34f88e466c85a6b703b11..35015a260f5af16a1614cebb78542a79d2c79dc5 100644 (file)
@@ -13,7 +13,7 @@
 use iter::BaseIter;
 
 trait A {
-  fn b<C:Copy, D>(x: C) -> C;
+  fn b<C:Copy,D>(x: C) -> C;
 }
 
 struct E {
@@ -22,7 +22,7 @@ struct E {
 
 impl A for E {
   // 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() {}
index 0b63ae5b1bad3947eedcde2f77b0ee7cc7ef304f..77a840e7e366dd372b9e286fea59df0b8f1b289f 100644 (file)
@@ -9,12 +9,12 @@
 // except according to those terms.
 
 pub mod stream {
-    pub enum Stream<T: Owned> { send(T, ::stream::server::Stream<T>), }
+    pub enum Stream<T:Owned> { send(T, ::stream::server::Stream<T>), }
     pub mod server {
         use core::option;
         use core::pipes;
 
-        impl<T: Owned> Stream<T> {
+        impl<T:Owned> Stream<T> {
             pub fn recv() -> extern fn(+v: Stream<T>) -> ::stream::Stream<T> {
               // resolve really should report just one error here.
               // Change the test case when it changes.
@@ -28,7 +28,7 @@ pub fn recv(+pipe: Stream<T>) -> ::stream::Stream<T> { //~ ERROR attempt to use
             }
         }
 
-        pub type Stream<T: Owned> = pipes::RecvPacket<::stream::Stream<T>>;
+        pub type Stream<T:Owned> = pipes::RecvPacket<::stream::Stream<T>>;
     }
 }
 
index a71826c629b6c89e92e828da298edebe959142c4..ab28b461a2c6b4e5ecfb3c8a301b485e84e9a304 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-test
 // error-pattern: instantiating a type parameter with an incompatible type
-struct S<T: Const> {
+struct S<T:Const> {
     s: T,
     mut cant_nest: ()
 }
index 3d83f13c211ba49376522736dcb6f845f721ae09..b2cef943528fe0ed449e7cb920fa7e3e023057ea 100644 (file)
@@ -35,7 +35,7 @@ fn to_foo_2<T:Copy>(t: T) -> foo {
     {f:t} as foo //~ ERROR value may contain borrowed pointers; use `&static` bound
 }
 
-fn to_foo_3<T:Copy &static>(t: T) -> foo {
+fn to_foo_3<T:Copy &static>(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 683d66d0d72e90729f3f8a2bf23d46c173c5b3b1..2bc6a91120424f209d8d38ebf5805d18b9d51a7a 100644 (file)
 
 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 `&static` bound
 }
 
-fn to_foo2<T: Copy foo &static>(t: T) -> foo {
+fn to_foo2<T:Copy + foo + &static>(t: T) -> foo {
     t as foo
 }
 
index 65f6f837c83a0d9c775cff261cf48d645e553dac..e792917622b3f8a985612282c5e457594d6a9098 100644 (file)
@@ -8,11 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-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 &static>(t: T) -> fn@() -> T {
+fn copy2<T:Copy + &static>(t: T) -> fn@() -> T {
     fn@() -> T { t }
 }
 
index f852fb1d38e42d543070f294d2a525fedecc0e79..95dd59eb27f73977408e3b09f01dd5202ca133a6 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn send<T: Owned>(ch: _chan<T>, -data: T) {
+fn send<T:Owned>(ch: _chan<T>, -data: T) {
     log(debug, ch);
     log(debug, data);
     fail!();
index 9bc4ce87787ed0c9d4437c8b3a9aff6c61d852fc..43c91490a9686bb22b0deacf4d5f82fdb4ec22c7 100644 (file)
@@ -10,7 +10,7 @@
 
 // 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 d92b545d1701f1ae5c92a03316bfb63ae4576a7a..ac873238bfc0d0505ead0cd9e1f65dbd6c4f9fbc 100644 (file)
@@ -8,16 +8,16 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn f1<T: copy>() -> T { }
+fn f1<T:copy>() -> T { }
 //~^ ERROR obsolete syntax: lower-case kind bounds
 
-fn f1<T: send>() -> T { }
+fn f1<T:send>() -> T { }
 //~^ ERROR obsolete syntax: lower-case kind bounds
 
-fn f1<T: const>() -> T { }
+fn f1<T:const>() -> T { }
 //~^ ERROR obsolete syntax: lower-case kind bounds
 
-fn f1<T: owned>() -> T { }
+fn f1<T:owned>() -> T { }
 //~^ ERROR obsolete syntax: lower-case kind bounds
 
 struct s {
index 0681680b9c4a24d37407e4a49c0053da72f86a75..e4598adca27dfd471e714f667017f40b0f45eca4 100644 (file)
@@ -18,7 +18,7 @@ fn get() -> int {
     }
 }
 
-fn with<R: deref>(f: fn(x: &int) -> R) -> int {
+fn with<R:deref>(f: fn(x: &int) -> R) -> int {
     f(&3).get()
 }
 
index d36b53eb2ee719729b6638ef486cc724f0b01c15..26058bf89cad726813bda21f7d8e27c19b07d04e 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn f<T: Owned>(_i: T) {
+fn f<T:Owned>(_i: T) {
 }
 
 fn main() {
index f9ad20eaeb9b4801bd827be14d2022bf62dc65d1..478e01ccd042eccf841eb81b7a0ef0ef608e9544 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-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 7b48eca3dbe23225ff4acd614e75fdedb826a3da..bd886f44ede848c84b492e83178d49514c9c7935 100644 (file)
@@ -13,16 +13,16 @@ trait TraitA {
 }
 
 trait TraitB {
-    fn gimme_an_a<A: TraitA>(a: A) -> int;
+    fn gimme_an_a<A:TraitA>(a: A) -> int;
 }
 
 impl TraitB for int {
-    fn gimme_an_a<A: TraitA>(a: A) -> int {
+    fn gimme_an_a<A:TraitA>(a: A) -> int {
         a.method_a() + self
     }
 }
 
-fn call_it<B: TraitB>(b: B)  -> int {
+fn call_it<B:TraitB>(b: B)  -> int {
     let y = 4u;
     b.gimme_an_a(y) //~ ERROR failed to find an implementation of trait @TraitA
 }
index 85e0f3dd398ee61ea833dc13a9170703912f486c..4dada6257d4b024f1a15c1c5c7430729b1dc3eeb 100644 (file)
@@ -16,6 +16,6 @@
 
 enum chan_t<T> = {task: task_id, port: port_id};
 
-fn send<T: Owned>(ch: chan_t<T>, data: T) { fail!(); }
+fn send<T:Owned>(ch: chan_t<T>, data: T) { fail!(); }
 
 fn main() { fail!(~"quux"); }
index 350132c15b82901f99e92d098a5c033417c914ed..2972c425192a8281be17f5134b318b097a3f660d 100644 (file)
@@ -12,7 +12,7 @@
     a: A, b: B
 };
 
-fn f<A:Copy &static>(a: A, b: u16) -> fn@() -> (A, u16) {
+fn f<A:Copy &static>(a: A, b: u16) -> fn@() -> (A, u16) {
     fn@() -> (A, u16) { (a, b) }
 }
 
index e16fae776f7e979ec185e19bcf8fcbd281348059..2a09de7a81c222276db78fbda0c194fc58ddeaa0 100644 (file)
@@ -23,7 +23,7 @@ fn make_cycle<A:Copy>(a: A) {
     g.rec = Some(g);
 }
 
-fn f<A:Owned Copy, B:Owned Copy>(a: A, b: B) -> fn@() -> (A, B) {
+fn f<A:Owned + Copy,B:Owned + Copy>(a: A, b: B) -> fn@() -> (A, B) {
     fn@() -> (A, B) { (a, b) }
 }
 
index d4171ceb70fd2a9ab69fb35e1793f71df9d399c5..6bf5293913f5779234d2ce349099a394138d4d8a 100644 (file)
@@ -26,7 +26,7 @@
 use std::prettyprint;
 use std::time;
 
-fn test_prettyprint<A: Encodable<prettyprint::Serializer>>(
+fn test_prettyprint<A:Encodable<prettyprint::Serializer>>(
     a: &A,
     expected: &~str
 ) {
index 8f7a88f19a73aa40012a2fe2f524f84fd4c276a1..4075ec5603813c5fff5ff51a0559d078f9fce5e6 100644 (file)
@@ -16,7 +16,7 @@
 struct Pair<T, U> { a: T, b: U }
 struct Triple { x: int, y: int, z: int }
 
-fn f<T: Copy, U: Copy>(x: T, y: U) -> Pair<T, U> { return Pair {a: x, b: y}; }
+fn f<T:Copy,U:Copy>(x: T, y: U) -> Pair<T, U> { return Pair {a: x, b: y}; }
 
 pub fn main() {
     log(debug, f(Triple {x: 3, y: 4, z: 5}, 4).a.x);
index 0b969540d74c0eb7c0ac44a61d3e636370a4ed76..316627e349be0e697044a61934cd1e8dfbaecc36 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-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 53dd6f942e8609627b65c515d3d8d3ebac63a0c8..b44d1cbb78d48a6dc986780e3480c19eb610950f 100644 (file)
@@ -16,7 +16,7 @@ impl double for uint {
     fn double() -> uint { self * 2u }
 }
 
-fn is_equal<D: double>(x: @D, exp: uint) {
+fn is_equal<D:double>(x: @D, exp: uint) {
     assert x.double() == exp;
 }
 
index 60f19b4db0a7d5f6385cdc1025dfa0cae940ed1c..8bc02eb2f9f3f26fd13fe8473b3bdf217558c556 100644 (file)
@@ -12,7 +12,7 @@ trait Foo {
     fn foo(&self) -> ~str;
 }
 
-impl<T: Foo> Foo for @T {
+impl<T:Foo> Foo for @T {
     fn foo(&self) -> ~str {
         fmt!("@%s", (**self).foo())
     }
index fdf4a16156064e3c539ee5cf7cb58fc9dfb3e888..b51481f1ea1a1df80a5efc62feaa485a9f9113f7 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn foo<T: Copy>(x: &T) -> T{
+fn foo<T:Copy>(x: &T) -> T{
     match x {
         &a => a
     }
index 6889d764cbbb04d1a55a6a690a09a53286d2d82f..1efe12c1a3c18709e9f37e238f80e927cad3e5d0 100644 (file)
@@ -12,7 +12,7 @@
 
 struct Box<T> {c: @T}
 
-fn unbox<T: Copy>(b: Box<T>) -> T { return *b.c; }
+fn unbox<T:Copy>(b: Box<T>) -> T { return *b.c; }
 
 pub fn main() {
     let foo: int = 17;
index 1d1b07ae32461bf8ced75a413620dddaa7831757..f81b12b555e4b7494aaa5348aeb79be3824ece57 100644 (file)
@@ -14,7 +14,7 @@
 use core::to_str::ToStr;
 use cci_class_cast::kitty::*;
 
-fn print_out<T: ToStr>(thing: T, expected: ~str) {
+fn print_out<T:ToStr>(thing: T, expected: ~str) {
   let actual = thing.to_str();
   debug!("%s", actual);
   assert(actual == expected);
index 36e6c6b487d5a40fc80b36ea9cbb223e18f83e68..d21ff90e7fbd57e1d8ced9572a42a63734a8310f 100644 (file)
@@ -48,7 +48,7 @@ fn eat() -> bool {
   fn to_str() -> str { self.name }
 }
 
-fn print_out<T: to_str>(thing: T, expected: str) {
+fn print_out<T:to_str>(thing: T, expected: str) {
   let actual = thing.to_str();
   debug!("%s", actual);
   assert(actual == expected);
index b72a8e5da27108ef106afcef0660a6ee1c35714b..f35a91c2b914f0dfde7eca6d32f38c8da7458b4d 100644 (file)
@@ -79,7 +79,7 @@ fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
 }
 
 
-fn annoy_neighbors<T: noisy>(critter: T) {
+fn annoy_neighbors<T:noisy>(critter: T) {
   for uint::range(0u, 10u) |i| { critter.speak(); }
 }
 
index 06a2dbeb9a4996190d54311d26c8cb04ec1d86b4..15564d73e1f70987d18a027f6b0ed58ad4858022 100644 (file)
@@ -59,7 +59,7 @@ fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
 }
 
 
-fn make_speak<C: noisy>(c: C) {
+fn make_speak<C:noisy>(c: C) {
     c.speak();
 }
 
index 6d2fb9843652ed140d54e6fc97bf5273da9da8eb..a05b74c9a3c551dd28bdc91a5c04602a526faaeb 100644 (file)
@@ -96,14 +96,14 @@ fn bite() -> body_part {
   }
 }
 
-fn annoy_neighbors<T: noisy>(critter: T) {
+fn annoy_neighbors<T:noisy>(critter: T) {
   for uint::range(0u, 10u) |i| {
       let what = critter.speak();
       debug!("%u %d", i, what);
   }
 }
 
-fn bite_everything<T: bitey>(critter: T) -> bool {
+fn bite_everything<T:bitey>(critter: T) -> bool {
   let mut left : ~[body_part] = ~[finger, toe, nose, ear];
   while vec::len(left) > 0u {
     let part = critter.bite();
@@ -118,7 +118,7 @@ fn bite_everything<T: bitey>(critter: T) -> bool {
   true
 }
 
-fn scratched_something<T: scratchy>(critter: T) -> bool {
+fn scratched_something<T:scratchy>(critter: T) -> bool {
   option::is_some(critter.scratch())
 }
 
index 919fb058a953aa65936dd777f495d08e2035eacc..fda358a86a2f50415b3f3c837e227439155141c8 100644 (file)
@@ -57,7 +57,7 @@ impl ToStr for cat {
   pure fn to_str(&self) -> ~str { copy self.name }
 }
 
-fn print_out<T: ToStr>(thing: T, expected: ~str) {
+fn print_out<T:ToStr>(thing: T, expected: ~str) {
   let actual = thing.to_str();
   debug!("%s", actual);
   assert(actual == expected);
index e3c4703432fecd979a9c7e79e7b980e824e16d1f..5e39b18db737536131095cf51f130bee757832e0 100644 (file)
@@ -13,7 +13,7 @@
 extern mod std;
 use std::oldmap::{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 d218519a4f3e55544a0316fce0dafcf44939ad2e..32f39177e1c065453b8434bc0ccbba7c406921fa 100644 (file)
@@ -16,7 +16,7 @@
     a: A, b: B
 };
 
-fn f<A:Copy &static>(a: A, b: u16) -> fn@() -> (A, u16) {
+fn f<A:Copy &static>(a: A, b: u16) -> fn@() -> (A, u16) {
     fn@() -> (A, u16) { (a, b) }
 }
 
index 2320a5b1aa389eb89377bf53c10a49cabbf69a6e..d4467ca0c7a060b2e15e8d90bf7a8b9de930827c 100644 (file)
@@ -12,7 +12,7 @@
 // are const.
 
 
-fn foo<T: Copy Const>(x: T) -> T { x }
+fn foo<T:Copy + Const>(x: T) -> T { x }
 
 struct F { field: int }
 
index 80c18ca0974a4a787cfb2e02d189af6143ecdb69..e226423f848054beb1725c083b7794cd496715f6 100644 (file)
@@ -13,7 +13,7 @@ pub trait ReaderUtil {
     fn read_bytes(&self, len: uint);
 }
 
-impl<T: Reader> ReaderUtil for T {
+impl<T:Reader> ReaderUtil for T {
 
     fn read_bytes(&self, len: uint) {
         let mut count = self.read(&mut [0], len);
index 80c18ca0974a4a787cfb2e02d189af6143ecdb69..e226423f848054beb1725c083b7794cd496715f6 100644 (file)
@@ -13,7 +13,7 @@ pub trait ReaderUtil {
     fn read_bytes(&self, len: uint);
 }
 
-impl<T: Reader> ReaderUtil for T {
+impl<T:Reader> ReaderUtil for T {
 
     fn read_bytes(&self, len: uint) {
         let mut count = self.read(&mut [0], len);
index a32ac955b946b7116afec5e996841feb588fecfc..1a18ee7c6f750df24e38cc5eea8c0e2caa118d15 100644 (file)
@@ -13,7 +13,7 @@ pub trait ReaderUtil {
     fn read_bytes(len: uint);
 }
 
-impl<T: Reader> ReaderUtil for T {
+impl<T:Reader> ReaderUtil for T {
 
     fn read_bytes(len: uint) {
         let mut count = self.read(&mut [0], len);
index ca7764f96f4f198b5260e9ed0170ef168b236724..a5d934d99849413c2e1356aab16173f2c48056d0 100644 (file)
@@ -13,7 +13,7 @@ pub trait ReaderUtil {
     fn read_bytes(len: uint);
 }
 
-impl<T: Reader> ReaderUtil for T {
+impl<T:Reader> ReaderUtil for T {
 
     fn read_bytes(len: uint) {
         let mut count = self.read(&mut [0], len);
index 9176e8672b2e1bfa0cbf66ec9455adc2a7eb5a4e..224ae2cf78e2386c9ee17824d5b2fb6dfc1566ca 100644 (file)
@@ -15,7 +15,7 @@
 
 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 36c591da853b2b53276b2112c1f4114ca98f304a..ec51fabd4a75078fb72f5674cf4561263ed2f46a 100644 (file)
@@ -13,7 +13,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 => { copy expected },
         _ => fail!(~"wat")
index 2a504c2e2bd4f7417fa7da2c65c6942aaf1c6fa8..cb641b493e0a456ea08a0f1c2fd5eb5d4ff99593 100644 (file)
@@ -15,7 +15,7 @@
 
 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 => copy expected,
         _ => fail!(~"wat")
index d631e4eac5ebfbe2d2366619e6cabf45ce5c3793..95710eecddb8694f8c30eb72f8ce67bd441df825 100644 (file)
@@ -14,7 +14,7 @@
 
 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 94627082eb47f72ce0f4cd3f805191d3ba164b5f..3851578d54748a2339ff3aae488617807832afd8 100644 (file)
@@ -14,7 +14,7 @@
 
 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 b3637f805356a3a56dacb911c019e6f6e09990c1..c4efe32a31ec1a766337acfa04646069fac4c3a5 100644 (file)
@@ -13,7 +13,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 = { copy expected };
     assert (eq(expected, actual));
 }
index 39585f7cc67715f3662b36789599f1f8d83cea17..b0a056e889180987037349a7c99a79b478ab10d4 100644 (file)
@@ -14,7 +14,7 @@
 
 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 dca3030df14f7339c8720c5553dbefcdf0c2d811..3d1ef7dbea2c82f6d8692bbccad78c9ca4b14908 100644 (file)
@@ -16,7 +16,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 727524f56776394d40c50c26c7fdae213cd03c21..0db78f776c45e32222456e21ae27cddce109f125 100644 (file)
@@ -19,7 +19,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 c1bd2589301279cfafb778aa091b86869fe50fb3..5a879071a8814ee85156152e09d2dfaca15414d4 100644 (file)
@@ -14,7 +14,7 @@
 
 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 537f6039af8e67455cd957441445017564fadbd9..179268a22b802f1cc0f65da0422588a7d4beddc3 100644 (file)
@@ -15,7 +15,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 e41fa1af90f7fe216acaea5a33ba284cdc66b218..8547180b933ff451f08bf269fa5bb0867073d840 100644 (file)
 // xfail-fast
 #[legacy_modes];
 
-fn fix_help<A: &static, B: Owned>(f: extern fn(fn@(A) -> B, A) -> B, x: A) -> B {
+fn fix_help<A:&static,B:Owned>(f: extern fn(fn@(A) -> B, A) -> B, x: A) -> B {
     return f(|a| fix_help(f, a), x);
 }
 
-fn fix<A: &static, B: Owned>(f: extern fn(fn@(A) -> B, A) -> B) -> fn@(A) -> B {
+fn fix<A:&static,B:Owned>(f: extern fn(fn@(A) -> B, A) -> B) -> fn@(A) -> B {
     return |a| fix_help(f, a);
 }
 
index c875b805ea3ca9e185e11c9b57b7c95c90aeca74..9b2a8d0c68177ac2c05f1505110f0888a5d01146 100644 (file)
@@ -10,7 +10,7 @@
 
 // This is what the signature to spawn should look like with bare functions
 
-fn spawn<T: Owned>(val: T, f: extern fn(T)) {
+fn spawn<T:Owned>(val: T, f: extern fn(T)) {
     f(val);
 }
 
index 3830d89616cb3f10e53f2dffcf1e1c9a16ef7ffd..95902acc8487a47cf0a78a6900d1406e61ff42b7 100644 (file)
@@ -10,7 +10,7 @@
 
 
 
-fn id<T: Copy>(t: T) -> T { return t; }
+fn id<T:Copy>(t: T) -> T { return t; }
 
 pub fn main() {
     let expected = @100;
index 0aa1b4dd6510b853eaa2662774cc4363b94f3151..3cb6409a254e1a206091143202dc459f4cfbbfd0 100644 (file)
@@ -10,7 +10,7 @@
 
 
 
-fn id<T: Copy Owned>(t: T) -> T { return t; }
+fn id<T:Copy + Owned>(t: T) -> T { return t; }
 
 pub fn main() {
     let expected = ~100;
index 05f4908b3b282231071caab1fde7b14a995e9e0f..43c6acd3f3da06b1f55a97a88a23a8c061bbcf83 100644 (file)
@@ -10,7 +10,7 @@
 
 
 
-fn box<T: Copy>(x: Box<T>) -> @Box<T> { return @x; }
+fn box<T:Copy>(x: Box<T>) -> @Box<T> { return @x; }
 
 struct Box<T> {x: T, y: T, z: T}
 
index 3667e54974590af123a7a3151080554cc5e4594d..264703439e810591095324878c52e7b65e191a15 100644 (file)
 
 
 
-fn g<X: Copy>(x: X) -> X { return x; }
+fn g<X:Copy>(x: X) -> X { return x; }
 
 struct Pair<T> {a: T, b: T}
 
-fn f<T: Copy>(t: T) -> Pair<T> {
+fn f<T:Copy>(t: T) -> Pair<T> {
 
     let x: Pair<T> = Pair {a: t, b: t};
     return g::<Pair<T>>(x);
index b8de3e0b5e3cd25f816aa1d16f1b6fd19d720090..19e11197fd91394474e4d8b701cce2d4179b2aa6 100644 (file)
@@ -11,6 +11,6 @@
 
 struct Pair { x: @int, y: @int }
 
-fn f<T: Copy>(t: T) { let t1: T = t; }
+fn f<T:Copy>(t: T) { let t1: T = t; }
 
 pub fn main() { let x = Pair {x: @10, y: @12}; f(x); }
index 4c8de2fbffca4c70f0fd060d5d096ea3eb58b8ec..7039fad1a9a2d40c9cb0a8b75e16cac61c19cd98 100644 (file)
@@ -12,7 +12,7 @@
 
 struct Recbox<T> {x: @T}
 
-fn reclift<T: Copy>(t: T) -> Recbox<T> { return Recbox {x: @t}; }
+fn reclift<T:Copy>(t: T) -> Recbox<T> { return Recbox {x: @t}; }
 
 pub fn main() {
     let foo: int = 17;
index 741d9f0e17943db2b28587662fb38a56ded4a027..3d3cc028f35831d3ee8724b98e3857aa0e862a12 100644 (file)
@@ -10,7 +10,7 @@
 
 struct Recbox<T> {x: ~T}
 
-fn reclift<T: Copy>(t: T) -> Recbox<T> { return Recbox {x: ~t}; }
+fn reclift<T:Copy>(t: T) -> Recbox<T> { return Recbox {x: ~t}; }
 
 pub fn main() {
     let foo: int = 17;
index 88130af2cccb289337222024f9a2f653f7230901..fcd356bcd2d835e123aa52f610a9c0fae73e412f 100644 (file)
@@ -14,6 +14,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; }
 
 pub fn main() { let x: int = 42; let y: int = id(x); assert (x == y); }
index b58b68ee5aea7531a8da06862d95aba626c1ae71..d41cd86bcc147f6100ee9b5fb5f2106d32201cb7 100644 (file)
@@ -9,6 +9,6 @@
 // except according to those terms.
 
 
-fn f<T: Copy>(x: ~T) -> ~T { return x; }
+fn f<T:Copy>(x: ~T) -> ~T { return x; }
 
 pub fn main() { let x = f(~3); log(debug, *x); }
index 551fe221edaffbc3c38a35bb3d0859fbf7e3e1ba..2fad81f4db20a3aed9ba31fe4cfad055e59489a1 100644 (file)
@@ -12,7 +12,7 @@
 
 
 // -*- rust -*-
-fn id<T: Copy>(x: T) -> T { return x; }
+fn id<T:Copy>(x: T) -> T { return x; }
 
 struct Triple {x: int, y: int, z: int}
 
index 8db1c4673bd4b54456532061bf3baaf459b19ff6..3f6f8e7af688105975ed873475739fb9f77a6c65 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-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; }
 
 pub fn main() {
     log(debug, get_third((1, 2, 3)));
index 0ae417e711e3665fa8cbc1cb6bd2356035759b6a..dc88f7acfbdf35a7892c9d6e8819afb0fd49c0fa 100644 (file)
@@ -10,7 +10,7 @@
 
 struct Triple<T> { x: T, y: T, z: T }
 
-fn box<T: Copy>(x: Triple<T>) -> ~Triple<T> { return ~x; }
+fn box<T:Copy>(x: Triple<T>) -> ~Triple<T> { return ~x; }
 
 pub fn main() {
     let x: ~Triple<int> = box::<int>(Triple{x: 1, y: 2, z: 3});
index 1c4f21c6288671c75934a66fd5a1141c04260940..ebf7eec470c3ebaab9a083b863db211b20a5d5c9 100644 (file)
@@ -12,7 +12,7 @@ trait Send {
     fn f();
 }
 
-fn f<T: Send>(t: T) {
+fn f<T:Send>(t: T) {
     t.f();
 }
 
index 99c9828bfeaa00a366f8791fb1b5f5c3bf92b312..375259baaf527091a7b62d25e9fd0c9d821bf8e2 100644 (file)
@@ -8,25 +8,25 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-trait clam<A: Copy> {
+trait clam<A:Copy> {
   fn chowder(y: A);
 }
 struct foo<A> {
   x: A,
 }
 
-impl<A: Copy> clam<A> for foo<A> {
+impl<A:Copy> clam<A> for foo<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 8e4036b36be6b5a10609c376dd1d3ff08ffb7552..b4141b47b4d6733cb9f15ac82c69dafce23206e3 100644 (file)
@@ -8,18 +8,18 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-trait clam<A: Copy> { }
+trait clam<A:Copy> { }
 struct foo<A> {
     x: A,
 }
 
-impl<A: Copy> foo<A> {
+impl<A:Copy> foo<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 2fce24c0670cf882e51cefe05e0ebd02d4945354..9869b8d330bf191060ae3d15b932c36fc618b661 100644 (file)
@@ -12,18 +12,18 @@ struct c1<T> {
     x: T,
 }
 
-impl<T: Copy> c1<T> {
+impl<T:Copy> c1<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 ea1cec61867e217c68e27cdb00ada4ceb41f551f..4a085a1eb8a97db65576f43f86368bf4e4d6c821 100644 (file)
@@ -12,17 +12,17 @@ struct c1<T> {
     x: T,
 }
 
-impl<T: Copy> c1<T> {
+impl<T:Copy> c1<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 8472f0158bb62d5c508bdecbd3e1a00971097715..029fe12fcd9847e8d617b62987f8000fe1accb13 100644 (file)
@@ -34,7 +34,7 @@ pub enum state {
         mut payload: Option<T>
     };
 
-    pub fn packet<T: Owned>() -> *packet<T> {
+    pub fn packet<T:Owned>() -> *packet<T> {
         unsafe {
             let p: *packet<T> = cast::transmute(~Stuff{
                 mut state: empty,
@@ -70,7 +70,7 @@ pub fn swap_state_rel(+dst: &mut state, src: state) -> state {
         }
     }
 
-    pub fn send<T: Owned>(-p: send_packet<T>, -payload: T) {
+    pub fn send<T:Owned>(-p: send_packet<T>, -payload: T) {
         let p = p.unwrap();
         let p = unsafe { uniquify(p) };
         assert (*p).payload.is_none();
@@ -96,7 +96,7 @@ pub fn send<T: Owned>(-p: send_packet<T>, -payload: T) {
         }
     }
 
-    pub fn recv<T: Owned>(-p: recv_packet<T>) -> Option<T> {
+    pub fn recv<T:Owned>(-p: recv_packet<T>) -> Option<T> {
         let p = p.unwrap();
         let p = unsafe { uniquify(p) };
         loop {
@@ -117,7 +117,7 @@ pub fn recv<T: Owned>(-p: recv_packet<T>) -> Option<T> {
         }
     }
 
-    pub fn sender_terminate<T: Owned>(p: *packet<T>) {
+    pub fn sender_terminate<T:Owned>(p: *packet<T>) {
         let p = unsafe { uniquify(p) };
         match swap_state_rel(&mut (*p).state, terminated) {
           empty | blocked => {
@@ -134,7 +134,7 @@ pub fn sender_terminate<T: Owned>(p: *packet<T>) {
         }
     }
 
-    pub fn receiver_terminate<T: Owned>(p: *packet<T>) {
+    pub fn receiver_terminate<T:Owned>(p: *packet<T>) {
         let p = unsafe { uniquify(p) };
         match swap_state_rel(&mut (*p).state, terminated) {
           empty => {
@@ -155,7 +155,7 @@ pub struct send_packet<T> {
         mut p: Option<*packet<T>>,
     }
 
-    pub impl<T: Owned> Drop for send_packet<T> {
+    pub impl<T:Owned> Drop for send_packet<T> {
         fn finalize(&self) {
             if self.p != None {
                 let mut p = None;
@@ -165,7 +165,7 @@ fn finalize(&self) {
         }
     }
 
-    pub impl<T: Owned> send_packet<T> {
+    pub impl<T:Owned> send_packet<T> {
         fn unwrap() -> *packet<T> {
             let mut p = None;
             p <-> self.p;
@@ -173,7 +173,7 @@ fn unwrap() -> *packet<T> {
         }
     }
 
-    pub fn send_packet<T: Owned>(p: *packet<T>) -> send_packet<T> {
+    pub fn send_packet<T:Owned>(p: *packet<T>) -> send_packet<T> {
         send_packet {
             p: Some(p)
         }
@@ -183,7 +183,7 @@ pub struct recv_packet<T> {
         mut p: Option<*packet<T>>,
     }
 
-    pub impl<T: Owned> Drop for recv_packet<T> {
+    pub impl<T:Owned> Drop for recv_packet<T> {
         fn finalize(&self) {
             if self.p != None {
                 let mut p = None;
@@ -193,7 +193,7 @@ fn finalize(&self) {
         }
     }
 
-    pub impl<T: Owned> recv_packet<T> {
+    pub impl<T:Owned> recv_packet<T> {
         fn unwrap() -> *packet<T> {
             let mut p = None;
             p <-> self.p;
@@ -201,13 +201,13 @@ fn unwrap() -> *packet<T> {
         }
     }
 
-    pub fn recv_packet<T: Owned>(p: *packet<T>) -> recv_packet<T> {
+    pub fn recv_packet<T:Owned>(p: *packet<T>) -> recv_packet<T> {
         recv_packet {
             p: Some(p)
         }
     }
 
-    pub fn entangle<T: Owned>() -> (send_packet<T>, recv_packet<T>) {
+    pub fn entangle<T:Owned>() -> (send_packet<T>, recv_packet<T>) {
         let p = packet();
         (send_packet(p), recv_packet(p))
     }
index ed7b032e7139e33ae541af39fcb2ff769d00922d..45c6b22544d9cb3e1c499b1d6105f7e8efe207b3 100644 (file)
@@ -11,7 +11,7 @@
 trait hax { } 
 impl<A> hax for A { } 
 
-fn perform_hax<T: &static>(x: @T) -> hax {
+fn perform_hax<T:&static>(x: @T) -> hax {
     x as hax 
 }
 
index 8a6f2a0b461bf7efab9be2c0d597ccd1c178f614..7c87c6a31cde1a0c1d864794a0a5c84faac8febb 100644 (file)
@@ -11,7 +11,7 @@
 trait hax { } 
 impl<A> hax for A { } 
 
-fn perform_hax<T: &static>(x: @T) -> hax {
+fn perform_hax<T:&static>(x: @T) -> hax {
     x as hax 
 }
 
index 84e0f20e61b11eb40e44005c2fb4250d3e1c3576..579c4f9f1d124f26b18d2a921a3bb9b313ccd4f8 100644 (file)
@@ -12,7 +12,7 @@
 //
 
 proto! streamp (
-    open:send<T: Owned> {
+    open:send<T:Owned> {
         data(T) -> open<T>
     }
 )
index 53dd6f942e8609627b65c515d3d8d3ebac63a0c8..b44d1cbb78d48a6dc986780e3480c19eb610950f 100644 (file)
@@ -16,7 +16,7 @@ impl double for uint {
     fn double() -> uint { self * 2u }
 }
 
-fn is_equal<D: double>(x: @D, exp: uint) {
+fn is_equal<D:double>(x: @D, exp: uint) {
     assert x.double() == exp;
 }
 
index 8b863bd90b64da0f2240649d0a582f2afbe65147..1f9dd6e3b6f3cccb8848913492da682c34c36440 100644 (file)
@@ -8,8 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-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; }
 
 pub fn main() { assert (quux(10) == 10); }
index 252ebb86685ec70f1b0d6ab185c378ab0aab90a3..e813cde7c2760bd63d26992d9648702aedd0df95 100644 (file)
@@ -9,14 +9,14 @@
 // except according to those terms.
 
 // xfail-test
-type IMap<K: Copy, V: Copy> = ~[(K, V)];
+type IMap<K:Copy,V:Copy> = ~[(K, V)];
 
-trait ImmutableMap<K: Copy, V: Copy>
+trait ImmutableMap<K:Copy,V:Copy>
 {
     pure fn contains_key(key: K) -> bool;
 }
 
-impl<K: Copy, V: Copy> IMap<K, V> : ImmutableMap<K, V>
+impl<K:Copy,V:Copy> IMap<K, V> : ImmutableMap<K, V>
 {
     pure fn contains_key(key: K) -> bool
     {
index 307d7974762f733ac9d923454507b420d931f5a2..69cd1a2a19d86f3d19c97659fab848dea1772f7f 100644 (file)
@@ -18,7 +18,7 @@
 trait JD : Deserializable<json::Deserializer> { }
 //type JD = Deserializable<json::Deserializer>;
 
-fn exec<T: JD>() {
+fn exec<T:JD>() {
     let doc = result::unwrap(json::from_str(""));
     let _v: T = deserialize(&json::Deserializer(doc));
     fail!()
index f06185f37272e012ba5331f070331444ffd8ad8e..aa61a35d6e350dc1c4fcf1c7e62a197532207a3b 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-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 9447330fe07ede2efd91f1da45365efb174cdf88..5a3adc14e433baadb077eb2259840496d76f8c2d 100644 (file)
 #[legacy_modes];
 
 trait vec_monad<A> {
-    fn bind<B: Copy>(f: fn(A) -> ~[B]) -> ~[B];
+    fn bind<B:Copy>(f: fn(A) -> ~[B]) -> ~[B];
 }
 
 impl<A> vec_monad<A> for ~[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 b5af07207bccd2325f36732957af163aa014f2b1..88c317a3c0735f52321dae481d680a85ba076e3d 100644 (file)
@@ -14,17 +14,17 @@ trait Serializer {
 }
 
 trait Serializable {
-    fn serialize<S: Serializer>(s: S);
+    fn serialize<S:Serializer>(s: S);
 }
 
 impl Serializable for int {
-    fn serialize<S: Serializer>(_s: S) { }
+    fn serialize<S:Serializer>(_s: S) { }
 }
 
 struct F<A> { a: A }
 
-impl<A: Copy Serializable> Serializable for F<A> {
-    fn serialize<S: Serializer>(s: S) {
+impl<A:Copy + Serializable> Serializable for F<A> {
+    fn serialize<S:Serializer>(s: S) {
         self.a.serialize(s);
     }
 }
index dfa1008a69e304a7e1cb41668a415dfb1f51f269..01e554ad04128c80357842b21006708fa554c873 100644 (file)
@@ -10,9 +10,9 @@
 
 enum myvec<X> = ~[X];
 
-fn myvec_deref<X: Copy>(mv: myvec<X>) -> ~[X] { return copy *mv; }
+fn myvec_deref<X:Copy>(mv: myvec<X>) -> ~[X] { return copy *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]; }
 
 pub fn main() {
     let mv = myvec(~[1, 2, 3]);
index 3fb9a557fa18c65c4c53a9eb8e21f57ce641931e..931c4cbad79c441ed74147262b0451f5369405ab 100644 (file)
 
 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_empty(ls);
     return head(ls);
 }
index bc218e71ede9b690b62f1e4a228c20562a9fb143..0016d792c0d0f14f50e499b839b88c14da713e48 100644 (file)
@@ -47,7 +47,7 @@ macro_rules! move_it (
     { $x:expr } => { unsafe { let y = *ptr::addr_of(&($x)); y } }
 )
 
-fn switch<T: Owned, U>(+endp: pipes::RecvPacket<T>,
+fn switch<T:Owned,U>(+endp: pipes::RecvPacket<T>,
                       f: fn(+v: Option<T>) -> U) -> U {
     f(pipes::try_recv(endp))
 }
index 3694ffdfde02f1c80babbc971152368423e2c5be..890599f9b8bf4d16eb177e51618555f822abb256 100644 (file)
@@ -31,7 +31,7 @@ fn align(size: uint, align: uint) -> uint {
 
 enum ptr_visit_adaptor<V> = Inner<V>;
 
-impl<V: TyVisitor movable_ptr> ptr_visit_adaptor<V> {
+impl<V:TyVisitor + movable_ptr> ptr_visit_adaptor<V> {
 
     #[inline(always)]
     fn bump(sz: uint) {
@@ -59,7 +59,7 @@ fn bump_past<T>() {
 
 }
 
-impl<V: TyVisitor movable_ptr> TyVisitor for ptr_visit_adaptor<V> {
+impl<V:TyVisitor + movable_ptr> TyVisitor for ptr_visit_adaptor<V> {
 
     fn visit_bot(&self) -> bool {
         self.align_to::<()>();
index eb25f20607f41544b9e554468e7f9375b82e58c4..347c14538a10dd1004adbc48c364fb845cb68f8d 100644 (file)
@@ -17,13 +17,13 @@ struct finish<T> {
   arg: Arg<T>
 }
 
-impl<T: Copy> Drop for finish<T> {
+impl<T:Copy> Drop for finish<T> {
     fn finalize(&self) {
         (self.arg.fin)(self.arg.val);
     }
 }
 
-fn finish<T: Copy>(arg: Arg<T>) -> finish<T> {
+fn finish<T:Copy>(arg: Arg<T>) -> finish<T> {
     finish {
         arg: arg
     }
index 97fa11bef1b2a30706b5484c43d5647344a050ad..e70c72f550d0d7fb2e6e611ab27c8bf9b46319a0 100644 (file)
@@ -21,7 +21,7 @@ fn iter<T>(v: ~[T], it: fn(T) -> bool) {
     }
 }
 
-fn find_pos<T:Eq Copy>(n: T, h: ~[T]) -> Option<uint> {
+fn find_pos<T:Eq Copy>(n: T, h: ~[T]) -> Option<uint> {
     let mut i = 0u;
     for iter(copy h) |e| {
         if e == n { return Some(i); }
index 1df01a5e579332025154ebc056620433103443d4..d493f23ba8400a4d16bfb25506212d3d927b2b02 100644 (file)
@@ -12,6 +12,6 @@
 
 enum option<T> { none, some(T), }
 
-fn f<T: Copy>() -> option<T> { return none; }
+fn f<T:Copy>() -> option<T> { return none; }
 
 pub fn main() { f::<int>(); }
index bf1ab6e07d2e52c001cdd93156fa81dca3def525..77f0614036941b646be7bb0383db3fa0e27b8e7a 100644 (file)
@@ -13,7 +13,7 @@
 // tests that ctrl's type gets inferred properly
 type command<K, V> = {key: K, val: V};
 
-fn cache_server<K: Owned, V: Owned>(c: Chan<Chan<command<K, V>>>) {
+fn cache_server<K:Owned,V:Owned>(c: Chan<Chan<command<K, V>>>) {
     let (ctrl_port, ctrl_chan) = stream();
     c.send(ctrl_chan);
 }
index be4b609afab109fb9fa1fc71b1263fbec89e9fdb..2dc008931e4902f361c95a4990e071dbf4f6ada3 100644 (file)
@@ -15,7 +15,7 @@
 
 struct 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 Pair {a: a, b: b};
 }
 
@@ -31,7 +31,7 @@ fn test05_start(&&f: fn~(&&v: float, &&v: ~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 5e7785c2dbbe81c1f57e69f1ac7ed6955e3bcb6e..5cc54da28b22c5b3310cff2684cf57523011d1a7 100644 (file)
@@ -41,13 +41,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> vec_utils<T> for ~[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 328a937b441feeb84c8c26032b5f6fe2d08c4389..9a9533d7c8a3b84df7f259ddd2e016fab0e9d72b 100644 (file)
@@ -12,11 +12,11 @@ trait Deserializer {
     fn read_int() -> int;
 }
 
-trait Deserializable<D: Deserializer> {
+trait Deserializable<D:Deserializer> {
     static fn deserialize(d: &D) -> Self;
 }
 
-impl<D: Deserializer> Deserializable<D> for int {
+impl<D:Deserializer> Deserializable<D> for int {
     static fn deserialize(d: &D) -> int {
         return d.read_int();
     }
index da79bf53fe06c9deedfc4c19c2249fb58d265b21..d9461c48be8a84eb7808634171f4618da2cbc525 100644 (file)
@@ -17,7 +17,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 {
     bool_like::select(x1, x2, x1)
 }
 
@@ -70,7 +70,7 @@ fn map<T, IT: BaseIter<T>, U, BU: buildable<U>>
     }
 }
 
-fn seq_range<BT: buildable<int>>(lo: uint, hi: uint) -> BT {
+fn seq_range<BT:buildable<int>>(lo: uint, hi: uint) -> BT {
     do buildable::build_sized(hi-lo) |push| {
         for uint::range(lo, hi) |i| {
             push(i as int);
index 2e093d6d63163dd6aefc19b36344ad301933e588..1775bba934c9394505458da39a4aa2b445a509c5 100644 (file)
@@ -12,7 +12,7 @@ trait connection {
     fn read() -> int;
 }
 
-trait connection_factory<C: connection> {
+trait connection_factory<C:connection> {
     fn create() -> C;
 }
 
index 62d1c00eea944fd8a85b6971027b4ca750363e83..e0e3c6e15975ce681e1eaf6b5f1dc8e5f8225537 100644 (file)
@@ -21,7 +21,7 @@ trait to_str {
     fn to_str() -> ~str;
 }
 
-impl<T: to_str> to_str for Option<T> {
+impl<T:to_str> to_str for Option<T> {
     fn to_str() -> ~str {
         match self {
           None => { ~"none" }
@@ -42,7 +42,7 @@ fn to_str() -> ~str {
     }
 }
 
-fn foo<T: to_str>(x: T) -> ~str { x.to_str() }
+fn foo<T:to_str>(x: T) -> ~str { x.to_str() }
 
 pub fn main() {
     let t1 = Tree(@TreeR{mut left: None,
index ab2f1928d1f30587a1b8f192bf124ae72dade373..be50b4340553cf5b385f1bcbe13bdf259db4fc77 100644 (file)
@@ -16,7 +16,7 @@ fn g() -> int { 10 }
 
 impl A for int { }
 
-fn f<T: A>(i: T) {
+fn f<T:A>(i: T) {
     assert i.g() == 10;
 }
 
index 80b1b1eba39ef612abe9eea978fc70a92ed0786d..ff902490e7c27f208e640f2d66c2030af767a542 100644 (file)
@@ -25,10 +25,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> map<T> for ~[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
@@ -38,7 +38,7 @@ fn map<U: Copy>(f: fn(T) -> U) -> ~[U] {
 fn foo<U, T: map<U>>(x: T) -> ~[~str] {
     x.map(|_e| ~"hi" )
 }
-fn bar<U: to_str, T: map<U>>(x: T) -> ~[~str] {
+fn bar<U:to_str,T:map<U>>(x: T) -> ~[~str] {
     x.map(|_e| _e.to_str() )
 }
 
index b8e060ee914310f661ac5a5e291d49d96fa79445..c3333fa10ab17f0321b2aae7279a8aa8326da2ee 100644 (file)
@@ -18,9 +18,9 @@
 
 // We want to extend all Foo, Bar, Bazes to Quuxes
 pub trait Quux: Foo Bar Baz { }
-impl<T: Foo Bar Baz> Quux for T { }
+impl<T:Foo + Bar + Baz> Quux for T { }
 
-fn f<T: Quux>(a: &T) {
+fn f<T:Quux>(a: &T) {
     assert a.f() == 10;
     assert a.g() == 20;
     assert a.h() == 30;
index f0fa291f00c1529e1396f17cf528df895263ce29..302076da7a2211e9ebb538eb6e243508d66b81bc 100644 (file)
@@ -21,7 +21,7 @@ impl Foo for A { fn f() -> int { 10 } }
 impl Bar for A { fn g() -> int { 20 } }
 impl Baz for A { fn h() -> int { 30 } }
 
-fn f<T: Quux>(a: &T) {
+fn f<T:Quux>(a: &T) {
     assert a.f() == 10;
     assert a.g() == 20;
     assert a.h() == 30;
index 84e498c8ffd11e19f53e5507f7c6610a7a141a71..5d576193880e55430ed54e5126e8075cfa280676 100644 (file)
@@ -10,7 +10,7 @@
 
 // Testing that this impl turns A into a Quux, because
 // A is already a Foo Bar Baz
-impl<T: Foo Bar Baz> Quux for T { }
+impl<T:Foo + Bar + Baz> Quux for T { }
 
 trait Foo { fn f() -> int; }
 trait Bar { fn g() -> int; }
@@ -24,7 +24,7 @@ impl Foo for A { fn f() -> int { 10 } }
 impl Bar for A { fn g() -> int { 20 } }
 impl Baz for A { fn h() -> int { 30 } }
 
-fn f<T: Quux>(a: &T) {
+fn f<T:Quux>(a: &T) {
     assert a.f() == 10;
     assert a.g() == 20;
     assert a.h() == 30;
index 45498996ba5528bd2ed3dadc6cdd3f9f66e52bfe..11a0918ba78c0cb4a170db451a2411e34f6f48c3 100644 (file)
@@ -20,7 +20,7 @@ impl Baz for A { fn h() -> int { 30 } }
 
 // Call a function on Foo, given a T: Baz,
 // which is inherited via Bar
-fn gg<T: Baz>(a: &T) -> int {
+fn gg<T:Baz>(a: &T) -> int {
     a.f()
 }
 
index 1c914ebabc0a202c4abec3e6d6aa2b7229f38fc8..1d6e482309178f332810eb768907188cd9c33d11 100644 (file)
@@ -22,7 +22,7 @@ impl B for S { fn b(&self) -> int { 20 } }
 impl C for S { fn c(&self) -> int { 30 } }
 impl D for S { fn d(&self) -> int { 40 } }
 
-fn f<T: D>(x: &T) {
+fn f<T:D>(x: &T) {
     assert x.a() == 10;
     assert x.b() == 20;
     assert x.c() == 30;
index afcf5c87832acdf292ee4f0be8904c6925b09e5d..ad4d3ebc0b577a2788d776b51be10e9da0b4eddd 100644 (file)
@@ -19,7 +19,7 @@ impl B for S { fn b(&self) -> int { 20 } }
 impl C for S { fn c(&self) -> int { 30 } }
 
 // Both B and C inherit from A
-fn f<T: B C>(x: &T) {
+fn f<T:B + C>(x: &T) {
     assert x.a() == 10;
     assert x.b() == 20;
     assert x.c() == 30;
index a91a40ce2212a021a0b3e070699b5f14fc02983d..5b6a754488efbf8fb26113819e7986f8288bf68c 100644 (file)
@@ -19,7 +19,7 @@ impl B for S { fn b(&self) -> int { 20 } }
 impl C for S { fn c(&self) -> int { 30 } }
 
 // Multiple type params, multiple levels of inheritance
-fn f<X: A, Y: B, Z: C>(x: &X, y: &Y, z: &Z) {
+fn f<X:A,Y:B,Z:C>(x: &X, y: &Y, z: &Z) {
     assert x.a() == 10;
     assert y.a() == 10;
     assert y.b() == 20;
index f7798507871606301cf1d6c39cbdf5fc6f82e1b1..1d59f1fc19e135f892fec9a8654baa3f2c0e5abd 100644 (file)
@@ -14,7 +14,7 @@
 extern mod trait_inheritance_overloading_xc;
 use trait_inheritance_overloading_xc::{MyNum, MyInt};
 
-fn f<T:Copy MyNum>(x: T, y: T) -> (T, T, T) {
+fn f<T:Copy MyNum>(x: T, y: T) -> (T, T, T) {
     return (x + y, x - y, x * y);
 }
 
index f56a950f918ce2910b53a4b17d3817cb69258043..08f3d41ddad9bafbb8cbaf426b1515d92ff52d2c 100644 (file)
@@ -33,7 +33,7 @@ impl Eq for MyInt {
 
 impl MyNum for MyInt;
 
-fn f<T:Copy MyNum>(x: T, y: T) -> (T, T, T) {
+fn f<T:Copy MyNum>(x: T, y: T) -> (T, T, T) {
     return (x + y, x - y, x * y);
 }
 
index 6015eff8abe24002ab7eccbca43eaf566cec4e1e..8518137bbb8291ff9f3495ea87d75c548bbb369e 100644 (file)
@@ -15,11 +15,11 @@ impl Foo for int { fn f() -> int { 10 } }
 }
 
 trait Quux: traits::Foo { }
-impl<T: traits::Foo> Quux for T { }
+impl<T:traits::Foo> Quux for T { }
 
 // Foo is not in scope but because Quux is we can still access
 // Foo's methods on a Quux bound typaram
-fn f<T: Quux>(x: &T) {
+fn f<T:Quux>(x: &T) {
     assert x.f() == 10;
 }
 
index 08448a65ac805f39c9f2e4abbf586a42889430d8..55a63e9099a9379c0dc02b7245821c4b159fd254 100644 (file)
@@ -21,7 +21,7 @@ impl Bar for A { fn g() -> int { 20 } }
 impl Baz for A { fn h() -> int { 30 } }
 impl Quux for A;
 
-fn f<T: Quux Foo Bar Baz>(a: &T) {
+fn f<T:Quux + Foo + Bar + Baz>(a: &T) {
     assert a.f() == 10;
     assert a.g() == 20;
     assert a.h() == 30;
index b3ebc2ba820aabd2a9f00085b65d1afad5d8766a..20e23c0fc58e762b35166d347d0b899d284351c6 100644 (file)
@@ -24,7 +24,7 @@ impl to_str for int {
     fn to_str() -> ~str { int::str(self) }
 }
 
-impl<T: to_str> to_str for ~[T] {
+impl<T:to_str> to_str for ~[T] {
     fn to_str() -> ~str {
         ~"[" + str::connect(vec::map(self, |e| e.to_str() ), ~", ") + ~"]"
     }
@@ -34,12 +34,12 @@ pub fn main() {
     assert 1.to_str() == ~"1";
     assert (~[2, 3, 4]).to_str() == ~"[2, 3, 4]";
 
-    fn indirect<T: to_str>(x: T) -> ~str {
+    fn indirect<T:to_str>(x: T) -> ~str {
         x.to_str() + ~"!"
     }
     assert indirect(~[10, 20]) == ~"[10, 20]!";
 
-    fn indirect2<T: to_str>(x: T) -> ~str {
+    fn indirect2<T:to_str>(x: T) -> ~str {
         indirect(x)
     }
     assert indirect2(~[1]) == ~"[1]!";
index 95920bcc967d3c27eab02d296870c7e596d2fccd..684e0a8aaaed85ac876ba3c3df717b998763e17f 100644 (file)
@@ -12,8 +12,8 @@
 #[legacy_modes];
 
 fn p_foo<T>(pinned: T) { }
-fn s_foo<T: Copy>(shared: T) { }
-fn u_foo<T: Owned>(unique: T) { }
+fn s_foo<T:Copy>(shared: T) { }
+fn u_foo<T:Owned>(unique: T) { }
 
 struct r {
   i: int,
index 8de91acd18542e427633a46aace3d956f53a8cf4..dd86150b93bf9a5ff0caaca05073abdec34a267d 100644 (file)
@@ -18,7 +18,7 @@ struct Pointy {
     d : fn~() -> uint,
 }
 
-fn make_uniq_closure<A:Owned Copy>(a: A) -> fn~() -> uint {
+fn make_uniq_closure<A:Owned Copy>(a: A) -> fn~() -> uint {
     fn~() -> uint { ptr::addr_of(&a) as uint }
 }
 
index 9ad5575be9dad4071a5e7e8c502bd0f29bdccd53..d6992e4623fd061e85631021671ba44c2009b114 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn f<T: Copy>(t: T) -> T {
+fn f<T:Copy>(t: T) -> T {
     let t1 = t;
     t1
 }
index 5d3b550c4304ab1c3adc63f30e0b5e2828156c8b..ab92b10a3320bdca772a6aa365119dc09ec00a79 100644 (file)
@@ -10,7 +10,7 @@
 
 // Issue #976
 
-fn f<T: Copy>(x: ~T) {
+fn f<T:Copy>(x: ~T) {
     let _x2 = x;
 }
 pub fn main() { }
index 0cffa14fb70e53053e26caac02302503b4be1120..180ce716dcc9d6e5e42998e834a59b39e99fe18d 100644 (file)
 
 fn sendable() {
 
-    fn f<T: Owned Eq>(i: T, j: T) {
+    fn f<T:Owned + Eq>(i: T, j: T) {
         assert i == j;
     }
 
-    fn g<T: Owned Eq>(i: T, j: T) {
+    fn g<T:Owned + Eq>(i: T, j: T) {
         assert i != j;
     }
 
@@ -30,11 +30,11 @@ fn g<T: Owned 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;
     }
 
@@ -48,11 +48,11 @@ fn g<T: Copy Eq>(i: T, j: T) {
 
 fn noncopyable() {
 
-    fn f<T: Eq>(i: T, j: T) {
+    fn f<T:Eq>(i: T, j: T) {
         assert i == j;
     }
 
-    fn g<T: Eq>(i: T, j: T) {
+    fn g<T:Eq>(i: T, j: T) {
         assert i != j;
     }