diff --git a/compiler/collections/src/all.rs b/compiler/collections/src/all.rs index 965fd819eb..f473ef4e97 100644 --- a/compiler/collections/src/all.rs +++ b/compiler/collections/src/all.rs @@ -28,8 +28,11 @@ pub type SendMap = im::hashmap::HashMap; pub type SendSet = im::hashset::HashSet; -pub type BumpMap<'a, K, V> = hashbrown::HashMap>; -pub type BumpSet<'a, K> = hashbrown::HashSet>; +// pub type BumpMap<'a, K, V> = hashbrown::HashMap>; +// pub type BumpSet<'a, K> = hashbrown::HashSet>; + +pub type BumpMap = hashbrown::HashMap; +pub type BumpSet = hashbrown::HashSet; pub trait BumpMapDefault<'a> { fn new_in(arena: &'a bumpalo::Bump) -> Self; @@ -37,31 +40,35 @@ pub trait BumpMapDefault<'a> { fn with_capacity_in(capacity: usize, arena: &'a bumpalo::Bump) -> Self; } -impl<'a, K, V> BumpMapDefault<'a> for BumpMap<'a, K, V> { - fn new_in(arena: &'a bumpalo::Bump) -> Self { - hashbrown::HashMap::with_hasher_in(default_hasher(), hashbrown::BumpWrapper(arena)) +impl<'a, K, V> BumpMapDefault<'a> for BumpMap { + fn new_in(_arena: &'a bumpalo::Bump) -> Self { + // hashbrown::HashMap::with_hasher_in(default_hasher(), hashbrown::BumpWrapper(arena)) + hashbrown::HashMap::with_hasher(default_hasher()) } - fn with_capacity_in(capacity: usize, arena: &'a bumpalo::Bump) -> Self { - hashbrown::HashMap::with_capacity_and_hasher_in( - capacity, - default_hasher(), - hashbrown::BumpWrapper(arena), - ) + fn with_capacity_in(capacity: usize, _arena: &'a bumpalo::Bump) -> Self { + // hashbrown::HashMap::with_capacity_and_hasher_in( + // capacity, + // default_hasher(), + // hashbrown::BumpWrapper(arena), + // ) + hashbrown::HashMap::with_capacity_and_hasher(capacity, default_hasher()) } } -impl<'a, K> BumpMapDefault<'a> for BumpSet<'a, K> { - fn new_in(arena: &'a bumpalo::Bump) -> Self { - hashbrown::HashSet::with_hasher_in(default_hasher(), hashbrown::BumpWrapper(arena)) +impl<'a, K> BumpMapDefault<'a> for BumpSet { + fn new_in(_arena: &'a bumpalo::Bump) -> Self { + // hashbrown::HashSet::with_hasher_in(default_hasher(), hashbrown::BumpWrapper(arena)) + hashbrown::HashSet::with_hasher(default_hasher()) } - fn with_capacity_in(capacity: usize, arena: &'a bumpalo::Bump) -> Self { - hashbrown::HashSet::with_capacity_and_hasher_in( - capacity, - default_hasher(), - hashbrown::BumpWrapper(arena), - ) + fn with_capacity_in(capacity: usize, _arena: &'a bumpalo::Bump) -> Self { + // hashbrown::HashSet::with_capacity_and_hasher_in( + // capacity, + // default_hasher(), + // hashbrown::BumpWrapper(arena), + // ) + hashbrown::HashSet::with_capacity_and_hasher(capacity, default_hasher()) } } diff --git a/compiler/load/src/file.rs b/compiler/load/src/file.rs index cf262fd3d4..5a75ad93bd 100644 --- a/compiler/load/src/file.rs +++ b/compiler/load/src/file.rs @@ -774,7 +774,7 @@ enum Msg<'a> { module_id: ModuleId, ident_ids: IdentIds, layout_cache: LayoutCache<'a>, - external_specializations_requested: BumpMap<'a, ModuleId, ExternalSpecializations<'a>>, + external_specializations_requested: BumpMap>, procedures: MutMap<(Symbol, Layout<'a>), Proc<'a>>, problems: Vec, module_timing: ModuleTiming, @@ -976,7 +976,7 @@ enum BuildTask<'a> { module_timing: ModuleTiming, layout_cache: LayoutCache<'a>, solved_subs: Solved, - imported_module_thunks: BumpSet<'a, Symbol>, + imported_module_thunks: BumpSet, module_id: ModuleId, ident_ids: IdentIds, decls: Vec, @@ -3831,7 +3831,7 @@ fn make_specializations<'a>( fn build_pending_specializations<'a>( arena: &'a Bump, solved_subs: Solved, - imported_module_thunks: BumpSet<'a, Symbol>, + imported_module_thunks: BumpSet, home: ModuleId, mut ident_ids: IdentIds, decls: Vec, diff --git a/compiler/mono/src/ir.rs b/compiler/mono/src/ir.rs index fff3781af0..98b528d645 100644 --- a/compiler/mono/src/ir.rs +++ b/compiler/mono/src/ir.rs @@ -73,7 +73,8 @@ impl<'a> CapturedSymbols<'a> { #[derive(Clone, Debug, PartialEq)] pub struct PendingSpecialization<'a> { solved_type: SolvedType, - host_exposed_aliases: BumpMap<'a, Symbol, SolvedType>, + host_exposed_aliases: BumpMap, + _lifetime: std::marker::PhantomData<&'a u8>, } impl<'a> PendingSpecialization<'a> { @@ -82,6 +83,7 @@ impl<'a> PendingSpecialization<'a> { PendingSpecialization { solved_type, host_exposed_aliases: BumpMap::new_in(arena), + _lifetime: std::marker::PhantomData, } } @@ -104,6 +106,7 @@ impl<'a> PendingSpecialization<'a> { PendingSpecialization { solved_type, host_exposed_aliases, + _lifetime: std::marker::PhantomData, } } } @@ -124,8 +127,8 @@ pub struct Proc<'a> { pub enum HostExposedLayouts<'a> { NotHostExposed, HostExposed { - rigids: BumpMap<'a, Lowercase, Layout<'a>>, - aliases: BumpMap<'a, Symbol, Layout<'a>>, + rigids: BumpMap>, + aliases: BumpMap>, }, } @@ -239,13 +242,15 @@ impl<'a> Proc<'a> { #[derive(Clone, Debug)] pub struct ExternalSpecializations<'a> { - pub specs: BumpMap<'a, Symbol, MutSet>, + pub specs: BumpMap>, + _lifetime: std::marker::PhantomData<&'a u8>, } impl<'a> ExternalSpecializations<'a> { pub fn new_in(arena: &'a Bump) -> Self { Self { specs: BumpMap::new_in(arena), + _lifetime: std::marker::PhantomData, } } @@ -276,16 +281,16 @@ impl<'a> ExternalSpecializations<'a> { #[derive(Clone, Debug)] pub struct Procs<'a> { - pub partial_procs: BumpMap<'a, Symbol, PartialProc<'a>>, - pub imported_module_thunks: BumpSet<'a, Symbol>, - pub module_thunks: BumpSet<'a, Symbol>, + pub partial_procs: BumpMap>, + pub imported_module_thunks: BumpSet, + pub module_thunks: BumpSet, pub pending_specializations: - Option, PendingSpecialization<'a>>>>, - pub specialized: BumpMap<'a, (Symbol, Layout<'a>), InProgressProc<'a>>, - pub runtime_errors: BumpMap<'a, Symbol, &'a str>, - pub call_by_pointer_wrappers: BumpMap<'a, Symbol, Symbol>, + Option, PendingSpecialization<'a>>>>, + pub specialized: BumpMap<(Symbol, Layout<'a>), InProgressProc<'a>>, + pub runtime_errors: BumpMap, + pub call_by_pointer_wrappers: BumpMap, pub externals_others_need: ExternalSpecializations<'a>, - pub externals_we_need: BumpMap<'a, ModuleId, ExternalSpecializations<'a>>, + pub externals_we_need: BumpMap>, } impl<'a> Procs<'a> { @@ -681,11 +686,7 @@ impl<'a> Procs<'a> { } fn add_pending<'a>( - pending_specializations: &mut BumpMap< - 'a, - Symbol, - MutMap, PendingSpecialization<'a>>, - >, + pending_specializations: &mut BumpMap, PendingSpecialization<'a>>>, symbol: Symbol, layout: Layout<'a>, pending: PendingSpecialization<'a>, @@ -1860,10 +1861,7 @@ fn specialize_external<'a>( } HostExposedLayouts::HostExposed { - rigids: hashbrown::HashMap::with_hasher_in( - default_hasher(), - hashbrown::BumpWrapper(env.arena), - ), + rigids: BumpMap::new_in(env.arena), aliases, } }; @@ -2314,6 +2312,7 @@ fn specialize<'a>( let PendingSpecialization { solved_type, host_exposed_aliases, + .. } = pending; specialize_solved_type( diff --git a/editor/src/lang/constrain.rs b/editor/src/lang/constrain.rs index 304929893b..0fdc555f9b 100644 --- a/editor/src/lang/constrain.rs +++ b/editor/src/lang/constrain.rs @@ -32,7 +32,7 @@ pub enum Constraint<'a> { pub struct LetConstraint<'a> { pub rigid_vars: BumpVec<'a, Variable>, pub flex_vars: BumpVec<'a, Variable>, - pub def_types: BumpMap<'a, Symbol, Located>, + pub def_types: BumpMap>, pub defs_constraint: Constraint<'a>, pub ret_constraint: Constraint<'a>, }