1 //! An efficient hash map for `NodeId`s.
3 use crate::hir::def_id::DefId;
4 use crate::hir::{HirId, ItemLocalId};
7 pub use rustc_data_structures::fx::FxHashMap;
8 pub use rustc_data_structures::fx::FxHashSet;
10 macro_rules! define_id_collections {
11 ($map_name:ident, $set_name:ident, $key:ty) => {
12 pub type $map_name<T> = FxHashMap<$key, T>;
13 pub type $set_name = FxHashSet<$key>;
17 define_id_collections!(NodeMap, NodeSet, ast::NodeId);
18 define_id_collections!(DefIdMap, DefIdSet, DefId);
19 define_id_collections!(HirIdMap, HirIdSet, HirId);
20 define_id_collections!(ItemLocalMap, ItemLocalSet, ItemLocalId);