about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-12-24 22:32:36 +0100
committerMazdak Farrokhzad <twingoow@gmail.com>2020-01-04 18:57:22 +0100
commitf507403517299765b6d628fd677c6d880899b83c (patch)
treecb6d1d924ea3aed771de041b39a4ae03df5f6481 /src
parent7901c7f707fd84c4f57401dd13ac0c4fc7b693ee (diff)
define_id_collections -> rustc_data_structures
Diffstat (limited to 'src')
-rw-r--r--src/librustc/util/nodemap.rs7
-rw-r--r--src/librustc_data_structures/fx.rs8
2 files changed, 9 insertions, 6 deletions
diff --git a/src/librustc/util/nodemap.rs b/src/librustc/util/nodemap.rs
index c166a712d7b..7a5c2780f3c 100644
--- a/src/librustc/util/nodemap.rs
+++ b/src/librustc/util/nodemap.rs
@@ -4,12 +4,7 @@ use crate::hir::def_id::DefId;
 use crate::hir::{HirId, ItemLocalId};
 use syntax::ast;
 
-macro_rules! define_id_collections {
-    ($map_name:ident, $set_name:ident, $key:ty) => {
-        pub type $map_name<T> = rustc_data_structures::fx::FxHashMap<$key, T>;
-        pub type $set_name = rustc_data_structures::fx::FxHashSet<$key>;
-    };
-}
+use rustc_data_structures::define_id_collections;
 
 define_id_collections!(NodeMap, NodeSet, ast::NodeId);
 define_id_collections!(DefIdMap, DefIdSet, DefId);
diff --git a/src/librustc_data_structures/fx.rs b/src/librustc_data_structures/fx.rs
index a9e8c2edbff..bbeb193dba3 100644
--- a/src/librustc_data_structures/fx.rs
+++ b/src/librustc_data_structures/fx.rs
@@ -4,3 +4,11 @@ pub use rustc_hash::{FxHashMap, FxHashSet, FxHasher};
 
 pub type FxIndexMap<K, V> = indexmap::IndexMap<K, V, BuildHasherDefault<FxHasher>>;
 pub type FxIndexSet<V> = indexmap::IndexSet<V, BuildHasherDefault<FxHasher>>;
+
+#[macro_export]
+macro_rules! define_id_collections {
+    ($map_name:ident, $set_name:ident, $key:ty) => {
+        pub type $map_name<T> = $crate::fx::FxHashMap<$key, T>;
+        pub type $set_name = $crate::fx::FxHashSet<$key>;
+    };
+}