mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Auto merge of #150353 - llogiq:rustc-hash-refactor, r=eholk
refactor rustc-hash integration I found that rustc-hash is used in multiple compiler crates. Also some types use `FxBuildHasher` whereas others use `BuildHasherDefault<FxHasher>` (both do the same thing). In order to simplify future hashing experiments, I changed every location to use `rustc_data_structures::fx::*` types instead, and also removed the `BuildHasherDefault` variant. This will simplify future experiments with hashing (for example trying out a hasher that doesn't implement `Default` for whatever reason).
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
use std::hash::BuildHasherDefault;
|
||||
|
||||
pub use rustc_hash::{FxBuildHasher, FxHashMap, FxHashSet, FxHasher};
|
||||
|
||||
pub type StdEntry<'a, K, V> = std::collections::hash_map::Entry<'a, K, V>;
|
||||
|
||||
pub type FxIndexMap<K, V> = indexmap::IndexMap<K, V, BuildHasherDefault<FxHasher>>;
|
||||
pub type FxIndexSet<V> = indexmap::IndexSet<V, BuildHasherDefault<FxHasher>>;
|
||||
pub type FxIndexMap<K, V> = indexmap::IndexMap<K, V, FxBuildHasher>;
|
||||
pub type FxIndexSet<V> = indexmap::IndexSet<V, FxBuildHasher>;
|
||||
pub type IndexEntry<'a, K, V> = indexmap::map::Entry<'a, K, V>;
|
||||
pub type IndexOccupiedEntry<'a, K, V> = indexmap::map::OccupiedEntry<'a, K, V>;
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
use std::iter::{Product, Sum};
|
||||
use std::ops::Index;
|
||||
|
||||
use rustc_hash::{FxBuildHasher, FxHashMap, FxHashSet};
|
||||
use rustc_macros::{Decodable_NoContext, Encodable_NoContext};
|
||||
|
||||
use crate::fingerprint::Fingerprint;
|
||||
use crate::fx::{FxBuildHasher, FxHashMap, FxHashSet};
|
||||
use crate::stable_hasher::{HashStable, StableCompare, StableHasher, ToStableHashKey};
|
||||
|
||||
/// `UnordItems` is the order-less version of `Iterator`. It only contains methods
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
use std::hash::BuildHasherDefault;
|
||||
|
||||
pub use ena::unify::{NoError, UnifyKey, UnifyValue};
|
||||
use rustc_hash::FxHasher;
|
||||
use rustc_hash::FxBuildHasher;
|
||||
pub use rustc_hash::{FxHashMap as HashMap, FxHashSet as HashSet};
|
||||
|
||||
pub type IndexMap<K, V> = indexmap::IndexMap<K, V, BuildHasherDefault<FxHasher>>;
|
||||
pub type IndexSet<V> = indexmap::IndexSet<V, BuildHasherDefault<FxHasher>>;
|
||||
pub type IndexMap<K, V> = indexmap::IndexMap<K, V, FxBuildHasher>;
|
||||
pub type IndexSet<V> = indexmap::IndexSet<V, FxBuildHasher>;
|
||||
|
||||
mod delayed_map;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user