about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-03-07 16:48:57 -0800
committerPatrick Walton <pcwalton@mimiga.net>2012-03-07 16:51:31 -0800
commitf0250a23d3fa2f8b4a4a4113ca89e41945a4cfed (patch)
treedc4426e7ef764f596c25feb3947980ea9ee2d042 /src/test
parenta9bd76b3c11ee0ad706abc3779a337fee3550424 (diff)
downloadrust-f0250a23d3fa2f8b4a4a4113ca89e41945a4cfed.tar.gz
rust-f0250a23d3fa2f8b4a4a4113ca89e41945a4cfed.zip
stdlib: Stop incurring vtable dispatch costs when hashmaps are used
This required changing almost all users of hashmaps to import the hashmap interface first.

The `size` member in the hashmap structure was renamed to `count` to work around a name conflict.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/bench/shootout-mandelbrot.rs1
-rw-r--r--src/test/bench/task-perf-word-count.rs1
-rw-r--r--src/test/compile-fail/map-types.rs6
-rw-r--r--src/test/run-fail/unwind-misc-1.rs3
-rw-r--r--src/test/run-pass/hashmap-memory.rs1
-rw-r--r--src/test/run-pass/issue-1696.rs1
6 files changed, 10 insertions, 3 deletions
diff --git a/src/test/bench/shootout-mandelbrot.rs b/src/test/bench/shootout-mandelbrot.rs
index 984e8d78a18..6cf0d3e7ce3 100644
--- a/src/test/bench/shootout-mandelbrot.rs
+++ b/src/test/bench/shootout-mandelbrot.rs
@@ -14,6 +14,7 @@
 
 use std;
 import std::io::writer_util;
+import std::map::hashmap;
 
 type cmplx = {re: f64, im: f64};
 type line = {i: uint, b: [u8]};
diff --git a/src/test/bench/task-perf-word-count.rs b/src/test/bench/task-perf-word-count.rs
index a69a2d54c6f..d800b5e9a64 100644
--- a/src/test/bench/task-perf-word-count.rs
+++ b/src/test/bench/task-perf-word-count.rs
@@ -13,6 +13,7 @@ use std;
 import option = option;
 import option::{some, none};
 import std::{map, io, time};
+import std::map::hashmap;
 import io::reader_util;
 
 import comm::chan;
diff --git a/src/test/compile-fail/map-types.rs b/src/test/compile-fail/map-types.rs
index f0c8bdf7b52..76c0807e69b 100644
--- a/src/test/compile-fail/map-types.rs
+++ b/src/test/compile-fail/map-types.rs
@@ -1,10 +1,12 @@
 use std;
 import std::map;
+import std::map::hashmap;
 import std::map::map;
 
 // Test that iface types printed in error msgs include the type arguments.
 
 fn main() {
-    let x: map<uint,str> = map::new_str_hash::<str>();
+    let x: map<str,str> = map::new_str_hash::<str>() as map::<str,str>;
+    let y: map<uint,str> = x;
     //!^ ERROR mismatched types: expected `std::map::map<uint,str>`
-}
\ No newline at end of file
+}
diff --git a/src/test/run-fail/unwind-misc-1.rs b/src/test/run-fail/unwind-misc-1.rs
index 365a1cbdcc6..532a911bd42 100644
--- a/src/test/run-fail/unwind-misc-1.rs
+++ b/src/test/run-fail/unwind-misc-1.rs
@@ -2,6 +2,7 @@
 
 use std;
 import std::map;
+import std::map::hashmap;
 import uint;
 
 fn main() {
@@ -21,4 +22,4 @@ fn main() {
         map.insert(arr, arr + [@"value stuff"]);
     }
     map.insert([@"boom"], []);
-}
\ No newline at end of file
+}
diff --git a/src/test/run-pass/hashmap-memory.rs b/src/test/run-pass/hashmap-memory.rs
index bc16c319374..10f7388f720 100644
--- a/src/test/run-pass/hashmap-memory.rs
+++ b/src/test/run-pass/hashmap-memory.rs
@@ -12,6 +12,7 @@ import option::none;
 import str;
 import vec;
 import std::map;
+import std::map::hashmap;
 import task;
 import comm::chan;
 import comm::port;
diff --git a/src/test/run-pass/issue-1696.rs b/src/test/run-pass/issue-1696.rs
index f55e2fb8541..249f64d445d 100644
--- a/src/test/run-pass/issue-1696.rs
+++ b/src/test/run-pass/issue-1696.rs
@@ -1,5 +1,6 @@
 use std;
 import std::map;
+import std::map::hashmap;
 
 fn main() {
     let m = map::new_bytes_hash();