about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2013-04-26 14:04:39 -0700
committerPatrick Walton <pcwalton@mimiga.net>2013-04-29 14:30:56 -0700
commit876483dcf4bdcd0001cc25812060bc04cf367f60 (patch)
treea1e5c6db1359979b0eb3b595740f541f55b8c104
parentf30f54e9d062bdb5b3cb10dd7185470280c1c278 (diff)
downloadrust-876483dcf4bdcd0001cc25812060bc04cf367f60.tar.gz
rust-876483dcf4bdcd0001cc25812060bc04cf367f60.zip
test: Fix tests.
-rw-r--r--src/libcore/cast.rs4
-rw-r--r--src/libcore/option.rs4
-rw-r--r--src/libcore/rt/thread.rs8
-rw-r--r--src/libcore/rt/uv/mod.rs16
-rw-r--r--src/libcore/sys.rs2
-rw-r--r--src/librustc/middle/trans/foreign.rs20
-rw-r--r--src/librustc/middle/typeck/check/mod.rs8
-rw-r--r--src/libstd/sync.rs44
-rw-r--r--src/libstd/uv_ll.rs4
-rw-r--r--src/libsyntax/ext/pipes/pipec.rs4
m---------src/llvm0
-rw-r--r--src/test/bench/graph500-bfs.rs8
-rw-r--r--src/test/bench/msgsend-pipes-shared.rs4
-rw-r--r--src/test/bench/msgsend-pipes.rs4
-rw-r--r--src/test/bench/shootout-k-nucleotide-pipes.rs8
-rw-r--r--src/test/bench/shootout-pfib.rs8
-rw-r--r--src/test/compile-fail/arg-style-mismatch.rs15
-rw-r--r--src/test/compile-fail/liveness-move-from-args.rs22
-rw-r--r--src/test/compile-fail/mode-inference-fail.rs21
-rw-r--r--src/test/compile-fail/mutable-arguments.rs35
-rw-r--r--src/test/run-pass/alt-pattern-drop.rs4
-rw-r--r--src/test/run-pass/cci_iter_exe.rs2
-rw-r--r--src/test/run-pass/cci_nested_exe.rs16
-rw-r--r--src/test/run-pass/class-implement-traits.rs1
-rw-r--r--src/test/run-pass/enum-alignment.rs5
-rw-r--r--src/test/run-pass/regions-mock-trans.rs2
-rw-r--r--src/test/run-pass/sendfn-spawn-with-fn-arg.rs5
-rw-r--r--src/test/run-pass/static-method-test.rs8
-rw-r--r--src/test/run-pass/task-comm-0.rs6
-rw-r--r--src/test/run-pass/task-comm-13.rs4
-rw-r--r--src/test/run-pass/task-comm-7.rs10
31 files changed, 113 insertions, 189 deletions
diff --git a/src/libcore/cast.rs b/src/libcore/cast.rs
index 0c960d4a308..6fb737d3770 100644
--- a/src/libcore/cast.rs
+++ b/src/libcore/cast.rs
@@ -178,8 +178,8 @@ mod tests {
             let box = @~"box box box";       // refcount 1
             bump_box_refcount(box);         // refcount 2
             let ptr: *int = transmute(box); // refcount 2
-            let _box1: @~str = reinterpret_cast(&ptr);
-            let _box2: @~str = reinterpret_cast(&ptr);
+            let _box1: @~str = ::cast::transmute_copy(&ptr);
+            let _box2: @~str = ::cast::transmute_copy(&ptr);
             assert!(*_box1 == ~"box box box");
             assert!(*_box2 == ~"box box box");
             // Will destroy _box1 and _box2. Without the bump, this would
diff --git a/src/libcore/option.rs b/src/libcore/option.rs
index 0fae64c0930..17192b4257b 100644
--- a/src/libcore/option.rs
+++ b/src/libcore/option.rs
@@ -482,10 +482,10 @@ pub impl<T:Copy + Zero> Option<T> {
 fn test_unwrap_ptr() {
     unsafe {
         let x = ~0;
-        let addr_x: *int = transmute(&*x);
+        let addr_x: *int = ::cast::transmute(&*x);
         let opt = Some(x);
         let y = opt.unwrap();
-        let addr_y: *int = transmute(&*y);
+        let addr_y: *int = ::cast::transmute(&*y);
         assert!(addr_x == addr_y);
     }
 }
diff --git a/src/libcore/rt/thread.rs b/src/libcore/rt/thread.rs
index 910e445f47b..0f1ae09bd94 100644
--- a/src/libcore/rt/thread.rs
+++ b/src/libcore/rt/thread.rs
@@ -21,10 +21,10 @@ pub struct Thread {
 
 pub impl Thread {
     fn start(main: ~fn()) -> Thread {
-        fn substart(main: &fn()) -> *raw_thread {
-            unsafe { rust_raw_thread_start(&main) }
+        fn substart(main: &~fn()) -> *raw_thread {
+            unsafe { rust_raw_thread_start(main) }
         }
-        let raw = substart(main);
+        let raw = substart(&main);
         Thread {
             main: main,
             raw_thread: raw
@@ -39,6 +39,6 @@ impl Drop for Thread {
 }
 
 extern {
-    pub unsafe fn rust_raw_thread_start(f: &(&fn())) -> *raw_thread;
+    pub unsafe fn rust_raw_thread_start(f: &(~fn())) -> *raw_thread;
     pub unsafe fn rust_raw_thread_join_delete(thread: *raw_thread);
 }
diff --git a/src/libcore/rt/uv/mod.rs b/src/libcore/rt/uv/mod.rs
index 4cbc8d70569..cb7925abdcd 100644
--- a/src/libcore/rt/uv/mod.rs
+++ b/src/libcore/rt/uv/mod.rs
@@ -366,14 +366,15 @@ pub fn slice_to_uv_buf(v: &[u8]) -> Buf {
 
 /// Transmute an owned vector to a Buf
 pub fn vec_to_uv_buf(v: ~[u8]) -> Buf {
-    let data = unsafe { malloc(v.len() as size_t) } as *u8;
-    assert!(data.is_not_null());
-    do vec::as_imm_buf(v) |b, l| {
-        let data = data as *mut u8;
-        unsafe { ptr::copy_memory(data, b, l) }
+    unsafe {
+        let data = malloc(v.len() as size_t) as *u8;
+        assert!(data.is_not_null());
+        do vec::as_imm_buf(v) |b, l| {
+            let data = data as *mut u8;
+            ptr::copy_memory(data, b, l)
+        }
+        uvll::buf_init(data, v.len())
     }
-    let buf = unsafe { uvll::buf_init(data, v.len()) };
-    return buf;
 }
 
 /// Transmute a Buf that was once a ~[u8] back to ~[u8]
@@ -384,6 +385,7 @@ pub fn vec_from_uv_buf(buf: Buf) -> Option<~[u8]> {
         return Some(v);
     } else {
         // No buffer
+        rtdebug!("No buffer!");
         return None;
     }
 }
diff --git a/src/libcore/sys.rs b/src/libcore/sys.rs
index 0173620dc51..8cad0a22886 100644
--- a/src/libcore/sys.rs
+++ b/src/libcore/sys.rs
@@ -154,7 +154,7 @@ pub fn pref_align_of_val<T>(_val: &T) -> uint {
 #[inline(always)]
 pub fn refcount<T>(t: @T) -> uint {
     unsafe {
-        let ref_ptr: *uint = cast::transmute(t);
+        let ref_ptr: *uint = cast::transmute_copy(&t);
         *ref_ptr - 1
     }
 }
diff --git a/src/librustc/middle/trans/foreign.rs b/src/librustc/middle/trans/foreign.rs
index 587f13ad65e..c45ba64c584 100644
--- a/src/librustc/middle/trans/foreign.rs
+++ b/src/librustc/middle/trans/foreign.rs
@@ -729,16 +729,16 @@ pub fn trans_intrinsic(ccx: @CrateContext,
                     _ => fail!(~"transmute has non-expr arg"),
                 };
                 let pluralize = |n| if 1u == n { "" } else { "s" };
-                ccx.sess.span_err(sp,
-                                  fmt!("transmute called on types with \
-                                        different sizes: %s (%u bit%s) to \
-                                        %s (%u bit%s)",
-                                       ty_to_str(ccx.tcx, in_type),
-                                       in_type_size,
-                                       pluralize(in_type_size),
-                                       ty_to_str(ccx.tcx, out_type),
-                                       out_type_size,
-                                       pluralize(out_type_size)));
+                ccx.sess.span_fatal(sp,
+                                    fmt!("transmute called on types with \
+                                          different sizes: %s (%u bit%s) to \
+                                          %s (%u bit%s)",
+                                         ty_to_str(ccx.tcx, in_type),
+                                         in_type_size,
+                                         pluralize(in_type_size),
+                                         ty_to_str(ccx.tcx, out_type),
+                                         out_type_size,
+                                         pluralize(out_type_size)));
             }
 
             if !ty::type_is_nil(out_type) {
diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs
index 7ce34bba29c..b9f3de873cf 100644
--- a/src/librustc/middle/typeck/check/mod.rs
+++ b/src/librustc/middle/typeck/check/mod.rs
@@ -3467,11 +3467,11 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
          ~[
             arg(ty::mk_mut_rptr(tcx,
                                 ty::re_bound(ty::br_anon(0)),
-                                ty::mk_int(tcx))),
+                                ty::mk_int())),
                arg(ty::mk_int()),
                arg(ty::mk_int())
          ],
-         ty::mk_int(tcx))
+         ty::mk_int())
       }
       ~"atomic_xchg"     | ~"atomic_xadd"     | ~"atomic_xsub"     |
       ~"atomic_xchg_acq" | ~"atomic_xadd_acq" | ~"atomic_xsub_acq" |
@@ -3480,7 +3480,7 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
          ~[
             arg(ty::mk_mut_rptr(tcx,
                                 ty::re_bound(ty::br_anon(0)),
-                                ty::mk_int(tcx))),
+                                ty::mk_int())),
             arg(ty::mk_int())
          ],
          ty::mk_int())
@@ -3550,7 +3550,7 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
            })),
            arg(ty::mk_u64())
          ],
