Skip to content

Commit 00cf591

Browse files
committed
fix: remove superfluos heap argument
1 parent 870b292 commit 00cf591

3 files changed

Lines changed: 7 additions & 11 deletions

File tree

libs/@local/hashql/core/src/module/mod.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,13 @@ impl<'heap, S: Allocator> PartialModuleRegistry<'heap, S> {
137137
///
138138
/// [`insert_module`]: Self::insert_module
139139
#[expect(unsafe_code)]
140-
pub fn finish(self, heap: &'heap Heap) -> ModuleRegistry<'heap> {
140+
pub fn finish(self) -> ModuleRegistry<'heap> {
141141
assert!(
142142
self.modules.iter().all(Option::is_some),
143143
"all modules must be inserted to be able to finish the registry"
144144
);
145145

146-
let modules = heap.allocate_slice_uninit(self.modules.len());
146+
let modules = self.heap.allocate_slice_uninit(self.modules.len());
147147
for (dst, src) in modules.iter_mut().zip(self.modules.iter()) {
148148
// SAFETY: We have just verified above that all modules are Some
149149
unsafe {
@@ -156,7 +156,7 @@ impl<'heap, S: Allocator> PartialModuleRegistry<'heap, S> {
156156
let modules = unsafe { modules.assume_init_ref() };
157157

158158
ModuleRegistry {
159-
heap,
159+
heap: self.heap,
160160
modules: IdSlice::from_raw(modules),
161161
root: self.root,
162162
}
@@ -194,7 +194,7 @@ impl<'heap> ModuleRegistry<'heap> {
194194
let mut std = StandardLibrary::new(env, &mut partial, scratch);
195195
std.register();
196196

197-
partial.finish(env.heap)
197+
partial.finish()
198198
}
199199

200200
/// Looks up a root-level module by name.
@@ -322,10 +322,6 @@ impl<'heap> ModuleRegistry<'heap> {
322322
/// This method requires allocation for the traversal state:
323323
/// - A vector for the module exploration stack
324324
/// - A hash set for tracking visited modules
325-
///
326-
/// # Panics
327-
///
328-
/// This function will panic if the internal `RwLock` is poisoned.
329325
#[must_use]
330326
pub fn search_by_name(
331327
&self,

libs/@local/hashql/core/src/module/namespace.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ mod tests {
689689
})),
690690
}])
691691
});
692-
let registry = builder.finish(&heap);
692+
let registry = builder.finish();
693693

694694
let mut namespace = ModuleNamespace::new(&registry);
695695
namespace.import_prelude();
@@ -959,7 +959,7 @@ mod tests {
959959
})),
960960
}])
961961
});
962-
let registry = builder.finish(&heap);
962+
let registry = builder.finish();
963963

964964
let mut namespace = ModuleNamespace::new(&registry);
965965
namespace.import_prelude();

libs/@local/hashql/core/src/module/resolver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ mod test {
892892

893893
let mut builder = ModuleRegistry::builder(&env);
894894
builder.insert_root_module(heap.intern_symbol("empty_module"), |_| &[]);
895-
let registry = builder.finish(&heap);
895+
let registry = builder.finish();
896896

897897
let resolver = Resolver {
898898
registry: &registry,

0 commit comments

Comments
 (0)