From cb7a5395ddfaa7b8fc40db57b32c22f69780ccd6 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 10 Sep 2012 15:38:28 -0700 Subject: [PATCH] Convert std::map to camel case --- doc/rust.md | 2 +- src/cargo/cargo.rs | 10 +- src/libstd/json.rs | 8 +- src/libstd/map.rs | 168 +++++++++--------- src/libstd/net_url.rs | 6 +- src/libstd/smallintmap.rs | 8 +- src/libstd/std.rc | 1 - src/libsyntax/ast_map.rs | 4 +- src/libsyntax/ast_util.rs | 4 +- src/libsyntax/attr.rs | 2 +- src/libsyntax/ext/auto_serialize.rs | 6 +- src/libsyntax/ext/base.rs | 4 +- src/libsyntax/ext/expand.rs | 10 +- src/libsyntax/ext/simplext.rs | 10 +- src/libsyntax/ext/tt/macro_parser.rs | 10 +- src/libsyntax/ext/tt/macro_rules.rs | 2 +- src/libsyntax/ext/tt/transcribe.rs | 6 +- src/libsyntax/parse/common.rs | 2 +- src/libsyntax/parse/parser.rs | 12 +- src/libsyntax/parse/token.rs | 10 +- src/libsyntax/util/interner.rs | 6 +- src/rustc/back/link.rs | 2 +- src/rustc/back/rpath.rs | 2 +- src/rustc/driver/driver.rs | 2 +- src/rustc/driver/rustc.rs | 2 +- src/rustc/lib/llvm.rs | 8 +- src/rustc/metadata/creader.rs | 2 +- src/rustc/metadata/csearch.rs | 2 +- src/rustc/metadata/cstore.rs | 10 +- src/rustc/metadata/decoder.rs | 2 +- src/rustc/metadata/encoder.rs | 16 +- src/rustc/metadata/tydecode.rs | 2 +- src/rustc/metadata/tyencode.rs | 4 +- src/rustc/middle/astencode.rs | 2 +- src/rustc/middle/borrowck.rs | 12 +- src/rustc/middle/borrowck/check_loans.rs | 2 +- src/rustc/middle/capture.rs | 4 +- src/rustc/middle/check_alt.rs | 2 +- src/rustc/middle/check_const.rs | 2 +- src/rustc/middle/freevars.rs | 2 +- src/rustc/middle/kind.rs | 4 +- src/rustc/middle/lang_items.rs | 4 +- src/rustc/middle/lint.rs | 8 +- src/rustc/middle/liveness.rs | 12 +- src/rustc/middle/pat_util.rs | 4 +- src/rustc/middle/region.rs | 10 +- src/rustc/middle/resolve.rs | 36 ++-- src/rustc/middle/trans/alt.rs | 2 +- src/rustc/middle/trans/base.rs | 18 +- src/rustc/middle/trans/build.rs | 2 +- src/rustc/middle/trans/closure.rs | 2 +- src/rustc/middle/trans/common.rs | 54 +++--- src/rustc/middle/trans/debuginfo.rs | 4 +- src/rustc/middle/trans/expr.rs | 2 +- src/rustc/middle/trans/foreign.rs | 2 +- src/rustc/middle/trans/impl.rs | 2 +- src/rustc/middle/trans/reachable.rs | 4 +- src/rustc/middle/trans/reflect.rs | 2 +- src/rustc/middle/trans/shape.rs | 8 +- src/rustc/middle/trans/type_of.rs | 2 +- src/rustc/middle/trans/type_use.rs | 2 +- src/rustc/middle/ty.rs | 54 +++--- src/rustc/middle/typeck.rs | 8 +- src/rustc/middle/typeck/check.rs | 8 +- src/rustc/middle/typeck/check/method.rs | 2 +- src/rustc/middle/typeck/coherence.rs | 12 +- src/rustc/middle/typeck/infer.rs | 2 +- .../typeck/infer/region_var_bindings.rs | 14 +- src/rustc/util/common.rs | 4 +- src/rustc/util/ppaux.rs | 2 +- src/rustdoc/astsrv.rs | 2 +- src/rustdoc/attr_pass.rs | 2 +- src/rustdoc/prune_hidden_pass.rs | 2 +- src/rustdoc/tystr_pass.rs | 2 +- src/test/auxiliary/issue-2631-a.rs | 4 +- src/test/bench/core-map.rs | 8 +- src/test/bench/core-std.rs | 4 +- src/test/bench/graph500-bfs.rs | 8 +- src/test/bench/shootout-chameneos-redux.rs | 2 +- src/test/bench/shootout-k-nucleotide-pipes.rs | 10 +- src/test/bench/shootout-k-nucleotide.rs | 10 +- src/test/bench/shootout-mandelbrot.rs | 2 +- .../bench/task-perf-word-count-generic.rs | 6 +- .../borrowck-borrowed-uniq-rvalue.rs | 6 +- src/test/compile-fail/for-loop-decl.rs | 4 +- src/test/compile-fail/map-types.rs | 10 +- src/test/run-fail/unwind-misc-1.rs | 4 +- .../class-impl-very-parameterized-trait.rs | 2 +- src/test/run-pass/extern-mod-syntax.rs | 2 +- src/test/run-pass/hashmap-memory.rs | 6 +- src/test/run-pass/issue-1696.rs | 2 +- src/test/run-pass/issue-2804-2.rs | 4 +- src/test/run-pass/issue-2804.rs | 6 +- 93 files changed, 384 insertions(+), 385 deletions(-) diff --git a/doc/rust.md b/doc/rust.md index eeedc7473a0..3c3b4300507 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -450,7 +450,7 @@ Two examples of paths with type arguments: # use std::map; # fn f() { # fn id(t: T) -> T { t } -type t = map::hashmap; // Type arguments used in a type expression +type t = map::HashMap; // Type arguments used in a type expression let x = id::(10); // Type arguments used in a call expression # } ~~~~ diff --git a/src/cargo/cargo.rs b/src/cargo/cargo.rs index 7657932412f..0d5ad013d47 100644 --- a/src/cargo/cargo.rs +++ b/src/cargo/cargo.rs @@ -10,7 +10,7 @@ use syntax::diagnostic; use result::{Ok, Err}; use io::WriterUtil; use std::{map, json, tempfile, term, sort, getopts}; -use map::hashmap; +use map::HashMap; use to_str::to_str; use getopts::{optflag, optopt, opt_present}; @@ -71,9 +71,9 @@ type cargo = { libdir: Path, workdir: Path, sourcedir: Path, - sources: map::hashmap<~str, source>, + sources: map::HashMap<~str, source>, mut current_install: ~str, - dep_cache: map::hashmap<~str, bool>, + dep_cache: map::HashMap<~str, bool>, opts: options }; @@ -454,7 +454,7 @@ fn parse_source(name: ~str, j: json::Json) -> source { }; } -fn try_parse_sources(filename: &Path, sources: map::hashmap<~str, source>) { +fn try_parse_sources(filename: &Path, sources: map::HashMap<~str, source>) { if !os::path_exists(filename) { return; } let c = io::read_whole_file_str(filename); match json::from_str(result::get(c)) { @@ -469,7 +469,7 @@ fn try_parse_sources(filename: &Path, sources: map::hashmap<~str, source>) { } } -fn load_one_source_package(src: source, p: map::hashmap<~str, json::Json>) { +fn load_one_source_package(src: source, p: map::HashMap<~str, json::Json>) { let name = match p.find(~"name") { Some(json::String(n)) => { if !valid_pkg_name(*n) { diff --git a/src/libstd/json.rs b/src/libstd/json.rs index de6f2ea3e90..e9b8486165a 100644 --- a/src/libstd/json.rs +++ b/src/libstd/json.rs @@ -6,8 +6,8 @@ use core::cmp::{Eq, Ord}; use result::{Result, Ok, Err}; use io::WriterUtil; -use map::hashmap; -use map::map; +use map::HashMap; +use map::Map; use sort::Sort; export Json; @@ -34,7 +34,7 @@ enum Json { String(@~str), Boolean(bool), List(@~[Json]), - Dict(map::hashmap<~str, Json>), + Dict(map::HashMap<~str, Json>), Null, } @@ -797,7 +797,7 @@ impl ~[A]: ToJson { fn to_json() -> Json { List(@self.map(|elt| elt.to_json())) } } -impl hashmap<~str, A>: ToJson { +impl HashMap<~str, A>: ToJson { fn to_json() -> Json { let d = map::str_hash(); for self.each() |key, value| { diff --git a/src/libstd/map.rs b/src/libstd/map.rs index cd19da61ab6..2db34c32c81 100644 --- a/src/libstd/map.rs +++ b/src/libstd/map.rs @@ -12,7 +12,7 @@ use core::cmp::Eq; use hash::Hash; use to_bytes::IterBytes; -export hashmap, hashfn, eqfn, set, map, chained, hashmap, str_hash; +export HashMap, hashfn, eqfn, Set, Map, chained, hashmap, str_hash; export box_str_hash; export bytes_hash, int_hash, uint_hash, set_add; export hash_from_vec, hash_from_strs, hash_from_bytes; @@ -20,11 +20,11 @@ export hash_from_ints, hash_from_uints; export vec_from_set; /// A convenience type to treat a hashmap as a set -type set = hashmap; +type Set = HashMap; -type hashmap = chained::t; +type HashMap = chained::T; -trait map { +trait Map { /// Return the number of elements in the map pure fn size() -> uint; @@ -86,9 +86,9 @@ trait map { } mod util { - type rational = {num: int, den: int}; // : int::positive(*.den); + type Rational = {num: int, den: int}; // : int::positive(*.den); - pure fn rational_leq(x: rational, y: rational) -> bool { + pure fn rational_leq(x: Rational, y: Rational) -> bool { // NB: Uses the fact that rationals have positive denominators WLOG: x.num * y.den <= y.num * x.den @@ -99,33 +99,33 @@ mod util { // FIXME (#2344): package this up and export it as a datatype usable for // external code that doesn't want to pay the cost of a box. mod chained { - export t, mk, hashmap; + export T, mk, HashMap; const initial_capacity: uint = 32u; // 2^5 - struct entry { + struct Entry { hash: uint, key: K, value: V, - mut next: Option<@entry> + mut next: Option<@Entry> } - struct hashmap_ { + struct HashMap_ { mut count: uint, - mut chains: ~[mut Option<@entry>] + mut chains: ~[mut Option<@Entry>] } - type t = @hashmap_; + type T = @HashMap_; - enum search_result { - not_found, - found_first(uint, @entry), - found_after(@entry, @entry) + enum SearchResult { + NotFound, + FoundFirst(uint, @Entry), + FoundAfter(@Entry, @Entry) } - priv impl t { + priv impl T { pure fn search_rem(k: &K, h: uint, idx: uint, - e_root: @entry) -> search_result { + e_root: @Entry) -> SearchResult { let mut e0 = e_root; let mut comp = 1u; // for logging loop { @@ -133,7 +133,7 @@ mod chained { None => { debug!("search_tbl: absent, comp %u, hash %u, idx %u", comp, h, idx); - return not_found; + return NotFound; } Some(e1) => { comp += 1u; @@ -142,7 +142,7 @@ mod chained { debug!("search_tbl: present, comp %u, \ hash %u, idx %u", comp, h, idx); - return found_after(e0, e1); + return FoundAfter(e0, e1); } else { e0 = e1; } @@ -152,20 +152,20 @@ mod chained { }; } - pure fn search_tbl(k: &K, h: uint) -> search_result { + pure fn search_tbl(k: &K, h: uint) -> SearchResult { let idx = h % vec::len(self.chains); match copy self.chains[idx] { None => { debug!("search_tbl: none, comp %u, hash %u, idx %u", 0u, h, idx); - return not_found; + return NotFound; } Some(e) => { unchecked { if e.hash == h && e.key == *k { debug!("search_tbl: present, comp %u, hash %u, \ idx %u", 1u, h, idx); - return found_first(idx, e); + return FoundFirst(idx, e); } else { return self.search_rem(k, h, idx, e); } @@ -186,7 +186,7 @@ mod chained { self.chains = new_chains; } - pure fn each_entry(blk: fn(@entry) -> bool) { + pure fn each_entry(blk: fn(@Entry) -> bool) { // n.b. we can't use vec::iter() here because self.chains // is stored in a mutable location. let mut i = 0u, n = self.chains.len(); @@ -207,7 +207,7 @@ mod chained { } } - impl t: map { + impl T: Map { pure fn size() -> uint { self.count } fn contains_key(+k: K) -> bool { @@ -217,19 +217,19 @@ mod chained { fn contains_key_ref(k: &K) -> bool { let hash = k.hash_keyed(0,0) as uint; match self.search_tbl(k, hash) { - not_found => false, - found_first(*) | found_after(*) => true + NotFound => false, + FoundFirst(*) | FoundAfter(*) => true } } fn insert(+k: K, +v: V) -> bool { let hash = k.hash_keyed(0,0) as uint; match self.search_tbl(&k, hash) { - not_found => { + NotFound => { self.count += 1u; let idx = hash % vec::len(self.chains); let old_chain = self.chains[idx]; - self.chains[idx] = Some(@entry { + self.chains[idx] = Some(@Entry { hash: hash, key: k, value: v, @@ -245,16 +245,16 @@ mod chained { return true; } - found_first(idx, entry) => { - self.chains[idx] = Some(@entry { + FoundFirst(idx, entry) => { + self.chains[idx] = Some(@Entry { hash: hash, key: k, value: v, next: entry.next}); return false; } - found_after(prev, entry) => { - prev.next = Some(@entry { + FoundAfter(prev, entry) => { + prev.next = Some(@Entry { hash: hash, key: k, value: v, @@ -267,9 +267,9 @@ mod chained { pure fn find(+k: K) -> Option { unchecked { match self.search_tbl(&k, k.hash_keyed(0,0) as uint) { - not_found => None, - found_first(_, entry) => Some(entry.value), - found_after(_, entry) => Some(entry.value) + NotFound => None, + FoundFirst(_, entry) => Some(entry.value), + FoundAfter(_, entry) => Some(entry.value) } } } @@ -284,13 +284,13 @@ mod chained { fn remove(+k: K) -> bool { match self.search_tbl(&k, k.hash_keyed(0,0) as uint) { - not_found => false, - found_first(idx, entry) => { + NotFound => false, + FoundFirst(idx, entry) => { self.count -= 1u; self.chains[idx] = entry.next; true } - found_after(eprev, entry) => { + FoundAfter(eprev, entry) => { self.count -= 1u; eprev.next = entry.next; true @@ -330,7 +330,7 @@ mod chained { } } - impl t: ToStr { + impl T: ToStr { fn to_writer(wr: io::Writer) { if self.count == 0u { wr.write_str(~"{}"); @@ -356,7 +356,7 @@ mod chained { } } - impl t: ops::Index { + impl T: ops::Index { pure fn index(&&k: K) -> V { unchecked { self.get(k) @@ -364,12 +364,12 @@ mod chained { } } - fn chains(nchains: uint) -> ~[mut Option<@entry>] { + fn chains(nchains: uint) -> ~[mut Option<@Entry>] { vec::to_mut(vec::from_elem(nchains, None)) } - fn mk() -> t { - let slf: t = @hashmap_ {count: 0u, + fn mk() -> T { + let slf: T = @HashMap_ {count: 0u, chains: chains(initial_capacity)}; slf } @@ -380,48 +380,48 @@ Function: hashmap Construct a hashmap. */ -fn hashmap() - -> hashmap { +fn HashMap() + -> HashMap { chained::mk() } /// Construct a hashmap for string-slice keys -fn str_slice_hash() -> hashmap<&str, V> { - return hashmap(); +fn str_slice_hash() -> HashMap<&str, V> { + return HashMap(); } /// Construct a hashmap for string keys -fn str_hash() -> hashmap<~str, V> { - return hashmap(); +fn str_hash() -> HashMap<~str, V> { + return HashMap(); } /// Construct a hashmap for boxed string keys -fn box_str_hash() -> hashmap<@~str, V> { - hashmap() +fn box_str_hash() -> HashMap<@~str, V> { + HashMap() } /// Construct a hashmap for byte string keys -fn bytes_hash() -> hashmap<~[u8], V> { - return hashmap(); +fn bytes_hash() -> HashMap<~[u8], V> { + return HashMap(); } /// Construct a hashmap for int keys -fn int_hash() -> hashmap { - return hashmap(); +fn int_hash() -> HashMap { + return HashMap(); } /// Construct a hashmap for uint keys -fn uint_hash() -> hashmap { - return hashmap(); +fn uint_hash() -> HashMap { + return HashMap(); } /// Convenience function for adding keys to a hashmap with nil type keys -fn set_add(set: set, +key: K) -> bool { +fn set_add(set: Set, +key: K) -> bool { set.insert(key, ()) } /// Convert a set into a vector. -fn vec_from_set(s: set) -> ~[T] { +fn vec_from_set(s: Set) -> ~[T] { let mut v = ~[]; vec::reserve(v, s.size()); do s.each_key() |k| { @@ -433,8 +433,8 @@ fn vec_from_set(s: set) -> ~[T] { /// Construct a hashmap from a vector fn hash_from_vec( - items: &[(K, V)]) -> hashmap { - let map = hashmap(); + items: &[(K, V)]) -> HashMap { + let map = HashMap(); do vec::iter(items) |item| { let (key, value) = item; map.insert(key, value); @@ -443,28 +443,28 @@ fn hash_from_vec( } /// Construct a hashmap from a vector with string keys -fn hash_from_strs(items: &[(~str, V)]) -> hashmap<~str, V> { +fn hash_from_strs(items: &[(~str, V)]) -> HashMap<~str, V> { hash_from_vec(items) } /// Construct a hashmap from a vector with byte keys -fn hash_from_bytes(items: &[(~[u8], V)]) -> hashmap<~[u8], V> { +fn hash_from_bytes(items: &[(~[u8], V)]) -> HashMap<~[u8], V> { hash_from_vec(items) } /// Construct a hashmap from a vector with int keys -fn hash_from_ints(items: &[(int, V)]) -> hashmap { +fn hash_from_ints(items: &[(int, V)]) -> HashMap { hash_from_vec(items) } /// Construct a hashmap from a vector with uint keys -fn hash_from_uints(items: &[(uint, V)]) -> hashmap { +fn hash_from_uints(items: &[(uint, V)]) -> HashMap { hash_from_vec(items) } // XXX Transitional impl @Mut>: - map { + Map { pure fn size() -> uint { unchecked { do self.borrow_const |p| { @@ -575,8 +575,8 @@ mod tests { pure fn eq_uint(x: &uint, y: &uint) -> bool { *x == *y } pure fn uint_id(x: &uint) -> uint { *x } debug!("uint -> uint"); - let hm_uu: map::hashmap = - map::hashmap::(); + let hm_uu: map::HashMap = + map::HashMap::(); assert (hm_uu.insert(10u, 12u)); assert (hm_uu.insert(11u, 13u)); assert (hm_uu.insert(12u, 14u)); @@ -591,8 +591,8 @@ mod tests { let eleven: ~str = ~"eleven"; let twelve: ~str = ~"twelve"; debug!("str -> uint"); - let hm_su: map::hashmap<~str, uint> = - map::hashmap::<~str, uint>(); + let hm_su: map::HashMap<~str, uint> = + map::HashMap::<~str, uint>(); assert (hm_su.insert(~"ten", 12u)); assert (hm_su.insert(eleven, 13u)); assert (hm_su.insert(~"twelve", 14u)); @@ -605,8 +605,8 @@ mod tests { assert (!hm_su.insert(~"twelve", 12u)); assert (hm_su.get(~"twelve") == 12u); debug!("uint -> str"); - let hm_us: map::hashmap = - map::hashmap::(); + let hm_us: map::HashMap = + map::HashMap::(); assert (hm_us.insert(10u, ~"twelve")); assert (hm_us.insert(11u, ~"thirteen")); assert (hm_us.insert(12u, ~"fourteen")); @@ -618,8 +618,8 @@ mod tests { assert (!hm_us.insert(12u, ~"twelve")); assert hm_us.get(12u) == ~"twelve"; debug!("str -> str"); - let hm_ss: map::hashmap<~str, ~str> = - map::hashmap::<~str, ~str>(); + let hm_ss: map::HashMap<~str, ~str> = + map::HashMap::<~str, ~str>(); assert (hm_ss.insert(ten, ~"twelve")); assert (hm_ss.insert(eleven, ~"thirteen")); assert (hm_ss.insert(twelve, ~"fourteen")); @@ -644,8 +644,8 @@ mod tests { pure fn eq_uint(x: &uint, y: &uint) -> bool { *x == *y } pure fn uint_id(x: &uint) -> uint { *x } debug!("uint -> uint"); - let hm_uu: map::hashmap = - map::hashmap::(); + let hm_uu: map::HashMap = + map::HashMap::(); let mut i: uint = 0u; while i < num_to_insert { assert (hm_uu.insert(i, i * i)); @@ -669,8 +669,8 @@ mod tests { i += 1u; } debug!("str -> str"); - let hm_ss: map::hashmap<~str, ~str> = - map::hashmap::<~str, ~str>(); + let hm_ss: map::HashMap<~str, ~str> = + map::HashMap::<~str, ~str>(); i = 0u; while i < num_to_insert { assert hm_ss.insert(uint::to_str(i, 2u), uint::to_str(i * i, 2u)); @@ -717,8 +717,8 @@ mod tests { assert (hash(&0u) == hash(&1u)); assert (hash(&2u) == hash(&3u)); assert (hash(&0u) != hash(&2u)); - let hm: map::hashmap = - map::hashmap::(); + let hm: map::HashMap = + map::HashMap::(); let mut i: uint = 0u; while i < num_to_insert { assert (hm.insert(i, i * i)); @@ -778,7 +778,7 @@ mod tests { #[test] fn test_contains_key() { let key = ~"k"; - let map = map::hashmap::<~str, ~str>(); + let map = map::HashMap::<~str, ~str>(); assert (!map.contains_key(key)); map.insert(key, ~"val"); assert (map.contains_key(key)); @@ -787,7 +787,7 @@ mod tests { #[test] fn test_find() { let key = ~"k"; - let map = map::hashmap::<~str, ~str>(); + let map = map::HashMap::<~str, ~str>(); assert (option::is_none(map.find(key))); map.insert(key, ~"val"); assert (option::get(map.find(key)) == ~"val"); @@ -796,7 +796,7 @@ mod tests { #[test] fn test_clear() { let key = ~"k"; - let map = map::hashmap::<~str, ~str>(); + let map = map::HashMap::<~str, ~str>(); map.insert(key, ~"val"); assert (map.size() == 1); assert (map.contains_key(key)); diff --git a/src/libstd/net_url.rs b/src/libstd/net_url.rs index cef29bbef2a..a83cb8637b5 100644 --- a/src/libstd/net_url.rs +++ b/src/libstd/net_url.rs @@ -3,7 +3,7 @@ #[forbid(deprecated_pattern)]; use core::cmp::Eq; -use map::{hashmap, str_hash}; +use map::{HashMap, str_hash}; use io::{Reader, ReaderUtil}; use dvec::DVec; use from_str::FromStr; @@ -184,7 +184,7 @@ fn encode_plus(s: &str) -> ~str { /** * Encode a hashmap to the 'application/x-www-form-urlencoded' media type. */ -fn encode_form_urlencoded(m: hashmap<~str, @DVec<@~str>>) -> ~str { +fn encode_form_urlencoded(m: HashMap<~str, @DVec<@~str>>) -> ~str { let mut out = ~""; let mut first = true; @@ -211,7 +211,7 @@ fn encode_form_urlencoded(m: hashmap<~str, @DVec<@~str>>) -> ~str { * type into a hashmap. */ fn decode_form_urlencoded(s: ~[u8]) -> - map::hashmap<~str, @dvec::DVec<@~str>> { + map::HashMap<~str, @dvec::DVec<@~str>> { do io::with_bytes_reader(s) |rdr| { let m = str_hash(); let mut key = ~""; diff --git a/src/libstd/smallintmap.rs b/src/libstd/smallintmap.rs index a65d41a2d32..87b238ed596 100644 --- a/src/libstd/smallintmap.rs +++ b/src/libstd/smallintmap.rs @@ -8,7 +8,7 @@ use core::option; use core::option::{Some, None}; use dvec::DVec; -use map::map; +use map::Map; // FIXME (#2347): Should not be @; there's a bug somewhere in rustc that // requires this to be. @@ -66,7 +66,7 @@ fn contains_key(self: SmallIntMap, key: uint) -> bool { } /// Implements the map::map interface for smallintmap -impl SmallIntMap: map::map { +impl SmallIntMap: map::Map { pure fn size() -> uint { let mut sz = 0u; for self.v.each |item| { @@ -146,6 +146,6 @@ impl SmallIntMap: ops::Index { } /// Cast the given smallintmap to a map::map -fn as_map(s: SmallIntMap) -> map::map { - s as map::map:: +fn as_map(s: SmallIntMap) -> map::Map { + s as map::Map:: } diff --git a/src/libstd/std.rc b/src/libstd/std.rc index 6243eb84e07..5381c1564a5 100644 --- a/src/libstd/std.rc +++ b/src/libstd/std.rc @@ -61,7 +61,6 @@ mod bitv; mod deque; mod fun_treemap; mod list; -#[allow(non_camel_case_types)] // XXX mod map; mod rope; mod smallintmap; diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs index e0285694460..d9a7543eed4 100644 --- a/src/libsyntax/ast_map.rs +++ b/src/libsyntax/ast_map.rs @@ -1,5 +1,5 @@ use std::map; -use std::map::hashmap; +use std::map::HashMap; use ast::*; use print::pprust; use ast_util::{path_to_ident, stmt_id}; @@ -79,7 +79,7 @@ enum ast_node { node_block(blk), } -type map = std::map::hashmap; +type map = std::map::HashMap; type ctx = {map: map, mut path: path, mut local_id: uint, diag: span_handler}; type vt = visit::vt; diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 474f0ede109..34ddee55a63 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -259,8 +259,8 @@ impl def_id : core::to_bytes::IterBytes { } } -fn new_def_hash() -> std::map::hashmap { - return std::map::hashmap::(); +fn new_def_hash() -> std::map::HashMap { + return std::map::HashMap::(); } fn block_from_expr(e: @expr) -> blk { diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index a12233765ca..67a7b6d3101 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -1,7 +1,7 @@ // Functions dealing with attributes and meta_items use std::map; -use std::map::hashmap; +use std::map::HashMap; use either::Either; use diagnostic::span_handler; use ast_util::{spanned, dummy_spanned}; diff --git a/src/libsyntax/ext/auto_serialize.rs b/src/libsyntax/ext/auto_serialize.rs index cd26dc58e73..1dc8cee6ac9 100644 --- a/src/libsyntax/ext/auto_serialize.rs +++ b/src/libsyntax/ext/auto_serialize.rs @@ -72,7 +72,7 @@ node twice. use base::*; use codemap::span; use std::map; -use std::map::hashmap; +use std::map::HashMap; export expand; @@ -84,8 +84,8 @@ mod syntax { export parse; } -type ser_tps_map = map::hashmap ~[@ast::stmt]>; -type deser_tps_map = map::hashmap @ast::expr>; +type ser_tps_map = map::HashMap ~[@ast::stmt]>; +type deser_tps_map = map::HashMap @ast::expr>; fn expand(cx: ext_ctxt, span: span, diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index d4d5d2b3b22..e1114ce8e2a 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -1,4 +1,4 @@ -use std::map::hashmap; +use std::map::HashMap; use parse::parser; use diagnostic::span_handler; use codemap::{codemap, span, expn_info, expanded_from}; @@ -65,7 +65,7 @@ enum syntax_extension { // A temporary hard-coded map of methods for expanding syntax extension // AST nodes into full ASTs -fn syntax_expander_table() -> hashmap<~str, syntax_extension> { +fn syntax_expander_table() -> HashMap<~str, syntax_extension> { fn builtin(f: syntax_expander_) -> syntax_extension {normal({expander: f, span: None})} fn builtin_expr_tt(f: syntax_expander_tt_) -> syntax_extension { diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 4558d0a1872..ffe86c94a24 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -1,4 +1,4 @@ -use std::map::hashmap; +use std::map::HashMap; use ast::{crate, expr_, expr_mac, mac_invoc, mac_invoc_tt, tt_delim, tt_tok, item_mac}; @@ -10,7 +10,7 @@ use parse::{parser, parse_expr_from_source_str, new_parser_from_tt}; use codemap::{span, expanded_from}; -fn expand_expr(exts: hashmap<~str, syntax_extension>, cx: ext_ctxt, +fn expand_expr(exts: HashMap<~str, syntax_extension>, cx: ext_ctxt, e: expr_, s: span, fld: ast_fold, orig: fn@(expr_, span, ast_fold) -> (expr_, span)) -> (expr_, span) @@ -132,7 +132,7 @@ fn expand_expr(exts: hashmap<~str, syntax_extension>, cx: ext_ctxt, // // NB: there is some redundancy between this and expand_item, below, and // they might benefit from some amount of semantic and language-UI merger. -fn expand_mod_items(exts: hashmap<~str, syntax_extension>, cx: ext_ctxt, +fn expand_mod_items(exts: HashMap<~str, syntax_extension>, cx: ext_ctxt, module_: ast::_mod, fld: ast_fold, orig: fn@(ast::_mod, ast_fold) -> ast::_mod) -> ast::_mod @@ -165,7 +165,7 @@ fn expand_mod_items(exts: hashmap<~str, syntax_extension>, cx: ext_ctxt, // When we enter a module, record it, for the sake of `module!` -fn expand_item(exts: hashmap<~str, syntax_extension>, +fn expand_item(exts: HashMap<~str, syntax_extension>, cx: ext_ctxt, &&it: @ast::item, fld: ast_fold, orig: fn@(&&@ast::item, ast_fold) -> Option<@ast::item>) -> Option<@ast::item> @@ -193,7 +193,7 @@ fn expand_item(exts: hashmap<~str, syntax_extension>, // Support for item-position macro invocations, exactly the same // logic as for expression-position macro invocations. -fn expand_item_mac(exts: hashmap<~str, syntax_extension>, +fn expand_item_mac(exts: HashMap<~str, syntax_extension>, cx: ext_ctxt, &&it: @ast::item, fld: ast_fold) -> Option<@ast::item> { match it.node { diff --git a/src/libsyntax/ext/simplext.rs b/src/libsyntax/ext/simplext.rs index c6ddc449b20..56fbb3bb074 100644 --- a/src/libsyntax/ext/simplext.rs +++ b/src/libsyntax/ext/simplext.rs @@ -1,5 +1,5 @@ use codemap::span; -use std::map::{hashmap, str_hash, uint_hash}; +use std::map::{HashMap, str_hash, uint_hash}; use dvec::DVec; use base::*; @@ -123,9 +123,9 @@ fn compose_sels(s1: selector, s2: selector) -> selector { type binders = - {real_binders: hashmap, + {real_binders: HashMap, literal_ast_matchers: DVec}; -type bindings = hashmap>; +type bindings = HashMap>; fn acumm_bindings(_cx: ext_ctxt, _b_dest: bindings, _b_src: bindings) { } @@ -237,9 +237,9 @@ fn follow_for_trans(cx: ext_ctxt, mmaybe: Option>, /* helper for transcribe_exprs: what vars from `b` occur in `e`? */ fn free_vars(b: bindings, e: @expr, it: fn(ident)) { - let idents: hashmap = uint_hash::<()>(); + let idents: HashMap = uint_hash::<()>(); fn mark_ident(&&i: ident, _fld: ast_fold, b: bindings, - idents: hashmap) -> ident { + idents: HashMap) -> ident { if b.contains_key(i) { idents.insert(i, ()); } return i; } diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 22f588f98c5..f32c23c936f 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -10,7 +10,7 @@ use parse::parse_sess; use dvec::DVec; use ast::{matcher, match_tok, match_seq, match_nonterminal, ident}; use ast_util::mk_sp; -use std::map::{hashmap, uint_hash}; +use std::map::{HashMap, uint_hash}; /* This is an Earley-like parser, without support for in-grammar nonterminals, only by calling out to the main rust parser for named nonterminals (which it @@ -168,9 +168,9 @@ enum named_match { type earley_item = matcher_pos; fn nameize(p_s: parse_sess, ms: ~[matcher], res: ~[@named_match]) - -> hashmap { + -> HashMap { fn n_rec(p_s: parse_sess, m: matcher, res: ~[@named_match], - ret_val: hashmap) { + ret_val: HashMap) { match m { {node: match_tok(_), span: _} => (), {node: match_seq(more_ms, _, _, _, _), span: _} => { @@ -191,13 +191,13 @@ fn nameize(p_s: parse_sess, ms: ~[matcher], res: ~[@named_match]) } enum parse_result { - success(hashmap), + success(HashMap), failure(codemap::span, ~str), error(codemap::span, ~str) } fn parse_or_else(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader, - ms: ~[matcher]) -> hashmap { + ms: ~[matcher]) -> HashMap { match parse(sess, cfg, rdr, ms) { success(m) => m, failure(sp, str) => sess.span_diagnostic.span_fatal(sp, str), diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index 30b5d479f05..ebb62293cc5 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -7,7 +7,7 @@ use parse::token::{FAT_ARROW, SEMI, LBRACE, RBRACE, nt_matchers, nt_tt}; use parse::parser::{parser, SOURCE_FILE}; use macro_parser::{parse, parse_or_else, success, failure, named_match, matched_seq, matched_nonterminal, error}; -use std::map::hashmap; +use std::map::HashMap; use parse::token::special_idents; fn add_new_extension(cx: ext_ctxt, sp: span, name: ident, diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs index 01e2328c85a..f7c7475bfc9 100644 --- a/src/libsyntax/ext/tt/transcribe.rs +++ b/src/libsyntax/ext/tt/transcribe.rs @@ -4,7 +4,7 @@ use macro_parser::{named_match, matched_seq, matched_nonterminal}; use codemap::span; use parse::token::{EOF, INTERPOLATED, IDENT, token, nt_ident, ident_interner}; -use std::map::{hashmap, box_str_hash}; +use std::map::{HashMap, box_str_hash}; export tt_reader, new_tt_reader, dup_tt_reader, tt_next_token; @@ -28,7 +28,7 @@ type tt_reader = @{ interner: ident_interner, mut cur: tt_frame, /* for MBE-style macro transcription */ - interpolations: std::map::hashmap, + interpolations: std::map::HashMap, mut repeat_idx: ~[mut uint], mut repeat_len: ~[uint], /* cached: */ @@ -40,7 +40,7 @@ type tt_reader = @{ * `src` contains no `tt_seq`s and `tt_nonterminal`s, `interp` can (and * should) be none. */ fn new_tt_reader(sp_diag: span_handler, itr: ident_interner, - interp: Option>, + interp: Option>, src: ~[ast::token_tree]) -> tt_reader { let r = @{sp_diag: sp_diag, interner: itr, diff --git a/src/libsyntax/parse/common.rs b/src/libsyntax/parse/common.rs index c2ed8a7d9d6..d71d95fd63f 100644 --- a/src/libsyntax/parse/common.rs +++ b/src/libsyntax/parse/common.rs @@ -1,4 +1,4 @@ -use std::map::{hashmap}; +use std::map::{HashMap}; use ast_util::spanned; use parser::parser; use lexer::reader; diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 512a5e6459e..e597d33a836 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2,7 +2,7 @@ use print::pprust::expr_to_str; use result::Result; use either::{Either, Left, Right}; -use std::map::{hashmap, str_hash}; +use std::map::{HashMap, str_hash}; use token::{can_begin_expr, is_ident, is_ident_or_path, is_plain_ident, INTERPOLATED}; use codemap::{span,fss_none}; @@ -216,7 +216,7 @@ fn parser(sess: parse_sess, cfg: ast::crate_cfg, keywords: token::keyword_table(), restricted_keywords: token::restricted_keyword_table(), strict_keywords: token::strict_keyword_table(), - obsolete_set: std::map::hashmap(), + obsolete_set: std::map::HashMap(), } } @@ -234,12 +234,12 @@ struct parser { mut quote_depth: uint, // not (yet) related to the quasiquoter reader: reader, interner: interner<@~str>, - keywords: hashmap<~str, ()>, - restricted_keywords: hashmap<~str, ()>, - strict_keywords: hashmap<~str, ()>, + keywords: HashMap<~str, ()>, + restricted_keywords: HashMap<~str, ()>, + strict_keywords: HashMap<~str, ()>, /// The set of seen errors about obsolete syntax. Used to suppress /// extra detail when the same error is seen twice - obsolete_set: hashmap, + obsolete_set: HashMap, drop {} /* do not copy the parser; its state is tied to outside state */ } diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 6e82e6d11b8..a96b2be6c09 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -1,6 +1,6 @@ use util::interner; use util::interner::interner; -use std::map::{hashmap, str_hash}; +use std::map::{HashMap, str_hash}; use std::serialization::{serializer, deserializer, serialize_uint, @@ -368,7 +368,7 @@ fn mk_fake_ident_interner() -> ident_interner { * that might otherwise contain _value identifiers_. Strict keywords may not * appear as identifiers. */ -fn keyword_table() -> hashmap<~str, ()> { +fn keyword_table() -> HashMap<~str, ()> { let keywords = str_hash(); for contextual_keyword_table().each_key |word| { keywords.insert(word, ()); @@ -383,7 +383,7 @@ fn keyword_table() -> hashmap<~str, ()> { } /// Keywords that may be used as identifiers -fn contextual_keyword_table() -> hashmap<~str, ()> { +fn contextual_keyword_table() -> HashMap<~str, ()> { let words = str_hash(); let keys = ~[ ~"self", ~"static", @@ -408,7 +408,7 @@ fn contextual_keyword_table() -> hashmap<~str, ()> { * * `true` or `false` as identifiers would always be shadowed by * the boolean constants */ -fn restricted_keyword_table() -> hashmap<~str, ()> { +fn restricted_keyword_table() -> HashMap<~str, ()> { let words = str_hash(); let keys = ~[ ~"const", ~"copy", @@ -426,7 +426,7 @@ fn restricted_keyword_table() -> hashmap<~str, ()> { } /// Full keywords. May not appear anywhere else. -fn strict_keyword_table() -> hashmap<~str, ()> { +fn strict_keyword_table() -> HashMap<~str, ()> { let words = str_hash(); let keys = ~[ ~"as", ~"assert", diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index ac2af21d087..7e42919f724 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -2,18 +2,18 @@ // allows bidirectional lookup; i.e. given a value, one can easily find the // type, and vice versa. use std::map; -use std::map::hashmap; +use std::map::HashMap; use dvec::DVec; use cmp::Eq; use hash::Hash; use to_bytes::IterBytes; type hash_interner = - {map: hashmap, + {map: HashMap, vect: DVec}; fn mk() -> interner { - let m = map::hashmap::(); + let m = map::HashMap::(); let hi: hash_interner = {map: m, vect: DVec()}; return hi as interner::; diff --git a/src/rustc/back/link.rs b/src/rustc/back/link.rs index 5708cf2f785..18c63c1934b 100644 --- a/src/rustc/back/link.rs +++ b/src/rustc/back/link.rs @@ -7,7 +7,7 @@ use middle::ty; use metadata::{encoder, cstore}; use middle::trans::common::crate_ctxt; use metadata::common::link_meta; -use std::map::hashmap; +use std::map::HashMap; use std::sha1::sha1; use syntax::ast; use syntax::print::pprust; diff --git a/src/rustc/back/rpath.rs b/src/rustc/back/rpath.rs index b77a667f7d3..df3e9e88185 100644 --- a/src/rustc/back/rpath.rs +++ b/src/rustc/back/rpath.rs @@ -1,5 +1,5 @@ use std::map; -use std::map::hashmap; +use std::map::HashMap; use metadata::cstore; use driver::session; use metadata::filesearch; diff --git a/src/rustc/driver/driver.rs b/src/rustc/driver/driver.rs index 04c71bdbe72..a82fc7ac69a 100644 --- a/src/rustc/driver/driver.rs +++ b/src/rustc/driver/driver.rs @@ -13,7 +13,7 @@ use std::getopts; use io::WriterUtil; use getopts::{optopt, optmulti, optflag, optflagopt, opt_present}; use back::{x86, x86_64}; -use std::map::hashmap; +use std::map::HashMap; use lib::llvm::llvm; enum pp_mode {ppm_normal, ppm_expanded, ppm_typed, ppm_identified, diff --git a/src/rustc/driver/rustc.rs b/src/rustc/driver/rustc.rs index 148a735221e..c4714ecf9e5 100644 --- a/src/rustc/driver/rustc.rs +++ b/src/rustc/driver/rustc.rs @@ -11,7 +11,7 @@ use core::*; // -*- rust -*- use result::{Ok, Err}; use std::getopts; -use std::map::hashmap; +use std::map::HashMap; use getopts::{opt_present}; use rustc::driver::driver::*; use syntax::codemap; diff --git a/src/rustc/lib/llvm.rs b/src/rustc/lib/llvm.rs index 4e529239401..64258fcd43a 100644 --- a/src/rustc/lib/llvm.rs +++ b/src/rustc/lib/llvm.rs @@ -1,4 +1,4 @@ -use std::map::hashmap; +use std::map::HashMap; use libc::{c_char, c_int, c_uint, c_longlong, c_ulonglong}; @@ -1038,8 +1038,8 @@ fn SetLinkage(Global: ValueRef, Link: Linkage) { /* Memory-managed object interface to type handles. */ -type type_names = @{type_names: std::map::hashmap, - named_types: std::map::hashmap<~str, TypeRef>}; +type type_names = @{type_names: std::map::HashMap, + named_types: std::map::HashMap<~str, TypeRef>}; fn associate_type(tn: type_names, s: ~str, t: TypeRef) { assert tn.type_names.insert(t, s); @@ -1057,7 +1057,7 @@ fn name_has_type(tn: type_names, s: ~str) -> Option { fn mk_type_names() -> type_names { pure fn hash(t: &TypeRef) -> uint { *t as uint } pure fn eq(a: &TypeRef, b: &TypeRef) -> bool { *a == *b } - @{type_names: std::map::hashmap(), + @{type_names: std::map::HashMap(), named_types: std::map::str_hash()} } diff --git a/src/rustc/metadata/creader.rs b/src/rustc/metadata/creader.rs index 444662ae0e2..ab7ee46dc64 100644 --- a/src/rustc/metadata/creader.rs +++ b/src/rustc/metadata/creader.rs @@ -5,7 +5,7 @@ use syntax::{ast, ast_util}; use syntax::attr; use syntax::visit; use syntax::codemap::span; -use std::map::{hashmap, int_hash}; +use std::map::{HashMap, int_hash}; use syntax::print::pprust; use filesearch::filesearch; use common::*; diff --git a/src/rustc/metadata/csearch.rs b/src/rustc/metadata/csearch.rs index 69fc8b81b23..e29a4fd436b 100644 --- a/src/rustc/metadata/csearch.rs +++ b/src/rustc/metadata/csearch.rs @@ -10,7 +10,7 @@ use syntax::diagnostic::span_handler; use syntax::diagnostic::expect; use ast_util::dummy_sp; use common::*; -use std::map::hashmap; +use std::map::HashMap; use dvec::DVec; export class_dtor; diff --git a/src/rustc/metadata/cstore.rs b/src/rustc/metadata/cstore.rs index ce20569116d..be974cb75b5 100644 --- a/src/rustc/metadata/cstore.rs +++ b/src/rustc/metadata/cstore.rs @@ -2,7 +2,7 @@ // crates and libraries use std::map; -use std::map::hashmap; +use std::map::HashMap; use syntax::{ast, attr}; use syntax::ast_util::new_def_hash; use syntax::parse::token::ident_interner; @@ -33,12 +33,12 @@ export get_path; // local crate numbers (as generated during this session). Each external // crate may refer to types in other external crates, and each has their // own crate numbers. -type cnum_map = map::hashmap; +type cnum_map = map::HashMap; // Multiple items may have the same def_id in crate metadata. They may be // renamed imports or reexports. This map keeps the "real" module path // and def_id. -type mod_path_map = map::hashmap; +type mod_path_map = map::HashMap; type crate_metadata = @{name: ~str, data: @~[u8], @@ -53,7 +53,7 @@ type crate_metadata = @{name: ~str, enum cstore { private(cstore_private), } type cstore_private = - @{metas: map::hashmap, + @{metas: map::HashMap, use_crate_map: use_crate_map, mod_path_map: mod_path_map, mut used_crate_files: ~[Path], @@ -62,7 +62,7 @@ type cstore_private = intr: ident_interner}; // Map from node_id's of local use statements to crate numbers -type use_crate_map = map::hashmap; +type use_crate_map = map::HashMap; // Internal method to retrieve the data from the cstore pure fn p(cstore: cstore) -> cstore_private { diff --git a/src/rustc/metadata/decoder.rs b/src/rustc/metadata/decoder.rs index fc158feffad..3f21caafb66 100644 --- a/src/rustc/metadata/decoder.rs +++ b/src/rustc/metadata/decoder.rs @@ -1,7 +1,7 @@ // Decoding metadata from a single crate's metadata use std::{ebml, map}; -use std::map::{hashmap, str_hash}; +use std::map::{HashMap, str_hash}; use io::WriterUtil; use dvec::DVec; use syntax::{ast, ast_util}; diff --git a/src/rustc/metadata/encoder.rs b/src/rustc/metadata/encoder.rs index 560dc384299..313723fc158 100644 --- a/src/rustc/metadata/encoder.rs +++ b/src/rustc/metadata/encoder.rs @@ -3,7 +3,7 @@ use util::ppaux::ty_to_str; use std::{ebml, map}; -use std::map::hashmap; +use std::map::HashMap; use io::WriterUtil; use ebml::Writer; use syntax::ast::*; @@ -35,7 +35,7 @@ export encode_ctxt; export write_type; export encode_def_id; -type abbrev_map = map::hashmap; +type abbrev_map = map::HashMap; type encode_inlined_item = fn@(ecx: @encode_ctxt, ebml_w: ebml::Writer, @@ -45,11 +45,11 @@ type encode_inlined_item = fn@(ecx: @encode_ctxt, type encode_parms = { diag: span_handler, tcx: ty::ctxt, - reachable: hashmap, + reachable: HashMap, reexports: ~[(~str, def_id)], reexports2: middle::resolve::ExportMap2, - item_symbols: hashmap, - discrim_symbols: hashmap, + item_symbols: HashMap, + discrim_symbols: HashMap, link_meta: link_meta, cstore: cstore::cstore, encode_inlined_item: encode_inlined_item @@ -72,11 +72,11 @@ enum encode_ctxt = { tcx: ty::ctxt, buf: io::MemBuffer, stats: stats, - reachable: hashmap, + reachable: HashMap, reexports: ~[(~str, def_id)], reexports2: middle::resolve::ExportMap2, - item_symbols: hashmap, - discrim_symbols: hashmap, + item_symbols: HashMap, + discrim_symbols: HashMap, link_meta: link_meta, cstore: cstore::cstore, encode_inlined_item: encode_inlined_item, diff --git a/src/rustc/metadata/tydecode.rs b/src/rustc/metadata/tydecode.rs index 8fe58a93824..0c94213c08c 100644 --- a/src/rustc/metadata/tydecode.rs +++ b/src/rustc/metadata/tydecode.rs @@ -8,7 +8,7 @@ use syntax::ast::*; use syntax::ast_util; use syntax::ast_util::respan; use middle::ty; -use std::map::hashmap; +use std::map::HashMap; use ty::{FnTyBase, FnMeta, FnSig}; export parse_ty_data, parse_def_id, parse_ident; diff --git a/src/rustc/metadata/tyencode.rs b/src/rustc/metadata/tyencode.rs index 622ba1a5cce..3d256367023 100644 --- a/src/rustc/metadata/tyencode.rs +++ b/src/rustc/metadata/tyencode.rs @@ -1,7 +1,7 @@ // Type encoding use io::WriterUtil; -use std::map::hashmap; +use std::map::HashMap; use syntax::ast::*; use syntax::diagnostic::span_handler; use middle::ty; @@ -31,7 +31,7 @@ type ctxt = { // Whatever format you choose should not contain pipe characters. type ty_abbrev = {pos: uint, len: uint, s: @~str}; -enum abbrev_ctxt { ac_no_abbrevs, ac_use_abbrevs(hashmap), } +enum abbrev_ctxt { ac_no_abbrevs, ac_use_abbrevs(HashMap), } fn cx_uses_abbrevs(cx: @ctxt) -> bool { match cx.abbrevs { diff --git a/src/rustc/middle/astencode.rs b/src/rustc/middle/astencode.rs index bf29efaaa64..d4891dc677e 100644 --- a/src/rustc/middle/astencode.rs +++ b/src/rustc/middle/astencode.rs @@ -10,7 +10,7 @@ use syntax::codemap::span; use std::ebml; use std::ebml::Writer; use std::ebml::get_doc; -use std::map::hashmap; +use std::map::HashMap; use std::serialization::serializer; use std::serialization::deserializer; use std::serialization::serializer_helpers; diff --git a/src/rustc/middle/borrowck.rs b/src/rustc/middle/borrowck.rs index 1286a95aa02..99e3005fd0c 100644 --- a/src/rustc/middle/borrowck.rs +++ b/src/rustc/middle/borrowck.rs @@ -222,7 +222,7 @@ use syntax::ast_map; use syntax::codemap::span; use util::ppaux::{ty_to_str, region_to_str, explain_region, note_and_explain_region}; -use std::map::{int_hash, hashmap, set}; +use std::map::{int_hash, HashMap, Set}; use std::list; use std::list::{List, Cons, Nil}; use result::{Result, Ok, Err}; @@ -300,7 +300,7 @@ enum borrowck_ctxt { // a map mapping id's of expressions of gc'd type (@T, @[], etc) where // the box needs to be kept live to the id of the scope for which they // must stay live. -type root_map = hashmap; +type root_map = HashMap; // the keys to the root map combine the `id` of the expression with // the number of types that it is autodereferenced. So, for example, @@ -311,7 +311,7 @@ type root_map_key = {id: ast::node_id, derefs: uint}; // set of ids of local vars / formal arguments that are modified / moved. // this is used in trans for optimization purposes. -type mutbl_map = std::map::hashmap; +type mutbl_map = std::map::HashMap; // Errors that can occur"] enum bckerr_code { @@ -392,8 +392,8 @@ type loan = {lp: @loan_path, cmt: cmt, mutbl: ast::mutability}; /// - `pure_map`: map from block/expr that must be pure to the error message /// that should be reported if they are not pure type req_maps = { - req_loan_map: hashmap>>, - pure_map: hashmap + req_loan_map: HashMap>>, + pure_map: HashMap }; fn save_and_restore(&save_and_restore_t: T, f: fn() -> U) -> U { @@ -421,7 +421,7 @@ impl root_map_key : to_bytes::IterBytes { } fn root_map() -> root_map { - return hashmap(); + return HashMap(); pure fn root_map_key_eq(k1: &root_map_key, k2: &root_map_key) -> bool { k1.id == k2.id && k1.derefs == k2.derefs diff --git a/src/rustc/middle/borrowck/check_loans.rs b/src/rustc/middle/borrowck/check_loans.rs index 2d4f988c007..974c9b632ca 100644 --- a/src/rustc/middle/borrowck/check_loans.rs +++ b/src/rustc/middle/borrowck/check_loans.rs @@ -15,7 +15,7 @@ enum check_loan_ctxt = @{ bccx: borrowck_ctxt, req_maps: req_maps, - reported: hashmap, + reported: HashMap, // Keep track of whether we're inside a ctor, so as to // allow mutating immutable fields in the same class if diff --git a/src/rustc/middle/capture.rs b/src/rustc/middle/capture.rs index 3a0f67c66b8..28b86f66528 100644 --- a/src/rustc/middle/capture.rs +++ b/src/rustc/middle/capture.rs @@ -2,7 +2,7 @@ use syntax::{ast, ast_util}; use driver::session::session; use syntax::codemap::span; use std::map; -use std::map::hashmap; +use std::map::HashMap; export capture_mode; export capture_var; @@ -28,7 +28,7 @@ type capture_var = { mode: capture_mode // How variable is being accessed }; -type capture_map = map::hashmap; +type capture_map = map::HashMap; // checks the capture clause for a fn_expr() and issues warnings or // errors for any irregularities which we identify. diff --git a/src/rustc/middle/check_alt.rs b/src/rustc/middle/check_alt.rs index b4a5db2baa4..1033f2c81c5 100644 --- a/src/rustc/middle/check_alt.rs +++ b/src/rustc/middle/check_alt.rs @@ -10,7 +10,7 @@ use syntax::visit; use driver::session::session; use middle::ty; use middle::ty::*; -use std::map::hashmap; +use std::map::HashMap; fn check_crate(tcx: ty::ctxt, crate: @crate) { visit::visit_crate(*crate, (), visit::mk_vt(@{ diff --git a/src/rustc/middle/check_const.rs b/src/rustc/middle/check_const.rs index c01eab9574b..d7cbd2969a3 100644 --- a/src/rustc/middle/check_const.rs +++ b/src/rustc/middle/check_const.rs @@ -1,7 +1,7 @@ use syntax::ast::*; use syntax::{visit, ast_util, ast_map}; use driver::session::session; -use std::map::hashmap; +use std::map::HashMap; use dvec::DVec; fn check_crate(sess: session, crate: @crate, ast_map: ast_map::map, diff --git a/src/rustc/middle/freevars.rs b/src/rustc/middle/freevars.rs index 549a1124264..f59be3e02ec 100644 --- a/src/rustc/middle/freevars.rs +++ b/src/rustc/middle/freevars.rs @@ -23,7 +23,7 @@ type freevar_entry = { span: span //< First span where it is accessed (there can be multiple) }; type freevar_info = @~[@freevar_entry]; -type freevar_map = hashmap; +type freevar_map = HashMap; // Searches through part of the AST for all references to locals or // upvars in this frame and returns the list of definition IDs thus found. diff --git a/src/rustc/middle/kind.rs b/src/rustc/middle/kind.rs index 6251b321b8e..4c363a5faf8 100644 --- a/src/rustc/middle/kind.rs +++ b/src/rustc/middle/kind.rs @@ -3,7 +3,7 @@ use syntax::ast::*; use syntax::codemap::span; use ty::{kind, kind_copyable, kind_noncopyable, kind_const}; use driver::session::session; -use std::map::hashmap; +use std::map::HashMap; use util::ppaux::{ty_to_str, tys_to_str}; use syntax::print::pprust::expr_to_str; use freevars::freevar_entry; @@ -58,7 +58,7 @@ fn kind_to_str(k: kind) -> ~str { str::connect(kinds, ~" ") } -type rval_map = std::map::hashmap; +type rval_map = std::map::HashMap; type ctx = {tcx: ty::ctxt, method_map: typeck::method_map, diff --git a/src/rustc/middle/lang_items.rs b/src/rustc/middle/lang_items.rs index fa47f7a2169..b63a29d770e 100644 --- a/src/rustc/middle/lang_items.rs +++ b/src/rustc/middle/lang_items.rs @@ -19,7 +19,7 @@ use syntax::ast_util::{local_def}; use syntax::visit::{default_simple_visitor, mk_simple_visitor}; use syntax::visit::{visit_crate, visit_item}; -use std::map::{hashmap, str_hash}; +use std::map::{HashMap, str_hash}; use str_eq = str::eq; struct LanguageItems { @@ -119,7 +119,7 @@ struct LanguageItemCollector { crate: @crate, session: session, - item_refs: hashmap<~str,&mut Option>, + item_refs: HashMap<~str,&mut Option>, } impl LanguageItemCollector { diff --git a/src/rustc/middle/lint.rs b/src/rustc/middle/lint.rs index 51210870b41..b41fb004653 100644 --- a/src/rustc/middle/lint.rs +++ b/src/rustc/middle/lint.rs @@ -4,8 +4,8 @@ use middle::ty; use syntax::{ast, ast_util, visit}; use syntax::attr; use syntax::codemap::span; -use std::map::{map,hashmap,int_hash,hash_from_strs}; -use std::smallintmap::{map,SmallIntMap}; +use std::map::{Map,HashMap,int_hash,hash_from_strs}; +use std::smallintmap::{Map,SmallIntMap}; use io::WriterUtil; use util::ppaux::{ty_to_str}; use middle::pat_util::{pat_bindings}; @@ -95,7 +95,7 @@ type lint_spec = @{lint: lint, desc: ~str, default: level}; -type lint_dict = hashmap<~str,lint_spec>; +type lint_dict = HashMap<~str,lint_spec>; /* Pass names should not contain a '-', as the compiler normalizes @@ -196,7 +196,7 @@ fn get_lint_dict() -> lint_dict { // This is a highly not-optimal set of data structure decisions. type lint_modes = SmallIntMap; -type lint_mode_map = hashmap; +type lint_mode_map = HashMap; // settings_map maps node ids of items with non-default lint settings // to their settings; default_settings contains the settings for everything diff --git a/src/rustc/middle/liveness.rs b/src/rustc/middle/liveness.rs index 9aca98f61e5..0500803b0d5 100644 --- a/src/rustc/middle/liveness.rs +++ b/src/rustc/middle/liveness.rs @@ -101,7 +101,7 @@ */ use dvec::DVec; -use std::map::{hashmap, int_hash, str_hash, uint_hash}; +use std::map::{HashMap, int_hash, str_hash, uint_hash}; use syntax::{visit, ast_util}; use syntax::print::pprust::{expr_to_str}; use visit::vt; @@ -122,7 +122,7 @@ export last_use_map; // // Very subtle (#2633): borrowck will remove entries from this table // if it detects an outstanding loan (that is, the addr is taken). -type last_use_map = hashmap>; +type last_use_map = HashMap>; enum Variable = uint; enum LiveNode = uint; @@ -274,10 +274,10 @@ struct IrMaps { mut num_live_nodes: uint, mut num_vars: uint, - live_node_map: hashmap, - variable_map: hashmap, - field_map: hashmap, - capture_map: hashmap, + live_node_map: HashMap, + variable_map: HashMap, + field_map: HashMap, + capture_map: HashMap, mut var_kinds: ~[VarKind], mut lnks: ~[LiveNodeKind], } diff --git a/src/rustc/middle/pat_util.rs b/src/rustc/middle/pat_util.rs index 6c52204f12d..179467cd3a1 100644 --- a/src/rustc/middle/pat_util.rs +++ b/src/rustc/middle/pat_util.rs @@ -4,12 +4,12 @@ use syntax::ast_util::{path_to_ident, respan, walk_pat}; use syntax::fold; use syntax::fold::*; use syntax::codemap::span; -use std::map::hashmap; +use std::map::HashMap; export pat_binding_ids, pat_bindings, pat_id_map; export pat_is_variant; -type pat_id_map = std::map::hashmap; +type pat_id_map = std::map::HashMap; // This is used because same-named variables in alternative patterns need to // use the node_id of their namesake in the first pattern. diff --git a/src/rustc/middle/region.rs b/src/rustc/middle/region.rs index 9b1065cf863..5fb17eb15b9 100644 --- a/src/rustc/middle/region.rs +++ b/src/rustc/middle/region.rs @@ -20,7 +20,7 @@ use ty::{region_variance, rv_covariant, rv_invariant, rv_contravariant}; use std::list; use std::list::list; -use std::map::{hashmap, int_hash}; +use std::map::{HashMap, int_hash}; type parent = Option; @@ -39,7 +39,7 @@ Encodes the bounding lifetime for a given AST node: - Variables and bindings are mapped to the block in which they are declared. */ -type region_map = hashmap; +type region_map = HashMap; struct ctxt { sess: session, @@ -55,7 +55,7 @@ struct ctxt { // the condition in a while loop is always a parent. In those // cases, we add the node id of such an expression to this set so // that when we visit it we can view it as a parent. - root_exprs: hashmap, + root_exprs: HashMap, // The parent scope is the innermost block, statement, call, or alt // expression during the execution of which the current expression @@ -370,9 +370,9 @@ fn resolve_crate(sess: session, def_map: resolve::DefMap, // a worklist. We can then process the worklist, propagating indirect // dependencies until a fixed point is reached. -type region_paramd_items = hashmap; +type region_paramd_items = HashMap; type region_dep = {ambient_variance: region_variance, id: ast::node_id}; -type dep_map = hashmap>; +type dep_map = HashMap>; impl region_dep: cmp::Eq { pure fn eq(&&other: region_dep) -> bool { diff --git a/src/rustc/middle/resolve.rs b/src/rustc/middle/resolve.rs index c99afbd6992..02788d53ba7 100644 --- a/src/rustc/middle/resolve.rs +++ b/src/rustc/middle/resolve.rs @@ -60,11 +60,11 @@ use vec::pop; use syntax::parse::token::ident_interner; use std::list::{Cons, List, Nil}; -use std::map::{hashmap, int_hash, uint_hash}; +use std::map::{HashMap, int_hash, uint_hash}; use str_eq = str::eq; // Definition mapping -type DefMap = hashmap; +type DefMap = HashMap; struct binding_info { span: span, @@ -72,7 +72,7 @@ struct binding_info { } // Map from the name in a pattern to its binding mode. -type BindingMap = hashmap; +type BindingMap = HashMap; // Implementation resolution // @@ -89,15 +89,15 @@ type MethodInfo = { type Impl = { did: def_id, ident: ident, methods: ~[@MethodInfo] }; // Trait method resolution -type TraitMap = @hashmap>; +type TraitMap = @HashMap>; // Export mapping type Export = { reexp: bool, id: def_id }; -type ExportMap = hashmap; +type ExportMap = HashMap; // This is the replacement export map. It maps a module to all of the exports // within. -type ExportMap2 = hashmap; +type ExportMap2 = HashMap; struct Export2 { name: ~str, // The name of the target. @@ -317,13 +317,13 @@ fn Atom(n: uint) -> Atom { } /// Creates a hash table of atoms. -fn atom_hashmap() -> hashmap { - hashmap::() +fn atom_hashmap() -> HashMap { + HashMap::() } /// One local scope. struct Rib { - bindings: hashmap, + bindings: HashMap, kind: RibKind, } @@ -414,7 +414,7 @@ struct Module { parent_link: ParentLink, mut def_id: Option, - children: hashmap, + children: HashMap, imports: DVec<@ImportDirective>, // The anonymous children of this node. Anonymous children are pseudo- @@ -432,7 +432,7 @@ struct Module { // There will be an anonymous module created around `g` with the ID of the // entry block for `f`. - anonymous_children: hashmap, + anonymous_children: HashMap, // XXX: This is about to be reworked so that exports are on individual // items, not names. @@ -440,10 +440,10 @@ struct Module { // The atom is the name of the exported item, while the node ID is the // ID of the export path. - exported_names: hashmap, + exported_names: HashMap, // The status of resolving each import in this module. - import_resolutions: hashmap, + import_resolutions: HashMap, // The number of unresolved globs that this module exports. mut glob_count: uint, @@ -633,7 +633,7 @@ fn NameBindings() -> NameBindings { /// Interns the names of the primitive types. struct PrimitiveTypeTable { - primitive_types: hashmap, + primitive_types: HashMap, } impl PrimitiveTypeTable { @@ -743,8 +743,8 @@ struct Resolver { unused_import_lint_level: level, - trait_info: hashmap>, - structs: hashmap, + trait_info: HashMap>, + structs: HashMap, // The number of imports that are currently unresolved. mut unresolved_imports: uint, @@ -1386,7 +1386,7 @@ impl Resolver { visit_block(block, new_parent, visitor); } - fn handle_external_def(def: def, modules: hashmap, + fn handle_external_def(def: def, modules: HashMap, child_name_bindings: @NameBindings, final_ident: ~str, atom: Atom, new_parent: ReducedGraphParent) { @@ -3835,7 +3835,7 @@ impl Resolver { mutability: Mutability, // Maps idents to the node ID for the (outermost) // pattern that binds them - bindings_list: Option>, + bindings_list: Option>, visitor: ResolveVisitor) { let pat_id = pattern.id; diff --git a/src/rustc/middle/trans/alt.rs b/src/rustc/middle/trans/alt.rs index 1a663ec260a..a11dcdd7d75 100644 --- a/src/rustc/middle/trans/alt.rs +++ b/src/rustc/middle/trans/alt.rs @@ -12,7 +12,7 @@ use syntax::codemap::span; use syntax::print::pprust::pat_to_str; use middle::resolve::DefMap; use back::abi; -use std::map::hashmap; +use std::map::HashMap; use dvec::DVec; use datum::*; use common::*; diff --git a/src/rustc/middle/trans/base.rs b/src/rustc/middle/trans/base.rs index ab91fc8278d..3b07f375051 100644 --- a/src/rustc/middle/trans/base.rs +++ b/src/rustc/middle/trans/base.rs @@ -15,7 +15,7 @@ use libc::{c_uint, c_ulonglong}; use std::{map, time, list}; -use std::map::hashmap; +use std::map::HashMap; use std::map::{int_hash, str_hash}; use driver::session; use session::session; @@ -124,7 +124,7 @@ fn decl_internal_cdecl_fn(llmod: ModuleRef, name: ~str, llty: TypeRef) -> return llfn; } -fn get_extern_fn(externs: hashmap<~str, ValueRef>, +fn get_extern_fn(externs: HashMap<~str, ValueRef>, llmod: ModuleRef, name: ~str, cc: lib::llvm::CallConv, ty: TypeRef) -> ValueRef { if externs.contains_key(name) { return externs.get(name); } @@ -133,7 +133,7 @@ fn get_extern_fn(externs: hashmap<~str, ValueRef>, return f; } -fn get_extern_const(externs: hashmap<~str, ValueRef>, llmod: ModuleRef, +fn get_extern_const(externs: HashMap<~str, ValueRef>, llmod: ModuleRef, name: ~str, ty: TypeRef) -> ValueRef { if externs.contains_key(name) { return externs.get(name); } let c = str::as_c_str(name, |buf| llvm::LLVMAddGlobal(llmod, ty, buf)); @@ -142,7 +142,7 @@ fn get_extern_const(externs: hashmap<~str, ValueRef>, llmod: ModuleRef, } fn get_simple_extern_fn(cx: block, - externs: hashmap<~str, ValueRef>, + externs: HashMap<~str, ValueRef>, llmod: ModuleRef, name: ~str, n_args: int) -> ValueRef { let _icx = cx.insn_ctxt("get_simple_extern_fn"); @@ -153,7 +153,7 @@ fn get_simple_extern_fn(cx: block, return get_extern_fn(externs, llmod, name, lib::llvm::CCallConv, t); } -fn trans_foreign_call(cx: block, externs: hashmap<~str, ValueRef>, +fn trans_foreign_call(cx: block, externs: HashMap<~str, ValueRef>, llmod: ModuleRef, name: ~str, args: ~[ValueRef]) -> ValueRef { let _icx = cx.insn_ctxt("trans_foreign_call"); @@ -2265,7 +2265,7 @@ fn p2i(ccx: @crate_ctxt, v: ValueRef) -> ValueRef { return llvm::LLVMConstPtrToInt(v, ccx.int_type); } -fn declare_intrinsics(llmod: ModuleRef) -> hashmap<~str, ValueRef> { +fn declare_intrinsics(llmod: ModuleRef) -> HashMap<~str, ValueRef> { let T_memmove32_args: ~[TypeRef] = ~[T_ptr(T_i8()), T_ptr(T_i8()), T_i32(), T_i32(), T_i1()]; let T_memmove64_args: ~[TypeRef] = @@ -2314,7 +2314,7 @@ fn declare_intrinsics(llmod: ModuleRef) -> hashmap<~str, ValueRef> { } fn declare_dbg_intrinsics(llmod: ModuleRef, - intrinsics: hashmap<~str, ValueRef>) { + intrinsics: HashMap<~str, ValueRef>) { let declare = decl_cdecl_fn(llmod, ~"llvm.dbg.declare", T_fn(~[T_metadata(), T_metadata()], T_void())); @@ -2630,10 +2630,10 @@ fn trans_crate(sess: session::session, tydescs: ty::new_ty_hash(), mut finished_tydescs: false, external: ast_util::new_def_hash(), - monomorphized: map::hashmap(), + monomorphized: map::HashMap(), monomorphizing: ast_util::new_def_hash(), type_use_cache: ast_util::new_def_hash(), - vtables: map::hashmap(), + vtables: map::HashMap(), const_cstr_cache: map::str_hash(), const_globals: int_hash::(), module_data: str_hash::(), diff --git a/src/rustc/middle/trans/build.rs b/src/rustc/middle/trans/build.rs index 21ced9f5813..23b1d964ba3 100644 --- a/src/rustc/middle/trans/build.rs +++ b/src/rustc/middle/trans/build.rs @@ -1,4 +1,4 @@ -use std::map::{hashmap, str_hash}; +use std::map::{HashMap, str_hash}; use libc::{c_uint, c_int}; use lib::llvm::llvm; use syntax::codemap; diff --git a/src/rustc/middle/trans/closure.rs b/src/rustc/middle/trans/closure.rs index 056f432fcd5..1ba8e22607a 100644 --- a/src/rustc/middle/trans/closure.rs +++ b/src/rustc/middle/trans/closure.rs @@ -16,7 +16,7 @@ use back::link::{ use util::ppaux::ty_to_str; use syntax::ast_map::{path, path_mod, path_name}; use driver::session::session; -use std::map::hashmap; +use std::map::HashMap; use datum::{Datum, INIT, ByRef, ByValue, FromLvalue}; // ___Good to know (tm)__________________________________________________ diff --git a/src/rustc/middle/trans/common.rs b/src/rustc/middle/trans/common.rs index 064b3006431..13c1b139f0a 100644 --- a/src/rustc/middle/trans/common.rs +++ b/src/rustc/middle/trans/common.rs @@ -5,7 +5,7 @@ use libc::c_uint; use vec::unsafe::to_ptr; -use std::map::{hashmap,set}; +use std::map::{HashMap,Set}; use syntax::{ast, ast_map}; use driver::session; use session::session; @@ -90,7 +90,7 @@ type stats = mut n_null_glues: uint, mut n_real_glues: uint, llvm_insn_ctxt: @mut ~[~str], - llvm_insns: hashmap<~str, uint>, + llvm_insns: HashMap<~str, uint>, fn_times: @mut ~[{ident: ~str, time: int}]}; struct BuilderRef_res { @@ -110,50 +110,50 @@ type crate_ctxt = { llmod: ModuleRef, td: target_data, tn: type_names, - externs: hashmap<~str, ValueRef>, - intrinsics: hashmap<~str, ValueRef>, - item_vals: hashmap, + externs: HashMap<~str, ValueRef>, + intrinsics: HashMap<~str, ValueRef>, + item_vals: HashMap, exp_map: resolve::ExportMap, exp_map2: resolve::ExportMap2, reachable: reachable::map, - item_symbols: hashmap, + item_symbols: HashMap, mut main_fn: Option, link_meta: link_meta, - enum_sizes: hashmap, - discrims: hashmap, - discrim_symbols: hashmap, - tydescs: hashmap, + enum_sizes: HashMap, + discrims: HashMap, + discrim_symbols: HashMap, + tydescs: HashMap, // Set when running emit_tydescs to enforce that no more tydescs are // created. mut finished_tydescs: bool, // Track mapping of external ids to local items imported for inlining - external: hashmap>, + external: HashMap>, // Cache instances of monomorphized functions - monomorphized: hashmap, - monomorphizing: hashmap, + monomorphized: HashMap, + monomorphizing: HashMap, // Cache computed type parameter uses (see type_use.rs) - type_use_cache: hashmap, + type_use_cache: HashMap, // Cache generated vtables - vtables: hashmap, + vtables: HashMap, // Cache of constant strings, - const_cstr_cache: hashmap<~str, ValueRef>, + const_cstr_cache: HashMap<~str, ValueRef>, // Reverse-direction for const ptrs cast from globals, // since the ptr -> init association is lost any // time a GlobalValue is cast. - const_globals: hashmap, - module_data: hashmap<~str, ValueRef>, - lltypes: hashmap, + const_globals: HashMap, + module_data: HashMap<~str, ValueRef>, + lltypes: HashMap, names: namegen, next_addrspace: addrspace_gen, symbol_hasher: @hash::State, - type_hashcodes: hashmap, - type_short_names: hashmap, - all_llvm_symbols: set<~str>, + type_hashcodes: HashMap, + type_short_names: HashMap, + all_llvm_symbols: Set<~str>, tcx: ty::ctxt, maps: astencode::maps, stats: stats, upcalls: @upcall::upcalls, - rtcalls: hashmap<~str, ast::def_id>, + rtcalls: HashMap<~str, ast::def_id>, tydesc_type: TypeRef, int_type: TypeRef, float_type: TypeRef, @@ -171,7 +171,7 @@ type crate_ctxt = { // used in base::trans_closure // parent_class must be a def_id because ctors can be // inlined, so the parent may be in a different crate - class_ctors: hashmap, + class_ctors: HashMap, mut do_not_commit_warning_issued: bool}; // Types used for llself. @@ -231,12 +231,12 @@ type fn_ctxt = @{ mut loop_ret: Option<{flagptr: ValueRef, retptr: ValueRef}>, // Maps arguments to allocas created for them in llallocas. - llargs: hashmap, + llargs: HashMap, // Maps the def_ids for local variables to the allocas created for // them in llallocas. - lllocals: hashmap, + lllocals: HashMap, // Same as above, but for closure upvars - llupvars: hashmap, + llupvars: HashMap, // The node_id of the function, or -1 if it doesn't correspond to // a user-defined function. diff --git a/src/rustc/middle/trans/debuginfo.rs b/src/rustc/middle/trans/debuginfo.rs index 056d3598a32..fe01a202e60 100644 --- a/src/rustc/middle/trans/debuginfo.rs +++ b/src/rustc/middle/trans/debuginfo.rs @@ -1,5 +1,5 @@ use std::map; -use std::map::hashmap; +use std::map::HashMap; use lib::llvm::llvm; use lib::llvm::ValueRef; use trans::common::*; @@ -116,7 +116,7 @@ type block_md = {start: codemap::loc, end: codemap::loc}; type argument_md = {id: ast::node_id}; type retval_md = {id: ast::node_id}; -type metadata_cache = hashmap; +type metadata_cache = HashMap; enum debug_metadata { file_metadata(@metadata), diff --git a/src/rustc/middle/trans/expr.rs b/src/rustc/middle/trans/expr.rs index 0fe4f3cd917..ddc2017e16a 100644 --- a/src/rustc/middle/trans/expr.rs +++ b/src/rustc/middle/trans/expr.rs @@ -716,7 +716,7 @@ fn trans_local_var(bcx: block, ref_id: ast::node_id, def: ast::def) -> Datum { fn take_local(bcx: block, ref_id: ast::node_id, - table: hashmap, + table: HashMap, nid: ast::node_id) -> Datum { let is_last_use = match bcx.ccx().maps.last_use_map.find(ref_id) { None => false, diff --git a/src/rustc/middle/trans/foreign.rs b/src/rustc/middle/trans/foreign.rs index 24207d66245..cb00cff9db5 100644 --- a/src/rustc/middle/trans/foreign.rs +++ b/src/rustc/middle/trans/foreign.rs @@ -15,7 +15,7 @@ use common::*; use build::*; use base::*; use type_of::*; -use std::map::hashmap; +use std::map::HashMap; use util::ppaux::ty_to_str; use datum::*; use callee::*; diff --git a/src/rustc/middle/trans/impl.rs b/src/rustc/middle/trans/impl.rs index 1e77fc43d09..b923e35765a 100644 --- a/src/rustc/middle/trans/impl.rs +++ b/src/rustc/middle/trans/impl.rs @@ -12,7 +12,7 @@ use back::{link, abi}; use lib::llvm::llvm; use lib::llvm::{ValueRef, TypeRef}; use lib::llvm::llvm::LLVMGetParam; -use std::map::hashmap; +use std::map::HashMap; use util::ppaux::{ty_to_str, tys_to_str}; use callee::*; use syntax::print::pprust::expr_to_str; diff --git a/src/rustc/middle/trans/reachable.rs b/src/rustc/middle/trans/reachable.rs index a9a7f4e4e9f..061b260bfbb 100644 --- a/src/rustc/middle/trans/reachable.rs +++ b/src/rustc/middle/trans/reachable.rs @@ -10,12 +10,12 @@ use syntax::{visit, ast_util, ast_map}; use syntax::ast_util::def_id_of_def; use syntax::attr; use syntax::print::pprust::expr_to_str; -use std::map::hashmap; +use std::map::HashMap; use driver::session::*; export map, find_reachable; -type map = std::map::hashmap; +type map = std::map::HashMap; type ctx = {exp_map: resolve::ExportMap, tcx: ty::ctxt, diff --git a/src/rustc/middle/trans/reflect.rs b/src/rustc/middle/trans/reflect.rs index c78e264a86f..680d2be7a50 100644 --- a/src/rustc/middle/trans/reflect.rs +++ b/src/rustc/middle/trans/reflect.rs @@ -1,4 +1,4 @@ -use std::map::{hashmap,str_hash}; +use std::map::{HashMap,str_hash}; use driver::session::session; use lib::llvm::{TypeRef, ValueRef}; use syntax::ast; diff --git a/src/rustc/middle/trans/shape.rs b/src/rustc/middle/trans/shape.rs index cdbaf6e5ee2..f60005f072e 100644 --- a/src/rustc/middle/trans/shape.rs +++ b/src/rustc/middle/trans/shape.rs @@ -17,7 +17,7 @@ use util::ppaux::ty_to_str; use syntax::codemap::span; use dvec::DVec; -use std::map::hashmap; +use std::map::HashMap; use option::is_some; use ty_ctxt = middle::ty::ctxt; @@ -58,8 +58,8 @@ fn mk_nominal_id(tcx: ty::ctxt, did: ast::def_id, @{did: did, parent_id: parent_id, tps: tps_norm} } -fn new_nominal_id_hash() -> hashmap { - return hashmap(); +fn new_nominal_id_hash() -> HashMap { + return HashMap(); } type enum_data = {did: ast::def_id, substs: ty::substs}; @@ -67,7 +67,7 @@ type enum_data = {did: ast::def_id, substs: ty::substs}; type ctxt = {mut next_tag_id: u16, pad: u16, - tag_id_to_index: hashmap, + tag_id_to_index: HashMap, tag_order: DVec, resources: interner::interner, llshapetablesty: TypeRef, diff --git a/src/rustc/middle/trans/type_of.rs b/src/rustc/middle/trans/type_of.rs index 3cdb132f26c..1a743ce31d5 100644 --- a/src/rustc/middle/trans/type_of.rs +++ b/src/rustc/middle/trans/type_of.rs @@ -3,7 +3,7 @@ use lib::llvm::{TypeRef}; use syntax::ast; use lib::llvm::llvm; use driver::session::session; -use std::map::hashmap; +use std::map::HashMap; export type_of; export type_of_dtor; diff --git a/src/rustc/middle/trans/type_use.rs b/src/rustc/middle/trans/type_use.rs index 09b53d2fccf..853bb71e84c 100644 --- a/src/rustc/middle/trans/type_use.rs +++ b/src/rustc/middle/trans/type_use.rs @@ -17,7 +17,7 @@ // much information, but have the disadvantage of being very // invasive.) -use std::map::hashmap; +use std::map::HashMap; use std::list; use std::list::{List, Cons, Nil}; use driver::session::session; diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs index 4a322a74cec..f5d25feccb2 100644 --- a/src/rustc/middle/ty.rs +++ b/src/rustc/middle/ty.rs @@ -3,7 +3,7 @@ use std::{map, smallintmap}; use result::Result; -use std::map::hashmap; +use std::map::HashMap; use driver::session; use session::session; use syntax::{ast, ast_map}; @@ -228,7 +228,7 @@ type field_ty = { // Contains information needed to resolve types and (in the future) look up // the types of AST nodes. type creader_cache_key = {cnum: int, pos: uint, len: uint}; -type creader_cache = hashmap; +type creader_cache = HashMap; impl creader_cache_key : cmp::Eq { pure fn eq(&&other: creader_cache_key) -> bool { @@ -304,7 +304,7 @@ impl borrow : cmp::Eq { type ctxt = @{diag: syntax::diagnostic::span_handler, - interner: hashmap, + interner: HashMap, mut next_id: uint, vecs_implicitly_copyable: bool, cstore: metadata::cstore::cstore, @@ -323,26 +323,26 @@ type ctxt = // of this node. This only applies to nodes that refer to entities // parameterized by type parameters, such as generic fns, types, or // other items. - node_type_substs: hashmap, + node_type_substs: HashMap, items: ast_map::map, - intrinsic_defs: hashmap, + intrinsic_defs: HashMap, freevars: freevars::freevar_map, tcache: type_cache, rcache: creader_cache, ccache: constness_cache, - short_names_cache: hashmap, - needs_drop_cache: hashmap, - needs_unwind_cleanup_cache: hashmap, - kind_cache: hashmap, - ast_ty_to_ty_cache: hashmap<@ast::ty, ast_ty_to_ty_cache_entry>, - enum_var_cache: hashmap, - trait_method_cache: hashmap, - ty_param_bounds: hashmap, - inferred_modes: hashmap, + short_names_cache: HashMap, + needs_drop_cache: HashMap, + needs_unwind_cleanup_cache: HashMap, + kind_cache: HashMap, + ast_ty_to_ty_cache: HashMap<@ast::ty, ast_ty_to_ty_cache_entry>, + enum_var_cache: HashMap, + trait_method_cache: HashMap, + ty_param_bounds: HashMap, + inferred_modes: HashMap, // maps the id of borrowed expr to scope of borrowed ptr - borrowings: hashmap, - normalized_cache: hashmap}; + borrowings: HashMap, + normalized_cache: HashMap}; enum tbox_flag { has_params = 1, @@ -789,19 +789,19 @@ type ty_param_bounds_and_ty = {bounds: @~[param_bounds], region_param: Option, ty: t}; -type type_cache = hashmap; +type type_cache = HashMap; -type constness_cache = hashmap; +type constness_cache = HashMap; type node_type_table = @smallintmap::SmallIntMap; fn mk_rcache() -> creader_cache { type val = {cnum: int, pos: uint, len: uint}; - return map::hashmap(); + return map::HashMap(); } -fn new_ty_hash() -> map::hashmap { - map::hashmap() +fn new_ty_hash() -> map::HashMap { + map::HashMap() } fn mk_ctxt(s: session::session, @@ -810,7 +810,7 @@ fn mk_ctxt(s: session::session, freevars: freevars::freevar_map, region_map: middle::region::region_map, region_paramd_items: middle::region::region_paramd_items) -> ctxt { - let interner = map::hashmap(); + let interner = map::HashMap(); let vecs_implicitly_copyable = get_lint_level(s.lint_settings.default_settings, lint::vecs_implicitly_copyable) == allow; @@ -835,7 +835,7 @@ fn mk_ctxt(s: session::session, needs_drop_cache: new_ty_hash(), needs_unwind_cleanup_cache: new_ty_hash(), kind_cache: new_ty_hash(), - ast_ty_to_ty_cache: map::hashmap(), + ast_ty_to_ty_cache: map::HashMap(), enum_var_cache: new_def_hash(), trait_method_cache: new_def_hash(), ty_param_bounds: map::int_hash(), @@ -1604,7 +1604,7 @@ fn type_needs_unwind_cleanup(cx: ctxt, ty: t) -> bool { } fn type_needs_unwind_cleanup_(cx: ctxt, ty: t, - tycache: map::hashmap, + tycache: map::HashMap, encountered_box: bool) -> bool { // Prevent infinite recursion @@ -2583,8 +2583,8 @@ pure fn hash_bound_region(br: &bound_region) -> uint { } } -fn br_hashmap() -> hashmap { - map::hashmap() +fn br_hashmap() -> HashMap { + map::HashMap() } pure fn hash_region(r: ®ion) -> uint { @@ -3096,7 +3096,7 @@ fn occurs_check(tcx: ctxt, sp: span, vid: TyVid, rt: t) { // Maintains a little union-set tree for inferred modes. `canon()` returns // the current head value for `m0`. -fn canon(tbl: hashmap>, +fn canon(tbl: HashMap>, +m0: ast::inferable) -> ast::inferable { match m0 { ast::infer(id) => match tbl.find(id) { diff --git a/src/rustc/middle/typeck.rs b/src/rustc/middle/typeck.rs index 4dfa17a9034..fe479bdb2a6 100644 --- a/src/rustc/middle/typeck.rs +++ b/src/rustc/middle/typeck.rs @@ -55,7 +55,7 @@ use middle::ty::{arg, field, node_type_table, mk_nil, ty_param_bounds_and_ty}; use middle::ty::{vstore_uniq}; use std::smallintmap; use std::map; -use std::map::{hashmap, int_hash}; +use std::map::{HashMap, int_hash}; use std::serialization::{serialize_uint, deserialize_uint}; use vec::each; use syntax::print::pprust::*; @@ -122,7 +122,7 @@ type method_map_entry = { // maps from an expression id that corresponds to a method call to the details // of the method to be invoked -type method_map = hashmap; +type method_map = HashMap; // Resolutions for bounds of all parameters, left to right, for a given path. type vtable_res = @~[vtable_origin]; @@ -173,12 +173,12 @@ impl vtable_origin { } } -type vtable_map = hashmap; +type vtable_map = HashMap; // Stores information about provided methods, aka "default methods" in traits. // Maps from a trait's def_id to a MethodInfo about // that method in that trait. -type provided_methods_map = hashmap; type ty_param_substs_and_ty = {substs: ty::substs, ty: ty::t}; diff --git a/src/rustc/middle/typeck/check.rs b/src/rustc/middle/typeck/check.rs index 4d4409e499c..49ed4b81d13 100644 --- a/src/rustc/middle/typeck/check.rs +++ b/src/rustc/middle/typeck/check.rs @@ -99,10 +99,10 @@ type self_info = { /// share the inherited fields. struct inherited { infcx: infer::infer_ctxt, - locals: hashmap, - node_types: hashmap, - node_type_substs: hashmap, - borrowings: hashmap, + locals: HashMap, + node_types: HashMap, + node_type_substs: HashMap, + borrowings: HashMap, } struct fn_ctxt { diff --git a/src/rustc/middle/typeck/check/method.rs b/src/rustc/middle/typeck/check/method.rs index 6694160e98e..6a61f7ae15e 100644 --- a/src/rustc/middle/typeck/check/method.rs +++ b/src/rustc/middle/typeck/check/method.rs @@ -102,7 +102,7 @@ struct lookup { mut self_ty: ty::t, mut derefs: uint, candidates: DVec, - candidate_impls: hashmap, + candidate_impls: HashMap, supplied_tps: ~[ty::t], include_private: bool, } diff --git a/src/rustc/middle/typeck/coherence.rs b/src/rustc/middle/typeck/coherence.rs index a75ec2c83dc..79ca4572e50 100644 --- a/src/rustc/middle/typeck/coherence.rs +++ b/src/rustc/middle/typeck/coherence.rs @@ -32,7 +32,7 @@ use util::ppaux::ty_to_str; use dvec::DVec; use result::Ok; -use std::map::{hashmap, int_hash}; +use std::map::{HashMap, int_hash}; use uint::range; use vec::{len, push}; @@ -121,11 +121,11 @@ fn method_to_MethodInfo(ast_method: @method) -> @MethodInfo { struct CoherenceInfo { // Contains implementations of methods that are inherent to a type. // Methods in these implementations don't need to be exported. - inherent_methods: hashmap>, + inherent_methods: HashMap>, // Contains implementations of methods associated with a trait. For these, // the associated trait must be imported at the call site. - extension_methods: hashmap>, + extension_methods: HashMap>, } fn CoherenceInfo() -> CoherenceInfo { @@ -152,12 +152,12 @@ struct CoherenceChecker { // A mapping from implementations to the corresponding base type // definition ID. - base_type_def_ids: hashmap, + base_type_def_ids: HashMap, // A set of implementations in privileged scopes; i.e. those // implementations that are defined in the same scope as their base types. - privileged_implementations: hashmap, + privileged_implementations: HashMap, } impl CoherenceChecker { @@ -645,7 +645,7 @@ impl CoherenceChecker { // External crate handling - fn add_impls_for_module(impls_seen: hashmap, + fn add_impls_for_module(impls_seen: HashMap, crate_store: cstore, module_def_id: def_id) { diff --git a/src/rustc/middle/typeck/infer.rs b/src/rustc/middle/typeck/infer.rs index 2aef5ff6b5b..af1df5d74ff 100644 --- a/src/rustc/middle/typeck/infer.rs +++ b/src/rustc/middle/typeck/infer.rs @@ -248,7 +248,7 @@ section on "Type Combining" below for details. use std::smallintmap; use std::smallintmap::smallintmap; -use std::map::hashmap; +use std::map::HashMap; use middle::ty; use middle::ty::{TyVid, IntVid, RegionVid, vid, ty_int, ty_uint, get, terr_fn, TyVar, IntVar}; diff --git a/src/rustc/middle/typeck/infer/region_var_bindings.rs b/src/rustc/middle/typeck/infer/region_var_bindings.rs index 3c51c22bf05..34291e82d64 100644 --- a/src/rustc/middle/typeck/infer/region_var_bindings.rs +++ b/src/rustc/middle/typeck/infer/region_var_bindings.rs @@ -308,7 +308,7 @@ because `&x` was created alone, but is relatable to `&A`. use dvec::DVec; use result::Result; use result::{Ok, Err}; -use std::map::{hashmap, uint_hash}; +use std::map::{HashMap, uint_hash}; use std::cell::{Cell, empty_cell}; use std::list::{List, Nil, Cons}; @@ -389,13 +389,13 @@ enum UndoLogEntry { AddCombination(CombineMap, TwoRegions) } -type CombineMap = hashmap; +type CombineMap = HashMap; struct RegionVarBindings { tcx: ty::ctxt, var_spans: DVec, values: Cell<~[ty::region]>, - constraints: hashmap, + constraints: HashMap, lubs: CombineMap, glbs: CombineMap, @@ -415,7 +415,7 @@ fn RegionVarBindings(tcx: ty::ctxt) -> RegionVarBindings { tcx: tcx, var_spans: DVec(), values: empty_cell(), - constraints: hashmap(), + constraints: HashMap(), lubs: CombineMap(), glbs: CombineMap(), undo_log: DVec() @@ -426,7 +426,7 @@ fn RegionVarBindings(tcx: ty::ctxt) -> RegionVarBindings { // `b`! Not obvious that this is the most efficient way to go about // it. fn CombineMap() -> CombineMap { - return hashmap(); + return HashMap(); } pure fn hash_constraint(rc: &Constraint) -> uint { @@ -804,10 +804,10 @@ struct SpannedRegion { span: span, } -type TwoRegionsMap = hashmap; +type TwoRegionsMap = HashMap; fn TwoRegionsMap() -> TwoRegionsMap { - return hashmap(); + return HashMap(); } impl RegionVarBindings { diff --git a/src/rustc/util/common.rs b/src/rustc/util/common.rs index 9c157610777..fc19ce2a215 100644 --- a/src/rustc/util/common.rs +++ b/src/rustc/util/common.rs @@ -1,4 +1,4 @@ -use std::map::hashmap; +use std::map::HashMap; use syntax::ast; use ast::{ty, pat}; use syntax::codemap::{span}; @@ -30,7 +30,7 @@ fn indenter() -> _indenter { _indenter(()) } -type flag = hashmap<~str, ()>; +type flag = HashMap<~str, ()>; fn field_expr(f: ast::field) -> @ast::expr { return f.node.expr; } diff --git a/src/rustc/util/ppaux.rs b/src/rustc/util/ppaux.rs index 3a27a521985..f58ed10a408 100644 --- a/src/rustc/util/ppaux.rs +++ b/src/rustc/util/ppaux.rs @@ -1,4 +1,4 @@ -use std::map::hashmap; +use std::map::HashMap; use middle::ty; use middle::ty::{arg, canon_mode}; use middle::ty::{bound_copy, bound_const, bound_owned, bound_send, diff --git a/src/rustdoc/astsrv.rs b/src/rustdoc/astsrv.rs index 385f76873b3..9f32e8f4c61 100644 --- a/src/rustdoc/astsrv.rs +++ b/src/rustdoc/astsrv.rs @@ -7,7 +7,7 @@ Rustdoc from its non-sendableness." )]; -use std::map::hashmap; +use std::map::HashMap; use rustc::driver::session; use session::{basic_options, options}; use session::session; diff --git a/src/rustdoc/attr_pass.rs b/src/rustdoc/attr_pass.rs index 6244d52c897..3203198586d 100644 --- a/src/rustdoc/attr_pass.rs +++ b/src/rustdoc/attr_pass.rs @@ -10,7 +10,7 @@ use doc::item_utils; use extract::to_str; use syntax::ast; use syntax::ast_map; -use std::map::hashmap; +use std::map::HashMap; export mk_pass; diff --git a/src/rustdoc/prune_hidden_pass.rs b/src/rustdoc/prune_hidden_pass.rs index 7acca3aed47..292e37d93c4 100644 --- a/src/rustdoc/prune_hidden_pass.rs +++ b/src/rustdoc/prune_hidden_pass.rs @@ -1,7 +1,7 @@ //! Prunes things with the #[doc(hidden)] attribute use doc::item_utils; -use std::map::hashmap; +use std::map::HashMap; export mk_pass; fn mk_pass() -> pass { diff --git a/src/rustdoc/tystr_pass.rs b/src/rustdoc/tystr_pass.rs index 68a3c94316e..4854ed5beaa 100644 --- a/src/rustdoc/tystr_pass.rs +++ b/src/rustdoc/tystr_pass.rs @@ -4,7 +4,7 @@ use doc::item_utils; use syntax::ast; use syntax::print::pprust; use syntax::ast_map; -use std::map::hashmap; +use std::map::HashMap; use extract::to_str; export mk_pass; diff --git a/src/test/auxiliary/issue-2631-a.rs b/src/test/auxiliary/issue-2631-a.rs index 4c3a6ea6121..f98f5a3cafc 100644 --- a/src/test/auxiliary/issue-2631-a.rs +++ b/src/test/auxiliary/issue-2631-a.rs @@ -5,9 +5,9 @@ use std; use dvec::*; use dvec::DVec; -use std::map::hashmap; +use std::map::HashMap; -type header_map = hashmap<~str, @DVec<@~str>>; +type header_map = HashMap<~str, @DVec<@~str>>; // the unused ty param is necessary so this gets monomorphized fn request(req: header_map) { diff --git a/src/test/bench/core-map.rs b/src/test/bench/core-map.rs index 112c25d5146..6f3dce6647a 100644 --- a/src/test/bench/core-map.rs +++ b/src/test/bench/core-map.rs @@ -28,7 +28,7 @@ fn timed(result: &mut float, *result = (end - start); } -fn int_benchmarks>(make_map: fn() -> M, +fn int_benchmarks>(make_map: fn() -> M, rng: @rand::Rng, num_keys: uint, results: &mut Results) { @@ -69,7 +69,7 @@ fn int_benchmarks>(make_map: fn() -> M, } } -fn str_benchmarks>(make_map: fn() -> M, +fn str_benchmarks>(make_map: fn() -> M, rng: @rand::Rng, num_keys: uint, results: &mut Results) { @@ -156,9 +156,9 @@ fn main(args: ~[~str]) { { let rng = rand::seeded_rng(copy seed); let mut results = empty_results(); - int_benchmarks::>( + int_benchmarks::>( map::uint_hash, rng, num_keys, &mut results); - str_benchmarks::>( + str_benchmarks::>( map::str_hash, rng, num_keys, &mut results); write_results("libstd::map::hashmap", &results); } diff --git a/src/test/bench/core-std.rs b/src/test/bench/core-std.rs index 5f846151917..e8c77926fd3 100644 --- a/src/test/bench/core-std.rs +++ b/src/test/bench/core-std.rs @@ -4,7 +4,7 @@ use std; use std::time::precise_time_s; use std::map; -use std::map::{map, hashmap}; +use std::map::{Map, HashMap}; use io::{Reader, ReaderUtil}; @@ -66,7 +66,7 @@ fn read_line() { fn str_set() { let r = rand::Rng(); - let s = map::hashmap(); + let s = map::HashMap(); for int::range(0, 1000) |_i| { map::set_add(s, r.gen_str(10)); diff --git a/src/test/bench/graph500-bfs.rs b/src/test/bench/graph500-bfs.rs index fda121c6596..d37f3aad5c2 100644 --- a/src/test/bench/graph500-bfs.rs +++ b/src/test/bench/graph500-bfs.rs @@ -8,8 +8,8 @@ use std; use std::arc; use std::time; use std::map; -use std::map::map; -use std::map::hashmap; +use std::map::Map; +use std::map::HashMap; use std::deque; use std::deque::Deque; use std::par; @@ -69,7 +69,7 @@ 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::() + map::HashMap::() }; do vec::each(edges) |e| { @@ -85,7 +85,7 @@ fn make_graph(N: uint, edges: ~[(node_id, node_id)]) -> graph { } fn gen_search_keys(graph: graph, n: uint) -> ~[node_id] { - let keys = map::hashmap::(); + let keys = map::HashMap::(); let r = rand::Rng(); while keys.size() < n { diff --git a/src/test/bench/shootout-chameneos-redux.rs b/src/test/bench/shootout-chameneos-redux.rs index 91f77a77ffb..0541e862aa7 100644 --- a/src/test/bench/shootout-chameneos-redux.rs +++ b/src/test/bench/shootout-chameneos-redux.rs @@ -2,7 +2,7 @@ use std; use std::map; -use std::map::hashmap; +use std::map::HashMap; use std::sort; fn print_complements() { diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs index 69e84286f23..c7ada4ef38d 100644 --- a/src/test/bench/shootout-k-nucleotide-pipes.rs +++ b/src/test/bench/shootout-k-nucleotide-pipes.rs @@ -4,14 +4,14 @@ use std; use std::map; -use std::map::hashmap; +use std::map::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); } @@ -57,7 +57,7 @@ fn sort_and_fmt(mm: hashmap<~[u8], uint>, total: uint) -> ~str { } // given a map, search for the frequency of a pattern -fn find(mm: hashmap<~[u8], uint>, key: ~str) -> uint { +fn find(mm: HashMap<~[u8], uint>, key: ~str) -> uint { match mm.find(str::to_bytes(str::to_lower(key))) { option::None => { return 0u; } option::Some(num) => { return num; } @@ -65,7 +65,7 @@ fn find(mm: hashmap<~[u8], uint>, key: ~str) -> uint { } // given a map, increment the counter for a key -fn update_freq(mm: hashmap<~[u8], uint>, key: &[u8]) { +fn update_freq(mm: HashMap<~[u8], uint>, key: &[u8]) { let key = vec::slice(key, 0, key.len()); match mm.find(key) { option::None => { mm.insert(key, 1u ); } @@ -92,7 +92,7 @@ fn windows_with_carry(bb: &[u8], nn: uint, fn make_sequence_processor(sz: uint, from_parent: pipes::Port<~[u8]>, to_parent: pipes::Chan<~str>) { - let freqs: hashmap<~[u8], uint> = map::bytes_hash(); + let freqs: HashMap<~[u8], uint> = map::bytes_hash(); let mut carry: ~[u8] = ~[]; let mut total: uint = 0u; diff --git a/src/test/bench/shootout-k-nucleotide.rs b/src/test/bench/shootout-k-nucleotide.rs index d5f9860caa1..e6edb8754db 100644 --- a/src/test/bench/shootout-k-nucleotide.rs +++ b/src/test/bench/shootout-k-nucleotide.rs @@ -4,13 +4,13 @@ use std; use std::map; -use std::map::hashmap; +use std::map::HashMap; use std::sort; use io::ReaderUtil; 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); } @@ -56,7 +56,7 @@ fn sort_and_fmt(mm: hashmap<~[u8], uint>, total: uint) -> ~str { } // given a map, search for the frequency of a pattern -fn find(mm: hashmap<~[u8], uint>, key: ~str) -> uint { +fn find(mm: HashMap<~[u8], uint>, key: ~str) -> uint { match mm.find(str::to_bytes(str::to_lower(key))) { option::None => { return 0u; } option::Some(num) => { return num; } @@ -64,7 +64,7 @@ fn find(mm: hashmap<~[u8], uint>, key: ~str) -> uint { } // given a map, increment the counter for a key -fn update_freq(mm: hashmap<~[u8], uint>, key: &[u8]) { +fn update_freq(mm: HashMap<~[u8], uint>, key: &[u8]) { let key = vec::slice(key, 0, key.len()); match mm.find(key) { option::None => { mm.insert(key, 1u ); } @@ -91,7 +91,7 @@ fn windows_with_carry(bb: &[u8], nn: uint, fn make_sequence_processor(sz: uint, from_parent: comm::Port<~[u8]>, to_parent: comm::Chan<~str>) { - let freqs: hashmap<~[u8], uint> = map::bytes_hash(); + let freqs: HashMap<~[u8], uint> = map::bytes_hash(); let mut carry: ~[u8] = ~[]; let mut total: uint = 0u; diff --git a/src/test/bench/shootout-mandelbrot.rs b/src/test/bench/shootout-mandelbrot.rs index 879825fa0ae..19f1c6a4536 100644 --- a/src/test/bench/shootout-mandelbrot.rs +++ b/src/test/bench/shootout-mandelbrot.rs @@ -14,7 +14,7 @@ use std; use io::WriterUtil; -use std::map::hashmap; +use std::map::HashMap; struct cmplx { re: f64, diff --git a/src/test/bench/task-perf-word-count-generic.rs b/src/test/bench/task-perf-word-count-generic.rs index a2d816ec369..b76a0c4dfc5 100644 --- a/src/test/bench/task-perf-word-count-generic.rs +++ b/src/test/bench/task-perf-word-count-generic.rs @@ -16,7 +16,7 @@ use option = option; use option::Some; use option::None; use std::map; -use std::map::hashmap; +use std::map::HashMap; use hash::Hash; use io::WriterUtil; @@ -173,7 +173,7 @@ mod map_reduce { input: K1) { // log(error, "map_task " + input); - let intermediates = map::hashmap(); + let intermediates = map::HashMap(); do map(input) |key, val| { let mut c = None; @@ -250,7 +250,7 @@ mod map_reduce { // This task becomes the master control task. It task::_spawns // to do the rest. - let reducers = map::hashmap(); + let reducers = map::HashMap(); let mut tasks = start_mappers(map, ctrl, inputs); let mut num_mappers = vec::len(inputs) as int; diff --git a/src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs b/src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs index 49ea43439d1..c983f895338 100644 --- a/src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs +++ b/src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs @@ -1,11 +1,11 @@ //buggy.rs use std; -use std::map::hashmap; +use std::map::HashMap; use std::map; fn main() { - let buggy_map :hashmap = - hashmap::(); + let buggy_map :HashMap = + HashMap::(); buggy_map.insert(42, ~1); //~ ERROR illegal borrow // but it is ok if we use a temporary diff --git a/src/test/compile-fail/for-loop-decl.rs b/src/test/compile-fail/for-loop-decl.rs index e14e1fdc7ef..f9696dd2870 100644 --- a/src/test/compile-fail/for-loop-decl.rs +++ b/src/test/compile-fail/for-loop-decl.rs @@ -1,9 +1,9 @@ // error-pattern: mismatched types use std; -use std::map::hashmap; +use std::map::HashMap; use std::bitv; -type fn_info = {vars: hashmap}; +type fn_info = {vars: HashMap}; type var_info = {a: uint, b: uint}; fn bitv_to_str(enclosing: fn_info, v: ~bitv::Bitv) -> str { diff --git a/src/test/compile-fail/map-types.rs b/src/test/compile-fail/map-types.rs index 0a714b12847..dce7d256033 100644 --- a/src/test/compile-fail/map-types.rs +++ b/src/test/compile-fail/map-types.rs @@ -1,12 +1,12 @@ use std; use std::map; -use std::map::hashmap; -use std::map::map; +use std::map::HashMap; +use std::map::Map; // Test that trait types printed in error msgs include the type arguments. fn main() { - let x: map<~str,~str> = map::str_hash::<~str>() as map::<~str,~str>; - let y: map = x; - //~^ ERROR mismatched types: expected `@std::map::map` + let x: Map<~str,~str> = map::str_hash::<~str>() as Map::<~str,~str>; + let y: Map = x; + //~^ ERROR mismatched types: expected `@std::map::Map` } diff --git a/src/test/run-fail/unwind-misc-1.rs b/src/test/run-fail/unwind-misc-1.rs index 5af2191c151..b0af04cc59f 100644 --- a/src/test/run-fail/unwind-misc-1.rs +++ b/src/test/run-fail/unwind-misc-1.rs @@ -2,11 +2,11 @@ use std; use std::map; -use std::map::hashmap; +use std::map::HashMap; fn main() { let count = @mut 0u; - let map = map::hashmap(); + let map = map::HashMap(); let mut arr = ~[]; for uint::range(0u, 10u) |i| { arr += ~[@~"key stuff"]; diff --git a/src/test/run-pass/class-impl-very-parameterized-trait.rs b/src/test/run-pass/class-impl-very-parameterized-trait.rs index ce6074ad4a7..b4d47f86e1a 100644 --- a/src/test/run-pass/class-impl-very-parameterized-trait.rs +++ b/src/test/run-pass/class-impl-very-parameterized-trait.rs @@ -40,7 +40,7 @@ impl cat { } } -impl cat : map { +impl cat : Map { pure fn size() -> uint { self.meows as uint } fn insert(+k: int, +_v: T) -> bool { self.meows += k; diff --git a/src/test/run-pass/extern-mod-syntax.rs b/src/test/run-pass/extern-mod-syntax.rs index 719cda244b5..7798bdc3d0a 100644 --- a/src/test/run-pass/extern-mod-syntax.rs +++ b/src/test/run-pass/extern-mod-syntax.rs @@ -1,5 +1,5 @@ extern mod std; -use std::map::hashmap; +use std::map::HashMap; fn main() { io::println("Hello world!"); diff --git a/src/test/run-pass/hashmap-memory.rs b/src/test/run-pass/hashmap-memory.rs index 6ae9cd430b4..98bcc8ed36f 100644 --- a/src/test/run-pass/hashmap-memory.rs +++ b/src/test/run-pass/hashmap-memory.rs @@ -10,7 +10,7 @@ use option = option; use option::Some; use option::None; use std::map; -use std::map::hashmap; +use std::map::HashMap; use comm::Chan; use comm::Port; use comm::send; @@ -38,7 +38,7 @@ mod map_reduce { fn map_task(ctrl: Chan, input: ~str) { let intermediates = map::str_hash(); - fn emit(im: map::hashmap<~str, int>, ctrl: Chan, key: ~str, + fn emit(im: map::HashMap<~str, int>, ctrl: Chan, key: ~str, val: ~str) { let mut c; match im.find(key) { @@ -65,7 +65,7 @@ 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: map::HashMap<~str, int>; reducers = map::str_hash(); diff --git a/src/test/run-pass/issue-1696.rs b/src/test/run-pass/issue-1696.rs index de0a1f23b52..0c24f791568 100644 --- a/src/test/run-pass/issue-1696.rs +++ b/src/test/run-pass/issue-1696.rs @@ -1,6 +1,6 @@ use std; use std::map; -use std::map::hashmap; +use std::map::HashMap; fn main() { let m = map::bytes_hash(); diff --git a/src/test/run-pass/issue-2804-2.rs b/src/test/run-pass/issue-2804-2.rs index 4b0637c586d..062e086d00c 100644 --- a/src/test/run-pass/issue-2804-2.rs +++ b/src/test/run-pass/issue-2804-2.rs @@ -1,9 +1,9 @@ // Minimized version of issue-2804.rs. Both check that callee IDs don't // clobber the previous node ID in a macro expr use std; -use std::map::hashmap; +use std::map::HashMap; -fn add_interfaces(managed_ip: ~str, device: std::map::hashmap<~str, int>) { +fn add_interfaces(managed_ip: ~str, device: std::map::HashMap<~str, int>) { error!("%s, %?", managed_ip, device[~"interfaces"]); } diff --git a/src/test/run-pass/issue-2804.rs b/src/test/run-pass/issue-2804.rs index 5ed46fc3df0..36620108db9 100644 --- a/src/test/run-pass/issue-2804.rs +++ b/src/test/run-pass/issue-2804.rs @@ -1,6 +1,6 @@ use std; use io::WriterUtil; -use std::map::hashmap; +use std::map::HashMap; enum object { @@ -8,7 +8,7 @@ enum object int_value(i64), } -fn lookup(table: std::map::hashmap<~str, std::json::Json>, key: ~str, default: ~str) -> ~str +fn lookup(table: std::map::HashMap<~str, std::json::Json>, key: ~str, default: ~str) -> ~str { match table.find(key) { @@ -47,7 +47,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::map::HashMap<~str, std::json::Json>) -> ~[(~str, object)] { match device[~"interfaces"] {