]> git.lizzy.rs Git - rust.git/commitdiff
librustc: Remove all uses of the `Copy` bound.
authorPatrick Walton <pcwalton@mimiga.net>
Wed, 10 Jul 2013 21:43:25 +0000 (14:43 -0700)
committerPatrick Walton <pcwalton@mimiga.net>
Wed, 17 Jul 2013 21:57:53 +0000 (14:57 -0700)
94 files changed:
src/libextra/par.rs
src/libextra/serialize.rs
src/libextra/sort.rs
src/libextra/timer.rs
src/librust/rust.rs
src/librustc/driver/driver.rs
src/librustc/front/std_inject.rs
src/librustc/front/test.rs
src/librustc/metadata/filesearch.rs
src/librustc/middle/astencode.rs
src/librustc/middle/lint.rs
src/librustc/middle/trans/type_use.rs
src/librustc/middle/ty.rs
src/librustc/middle/typeck/check/mod.rs
src/librustdoc/astsrv.rs
src/librustdoc/markdown_index_pass.rs
src/librustdoc/tystr_pass.rs
src/librustpkg/tests.rs
src/libstd/clone.rs
src/libstd/condition.rs
src/libstd/kinds.rs
src/libstd/local_data.rs
src/libstd/num/num.rs
src/libstd/num/strconv.rs
src/libstd/prelude.rs
src/libstd/rand.rs
src/libstd/task/local_data_priv.rs
src/libstd/trie.rs
src/libstd/tuple.rs
src/libsyntax/ast_util.rs
src/libsyntax/ext/base.rs
src/libsyntax/ext/expand.rs
src/libsyntax/parse/parser.rs
src/test/auxiliary/static-methods-crate.rs
src/test/bench/shootout-k-nucleotide-pipes.rs
src/test/compile-fail/bad-method-typaram-kind.rs
src/test/compile-fail/closure-bounds-cant-promote-superkind-in-struct.rs
src/test/compile-fail/closure-bounds-copy-cant-capture-noncopyable.rs [deleted file]
src/test/compile-fail/closure-bounds-subtype.rs
src/test/compile-fail/fn-variance-2.rs
src/test/compile-fail/fn-variance-3.rs
src/test/compile-fail/issue-2548.rs
src/test/compile-fail/issue-2611-4.rs
src/test/compile-fail/issue-2611-5.rs
src/test/compile-fail/kindck-owned-trait-contains.rs
src/test/compile-fail/kindck-owned-trait-scoped.rs
src/test/compile-fail/kindck-owned-trait.rs
src/test/compile-fail/trait-bounds-cant-coerce.rs
src/test/run-pass/auto-instantiate.rs
src/test/run-pass/autobind.rs
src/test/run-pass/cond-macro-no-default.rs
src/test/run-pass/cond-macro.rs
src/test/run-pass/const-bound.rs
src/test/run-pass/expr-block-generic-unique1.rs
src/test/run-pass/expr-fn.rs
src/test/run-pass/expr-match-generic-unique1.rs
src/test/run-pass/expr-match-generic-unique2.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-drop-glue.rs
src/test/run-pass/generic-exterior-box.rs
src/test/run-pass/generic-exterior-unique.rs
src/test/run-pass/generic-fn-infer.rs
src/test/run-pass/generic-fn-unique.rs
src/test/run-pass/generic-fn.rs
src/test/run-pass/generic-tup.rs
src/test/run-pass/generic-unique.rs
src/test/run-pass/issue-2288.rs
src/test/run-pass/issue-2311-2.rs
src/test/run-pass/issue-2445-b.rs
src/test/run-pass/issue-2445.rs
src/test/run-pass/issue-2550.rs
src/test/run-pass/issue-2611-3.rs
src/test/run-pass/issue-3149.rs
src/test/run-pass/issue-333.rs
src/test/run-pass/ivec-add.rs
src/test/run-pass/monad.rs
src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs
src/test/run-pass/non-boolean-pure-fns.rs
src/test/run-pass/ret-break-cont-in-block.rs
src/test/run-pass/ret-none.rs
src/test/run-pass/static-impl.rs
src/test/run-pass/tag-align-dyn-variants.rs
src/test/run-pass/trait-bounds-basic.rs
src/test/run-pass/trait-generic.rs
src/test/run-pass/trait-inheritance-overloading-xc-exe.rs
src/test/run-pass/trait-inheritance-overloading.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
src/test/run-pass/vec-matching-fold.rs

index 1c686843ab095ade770a492fca84993d0d96b752..74ebf525e00a83784cf1eea816105dff6862b344 100644 (file)
@@ -85,7 +85,7 @@ fn map_slices<A:Clone + Send,B:Clone + Send>(
 }
 
 /// A parallel version of map.
