]> git.lizzy.rs Git - rust.git/blob - src/librustc/util/nodemap.rs
fix merge conflicts
[rust.git] / src / librustc / util / nodemap.rs
1 //! An efficient hash map for `NodeId`s.
2
3 use crate::hir::def_id::DefId;
4 use crate::hir::{HirId, ItemLocalId};
5 use syntax::ast;
6
7 pub use rustc_data_structures::fx::FxHashMap;
8 pub use rustc_data_structures::fx::FxHashSet;
9
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>;
14     }
15 }
16
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);