Browse files

Convert std::map to camel case

  • Loading branch information...
1 parent 29003c7 commit cb7a5395ddfaa7b8fc40db57b32c22f69780ccd6 @brson brson committed Sep 10, 2012
Showing with 384 additions and 385 deletions.
  1. +1 −1 doc/rust.md
  2. +5 −5 src/cargo/cargo.rs
  3. +4 −4 src/libstd/json.rs
  4. +84 −84 src/libstd/map.rs
  5. +3 −3 src/libstd/net_url.rs
  6. +4 −4 src/libstd/smallintmap.rs
  7. +0 −1 src/libstd/std.rc
  8. +2 −2 src/libsyntax/ast_map.rs
  9. +2 −2 src/libsyntax/ast_util.rs
  10. +1 −1 src/libsyntax/attr.rs
  11. +3 −3 src/libsyntax/ext/auto_serialize.rs
  12. +2 −2 src/libsyntax/ext/base.rs
  13. +5 −5 src/libsyntax/ext/expand.rs
  14. +5 −5 src/libsyntax/ext/simplext.rs
  15. +5 −5 src/libsyntax/ext/tt/macro_parser.rs
  16. +1 −1 src/libsyntax/ext/tt/macro_rules.rs
  17. +3 −3 src/libsyntax/ext/tt/transcribe.rs
  18. +1 −1 src/libsyntax/parse/common.rs
  19. +6 −6 src/libsyntax/parse/parser.rs
  20. +5 −5 src/libsyntax/parse/token.rs
  21. +3 −3 src/libsyntax/util/interner.rs
  22. +1 −1 src/rustc/back/link.rs
  23. +1 −1 src/rustc/back/rpath.rs
  24. +1 −1 src/rustc/driver/driver.rs
  25. +1 −1 src/rustc/driver/rustc.rs
  26. +4 −4 src/rustc/lib/llvm.rs
  27. +1 −1 src/rustc/metadata/creader.rs
  28. +1 −1 src/rustc/metadata/csearch.rs
  29. +5 −5 src/rustc/metadata/cstore.rs
  30. +1 −1 src/rustc/metadata/decoder.rs
  31. +8 −8 src/rustc/metadata/encoder.rs
  32. +1 −1 src/rustc/metadata/tydecode.rs
  33. +2 −2 src/rustc/metadata/tyencode.rs
  34. +1 −1 src/rustc/middle/astencode.rs
  35. +6 −6 src/rustc/middle/borrowck.rs
  36. +1 −1 src/rustc/middle/borrowck/check_loans.rs
  37. +2 −2 src/rustc/middle/capture.rs
  38. +1 −1 src/rustc/middle/check_alt.rs
  39. +1 −1 src/rustc/middle/check_const.rs
  40. +1 −1 src/rustc/middle/freevars.rs
  41. +2 −2 src/rustc/middle/kind.rs
  42. +2 −2 src/rustc/middle/lang_items.rs
  43. +4 −4 src/rustc/middle/lint.rs
  44. +6 −6 src/rustc/middle/liveness.rs
  45. +2 −2 src/rustc/middle/pat_util.rs
  46. +5 −5 src/rustc/middle/region.rs
  47. +18 −18 src/rustc/middle/resolve.rs
  48. +1 −1 src/rustc/middle/trans/alt.rs
  49. +9 −9 src/rustc/middle/trans/base.rs
  50. +1 −1 src/rustc/middle/trans/build.rs
  51. +1 −1 src/rustc/middle/trans/closure.rs
  52. +27 −27 src/rustc/middle/trans/common.rs
  53. +2 −2 src/rustc/middle/trans/debuginfo.rs
  54. +1 −1 src/rustc/middle/trans/expr.rs
  55. +1 −1 src/rustc/middle/trans/foreign.rs
  56. +1 −1 src/rustc/middle/trans/impl.rs
  57. +2 −2 src/rustc/middle/trans/reachable.rs
  58. +1 −1 src/rustc/middle/trans/reflect.rs
  59. +4 −4 src/rustc/middle/trans/shape.rs
  60. +1 −1 src/rustc/middle/trans/type_of.rs
  61. +1 −1 src/rustc/middle/trans/type_use.rs
  62. +27 −27 src/rustc/middle/ty.rs
  63. +4 −4 src/rustc/middle/typeck.rs
  64. +4 −4 src/rustc/middle/typeck/check.rs
  65. +1 −1 src/rustc/middle/typeck/check/method.rs
  66. +6 −6 src/rustc/middle/typeck/coherence.rs
  67. +1 −1 src/rustc/middle/typeck/infer.rs
  68. +7 −7 src/rustc/middle/typeck/infer/region_var_bindings.rs
  69. +2 −2 src/rustc/util/common.rs
  70. +1 −1 src/rustc/util/ppaux.rs
  71. +1 −1 src/rustdoc/astsrv.rs
  72. +1 −1 src/rustdoc/attr_pass.rs
  73. +1 −1 src/rustdoc/prune_hidden_pass.rs
  74. +1 −1 src/rustdoc/tystr_pass.rs
  75. +2 −2 src/test/auxiliary/issue-2631-a.rs
  76. +4 −4 src/test/bench/core-map.rs
  77. +2 −2 src/test/bench/core-std.rs
  78. +4 −4 src/test/bench/graph500-bfs.rs
  79. +1 −1 src/test/bench/shootout-chameneos-redux.rs
  80. +5 −5 src/test/bench/shootout-k-nucleotide-pipes.rs
  81. +5 −5 src/test/bench/shootout-k-nucleotide.rs
  82. +1 −1 src/test/bench/shootout-mandelbrot.rs
  83. +3 −3 src/test/bench/task-perf-word-count-generic.rs
  84. +3 −3 src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs
  85. +2 −2 src/test/compile-fail/for-loop-decl.rs
  86. +5 −5 src/test/compile-fail/map-types.rs
  87. +2 −2 src/test/run-fail/unwind-misc-1.rs
  88. +1 −1 src/test/run-pass/class-impl-very-parameterized-trait.rs
  89. +1 −1 src/test/run-pass/extern-mod-syntax.rs
  90. +3 −3 src/test/run-pass/hashmap-memory.rs
  91. +1 −1 src/test/run-pass/issue-1696.rs
  92. +2 −2 src/test/run-pass/issue-2804-2.rs
  93. +3 −3 src/test/run-pass/issue-2804.rs