-pub fn map<A:Copy + Clone + Send,B:Copy + Clone + Send>(
+pub fn map<A:Clone + Send,B:Clone + Send>(
     xs: &[A], fn_factory: &fn() -> ~fn(&A) -> B) -> ~[B] {
     vec::concat(map_slices(xs, || {
         let f = fn_factory();
@@ -96,7 +96,7 @@ pub fn map<A:Copy + Clone + Send,B:Copy + Clone + Send>(
 }
 
 /// A parallel version of mapi.
-pub fn mapi<A:Copy + Clone + Send,B:Copy + Clone + Send>(
+pub fn mapi<A:Clone + Send,B:Clone + Send>(
         xs: &[A],
         fn_factory: &fn() -> ~fn(uint, &A) -> B) -> ~[B] {
     let slices = map_slices(xs, || {
index 9fec58e74958ee2a2c77ba9841e7e9f4dd5077bb..53db93313a6e45f39e0afd6c01541e98f457186c 100644 (file)
@@ -650,10 +650,7 @@ fn decode(d: &mut D) -> (T0, T1, T2, T3, T4) {
     }
 }
 
-impl<
-    S: Encoder,
-    T: Encodable<S> + Copy
-> Encodable<S> for DList<T> {
+impl<S: Encoder, T: Encodable<S>> Encodable<S> for @mut DList<T> {
     fn encode(&self, s: &mut S) {
         do s.emit_seq(self.len()) |s| {
             let mut i = 0;
index 8a21ea0bd3bca9e1b81437b8e080d330f91470f2..a11b819dda115c3266b8aa7893dd56ea7f391f9a 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 fn merge_sort<T:Copy + Clone>(v: &[T], le: Le<T>) -> ~[T] {
+pub fn merge_sort<T:Clone>(v: &[T], le: Le<T>) -> ~[T] {
     type Slice = (uint, uint);
 
     return merge_sort_(v, (0u, v.len()), le);
 
-    fn merge_sort_<T:Copy + Clone>(v: &[T], slice: Slice, le: Le<T>) -> ~[T] {
+    fn merge_sort_<T:Clone>(v: &[T], slice: Slice, le: Le<T>) -> ~[T] {
         let begin = slice.first();
         let end = slice.second();
 
@@ -44,7 +44,7 @@ fn merge_sort_<T:Copy + Clone>(v: &[T], slice: Slice, le: Le<T>) -> ~[T] {
                                     merge_sort_(v, b, |x,y| le(x,y)));
     }
 
-    fn merge<T:Copy + Clone>(le: Le<T>, a: &[T], b: &[T]) -> ~[T] {
+    fn merge<T:Clone>(le: Le<T>, a: &[T], b: &[T]) -> ~[T] {
         let mut rs = vec::with_capacity(a.len() + b.len());
         let a_len = a.len();
         let mut a_ix = 0;
@@ -183,7 +183,7 @@ impl<'self, T:Clone + Ord + Eq> Sort for &'self mut [T] {
 static INITIAL_TMP_STORAGE: uint = 128;
 
 #[allow(missing_doc)]
-pub fn tim_sort<T:Copy + Clone + Ord>(array: &mut [T]) {
+pub fn tim_sort<T:Clone + Ord>(array: &mut [T]) {
     let size = array.len();
     if size < 2 {
         return;
@@ -227,7 +227,7 @@ pub fn tim_sort<T:Copy + Clone + Ord>(array: &mut [T]) {
     ms.merge_force_collapse(array);
 }
 
-fn binarysort<T:Copy + Clone + Ord>(array: &mut [T], start: uint) {
+fn binarysort<T:Clone + Ord>(array: &mut [T], start: uint) {
     let size = array.len();
     let mut start = start;
     assert!(start <= size);
@@ -419,7 +419,7 @@ fn MergeState<T>() -> MergeState<T> {
     }
 }
 
-impl<T:Copy + Clone + Ord> MergeState<T> {
+impl<T:Clone + Ord> MergeState<T> {
     fn push_run(&mut self, run_base: uint, run_len: uint) {
         let tmp = RunState{base: run_base, len: run_len};
         self.runs.push(tmp);
@@ -739,10 +739,7 @@ fn copy_vec<T:Clone>(dest: &mut [T],
 }
 
 #[inline]
-fn shift_vec<T:Copy + Clone>(dest: &mut [T],
-                             s1: uint,
-                             s2: uint,
-                             len: uint) {
+fn shift_vec<T:Clone>(dest: &mut [T], s1: uint, s2: uint, len: uint) {
     assert!(s1+len <= dest.len());
 
     let tmp = dest.slice(s2, s2+len).to_owned();
index d957ac43801e576bbcf99632640eba42bc477623..1cfbeb9e514dda1f5eb9e5916c79e93ab94ff850 100644 (file)
@@ -118,10 +118,8 @@ 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 + Send>(iotask: &IoTask,
-                                   msecs: uint,
-                                   wait_po: &Port<T>)
-                                   -> Option<T> {
+pub fn recv_timeout<T:Send>(iotask: &IoTask, msecs: uint, wait_po: &Port<T>)
+                            -> Option<T> {
     let (timeout_po, timeout_ch) = stream::<()>();
     let mut timeout_po = timeout_po;
     delayed_send(iotask, msecs, &timeout_ch, ());
index adf73a7e7f00ff6526a55d4a9673cababdedcf8d..bc97ef0e8ca4d9541334773323127dfc25f1f05c 100644 (file)
@@ -43,19 +43,19 @@ fn is_valid(&self) -> bool {
     }
 }
 
-enum Action<'self> {
-    Call(&'self fn:Copy(args: &[~str]) -> ValidUsage),
-    CallMain(&'static str, &'self fn:Copy()),
+enum Action {
+    Call(extern "Rust" fn(args: &[~str]) -> ValidUsage),
+    CallMain(&'static str, extern "Rust" fn()),
 }
 
 enum UsageSource<'self> {
     UsgStr(&'self str),
-    UsgCall(&'self fn:Copy()),
+    UsgCall(extern "Rust" fn()),
 }
 
 struct Command<'self> {
     cmd: &'self str,
-    action: Action<'self>,
+    action: Action,
     usage_line: &'self str,
     usage_full: UsageSource<'self>,
 }
index 2c1f3dd1918d7bcff744ce1a83211d551dfa6f7d..e85b3239e805559bd6e706f7b76b60d4501d4c64 100644 (file)
@@ -199,8 +199,9 @@ pub fn compile_rest(sess: Session,
         //
         // baz! should not use this definition unless foo is enabled.
         crate = time(time_passes, ~"std macros injection", ||
-                     syntax::ext::expand::inject_std_macros(sess.parse_sess, copy cfg,
-                                                             crate));
+                     syntax::ext::expand::inject_std_macros(sess.parse_sess,
+                                                            cfg.clone(),
+                                                            crate));
 
         crate = time(time_passes, ~"configuration 1", ||
                      front::config::strip_unconfigured_items(crate));
index 3d4b22ecd8c78eb8c3b30daa27d732823ffc7b38..6865428cd69a7666bd708759c098bc09ebe82fe7 100644 (file)
@@ -37,7 +37,7 @@ fn no_prelude(attrs: &[ast::attribute]) -> bool {
 }
 
 fn inject_libstd_ref(sess: Session, crate: &ast::crate) -> @ast::crate {
-    fn spanned<T:Copy>(x: T) -> codemap::spanned<T> {
+    fn spanned<T>(x: T) -> codemap::spanned<T> {
         codemap::spanned { node: x, span: dummy_sp() }
     }
 
index 61a530b307c457a815eeddf7213a1874d1270ade..e83c5ff6d10950796684051df1263ed2ceea51fc 100644 (file)
@@ -343,7 +343,7 @@ pub fn main() {
     return @item;
 }
 
-fn nospan<T:Copy>(t: T) -> codemap::spanned<T> {
+fn nospan<T>(t: T) -> codemap::spanned<T> {
     codemap::spanned { node: t, span: dummy_sp() }
 }
 
index 62bbe22a0432427558952323c19b336a7616a28d..112965127a25b84031ffd9f37a077b0a5bcd7896 100644 (file)
@@ -87,7 +87,7 @@ fn get_target_lib_file_path(&self, file: &Path) -> Path {
     } as @FileSearch
 }
 
-pub fn search<T:Copy>(filesearch: @FileSearch, pick: pick<T>) -> Option<T> {
+pub fn search<T>(filesearch: @FileSearch, pick: pick<T>) -> Option<T> {
     let mut rslt = None;
     for filesearch.for_each_lib_search_path() |lib_search_path| {
         debug!("searching %s", lib_search_path.to_str());
index d4d20e75c9de603e5d8058b013c40b9c57d88a9e..6201283939faacb60a161ff3c2a3d18184f77413 100644 (file)
@@ -1282,14 +1282,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>() -> alist<int, B> {
             fn eq_int(a: int, b: int) -> bool { a == b }
             return alist {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>() -> alist<int, B> {
             return alist {eq_fn: eq_int, data: ~[]};
         }
     ).get());
index 6d3f50073f2755caf536a86b3f6c181c1b43ec2b..9fb07927d9860ceb298d21803fae9a7bbf3e9914 100644 (file)
@@ -561,7 +561,7 @@ pub fn each_lint(sess: session::Session,
 // This is used to make the simple visitors used for the lint passes
 // not traverse into subitems, since that is handled by the outer
 // lint visitor.
-fn item_stopping_visitor<E: Copy>(outer: visit::vt<E>) -> visit::vt<E> {
+fn item_stopping_visitor<E>(outer: visit::vt<E>) -> visit::vt<E> {
     visit::mk_vt(@visit::Visitor {
         visit_item: |_i, (_e, _v)| { },
         visit_fn: |fk, fd, b, s, id, (e, v)| {
index c708331e1c4441d4e2003ec1b999a8814c958025..2c63079ad8f829c3a55e17e8d407f737032d8fd1 100644 (file)
@@ -62,7 +62,7 @@ pub fn type_uses_for(ccx: @mut CrateContext, fn_id: def_id, n_tps: uint)
 
     fn store_type_uses(cx: Context, fn_id: def_id) -> @~[type_uses] {
         let Context { uses, ccx } = cx;
-        let uses = @copy *uses; // freeze
+        let uses = @(*uses).clone(); // freeze
         ccx.type_use_cache.insert(fn_id, uses);
         uses
     }
index 5910eaacc5db710c0964fc1b3d42862d8c3738e8..8eefcb154ef221042dae12f8429209bbcaa29409 100644 (file)
@@ -860,7 +860,7 @@ fn mk_rcache() -> creader_cache {
     return @mut HashMap::new();
 }
 
-pub fn new_ty_hash<V:Copy>() -> @mut HashMap<t, V> {
+pub fn new_ty_hash<V>() -> @mut HashMap<t, V> {
     @mut HashMap::new()
 }
 
index 42b861b73301bac51b53b6610fbd0398323a5136..4a9e0fddbe73a2ea780f5ff12c2e101beed85fa8 100644 (file)
@@ -1686,10 +1686,10 @@ 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,
-                                expected: Option<ty::t>,
-                                unpack: &fn(&ty::sty) -> Option<O>)
-                             -> Option<O> {
+    fn unpack_expected<O>(fcx: @mut FnCtxt,
+                          expected: Option<ty::t>,
+                          unpack: &fn(&ty::sty) -> Option<O>)
+                          -> Option<O> {
         match expected {
             Some(t) => {
                 match resolve_type(fcx.infcx(), t, force_tvar) {
index b20d8cab2a4c3e8d9fd6fc3fbf754c9eadfb33e9..16a89122a11c0f031eb898ae4a1a386b11c1d29b 100644 (file)
@@ -114,7 +114,8 @@ fn build_ctxt(sess: Session,
     use rustc::front::config;
 
     let ast = syntax::ext::expand::inject_std_macros(sess.parse_sess,
-                                                     copy sess.opts.cfg, ast);
+                                                     sess.opts.cfg.clone(),
+                                                     ast);
     let ast = config::strip_unconfigured_items(ast);
     let ast = syntax::ext::expand::expand_crate(sess.parse_sess,
                                                 sess.opts.cfg.clone(),
index e766909b8abd2109c3a0a2814b9626e3c57e1777..2c6312e01b205e988f6c576b4a86857ea3d0b796 100644 (file)
@@ -208,8 +208,8 @@ fn should_remove_punctuation_from_headers() {
                 == ~"impl-of-selectt-u-for-left-right");
         assert!(pandoc_header_id("impl of Condition<'self, T, U>")
                 == ~"impl-of-conditionself-t-u");
-        assert!(pandoc_header_id("impl of Condition<T: Copy + Clone>")
-                == ~"impl-of-conditiont-copy-clone");
+        assert!(pandoc_header_id("impl of Condition<T: Clone>")
+                == ~"impl-of-conditiont-clone");
     }
 
     #[test]
index f66aeca06ffc821c767024d0e0278a99834e18dd..044ab3226053d37147e234a729a2f127c3750250 100644 (file)
@@ -394,8 +394,8 @@ fn should_add_trait_method_sigs() {
 
     #[test]
     fn should_add_impl_bounds() {
-        let doc = mk_doc(~"impl<T, U: Copy, V: Copy + Clone> Option<T, U, V> { }");
-        assert!(doc.cratemod().impls()[0].bounds_str == Some(~"<T, U: Copy, V: Copy + Clone>"));
+        let doc = mk_doc(~"impl<T, U, V: Clone> Option<T, U, V> { }");
+        assert!(doc.cratemod().impls()[0].bounds_str == Some(~"<T, U, V: Clone>"));
     }
 
     #[test]
index 9d4c2f87a614dc565700c2ee9524b90649ec9028..b6dabfd0b1292fa15d6f4695937899dc64ead9e7 100644 (file)
@@ -839,7 +839,7 @@ fn install_check_duplicates() {
             fail!("package database contains duplicate ID");
         }
         else {
-            contents.push(copy *p);
+            contents.push((*p).clone());
         }
         false
     };
index 947aa5708c2967f686e3d54e67603666673286a2..f24bc002a2b1e710d3e8e48c84a5462d348fe865 100644 (file)
 leaving the original value in place. These types do not require
 allocation to copy and do not have finalizers (i.e. they do not
 contain owned boxes or implement `Drop`), so the compiler considers
-them cheap and safe to copy and automatically implements the `Copy`
-trait for them. For other types copies must be made explicitly,
-by convention implementing the `Clone` trait and calling the
-`clone` method.
+them cheap and safe to copy. For other types copies must be made
+explicitly, by convention implementing the `Clone` trait and calling
+the `clone` method.
 
 */
 
index 80caa34ce065800b8bc864ae956febecaeb7ff5d..100751370174fcbe9b209f5b2ebdbb0c930ec0fe 100644 (file)
@@ -47,7 +47,7 @@ pub fn trap<'a>(&'a self, h: &'a fn(T) -> U) -> Trap<'a, T, U> {
 
     pub fn raise(&self, t: T) -> U {
         let msg = fmt!("Unhandled condition: %s: %?", self.name, t);
-        self.raise_default(t, || fail!(copy msg))
+        self.raise_default(t, || fail!(msg.clone()))
     }
 
     pub fn raise_default(&self, t: T, default: &fn() -> U) -> U {
@@ -78,7 +78,8 @@ impl<'self, T, U> Condition<'self, T, U> {
     pub fn trap<'a>(&'a self, h: &'a fn(T) -> U) -> Trap<'a, T, U> {
         unsafe {
             let p : *RustClosure = ::cast::transmute(&h);
-            let prev = local_data::get(self.key, |k| k.map(|&x| *x));
+            let prev = local_data::get(::cast::unsafe_copy(&self.key),
+                                       |k| k.map(|&x| *x));
             let h = @Handler { handle: *p, prev: prev };
             Trap { cond: self, handler: h }
         }
@@ -91,7 +92,7 @@ pub fn raise(&self, t: T) -> U {
 
     pub fn raise_default(&self, t: T, default: &fn() -> U) -> U {
         unsafe {
-            match local_data::pop(self.key) {
+            match local_data::pop(::cast::unsafe_copy(&self.key)) {
                 None => {
                     debug!("Condition.raise: found no handler");
                     default()
@@ -100,12 +101,15 @@ pub fn raise_default(&self, t: T, default: &fn() -> U) -> U {
                     debug!("Condition.raise: found handler");
                     match handler.prev {
                         None => {}
-                        Some(hp) => local_data::set(self.key, hp)
+                        Some(hp) => {
+                            local_data::set(::cast::unsafe_copy(&self.key),
+                                            hp)
+                        }
                     }
                     let handle : &fn(T) -> U =
                         ::cast::transmute(handler.handle);
                     let u = handle(t);
-                    local_data::set(self.key, handler);
+                    local_data::set(::cast::unsafe_copy(&self.key), handler);
                     u
                 }
             }
index 6c16ecc0d4ef8bc5ef84b1774d2727e0c560bafd..f2f8f46e7cd99c03470a53396108d8af02267e29 100644 (file)
 They cannot be implemented by user code, but are instead implemented
 by the compiler automatically for the types to which they apply.
 
-The 3 kinds are
-
-* Copy - types that may be copied without allocation. This includes
-  scalar types and managed pointers, and exludes owned pointers. It
-  also excludes types that implement `Drop`.
+The 2 kinds are
 
 * Send - owned types and types containing owned types.  These types
   may be transferred across task boundaries.
 
 * Freeze - types that are deeply immutable.
 
-`Copy` types include both implicitly copyable types that the compiler
-will copy automatically and non-implicitly copyable types that require
-the `copy` keyword to copy. Types that do not implement `Copy` may
-instead implement `Clone`.
-
 */
 
 #[allow(missing_doc)];
index 168bb7c14f0a6ed5b4802c6e645fa2064a764d40..2c1a3bb29a09d734c4a9fb0c4c450574aaf13dad 100644 (file)
@@ -59,7 +59,7 @@
 #[cfg(not(stage0))]
 pub type Key<T> = &'static KeyValue<T>;
 #[cfg(stage0)]
-pub type Key<'self,T> = &'self fn:Copy(v: T);
+pub type Key<'self,T> = &'self fn(v: T);
 
 pub enum KeyValue<T> { Key }
 
index 4468b51c26148dfc440753c25ea2b549b1620bf9..fc199876902f12565fdf9359e1396d9f48db9f1c 100644 (file)
@@ -16,7 +16,6 @@
 use ops::{Add, Sub, Mul, Div, Rem, Neg};
 use ops::{Not, BitAnd, BitOr, BitXor, Shl, Shr};
 use option::Option;
-use kinds::Copy;
 
 pub mod strconv;
 
@@ -428,7 +427,7 @@ pub trait FromStrRadix {
 /// - If code written to use this function doesn't care about it, it's
 ///   probably assuming that `x^0` always equals `1`.
 ///
-pub fn pow_with_uint<T:NumCast+One+Zero+Copy+Div<T,T>+Mul<T,T>>(radix: uint, pow: uint) -> T {
+pub fn pow_with_uint<T:NumCast+One+Zero+Div<T,T>+Mul<T,T>>(radix: uint, pow: uint) -> T {
     let _0: T = Zero::zero();
     let _1: T = One::one();
 
index 4661bc20403a90ec9daf19cf5840440337455ddf..ab17c5f175a471a3120f10b9124f9f1dd2ec1dfd 100644 (file)
@@ -16,9 +16,8 @@
 use ops::{Add, Sub, Mul, Div, Rem, Neg};
 use option::{None, Option, Some};
 use char;
+use str::{StrSlice};
 use str;
-use str::StrSlice;
-use kinds::Copy;
 use vec::{CopyableVector, ImmutableVector, MutableVector};
 use vec::OwnedVector;
 use num::{NumCast, Zero, One, cast, pow_with_uint, Integer};
@@ -466,7 +465,7 @@ pub fn float_to_str_common<T:NumCast+Zero+One+Eq+Ord+NumStrConv+Float+Round+
  * - Fails if `radix` > 18 and `special == true` due to conflict
  *   between digit and lowest first character in `inf` and `NaN`, the `'i'`.
  */
-pub fn from_str_bytes_common<T:NumCast+Zero+One+Eq+Ord+Copy+Div<T,T>+
+pub fn from_str_bytes_common<T:NumCast+Zero+One+Eq+Ord+Div<T,T>+
                                     Mul<T,T>+Sub<T,T>+Neg<T>+Add<T,T>+
                                     NumStrConv+Clone>(
         buf: &[u8], radix: uint, negative: bool, fractional: bool,
@@ -663,7 +662,7 @@ pub fn from_str_bytes_common<T:NumCast+Zero+One+Eq+Ord+Copy+Div<T,T>+
  * `from_str_bytes_common()`, for details see there.
  */
 #[inline]
-pub fn from_str_common<T:NumCast+Zero+One+Eq+Ord+Copy+Div<T,T>+Mul<T,T>+
+pub fn from_str_common<T:NumCast+Zero+One+Eq+Ord+Div<T,T>+Mul<T,T>+
                               Sub<T,T>+Neg<T>+Add<T,T>+NumStrConv+Clone>(
         buf: &str, radix: uint, negative: bool, fractional: bool,
         special: bool, exponent: ExponentFormat, empty_zero: bool,
index 8be34896bef6d4f797fc8b677cceb66806b51f5e..e3e042a4947240033faab4367a948f422b743948 100644 (file)
@@ -29,7 +29,7 @@
 
 // Reexported core operators
 pub use either::{Either, Left, Right};
-pub use kinds::{Copy, Sized};
+pub use kinds::Sized;
 pub use kinds::{Freeze, Send};
 pub use ops::{Add, Sub, Mul, Div, Rem, Neg, Not};
 pub use ops::{BitAnd, BitOr, BitXor};
index 7d65ba63ff0cefdd03371d08bc83769121545b36..76dbc6291681702bbe43af2402d8d615cb4cceba 100644 (file)
@@ -356,7 +356,7 @@ pub trait RngUtil {
      * }
      * ~~~
      */
-    fn choose<T:Copy + Clone>(&mut self, values: &[T]) -> T;
+    fn choose<T:Clone>(&mut self, values: &[T]) -> T;
     /// Choose Some(item) randomly, returning None if values is empty
     fn choose_option<T:Clone>(&mut self, values: &[T]) -> Option<T>;
     /**
@@ -379,7 +379,7 @@ pub trait RngUtil {
      * }
      * ~~~
      */
-    fn choose_weighted<T:Copy + Clone>(&mut self, v : &[Weighted<T>]) -> T;
+    fn choose_weighted<T:Clone>(&mut self, v : &[Weighted<T>]) -> T;
     /**
      * Choose Some(item) respecting the relative weights, returning none if
      * the sum of the weights is 0
@@ -439,7 +439,7 @@ fn choose_weighted_option<T:Clone>(&mut self, v: &[Weighted<T>])
      * }
      * ~~~
      */
-    fn shuffle<T:Copy + Clone>(&mut self, values: &[T]) -> ~[T];
+    fn shuffle<T:Clone>(&mut self, values: &[T]) -> ~[T];
     /**
      * Shuffle a mutable vec in place
      *
@@ -532,7 +532,7 @@ fn gen_bytes(&mut self, len: uint) -> ~[u8] {
     }
 
     /// Choose an item randomly, failing if values is empty
-    fn choose<T:Copy + Clone>(&mut self, values: &[T]) -> T {
+    fn choose<T:Clone>(&mut self, values: &[T]) -> T {
         self.choose_option(values).get()
     }
 
@@ -548,7 +548,7 @@ fn choose_option<T:Clone>(&mut self, 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 + Clone>(&mut self, v: &[Weighted<T>]) -> T {
+    fn choose_weighted<T:Clone>(&mut self, v: &[Weighted<T>]) -> T {
         self.choose_weighted_option(v).get()
     }
 
@@ -591,7 +591,7 @@ fn weighted_vec<T:Clone>(&mut self, v: &[Weighted<T>]) -> ~[T] {
     }
 
     /// Shuffle a vec
-    fn shuffle<T:Copy + Clone>(&mut self, values: &[T]) -> ~[T] {
+    fn shuffle<T:Clone>(&mut self, values: &[T]) -> ~[T] {
         let mut m = values.to_owned();
         self.shuffle_mut(m);
         m
index 75fd6eacc1b3a66826d49955ae32c1b6b8966015..d5f4973e8c71a5a572e5c7afdae4680abae1e408 100644 (file)
@@ -15,6 +15,7 @@
 use local_data;
 use prelude::*;
 use ptr;
+use sys;
 use task::rt;
 use util;
 
@@ -156,8 +157,9 @@ unsafe fn newsched_map(local: *mut LocalStorage) -> &mut TaskLocalMap {
     }
 }
 
-fn key_to_key_value<T: 'static>(key: local_data::Key<T>) -> *libc::c_void {
-    unsafe { cast::transmute(key) }
+unsafe fn key_to_key_value<T: 'static>(key: local_data::Key<T>) -> *libc::c_void {
+    let pair: sys::Closure = cast::transmute_copy(&key);
+    return pair.code as *libc::c_void;
 }
 
 pub unsafe fn local_pop<T: 'static>(handle: Handle,
index 396fdaf2e6a5592ae5fc598bf89561a46d6534b5..df6f77fd6cef347daeacd8dd7c37a696f35540ca 100644 (file)
@@ -264,7 +264,8 @@ struct TrieNode<T> {
 impl<T> TrieNode<T> {
     #[inline]
     fn new() -> TrieNode<T> {
-        // FIXME: #5244: [Nothing, ..SIZE] should be possible without Copy
+        // FIXME: #5244: [Nothing, ..SIZE] should be possible without implicit
+        // copyability
         TrieNode{count: 0,
                  children: [Nothing, Nothing, Nothing, Nothing,
                             Nothing, Nothing, Nothing, Nothing,
index 841be4df6e296ae4de3cb90c07e7417d21278ae8..6201e753bc99463849004572d26635c0f8a3e01b 100644 (file)
@@ -13,7 +13,6 @@
 #[allow(missing_doc)];
 
 use clone::Clone;
-use kinds::Copy;
 use vec;
 use vec::ImmutableVector;
 use iterator::IteratorUtil;
@@ -86,8 +85,8 @@ pub trait ExtendedTupleOps<A,B> {
 }
 
 impl<'self,
-     A:Copy + Clone,
-     B:Copy + Clone>
+     A:Clone,
+     B:Clone>
      ExtendedTupleOps<A,B> for
      (&'self [A], &'self [B]) {
     #[inline]
@@ -109,10 +108,7 @@ fn map<C>(&self, f: &fn(a: &A, b: &B) -> C) -> ~[C] {
     }
 }
 
-impl<A:Copy + Clone,
-     B:Copy + Clone>
-     ExtendedTupleOps<A,B> for
-     (~[A], ~[B]) {
+impl<A:Clone, B:Clone> ExtendedTupleOps<A,B> for (~[A], ~[B]) {
     #[inline]
     fn zip(&self) -> ~[(A, B)] {
         match *self {
index 843fd4bdba2c0816f3f2005a4bc6470f83c3ed0e..d0dfb0fb06e58330b6afcd5a332ca814620bed72 100644 (file)
 use parse::token;
 use visit;
 
+use std::cast::unsafe_copy;
+use std::cast;
 use std::hashmap::HashMap;
 use std::int;
+use std::local_data;
 use std::num;
 use std::option;
-use std::local_data;
 
 pub fn path_name_i(idents: &[ident]) -> ~str {
     // FIXME: Bad copies (#2543 -- same for everything else that says "bad")
index e2f37bd54bd21c8cf13112bb9ea246d6e7f76e57..230640767c9b49dbcb59705ceeef990b8e6f5e46 100644 (file)
@@ -414,7 +414,7 @@ pub enum MapChain<K,V> {
 
 
 // get the map from an env frame
-impl <K: Eq + Hash + IterBytes ,V: Copy> MapChain<K,V>{
+impl <K: Eq + Hash + IterBytes, V> MapChain<K,V>{
 
     // Constructor. I don't think we need a zero-arg one.
     fn new(init: ~HashMap<K,@V>) -> @mut MapChain<K,V> {
index ba8e3e729338fe79921a7cc742bc0566f311f631..2f1d320fef7e699af3735758200d7ebc3d33417f 100644 (file)
@@ -693,7 +693,7 @@ pub fn inject_std_macros(parse_sess: @mut parse::ParseSess,
                          cfg: ast::crate_cfg, c: &crate) -> @crate {
     let sm = match parse_item_from_source_str(@"<std-macros>",
                                               std_macros(),
-                                              copy cfg,
+                                              cfg.clone(),
                                               ~[],
                                               parse_sess) {
         Some(item) => item,
@@ -708,7 +708,7 @@ pub fn inject_std_macros(parse_sess: @mut parse::ParseSess,
             ast::_mod {
                 items: items,
                 // FIXME #2543: Bad copy.
-                .. copy *modd
+                .. (*modd).clone()
             }
         },
         .. *default_ast_fold()
index f0b9258eaeb6bfdcd46733cad23ef080da9b9076..adecbc050a3a8b36a534ef79733cd9f342e59e11 100644 (file)
@@ -473,10 +473,10 @@ pub fn expect_gt(&self) {
 
     // parse a sequence bracketed by '<' and '>', stopping
     // before the '>'.
-    pub fn parse_seq_to_before_gt<T: Copy>(&self,
-                                           sep: Option<token::Token>,
-                                           f: &fn(&Parser) -> T)
-                                           -> OptVec<T> {
+    pub fn parse_seq_to_before_gt<T>(&self,
+                                     sep: Option<token::Token>,
+                                     f: &fn(&Parser) -> T)
+                                     -> OptVec<T> {
         let mut first = true;
         let mut v = opt_vec::Empty;
         while *self.token != token::GT
@@ -493,10 +493,10 @@ pub fn parse_seq_to_before_gt<T: Copy>(&self,
         return v;
     }
 
-    pub fn parse_seq_to_gt<T: Copy>(&self,
-                                    sep: Option<token::Token>,
-                                    f: &fn(&Parser) -> T)
-                                    -> OptVec<T> {
+    pub fn parse_seq_to_gt<T>(&self,
+                              sep: Option<token::Token>,
+                              f: &fn(&Parser) -> T)
+                              -> OptVec<T> {
         let v = self.parse_seq_to_before_gt(sep, f);
         self.expect_gt();
         return v;
@@ -505,11 +505,11 @@ pub fn parse_seq_to_gt<T: Copy>(&self,
     // parse a sequence, including the closing delimiter. The function
     // f must consume tokens until reaching the next separator or
     // closing bracket.
-    pub fn parse_seq_to_end<T: Copy>(&self,
-                                     ket: &token::Token,
-                                     sep: SeqSep,
-                                     f: &fn(&Parser) -> T)
-                                     -> ~[T] {
+    pub fn parse_seq_to_end<T>(&self,
+                               ket: &token::Token,
+                               sep: SeqSep,
+                               f: &fn(&Parser) -> T)
+                               -> ~[T] {
         let val = self.parse_seq_to_before_end(ket, sep, f);
         self.bump();
         val
@@ -518,11 +518,11 @@ pub fn parse_seq_to_end<T: Copy>(&self,
     // parse a sequence, not including the closing delimiter. The function
     // f must consume tokens until reaching the next separator or
     // closing bracket.
-    pub fn parse_seq_to_before_end<T: Copy>(&self,
-                                            ket: &token::Token,
-                                            sep: SeqSep,
-                                            f: &fn(&Parser) -> T)
-                                            -> ~[T] {
+    pub fn parse_seq_to_before_end<T>(&self,
+                                      ket: &token::Token,
+                                      sep: SeqSep,
+                                      f: &fn(&Parser) -> T)
+                                      -> ~[T] {
         let mut first: bool = true;
         let mut v: ~[T] = ~[];
         while *self.token != *ket {
@@ -542,12 +542,12 @@ pub fn parse_seq_to_before_end<T: Copy>(&self,
     // parse a sequence, including the closing delimiter. The function
     // f must consume tokens until reaching the next separator or
     // closing bracket.
-    pub fn parse_unspanned_seq<T: Copy>(&self,
-                                        bra: &token::Token,
-                                        ket: &token::Token,
-                                        sep: SeqSep,
-                                        f: &fn(&Parser) -> T)
-                                        -> ~[T] {
+    pub fn parse_unspanned_seq<T>(&self,
+                                  bra: &token::Token,
+                                  ket: &token::Token,
+                                  sep: SeqSep,
+                                  f: &fn(&Parser) -> T)
+                                  -> ~[T] {
         self.expect(bra);
         let result = self.parse_seq_to_before_end(ket, sep, f);
         self.bump();
@@ -556,12 +556,12 @@ pub fn parse_unspanned_seq<T: Copy>(&self,
 
     // NB: Do not use this function unless you actually plan to place the
     // spanned list in the AST.
-    pub fn parse_seq<T: Copy>(&self,
-                              bra: &token::Token,
-                              ket: &token::Token,
-                              sep: SeqSep,
-                              f: &fn(&Parser) -> T)
-                              -> spanned<~[T]> {
+    pub fn parse_seq<T>(&self,
+                        bra: &token::Token,
+                        ket: &token::Token,
+                        sep: SeqSep,
+                        f: &fn(&Parser) -> T)
+                        -> spanned<~[T]> {
         let lo = self.span.lo;
         self.expect(bra);
         let result = self.parse_seq_to_before_end(ket, sep, f);
index b5b338531294929104e2f46b5076d53dac0ac146..180cb18c745966e87c3b0984221e32991d187164 100644 (file)
@@ -35,7 +35,7 @@ fn readMaybe(s: ~str) -> Option<bool> {
     }
 }
 
-pub fn read<T:read + Copy>(s: ~str) -> T {
+pub fn read<T:read>(s: ~str) -> T {
     match read::readMaybe(s) {
       Some(x) => x,
       _ => fail!("read failed!")
index 64cfa2561a4bdac0d3a690816bd652f416c34198..86ab99407b98a6c4440bed7ff0c3d53a19ae715f 100644 (file)
@@ -34,8 +34,8 @@ fn pct(xx: uint, yy: uint) -> float {
       return (xx as float) * 100f / (yy as float);
    }
 
-   fn le_by_val<TT:Copy + Clone,
-                UU:Copy + Clone + Ord>(
+   fn le_by_val<TT:Clone,
+                UU:Clone + Ord>(
                 kv0: &(TT,UU),
                 kv1: &(TT,UU))
                 -> bool {
@@ -44,8 +44,8 @@ fn le_by_val<TT:Copy + Clone,
       return v0 >= v1;
    }
 
-   fn le_by_key<TT:Copy + Clone + Ord,
-                UU:Copy + Clone>(
+   fn le_by_key<TT:Clone + Ord,
+                UU:Clone>(
                 kv0: &(TT,UU),
                 kv1: &(TT,UU))
                 -> bool {
@@ -55,10 +55,7 @@ fn le_by_key<TT:Copy + Clone + Ord,
    }
 
    // sort by key, then by value
-   fn sortKV<TT:Copy + Clone + Ord,
-             UU:Copy + Clone + Ord>(
-             orig: ~[(TT,UU)])
-             -> ~[(TT,UU)] {
+   fn sortKV<TT:Clone + Ord, UU:Clone + Ord>(orig: ~[(TT,UU)]) -> ~[(TT,UU)] {
       return sort::merge_sort(sort::merge_sort(orig, le_by_key), le_by_val);
    }
 
index d5b8f99ada0eaea363f5ae91bc3f4c93f4933e2d..db6db02ded5025eeb2f4fffb2ae9452028228e30 100644 (file)
@@ -9,15 +9,15 @@
 // except according to those terms.
 
 fn foo<T>() {
-    1u.bar::<T>(); //~ ERROR: does not fulfill `Copy`
+    1u.bar::<T>(); //~ ERROR: does not fulfill `Send`
 }
 
 trait bar {
-    fn bar<T:Copy>(&self);
+    fn bar<T:Send>(&self);
 }
 
 impl bar for uint {
-    fn bar<T:Copy>(&self) {
+    fn bar<T:Send>(&self) {
     }
 }
 
index 098a395f017445133027e607346ca1680b52e10c..b38cb89548807b04502a6e1de1fe2a60b2f5c040 100644 (file)
@@ -9,11 +9,11 @@
 // except according to those terms.
 
 struct X {
-    field: @fn:Copy(),
+    field: @fn:Send(),
 }
 
 fn foo(blk: @fn:()) -> X {
-    return X { field: blk }; //~ ERROR expected bounds `Copy` but found no bounds
+    return X { field: blk }; //~ ERROR expected bounds `Send` but found no bounds
 }
 
 fn main() {
diff --git a/src/test/compile-fail/closure-bounds-copy-cant-capture-noncopyable.rs b/src/test/compile-fail/closure-bounds-copy-cant-capture-noncopyable.rs
deleted file mode 100644 (file)
index 0b11da1..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-use std::comm;
-
-// If this were legal you could use it to copy captured noncopyables.
-// Issue (#2828)
-
-fn foo(blk: ~fn:Copy()) {
-    blk();
-}
-
-fn main() {
-    let (p,c) = comm::stream();
-    do foo {
-        c.send(()); //~ ERROR does not fulfill `Copy`
-    }
-    p.recv();
-}
index 0c9220d18ab760949e35fa5d79a31aab960def88..324634ac66db8fcd27d5105af61f54cb82b05fb0 100644 (file)
@@ -2,38 +2,16 @@
 fn take_any(_: &fn:()) {
 }
 
-fn take_copyable(_: &fn:Copy()) {
-}
-
-fn take_copyable_owned(_: &fn:Copy+Send()) {
-}
-
 fn take_const_owned(_: &fn:Freeze+Send()) {
 }
 
 fn give_any(f: &fn:()) {
     take_any(f);
-    take_copyable(f); //~ ERROR expected bounds `Copy` but found no bounds
-    take_copyable_owned(f); //~ ERROR expected bounds `Copy+Send` but found no bounds
-}
-
-fn give_copyable(f: &fn:Copy()) {
-    take_any(f);
-    take_copyable(f);
-    take_copyable_owned(f); //~ ERROR expected bounds `Copy+Send` but found bounds `Copy`
 }
 
 fn give_owned(f: &fn:Send()) {
     take_any(f);
-    take_copyable(f); //~ ERROR expected bounds `Copy` but found bounds `Send`
-    take_copyable_owned(f); //~ ERROR expected bounds `Copy+Send` but found bounds `Send`
-}
-
-fn give_copyable_owned(f: &fn:Copy+Send()) {
-    take_any(f);
-    take_copyable(f);
-    take_copyable_owned(f);
-    take_const_owned(f); //~ ERROR expected bounds `Send+Freeze` but found bounds `Copy+Send`
+    take_const_owned(f); //~ ERROR expected bounds `Freeze+Send` but found bounds `Send`
 }
 
 fn main() {}
index 61668cbdb9eabf663fcb4ad320a8e55b3dc4c993..ab5591900346e3e273bab99489ea4d121a8b5dd5 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn reproduce<T:Copy>(t: T) -> @fn() -> T {
+fn reproduce<T>(t: T) -> @fn() -> T {
     let result: @fn() -> T = || t;
     result
 }
index 4d145d3f9ea3aff34b3e0db1784816aa67c790b1..630eb4b538d58bc93070efde8e8e65a75fb45b28 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn mk_identity<T:Copy>() -> @fn(T) -> T {
+fn mk_identity<T>() -> @fn(T) -> T {
     let result: @fn(t: T) -> T = |t| t;
     result
 }
index 314f282355dbb296a4a8529de346ef51af00ce8a..47087337e340719405bc250a05bd150706fd3a41 100644 (file)
@@ -37,7 +37,7 @@ fn main() {
         let mut res = foo(x);
 
         let mut v = ~[];
-        v = ~[(res)] + v; //~ instantiating a type parameter with an incompatible type `foo`, which does not fulfill `Copy`
+        v = ~[(res)] + v; //~ instantiating a type parameter with an incompatible type `foo`, which does not fulfill `Clone`
         assert_eq!(v.len(), 2);
     }
 
index 531d4eab53578a4657f58241067be0ebc6d96334..c62c28745253d157977417675c3758126fcdf2e8 100644 (file)
@@ -12,7 +12,7 @@
 // than the trait method it's implementing
 
 trait A {
-  fn b<C:Copy,D>(x: C) -> C;
+  fn b<C,D>(x: C) -> C;
 }
 
 struct E {
@@ -20,7 +20,7 @@ struct E {
 }
 
 impl A for E {
-  fn b<F:Copy + Freeze,G>(_x: F) -> F { fail!() } //~ ERROR type parameter 0 requires `Freeze`
+  fn b<F:Freeze,G>(_x: F) -> F { fail!() } //~ ERROR type parameter 0 requires `Freeze`
 }
 
 fn main() {}
index 9840650fa2e4af8b9690303514e817a28a26ad82..9b8346da5c5d932dc2886938037bb32cbe931fb3 100644 (file)
@@ -12,7 +12,7 @@
 // an impl against a trait
 
 trait A {
-  fn b<C:Copy,D>(&self, x: C) -> C;
+  fn b<C:Clone,D>(&self, x: C) -> C;
 }
 
 struct E {
@@ -21,7 +21,7 @@ struct E {
 
 impl A for E {
   // n.b. The error message is awful -- see #3404
-  fn b<F:Copy,G>(&self, _x: G) -> G { fail!() } //~ ERROR method `b` has an incompatible type
+  fn b<F:Clone,G>(&self, _x: G) -> G { fail!() } //~ ERROR method `b` has an incompatible type
 }
 
 fn main() {}
index 33e122867bb3d0e0795748e515344e47b78e04d0..19b38769d95694886fc3532a26c93544d5318883 100644 (file)
 
 trait repeat<A> { fn get(&self) -> A; }
 
-impl<A:Copy> repeat<A> for @A {
+impl<A:Clone> repeat<A> for @A {
     fn get(&self) -> A { **self }
 }
 
-fn repeater<A:Copy>(v: @A) -> @repeat<A> {
+fn repeater<A:Clone>(v: @A) -> @repeat<A> {
     // Note: owned kind is not necessary as A appears in the trait type
     @v as @repeat<A> // No
 }
index 808bfba829858a8aa340466c62fb21dd015e1032..4dc1c6f2f3ee96b225c5e700f73c74bc0aa4d31b 100644 (file)
@@ -18,11 +18,11 @@ trait foo {
     fn foo(&self, i: &'self int) -> int;
 }
 
-impl<T:Copy> foo for T {
+impl<T:Clone> foo for T {
     fn foo(&self, i: &'self int) -> int {*i}
 }
 
-fn to_foo<T:Copy>(t: T) {
+fn to_foo<T:Clone>(t: T) {
     // This version is ok because, although T may contain borrowed
     // pointers, it never escapes the fn body.  We know this because
     // the type of foo includes a region which will be resolved to
@@ -33,14 +33,14 @@ struct F<T> { f: T }
     assert_eq!(x.foo(v), 3);
 }
 
-fn to_foo_2<T:Copy>(t: T) -> @foo {
+fn to_foo_2<T:Clone>(t: T) -> @foo {
     // Not OK---T may contain borrowed ptrs and it is going to escape
     // as part of the returned foo value
     struct F<T> { f: T }
     @F {f:t} as @foo //~ ERROR value may contain borrowed pointers; add `'static` bound
 }
 
-fn to_foo_3<T:Copy + 'static>(t: T) -> @foo {
+fn to_foo_3<T:Clone + '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
     struct F<T> { f: T }
index c2352e35a46e92add4e236393c5ab616a5fd2e1e..73d59ff8af218453190696d12281f6e4c044db3b 100644 (file)
 
 trait foo { fn foo(&self); }
 
-fn to_foo<T:Copy + foo>(t: T) -> @foo {
+fn to_foo<T:Clone + foo>(t: T) -> @foo {
     @t as @foo
     //~^ ERROR value may contain borrowed pointers; add `'static` bound
     //~^^ ERROR cannot pack type
 }
 
-fn to_foo2<T:Copy + foo + 'static>(t: T) -> @foo {
+fn to_foo2<T:Clone + foo + 'static>(t: T) -> @foo {
     @t as @foo
 }
 
index a96da398f5a1195dd27c9455619d561681df0523..72d6b70a7c2caff56a787cd1cacbb5c6de9116a5 100644 (file)
@@ -14,11 +14,11 @@ trait Foo {
 fn a(_x: ~Foo:Send) {
 }
 
-fn b(_x: ~Foo:Send+Copy) {
+fn b(_x: ~Foo:Send+Clone) {
 }
 
 fn c(x: ~Foo:Freeze+Send) {
-    b(x); //~ ERROR expected bounds `Copy+Send`
+    b(x); //~ ERROR expected bounds `Clone+Send`
 }
 
 fn d(x: ~Foo:) {
index 184fef52c8c14e9245e24d4e699175b8d5e1d7c0..47cf12629013e1c5807a4e84bd5384c58d0ce87e 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,U>(x: T, y: U) -> Pair<T, U> { return Pair {a: x, b: y}; }
 
 pub fn main() {
     info!("%?", f(Triple {x: 3, y: 4, z: 5}, 4).a.x);
index 0788c74d07850df2e32bf51e123ff04cb0889372..440ad723a12ce38ed34fa12a4223552c5e2569a6 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>(x: ~[T]) -> T { return x[0]; }
 
 fn g(act: &fn(~[int]) -> int) -> int { return act(~[1, 2, 3]); }
 
index 6b90308f8a8680c82b63fadf2ab392cca5203495..8bd1a772e55ed790ce20111e611a0e5728545d39 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn clamp<T:Copy + Ord + Signed>(x: T, mn: T, mx: T) -> T {
+fn clamp<T:Ord + Signed>(x: T, mn: T, mx: T) -> T {
     cond!(
         (x > mx) { return mx; }
         (x < mn) { return mn; }
index 929752b3f1a0daf1cf8d002f3e3d894f8ced6dec..61a51b6726114de357abd4d6a5bd069997eddeca 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn clamp<T:Copy + Ord + Signed>(x: T, mn: T, mx: T) -> T {
+fn clamp<T:Ord + Signed>(x: T, mn: T, mx: T) -> T {
     cond!(
         (x > mx) { mx }
         (x < mn) { mn }
index 05f586f76e950302ea8ce54567874fe92d9538b0..635ae704e4194df134ac6841d4bd73e2d00d27c3 100644 (file)
@@ -12,7 +12,7 @@
 // are const.
 
 
-fn foo<T:Copy + Freeze>(x: T) -> T { x }
+fn foo<T:Freeze>(x: T) -> T { x }
 
 struct F { field: int }
 
index 679210351bd1ffe2b0ea62c00a868fea007199f9..0249820410c435fc642e536dadd2ef5c624c881e 100644 (file)
@@ -13,7 +13,7 @@
 // -*- rust -*-
 type compare<T> = @fn(~T, ~T) -> bool;
 
-fn test_generic<T:Copy+Clone>(expected: ~T, eq: compare<T>) {
+fn test_generic<T:Clone>(expected: ~T, eq: compare<T>) {
     let actual: ~T = { expected.clone() };
     assert!((eq(expected, actual)));
 }
index e4eae9c4c39968d795a0f8ecadd33ca20ecc21f1..cba1bab3004684eb378bc5ef27db518c1126ea0c 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>(t: T) -> T { t }
     assert_eq!(f(10), 10);
 }
 
index 085d52d6d7f9ff4ca254632568b5764f97cdd965..0f564e6a78029a51cdc18f9b0b0e25897ce0a394 100644 (file)
@@ -13,7 +13,7 @@
 // -*- rust -*-
 type compare<T> = @fn(~T, ~T) -> bool;
 
-fn test_generic<T:Copy+Clone>(expected: ~T, eq: compare<T>) {
+fn test_generic<T:Clone>(expected: ~T, eq: compare<T>) {
     let actual: ~T = match true {
         true => { expected.clone() },
         _ => fail!("wat")
index 7ef1fb8cab844a072af82d11809c89a20b6b6e7d..ae88d48bc443b606a038b2932e905d913311bfa6 100644 (file)
@@ -13,7 +13,7 @@
 
 type compare<T> = @fn(T, T) -> bool;
 
-fn test_generic<T:Copy+Clone>(expected: T, eq: compare<T>) {
+fn test_generic<T:Clone>(expected: T, eq: compare<T>) {
     let actual: T = match true {
         true => expected.clone(),
         _ => fail!("wat")
index efb514caba95b1d9f58607c3c7025121b3331d48..2cd505f1f7d2505f49063a1ae79b7d61d10958d2 100644 (file)
@@ -10,7 +10,7 @@
 
 
 
-fn id<T:Copy>(t: T) -> T { return t; }
+fn id<T>(t: T) -> T { return t; }
 
 pub fn main() {
     let expected = @100;
index 203adf81cecd1df584b7e4c4bd16f659cea0978c..7a6cb9470b2a4a8d67a57caf97a6482cab240811 100644 (file)
@@ -10,7 +10,7 @@
 
 
 
-fn id<T:Copy + Send>(t: T) -> T { return t; }
+fn id<T:Send>(t: T) -> T { return t; }
 
 pub fn main() {
     let expected = ~100;
index 7248e5770698f215da7596b9bc120e856fd91066..a3e933f3ceb03c7167f0d6a69285405e0655e103 100644 (file)
@@ -10,7 +10,7 @@
 
 
 
-fn box<T:Copy>(x: Box<T>) -> @Box<T> { return @x; }
+fn box<T>(x: Box<T>) -> @Box<T> { return @x; }
 
 struct Box<T> {x: T, y: T, z: T}
 
index 19e11197fd91394474e4d8b701cce2d4179b2aa6..9592f9ff73616335ef1d138eeeffd1cd8e5b18cd 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>(t: T) { let t1: T = t; }
 
 pub fn main() { let x = Pair {x: @10, y: @12}; f(x); }
index 79ee544d49555eea31fe7fecddc9986d735d68dc..b7fe704749c74408113154d9454724f1b0fab2b4 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>(t: T) -> Recbox<T> { return Recbox {x: @t}; }
 
 pub fn main() {
     let foo: int = 17;
index cc94fca68040855e75efa86f009a6636ce654ac9..0820923efcfec99f167df082e72855f224e1796a 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>(t: T) -> Recbox<T> { return Recbox {x: ~t}; }
 
 pub fn main() {
     let foo: int = 17;
index 7c21bd52d46476864b6836e44d7e476e87abd19d..092a17bf456c9a906e4291712f9d6a5d6002f07e 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>(x: T) -> T { return x; }
 
 pub fn main() { let x: int = 42; let y: int = id(x); assert!((x == y)); }
index bf4729a058944cf3707ddb2099b7631449f2b4ac..3c28b16d3a981244fdffecf17b689c586c3240e9 100644 (file)
@@ -9,6 +9,6 @@
 // except according to those terms.
 
 
-fn f<T:Copy>(x: ~T) -> ~T { return x; }
+fn f<T>(x: ~T) -> ~T { return x; }
 
 pub fn main() { let x = f(~3); info!(*x); }
index e5e6beb8c706e1c9df62ed337246a0177a382273..34fb22ea0f45bb915b9e9746270a0117a76b75ae 100644 (file)
@@ -12,7 +12,7 @@
 
 
 // -*- rust -*-
-fn id<T:Copy>(x: T) -> T { return x; }
+fn id<T>(x: T) -> T { return x; }
 
 struct Triple {x: int, y: int, z: int}
 
index d09996cc2dae52a1e49d8d60014c343c7cad6e9c..4a74330f7d67e36012a86a40e9498bc9c6b1d646 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>(t: (T, T, T)) -> T { let (_, _, x) = t; return x; }
 
 pub fn main() {
     info!(get_third((1, 2, 3)));
index 8a4fc94135b9a229f8c164d87cf485ea47360b8a..71cc432786023f107e4950cec00e567573473f50 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>(x: Triple<T>) -> ~Triple<T> { return ~x; }
 
 pub fn main() {
     let x: ~Triple<int> = box::<int>(Triple{x: 1, y: 2, z: 3});
index 9aef66fd35c5947386bdc175d18f08cfe49d2af1..e951eef37056381bd49cfb2393ae73a899d8b174 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> {
   fn chowder(&self, y: A);
 }
 struct foo<A> {
   x: A,
 }
 
-impl<A:Copy> clam<A> for foo<A> {
+impl<A> clam<A> for foo<A> {
   fn chowder(&self, y: A) {
   }
 }
 
-fn foo<A:Copy>(b: A) -> foo<A> {
+fn foo<A>(b: A) -> foo<A> {
     foo {
         x: b
     }
 }
 
-fn f<A:Copy>(x: @clam<A>, a: A) {
+fn f<A>(x: @clam<A>, a: A) {
   x.chowder(a);
 }
 
index 155f9cff29629fa4cbe19a005d3e150fc5d2c05e..df7c3b6e7d977c7c509f173e45c742fc457b5386 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> { }
 struct foo<A> {
     x: A,
 }
 
-impl<A:Copy> foo<A> {
+impl<A> foo<A> {
    pub fn bar<B,C:clam<A>>(&self, c: C) -> B {
      fail!();
    }
 }
 
-fn foo<A:Copy>(b: A) -> foo<A> {
+fn foo<A>(b: A) -> foo<A> {
     foo {
         x: b
     }
index c26038afd764f4af14a60e50b22162317b3eb4c1..432e8c19d2a98d36c3348a948e146236f9027a5f 100644 (file)
@@ -12,18 +12,18 @@ struct c1<T> {
     x: T,
 }
 
-impl<T:Copy> c1<T> {
+impl<T> c1<T> {
     pub fn f1(&self, x: int) {
     }
 }
 
-fn c1<T:Copy>(x: T) -> c1<T> {
+fn c1<T>(x: T) -> c1<T> {
     c1 {
         x: x
     }
 }
 
-impl<T:Copy> c1<T> {
+impl<T> c1<T> {
     pub fn f2(&self, x: int) {
     }
 }
index 64d60725978763848ef5b253230e6113dba4856d..3c0a9355b587820223004266b3b7e0605c6122e5 100644 (file)
@@ -12,17 +12,17 @@ struct c1<T> {
     x: T,
 }
 
-impl<T:Copy> c1<T> {
+impl<T> c1<T> {
     pub fn f1(&self, x: T) {}
 }
 
-fn c1<T:Copy>(x: T) -> c1<T> {
+fn c1<T>(x: T) -> c1<T> {
     c1 {
         x: x
     }
 }
 
-impl<T:Copy> c1<T> {
+impl<T> c1<T> {
     pub fn f2(&self, x: T) {}
 }
 
index f59777138903f53ffefb2ed8173b43b6e649c3e5..af0b937f602cdec26f8ea798f0e8b2427db5be29 100644 (file)
@@ -18,7 +18,7 @@ fn C(x: uint) -> C {
     }
 }
 
-fn f<T:Copy>(_x: T) {
+fn f<T>(_x: T) {
 }
 
 #[deny(non_implicitly_copyable_typarams)]
index 7f6535526312a4c57173bd349d7aa093476fd86e..56c18d557f0da610301fb05b6e2341d83f44cf01 100644 (file)
@@ -12,7 +12,7 @@
 // than the traits require.
 
 trait A {
-  fn b<C:Copy + Freeze,D>(x: C) -> C;
+  fn b<C:Freeze,D>(x: C) -> C;
 }
 
 struct E {
@@ -20,7 +20,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,G>(_x: F) -> F { fail!() } //~ ERROR in method `b`, type parameter 0 has 1 bound, but
 }
 
 fn main() {}
index e433141c44dbd34bce971176c2c130f00fe5222a..ab64fb4fbfa1f22cb03d8d580a40b5353c636a56 100644 (file)
@@ -8,12 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn Matrix4<T:Copy>(m11: T, m12: T, m13: T, m14: T,
-                   m21: T, m22: T, m23: T, m24: T,
-                   m31: T, m32: T, m33: T, m34: T,
-                   m41: T, m42: T, m43: T, m44: T)
-                -> Matrix4<T> {
-
+fn Matrix4<T>(m11: T, m12: T, m13: T, m14: T,
+              m21: T, m22: T, m23: T, m24: T,
+              m31: T, m32: T, m33: T, m34: T,
+              m41: T, m42: T, m43: T, m44: T)
+              -> Matrix4<T> {
     Matrix4 {
         m11: m11, m12: m12, m13: m13, m14: m14,
         m21: m21, m22: m22, m23: m23, m24: m24,
index 9791b6cdc530a80a01f0398c86bd2d9eeda812ab..1217f32826f6d3be179ba888f22374baeba3443a 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>(x: T) -> T { let f = id::<T>; return f(x); }
 
-fn id<T:Copy>(x: T) -> T { return x; }
+fn id<T>(x: T) -> T { return x; }
 
 pub fn main() { assert!((quux(10) == 10)); }
index 61c63245d7026d57a235233b56590d0d38a774ad..ecf530f07f309e9d5f848482db75d84541ed64c2 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 + Clone>(a: T) -> ~[T] { return ~[a.clone()] + ~[a]; }
+fn double<T:Clone>(a: T) -> ~[T] { return ~[a.clone()] + ~[a]; }
 
 fn double_int(a: int) -> ~[int] { return ~[a] + ~[a]; }
 
index fe06c973dbfd815d92371c1fab6d02d83c12a1d3..eaf9eafa2a5dcceaca7f5f8d49ff9df0e1ef34fb 100644 (file)
 use std::int;
 
 trait vec_monad<A> {
-    fn bind<B:Copy>(&self, f: &fn(&A) -> ~[B]) -> ~[B];
+    fn bind<B>(&self, f: &fn(&A) -> ~[B]) -> ~[B];
 }
 
 impl<A> vec_monad<A> for ~[A] {
-    fn bind<B:Copy>(&self, f: &fn(&A) -> ~[B]) -> ~[B] {
+    fn bind<B>(&self, f: &fn(&A) -> ~[B]) -> ~[B] {
         let mut r = ~[];
         for self.iter().advance |elt| {
             r.push_all_move(f(elt));
index eb3c1e4cd27cc5ebf823d0ea72e3a5f084775163..3146c2a9499787c3a2ed2b5acede246c97062791 100644 (file)
@@ -25,7 +25,7 @@ fn serialize<S:Serializer>(&self, _s: S) { }
 
 struct F<A> { a: A }
 
-impl<A:Copy + Serializable> Serializable for F<A> {
+impl<A:Serializable> Serializable for F<A> {
     fn serialize<S:Serializer>(&self, s: S) {
         self.a.serialize(s);
     }
index c08f52cba1597088a757b8cf498a9b36a34a1d4b..8257d495d4606f196ef4d74584d65c7791e93b19 100644 (file)
 
 use extra::list::*;
 
-fn pure_length_go<T:Copy>(ls: @List<T>, acc: uint) -> uint {
+fn pure_length_go<T>(ls: @List<T>, acc: uint) -> uint {
     match *ls { Nil => { acc } Cons(_, tl) => { pure_length_go(tl, acc + 1u) } }
 }
 
-fn pure_length<T:Copy>(ls: @List<T>) -> uint { pure_length_go(ls, 0u) }
+fn pure_length<T>(ls: @List<T>) -> uint { pure_length_go(ls, 0u) }
 
-fn nonempty_list<T:Copy>(ls: @List<T>) -> bool { pure_length(ls) > 0u }
+fn nonempty_list<T>(ls: @List<T>) -> bool { pure_length(ls) > 0u }
 
-fn safe_head<T:Copy>(ls: @List<T>) -> T {
+fn safe_head<T>(ls: @List<T>) -> T {
     assert!(!is_empty(ls));
     return head(ls);
 }
index 2b8b7c6a788d88ffd5be31269ecef14b4452b91c..341c1b96e36dd6f577533a2d284282d2079bd681 100644 (file)
@@ -23,7 +23,7 @@ fn iter<T>(v: ~[T], it: &fn(&T) -> bool) -> bool {
     return true;
 }
 
-fn find_pos<T:Eq + Copy + Clone>(n: T, h: ~[T]) -> Option<uint> {
+fn find_pos<T:Eq + Clone>(n: T, h: ~[T]) -> Option<uint> {
     let mut i = 0u;
     for iter(h.clone()) |e| {
         if *e == n { return Some(i); }
index d493f23ba8400a4d16bfb25506212d3d927b2b02..b1974f710956037e03614719c9ae3161bd54b01b 100644 (file)
@@ -12,6 +12,6 @@
 
 enum option<T> { none, some(T), }
 
-fn f<T:Copy>() -> option<T> { return none; }
+fn f<T>() -> option<T> { return none; }
 
 pub fn main() { f::<int>(); }
index 0ddc39d6b18cc7eda81e94fc6fe3936267bffa69..1588bd1a5a5418e32fdb61fceb7770950846a569 100644 (file)
@@ -43,13 +43,13 @@ fn multi(&self, f: &fn(uint)) {
 trait vec_utils<T> {
     fn length_(&self, ) -> uint;
     fn iter_(&self, f: &fn(&T));
-    fn map_<U:Copy>(&self, f: &fn(&T) -> U) -> ~[U];
+    fn map_<U>(&self, f: &fn(&T) -> U) -> ~[U];
 }
 
 impl<T> vec_utils<T> for ~[T] {
     fn length_(&self) -> uint { self.len() }
     fn iter_(&self, f: &fn(&T)) { for self.iter().advance |x| { f(x); } }
-    fn map_<U:Copy>(&self, f: &fn(&T) -> U) -> ~[U] {
+    fn map_<U>(&self, f: &fn(&T) -> U) -> ~[U] {
         let mut r = ~[];
         for self.iter().advance |elt| {
             r.push(f(elt));
index 85a4f98d198c3afac6cdb188135aa898ec421928..fa3b0a4ea33b13168de1f9e4acb97e59cb9a2ed1 100644 (file)
@@ -24,7 +24,7 @@ struct t_rec<A,B> {
     tB: a_tag<A,B>
 }
 
-fn mk_rec<A:Copy,B:Copy>(a: A, b: B) -> t_rec<A,B> {
+fn mk_rec<A,B>(a: A, b: B) -> t_rec<A,B> {
     return t_rec{ chA:0u8, tA:varA(a), chB:1u8, tB:varB(b) };
 }
 
index e0d60d62bb5824798003a3f926a93b4d8433eb2b..cc2c12e4109019a42fc192a9523194563a0dbdd9 100644 (file)
@@ -21,7 +21,7 @@ fn c(x: ~Foo:Freeze+Send) {
     a(x);
 }
 
-fn d(x: ~Foo:Send+Copy) {
+fn d(x: ~Foo:Send) {
     b(x);
 }
 
index 5952afa6676b7134a7e053c1697b896afbefdecf..d6218a6ad8e8ae21e47dd55e01e42f6286e95a29 100644 (file)
@@ -26,10 +26,10 @@ fn to_str(&self) -> ~str { ~"()" }
 }
 
 trait map<T> {
-    fn map<U:Copy>(&self, f: &fn(&T) -> U) -> ~[U];
+    fn map<U>(&self, f: &fn(&T) -> U) -> ~[U];
 }
 impl<T> map<T> for ~[T] {
-    fn map<U:Copy>(&self, f: &fn(&T) -> U) -> ~[U] {
+    fn map<U>(&self, f: &fn(&T) -> U) -> ~[U] {
         let mut r = ~[];
         // FIXME: #7355 generates bad code with Iterator
         for std::uint::range(0, self.len()) |i| {
index 21f840ca8d346a823872b94f7218971e775191ed..84d54d9d0df45520bba59924e8ed30fe5b796592 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:MyNum>(x: T, y: T) -> (T, T, T) {
     return (x + y, x - y, x * y);
 }
 
index 302d3d87df909b6968b2fd38285b42dbf8cb6954..d5321ea52983a25778eb347546e4c64eb1fc7795 100644 (file)
@@ -33,7 +33,7 @@ fn ne(&self, other: &MyInt) -> bool { !self.eq(other) }
 
 impl MyNum for MyInt;
 
-fn f<T:Copy + MyNum>(x: T, y: T) -> (T, T, T) {
+fn f<T:MyNum>(x: T, y: T) -> (T, T, T) {
     return (x + y, x - y, x * y);
 }
 
index 216a7a939fe0546a34f5c9aa378dcfd8c85d88d7..8968fe49bc1d4ab0aa91439ff7f5a06e0d9c5497 100644 (file)
@@ -11,7 +11,7 @@
 // xfail-fast
 
 fn p_foo<T>(pinned: T) { }
-fn s_foo<T:Copy>(shared: T) { }
+fn s_foo<T>(shared: T) { }
 fn u_foo<T:Send>(unique: T) { }
 
 struct r {
index 2c3424d1f06fd3db8458105c6eeebb85ae564087..5d115139bdc87958486a53e806d43566b98d1728 100644 (file)
@@ -20,7 +20,7 @@ struct Pointy {
     d : ~fn() -> uint,
 }
 
-fn make_uniq_closure<A:Send + Copy>(a: A) -> ~fn() -> uint {
+fn make_uniq_closure<A:Send>(a: A) -> ~fn() -> uint {
     let result: ~fn() -> uint = || ptr::to_unsafe_ptr(&a) as uint;
     result
 }
index 67ffc797ee4bfd68305cc3bee56f7295c91e9b88..eb2638f256881edbdc1edaaebe4c1d2aff3334e1 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>(t: T) -> T {
     let t1 = t;
     t1
 }
index ab92b10a3320bdca772a6aa365119dc09ec00a79..3805cbe47bf621667f83d259dd4f51b9d5b1b3b5 100644 (file)
@@ -10,7 +10,7 @@
 
 // Issue #976
 
-fn f<T:Copy>(x: ~T) {
+fn f<T>(x: ~T) {
     let _x2 = x;
 }
 pub fn main() { }
index 391881deff66812e931d0449c74c928a9af13382..11425a94ce9e1aa6d325ce10ed207c93e43b20d5 100644 (file)
@@ -30,11 +30,11 @@ fn g<T:Send + Eq>(i: T, j: T) {
 
 fn copyable() {
 
-    fn f<T:Copy + Eq>(i: T, j: T) {
+    fn f<T:Eq>(i: T, j: T) {
         assert_eq!(i, j);
     }
 
-    fn g<T:Copy + Eq>(i: T, j: T) {
+    fn g<T:Eq>(i: T, j: T) {
         assert!(i != j);
     }
 
index 05a6dee06cc87bf582a53ae900de8c4e5ac03723..22f1ccb8bbb058ab7409b92f76abb7f513902fec 100644 (file)
@@ -1,8 +1,7 @@
-fn foldl<T, U: Copy+Clone>(
-    values: &[T],
-    initial: U,
-    function: &fn(partial: U, element: &T) -> U
-) -> U {
+fn foldl<T,U:Clone>(values: &[T],
+                    initial: U,
+                    function: &fn(partial: U, element: &T) -> U)
+                    -> U {
     match values {
         [ref head, ..tail] =>
             foldl(tail, function(initial, head), function),
@@ -10,11 +9,10 @@ fn foldl<T, U: Copy+Clone>(
     }
 }
 
-fn foldr<T, U: Copy+Clone>(
-    values: &[T],
-    initial: U,
-    function: &fn(element: &T, partial: U) -> U
-) -> U {
+fn foldr<T,U:Clone>(values: &[T],
+                    initial: U,
+                    function: &fn(element: &T, partial: U) -> U)
+                    -> U {
     match values {
         [..head, ref tail] =>
             foldr(head, function(tail, initial), function),