-         ty::mk_nil(tcx))
+         ty::mk_nil())
       }
         ~"sqrtf32" => (0, ~[ arg(ty::mk_f32()) ], ty::mk_f32()),
         ~"sqrtf64" => (0, ~[ arg(ty::mk_f64()) ], ty::mk_f64()),
diff --git a/src/libstd/sync.rs b/src/libstd/sync.rs
index 21a6153380c..e86ec793188 100644
--- a/src/libstd/sync.rs
+++ b/src/libstd/sync.rs
@@ -828,18 +828,22 @@ mod tests {
         let m = ~Mutex();
         let m2 = m.clone();
         let mut sharedstate = ~0;
-        let ptr: *int = &*sharedstate;
-        do task::spawn || {
-            let sharedstate: &mut int =
-                unsafe { cast::transmute(ptr) };
-            access_shared(sharedstate, m2, 10);
-            c.send(());
+        {
+            let ptr: *int = &*sharedstate;
+            do task::spawn || {
+                let sharedstate: &mut int =
+                    unsafe { cast::transmute(ptr) };
+                access_shared(sharedstate, m2, 10);
+                c.send(());
 
+            }
         }
-        access_shared(sharedstate, m, 10);
-        let _ = p.recv();
+        {
+            access_shared(sharedstate, m, 10);
+            let _ = p.recv();
 
-        assert!(*sharedstate == 20);
+            assert!(*sharedstate == 20);
+        }
 
         fn access_shared(sharedstate: &mut int, m: &Mutex, n: uint) {
             for n.times {
@@ -1106,17 +1110,21 @@ mod tests {
         let (p,c) = comm::stream();
         let x2 = (*x).clone();
         let mut sharedstate = ~0;
-        let ptr: *int = &*sharedstate;
-        do task::spawn || {
-            let sharedstate: &mut int =
-                unsafe { cast::transmute(ptr) };
-            access_shared(sharedstate, &x2, mode1, 10);
-            c.send(());
+        {
+            let ptr: *int = &*sharedstate;
+            do task::spawn || {
+                let sharedstate: &mut int =
+                    unsafe { cast::transmute(ptr) };
+                access_shared(sharedstate, &x2, mode1, 10);
+                c.send(());
+            }
         }
-        access_shared(sharedstate, x, mode2, 10);
-        let _ = p.recv();
+        {
+            access_shared(sharedstate, x, mode2, 10);
+            let _ = p.recv();
 
-        assert!(*sharedstate == 20);
+            assert!(*sharedstate == 20);
+        }
 
         fn access_shared(sharedstate: &mut int, x: &RWlock, mode: RWlockMode,
                          n: uint) {
diff --git a/src/libstd/uv_ll.rs b/src/libstd/uv_ll.rs
index 8e5b3274bbb..8d7a97e2e48 100644
--- a/src/libstd/uv_ll.rs
+++ b/src/libstd/uv_ll.rs
@@ -1396,9 +1396,9 @@ mod test {
                     // not set the data on the connect_req
                     // until its initialized
                     set_data_for_req(connect_req_ptr as *libc::c_void,
-                                     transmute(&client_data));
+                                     &client_data);
                     set_data_for_uv_handle(tcp_handle_ptr as *libc::c_void,
-                                           transmute(&client_data));
+                                           &client_data);
                     debug!(~"before run tcp req loop");
                     run(test_loop);
                     debug!(~"after run tcp req loop");
diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs
index 9c309c1b9f9..3311c61de8b 100644
--- a/src/libsyntax/ext/pipes/pipec.rs
+++ b/src/libsyntax/ext/pipes/pipec.rs
@@ -365,7 +365,9 @@ impl gen_init for protocol {
                     |s| ext_cx.parse_stmt(
                         fmt!("data.%s.set_buffer(buffer)",
                              s.name))),
-                ext_cx.parse_expr(fmt!("&(data.%s)", self.states[0].name))));
+                ext_cx.parse_expr(fmt!(
+                    "::core::ptr::to_unsafe_ptr(&(data.%s))",
+                    self.states[0].name))));
 
         quote_expr!({
             let buffer = $buffer;
diff --git a/src/llvm b/src/llvm
-Subproject 2e9f0d21fe321849a4759a01fc28eae82ef196d
+Subproject 56dd407f4f97a01b8df6554c569170d2fc276fc
diff --git a/src/test/bench/graph500-bfs.rs b/src/test/bench/graph500-bfs.rs
index 2629c916fce..c8555ab1286 100644
--- a/src/test/bench/graph500-bfs.rs
+++ b/src/test/bench/graph500-bfs.rs
@@ -225,7 +225,7 @@ fn bfs2(graph: graph, key: node_id) -> bfs_result {
 }
 
 /// A parallel version of the bfs function.
-fn pbfs(&&graph: arc::ARC<graph>, key: node_id) -> bfs_result {
+fn pbfs(graph: &arc::ARC<graph>, key: node_id) -> bfs_result {
     // This works by doing functional updates of a color vector.
 
     enum color {
@@ -236,7 +236,7 @@ fn pbfs(&&graph: arc::ARC<graph>, key: node_id) -> bfs_result {
         black(node_id)
     };
 
-    let graph_vec = arc::get(&graph); // FIXME #3387 requires this temp
+    let graph_vec = arc::get(graph); // FIXME #3387 requires this temp
     let mut colors = do vec::from_fn(graph_vec.len()) |i| {
         if i as node_id == key {
             gray(key)
@@ -271,7 +271,7 @@ fn pbfs(&&graph: arc::ARC<graph>, key: node_id) -> bfs_result {
         let color_vec = arc::get(&color); // FIXME #3387 requires this temp
         colors = do par::mapi(*color_vec) {
             let colors = arc::clone(&color);
-            let graph = arc::clone(&graph);
+            let graph = arc::clone(graph);
             let result: ~fn(+x: uint, +y: &color) -> color = |i, c| {
                 let colors = arc::get(&colors);
                 let graph = arc::get(&graph);
@@ -496,7 +496,7 @@ fn main() {
         }
 
         let start = time::precise_time_s();
-        let bfs_tree = pbfs(graph_arc, *root);
+        let bfs_tree = pbfs(&graph_arc, *root);
         let stop = time::precise_time_s();
 
         total_par += stop - start;
diff --git a/src/test/bench/msgsend-pipes-shared.rs b/src/test/bench/msgsend-pipes-shared.rs
index ded0a305e99..3833c884652 100644
--- a/src/test/bench/msgsend-pipes-shared.rs
+++ b/src/test/bench/msgsend-pipes-shared.rs
@@ -34,7 +34,7 @@ enum request {
     stop
 }
 
-fn server(requests: Port<request>, responses: comm::Chan<uint>) {
+fn server(requests: &Port<request>, responses: &comm::Chan<uint>) {
     let mut count = 0u;
     let mut done = false;
     while !done {
@@ -76,7 +76,7 @@ fn run(args: &[~str]) {
         };
     }
     do task::spawn || {
-        server(from_parent, to_parent);
+        server(&from_parent, &to_parent);
     }
 
     for vec::each(worker_results) |r| {
diff --git a/src/test/bench/msgsend-pipes.rs b/src/test/bench/msgsend-pipes.rs
index 03348b45610..c4044d45f36 100644
--- a/src/test/bench/msgsend-pipes.rs
+++ b/src/test/bench/msgsend-pipes.rs
@@ -30,7 +30,7 @@ enum request {
     stop
 }
 
-fn server(requests: PortSet<request>, responses: Chan<uint>) {
+fn server(requests: &PortSet<request>, responses: &Chan<uint>) {
     let mut count = 0;
     let mut done = false;
     while !done {
@@ -73,7 +73,7 @@ fn run(args: &[~str]) {
         };
     }
     do task::spawn || {
-        server(from_parent, to_parent);
+        server(&from_parent, &to_parent);
     }
 
     for vec::each(worker_results) |r| {
diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs
index bb763cebb44..4cd7b58ce12 100644
--- a/src/test/bench/shootout-k-nucleotide-pipes.rs
+++ b/src/test/bench/shootout-k-nucleotide-pipes.rs
@@ -104,8 +104,8 @@ fn windows_with_carry(bb: &[u8], nn: uint,
 }
 
 fn make_sequence_processor(sz: uint,
-                           from_parent: comm::Port<~[u8]>,
-                           to_parent: comm::Chan<~str>) {
+                           from_parent: &comm::Port<~[u8]>,
+                           to_parent: &comm::Chan<~str>) {
    let mut freqs: HashMap<~[u8], uint> = HashMap::new();
    let mut carry: ~[u8] = ~[];
    let mut total: uint = 0u;
@@ -140,7 +140,7 @@ fn make_sequence_processor(sz: uint,
 // given a FASTA file on stdin, process sequence THREE
 fn main() {
     let args = os::args();
-   let rdr = if os::getenv(~"RUST_BENCH").is_some() {
+    let rdr = if os::getenv(~"RUST_BENCH").is_some() {
        // FIXME: Using this compile-time env variable is a crummy way to
        // get to this massive data set, but include_bin! chokes on it (#2598)
        let path = Path(env!("CFG_SRC_DIR"))
@@ -168,7 +168,7 @@ fn main() {
         let (from_parent, to_child) = comm::stream();
 
         do task::spawn_with(from_parent) |from_parent| {
-            make_sequence_processor(sz, from_parent, to_parent_);
+            make_sequence_processor(sz, &from_parent, &to_parent_);
         };
 
         to_child
diff --git a/src/test/bench/shootout-pfib.rs b/src/test/bench/shootout-pfib.rs
index ba970602833..acb8a6bcbee 100644
--- a/src/test/bench/shootout-pfib.rs
+++ b/src/test/bench/shootout-pfib.rs
@@ -30,7 +30,7 @@ use core::result;
 use core::result::{Ok, Err};
 
 fn fib(n: int) -> int {
-    fn pfib(c: Chan<int>, n: int) {
+    fn pfib(c: &Chan<int>, n: int) {
         if n == 0 {
             c.send(0);
         } else if n <= 2 {
@@ -38,15 +38,15 @@ fn fib(n: int) -> int {
         } else {
             let p = PortSet::new();
             let ch = p.chan();
-            task::spawn(|| pfib(ch, n - 1) );
+            task::spawn(|| pfib(&ch, n - 1) );
             let ch = p.chan();
-            task::spawn(|| pfib(ch, n - 2) );
+            task::spawn(|| pfib(&ch, n - 2) );
             c.send(p.recv() + p.recv());
         }
     }
 
     let (p, ch) = stream();
-    let _t = task::spawn(|| pfib(ch, n) );
+    let _t = task::spawn(|| pfib(&ch, n) );
     p.recv()
 }
 
diff --git a/src/test/compile-fail/arg-style-mismatch.rs b/src/test/compile-fail/arg-style-mismatch.rs
deleted file mode 100644
index 2efc16de830..00000000000
--- a/src/test/compile-fail/arg-style-mismatch.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2012 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.
-
-// error-pattern: mismatched types
-
-fn f(&&_x: int) {}
-fn g(_a: &fn(+v: int)) {}
-fn main() { g(f); }
diff --git a/src/test/compile-fail/liveness-move-from-args.rs b/src/test/compile-fail/liveness-move-from-args.rs
deleted file mode 100644
index c60848e5cc6..00000000000
--- a/src/test/compile-fail/liveness-move-from-args.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2012 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.
-
-fn take(_x: ~int) { }
-
-fn from_by_ref_arg(&&x: ~int) {
-    take(x);  //~ ERROR illegal move from argument `x`, which is not copy or move mode
-}
-
-fn from_copy_arg(+x: ~int) {
-    take(x);
-}
-
-fn main() {
-}
diff --git a/src/test/compile-fail/mode-inference-fail.rs b/src/test/compile-fail/mode-inference-fail.rs
deleted file mode 100644
index 9fe464131cc..00000000000
--- a/src/test/compile-fail/mode-inference-fail.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2012 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.
-
-// In this test, the mode gets inferred to ++ due to the apply_int(),
-// but then we get a failure in the generic apply().
-
-fn apply<A>(f: &fn(A) -> A, a: A) -> A { f(a) }
-fn apply_int(f: &fn(int) -> int, a: int) -> int { f(a) }
-
-fn main() {
-    let f = {|i| i};
-    assert!(apply_int(f, 2) == 2);
-    assert!(apply(f, 2) == 2); //~ ERROR expected argument mode &&
-}
diff --git a/src/test/compile-fail/mutable-arguments.rs b/src/test/compile-fail/mutable-arguments.rs
deleted file mode 100644
index 39e47fb1aab..00000000000
--- a/src/test/compile-fail/mutable-arguments.rs
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2012 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.
-
-// Note: it would be nice to give fewer warnings in these cases.
-
-fn mutate_by_mut_ref(x: &mut uint) {
-    *x = 0;
-}
-
-fn mutate_by_ref(&&x: uint) {
-    //~^ WARNING unused variable: `x`
-    x = 0; //~ ERROR assigning to argument
-}
-
-fn mutate_by_copy(+x: uint) {
-    //~^ WARNING unused variable: `x`
-    x = 0; //~ ERROR assigning to argument
-    //~^ WARNING value assigned to `x` is never read
-}
-
-fn mutate_by_move(+x: uint) {
-    //~^ WARNING unused variable: `x`
-    x = 0; //~ ERROR assigning to argument
-    //~^ WARNING value assigned to `x` is never read
-}
-
-fn main() {
-}
diff --git a/src/test/run-pass/alt-pattern-drop.rs b/src/test/run-pass/alt-pattern-drop.rs
index 8e71d8d4a67..d9f3f10a11b 100644
--- a/src/test/run-pass/alt-pattern-drop.rs
+++ b/src/test/run-pass/alt-pattern-drop.rs
@@ -25,7 +25,7 @@ fn foo(s: @int) {
       _ => { debug!("?"); fail!(); }
     }
     debug!(::core::sys::refcount(s));
-    assert!((::core::sys::refcount(s) == count + 1u));
+    assert_eq!(::core::sys::refcount(s), count + 1u);
     let _ = ::core::sys::refcount(s); // don't get bitten by last-use.
 }
 
@@ -39,5 +39,5 @@ pub fn main() {
     debug!("%u", ::core::sys::refcount(s));
     let count2 = ::core::sys::refcount(s);
     let _ = ::core::sys::refcount(s); // don't get bitten by last-use.
-    assert!(count == count2);
+    assert_eq!(count, count2);
 }
diff --git a/src/test/run-pass/cci_iter_exe.rs b/src/test/run-pass/cci_iter_exe.rs
index cdee58daa20..cb713adcb28 100644
--- a/src/test/run-pass/cci_iter_exe.rs
+++ b/src/test/run-pass/cci_iter_exe.rs
@@ -17,7 +17,7 @@ pub fn main() {
     //let bt0 = sys::rusti::frame_address(1u32);
     //debug!("%?", bt0);
     do cci_iter_lib::iter(~[1, 2, 3]) |i| {
-        io::print(fmt!("%d", i));
+        io::print(fmt!("%d", *i));
         //assert!(bt0 == sys::rusti::frame_address(2u32));
     }
 }
diff --git a/src/test/run-pass/cci_nested_exe.rs b/src/test/run-pass/cci_nested_exe.rs
index f6bfa25d94d..847d8a4d1f9 100644
--- a/src/test/run-pass/cci_nested_exe.rs
+++ b/src/test/run-pass/cci_nested_exe.rs
@@ -16,14 +16,14 @@ use cci_nested_lib::*;
 
 pub fn main() {
     let lst = new_int_alist();
-    alist_add(lst, 22, ~"hi");
-    alist_add(lst, 44, ~"ho");
-    assert!(alist_get(lst, 22) == ~"hi");
-    assert!(alist_get(lst, 44) == ~"ho");
+    alist_add(&lst, 22, ~"hi");
+    alist_add(&lst, 44, ~"ho");
+    assert!(alist_get(&lst, 22) == ~"hi");
+    assert!(alist_get(&lst, 44) == ~"ho");
 
     let lst = new_int_alist_2();
-    alist_add(lst, 22, ~"hi");
-    alist_add(lst, 44, ~"ho");
-    assert!(alist_get(lst, 22) == ~"hi");
-    assert!(alist_get(lst, 44) == ~"ho");
+    alist_add(&lst, 22, ~"hi");
+    alist_add(&lst, 44, ~"ho");
+    assert!(alist_get(&lst, 22) == ~"hi");
+    assert!(alist_get(&lst, 44) == ~"ho");
 }
diff --git a/src/test/run-pass/class-implement-traits.rs b/src/test/run-pass/class-implement-traits.rs
index 9709515a75a..1c0a09d52cf 100644
--- a/src/test/run-pass/class-implement-traits.rs
+++ b/src/test/run-pass/class-implement-traits.rs
@@ -68,5 +68,4 @@ pub fn main() {
   for uint::range(1u, 10u) |_i| {
     make_speak(copy nyan);
   }
-  assert!((nyan.eat()));
 }
diff --git a/src/test/run-pass/enum-alignment.rs b/src/test/run-pass/enum-alignment.rs
index 8883e50622f..cf92515e010 100644
--- a/src/test/run-pass/enum-alignment.rs
+++ b/src/test/run-pass/enum-alignment.rs
@@ -14,7 +14,10 @@ fn addr_of<T>(ptr: &T) -> uint {
 }
 
 fn is_aligned<T>(ptr: &T) -> bool {
-    (ptr::to_unsafe_ptr(ptr) % sys::min_align_of::<T>()) == 0
+    unsafe {
+        let addr: uint = ::cast::transmute(ptr);
+        (addr % sys::min_align_of::<T>()) == 0
+    }
 }
 
 pub fn main() {
diff --git a/src/test/run-pass/regions-mock-trans.rs b/src/test/run-pass/regions-mock-trans.rs
index 5a125ef9e0f..c46e41ab0eb 100644
--- a/src/test/run-pass/regions-mock-trans.rs
+++ b/src/test/run-pass/regions-mock-trans.rs
@@ -26,7 +26,7 @@ struct Ccx {
 fn alloc<'a>(_bcx : &'a arena) -> &'a Bcx<'a> {
     unsafe {
         cast::transmute(libc::malloc(sys::size_of::<Bcx<'blk>>()
-            as libc::size_t));
+            as libc::size_t))
     }
 }
 
diff --git a/src/test/run-pass/sendfn-spawn-with-fn-arg.rs b/src/test/run-pass/sendfn-spawn-with-fn-arg.rs
index a91a6a92820..afed0bd9ac3 100644
--- a/src/test/run-pass/sendfn-spawn-with-fn-arg.rs
+++ b/src/test/run-pass/sendfn-spawn-with-fn-arg.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+use core::cell::Cell;
+
 pub fn main() { test05(); }
 
 fn test05_start(&&f: ~fn(int)) {
@@ -20,7 +22,8 @@ fn test05() {
         error!(*three + n); // will copy x into the closure
         assert!((*three == 3));
     };
+    let fn_to_send = Cell(fn_to_send);
     task::spawn(|| {
-        test05_start(fn_to_send);
+        test05_start(fn_to_send.take());
     });
 }
diff --git a/src/test/run-pass/static-method-test.rs b/src/test/run-pass/static-method-test.rs
index eed83ec34b3..973897cd145 100644
--- a/src/test/run-pass/static-method-test.rs
+++ b/src/test/run-pass/static-method-test.rs
@@ -58,10 +58,10 @@ fn build<A, B: buildable<A>>(builder: &fn(push: &fn(+v: A))) -> B {
 
 /// Apply a function to each element of an iterable and return the results
 fn map<T, IT: BaseIter<T>, U, BU: buildable<U>>
-    (v: IT, f: &fn(T) -> U) -> BU {
+    (v: IT, f: &fn(&T) -> U) -> BU {
     do build |push| {
         for v.each() |elem| {
-            push(f(*elem));
+            push(f(elem));
         }
     }
 }
@@ -78,9 +78,9 @@ pub fn main() {
     let v: @[int] = seq_range(0, 10);
     assert!(v == @[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
 
-    let v: @[int] = map(&[1,2,3], |x| 1+x);
+    let v: @[int] = map(&[1,2,3], |&x| 1+x);
     assert!(v == @[2, 3, 4]);
-    let v: ~[int] = map(&[1,2,3], |x| 1+x);
+    let v: ~[int] = map(&[1,2,3], |&x| 1+x);
     assert!(v == ~[2, 3, 4]);
 
     assert!(bool_like::select(true, 9, 14) == 9);
diff --git a/src/test/run-pass/task-comm-0.rs b/src/test/run-pass/task-comm-0.rs
index 2380302c8bc..6fc29fa32db 100644
--- a/src/test/run-pass/task-comm-0.rs
+++ b/src/test/run-pass/task-comm-0.rs
@@ -17,7 +17,7 @@ use core::comm::Port;
 
 pub fn main() { test05(); }
 
-fn test05_start(ch : Chan<int>) {
+fn test05_start(ch : &Chan<int>) {
     ch.send(10);
     error!("sent 10");
     ch.send(20);
@@ -28,8 +28,8 @@ fn test05_start(ch : Chan<int>) {
 
 fn test05() {
     let (po, ch) = comm::stream();
-    task::spawn(|| test05_start(ch) );
-    let mut value = po.recv();
+    task::spawn(|| test05_start(&ch) );
+    let mut value: int = po.recv();
     error!(value);
     value = po.recv();
     error!(value);
diff --git a/src/test/run-pass/task-comm-13.rs b/src/test/run-pass/task-comm-13.rs
index a01a33e589b..f22328a3e1b 100644
--- a/src/test/run-pass/task-comm-13.rs
+++ b/src/test/run-pass/task-comm-13.rs
@@ -12,7 +12,7 @@
 
 extern mod std;
 
-fn start(c: comm::Chan<int>, start: int, number_of_messages: int) {
+fn start(c: &comm::Chan<int>, start: int, number_of_messages: int) {
     let mut i: int = 0;
     while i < number_of_messages { c.send(start + i); i += 1; }
 }
@@ -20,6 +20,6 @@ fn start(c: comm::Chan<int>, start: int, number_of_messages: int) {
 pub fn main() {
     debug!("Check that we don't deadlock.");
     let (p, ch) = comm::stream();
-    task::try(|| start(ch, 0, 10) );
+    task::try(|| start(&ch, 0, 10) );
     debug!("Joined task");
 }
diff --git a/src/test/run-pass/task-comm-7.rs b/src/test/run-pass/task-comm-7.rs
index 6ff0d1663fe..12f9a113dfc 100644
--- a/src/test/run-pass/task-comm-7.rs
+++ b/src/test/run-pass/task-comm-7.rs
@@ -14,7 +14,7 @@ extern mod std;
 
 pub fn main() { test00(); }
 
-fn test00_start(c: comm::Chan<int>, start: int, number_of_messages: int) {
+fn test00_start(c: &comm::Chan<int>, start: int, number_of_messages: int) {
     let mut i: int = 0;
     while i < number_of_messages { c.send(start + i); i += 1; }
 }
@@ -27,19 +27,19 @@ fn test00() {
 
     let c = p.chan();
     do task::spawn || {
-        test00_start(c, number_of_messages * 0, number_of_messages);
+        test00_start(&c, number_of_messages * 0, number_of_messages);
     }
     let c = p.chan();
     do task::spawn || {
-        test00_start(c, number_of_messages * 1, number_of_messages);
+        test00_start(&c, number_of_messages * 1, number_of_messages);
     }
     let c = p.chan();
     do task::spawn || {
-        test00_start(c, number_of_messages * 2, number_of_messages);
+        test00_start(&c, number_of_messages * 2, number_of_messages);
     }
     let c = p.chan();
     do task::spawn || {
-        test00_start(c, number_of_messages * 3, number_of_messages);
+        test00_start(&c, number_of_messages * 3, number_of_messages);
     }
 
     let mut i: int = 0;