rust/src/test/run-fail/unwind-misc-1.rs
Brian Anderson 393deeb06f Merge branch 'unwind'
Conflicts:
	src/comp/middle/trans.rs
	src/comp/middle/trans_build.rs
	src/lib/run_program.rs
	src/test/compiletest/runtest.rs
2011-09-12 09:36:51 -07:00

28 lines
570 B
Rust

// error-pattern:fail
use std;
import std::map;
import std::uint;
fn main() {
let count = @mutable 0u;
let hash = bind fn (_s: [@str], count: @mutable uint) -> uint {
*count += 1u;
if *count == 10u {
fail;
} else {
ret *count;
}
} (_, count);
fn eq(s: [@str], t: [@str]) -> bool {
ret s == t;
}
let map = map::mk_hashmap(hash, eq);
let arr = [];
for each i in uint::range(0u, 10u) {
arr += [@"key stuff"];
map.insert(arr, arr + [@"value stuff"]);
}
}