Skip to content

Commit

Permalink
SsoHashMap
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Sep 25, 2024
1 parent 5631939 commit a1b67fa
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_infer/src/infer/relate/type_relating.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::sso::SsoHashSet;
use rustc_middle::traits::solve::Goal;
use rustc_middle::ty::relate::{
Relate, RelateResult, TypeRelation, relate_args_invariantly, relate_args_with_variances,
Expand All @@ -17,7 +17,7 @@ pub struct TypeRelating<'combine, 'a, 'tcx> {
fields: &'combine mut CombineFields<'a, 'tcx>,
structurally_relate_aliases: StructurallyRelateAliases,
ambient_variance: ty::Variance,
cache: FxHashSet<(ty::Variance, Ty<'tcx>, Ty<'tcx>)>,
cache: SsoHashSet<(ty::Variance, Ty<'tcx>, Ty<'tcx>)>,
}

impl<'combine, 'infcx, 'tcx> TypeRelating<'combine, 'infcx, 'tcx> {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_infer/src/infer/resolve.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sso::SsoHashMap;
use rustc_middle::bug;
use rustc_middle::ty::fold::{FallibleTypeFolder, TypeFolder, TypeSuperFoldable};
use rustc_middle::ty::visit::TypeVisitableExt;
Expand All @@ -16,7 +16,7 @@ use super::{FixupError, FixupResult, InferCtxt};
/// points for correctness.
pub struct OpportunisticVarResolver<'a, 'tcx> {
infcx: &'a InferCtxt<'tcx>,
cache: FxHashMap<Ty<'tcx>, Ty<'tcx>>,
cache: SsoHashMap<Ty<'tcx>, Ty<'tcx>>,
}

impl<'a, 'tcx> OpportunisticVarResolver<'a, 'tcx> {
Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_middle/src/ty/fold.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use rustc_data_structures::fx::{FxHashMap, FxIndexMap};
use rustc_data_structures::fx::FxIndexMap;
use rustc_data_structures::sso::SsoHashMap;
use rustc_hir::def_id::DefId;
pub use rustc_type_ir::fold::{
FallibleTypeFolder, TypeFoldable, TypeFolder, TypeSuperFoldable, shift_region, shift_vars,
Expand Down Expand Up @@ -165,7 +166,7 @@ struct BoundVarReplacer<'tcx, D> {

delegate: D,

cache: FxHashMap<(ty::DebruijnIndex, Ty<'tcx>), Ty<'tcx>>,
cache: SsoHashMap<(ty::DebruijnIndex, Ty<'tcx>), Ty<'tcx>>,
}

impl<'tcx, D: BoundVarReplacerDelegate<'tcx>> BoundVarReplacer<'tcx, D> {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_next_trait_solver/src/resolve.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rustc_type_ir::data_structures::HashMap;
use rustc_data_structures::sso::SsoHashMap;

Check failure on line 1 in compiler/rustc_next_trait_solver/src/resolve.rs

View workflow job for this annotation

GitHub Actions / PR - x86_64-gnu-llvm-18

failed to resolve: use of undeclared crate or module `rustc_data_structures`
use rustc_type_ir::fold::{TypeFoldable, TypeFolder, TypeSuperFoldable};
use rustc_type_ir::inherent::*;
use rustc_type_ir::visit::TypeVisitableExt;
Expand All @@ -16,7 +16,7 @@ where
I: Interner,
{
delegate: &'a D,
cache: HashMap<I::Ty, I::Ty>,
cache: SsoHashMap<I::Ty, I::Ty>,
}

impl<'a, D: SolverDelegate> EagerResolver<'a, D> {
Expand Down

0 comments on commit a1b67fa

Please sign in to comment.