rustc_type_ir/data_structures/
mod.rs

1use std::hash::BuildHasherDefault;
2
3pub use ena::unify::{NoError, UnifyKey, UnifyValue};
4use rustc_hash::FxHasher;
5pub use rustc_hash::{FxHashMap as HashMap, FxHashSet as HashSet};
6
7pub type IndexMap<K, V> = indexmap::IndexMap<K, V, BuildHasherDefault<FxHasher>>;
8pub type IndexSet<V> = indexmap::IndexSet<V, BuildHasherDefault<FxHasher>>;
9
10mod delayed_map;
11
12#[cfg(feature = "nightly")]
13mod impl_ {
14    pub use rustc_data_structures::sso::{SsoHashMap, SsoHashSet};
15    pub use rustc_data_structures::stack::ensure_sufficient_stack;
16}
17
18#[cfg(not(feature = "nightly"))]
19mod impl_ {
20    pub use std::collections::{HashMap as SsoHashMap, HashSet as SsoHashSet};
21
22    #[inline]
23    pub fn ensure_sufficient_stack<R>(f: impl FnOnce() -> R) -> R {
24        f()
25    }
26}
27
28pub use delayed_map::{DelayedMap, DelayedSet};
29pub use impl_::*;