diff --git a/src/test/bench/core-std.rs b/src/test/bench/core-std.rs index e8fb86fda78..eecf509998b 100644 --- a/src/test/bench/core-std.rs +++ b/src/test/bench/core-std.rs @@ -17,6 +17,7 @@ use std::oldmap::{Map, HashMap}; use core::io::{Reader, ReaderUtil}; +use core::rand::RngUtil; macro_rules! bench ( ($id:ident) => (maybe_run_test(argv, stringify!($id).to_owned(), $id)) diff --git a/src/test/bench/graph500-bfs.rs b/src/test/bench/graph500-bfs.rs index 8da09af2d18..b99dfa8bacb 100644 --- a/src/test/bench/graph500-bfs.rs +++ b/src/test/bench/graph500-bfs.rs @@ -29,6 +29,7 @@ use std::par; use core::io::WriterUtil; use core::int::abs; +use core::rand::RngUtil; type node_id = i64; type graph = ~[~[node_id]]; @@ -37,7 +38,7 @@ fn make_edges(scale: uint, edgefactor: uint) -> ~[(node_id, node_id)] { let r = rand::xorshift(); - fn choose_edge(i: node_id, j: node_id, scale: uint, r: rand::Rng) + fn choose_edge(i: node_id, j: node_id, scale: uint, r: @rand::Rng) -> (node_id, node_id) { let A = 0.57; diff --git a/src/test/bench/noise.rs b/src/test/bench/noise.rs index 9825671bc8a..7993822afd8 100644 --- a/src/test/bench/noise.rs +++ b/src/test/bench/noise.rs @@ -1,5 +1,7 @@ // Perlin noise benchmark from https://gist.github.com/1170424 +use core::rand::RngUtil; + struct Vec2 { x: f32, y: f32, @@ -8,7 +10,7 @@ struct Vec2 { fn lerp(a: f32, b: f32, v: f32) -> f32 { a * (1.0 - v) + b * v } fn smooth(v: f32) -> f32 { v * v * (3.0 - 2.0 * v) } -fn random_gradient(r: rand::Rng) -> Vec2 { +fn random_gradient(r: @rand::Rng) -> Vec2 { let v = r.gen_float() * float::consts::pi * 2.0; Vec2{ x: float::cos(v) as f32, diff --git a/src/test/bench/shootout-fasta.rs b/src/test/bench/shootout-fasta.rs index 2bc89f64a29..8c371150e1e 100644 --- a/src/test/bench/shootout-fasta.rs +++ b/src/test/bench/shootout-fasta.rs @@ -57,7 +57,11 @@ fn bisect(v: ~[AminoAcids], lo: uint, hi: uint, target: u32) -> char { return bisect(copy genelist, 0, vec::len::(genelist) - 1, r); } -fn make_random_fasta(wr: io::Writer, id: ~str, desc: ~str, genelist: ~[AminoAcids], n: int) { +fn make_random_fasta(wr: @io::Writer, + id: ~str, + desc: ~str, + genelist: ~[AminoAcids], + n: int) { wr.write_line(~">" + id + ~" " + desc); let rng = @mut MyRandom {last: rand::Rng().next()}; let mut op: ~str = ~""; @@ -72,7 +76,7 @@ fn make_random_fasta(wr: io::Writer, id: ~str, desc: ~str, genelist: ~[AminoAcid if str::len(op) > 0u { wr.write_line(op); } } -fn make_repeat_fasta(wr: io::Writer, id: ~str, desc: ~str, s: ~str, n: int) { +fn make_repeat_fasta(wr: @io::Writer, id: ~str, desc: ~str, s: ~str, n: int) { unsafe { wr.write_line(~">" + id + ~" " + desc); let mut op: ~str = ~""; diff --git a/src/test/bench/shootout-mandelbrot.rs b/src/test/bench/shootout-mandelbrot.rs index 146a4b8c869..eeea62d50fb 100644 --- a/src/test/bench/shootout-mandelbrot.rs +++ b/src/test/bench/shootout-mandelbrot.rs @@ -110,7 +110,7 @@ fn get_type(&self) -> io::WriterType { io::File } fn writer(path: ~str, pport: comm::Port, size: uint) { - let cout: io::Writer = match path { + let cout: @io::Writer = match path { ~"" => { @Devnull as @io::Writer } diff --git a/src/test/bench/sudoku.rs b/src/test/bench/sudoku.rs index 78234ca0dfa..e2edb1a94ea 100644 --- a/src/test/bench/sudoku.rs +++ b/src/test/bench/sudoku.rs @@ -39,7 +39,7 @@ pub enum grid_t { grid_ctor(grid), } // read a sudoku problem from file f -pub fn read_grid(f: io::Reader) -> grid_t { +pub fn read_grid(f: @io::Reader) -> grid_t { fail_unless!(f.read_line() == ~"9,9"); /* assert first line is exactly "9,9" */ let mut g = vec::from_fn(10u, {|_i| @@ -127,7 +127,7 @@ fn drop_color(g: grid, mut colors: bitv::Bitv, row: u8, col: u8) { } } -pub fn write_grid(f: io::Writer, g: grid_t) { +pub fn write_grid(f: @io::Writer, g: grid_t) { for u8::range(0u8, 9u8) |row| { f.write_str(fmt!("%u", (*g)[row][0] as uint)); for u8::range(1u8, 9u8) |col| {