Skip to content

Commit ee81739

Browse files
committed
Deprecate the FxHashMap() and FxHashSet() constructor function hack
1 parent 74ff7dc commit ee81739

File tree

115 files changed

+318
-333
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+318
-333
lines changed

src/librustc/dep_graph/cgu_reuse_tracker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ pub struct CguReuseTracker {
5151
impl CguReuseTracker {
5252
pub fn new() -> CguReuseTracker {
5353
let data = TrackerData {
54-
actual_reuse: FxHashMap(),
55-
expected_reuse: FxHashMap(),
54+
actual_reuse: FxHashMap::default(),
55+
expected_reuse: FxHashMap::default(),
5656
};
5757

5858
CguReuseTracker {

src/librustc/dep_graph/dep_tracking_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl<M: DepTrackingMapConfig> DepTrackingMap<M> {
3636
DepTrackingMap {
3737
phantom: PhantomData,
3838
graph,
39-
map: FxHashMap(),
39+
map: FxHashMap::default(),
4040
}
4141
}
4242
}

src/librustc/dep_graph/graph.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ impl DepGraph {
101101
DepGraph {
102102
data: Some(Lrc::new(DepGraphData {
103103
previous_work_products: prev_work_products,
104-
dep_node_debug: Lock::new(FxHashMap()),
104+
dep_node_debug: Lock::new(FxHashMap::default()),
105105
current: Lock::new(CurrentDepGraph::new()),
106106
previous: prev_graph,
107107
colors: Lock::new(DepNodeColorMap::new(prev_graph_node_count)),
108-
loaded_from_cache: Lock::new(FxHashMap()),
108+
loaded_from_cache: Lock::new(FxHashMap::default()),
109109
})),
110110
fingerprints: Lrc::new(Lock::new(fingerprints)),
111111
}
@@ -209,7 +209,7 @@ impl DepGraph {
209209
|key| OpenTask::Regular(Lock::new(RegularOpenTask {
210210
node: key,
211211
reads: SmallVec::new(),
212-
read_set: FxHashSet(),
212+
read_set: FxHashSet::default(),
213213
})),
214214
|data, key, task| data.borrow_mut().complete_task(key, task))
215215
}
@@ -353,7 +353,7 @@ impl DepGraph {
353353
let (result, open_task) = ty::tls::with_context(|icx| {
354354
let task = OpenTask::Anon(Lock::new(AnonOpenTask {
355355
reads: SmallVec::new(),
356-
read_set: FxHashSet(),
356+
read_set: FxHashSet::default(),
357357
}));
358358

359359
let r = {
@@ -937,7 +937,7 @@ impl CurrentDepGraph {
937937
CurrentDepGraph {
938938
nodes: IndexVec::new(),
939939
edges: IndexVec::new(),
940-
node_to_node_index: FxHashMap(),
940+
node_to_node_index: FxHashMap::default(),
941941
anon_id_seed: stable_hasher.finish(),
942942
forbidden_edge,
943943
total_read_count: 0,

src/librustc/dep_graph/query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl DepGraphQuery {
2525
edges: &[(DepNode, DepNode)])
2626
-> DepGraphQuery {
2727
let mut graph = Graph::with_capacity(nodes.len(), edges.len());
28-
let mut indices = FxHashMap();
28+
let mut indices = FxHashMap::default();
2929
for node in nodes {
3030
indices.insert(node.clone(), graph.add_node(node.clone()));
3131
}

src/librustc/hir/map/definitions.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,10 @@ impl Definitions {
421421
node_to_def_index: NodeMap(),
422422
def_index_to_node: [vec![], vec![]],
423423
node_to_hir_id: IndexVec::new(),
424-
parent_modules_of_macro_defs: FxHashMap(),
425-
expansions_that_defined: FxHashMap(),
426-
next_disambiguator: FxHashMap(),
427-
def_index_to_span: FxHashMap(),
424+
parent_modules_of_macro_defs: FxHashMap::default(),
425+
expansions_that_defined: FxHashMap::default(),
426+
next_disambiguator: FxHashMap::default(),
427+
def_index_to_span: FxHashMap::default(),
428428
}
429429
}
430430

src/librustc/hir/map/hir_id_validator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<'a, 'hir: 'a> OuterVisitor<'a, 'hir> {
5151
HirIdValidator {
5252
hir_map,
5353
owner_def_index: None,
54-
hir_ids_seen: FxHashMap(),
54+
hir_ids_seen: FxHashMap::default(),
5555
errors: Vec::new(),
5656
}
5757
}

src/librustc/ich/hcx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for Span {
370370
// recursing every time.
371371
thread_local! {
372372
static CACHE: RefCell<FxHashMap<hygiene::Mark, u64>> =
373-
RefCell::new(FxHashMap());
373+
RefCell::new(FxHashMap::default());
374374
}
375375

376376
let sub_hash: u64 = CACHE.with(|cache| {

src/librustc/ich/impls_ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ for &'gcx ty::List<T>
3232
hasher: &mut StableHasher<W>) {
3333
thread_local! {
3434
static CACHE: RefCell<FxHashMap<(usize, usize), Fingerprint>> =
35-
RefCell::new(FxHashMap());
35+
RefCell::new(FxHashMap::default());
3636
}
3737

3838
let hash = CACHE.with(|cache| {

src/librustc/infer/freshen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl<'a, 'gcx, 'tcx> TypeFreshener<'a, 'gcx, 'tcx> {
6262
TypeFreshener {
6363
infcx,
6464
freshen_count: 0,
65-
freshen_map: FxHashMap(),
65+
freshen_map: FxHashMap::default(),
6666
}
6767
}
6868

src/librustc/infer/higher_ranked/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
553553
let escaping_types =
554554
self.type_variables.borrow_mut().types_escaping_snapshot(&snapshot.type_snapshot);
555555

556-
let mut escaping_region_vars = FxHashSet();
556+
let mut escaping_region_vars = FxHashSet::default();
557557
for ty in &escaping_types {
558558
self.tcx.collect_regions(ty, &mut escaping_region_vars);
559559
}

0 commit comments

Comments
 (0)