Skip to content

Commit f507403

Browse files
committedJan 4, 2020
define_id_collections -> rustc_data_structures
1 parent 7901c7f commit f507403

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed
 

‎src/librustc/util/nodemap.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@ use crate::hir::def_id::DefId;
44
use crate::hir::{HirId, ItemLocalId};
55
use syntax::ast;
66

7-
macro_rules! define_id_collections {
8-
($map_name:ident, $set_name:ident, $key:ty) => {
9-
pub type $map_name<T> = rustc_data_structures::fx::FxHashMap<$key, T>;
10-
pub type $set_name = rustc_data_structures::fx::FxHashSet<$key>;
11-
};
12-
}
7+
use rustc_data_structures::define_id_collections;
138

149
define_id_collections!(NodeMap, NodeSet, ast::NodeId);
1510
define_id_collections!(DefIdMap, DefIdSet, DefId);

‎src/librustc_data_structures/fx.rs

+8
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,11 @@ pub use rustc_hash::{FxHashMap, FxHashSet, FxHasher};
44

55
pub type FxIndexMap<K, V> = indexmap::IndexMap<K, V, BuildHasherDefault<FxHasher>>;
66
pub type FxIndexSet<V> = indexmap::IndexSet<V, BuildHasherDefault<FxHasher>>;
7+
8+
#[macro_export]
9+
macro_rules! define_id_collections {
10+
($map_name:ident, $set_name:ident, $key:ty) => {
11+
pub type $map_name<T> = $crate::fx::FxHashMap<$key, T>;
12+
pub type $set_name = $crate::fx::FxHashSet<$key>;
13+
};
14+
}

0 commit comments

Comments
 (0)
Please sign in to comment.