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