X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_data_structures%2Ffx.rs;h=bbeb193dba32b4c8970d8bc18160d4d2dd5563c7;hb=d493dccef7ae1d2ca739fe828bf9556b44dc460a;hp=a2afeffe7305045b53f61d17f36e1875c78a5342;hpb=257dbb826d0000f7d56c71fb7d93b5de288a157e;p=rust.git diff --git a/src/librustc_data_structures/fx.rs b/src/librustc_data_structures/fx.rs index a2afeffe730..bbeb193dba3 100644 --- a/src/librustc_data_structures/fx.rs +++ b/src/librustc_data_structures/fx.rs @@ -1 +1,14 @@ -pub use rustc_hash::{FxHasher, FxHashMap, FxHashSet}; +use std::hash::BuildHasherDefault; + +pub use rustc_hash::{FxHashMap, FxHashSet, FxHasher}; + +pub type FxIndexMap = indexmap::IndexMap>; +pub type FxIndexSet = indexmap::IndexSet>; + +#[macro_export] +macro_rules! define_id_collections { + ($map_name:ident, $set_name:ident, $key:ty) => { + pub type $map_name = $crate::fx::FxHashMap<$key, T>; + pub type $set_name = $crate::fx::FxHashSet<$key>; + }; +}