Merge remote-tracking branch 'thestinger/old_map' into incoming

Conflicts:
	src/test/bench/core-map.rs
This commit is contained in:
Brian Anderson 2013-02-03 17:55:19 -08:00
commit 3b396d17d6
111 changed files with 528 additions and 641 deletions

View file

@ -14,7 +14,7 @@
extern mod std;
use core::dvec::*;
use std::map::HashMap;
use std::oldmap::HashMap;
pub type header_map = HashMap<~str, @DVec<@~str>>;

View file

@ -9,7 +9,7 @@
// except according to those terms.
extern mod std;
use std::map;
use std::oldmap;
use std::treemap::TreeMap;
use core::hashmap::linear::*;
use core::io::WriterUtil;
@ -35,7 +35,7 @@ fn timed(result: &mut float,
fn old_int_benchmarks(rng: @rand::Rng, num_keys: uint, results: &mut Results) {
{
let map = map::HashMap();
let map = oldmap::HashMap();
do timed(&mut results.sequential_ints) {
for uint::range(0, num_keys) |i| {
map.insert(i, i+1);
@ -48,7 +48,7 @@ fn old_int_benchmarks(rng: @rand::Rng, num_keys: uint, results: &mut Results) {
}
{
let map = map::HashMap();
let map = oldmap::HashMap();
do timed(&mut results.random_ints) {
for uint::range(0, num_keys) |i| {
map.insert(rng.next() as uint, i);
@ -57,14 +57,14 @@ fn old_int_benchmarks(rng: @rand::Rng, num_keys: uint, results: &mut Results) {
}
{
let map = map::HashMap();
let map = oldmap::HashMap();
for uint::range(0, num_keys) |i| {
map.insert(i, i);;
}
do timed(&mut results.delete_ints) {
for uint::range(0, num_keys) |i| {
assert map.remove(i);
assert map.remove(&i);
}
}
}
@ -72,7 +72,7 @@ fn old_int_benchmarks(rng: @rand::Rng, num_keys: uint, results: &mut Results) {
fn old_str_benchmarks(rng: @rand::Rng, num_keys: uint, results: &mut Results) {
{
let map = map::HashMap();
let map = oldmap::HashMap();
do timed(&mut results.sequential_strings) {
for uint::range(0, num_keys) |i| {
let s = uint::to_str(i);
@ -87,7 +87,7 @@ fn old_str_benchmarks(rng: @rand::Rng, num_keys: uint, results: &mut Results) {
}
{
let map = map::HashMap();
let map = oldmap::HashMap();
do timed(&mut results.random_strings) {
for uint::range(0, num_keys) |i| {
let s = uint::to_str(rng.next() as uint);
@ -97,13 +97,13 @@ fn old_str_benchmarks(rng: @rand::Rng, num_keys: uint, results: &mut Results) {
}
{
let map = map::HashMap();
let map = oldmap::HashMap();
for uint::range(0, num_keys) |i| {
map.insert(uint::to_str(i), i);
}
do timed(&mut results.delete_strings) {
for uint::range(0, num_keys) |i| {
assert map.remove(uint::to_str(i));
assert map.remove(&uint::to_str(i));
}
}
}
@ -309,7 +309,7 @@ fn main() {
let mut results = empty_results();
old_int_benchmarks(rng, num_keys, &mut results);
old_str_benchmarks(rng, num_keys, &mut results);
write_results("std::map::HashMap", &results);
write_results("std::oldmap::HashMap", &results);
}
{

View file

@ -13,8 +13,8 @@
extern mod std;
use std::time::precise_time_s;
use std::map;
use std::map::{Map, HashMap};
use std::oldmap;
use std::oldmap::{Map, HashMap};
use io::{Reader, ReaderUtil};
@ -75,12 +75,12 @@ fn read_line() {
fn str_set() {
let r = rand::Rng();
let s = map::HashMap();
let s = oldmap::HashMap();
for int::range(0, 1000) |_i| {
map::set_add(s, r.gen_str(10));
oldmap::set_add(s, r.gen_str(10));
}
let mut found = 0;
for int::range(0, 1000) |_i| {
match s.find(r.gen_str(10)) {
@ -93,7 +93,7 @@ fn str_set() {
fn vec_plus() {
let r = rand::Rng();
let mut v = ~[];
let mut v = ~[];
let mut i = 0;
while i < 1500 {
let rv = vec::from_elem(r.gen_uint_range(0, i + 1), i);

View file

@ -19,9 +19,9 @@ An implementation of the Graph500 Breadth First Search problem in Rust.
extern mod std;
use std::arc;
use std::time;
use std::map;
use std::map::Map;
use std::map::HashMap;
use std::oldmap;
use std::oldmap::Map;
use std::oldmap::HashMap;
use std::deque;
use std::deque::Deque;
use std::par;
@ -41,7 +41,7 @@ fn make_edges(scale: uint, edgefactor: uint) -> ~[(node_id, node_id)] {
let A = 0.57;
let B = 0.19;
let C = 0.19;
if scale == 0u {
(i, j)
}
@ -49,7 +49,7 @@ fn make_edges(scale: uint, edgefactor: uint) -> ~[(node_id, node_id)] {
let i = i * 2i64;
let j = j * 2i64;
let scale = scale - 1u;
let x = r.gen_float();
if x < A {
@ -80,38 +80,38 @@ fn make_edges(scale: uint, edgefactor: uint) -> ~[(node_id, node_id)] {
fn make_graph(N: uint, edges: ~[(node_id, node_id)]) -> graph {
let graph = do vec::from_fn(N) |_i| {
map::HashMap::<node_id, ()>()
oldmap::HashMap::<node_id, ()>()
};
do vec::each(edges) |e| {
match *e {
(i, j) => {
map::set_add(graph[i], j);
map::set_add(graph[j], i);
oldmap::set_add(graph[i], j);
oldmap::set_add(graph[j], i);
}
}
true
}
do graph.map() |v| {
map::vec_from_set(*v)
oldmap::vec_from_set(*v)
}
}
fn gen_search_keys(graph: graph, n: uint) -> ~[node_id] {
let keys = map::HashMap::<node_id, ()>();
let keys = oldmap::HashMap::<node_id, ()>();
let r = rand::Rng();
while keys.size() < n {
while keys.len() < n {
let k = r.gen_uint_range(0u, graph.len());
if graph[k].len() > 0u && vec::any(graph[k], |i| {
*i != k as node_id
}) {
map::set_add(keys, k as node_id);
oldmap::set_add(keys, k as node_id);
}
}
map::vec_from_set(keys)
oldmap::vec_from_set(keys)
}
/**
@ -120,7 +120,7 @@ fn gen_search_keys(graph: graph, n: uint) -> ~[node_id] {
* Nodes that are unreachable have a parent of -1.
*/
fn bfs(graph: graph, key: node_id) -> bfs_result {
let marks : ~[mut node_id]
let marks : ~[mut node_id]
= vec::cast_to_mut(vec::from_elem(vec::len(graph), -1i64));
let Q = deque::create();
@ -300,7 +300,7 @@ fn pbfs(&&graph: arc::ARC<graph>, key: node_id) -> bfs_result {
}
/// Performs at least some of the validation in the Graph500 spec.
fn validate(edges: ~[(node_id, node_id)],
fn validate(edges: ~[(node_id, node_id)],
root: node_id, tree: bfs_result) -> bool {
// There are 5 things to test. Below is code for each of them.
@ -336,7 +336,7 @@ fn validate(edges: ~[(node_id, node_id)],
path.len() as int
}
};
if !status { return status }
// 2. Each tree edge connects vertices whose BFS levels differ by
@ -366,7 +366,7 @@ fn validate(edges: ~[(node_id, node_id)],
abs(level[u] - level[v]) <= 1
};
if !status { return status }
if !status { return status }
// 4. The BFS tree spans an entire connected component's vertices.
@ -388,7 +388,7 @@ fn validate(edges: ~[(node_id, node_id)],
}
};
if !status { return status }
if !status { return status }
// If we get through here, all the tests passed!
true
@ -440,44 +440,44 @@ fn main() {
let start = time::precise_time_s();
let bfs_tree = bfs(copy graph, *root);
let stop = time::precise_time_s();
//total_seq += stop - start;
io::stdout().write_line(
fmt!("Sequential BFS completed in %? seconds.",
stop - start));
if do_validate {
let start = time::precise_time_s();
assert(validate(copy edges, *root, bfs_tree));
let stop = time::precise_time_s();
io::stdout().write_line(
fmt!("Validation completed in %? seconds.",
stop - start));
}
let start = time::precise_time_s();
let bfs_tree = bfs2(copy graph, *root);
let stop = time::precise_time_s();
total_seq += stop - start;
io::stdout().write_line(
fmt!("Alternate Sequential BFS completed in %? seconds.",
stop - start));
if do_validate {
let start = time::precise_time_s();
assert(validate(copy edges, *root, bfs_tree));
let stop = time::precise_time_s();
io::stdout().write_line(
fmt!("Validation completed in %? seconds.",
stop - start));
}
}
let start = time::precise_time_s();
let bfs_tree = pbfs(graph_arc, *root);
let stop = time::precise_time_s();
@ -491,7 +491,7 @@ fn main() {
let start = time::precise_time_s();
assert(validate(copy edges, *root, bfs_tree));
let stop = time::precise_time_s();
io::stdout().write_line(fmt!("Validation completed in %? seconds.",
stop - start));
}

View file

@ -11,8 +11,8 @@
// chameneos
extern mod std;
use std::map;
use std::map::HashMap;
use std::oldmap;
use std::oldmap::HashMap;
use std::sort;
use std::cell::Cell;
use core::pipes::*;

View file

@ -14,15 +14,15 @@
#[legacy_modes];
extern mod std;
use std::map;
use std::map::HashMap;
use std::oldmap;
use std::oldmap::HashMap;
use std::sort;
use io::ReaderUtil;
use pipes::{stream, Port, Chan};
use cmp::Ord;
// given a map, print a sorted version of it
fn sort_and_fmt(mm: HashMap<~[u8], uint>, total: uint) -> ~str {
fn sort_and_fmt(mm: HashMap<~[u8], uint>, total: uint) -> ~str {
fn pct(xx: uint, yy: uint) -> float {
return (xx as float) * 100f / (yy as float);
}
@ -49,10 +49,9 @@ fn sort_and_fmt(mm: HashMap<~[u8], uint>, total: uint) -> ~str {
let mut pairs = ~[];
// map -> [(k,%)]
mm.each(fn&(key: ~[u8], val: uint) -> bool {
for mm.each_ref |&key, &val| {
pairs.push((key, pct(val, total)));
return true;
});
}
let pairs_sorted = sortKV(pairs);
@ -95,13 +94,13 @@ fn windows_with_carry(bb: &[u8], nn: uint,
ii += 1u;
}
return vec::slice(bb, len - (nn - 1u), len);
return vec::slice(bb, len - (nn - 1u), len);
}
fn make_sequence_processor(sz: uint, from_parent: pipes::Port<~[u8]>,
to_parent: pipes::Chan<~str>) {
let freqs: HashMap<~[u8], uint> = map::HashMap();
let freqs: HashMap<~[u8], uint> = oldmap::HashMap();
let mut carry: ~[u8] = ~[];
let mut total: uint = 0u;
@ -118,7 +117,7 @@ fn make_sequence_processor(sz: uint, from_parent: pipes::Port<~[u8]>,
});
}
let buffer = match sz {
let buffer = match sz {
1u => { sort_and_fmt(freqs, total) }
2u => { sort_and_fmt(freqs, total) }
3u => { fmt!("%u\t%s", find(freqs, ~"GGT"), ~"GGT") }
@ -165,11 +164,11 @@ fn main() {
do task::spawn_with(move from_parent) |move to_parent_, from_parent| {
make_sequence_processor(sz, from_parent, to_parent_);
};
move to_child
});
// latch stores true after we've started
// reading the sequence of interest
let mut proc_mode = false;

View file

@ -22,7 +22,7 @@
extern mod std;
use io::WriterUtil;
use std::map::HashMap;
use std::oldmap::HashMap;
struct cmplx {
re: f64,
@ -134,11 +134,11 @@ fn writer(path: ~str, pport: pipes::Port<Line>, size: uint)
done += 1_u;
let mut prev = done;
while prev <= i {
if lines.contains_key(prev) {
if lines.contains_key_ref(&prev) {
debug!("WS %u", prev);
cout.write(lines.get(prev));
done += 1_u;
lines.remove(prev);
lines.remove(&prev);
prev += 1_u;
}
else {

View file

@ -10,8 +10,8 @@
//buggy.rs
extern mod std;
use std::map::HashMap;
use std::map;
use std::oldmap::HashMap;
use std::oldmap;
fn main() {
let buggy_map :HashMap<uint, &uint> =

View file

@ -10,7 +10,7 @@
// error-pattern: mismatched types
extern mod std;
use std::map::HashMap;
use std::oldmap::HashMap;
use std::bitv;
type fn_info = {vars: HashMap<uint, var_info>};

View file

@ -8,16 +8,14 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
extern mod std;
use std::map;
use std::map::HashMap;
use std::map::StdMap;
use core::container::Map;
use core::hashmap::linear::LinearMap;
// Test that trait types printed in error msgs include the type arguments.
fn main() {
let x: StdMap<~str,~str> = map::HashMap::<~str,~str>() as
StdMap::<~str,~str>;
let y: StdMap<uint,~str> = x;
//~^ ERROR mismatched types: expected `@std::map::StdMap<uint,~str>`
let x: Map<~str, ~str> = LinearMap::new::<~str, ~str>() as
Map::<~str, ~str>;
let y: Map<uint, ~str> = x;
//~^ ERROR mismatched types: expected `@core::container::Map/&<uint,~str>`
}

View file

@ -11,12 +11,12 @@
// error-pattern:fail
extern mod std;
use std::map;
use std::map::HashMap;
use std::oldmap;
use std::oldmap::HashMap;
fn main() {
let count = @mut 0u;
let map = map::HashMap();
let map = oldmap::HashMap();
let mut arr = ~[];
for uint::range(0u, 10u) |i| {
arr += ~[@~"key stuff"];

View file

@ -12,7 +12,7 @@
// xfail-fast
extern mod std;
use std::map::*;
use std::oldmap::*;
class cat : map<int, bool> {
priv {

View file

@ -9,10 +9,8 @@
// except according to those terms.
// xfail-fast
#[legacy_modes];
extern mod std;
use std::map::*;
use core::container::{Container, Mutable, Map};
enum cat_type { tuxedo, tabby, tortoiseshell }
@ -28,121 +26,110 @@ impl cat_type : cmp::Eq {
// ok: T should be in scope when resolving the trait ref for map
struct cat<T> {
// Yes, you can have negative meows
priv mut meows : int,
// Yes, you can have negative meows
priv mut meows : int,
mut how_hungry : int,
name : T,
mut how_hungry : int,
name : T,
}
impl<T: Copy> cat<T> {
fn speak() { self.meow(); }
impl<T> cat<T> {
fn speak(&mut self) { self.meow(); }
fn eat() -> bool {
if self.how_hungry > 0 {
error!("OM NOM NOM");
self.how_hungry -= 2;
return true;
}
else {
error!("Not hungry!");
return false;
}
}
}
impl<T: Copy> cat<T> : StdMap<int, T> {
pure fn size() -> uint { self.meows as uint }
fn insert(+k: int, +_v: T) -> bool {
self.meows += k;
true
}
pure fn contains_key(+k: int) -> bool { k <= self.meows }
pure fn contains_key_ref(k: &int) -> bool { self.contains_key(*k) }
pure fn get(+k:int) -> T { match self.find(k) {
Some(v) => { v }
None => { die!(~"epic fail"); }
}
}
pure fn find(+k:int) -> Option<T> { if k <= self.meows {
Some(self.name)
}
else { None }
}
fn update_with_key(+key: int, +val: T, ff: fn(+k: int, +v0: T, +v1: T) -> T) -> bool {
match self.find(key) {
None => return self.insert(key, val),
Some(copy orig) => return self.insert(key, ff(key, orig, val))
}
}
fn update(+key: int, +val: T, ff: fn(+v0: T, +v1: T) -> T) -> bool {
match self.find(key) {
None => return self.insert(key, val),
Some(copy orig) => return self.insert(key, ff(orig, val))
}
}
fn remove(+k:int) -> bool {
match self.find(k) {
Some(x) => {
self.meows -= k; true
}
None => { false }
}
}
pure fn each(f: fn(+v: int, +v: T) -> bool) {
let mut n = int::abs(self.meows);
while n > 0 {
if !f(n, self.name) { break; }
n -= 1;
}
}
pure fn each_key(&&f: fn(+v: int) -> bool) {
for self.each |k, _v| { if !f(k) { break; } loop;};
}
pure fn each_value(&&f: fn(+v: T) -> bool) {
for self.each |_k, v| { if !f(v) { break; } loop;};
}
pure fn each_ref(f: fn(k: &int, v: &T) -> bool) {}
pure fn each_key_ref(f: fn(k: &int) -> bool) {}
pure fn each_value_ref(f: fn(k: &T) -> bool) {}
fn clear() { }
}
priv impl<T: Copy> cat<T> {
fn meow() {
self.meows += 1;
error!("Meow %d", self.meows);
if self.meows % 5 == 0 {
self.how_hungry += 1;
}
fn eat(&mut self) -> bool {
if self.how_hungry > 0 {
error!("OM NOM NOM");
self.how_hungry -= 2;
return true;
} else {
error!("Not hungry!");
return false;
}
}
}
fn cat<T: Copy>(in_x : int, in_y : int, in_name: T) -> cat<T> {
cat {
meows: in_x,
how_hungry: in_y,
name: in_name
impl<T> cat<T>: Container {
pure fn len(&self) -> uint { self.meows as uint }
pure fn is_empty(&self) -> bool { self.meows == 0 }
}
impl<T> cat<T>: Mutable {
fn clear(&mut self) {}
}
impl<T> cat<T>: Map<int, T> {
pure fn contains_key(&self, k: &int) -> bool { *k <= self.meows }
pure fn each(&self, f: fn(v: &int, v: &T) -> bool) {
let mut n = int::abs(self.meows);
while n > 0 {
if !f(&n, &self.name) { break; }
n -= 1;
}
}
pure fn each_key(&self, f: fn(v: &int) -> bool) {
for self.each |k, _| { if !f(k) { break; } loop;};
}
pure fn each_value(&self, f: fn(v: &T) -> bool) {
for self.each |_, v| { if !f(v) { break; } loop;};
}
fn insert(&mut self, k: int, _: T) -> bool {
self.meows += k;
true
}
pure fn find(&self, k: &int) -> Option<&self/T> {
if *k <= self.meows {
Some(&self.name)
} else {
None
}
}
fn remove(&mut self, k: &int) -> bool {
match self.find(k) {
Some(_) => {
self.meows -= *k; true
}
None => { false }
}
}
}
pub fn main() {
let nyan : cat<~str> = cat(0, 2, ~"nyan");
for uint::range(1u, 5u) |_i| { nyan.speak(); }
assert(nyan.find(1) == Some(~"nyan"));
assert(nyan.find(10) == None);
let spotty : cat<cat_type> = cat(2, 57, tuxedo);
for uint::range(0u, 6u) |_i| { spotty.speak(); }
assert(spotty.size() == 8u);
assert(spotty.contains_key(2));
assert(spotty.get(3) == tuxedo);
impl<T> cat<T> {
pure fn get(&self, k: &int) -> &self/T {
match self.find(k) {
Some(v) => { v }
None => { die!(~"epic fail"); }
}
}
static pure fn new(in_x: int, in_y: int, in_name: T) -> cat<T> {
cat{meows: in_x, how_hungry: in_y, name: in_name }
}
}
priv impl<T> cat<T> {
fn meow(&mut self) {
self.meows += 1;
error!("Meow %d", self.meows);
if self.meows % 5 == 0 {
self.how_hungry += 1;
}
}
}
fn main() {
let mut nyan: cat<~str> = cat::new(0, 2, ~"nyan");
for uint::range(1, 5) |_| { nyan.speak(); }
assert(*nyan.find(&1).unwrap() == ~"nyan");
assert(nyan.find(&10) == None);
let mut spotty: cat<cat_type> = cat::new(2, 57, tuxedo);
for uint::range(0, 6) |_| { spotty.speak(); }
assert(spotty.len() == 8);
assert(spotty.contains_key(&2));
assert(spotty.get(&3) == &tuxedo);
}

View file

@ -11,7 +11,7 @@
// xfail-test
extern mod std;
use std::map::*;
use std::oldmap::*;
use vec::*;
use dvec::{dvec, extensions};

View file

@ -11,7 +11,7 @@
// xfail-test
extern mod std;
use std::map::{map, hashmap, int_hash};
use std::oldmap::{map, hashmap, int_hash};
class keys<K: Copy, V: Copy, M: Copy map<K,V>>
: iter::base_iter<K> {

View file

@ -11,7 +11,7 @@
// xfail-test
extern mod std;
use list = std::map::chained;
use list = std::oldmap::chained;
use std::list;
pub fn main() {

View file

@ -11,7 +11,7 @@
// except according to those terms.
extern mod std;
use std::map::HashMap;
use std::oldmap::HashMap;
pub fn main() {
io::println("Hello world!");

View file

@ -18,15 +18,15 @@
extern mod std;
use std::map;
use std::map::HashMap;
use std::oldmap;
use std::oldmap::HashMap;
use core::pipes::*;
pub fn map(filename: ~str, emit: map_reduce::putter) { emit(filename, ~"1"); }
mod map_reduce {
use std::map;
use std::map::HashMap;
use std::oldmap;
use std::oldmap::HashMap;
use core::pipes::*;
pub type putter = fn@(~str, ~str);
@ -44,9 +44,9 @@ mod map_reduce {
}
fn map_task(ctrl: SharedChan<ctrl_proto>, input: ~str) {
let intermediates = map::HashMap();
let intermediates = oldmap::HashMap();
fn emit(im: map::HashMap<~str, int>, ctrl: SharedChan<ctrl_proto>, key: ~str,
fn emit(im: oldmap::HashMap<~str, int>, ctrl: SharedChan<ctrl_proto>, key: ~str,
val: ~str) {
let mut c;
match im.find(copy key) {
@ -75,9 +75,9 @@ mod map_reduce {
// This task becomes the master control task. It spawns others
// to do the rest.
let mut reducers: map::HashMap<~str, int>;
let mut reducers: oldmap::HashMap<~str, int>;
reducers = map::HashMap();
reducers = oldmap::HashMap();
start_mappers(ctrl_chan, copy inputs);

View file

@ -11,11 +11,10 @@
// except according to those terms.
extern mod std;
use std::map;
use std::map::HashMap;
use std::oldmap::HashMap;
pub fn main() {
let m = map::HashMap();
let m = HashMap();
m.insert(str::to_bytes(~"foo"), str::to_bytes(~"bar"));
log(error, m);
}

View file

@ -15,8 +15,8 @@ extern mod req;
extern mod std;
use req::*;
use std::map::*;
use std::map::HashMap;
use std::oldmap::*;
use std::oldmap::HashMap;
pub fn main() {
let v = ~[@~"hi"];

View file

@ -13,9 +13,9 @@
// Minimized version of issue-2804.rs. Both check that callee IDs don't
// clobber the previous node ID in a macro expr
extern mod std;
use std::map::HashMap;
use std::oldmap::HashMap;
fn add_interfaces(managed_ip: ~str, device: std::map::HashMap<~str, int>) {
fn add_interfaces(managed_ip: ~str, device: std::oldmap::HashMap<~str, int>) {
error!("%s, %?", managed_ip, device[~"interfaces"]);
}

View file

@ -12,7 +12,7 @@
extern mod std;
use io::WriterUtil;
use std::map::HashMap;
use std::oldmap::HashMap;
use std::json;
enum object
@ -60,7 +60,7 @@ fn add_interface(store: int, managed_ip: ~str, data: std::json::Json) -> (~str,
}
}
fn add_interfaces(store: int, managed_ip: ~str, device: std::map::HashMap<~str, std::json::Json>) -> ~[(~str, object)]
fn add_interfaces(store: int, managed_ip: ~str, device: std::oldmap::HashMap<~str, std::json::Json>) -> ~[(~str, object)]
{
match device[~"interfaces"]
{

View file

@ -11,8 +11,8 @@
// except according to those terms.
extern mod std;
use std::map::HashMap;
use std::map;
use std::oldmap::HashMap;
use std::oldmap;
pub fn main() {
let buggy_map :HashMap<uint, &uint> = HashMap::<uint, &uint>();

View file

@ -14,7 +14,7 @@
extern mod std;
use core::io::{WriterUtil};
use std::map::*;
use std::oldmap::*;
#[cfg(test)]
fn check_strs(actual: &str, expected: &str) -> bool

View file

@ -11,6 +11,6 @@
extern mod std;
pub fn main() {
let x = std::map::HashMap();
let x = std::oldmap::HashMap();
x.insert((@"abc", 0), 0);
}