Convert std::map to camel case

This commit is contained in:
Brian Anderson 2012-09-10 15:38:28 -07:00
parent 29003c799f
commit cb7a5395dd
93 changed files with 384 additions and 385 deletions

View File

@ -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 File

@ -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 File

@ -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 File

@ -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<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,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<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 {
@ -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<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,7 +356,7 @@ 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)
@ -364,12 +364,12 @@ mod chained {
}
}
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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -1,4 +1,4 @@
use std::map::{hashmap};
use std::map::{HashMap};
use ast_util::spanned;
use parser::parser;
use lexer::reader;

View File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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>;
type region_dep = {ambient_variance: region_variance, id: ast::node_id};
type dep_map = hashmap<ast::node_id, @DVec<region_dep>>;
type dep_map = HashMap<ast::node_id, @DVec<region_dep>>;
impl region_dep: cmp::Eq {
pure fn eq(&&other: region_dep) -> bool {

View File

@ -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<node_id,def>;
type DefMap = HashMap<node_id,def>;
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<ident,binding_info>;
type BindingMap = HashMap<ident,binding_info>;
// Implementation resolution
//
@ -89,15 +89,15 @@ type MethodInfo = {
type Impl = { did: def_id, ident: ident, methods: ~[@MethodInfo] };
// Trait method resolution
type TraitMap = @hashmap<node_id,@DVec<def_id>>;
type TraitMap = @HashMap<node_id,@DVec<def_id>>;
// Export mapping
type Export = { reexp: bool, id: def_id };
type ExportMap = hashmap<node_id, ~[Export]>;
type ExportMap = HashMap<node_id, ~[Export]>;
// This is the replacement export map. It maps a module to all of the exports
// within.
type ExportMap2 = hashmap<node_id, ~[Export2]>;
type ExportMap2 = HashMap<node_id, ~[Export2]>;
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<V:Copy>() -> hashmap<Atom,V> {
hashmap::<Atom,V>()
fn atom_hashmap<V:Copy>() -> HashMap<Atom,V> {
HashMap::<Atom,V>()
}
/// One local scope.
struct Rib {
bindings: hashmap<Atom,def_like>,
bindings: HashMap<Atom,def_like>,
kind: RibKind,
}
@ -414,7 +414,7 @@ struct Module {
parent_link: ParentLink,
mut def_id: Option<def_id>,
children: hashmap<Atom,@NameBindings>,
children: HashMap<Atom,@NameBindings>,
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<node_id,@Module>,
anonymous_children: HashMap<node_id,@Module>,
// 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<Atom,node_id>,
exported_names: HashMap<Atom,node_id>,
// The status of resolving each import in this module.
import_resolutions: hashmap<Atom,@ImportResolution>,
import_resolutions: HashMap<Atom,@ImportResolution>,
// 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<Atom,prim_ty>,
primitive_types: HashMap<Atom,prim_ty>,
}
impl PrimitiveTypeTable {
@ -743,8 +743,8 @@ struct Resolver {
unused_import_lint_level: level,
trait_info: hashmap<def_id,@hashmap<Atom,()>>,
structs: hashmap<def_id,bool>,
trait_info: HashMap<def_id,@HashMap<Atom,()>>,
structs: HashMap<def_id,bool>,
// 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<def_id, @Module>,
fn handle_external_def(def: def, modules: HashMap<def_id, @Module>,
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<hashmap<Atom,node_id>>,
bindings_list: Option<HashMap<Atom,node_id>>,
visitor: ResolveVisitor) {
let pat_id = pattern.id;

View File

@ -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::*;

View File

@ -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::<ValueRef>(),
module_data: str_hash::<ValueRef>(),

View File

@ -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;

View File

@ -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)__________________________________________________

View File

@ -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<ast::node_id, ValueRef>,
externs: HashMap<~str, ValueRef>,
intrinsics: HashMap<~str, ValueRef>,
item_vals: HashMap<ast::node_id, ValueRef>,
exp_map: resolve::ExportMap,
exp_map2: resolve::ExportMap2,
reachable: reachable::map,
item_symbols: hashmap<ast::node_id, ~str>,
item_symbols: HashMap<ast::node_id, ~str>,
mut main_fn: Option<ValueRef>,
link_meta: link_meta,
enum_sizes: hashmap<ty::t, uint>,
discrims: hashmap<ast::def_id, ValueRef>,
discrim_symbols: hashmap<ast::node_id, ~str>,
tydescs: hashmap<ty::t, @tydesc_info>,
enum_sizes: HashMap<ty::t, uint>,
discrims: HashMap<ast::def_id, ValueRef>,
discrim_symbols: HashMap<ast::node_id, ~str>,
tydescs: HashMap<ty::t, @tydesc_info>,
// 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<ast::def_id, Option<ast::node_id>>,
external: HashMap<ast::def_id, Option<ast::node_id>>,
// Cache instances of monomorphized functions
monomorphized: hashmap<mono_id, ValueRef>,
monomorphizing: hashmap<ast::def_id, uint>,
monomorphized: HashMap<mono_id, ValueRef>,
monomorphizing: HashMap<ast::def_id, uint>,
// Cache computed type parameter uses (see type_use.rs)
type_use_cache: hashmap<ast::def_id, ~[type_use::type_uses]>,
type_use_cache: HashMap<ast::def_id, ~[type_use::type_uses]>,
// Cache generated vtables
vtables: hashmap<mono_id, ValueRef>,
vtables: HashMap<mono_id, ValueRef>,
// 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<int, ValueRef>,
module_data: hashmap<~str, ValueRef>,
lltypes: hashmap<ty::t, TypeRef>,
const_globals: HashMap<int, ValueRef>,
module_data: HashMap<~str, ValueRef>,
lltypes: HashMap<ty::t, TypeRef>,
names: namegen,
next_addrspace: addrspace_gen,
symbol_hasher: @hash::State,
type_hashcodes: hashmap<ty::t, ~str>,
type_short_names: hashmap<ty::t, ~str>,
all_llvm_symbols: set<~str>,
type_hashcodes: HashMap<ty::t, ~str>,
type_short_names: HashMap<ty::t, ~str>,
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<ast::node_id, ast::def_id>,
class_ctors: HashMap<ast::node_id, ast::def_id>,
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<ast::node_id, local_val>,
llargs: HashMap<ast::node_id, local_val>,
// Maps the def_ids for local variables to the allocas created for
// them in llallocas.
lllocals: hashmap<ast::node_id, local_val>,
lllocals: HashMap<ast::node_id, local_val>,
// Same as above, but for closure upvars
llupvars: hashmap<ast::node_id, ValueRef>,
llupvars: HashMap<ast::node_id, ValueRef>,
// The node_id of the function, or -1 if it doesn't correspond to
// a user-defined function.

View File

@ -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<int, ~[debug_metadata]>;
type metadata_cache = HashMap<int, ~[debug_metadata]>;
enum debug_metadata {
file_metadata(@metadata<file_md>),

View File

@ -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<ast::node_id, local_val>,
table: HashMap<ast::node_id, local_val>,
nid: ast::node_id) -> Datum {
let is_last_use = match bcx.ccx().maps.last_use_map.find(ref_id) {
None => false,

View File

@ -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::*;

View File

@ -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;

View File

@ -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<node_id, ()>;
type map = std::map::HashMap<node_id, ()>;
type ctx = {exp_map: resolve::ExportMap,
tcx: ty::ctxt,

View File

@ -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;

View File

@ -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<T: Copy>() -> hashmap<nominal_id, T> {
return hashmap();
fn new_nominal_id_hash<T: Copy>() -> HashMap<nominal_id, T> {
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<nominal_id, u16>,
tag_id_to_index: HashMap<nominal_id, u16>,
tag_order: DVec<enum_data>,
resources: interner::interner<nominal_id>,
llshapetablesty: TypeRef,

View File

@ -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;

View File

@ -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;

View File

@ -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<creader_cache_key, t>;
type creader_cache = HashMap<creader_cache_key, t>;
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<intern_key, t_box>,
interner: HashMap<intern_key, t_box>,
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_id, ~[t]>,
node_type_substs: HashMap<node_id, ~[t]>,
items: ast_map::map,
intrinsic_defs: hashmap<ast::ident, (ast::def_id, t)>,
intrinsic_defs: HashMap<ast::ident, (ast::def_id, t)>,
freevars: freevars::freevar_map,
tcache: type_cache,
rcache: creader_cache,
ccache: constness_cache,
short_names_cache: hashmap<t, @~str>,
needs_drop_cache: hashmap<t, bool>,
needs_unwind_cleanup_cache: hashmap<t, bool>,
kind_cache: hashmap<t, kind>,
ast_ty_to_ty_cache: hashmap<@ast::ty, ast_ty_to_ty_cache_entry>,
enum_var_cache: hashmap<def_id, @~[variant_info]>,
trait_method_cache: hashmap<def_id, @~[method]>,
ty_param_bounds: hashmap<ast::node_id, param_bounds>,
inferred_modes: hashmap<ast::node_id, ast::mode>,
short_names_cache: HashMap<t, @~str>,
needs_drop_cache: HashMap<t, bool>,
needs_unwind_cleanup_cache: HashMap<t, bool>,
kind_cache: HashMap<t, kind>,
ast_ty_to_ty_cache: HashMap<@ast::ty, ast_ty_to_ty_cache_entry>,
enum_var_cache: HashMap<def_id, @~[variant_info]>,
trait_method_cache: HashMap<def_id, @~[method]>,
ty_param_bounds: HashMap<ast::node_id, param_bounds>,
inferred_modes: HashMap<ast::node_id, ast::mode>,
// maps the id of borrowed expr to scope of borrowed ptr
borrowings: hashmap<ast::node_id, borrow>,
normalized_cache: hashmap<t, t>};
borrowings: HashMap<ast::node_id, borrow>,
normalized_cache: HashMap<t, t>};
enum tbox_flag {
has_params = 1,
@ -789,19 +789,19 @@ type ty_param_bounds_and_ty = {bounds: @~[param_bounds],
region_param: Option<region_variance>,
ty: t};
type type_cache = hashmap<ast::def_id, ty_param_bounds_and_ty>;
type type_cache = HashMap<ast::def_id, ty_param_bounds_and_ty>;
type constness_cache = hashmap<ast::def_id, const_eval::constness>;
type constness_cache = HashMap<ast::def_id, const_eval::constness>;
type node_type_table = @smallintmap::SmallIntMap<t>;
fn mk_rcache() -> creader_cache {
type val = {cnum: int, pos: uint, len: uint};
return map::hashmap();
return map::HashMap();
}
fn new_ty_hash<V: Copy>() -> map::hashmap<t, V> {
map::hashmap()
fn new_ty_hash<V: Copy>() -> map::HashMap<t, V> {
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<t, ()>,
tycache: map::HashMap<t, ()>,
encountered_box: bool) -> bool {
// Prevent infinite recursion
@ -2583,8 +2583,8 @@ pure fn hash_bound_region(br: &bound_region) -> uint {
}
}
fn br_hashmap<V:Copy>() -> hashmap<bound_region, V> {
map::hashmap()
fn br_hashmap<V:Copy>() -> HashMap<bound_region, V> {
map::HashMap()
}
pure fn hash_region(r: &region) -> 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<T:Copy cmp::Eq>(tbl: hashmap<ast::node_id, ast::inferable<T>>,
fn canon<T:Copy cmp::Eq>(tbl: HashMap<ast::node_id, ast::inferable<T>>,
+m0: ast::inferable<T>) -> ast::inferable<T> {
match m0 {
ast::infer(id) => match tbl.find(id) {

View File

@ -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<ast::node_id, method_map_entry>;
type method_map = HashMap<ast::node_id, method_map_entry>;
// 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<ast::node_id, vtable_res>;
type vtable_map = HashMap<ast::node_id, vtable_res>;
// 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<ast::node_id,
type provided_methods_map = HashMap<ast::node_id,
~[@resolve::MethodInfo]>;
type ty_param_substs_and_ty = {substs: ty::substs, ty: ty::t};

View File

@ -99,10 +99,10 @@ type self_info = {
/// share the inherited fields.
struct inherited {
infcx: infer::infer_ctxt,
locals: hashmap<ast::node_id, TyVid>,
node_types: hashmap<ast::node_id, ty::t>,
node_type_substs: hashmap<ast::node_id, ty::substs>,
borrowings: hashmap<ast::node_id, ty::borrow>,
locals: HashMap<ast::node_id, TyVid>,
node_types: HashMap<ast::node_id, ty::t>,
node_type_substs: HashMap<ast::node_id, ty::substs>,
borrowings: HashMap<ast::node_id, ty::borrow>,
}
struct fn_ctxt {

View File

@ -102,7 +102,7 @@ struct lookup {
mut self_ty: ty::t,
mut derefs: uint,
candidates: DVec<candidate>,
candidate_impls: hashmap<def_id, ()>,
candidate_impls: HashMap<def_id, ()>,
supplied_tps: ~[ty::t],
include_private: bool,
}

View File

@ -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<def_id,@DVec<@Impl>>,
inherent_methods: HashMap<def_id,@DVec<@Impl>>,
// Contains implementations of methods associated with a trait. For these,
// the associated trait must be imported at the call site.
extension_methods: hashmap<def_id,@DVec<@Impl>>,
extension_methods: HashMap<def_id,@DVec<@Impl>>,
}
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<def_id,def_id>,
base_type_def_ids: HashMap<def_id,def_id>,
// 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<node_id,()>,
privileged_implementations: HashMap<node_id,()>,
}
impl CoherenceChecker {
@ -645,7 +645,7 @@ impl CoherenceChecker {
// External crate handling
fn add_impls_for_module(impls_seen: hashmap<def_id,()>,
fn add_impls_for_module(impls_seen: HashMap<def_id,()>,
crate_store: cstore,
module_def_id: def_id) {

View File

@ -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};

View File

@ -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<TwoRegions, RegionVid>;
type CombineMap = HashMap<TwoRegions, RegionVid>;
struct RegionVarBindings {
tcx: ty::ctxt,
var_spans: DVec<span>,
values: Cell<~[ty::region]>,
constraints: hashmap<Constraint, span>,
constraints: HashMap<Constraint, span>,
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<TwoRegions, ()>;
type TwoRegionsMap = HashMap<TwoRegions, ()>;
fn TwoRegionsMap() -> TwoRegionsMap {
return hashmap();
return HashMap();
}
impl RegionVarBindings {

View File

@ -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; }

View File

@ -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,

View File

@ -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;

View File

@ -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;

View File

@ -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 {

View File

@ -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;

View File

@ -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<T: Copy>(req: header_map) {

View File

@ -28,7 +28,7 @@ fn timed(result: &mut float,
*result = (end - start);
}
fn int_benchmarks<M: map::map<uint, uint>>(make_map: fn() -> M,
fn int_benchmarks<M: map::Map<uint, uint>>(make_map: fn() -> M,
rng: @rand::Rng,
num_keys: uint,
results: &mut Results) {
@ -69,7 +69,7 @@ fn int_benchmarks<M: map::map<uint, uint>>(make_map: fn() -> M,
}
}
fn str_benchmarks<M: map::map<~str, uint>>(make_map: fn() -> M,
fn str_benchmarks<M: map::Map<~str, uint>>(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::<map::hashmap<uint, uint>>(
int_benchmarks::<map::HashMap<uint, uint>>(
map::uint_hash, rng, num_keys, &mut results);
str_benchmarks::<map::hashmap<~str, uint>>(
str_benchmarks::<map::HashMap<~str, uint>>(
map::str_hash, rng, num_keys, &mut results);
write_results("libstd::map::hashmap", &results);
}

View File

@ -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));

View File

@ -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::<node_id, ()>()
map::HashMap::<node_id, ()>()
};
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::<node_id, ()>();
let keys = map::HashMap::<node_id, ()>();
let r = rand::Rng();
while keys.size() < n {

View File

@ -2,7 +2,7 @@
use std;
use std::map;
use std::map::hashmap;
use std::map::HashMap;
use std::sort;
fn print_complements() {

View File

@ -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;

View File

@ -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;

View File

@ -14,7 +14,7 @@
use std;
use io::WriterUtil;
use std::map::hashmap;
use std::map::HashMap;
struct cmplx {
re: f64,

View File

@ -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;

View File

@ -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<uint, &uint> =
hashmap::<uint, &uint>();
let buggy_map :HashMap<uint, &uint> =
HashMap::<uint, &uint>();
buggy_map.insert(42, ~1); //~ ERROR illegal borrow
// but it is ok if we use a temporary

View File

@ -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<uint, var_info>};
type fn_info = {vars: HashMap<uint, var_info>};
type var_info = {a: uint, b: uint};
fn bitv_to_str(enclosing: fn_info, v: ~bitv::Bitv) -> str {

View File

@ -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<uint,~str> = x;
//~^ ERROR mismatched types: expected `@std::map::map<uint,~str>`
let x: Map<~str,~str> = map::str_hash::<~str>() as Map::<~str,~str>;
let y: Map<uint,~str> = x;
//~^ ERROR mismatched types: expected `@std::map::Map<uint,~str>`
}

View File

@ -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"];

View File

@ -40,7 +40,7 @@ impl<T: Copy> cat<T> {
}
}
impl<T: Copy> cat<T> : map<int, T> {
impl<T: Copy> cat<T> : Map<int, T> {
pure fn size() -> uint { self.meows as uint }
fn insert(+k: int, +_v: T) -> bool {
self.meows += k;

View File

@ -1,5 +1,5 @@
extern mod std;
use std::map::hashmap;
use std::map::HashMap;
fn main() {
io::println("Hello world!");

View File

@ -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<ctrl_proto>, input: ~str) {
let intermediates = map::str_hash();
fn emit(im: map::hashmap<~str, int>, ctrl: Chan<ctrl_proto>, key: ~str,
fn emit(im: map::HashMap<~str, int>, ctrl: Chan<ctrl_proto>, 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();

View File

@ -1,6 +1,6 @@
use std;
use std::map;
use std::map::hashmap;
use std::map::HashMap;
fn main() {
let m = map::bytes_hash();

View File

@ -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"]);
}

View File

@ -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"]
{