393deeb06f
Conflicts: src/comp/middle/trans.rs src/comp/middle/trans_build.rs src/lib/run_program.rs src/test/compiletest/runtest.rs
28 lines
570 B
Rust
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"]);
|
|
}
|
|
} |