From b5f61fddde038b6dc8276b6ea2b569a2f18b2a9f Mon Sep 17 00:00:00 2001 From: Ben Striegel Date: Wed, 30 Jan 2013 23:06:32 -0500 Subject: [PATCH] Repair RIMOV damage to benchmarks --- src/test/bench/graph500-bfs.rs | 4 ++-- src/test/bench/sudoku.rs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/bench/graph500-bfs.rs b/src/test/bench/graph500-bfs.rs index 9454faba17b..c9430cf7e38 100644 --- a/src/test/bench/graph500-bfs.rs +++ b/src/test/bench/graph500-bfs.rs @@ -121,7 +121,7 @@ fn gen_search_keys(graph: graph, n: uint) -> ~[node_id] { */ fn bfs(graph: graph, key: node_id) -> bfs_result { let mut marks : ~[node_id] - = vec::cast_to_mut(vec::from_elem(vec::len(graph), -1i64)); + = vec::from_elem(vec::len(graph), -1i64); let Q = deque::create(); @@ -140,7 +140,7 @@ fn bfs(graph: graph, key: node_id) -> bfs_result { }; } - vec::cast_from_mut(move marks) + move marks } /** diff --git a/src/test/bench/sudoku.rs b/src/test/bench/sudoku.rs index 27083d2583b..91ef3f3f7ab 100644 --- a/src/test/bench/sudoku.rs +++ b/src/test/bench/sudoku.rs @@ -41,8 +41,8 @@ enum grid_t { grid_ctor(grid), } fn read_grid(f: io::Reader) -> grid_t { assert f.read_line() == ~"9,9"; /* assert first line is exactly "9,9" */ - let g = vec::from_fn(10u, {|_i| - vec::cast_to_mut(vec::from_elem(10u, 0 as u8)) + let mut g = vec::from_fn(10u, {|_i| + vec::from_elem(10u, 0 as u8) }); while !f.eof() { let comps = str::split_char(str::trim(f.read_line()), ','); @@ -57,7 +57,7 @@ fn read_grid(f: io::Reader) -> grid_t { // solve sudoku grid fn solve_grid(g: grid_t) { - fn next_color(g: grid, row: u8, col: u8, start_color: u8) -> bool { + fn next_color(mut g: grid, row: u8, col: u8, start_color: u8) -> bool { if start_color < 10u8 { // colors not yet used let avail = bitv::Bitv(10u, false); @@ -141,8 +141,8 @@ fn main() { let grid = if vec::len(args) == 1u { // FIXME create sudoku inline since nested vec consts dont work yet // (#3733) - let g = vec::from_fn(10u, |_i| { - vec::cast_to_mut(vec::from_elem(10u, 0 as u8)) + let mut g = vec::from_fn(10u, |_i| { + vec::from_elem(10u, 0 as u8) }); g[0][1] = 4u8; g[0][3] = 6u8;