2011-09-09 16:20:11 -07:00
|
|
|
// error-pattern:fail
|
|
|
|
|
|
|
|
use std;
|
|
|
|
import std::map;
|
2011-12-13 16:25:51 -08:00
|
|
|
import uint;
|
2011-09-09 16:20:11 -07:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let count = @mutable 0u;
|
2011-10-25 17:57:26 +02:00
|
|
|
fn hash(&&s: [@str]) -> uint {
|
2011-12-13 16:25:51 -08:00
|
|
|
if (vec::len(s) > 0u && str::eq(*s[0], "boom")) { fail; }
|
2011-10-25 17:57:26 +02:00
|
|
|
ret 10u;
|
|
|
|
}
|
2011-10-10 13:54:03 +02:00
|
|
|
fn eq(&&s: [@str], &&t: [@str]) -> bool {
|
2011-09-09 16:20:11 -07:00
|
|
|
ret s == t;
|
|
|
|
}
|
|
|
|
|
|
|
|
let map = map::mk_hashmap(hash, eq);
|
|
|
|
let arr = [];
|
2011-10-21 13:14:28 +02:00
|
|
|
uint::range(0u, 10u) {|i|
|
2011-09-09 16:20:11 -07:00
|
|
|
arr += [@"key stuff"];
|
|
|
|
map.insert(arr, arr + [@"value stuff"]);
|
2011-10-21 14:12:12 +02:00
|
|
|
}
|
2011-10-25 17:57:26 +02:00
|
|
|
map.insert([@"boom"], []);
|
2011-09-09 16:20:11 -07:00
|
|
|
}
|