diff --git a/src/test/bench/core-map.rs b/src/test/bench/core-map.rs index c978046e391..cc7a0f2c768 100644 --- a/src/test/bench/core-map.rs +++ b/src/test/bench/core-map.rs @@ -14,7 +14,6 @@ use std::collections::{BTreeMap, HashMap, HashSet}; use std::os; use std::rand::{Rng, IsaacRng, SeedableRng}; use std::time::Duration; -use std::uint; fn timed(label: &str, f: F) where F: FnMut() { println!(" {}: {}", label, Duration::span(f)); diff --git a/src/test/bench/core-set.rs b/src/test/bench/core-set.rs index edeb07c960e..e638721a501 100644 --- a/src/test/bench/core-set.rs +++ b/src/test/bench/core-set.rs @@ -22,7 +22,6 @@ use std::collections::hash_map::Hasher; use std::hash::Hash; use std::os; use std::time::Duration; -use std::uint; struct Results { sequential_ints: Duration, diff --git a/src/test/bench/core-uint-to-str.rs b/src/test/bench/core-uint-to-str.rs index 0235482ca2c..6a66785a1ae 100644 --- a/src/test/bench/core-uint-to-str.rs +++ b/src/test/bench/core-uint-to-str.rs @@ -9,7 +9,6 @@ // except according to those terms. use std::os; -use std::uint; fn main() { let args = os::args(); diff --git a/src/test/bench/msgsend-pipes-shared.rs b/src/test/bench/msgsend-pipes-shared.rs index a091e0853f9..7fe086f1d0e 100644 --- a/src/test/bench/msgsend-pipes-shared.rs +++ b/src/test/bench/msgsend-pipes-shared.rs @@ -22,7 +22,6 @@ use std::sync::mpsc::{channel, Sender, Receiver}; use std::os; use std::thread::Thread; use std::time::Duration; -use std::uint; fn move_out(_x: T) {} diff --git a/src/test/bench/msgsend-pipes.rs b/src/test/bench/msgsend-pipes.rs index a9e6cef38aa..fef78f413f6 100644 --- a/src/test/bench/msgsend-pipes.rs +++ b/src/test/bench/msgsend-pipes.rs @@ -18,9 +18,6 @@ use std::sync::mpsc::{channel, Sender, Receiver}; use std::os; use std::thread::Thread; use std::time::Duration; -use std::uint; - -fn move_out(_x: T) {} enum request { get_count, @@ -42,7 +39,7 @@ fn server(requests: &Receiver, responses: &Sender) { _ => { } } } - responses.send(count); + responses.send(count).unwrap(); //println!("server exiting"); } diff --git a/src/test/bench/msgsend-ring-mutex-arcs.rs b/src/test/bench/msgsend-ring-mutex-arcs.rs index ef5e8f3f4bb..51819424929 100644 --- a/src/test/bench/msgsend-ring-mutex-arcs.rs +++ b/src/test/bench/msgsend-ring-mutex-arcs.rs @@ -21,7 +21,6 @@ use std::os; use std::sync::{Arc, Future, Mutex, Condvar}; use std::time::Duration; -use std::uint; // A poor man's pipe. type pipe = Arc<(Mutex>, Condvar)>; @@ -76,7 +75,7 @@ fn main() { let num_tasks = args[1].parse::().unwrap(); let msg_per_task = args[2].parse::().unwrap(); - let (mut num_chan, num_port) = init(); + let (num_chan, num_port) = init(); let mut p = Some((num_chan, num_port)); let dur = Duration::span(|| { diff --git a/src/test/bench/rt-parfib.rs b/src/test/bench/rt-parfib.rs index 37210cd93f1..7dc94efcf91 100644 --- a/src/test/bench/rt-parfib.rs +++ b/src/test/bench/rt-parfib.rs @@ -11,23 +11,22 @@ use std::sync::mpsc::channel; use std::os; use std::thread::Thread; -use std::uint; // A simple implementation of parfib. One subtree is found in a new // task and communicated over a oneshot pipe, the other is found // locally. There is no sequential-mode threshold. fn parfib(n: uint) -> uint { - if(n == 0 || n == 1) { + if n == 0 || n == 1 { return 1; } let (tx, rx) = channel(); Thread::spawn(move|| { - tx.send(parfib(n-1)); + tx.send(parfib(n-1)).unwrap(); }); let m2 = parfib(n-2); - return (rx.recv().unwrap() + m2); + return rx.recv().unwrap() + m2; } fn main() { diff --git a/src/test/bench/shootout-binarytrees.rs b/src/test/bench/shootout-binarytrees.rs index 737776368dd..fad5e174644 100644 --- a/src/test/bench/shootout-binarytrees.rs +++ b/src/test/bench/shootout-binarytrees.rs @@ -92,7 +92,7 @@ fn main() { let long_lived_arena = TypedArena::new(); let long_lived_tree = bottom_up_tree(&long_lived_arena, 0, max_depth); - let mut messages = range_step(min_depth, max_depth + 1, 2).map(|depth| { + let messages = range_step(min_depth, max_depth + 1, 2).map(|depth| { use std::num::Int; let iterations = 2i.pow((max_depth - depth + min_depth) as uint); Thread::scoped(move|| { diff --git a/src/test/bench/shootout-chameneos-redux.rs b/src/test/bench/shootout-chameneos-redux.rs index c58c6ef6212..33995a9be74 100644 --- a/src/test/bench/shootout-chameneos-redux.rs +++ b/src/test/bench/shootout-chameneos-redux.rs @@ -182,7 +182,7 @@ fn rendezvous(nn: uint, set: Vec) { let (to_rendezvous_log, from_creatures_log) = channel::(); // these channels will allow us to talk to each creature by 'name'/index - let mut to_creature: Vec> = + let to_creature: Vec> = set.iter().enumerate().map(|(ii, &col)| { // create each creature as a listener with a port, and // give us a channel to talk to each diff --git a/src/test/bench/shootout-fannkuch-redux.rs b/src/test/bench/shootout-fannkuch-redux.rs index bd4b8e5e97f..e8e8ac48485 100644 --- a/src/test/bench/shootout-fannkuch-redux.rs +++ b/src/test/bench/shootout-fannkuch-redux.rs @@ -128,7 +128,7 @@ impl Perm { } -fn reverse(tperm: &mut [i32], mut k: uint) { +fn reverse(tperm: &mut [i32], k: uint) { tperm.slice_to_mut(k).reverse() } @@ -163,7 +163,7 @@ fn fannkuch(n: i32) -> (i32, i32) { let mut futures = vec![]; let k = perm.max() / N; - for (i, j) in range(0, N).zip(iter::count(0, k)) { + for (_, j) in range(0, N).zip(iter::count(0, k)) { let max = cmp::min(j+k, perm.max()); futures.push(Thread::scoped(move|| { diff --git a/src/test/bench/shootout-k-nucleotide.rs b/src/test/bench/shootout-k-nucleotide.rs index 9057372d2cf..5256e607d20 100644 --- a/src/test/bench/shootout-k-nucleotide.rs +++ b/src/test/bench/shootout-k-nucleotide.rs @@ -43,7 +43,6 @@ #![feature(box_syntax)] use std::ascii::OwnedAsciiExt; -use std::iter::repeat; use std::slice; use std::sync::Arc; use std::thread::Thread; diff --git a/src/test/bench/shootout-nbody.rs b/src/test/bench/shootout-nbody.rs index 7973af3722d..c65f98e545b 100644 --- a/src/test/bench/shootout-nbody.rs +++ b/src/test/bench/shootout-nbody.rs @@ -202,6 +202,6 @@ fn shift_mut_ref<'a, T>(r: &mut &'a mut [T]) -> Option<&'a mut T> { raw.data = raw.data.offset(1); raw.len -= 1; *r = mem::transmute(raw); - Some(unsafe { &mut *ret }) + Some({ &mut *ret }) } } diff --git a/src/test/bench/shootout-reverse-complement.rs b/src/test/bench/shootout-reverse-complement.rs index 841f70e13c4..c8a74c7d735 100644 --- a/src/test/bench/shootout-reverse-complement.rs +++ b/src/test/bench/shootout-reverse-complement.rs @@ -229,7 +229,7 @@ unsafe impl Send for Racy {} /// Executes a closure in parallel over the given iterator over mutable slice. /// The closure `f` is run in parallel with an element of `iter`. -fn parallel<'a, I, T, F>(mut iter: I, f: F) +fn parallel<'a, I, T, F>(iter: I, f: F) where T: 'a+Send + Sync, I: Iterator, F: Fn(&mut [T]) + Sync { diff --git a/src/test/bench/shootout-threadring.rs b/src/test/bench/shootout-threadring.rs index da427b36e8d..ea4b3c46312 100644 --- a/src/test/bench/shootout-threadring.rs +++ b/src/test/bench/shootout-threadring.rs @@ -43,7 +43,7 @@ use std::thread::Thread; fn start(n_tasks: int, token: int) { let (tx, mut rx) = channel(); - tx.send(token); + tx.send(token).unwrap(); for i in range(2, n_tasks + 1) { let (tx, next_rx) = channel(); Thread::spawn(move|| roundtrip(i, tx, rx)); @@ -58,7 +58,7 @@ fn roundtrip(id: int, tx: Sender, rx: Receiver) { println!("{}", id); break; } - tx.send(token - 1); + tx.send(token - 1).unwrap(); } } diff --git a/src/test/bench/std-smallintmap.rs b/src/test/bench/std-smallintmap.rs index c2e657151f0..c200c089bf4 100644 --- a/src/test/bench/std-smallintmap.rs +++ b/src/test/bench/std-smallintmap.rs @@ -13,7 +13,6 @@ use std::collections::VecMap; use std::os; use std::time::Duration; -use std::uint; fn append_sequential(min: uint, max: uint, map: &mut VecMap) { for i in range(min, max) { diff --git a/src/test/bench/sudoku.rs b/src/test/bench/sudoku.rs index 786bbdfc803..67476eddbc7 100644 --- a/src/test/bench/sudoku.rs +++ b/src/test/bench/sudoku.rs @@ -55,18 +55,6 @@ impl Sudoku { return Sudoku::new(g) } - pub fn equal(&self, other: &Sudoku) -> bool { - for row in range(0u8, 9u8) { - for col in range(0u8, 9u8) { - if self.grid[row as uint][col as uint] != - other.grid[row as uint][col as uint] { - return false; - } - } - } - return true; - } - pub fn read(mut reader: &mut BufferedReader) -> Sudoku { /* assert first line is exactly "9,9" */ assert!(reader.read_line().unwrap() == "9,9".to_string()); @@ -184,7 +172,7 @@ impl Colors { fn next(&self) -> u8 { let Colors(c) = *self; let val = c & HEADS; - if (0u16 == val) { + if 0u16 == val { return 0u8; } else { return val.trailing_zeros() as u8 diff --git a/src/test/bench/task-perf-alloc-unwind.rs b/src/test/bench/task-perf-alloc-unwind.rs index dc536102d5d..03dc9dd4441 100644 --- a/src/test/bench/task-perf-alloc-unwind.rs +++ b/src/test/bench/task-perf-alloc-unwind.rs @@ -19,10 +19,6 @@ enum List { Nil, Cons(T, Box>) } -enum UniqueList { - ULNil, ULCons(Box) -} - fn main() { let (repeat, depth) = if os::getenv("RUST_BENCH").is_some() { (50, 1000) diff --git a/src/test/bench/task-perf-jargon-metal-smoke.rs b/src/test/bench/task-perf-jargon-metal-smoke.rs index a2a380279f3..31a4ac3d045 100644 --- a/src/test/bench/task-perf-jargon-metal-smoke.rs +++ b/src/test/bench/task-perf-jargon-metal-smoke.rs @@ -20,7 +20,6 @@ use std::sync::mpsc::{channel, Sender}; use std::os; use std::thread::Thread; -use std::uint; fn child_generation(gens_left: uint, tx: Sender<()>) { // This used to be O(n^2) in the number of generations that ever existed. diff --git a/src/test/bench/task-perf-spawnalot.rs b/src/test/bench/task-perf-spawnalot.rs index eb1e30e2846..e76fad9f1a4 100644 --- a/src/test/bench/task-perf-spawnalot.rs +++ b/src/test/bench/task-perf-spawnalot.rs @@ -9,7 +9,6 @@ // except according to those terms. use std::os; -use std::uint; use std::thread::Thread; fn f(n: uint) {