Skip to content

Commit 0f4ee2d

Browse files
committed
bench: fix a few compiler warnings
1 parent 2a8cb67 commit 0f4ee2d

19 files changed

+14
-43
lines changed

src/test/bench/core-map.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use std::collections::{BTreeMap, HashMap, HashSet};
1414
use std::os;
1515
use std::rand::{Rng, IsaacRng, SeedableRng};
1616
use std::time::Duration;
17-
use std::uint;
1817

1918
fn timed<F>(label: &str, f: F) where F: FnMut() {
2019
println!(" {}: {}", label, Duration::span(f));

src/test/bench/core-set.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use std::collections::HashSet;
2121
use std::hash::Hash;
2222
use std::os;
2323
use std::time::Duration;
24-
use std::uint;
2524

2625
struct Results {
2726
sequential_ints: Duration,

src/test/bench/core-uint-to-str.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
use std::os;
12-
use std::uint;
1312

1413
fn main() {
1514
let args = os::args();

src/test/bench/msgsend-pipes-shared.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use std::sync::mpsc::{channel, Sender, Receiver};
2222
use std::os;
2323
use std::thread::Thread;
2424
use std::time::Duration;
25-
use std::uint;
2625

2726
fn move_out<T>(_x: T) {}
2827

src/test/bench/msgsend-pipes.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ use std::sync::mpsc::{channel, Sender, Receiver};
1818
use std::os;
1919
use std::thread::Thread;
2020
use std::time::Duration;
21-
use std::uint;
22-
23-
fn move_out<T>(_x: T) {}
2421

2522
enum request {
2623
get_count,
@@ -42,7 +39,7 @@ fn server(requests: &Receiver<request>, responses: &Sender<uint>) {
4239
_ => { }
4340
}
4441
}
45-
responses.send(count);
42+
responses.send(count).unwrap();
4643
//println!("server exiting");
4744
}
4845

src/test/bench/msgsend-ring-mutex-arcs.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
use std::os;
2222
use std::sync::{Arc, Future, Mutex, Condvar};
2323
use std::time::Duration;
24-
use std::uint;
2524

2625
// A poor man's pipe.
2726
type pipe = Arc<(Mutex<Vec<uint>>, Condvar)>;
@@ -76,7 +75,7 @@ fn main() {
7675
let num_tasks = args[1].parse::<uint>().unwrap();
7776
let msg_per_task = args[2].parse::<uint>().unwrap();
7877

79-
let (mut num_chan, num_port) = init();
78+
let (num_chan, num_port) = init();
8079

8180
let mut p = Some((num_chan, num_port));
8281
let dur = Duration::span(|| {

src/test/bench/rt-parfib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,22 @@
1111
use std::sync::mpsc::channel;
1212
use std::os;
1313
use std::thread::Thread;
14-
use std::uint;
1514

1615
// A simple implementation of parfib. One subtree is found in a new
1716
// task and communicated over a oneshot pipe, the other is found
1817
// locally. There is no sequential-mode threshold.
1918

2019
fn parfib(n: uint) -> uint {
21-
if(n == 0 || n == 1) {
20+
if n == 0 || n == 1 {
2221
return 1;
2322
}
2423

2524
let (tx, rx) = channel();
2625
Thread::spawn(move|| {
27-
tx.send(parfib(n-1));
26+
tx.send(parfib(n-1)).unwrap();
2827
});
2928
let m2 = parfib(n-2);
30-
return (rx.recv().unwrap() + m2);
29+
return rx.recv().unwrap() + m2;
3130
}
3231

3332
fn main() {

src/test/bench/shootout-binarytrees.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn main() {
9292
let long_lived_arena = TypedArena::new();
9393
let long_lived_tree = bottom_up_tree(&long_lived_arena, 0, max_depth);
9494

95-
let mut messages = range_step(min_depth, max_depth + 1, 2).map(|depth| {
95+
let messages = range_step(min_depth, max_depth + 1, 2).map(|depth| {
9696
use std::num::Int;
9797
let iterations = 2i.pow((max_depth - depth + min_depth) as uint);
9898
Thread::scoped(move|| {

src/test/bench/shootout-chameneos-redux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ fn rendezvous(nn: uint, set: Vec<Color>) {
182182
let (to_rendezvous_log, from_creatures_log) = channel::<String>();
183183

184184
// these channels will allow us to talk to each creature by 'name'/index
185-
let mut to_creature: Vec<Sender<CreatureInfo>> =
185+
let to_creature: Vec<Sender<CreatureInfo>> =
186186
set.iter().enumerate().map(|(ii, &col)| {
187187
// create each creature as a listener with a port, and
188188
// give us a channel to talk to each

src/test/bench/shootout-fannkuch-redux.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl Perm {
130130
}
131131

132132

133-
fn reverse(tperm: &mut [i32], mut k: uint) {
133+
fn reverse(tperm: &mut [i32], k: uint) {
134134
tperm.slice_to_mut(k).reverse()
135135
}
136136

@@ -165,7 +165,7 @@ fn fannkuch(n: i32) -> (i32, i32) {
165165
let mut futures = vec![];
166166
let k = perm.max() / N;
167167

168-
for (i, j) in range(0, N).zip(iter::count(0, k)) {
168+
for (_, j) in range(0, N).zip(iter::count(0, k)) {
169169
let max = cmp::min(j+k, perm.max());
170170

171171
futures.push(Thread::scoped(move|| {

0 commit comments

Comments
 (0)