diff --git a/compiler/gen/tests/gen_list.rs b/compiler/gen/tests/gen_list.rs index 1d78ba87fe..38e499d37e 100644 --- a/compiler/gen/tests/gen_list.rs +++ b/compiler/gen/tests/gen_list.rs @@ -14,9 +14,6 @@ mod helpers; #[cfg(test)] mod gen_list { use crate::helpers::with_larger_debug_stack; - use bumpalo::Bump; - use inkwell::context::Context; - use inkwell::execution_engine::JitFunction; #[test] fn empty_list_literal() { diff --git a/compiler/gen/tests/gen_num.rs b/compiler/gen/tests/gen_num.rs index bc46d40a29..e460e42340 100644 --- a/compiler/gen/tests/gen_num.rs +++ b/compiler/gen/tests/gen_num.rs @@ -13,10 +13,7 @@ mod helpers; #[cfg(test)] mod gen_num { - use crate::helpers::{can_expr, infer_expr, uniq_expr, CanExprOut}; - use bumpalo::Bump; - use inkwell::context::Context; - use inkwell::execution_engine::JitFunction; + /* use inkwell::passes::PassManager; use inkwell::types::BasicType; use inkwell::OptimizationLevel; @@ -24,6 +21,7 @@ mod gen_num { use roc_gen::llvm::convert::basic_type_from_layout; use roc_mono::layout::Layout; use roc_types::subs::Subs; + */ #[test] fn f64_sqrt() { diff --git a/compiler/gen/tests/gen_primitives.rs b/compiler/gen/tests/gen_primitives.rs index eaecfb54d5..e2914ff7c9 100644 --- a/compiler/gen/tests/gen_primitives.rs +++ b/compiler/gen/tests/gen_primitives.rs @@ -13,17 +13,6 @@ mod helpers; #[cfg(test)] mod gen_primitives { - use crate::helpers::{can_expr, infer_expr, uniq_expr, CanExprOut}; - use bumpalo::Bump; - use inkwell::context::Context; - use inkwell::execution_engine::JitFunction; - use inkwell::passes::PassManager; - use inkwell::types::BasicType; - use inkwell::OptimizationLevel; - use roc_gen::llvm::build::{build_proc, build_proc_header}; - use roc_gen::llvm::convert::basic_type_from_layout; - use roc_mono::layout::Layout; - use roc_types::subs::Subs; use std::ffi::{CStr, CString}; use std::os::raw::c_char; diff --git a/compiler/gen/tests/gen_records.rs b/compiler/gen/tests/gen_records.rs index d8f705bf0f..577538db01 100644 --- a/compiler/gen/tests/gen_records.rs +++ b/compiler/gen/tests/gen_records.rs @@ -13,18 +13,6 @@ mod helpers; #[cfg(test)] mod gen_records { - use crate::helpers::{can_expr, infer_expr, uniq_expr, CanExprOut}; - use bumpalo::Bump; - use inkwell::context::Context; - use inkwell::execution_engine::JitFunction; - use inkwell::passes::PassManager; - use inkwell::types::BasicType; - use inkwell::OptimizationLevel; - use roc_gen::llvm::build::{build_proc, build_proc_header}; - use roc_gen::llvm::convert::basic_type_from_layout; - use roc_mono::layout::Layout; - use roc_types::subs::Subs; - #[test] fn basic_record() { assert_evals_to!( diff --git a/compiler/gen/tests/gen_tags.rs b/compiler/gen/tests/gen_tags.rs index 122ecdfaf0..28d93a7668 100644 --- a/compiler/gen/tests/gen_tags.rs +++ b/compiler/gen/tests/gen_tags.rs @@ -13,18 +13,6 @@ mod helpers; #[cfg(test)] mod gen_tags { - use crate::helpers::{can_expr, infer_expr, uniq_expr, CanExprOut}; - use bumpalo::Bump; - use inkwell::context::Context; - use inkwell::execution_engine::JitFunction; - use inkwell::passes::PassManager; - use inkwell::types::BasicType; - use inkwell::OptimizationLevel; - use roc_gen::llvm::build::{build_proc, build_proc_header}; - use roc_gen::llvm::convert::basic_type_from_layout; - use roc_mono::layout::Layout; - use roc_types::subs::Subs; - #[test] fn applied_tag_nothing_ir() { assert_evals_to!( diff --git a/compiler/gen/tests/helpers/eval.rs b/compiler/gen/tests/helpers/eval.rs index 065a4c30a5..7808df2c21 100644 --- a/compiler/gen/tests/helpers/eval.rs +++ b/compiler/gen/tests/helpers/eval.rs @@ -133,7 +133,7 @@ pub fn helper_without_uniqueness<'a>( // We have to do this in a separate pass first, // because their bodies may reference each other. - for ((symbol, layout), proc) in procs.to_specialized_procs(env.arena).drain() { + for ((symbol, layout), proc) in procs.get_specialized_procs(env.arena).drain() { let (fn_val, arg_basic_types) = build_proc_header(&env, &mut layout_ids, symbol, &layout, &proc); @@ -325,7 +325,7 @@ pub fn helper_with_uniqueness<'a>( // Add all the Proc headers to the module. // We have to do this in a separate pass first, // because their bodies may reference each other. - for ((symbol, layout), proc) in procs.to_specialized_procs(env.arena).drain() { + for ((symbol, layout), proc) in procs.get_specialized_procs(env.arena).drain() { let (fn_val, arg_basic_types) = build_proc_header(&env, &mut layout_ids, symbol, &layout, &proc); @@ -400,6 +400,10 @@ pub fn helper_with_uniqueness<'a>( #[macro_export] macro_rules! assert_opt_evals_to { ($src:expr, $expected:expr, $ty:ty, $transform:expr, $leak:expr) => { + use bumpalo::Bump; + use inkwell::context::Context; + use inkwell::execution_engine::JitFunction; + let arena = Bump::new(); let context = Context::create(); @@ -426,6 +430,10 @@ macro_rules! assert_opt_evals_to { #[macro_export] macro_rules! assert_llvm_evals_to { ($src:expr, $expected:expr, $ty:ty, $transform:expr, $leak:expr) => { + use bumpalo::Bump; + use inkwell::context::Context; + use inkwell::execution_engine::JitFunction; + let arena = Bump::new(); let context = Context::create(); diff --git a/compiler/mono/src/ir.rs b/compiler/mono/src/ir.rs index edcc879d6e..54ea22e0da 100644 --- a/compiler/mono/src/ir.rs +++ b/compiler/mono/src/ir.rs @@ -91,7 +91,7 @@ pub enum InProgressProc<'a> { impl<'a> Procs<'a> { // TODO investigate make this an iterator? - pub fn to_specialized_procs(self, arena: &'a Bump) -> MutMap<(Symbol, Layout<'a>), Proc<'a>> { + pub fn get_specialized_procs(self, arena: &'a Bump) -> MutMap<(Symbol, Layout<'a>), Proc<'a>> { let mut result = MutMap::with_capacity_and_hasher(self.specialized.len(), default_hasher()); for (key, in_prog_proc) in self.specialized.into_iter() { diff --git a/compiler/mono/tests/test_mono.rs b/compiler/mono/tests/test_mono.rs index 51f84a2bf9..23db0f1dda 100644 --- a/compiler/mono/tests/test_mono.rs +++ b/compiler/mono/tests/test_mono.rs @@ -73,7 +73,7 @@ mod test_mono { interns.all_ident_ids.insert(home, ident_ids); let mut procs_string = procs - .to_specialized_procs(mono_env.arena) + .get_specialized_procs(mono_env.arena) .values() .map(|proc| proc.to_pretty(200)) .collect::>();