rustc_type_ir/data_structures/
mod.rs

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