rename map -> oldmap and mark it as deprecated

LinearMap is quite a bit faster, and is fully owned/sendable without
requiring copies. The older std::map also doesn't use explicit self and
relies on mutable fields.
This commit is contained in:
Daniel Micay 2013-02-01 02:13:36 -05:00
parent df31373406
commit 319eeb1c79
96 changed files with 230 additions and 231 deletions

View File

@ -448,10 +448,10 @@ expression context, the final namespace qualifier is omitted.
Two examples of paths with type arguments:
~~~~
# use std::map;
# use std::oldmap;
# 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 = oldmap::HashMap<int,~str>; // Type arguments used in a type expression
let x = id::<int>(10); // Type arguments used in a call expression
# }
~~~~

View File

@ -1791,7 +1791,7 @@ illegal to copy and pass by value.
Generic `type`, `struct`, and `enum` declarations follow the same pattern:
~~~~
# use std::map::HashMap;
# use std::oldmap::HashMap;
type Set<T> = HashMap<T, ()>;
struct Stack<T> {

View File

@ -53,8 +53,8 @@ use core::io::WriterUtil;
use core::result::{Ok, Err};
use core::hashmap::linear::LinearMap;
use std::getopts::{optflag, optopt, opt_present};
use std::map::HashMap;
use std::{map, json, tempfile, term, sort, getopts};
use std::oldmap::HashMap;
use std::{oldmap, json, tempfile, term, sort, getopts};
use syntax::codemap::span;
use syntax::diagnostic::span_handler;
use syntax::diagnostic;
@ -110,9 +110,9 @@ pub struct Cargo {
libdir: Path,
workdir: Path,
sourcedir: Path,
sources: map::HashMap<~str, @Source>,
sources: oldmap::HashMap<~str, @Source>,
mut current_install: ~str,
dep_cache: map::HashMap<~str, bool>,
dep_cache: oldmap::HashMap<~str, bool>,
opts: Options
}
@ -490,7 +490,7 @@ pub fn parse_source(name: ~str, j: &json::Json) -> @Source {
}
pub fn try_parse_sources(filename: &Path,
sources: map::HashMap<~str, @Source>) {
sources: oldmap::HashMap<~str, @Source>) {
if !os::path_exists(filename) { return; }
let c = io::read_whole_file_str(filename);
match json::from_str(c.get()) {

View File

@ -36,7 +36,7 @@ use core::ptr;
use core::run;
use core::str;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
use std::sha1::sha1;
use syntax::ast;
use syntax::ast_map::{path, path_mod, path_name};

View File

@ -18,8 +18,8 @@ use core::os;
use core::uint;
use core::util;
use core::vec;
use std::map::HashMap;
use std::map;
use std::oldmap::HashMap;
use std::oldmap;
pure fn not_win32(os: session::os) -> bool {
match os {
@ -187,7 +187,7 @@ pub fn get_install_prefix_rpath(target_triple: &str) -> Path {
}
pub fn minimize_rpaths(rpaths: &[Path]) -> ~[Path] {
let set = map::HashMap();
let set = oldmap::HashMap();
let mut minimized = ~[];
for rpaths.each |rpath| {
let s = rpath.to_str();

View File

@ -35,7 +35,7 @@ use std::getopts::groups::{optopt, optmulti, optflag, optflagopt, getopts};
use std::getopts::groups;
use std::getopts::{opt_present};
use std::getopts;
use std::map::HashMap;
use std::oldmap::HashMap;
use std;
use syntax::ast;
use syntax::ast_map;

View File

@ -20,7 +20,7 @@ use core::ptr;
use core::str;
use core::uint;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
pub type Opcode = u32;
pub type Bool = c_uint;

View File

@ -30,7 +30,7 @@ use syntax::parse::token::ident_interner;
use syntax::print::pprust;
use syntax::visit;
use syntax::{ast, ast_util};
use std::map::HashMap;
use std::oldmap::HashMap;
// Traverses an AST, reading all the information about use'd crates and extern
// libraries necessary for later resolving, typechecking, linking, etc.

View File

@ -23,7 +23,7 @@ use core::dvec::DVec;
use core::vec;
use reader = std::ebml::reader;
use std::ebml;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast;
use syntax::ast_map;
use syntax::codemap::dummy_sp;

View File

@ -21,8 +21,8 @@ use metadata::decoder;
use core::option;
use core::str;
use core::vec;
use std::map::HashMap;
use std::map;
use std::oldmap::HashMap;
use std::oldmap;
use std;
use syntax::{ast, attr};
use syntax::parse::token::ident_interner;
@ -31,7 +31,7 @@ use syntax::parse::token::ident_interner;
// 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.
pub type cnum_map = map::HashMap<ast::crate_num, ast::crate_num>;
pub type cnum_map = oldmap::HashMap<ast::crate_num, ast::crate_num>;
pub type crate_metadata = @{name: ~str,
data: @~[u8],
@ -46,7 +46,7 @@ pub type crate_metadata = @{name: ~str,
pub enum CStore { private(cstore_private), }
type cstore_private =
@{metas: map::HashMap<ast::crate_num, crate_metadata>,
@{metas: oldmap::HashMap<ast::crate_num, crate_metadata>,
use_crate_map: use_crate_map,
mut used_crate_files: ~[Path],
mut used_libraries: ~[~str],
@ -54,7 +54,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 = oldmap::HashMap<ast::node_id, ast::crate_num>;
// Internal method to retrieve the data from the cstore
pure fn p(cstore: CStore) -> cstore_private {
@ -62,8 +62,8 @@ pure fn p(cstore: CStore) -> cstore_private {
}
pub fn mk_cstore(intr: @ident_interner) -> CStore {
let meta_cache = map::HashMap();
let crate_map = map::HashMap();
let meta_cache = oldmap::HashMap();
let crate_map = oldmap::HashMap();
return private(@{metas: meta_cache,
use_crate_map: crate_map,
mut used_crate_files: ~[],

View File

@ -36,8 +36,8 @@ use core::str;
use core::vec;
use std::ebml::reader;
use std::ebml;
use std::map::HashMap;
use std::map;
use std::oldmap::HashMap;
use std::oldmap;
use std::serialize::Decodable;
use syntax::ast_map;
use syntax::attr;

View File

@ -36,9 +36,9 @@ use core::str;
use core::to_bytes::IterBytes;
use core::uint;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
use std::serialize::Encodable;
use std::{ebml, map};
use std::{ebml, oldmap};
use std;
use syntax::ast::*;
use syntax::ast;
@ -52,7 +52,7 @@ use syntax;
use writer = std::ebml::writer;
// used by astencode:
type abbrev_map = map::HashMap<ty::t, tyencode::ty_abbrev>;
type abbrev_map = oldmap::HashMap<ty::t, tyencode::ty_abbrev>;
pub type encode_inlined_item = fn@(ecx: @encode_ctxt,
ebml_w: writer::Encoder,

View File

@ -27,7 +27,7 @@ use core::vec;
use syntax::ast;
use syntax::ast::*;
use syntax::codemap::{respan, dummy_sp};
use std::map::HashMap;
use std::oldmap::HashMap;
// Compact string representation for ty::t values. API ty_str &
// parse_from_str. Extra parameters are for converting to/from def_ids in the

View File

@ -20,7 +20,7 @@ use core::io::WriterUtil;
use core::io;
use core::uint;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast::*;
use syntax::diagnostic::span_handler;
use syntax::print::pprust::*;

View File

@ -31,7 +31,7 @@ use std::ebml::reader::get_doc;
use std::ebml::reader;
use std::ebml::writer::Encoder;
use std::ebml;
use std::map::HashMap;
use std::oldmap::HashMap;
use std::prettyprint;
use std::serialize;
use std::serialize::{Encodable, EncoderHelpers, DecoderHelpers};

View File

@ -35,7 +35,7 @@ use core::cmp;
use core::dvec::DVec;
use core::uint;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast::{m_const, m_imm, m_mutbl};
use syntax::ast;
use syntax::ast_util;

View File

@ -33,7 +33,7 @@ use util::ppaux::{expr_repr, region_to_str};
use core::dvec;
use core::hashmap::linear::LinearSet;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast::{m_const, m_imm, m_mutbl};
use syntax::ast;
use syntax::codemap::span;

View File

@ -241,7 +241,7 @@ use core::io;
use core::result::{Result, Ok, Err};
use std::list::{List, Cons, Nil};
use std::list;
use std::map::{HashMap, Set};
use std::oldmap::{HashMap, Set};
use syntax::ast::{mutability, m_mutbl, m_imm, m_const};
use syntax::ast;
use syntax::ast_map;

View File

@ -18,7 +18,7 @@ use util::ppaux;
use core::dvec::DVec;
use core::option;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast::*;
use syntax::codemap;
use syntax::{visit, ast_util, ast_map};

View File

@ -23,7 +23,7 @@ use core::cmp;
use core::option;
use core::uint;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
use std::sort;
use syntax::ast::*;
use syntax::ast_util::{variant_def_ids, unguarded_pat, walk_pat};

View File

@ -18,7 +18,7 @@ use middle::ty;
use core::int;
use core::option::*;
use core::vec;
use std::map::*;
use std::oldmap::*;
use syntax::codemap::span;
use syntax::print::pprust::path_to_str;
use syntax::{ast, ast_util, visit};

View File

@ -24,7 +24,7 @@ use util::ppaux::{ty_to_str, tys_to_str};
use core::option;
use core::str;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast::*;
use syntax::codemap::{span, spanned};
use syntax::print::pprust::expr_to_str;

View File

@ -33,7 +33,7 @@ use syntax::visit::{default_simple_visitor, mk_simple_visitor, SimpleVisitor};
use syntax::visit::{visit_crate, visit_item};
use core::ptr;
use std::map::HashMap;
use std::oldmap::HashMap;
use str_eq = str::eq;
pub enum LangItem {

View File

@ -32,8 +32,8 @@ use core::u32;
use core::u64;
use core::uint;
use core::vec;
use std::map::{Map, HashMap};
use std::map;
use std::oldmap::{Map, HashMap};
use std::oldmap;
use std::oldsmallintmap::{Map, SmallIntMap};
use std::oldsmallintmap;
use syntax::ast_util::{path_to_ident};
@ -233,7 +233,7 @@ pub fn get_lint_dict() -> lint_dict {
default: warn}),
*/
];
map::hash_from_vec(v)
oldmap::hash_from_vec(v)
}
// This is a highly not-optimal set of data structure decisions.

View File

@ -119,7 +119,7 @@ use core::ptr;
use core::to_str;
use core::uint;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast::*;
use syntax::codemap::span;
use syntax::parse::token::special_idents;

View File

@ -217,7 +217,7 @@ use util::ppaux;
use util::common::indenter;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast::*;
use syntax::ast_util;
use syntax::visit;

View File

@ -18,7 +18,7 @@ use syntax::ast_util::{path_to_ident, walk_pat};
use syntax::fold;
use syntax::fold::*;
use syntax::codemap::{span, respan};
use std::map::HashMap;
use std::oldmap::HashMap;
pub type PatIdMap = HashMap<ident, node_id>;

View File

@ -32,7 +32,7 @@ use core::dvec::DVec;
use core::vec;
use std::list;
use std::list::list;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast_map;
use syntax::codemap::span;
use syntax::print::pprust;

View File

@ -79,7 +79,7 @@ use str::{connect, split_str};
use vec::pop;
use std::list::{Cons, List, Nil};
use std::map::HashMap;
use std::oldmap::HashMap;
use str_eq = str::eq;
// Definition mapping

View File

@ -164,7 +164,7 @@ use util::common::indenter;
use core::dvec::DVec;
use core::dvec;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast::def_id;
use syntax::ast;
use syntax::ast_util::{dummy_sp, path_to_ident};

View File

@ -75,9 +75,9 @@ use core::libc::{c_uint, c_ulonglong};
use core::option::{is_none, is_some};
use core::option;
use core::uint;
use std::map::HashMap;
use std::oldmap::HashMap;
use std::oldsmallintmap;
use std::{map, time, list};
use std::{oldmap, time, list};
use syntax::ast_map::{path, path_elt_to_str, path_mod, path_name};
use syntax::ast_util::{def_id_of_def, local_def, path_to_ident};
use syntax::attr;
@ -3016,7 +3016,7 @@ pub fn trans_crate(sess: session::Session,
monomorphized: HashMap(),
monomorphizing: HashMap(),
type_use_cache: HashMap(),
vtables: map::HashMap(),
vtables: oldmap::HashMap(),
const_cstr_cache: HashMap(),
const_globals: HashMap(),
const_values: HashMap(),

View File

@ -22,7 +22,7 @@ use core::cast;
use core::libc;
use core::str;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::codemap;
pub fn terminate(cx: block, _: &str) {

View File

@ -28,7 +28,7 @@ use middle::trans::type_of::*;
use util::ppaux::ty_to_str;
use core::libc::c_uint;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast;
use syntax::ast_map::{path, path_mod, path_name};
use syntax::ast_util;

View File

@ -53,7 +53,7 @@ use core::str;
use core::to_bytes;
use core::vec::raw::to_ptr;
use core::vec;
use std::map::{HashMap, Set};
use std::oldmap::{HashMap, Set};
use syntax::ast::ident;
use syntax::ast_map::path;
use syntax::codemap::span;

View File

@ -26,8 +26,8 @@ use util::ppaux::ty_to_str;
use core::libc;
use core::option;
use core::sys;
use std::map::HashMap;
use std::map;
use std::oldmap::HashMap;
use std::oldmap;
use syntax::ast::Ty;
use syntax::codemap::{span, CharPos};
use syntax::parse::token::ident_interner;
@ -111,7 +111,7 @@ pub type debug_ctxt = {
};
pub fn mk_ctxt(+crate: ~str, intr: @ident_interner) -> debug_ctxt {
{llmetadata: map::HashMap(),
{llmetadata: oldmap::HashMap(),
names: new_namegen(intr),
crate_file: crate}
}

View File

@ -33,7 +33,7 @@ use middle::typeck;
use util::ppaux::{ty_to_str, tys_to_str};
use core::libc::c_uint;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast_map::{path, path_mod, path_name, node_id_to_str};
use syntax::ast_util::local_def;
use syntax::print::pprust::expr_to_str;

View File

@ -22,7 +22,7 @@ use middle::ty;
use middle::typeck;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast::*;
use syntax::ast_util::def_id_of_def;
use syntax::attr;

View File

@ -24,7 +24,7 @@ use middle::trans::meth;
use middle::trans::type_of::*;
use util::ppaux::ty_to_str;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast::def_id;
use syntax::ast;

View File

@ -26,7 +26,7 @@ use util::ppaux::ty_to_str;
use core::dvec::DVec;
use core::option::is_some;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast;
use syntax::codemap::dummy_sp;
use syntax::codemap::span;

View File

@ -17,7 +17,7 @@ use middle::trans::expr;
use middle::trans::machine;
use util::ppaux;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast;
pub fn type_of_explicit_arg(ccx: @crate_ctxt, arg: ty::arg) -> TypeRef {

View File

@ -38,7 +38,7 @@ use core::uint;
use core::vec;
use std::list::{List, Cons, Nil};
use std::list;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast::*;
use syntax::ast_map;
use syntax::ast_util;

View File

@ -41,8 +41,8 @@ use core::result;
use core::to_bytes;
use core::uint;
use core::vec;
use std::map::HashMap;
use std::{map, oldsmallintmap};
use std::oldmap::HashMap;
use std::{oldmap, oldsmallintmap};
use syntax::ast::*;
use syntax::ast_util::{is_local, local_def};
use syntax::ast_util;
@ -790,11 +790,11 @@ pub type node_type_table = @oldsmallintmap::SmallIntMap<t>;
fn mk_rcache() -> creader_cache {
type val = {cnum: int, pos: uint, len: uint};
return map::HashMap();
return oldmap::HashMap();
}
pub fn new_ty_hash<V: Copy>() -> map::HashMap<t, V> {
map::HashMap()
pub fn new_ty_hash<V: Copy>() -> oldmap::HashMap<t, V> {
oldmap::HashMap()
}
pub fn mk_ctxt(s: session::Session,
@ -822,7 +822,7 @@ pub fn mk_ctxt(s: session::Session,
}
}
let interner = map::HashMap();
let interner = oldmap::HashMap();
let vecs_implicitly_copyable =
get_lint_level(s.lint_settings.default_settings,
lint::vecs_implicitly_copyable) == allow;
@ -839,9 +839,9 @@ pub fn mk_ctxt(s: session::Session,
region_map: region_map,
region_paramd_items: region_paramd_items,
node_types: @oldsmallintmap::mk(),
node_type_substs: map::HashMap(),
node_type_substs: oldmap::HashMap(),
items: amap,
intrinsic_defs: map::HashMap(),
intrinsic_defs: oldmap::HashMap(),
freevars: freevars,
tcache: HashMap(),
rcache: mk_rcache(),
@ -1745,7 +1745,7 @@ pub fn type_needs_unwind_cleanup(cx: ctxt, ty: t) -> bool {
}
fn type_needs_unwind_cleanup_(cx: ctxt, ty: t,
tycache: map::HashMap<t, ()>,
tycache: oldmap::HashMap<t, ()>,
encountered_box: bool) -> bool {
// Prevent infinite recursion
@ -2795,7 +2795,7 @@ impl sty : to_bytes::IterBytes {
}
pub fn br_hashmap<V:Copy>() -> HashMap<bound_region, V> {
map::HashMap()
oldmap::HashMap()
}
pub fn node_id_to_type(cx: ctxt, id: ast::node_id) -> t {

View File

@ -20,7 +20,7 @@ use middle::typeck::check::{structure_of, valid_range_bounds};
use middle::typeck::require_same_types;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast;
use syntax::ast_util::walk_pat;
use syntax::ast_util;

View File

@ -101,7 +101,7 @@ use core::dvec::DVec;
use core::result;
use core::uint;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast::{def_id, sty_by_ref, sty_value, sty_region, sty_box};
use syntax::ast::{sty_uniq, sty_static, node_id, by_copy, by_ref};
use syntax::ast::{m_const, m_mutbl, m_imm};

View File

@ -115,8 +115,8 @@ use core::result;
use core::str;
use core::vec;
use std::list::Nil;
use std::map::HashMap;
use std::map;
use std::oldmap::HashMap;
use std::oldmap;
use syntax::ast::{provided, required, ty_i};
use syntax::ast;
use syntax::ast_map;
@ -209,9 +209,9 @@ pub fn blank_inherited(ccx: @crate_ctxt) -> @inherited {
@inherited {
infcx: infer::new_infer_ctxt(ccx.tcx),
locals: HashMap(),
node_types: map::HashMap(),
node_type_substs: map::HashMap(),
adjustments: map::HashMap()
node_types: oldmap::HashMap(),
node_type_substs: oldmap::HashMap(),
adjustments: oldmap::HashMap()
}
}

View File

@ -28,7 +28,7 @@ use core::result;
use core::uint;
use core::vec;
use result::{Result, Ok, Err};
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast;
use syntax::ast_util;
use syntax::codemap::span;

View File

@ -28,7 +28,7 @@ use util::ppaux;
use core::result::{Result, Ok, Err};
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast;
use syntax::codemap::span;
use syntax::print::pprust::pat_to_str;

View File

@ -63,7 +63,7 @@ use core::uint::range;
use core::uint;
use core::vec::{len, push};
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
pub struct UniversalQuantificationResult {
monotype: t,

View File

@ -280,7 +280,7 @@ use core::result::{Result, Ok, Err, map_vec, map_vec2, iter_vec2};
use core::result;
use core::vec;
use std::list::Nil;
use std::map::HashMap;
use std::oldmap::HashMap;
use std::oldsmallintmap;
use syntax::ast::{ret_style, purity};
use syntax::ast::{m_const, m_imm, m_mutbl};

View File

@ -559,7 +559,7 @@ use core::uint;
use core::vec;
use result::Result;
use result::{Ok, Err};
use std::map::HashMap;
use std::oldmap::HashMap;
use std::cell::{Cell, empty_cell};
use std::list::{List, Nil, Cons};
use syntax::codemap::span;

View File

@ -30,7 +30,7 @@ use std::getopts::groups;
use std::getopts::{opt_present};
use std::getopts;
use std::getopts;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::codemap::dummy_sp;
use syntax::parse::parse_crate_from_source_str;
use syntax::{ast, attr, parse};

View File

@ -67,8 +67,8 @@ use core::result;
use core::vec;
use std::list::{List, Nil, Cons};
use std::list;
use std::map::HashMap;
use std::map;
use std::oldmap::HashMap;
use std::oldmap;
use std::oldsmallintmap;
use syntax::ast::{provided, required};
use syntax::ast_map::node_id_to_str;
@ -377,8 +377,8 @@ pub fn check_crate(tcx: ty::ctxt,
let ccx = @crate_ctxt_(crate_ctxt__ {
trait_map: trait_map,
method_map: map::HashMap(),
vtable_map: map::HashMap(),
method_map: oldmap::HashMap(),
vtable_map: oldmap::HashMap(),
coherence_info: @coherence::CoherenceInfo(),
tcx: tcx
});

View File

@ -136,7 +136,7 @@ pub mod lib {
use result::{Ok, Err};
use io::ReaderUtil;
use std::getopts;
use std::map::HashMap;
use std::oldmap::HashMap;
use getopts::{opt_present};
use getopts::groups;
use syntax::codemap;

View File

@ -19,7 +19,7 @@ use syntax;
use core::option;
use core::str;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
pub fn indent<R>(op: fn() -> R) -> R {
// Use in conjunction with the log post-processor like `src/etc/indenter`

View File

@ -36,7 +36,7 @@ use syntax::ast_map;
use core::str;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
pub fn note_and_explain_region(cx: ctxt,
prefix: ~str,

View File

@ -32,7 +32,7 @@ use rustc::driver::session::{basic_options, options};
use rustc::driver::session;
use rustc::front;
use rustc::metadata::filesearch;
use std::map::HashMap;
use std::oldmap::HashMap;
use syntax::ast;
use syntax::ast_map;
use syntax::codemap;

View File

@ -31,7 +31,7 @@ use core::option;
use core::vec;
use syntax::ast;
use syntax::ast_map;
use std::map::HashMap;
use std::oldmap::HashMap;
use std::par;
pub fn mk_pass() -> Pass {

View File

@ -19,7 +19,7 @@ use fold;
use pass::Pass;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
pub fn mk_pass() -> Pass {
Pass {

View File

@ -22,7 +22,7 @@ use fold;
use pass::Pass;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
use std::par;
use syntax::ast;
use syntax::print::pprust;

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! A map type
//! A map type - **deprecated**, use `core::hashmap` instead
#[forbid(deprecated_mode)];
use core::cmp::Eq;
@ -46,7 +46,7 @@ pub 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.
pub mod chained {
use map::util;
use super::util;
use core::io;
use core::ops;
@ -431,20 +431,20 @@ pub fn hash_from_vec<K: Eq IterBytes Hash Const Copy, V: Copy>(
#[cfg(test)]
mod tests {
use map;
use core::option::None;
use core::option;
use core::uint;
use super::*;
#[test]
fn test_simple() {
debug!("*** starting test_simple");
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: HashMap<uint, uint> =
HashMap::<uint, uint>();
assert (hm_uu.insert(10u, 12u));
assert (hm_uu.insert(11u, 13u));
assert (hm_uu.insert(12u, 14u));
@ -459,8 +459,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: HashMap<~str, uint> =
HashMap::<~str, uint>();
assert (hm_su.insert(~"ten", 12u));
assert (hm_su.insert(eleven, 13u));
assert (hm_su.insert(~"twelve", 14u));
@ -473,8 +473,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: HashMap<uint, ~str> =
HashMap::<uint, ~str>();
assert (hm_us.insert(10u, ~"twelve"));
assert (hm_us.insert(11u, ~"thirteen"));
assert (hm_us.insert(12u, ~"fourteen"));
@ -486,8 +486,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: HashMap<~str, ~str> =
HashMap::<~str, ~str>();
assert (hm_ss.insert(ten, ~"twelve"));
assert (hm_ss.insert(eleven, ~"thirteen"));
assert (hm_ss.insert(twelve, ~"fourteen"));
@ -512,8 +512,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: HashMap<uint, uint> =
HashMap::<uint, uint>();
let mut i: uint = 0u;
while i < num_to_insert {
assert (hm_uu.insert(i, i * i));
@ -537,8 +537,8 @@ mod tests {
i += 1u;
}
debug!("str -> str");
let hm_ss: map::HashMap<~str, ~str> =
map::HashMap::<~str, ~str>();
let hm_ss: HashMap<~str, ~str> =
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));
@ -576,8 +576,8 @@ mod tests {
fn test_removal() {
debug!("*** starting test_removal");
let num_to_insert: uint = 64u;
let hm: map::HashMap<uint, uint> =
map::HashMap::<uint, uint>();
let hm: HashMap<uint, uint> =
HashMap::<uint, uint>();
let mut i: uint = 0u;
while i < num_to_insert {
assert (hm.insert(i, i * i));
@ -637,7 +637,7 @@ mod tests {
#[test]
fn test_contains_key() {
let key = ~"k";
let map = map::HashMap::<~str, ~str>();
let map = HashMap::<~str, ~str>();
assert (!map.contains_key(key));
map.insert(key, ~"val");
assert (map.contains_key(key));
@ -646,7 +646,7 @@ mod tests {
#[test]
fn test_find() {
let key = ~"k";
let map = map::HashMap::<~str, ~str>();
let map = HashMap::<~str, ~str>();
assert (option::is_none(&map.find(key)));
map.insert(key, ~"val");
assert (option::get(map.find(key)) == ~"val");
@ -655,7 +655,7 @@ mod tests {
#[test]
fn test_clear() {
let key = ~"k";
let map = map::HashMap::<~str, ~str>();
let map = HashMap::<~str, ~str>();
map.insert(key, ~"val");
assert (map.size() == 1);
assert (map.contains_key(key));
@ -666,7 +666,7 @@ mod tests {
#[test]
fn test_hash_from_vec() {
let map = map::hash_from_vec(~[
let map = hash_from_vec(~[
(~"a", 1),
(~"b", 2),
(~"c", 3)
@ -679,7 +679,7 @@ mod tests {
#[test]
fn test_update_with_key() {
let map = map::HashMap::<~str, uint>();
let map = HashMap::<~str, uint>();
// given a new key, initialize it with this new count, given
// given an existing key, add more to its count

View File

@ -79,7 +79,7 @@ pub mod bitv;
pub mod deque;
pub mod fun_treemap;
pub mod list;
pub mod map;
pub mod oldmap;
pub mod priority_queue;
pub mod rope;
pub mod smallintmap;

View File

@ -25,8 +25,8 @@ use core::cmp;
use core::either;
use core::str;
use core::vec;
use std::map::HashMap;
use std::map;
use std::oldmap::HashMap;
use std::oldmap;
use std;
pub enum path_elt {
@ -106,7 +106,7 @@ pub enum ast_node {
node_struct_ctor(@struct_def, @item, @path),
}
pub type map = std::map::HashMap<node_id, ast_node>;
pub type map = std::oldmap::HashMap<node_id, ast_node>;
pub struct ctx {
map: map,
mut path: path,
@ -134,7 +134,7 @@ pub fn mk_ast_map_visitor() -> vt {
pub fn map_crate(diag: span_handler, c: crate) -> map {
let cx = ctx {
map: std::map::HashMap(),
map: std::oldmap::HashMap(),
mut path: ~[],
mut local_id: 0u,
diag: diag,

View File

@ -24,8 +24,8 @@ use core::either::Either;
use core::either;
use core::option;
use core::vec;
use std::map::HashMap;
use std::map;
use std::oldmap::HashMap;
use std::oldmap;
use std;
/* Constructors */
@ -358,7 +358,7 @@ pub fn find_inline_attr(attrs: &[ast::attribute]) -> inline_attr {
pub fn require_unique_names(diagnostic: span_handler,
metas: &[@ast::meta_item]) {
let map = map::HashMap();
let map = oldmap::HashMap();
for metas.each |meta| {
let name = get_meta_item_name(*meta);

View File

@ -98,8 +98,8 @@ use ext::base::*;
use parse;
use core::vec;
use std::map;
use std::map::HashMap;
use std::oldmap;
use std::oldmap::HashMap;
// Transitional reexports so qquote can find the paths it is looking for
mod syntax {

View File

@ -20,7 +20,7 @@ use parse::{parser, token};
use core::io;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
// new-style macro! tt code:
//

View File

@ -20,7 +20,7 @@ use parse::{parser, parse_expr_from_source_str, new_parser_from_tts};
use core::option;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
pub fn expand_expr(exts: HashMap<~str, SyntaxExtension>, cx: ext_ctxt,
e: expr_, s: span, fld: ast_fold,

View File

@ -26,7 +26,7 @@ use core::option;
use core::str;
use core::uint;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
/* 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

View File

@ -26,7 +26,7 @@ use parse::token::{FAT_ARROW, SEMI, LBRACE, RBRACE, nt_matchers, nt_tt};
use print;
use core::io;
use std::map::HashMap;
use std::oldmap::HashMap;
pub fn add_new_extension(cx: ext_ctxt, sp: span, name: ident,
arg: ~[ast::token_tree]) -> base::MacResult {

View File

@ -22,7 +22,7 @@ use parse::lexer::TokenAndSpan;
use core::option;
use core::vec;
use std;
use std::map::HashMap;
use std::oldmap::HashMap;
enum tt_frame_up { /* to break a circularity */
tt_frame_up(Option<tt_frame>)
@ -44,7 +44,7 @@ pub type tt_reader = @{
interner: @ident_interner,
mut cur: tt_frame,
/* for MBE-style macro transcription */
interpolations: std::map::HashMap<ident, @named_match>,
interpolations: std::oldmap::HashMap<ident, @named_match>,
mut repeat_idx: ~[uint],
mut repeat_len: ~[uint],
/* cached: */
@ -56,14 +56,14 @@ pub type tt_reader = @{
* `src` contains no `tt_seq`s and `tt_nonterminal`s, `interp` can (and
* should) be none. */
pub fn new_tt_reader(sp_diag: span_handler, itr: @ident_interner,
interp: Option<std::map::HashMap<ident,@named_match>>,
interp: Option<std::oldmap::HashMap<ident,@named_match>>,
src: ~[ast::token_tree])
-> tt_reader {
let r = @{sp_diag: sp_diag, interner: itr,
mut cur: @{readme: src, mut idx: 0u, dotdotdoted: false,
sep: None, up: tt_frame_up(option::None)},
interpolations: match interp { /* just a convienience */
None => std::map::HashMap(),
None => std::oldmap::HashMap(),
Some(x) => x
},
mut repeat_idx: ~[],

View File

@ -18,7 +18,7 @@ use parse::token;
use core::option::{None, Option, Some};
use core::option;
use std::map::HashMap;
use std::oldmap::HashMap;
pub type seq_sep = {
sep: Option<token::Token>,

View File

@ -87,7 +87,7 @@ use core::either;
use core::result::Result;
use core::vec::push;
use core::vec;
use std::map::HashMap;
use std::oldmap::HashMap;
#[deriving_eq]
enum restriction {

View File

@ -21,7 +21,7 @@ use core::char;
use core::cmp;
use core::str;
use core::task;
use std::map::HashMap;
use std::oldmap::HashMap;
#[auto_encode]
#[auto_decode]

View File

@ -15,13 +15,13 @@
use core::prelude::*;
use core::dvec::DVec;
use std::map::HashMap;
use std::map;
use std::oldmap::HashMap;
use std::oldmap;
pub type hash_interner<T> = {map: HashMap<T, uint>, vect: DVec<T>};
pub fn mk<T:Eq IterBytes Hash Const Copy>() -> Interner<T> {
let m = map::HashMap::<T, uint>();
let m = oldmap::HashMap::<T, uint>();
let hi: hash_interner<T> =
{map: m, vect: DVec()};
move ((move hi) as Interner::<T>)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -22,7 +22,7 @@
extern mod std;
use io::WriterUtil;
use std::map::HashMap;
use std::oldmap::HashMap;
struct cmplx {
re: f64,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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