View
2 doc/rust.md
@@ -450,7 +450,7 @@ Two examples of paths with type arguments:
# use std::map;
# fn f() {
# fn id<T:Copy>(t: T) -> T { t }
-type t = map::hashmap<int,~str>; // Type arguments used in a type expression
+type t = map::HashMap<int,~str>; // Type arguments used in a type expression
let x = id::<int>(10); // Type arguments used in a call expression
# }
~~~~
View
10 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) {
View
8 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> ~[A]: ToJson {
fn to_json() -> Json { List(@self.map(|elt| elt.to_json())) }
}
-impl <A: ToJson Copy> hashmap<~str, A>: ToJson {
+impl <A: ToJson Copy> HashMap<~str, A>: ToJson {
fn to_json() -> Json {
let d = map::str_hash();
for self.each() |key, value| {
View
168 src/libstd/map.rs
@@ -12,19 +12,19 @@ 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;
export hash_from_ints, hash_from_uints;
export vec_from_set;
/// A convenience type to treat a hashmap as a set
-type set<K:Eq IterBytes Hash> = hashmap<K, ()>;
+type Set<K:Eq IterBytes Hash> = HashMap<K, ()>;
-type hashmap<K:Eq IterBytes Hash, V> = chained::t<K, V>;
+type HashMap<K:Eq IterBytes Hash, V> = chained::T<K, V>;
-trait map<K:Eq IterBytes Hash Copy, V: Copy> {
+trait Map<K:Eq IterBytes Hash Copy, V: Copy> {
/// Return the number of elements in the map
pure fn size() -> uint;
@@ -86,9 +86,9 @@ trait map<K:Eq IterBytes Hash Copy, V: Copy> {
}
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,41 +99,41 @@ 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<K, V> {
+ struct Entry<K, V> {
hash: uint,
key: K,
value: V,
- mut next: Option<@entry<K, V>>
+ mut next: Option<@Entry<K, V>>
}
- struct hashmap_<K:Eq IterBytes Hash, V> {
+ struct HashMap_<K:Eq IterBytes Hash, V> {
mut count: uint,
- mut chains: ~[mut Option<@entry<K,V>>]
+ mut chains: ~[mut Option<@Entry<K,V>>]
}
- type t<K:Eq IterBytes Hash, V> = @hashmap_<K, V>;
+ type T<K:Eq IterBytes Hash, V> = @HashMap_<K, V>;
- enum search_result<K, V> {
- not_found,
- found_first(uint, @entry<K,V>),
- found_after(@entry<K,V>, @entry<K,V>)
+ enum SearchResult<K, V> {
+ NotFound,
+ FoundFirst(uint, @Entry<K,V>),
+ FoundAfter(@Entry<K,V>, @Entry<K,V>)
}
- priv impl<K:Eq IterBytes Hash, V: Copy> t<K, V> {
+ priv impl<K:Eq IterBytes Hash, V: Copy> T<K, V> {
pure fn search_rem(k: &K, h: uint, idx: uint,
- e_root: @entry<K,V>) -> search_result<K,V> {
+ e_root: @Entry<K,V>) -> SearchResult<K,V> {
let mut e0 = e_root;
let mut comp = 1u; // for logging
loop {
match copy e0.next {
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<K,V> {
+ pure fn search_tbl(k: &K, h: uint) -> SearchResult<K,V> {
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<K,V>) -> bool) {
+ pure fn each_entry(blk: fn(@Entry<K,V>) -> 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<K:Eq IterBytes Hash Copy, V: Copy> t<K, V>: map<K, V> {
+ impl<K:Eq IterBytes Hash Copy, V: Copy> T<K, V>: Map<K, V> {
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<V> {
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<K:Eq IterBytes Hash Copy ToStr, V: ToStr Copy> t<K, V>: ToStr {
+ impl<K:Eq IterBytes Hash Copy ToStr, V: ToStr Copy> T<K, V>: ToStr {
fn to_writer(wr: io::Writer) {
if self.count == 0u {
wr.write_str(~"{}");
@@ -356,20 +356,20 @@ mod chained {
}
}
- impl<K:Eq IterBytes Hash Copy, V: Copy> t<K, V>: ops::Index<K, V> {
+ impl<K:Eq IterBytes Hash Copy, V: Copy> T<K, V>: ops::Index<K, V> {
pure fn index(&&k: K) -> V {
unchecked {
self.get(k)
}
}
}
- fn chains<K,V>(nchains: uint) -> ~[mut Option<@entry<K,V>>] {
+ fn chains<K,V>(nchains: uint) -> ~[mut Option<@Entry<K,V>>] {
vec::to_mut(vec::from_elem(nchains, None))
}
- fn mk<K:Eq IterBytes Hash, V: Copy>() -> t<K,V> {
- let slf: t<K, V> = @hashmap_ {count: 0u,
+ fn mk<K:Eq IterBytes Hash, V: Copy>() -> T<K,V> {
+ let slf: T<K, V> = @HashMap_ {count: 0u,
chains: chains(initial_capacity)};
slf
}
@@ -380,48 +380,48 @@ Function: hashmap
Construct a hashmap.
*/
-fn hashmap<K:Eq IterBytes Hash Const, V: Copy>()
- -> hashmap<K, V> {
+fn HashMap<K:Eq IterBytes Hash Const, V: Copy>()
+ -> HashMap<K, V> {
chained::mk()
}
/// Construct a hashmap for string-slice keys
-fn str_slice_hash<V: Copy>() -> hashmap<&str, V> {
- return hashmap();
+fn str_slice_hash<V: Copy>() -> HashMap<&str, V> {
+ return HashMap();
}
/// Construct a hashmap for string keys
-fn str_hash<V: Copy>() -> hashmap<~str, V> {
- return hashmap();
+fn str_hash<V: Copy>() -> HashMap<~str, V> {
+ return HashMap();
}
/// Construct a hashmap for boxed string keys
-fn box_str_hash<V: Copy>() -> hashmap<@~str, V> {
- hashmap()
+fn box_str_hash<V: Copy>() -> HashMap<@~str, V> {
+ HashMap()
}
/// Construct a hashmap for byte string keys
-fn bytes_hash<V: Copy>() -> hashmap<~[u8], V> {
- return hashmap();
+fn bytes_hash<V: Copy>() -> HashMap<~[u8], V> {
+ return HashMap();
}
/// Construct a hashmap for int keys
-fn int_hash<V: Copy>() -> hashmap<int, V> {
- return hashmap();
+fn int_hash<V: Copy>() -> HashMap<int, V> {
+ return HashMap();
}
/// Construct a hashmap for uint keys
-fn uint_hash<V: Copy>() -> hashmap<uint, V> {
- return hashmap();
+fn uint_hash<V: Copy>() -> HashMap<uint, V> {
+ return HashMap();
}
/// Convenience function for adding keys to a hashmap with nil type keys
-fn set_add<K:Eq IterBytes Hash Const Copy>(set: set<K>, +key: K) -> bool {
+fn set_add<K:Eq IterBytes Hash Const Copy>(set: Set<K>, +key: K) -> bool {
set.insert(key, ())
}
/// Convert a set into a vector.
-fn vec_from_set<T:Eq IterBytes Hash Copy>(s: set<T>) -> ~[T] {
+fn vec_from_set<T:Eq IterBytes Hash Copy>(s: Set<T>) -> ~[T] {
let mut v = ~[];
vec::reserve(v, s.size());
do s.each_key() |k| {
@@ -433,8 +433,8 @@ fn vec_from_set<T:Eq IterBytes Hash Copy>(s: set<T>) -> ~[T] {
/// Construct a hashmap from a vector
fn hash_from_vec<K: Eq IterBytes Hash Const Copy, V: Copy>(
- items: &[(K, V)]) -> hashmap<K, V> {
- let map = hashmap();
+ items: &[(K, V)]) -> HashMap<K, V> {
+ let map = HashMap();
do vec::iter(items) |item| {
let (key, value) = item;
map.insert(key, value);
@@ -443,28 +443,28 @@ fn hash_from_vec<K: Eq IterBytes Hash Const Copy, V: Copy>(
}
/// Construct a hashmap from a vector with string keys
-fn hash_from_strs<V: Copy>(items: &[(~str, V)]) -> hashmap<~str, V> {
+fn hash_from_strs<V: Copy>(items: &[(~str, V)]) -> HashMap<~str, V> {
hash_from_vec(items)
}
/// Construct a hashmap from a vector with byte keys
-fn hash_from_bytes<V: Copy>(items: &[(~[u8], V)]) -> hashmap<~[u8], V> {
+fn hash_from_bytes<V: Copy>(items: &[(~[u8], V)]) -> HashMap<~[u8], V> {
hash_from_vec(items)
}
/// Construct a hashmap from a vector with int keys
-fn hash_from_ints<V: Copy>(items: &[(int, V)]) -> hashmap<int, V> {
+fn hash_from_ints<V: Copy>(items: &[(int, V)]) -> HashMap<int, V> {
hash_from_vec(items)
}
/// Construct a hashmap from a vector with uint keys
-fn hash_from_uints<V: Copy>(items: &[(uint, V)]) -> hashmap<uint, V> {
+fn hash_from_uints<V: Copy>(items: &[(uint, V)]) -> HashMap<uint, V> {
hash_from_vec(items)
}
// XXX Transitional
impl<K: Eq IterBytes Hash Copy, V: Copy> @Mut<LinearMap<K, V>>:
- map<K, V> {
+ Map<K, V> {
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<uint, uint> =
- map::hashmap::<uint, uint>();
+ let hm_uu: map::HashMap<uint, uint> =
+ map::HashMap::<uint, uint>();
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<uint, ~str> =
- map::hashmap::<uint, ~str>();
+ let hm_us: map::HashMap<uint, ~str> =
+ map::HashMap::<uint, ~str>();
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<uint, uint> =
- map::hashmap::<uint, uint>();
+ let hm_uu: map::HashMap<uint, uint> =
+ map::HashMap::<uint, uint>();
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<uint, uint> =
- map::hashmap::<uint, uint>();
+ let hm: map::HashMap<uint, uint> =
+ map::HashMap::<uint, uint>();
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));
View
6 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 = ~"";
View
8 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<T: Copy>(self: SmallIntMap<T>, key: uint) -> bool {
}
/// Implements the map::map interface for smallintmap
-impl<V: Copy> SmallIntMap<V>: map::map<uint, V> {
+impl<V: Copy> SmallIntMap<V>: map::Map<uint, V> {
pure fn size() -> uint {
let mut sz = 0u;
for self.v.each |item| {
@@ -146,6 +146,6 @@ impl<V: Copy> SmallIntMap<V>: ops::Index<uint, V> {
}
/// Cast the given smallintmap to a map::map
-fn as_map<V: Copy>(s: SmallIntMap<V>) -> map::map<uint, V> {
- s as map::map::<uint, V>
+fn as_map<V: Copy>(s: SmallIntMap<V>) -> map::Map<uint, V> {
+ s as map::Map::<uint, V>
}
View
1 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;
View
4 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<node_id, ast_node>;
+type map = std::map::HashMap<node_id, ast_node>;
type ctx = {map: map, mut path: path,
mut local_id: uint, diag: span_handler};
type vt = visit::vt<ctx>;
View
4 src/libsyntax/ast_util.rs
@@ -259,8 +259,8 @@ impl def_id : core::to_bytes::IterBytes {
}
}
-fn new_def_hash<V: Copy>() -> std::map::hashmap<ast::def_id, V> {
- return std::map::hashmap::<ast::def_id, V>();
+fn new_def_hash<V: Copy>() -> std::map::HashMap<ast::def_id, V> {
+ return std::map::HashMap::<ast::def_id, V>();
}
fn block_from_expr(e: @expr) -> blk {
View
2 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};
View
6 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::ident, fn@(@ast::expr) -> ~[@ast::stmt]>;
-type deser_tps_map = map::hashmap<ast::ident, fn@() -> @ast::expr>;
+type ser_tps_map = map::HashMap<ast::ident, fn@(@ast::expr) -> ~[@ast::stmt]>;
+type deser_tps_map = map::HashMap<ast::ident, fn@() -> @ast::expr>;
fn expand(cx: ext_ctxt,
span: span,
View
4 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 {
View
10 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 {
View
10 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<ident, selector>,
+ {real_binders: HashMap<ident, selector>,
literal_ast_matchers: DVec<selector>};
-type bindings = hashmap<ident, arb_depth<matchable>>;
+type bindings = HashMap<ident, arb_depth<matchable>>;
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<arb_depth<matchable>>,
/* helper for transcribe_exprs: what vars from `b` occur in `e`? */
fn free_vars(b: bindings, e: @expr, it: fn(ident)) {
- let idents: hashmap<ident, ()> = uint_hash::<()>();
+ let idents: HashMap<ident, ()> = uint_hash::<()>();
fn mark_ident(&&i: ident, _fld: ast_fold, b: bindings,
- idents: hashmap<ident, ()>) -> ident {
+ idents: HashMap<ident, ()>) -> ident {
if b.contains_key(i) { idents.insert(i, ()); }
return i;
}
View
10 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<ident,@named_match> {
+ -> HashMap<ident,@named_match> {
fn n_rec(p_s: parse_sess, m: matcher, res: ~[@named_match],
- ret_val: hashmap<ident, @named_match>) {
+ ret_val: HashMap<ident, @named_match>) {
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<ident, @named_match>),
+ success(HashMap<ident, @named_match>),
failure(codemap::span, ~str),
error(codemap::span, ~str)
}
fn parse_or_else(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader,
- ms: ~[matcher]) -> hashmap<ident, @named_match> {
+ ms: ~[matcher]) -> HashMap<ident, @named_match> {
match parse(sess, cfg, rdr, ms) {
success(m) => m,
failure(sp, str) => sess.span_diagnostic.span_fatal(sp, str),
View
2 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,
View
6 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<ident, @named_match>,
+ interpolations: std::map::HashMap<ident, @named_match>,
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<std::map::hashmap<ident,@named_match>>,
+ interp: Option<std::map::HashMap<ident,@named_match>>,
src: ~[ast::token_tree])
-> tt_reader {
let r = @{sp_diag: sp_diag, interner: itr,
View
2 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;
View
12 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<ObsoleteSyntax, ()>,
+ obsolete_set: HashMap<ObsoleteSyntax, ()>,
drop {} /* do not copy the parser; its state is tied to outside state */
}
View
10 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",
View
6 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<T: Const> =
- {map: hashmap<T, uint>,
+ {map: HashMap<T, uint>,
vect: DVec<T>};
fn mk<T:Eq IterBytes Hash Const Copy>() -> interner<T> {
- let m = map::hashmap::<T, uint>();
+ let m = map::HashMap::<T, uint>();
let hi: hash_interner<T> =
{map: m, vect: DVec()};
return hi as interner::<T>;
View
2 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;
View
2 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;
View
2 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,
View
2 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;
View
8 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<TypeRef, ~str>,
- named_types: std::map::hashmap<~str, TypeRef>};
+type type_names = @{type_names: std::map::HashMap<TypeRef, ~str>,
+ 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<TypeRef> {
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()}
}
View
2 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::*;
View
2 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;
View
10 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<ast::crate_num, ast::crate_num>;
+type cnum_map = map::HashMap<ast::crate_num, ast::crate_num>;
// 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<ast::def_id, @~str>;
+type mod_path_map = map::HashMap<ast::def_id, @~str>;
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<ast::crate_num, crate_metadata>,
+ @{metas: map::HashMap<ast::crate_num, crate_metadata>,
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<ast::node_id, ast::crate_num>;
+type use_crate_map = map::HashMap<ast::node_id, ast::crate_num>;
// Internal method to retrieve the data from the cstore
pure fn p(cstore: cstore) -> cstore_private {
View
2 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};
View
16 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<ty::t, tyencode::ty_abbrev>;
+type abbrev_map = map::HashMap<ty::t, tyencode::ty_abbrev>;
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<ast::node_id, ()>,
+ reachable: HashMap<ast::node_id, ()>,
reexports: ~[(~str, def_id)],
reexports2: middle::resolve::ExportMap2,
- item_symbols: hashmap<ast::node_id, ~str>,
- discrim_symbols: hashmap<ast::node_id, ~str>,
+ item_symbols: HashMap<ast::node_id, ~str>,
+ discrim_symbols: HashMap<ast::node_id, ~str>,
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<ast::node_id, ()>,
+ reachable: HashMap<ast::node_id, ()>,
reexports: ~[(~str, def_id)],
reexports2: middle::resolve::ExportMap2,
- item_symbols: hashmap<ast::node_id, ~str>,
- discrim_symbols: hashmap<ast::node_id, ~str>,
+ item_symbols: HashMap<ast::node_id, ~str>,
+ discrim_symbols: HashMap<ast::node_id, ~str>,
link_meta: link_meta,
cstore: cstore::cstore,
encode_inlined_item: encode_inlined_item,
View
2 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;
View
4 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<ty::t, ty_abbrev>), }
+enum abbrev_ctxt { ac_no_abbrevs, ac_use_abbrevs(HashMap<ty::t, ty_abbrev>), }
fn cx_uses_abbrevs(cx: @ctxt) -> bool {
match cx.abbrevs {
View
2 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;
View
12 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<root_map_key, ast::node_id>;
+type root_map = HashMap<root_map_key, ast::node_id>;
// 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<ast::node_id, ()>;
+type mutbl_map = std::map::HashMap<ast::node_id, ()>;
// 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<ast::node_id, @DVec<@DVec<loan>>>,
- pure_map: hashmap<ast::node_id, bckerr>
+ req_loan_map: HashMap<ast::node_id, @DVec<@DVec<loan>>>,
+ pure_map: HashMap<ast::node_id, bckerr>
};
fn save_and_restore<T:Copy,U>(&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
View
2 src/rustc/middle/borrowck/check_loans.rs
@@ -15,7 +15,7 @@ enum check_loan_ctxt = @{
bccx: borrowck_ctxt,
req_maps: req_maps,
- reported: hashmap<ast::node_id, ()>,
+ reported: HashMap<ast::node_id, ()>,
// Keep track of whether we're inside a ctor, so as to
// allow mutating immutable fields in the same class if
View
4 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<ast::def_id, capture_var>;
+type capture_map = map::HashMap<ast::def_id, capture_var>;
// checks the capture clause for a fn_expr() and issues warnings or
// errors for any irregularities which we identify.
View
2 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(@{
View
2 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,
View
2 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<ast::node_id, freevar_info>;
+type freevar_map = HashMap<ast::node_id, freevar_info>;
// 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.
View
4 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<node_id, ()>;
+type rval_map = std::map::HashMap<node_id, ()>;
type ctx = {tcx: ty::ctxt,
method_map: typeck::method_map,
View
4 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<def_id>>,
+ item_refs: HashMap<~str,&mut Option<def_id>>,
}
impl LanguageItemCollector {
View
8 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<level>;
-type lint_mode_map = hashmap<ast::node_id, lint_modes>;
+type lint_mode_map = HashMap<ast::node_id, lint_modes>;
// settings_map maps node ids of items with non-default lint settings
// to their settings; default_settings contains the settings for everything
View
12 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<node_id, @DVec<node_id>>;
+type last_use_map = HashMap<node_id, @DVec<node_id>>;
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<node_id, LiveNode>,
- variable_map: hashmap<node_id, Variable>,
- field_map: hashmap<ident, Variable>,
- capture_map: hashmap<node_id, @~[CaptureInfo]>,
+ live_node_map: HashMap<node_id, LiveNode>,
+ variable_map: HashMap<node_id, Variable>,
+ field_map: HashMap<ident, Variable>,
+ capture_map: HashMap<node_id, @~[CaptureInfo]>,
mut var_kinds: ~[VarKind],
mut lnks: ~[LiveNodeKind],
}
View
4 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<ident, node_id>;
+type pat_id_map = std::map::HashMap<ident, node_id>;
// This is used because same-named variables in alternative patterns need to
// use the node_id of their namesake in the first pattern.
View
10 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<ast::node_id>;
@@ -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<ast::node_id, ast::node_id>;
+type region_map = HashMap<ast::node_id, ast::node_id>;
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<ast::node_id, ()>,
+ root_exprs: HashMap<ast::node_id, ()>,
// 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<ast::node_id, region_variance>;
+type region_paramd_items = HashMap<ast::node_id, region_variance>;