@@ -25,7 +25,6 @@ use crate::{
2525 collections:: { FastHashMap , fast_hash_map_in} ,
2626 heap:: { BumpAllocator as _, Heap } ,
2727 id:: { HasId , Id as _, IdSlice , IdVec , bit_vec:: DenseBitSet , newtype} ,
28- intern:: { Decompose , InternSet , Interned } ,
2928 symbol:: Symbol ,
3029 r#type:: environment:: Environment ,
3130} ;
@@ -40,17 +39,17 @@ impl ModuleId {
4039}
4140
4241pub struct PartialModuleRegistry < ' heap , S : Allocator > {
42+ heap : & ' heap Heap ,
4343 modules : IdVec < ModuleId , Option < Module < ' heap > > , S > ,
44- items : InternSet < ' heap , [ Item < ' heap > ] > ,
4544
4645 root : FastHashMap < Symbol < ' heap > , ModuleId , & ' heap Heap > ,
4746}
4847
4948impl < ' heap , S : Allocator > PartialModuleRegistry < ' heap , S > {
5049 pub fn new_in ( heap : & ' heap Heap , scratch : S ) -> Self {
5150 Self {
51+ heap,
5252 modules : IdVec :: new_in ( scratch) ,
53- items : InternSet :: new ( heap) ,
5453 root : fast_hash_map_in ( heap) ,
5554 }
5655 }
@@ -89,11 +88,6 @@ impl<'heap, S: Allocator> PartialModuleRegistry<'heap, S> {
8988 debug_assert ! ( value. is_none( ) ) ;
9089 }
9190
92- /// Interns a slice of items into the registry.
93- pub fn intern_items ( & self , items : & [ Item < ' heap > ] ) -> Interned < ' heap , [ Item < ' heap > ] > {
94- self . items . intern_slice ( items)
95- }
96-
9791 /// Register a new module in the root namespace.
9892 ///
9993 /// # Panics
@@ -363,7 +357,7 @@ pub struct Module<'heap> {
363357 pub parent : ModuleId ,
364358 pub depth : NonZero < u32 > ,
365359
366- pub items : Interned < ' heap , [ Item < ' heap > ] > ,
360+ pub items : & ' heap [ Item < ' heap > ] ,
367361}
368362
369363impl < ' heap > Module < ' heap > {
@@ -388,28 +382,6 @@ impl<'heap> Module<'heap> {
388382 }
389383}
390384
391- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
392- pub struct PartialModule < ' heap > {
393- name : Symbol < ' heap > ,
394- parent : ModuleId ,
395- depth : NonZero < u32 > ,
396- items : Interned < ' heap , [ Item < ' heap > ] > ,
397- }
398-
399- impl < ' heap > Decompose < ' heap > for Module < ' heap > {
400- type Partial = PartialModule < ' heap > ;
401-
402- fn from_parts ( id : Self :: Id , partial : Interned < ' heap , Self :: Partial > ) -> Self {
403- Self {
404- id,
405- name : partial. name ,
406- parent : partial. parent ,
407- depth : partial. depth ,
408- items : partial. items ,
409- }
410- }
411- }
412-
413385impl HasId for Module < ' _ > {
414386 type Id = ModuleId ;
415387
0 commit comments