Skip to content

Commit e021fc1

Browse files
committed
---
yaml --- r: 103547 b: refs/heads/auto c: 42389b7 h: refs/heads/master i: 103545: 4095ce4 103543: 18a4f15 v: v3
1 parent 3ada8c8 commit e021fc1

File tree

34 files changed

+226
-425
lines changed

34 files changed

+226
-425
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 5862c0c28b7d25f1a1f8fd9165eff1f6f3d191d8
16+
refs/heads/auto: 42389b7069a21679d6b92229d825b860121125d9
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libcollections/hashmap.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -358,13 +358,13 @@ impl<K: Hash + Eq, V> HashMap<K, V> {
358358
pub fn with_capacity(capacity: uint) -> HashMap<K, V> {
359359
let mut r = rand::task_rng();
360360
let hasher = SipHasher::new_with_keys(r.gen(), r.gen());
361-
HashMap::with_capacity_and_hasher(hasher, capacity)
361+
HashMap::with_capacity_and_hasher(capacity, hasher)
362362
}
363363
}
364364

365365
impl<K: Hash<S> + Eq, V, S, H: Hasher<S>> HashMap<K, V, H> {
366366
pub fn with_hasher(hasher: H) -> HashMap<K, V, H> {
367-
HashMap::with_capacity_and_hasher(hasher, INITIAL_CAPACITY)
367+
HashMap::with_capacity_and_hasher(INITIAL_CAPACITY, hasher)
368368
}
369369

370370
/// Create an empty HashMap with space for at least `capacity`
@@ -374,7 +374,7 @@ impl<K: Hash<S> + Eq, V, S, H: Hasher<S>> HashMap<K, V, H> {
374374
/// is designed to allow HashMaps to be resistant to attacks that
375375
/// cause many collisions and very poor performance. Setting it
376376
/// manually using this function can expose a DoS attack vector.
377-
pub fn with_capacity_and_hasher(hasher: H, capacity: uint) -> HashMap<K, V, H> {
377+
pub fn with_capacity_and_hasher(capacity: uint, hasher: H) -> HashMap<K, V, H> {
378378
let cap = max(INITIAL_CAPACITY, capacity);
379379
HashMap {
380380
hasher: hasher,
@@ -587,7 +587,8 @@ impl<K: Hash<S> + Eq, V: Eq, S, H: Hasher<S>> Eq for HashMap<K, V, H> {
587587

588588
impl<K: Hash<S> + Eq + Clone, V:Clone, S, H: Hasher<S> + Clone> Clone for HashMap<K, V, H> {
589589
fn clone(&self) -> HashMap<K, V, H> {
590-
let mut new_map = HashMap::with_capacity_and_hasher(self.hasher.clone(), self.len());
590+
let mut new_map = HashMap::with_capacity_and_hasher(self.len(),
591+
self.hasher.clone());
591592
for (key, value) in self.iter() {
592593
new_map.insert((*key).clone(), (*value).clone());
593594
}
@@ -714,7 +715,7 @@ impl<K> Iterator<K> for SetMoveItems<K> {
714715
impl<K: Hash<S> + Eq, V, S, H: Hasher<S> + Default> FromIterator<(K, V)> for HashMap<K, V, H> {
715716
fn from_iterator<T: Iterator<(K, V)>>(iter: &mut T) -> HashMap<K, V, H> {
716717
let (lower, _) = iter.size_hint();
717-
let mut map = HashMap::with_capacity_and_hasher(Default::default(), lower);
718+
let mut map = HashMap::with_capacity_and_hasher(lower, Default::default());
718719
map.extend(iter);
719720
map
720721
}
@@ -730,7 +731,7 @@ impl<K: Hash<S> + Eq, V, S, H: Hasher<S> + Default> Extendable<(K, V)> for HashM
730731

731732
impl<K: Hash<S> + Eq, V, S, H: Hasher<S> + Default> Default for HashMap<K, V, H> {
732733
fn default() -> HashMap<K, V, H> {
733-
HashMap::with_capacity_and_hasher(Default::default(), INITIAL_CAPACITY)
734+
HashMap::with_capacity_and_hasher(INITIAL_CAPACITY, Default::default())
734735
}
735736
}
736737

@@ -802,7 +803,7 @@ impl<T: Hash<SipState> + Eq> HashSet<T, SipHasher> {
802803

803804
impl<T: Hash<S> + Eq, S, H: Hasher<S>> HashSet<T, H> {
804805
pub fn with_hasher(hasher: H) -> HashSet<T, H> {
805-
HashSet::with_capacity_and_hasher(hasher, INITIAL_CAPACITY)
806+
HashSet::with_capacity_and_hasher(INITIAL_CAPACITY, hasher)
806807
}
807808

808809
/// Create an empty HashSet with space for at least `capacity`
@@ -812,9 +813,9 @@ impl<T: Hash<S> + Eq, S, H: Hasher<S>> HashSet<T, H> {
812813
/// are designed to allow HashSets to be resistant to attacks that
813814
/// cause many collisions and very poor performance. Setting them
814815
/// manually using this function can expose a DoS attack vector.
815-
pub fn with_capacity_and_hasher(hasher: H, capacity: uint) -> HashSet<T, H> {
816+
pub fn with_capacity_and_hasher(capacity: uint, hasher: H) -> HashSet<T, H> {
816817
HashSet {
817-
map: HashMap::with_capacity_and_hasher(hasher, capacity)
818+
map: HashMap::with_capacity_and_hasher(capacity, hasher)
818819
}
819820
}
820821

@@ -902,7 +903,7 @@ impl<T: fmt::Show + Hash<S> + Eq, S, H: Hasher<S>> fmt::Show for HashSet<T, H> {
902903
impl<T: Hash<S> + Eq, S, H: Hasher<S> + Default> FromIterator<T> for HashSet<T, H> {
903904
fn from_iterator<Iter: Iterator<T>>(iter: &mut Iter) -> HashSet<T, H> {
904905
let (lower, _) = iter.size_hint();
905-
let mut set = HashSet::with_capacity_and_hasher(Default::default(), lower);
906+
let mut set = HashSet::with_capacity_and_hasher(lower, Default::default());
906907
set.extend(iter);
907908
set
908909
}

branches/auto/src/librustc/driver/driver.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ use middle::{trans, freevars, kind, ty, typeck, lint, astencode, reachable};
2727
use middle;
2828
use util::common::time;
2929
use util::ppaux;
30-
use util::nodemap::NodeSet;
3130

3231
use serialize::{json, Encodable};
3332

@@ -39,7 +38,7 @@ use std::os;
3938
use std::vec;
4039
use std::vec_ng::Vec;
4140
use std::vec_ng;
42-
use collections::HashMap;
41+
use collections::{HashMap, HashSet};
4342
use getopts::{optopt, optmulti, optflag, optflagopt, opt};
4443
use MaybeHasArg = getopts::Maybe;
4544
use OccurOptional = getopts::Optional;
@@ -224,12 +223,8 @@ pub fn phase_2_configure_and_expand(sess: Session,
224223
front::config::strip_unconfigured_items(krate));
225224

226225
krate = time(time_passes, "expansion", krate, |krate| {
227-
let cfg = syntax::ext::expand::ExpansionConfig {
228-
loader: loader,
229-
deriving_hash_type_parameter: sess.features.default_type_params.get()
230-
};
231226
syntax::ext::expand::expand_crate(sess.parse_sess,
232-
cfg,
227+
loader,
233228
krate)
234229
});
235230
// dump the syntax-time crates
@@ -263,7 +258,7 @@ pub struct CrateAnalysis {
263258
public_items: middle::privacy::PublicItems,
264259
ty_cx: ty::ctxt,
265260
maps: astencode::Maps,
266-
reachable: @RefCell<NodeSet>,
261+
reachable: @RefCell<HashSet<ast::NodeId>>
267262
}
268263

269264
/// Run the resolution, typechecking, region checking and other

branches/auto/src/librustc/front/test.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ use syntax::attr;
2828
use syntax::codemap::{DUMMY_SP, Span, ExpnInfo, NameAndSpan, MacroAttribute};
2929
use syntax::codemap;
3030
use syntax::ext::base::ExtCtxt;
31-
use syntax::ext::expand::ExpansionConfig;
3231
use syntax::fold::Folder;
3332
use syntax::fold;
3433
use syntax::opt_vec;
@@ -166,11 +165,7 @@ fn generate_test_harness(sess: session::Session, krate: ast::Crate)
166165
let loader = &mut Loader::new(sess);
167166
let mut cx: TestCtxt = TestCtxt {
168167
sess: sess,
169-
ext_cx: ExtCtxt::new(sess.parse_sess, sess.opts.cfg.clone(),
170-
ExpansionConfig {
171-
loader: loader,
172-
deriving_hash_type_parameter: false,
173-
}),
168+
ext_cx: ExtCtxt::new(sess.parse_sess, sess.opts.cfg.clone(), loader),
174169
path: RefCell::new(~[]),
175170
testfns: RefCell::new(~[]),
176171
is_test_crate: is_test_crate(&krate),

branches/auto/src/librustc/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ This API is completely unstable and subject to change.
2929

3030
#[allow(deprecated)];
3131
#[feature(macro_rules, globs, struct_variant, managed_boxes)];
32-
#[feature(quote, default_type_params)];
32+
#[feature(quote)];
3333

3434
extern crate extra;
3535
extern crate flate;
@@ -125,7 +125,6 @@ pub mod util {
125125
pub mod common;
126126
pub mod ppaux;
127127
pub mod sha2;
128-
pub mod nodemap;
129128
}
130129

131130
pub mod lib {

branches/auto/src/librustc/metadata/encoder.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use middle::astencode;
2323
use middle::ty;
2424
use middle::typeck;
2525
use middle;
26-
use util::nodemap::{NodeMap, NodeSet};
2726

2827
use serialize::Encodable;
2928
use std::cast;
@@ -32,7 +31,7 @@ use std::hash;
3231
use std::hash::Hash;
3332
use std::io::MemWriter;
3433
use std::str;
35-
use collections::HashMap;
34+
use collections::{HashMap, HashSet};
3635
use syntax::abi::AbiSet;
3736
use syntax::ast::*;
3837
use syntax::ast;
@@ -70,8 +69,8 @@ pub struct EncodeParams<'a> {
7069
diag: @SpanHandler,
7170
tcx: ty::ctxt,
7271
reexports2: middle::resolve::ExportMap2,
73-
item_symbols: &'a RefCell<NodeMap<~str>>,
74-
non_inlineable_statics: &'a RefCell<NodeSet>,
72+
item_symbols: &'a RefCell<HashMap<ast::NodeId, ~str>>,
73+
non_inlineable_statics: &'a RefCell<HashSet<ast::NodeId>>,
7574
link_meta: &'a LinkMeta,
7675
cstore: @cstore::CStore,
7776
encode_inlined_item: EncodeInlinedItem<'a>,
@@ -98,8 +97,8 @@ pub struct EncodeContext<'a> {
9897
tcx: ty::ctxt,
9998
stats: @Stats,
10099
reexports2: middle::resolve::ExportMap2,
101-
item_symbols: &'a RefCell<NodeMap<~str>>,
102-
non_inlineable_statics: &'a RefCell<NodeSet>,
100+
item_symbols: &'a RefCell<HashMap<ast::NodeId, ~str>>,
101+
non_inlineable_statics: &'a RefCell<HashSet<ast::NodeId>>,
103102
link_meta: &'a LinkMeta,
104103
cstore: &'a cstore::CStore,
105104
encode_inlined_item: EncodeInlinedItem<'a>,

branches/auto/src/librustc/middle/cfg/construct.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ use middle::cfg::*;
1212
use middle::graph;
1313
use middle::typeck;
1414
use middle::ty;
15+
use collections::HashMap;
1516
use syntax::ast;
1617
use syntax::ast_util;
1718
use syntax::opt_vec;
18-
use util::nodemap::NodeMap;
1919

2020
struct CFGBuilder {
2121
tcx: ty::ctxt,
2222
method_map: typeck::MethodMap,
23-
exit_map: NodeMap<CFGIndex>,
23+
exit_map: HashMap<ast::NodeId, CFGIndex>,
2424
graph: CFGGraph,
2525
loop_scopes: ~[LoopScope],
2626
}
@@ -35,7 +35,7 @@ pub fn construct(tcx: ty::ctxt,
3535
method_map: typeck::MethodMap,
3636
blk: &ast::Block) -> CFG {
3737
let mut cfg_builder = CFGBuilder {
38-
exit_map: NodeMap::new(),
38+
exit_map: HashMap::new(),
3939
graph: graph::Graph::new(),
4040
tcx: tcx,
4141
method_map: method_map,

branches/auto/src/librustc/middle/cfg/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ Uses `Graph` as the underlying representation.
1818
use middle::graph;
1919
use middle::ty;
2020
use middle::typeck;
21+
use collections::HashMap;
2122
use syntax::ast;
2223
use syntax::opt_vec::OptVec;
23-
use util::nodemap::NodeMap;
2424

2525
mod construct;
2626

2727
pub struct CFG {
28-
exit_map: NodeMap<CFGIndex>,
28+
exit_map: HashMap<ast::NodeId, CFGIndex>,
2929
graph: CFGGraph,
3030
entry: CFGIndex,
3131
exit: CFGIndex,

branches/auto/src/librustc/middle/const_eval.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use middle::astencode;
1616
use middle::ty;
1717
use middle::typeck::astconv;
1818
use middle;
19-
use util::nodemap::{DefIdMap, NodeMap};
2019

2120
use syntax::ast::*;
2221
use syntax::parse::token::InternedString;
@@ -67,7 +66,7 @@ pub enum constness {
6766
non_const
6867
}
6968

70-
type constness_cache = DefIdMap<constness>;
69+
type constness_cache = HashMap<ast::DefId, constness>;
7170

7271
pub fn join(a: constness, b: constness) -> constness {
7372
match (a, b) {
@@ -135,9 +134,9 @@ pub fn lookup_variant_by_id(tcx: ty::ctxt,
135134
}
136135
let maps = astencode::Maps {
137136
root_map: @RefCell::new(HashMap::new()),
138-
method_map: @RefCell::new(NodeMap::new()),
139-
vtable_map: @RefCell::new(NodeMap::new()),
140-
capture_map: @RefCell::new(NodeMap::new())
137+
method_map: @RefCell::new(HashMap::new()),
138+
vtable_map: @RefCell::new(HashMap::new()),
139+
capture_map: @RefCell::new(HashMap::new())
141140
};
142141
let e = match csearch::maybe_get_item_ast(tcx, enum_def,
143142
|a, b, c, d| astencode::decode_inlined_item(a, b,
@@ -185,9 +184,9 @@ pub fn lookup_const_by_id(tcx: ty::ctxt, def_id: ast::DefId)
185184
}
186185
let maps = astencode::Maps {
187186
root_map: @RefCell::new(HashMap::new()),
188-
method_map: @RefCell::new(NodeMap::new()),
189-
vtable_map: @RefCell::new(NodeMap::new()),
190-
capture_map: @RefCell::new(NodeMap::new())
187+
method_map: @RefCell::new(HashMap::new()),
188+
vtable_map: @RefCell::new(HashMap::new()),
189+
capture_map: @RefCell::new(HashMap::new())
191190
};
192191
let e = match csearch::maybe_get_item_ast(tcx, def_id,
193192
|a, b, c, d| astencode::decode_inlined_item(a, b, maps, c, d)) {
@@ -306,7 +305,7 @@ pub fn process_crate(krate: &ast::Crate,
306305
tcx: ty::ctxt) {
307306
let mut v = ConstEvalVisitor {
308307
tcx: tcx,
309-
ccache: DefIdMap::new(),
308+
ccache: HashMap::new(),
310309
};
311310
visit::walk_crate(&mut v, krate, ());
312311
tcx.sess.abort_if_errors();

branches/auto/src/librustc/middle/dataflow.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
use std::io;
2121
use std::uint;
2222
use std::vec;
23+
use collections::HashMap;
2324
use syntax::ast;
2425
use syntax::ast_util;
2526
use syntax::ast_util::IdRange;
2627
use syntax::print::{pp, pprust};
2728
use middle::ty;
2829
use middle::typeck;
2930
use util::ppaux::Repr;
30-
use util::nodemap::NodeMap;
3131

3232
#[deriving(Clone)]
3333
pub struct DataFlowContext<O> {
@@ -45,7 +45,7 @@ pub struct DataFlowContext<O> {
4545
priv words_per_id: uint,
4646

4747
// mapping from node to bitset index.
48-
priv nodeid_to_bitset: NodeMap<uint>,
48+
priv nodeid_to_bitset: HashMap<ast::NodeId,uint>,
4949

5050
// Bit sets per id. The following three fields (`gens`, `kills`,
5151
// and `on_entry`) all have the same structure. For each id in
@@ -139,7 +139,7 @@ impl<O:DataFlowOperator> DataFlowContext<O> {
139139
tcx: tcx,
140140
method_map: method_map,
141141
words_per_id: words_per_id,
142-
nodeid_to_bitset: NodeMap::new(),
142+
nodeid_to_bitset: HashMap::new(),
143143
bits_per_id: bits_per_id,
144144
oper: oper,
145145
gens: gens,

branches/auto/src/librustc/middle/dead.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use middle::lint::{allow, contains_lint, DeadCode};
1616
use middle::privacy;
1717
use middle::ty;
1818
use middle::typeck;
19-
use util::nodemap::NodeSet;
2019

2120
use collections::HashSet;
2221
use syntax::ast;
@@ -253,7 +252,7 @@ impl Visitor<()> for LifeSeeder {
253252

254253
fn create_and_seed_worklist(tcx: ty::ctxt,
255254
exported_items: &privacy::ExportedItems,
256-
reachable_symbols: &NodeSet,
255+
reachable_symbols: &HashSet<ast::NodeId>,
257256
krate: &ast::Crate) -> ~[ast::NodeId] {
258257
let mut worklist = ~[];
259258

@@ -287,7 +286,7 @@ fn create_and_seed_worklist(tcx: ty::ctxt,
287286
fn find_live(tcx: ty::ctxt,
288287
method_map: typeck::MethodMap,
289288
exported_items: &privacy::ExportedItems,
290-
reachable_symbols: &NodeSet,
289+
reachable_symbols: &HashSet<ast::NodeId>,
291290
krate: &ast::Crate)
292291
-> ~HashSet<ast::NodeId> {
293292
let worklist = create_and_seed_worklist(tcx, exported_items,
@@ -410,7 +409,7 @@ impl Visitor<()> for DeadVisitor {
410409
pub fn check_crate(tcx: ty::ctxt,
411410
method_map: typeck::MethodMap,
412411
exported_items: &privacy::ExportedItems,
413-
reachable_symbols: &NodeSet,
412+
reachable_symbols: &HashSet<ast::NodeId>,
414413
krate: &ast::Crate) {
415414
let live_symbols = find_live(tcx, method_map, exported_items,
416415
reachable_symbols, krate);

0 commit comments

Comments
 (0)