rust/src/test/run-fail/unwind-misc-1.rs
Marijn Haverbeke 3b5b93221e Remove some semicolons after block calls
The remaining ones can be removed after the next snapshot. (Or
we can let the next pretty-print pass take care of them.)
2011-10-21 14:24:42 +02:00

28 lines
565 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 = [];
uint::range(0u, 10u) {|i|
arr += [@"key stuff"];
map.insert(arr, arr + [@"value stuff"]);
}
}