diff --git a/compiler/gen/src/llvm/build_list.rs b/compiler/gen/src/llvm/build_list.rs index 8e5b4e0f06..f8eb8d9151 100644 --- a/compiler/gen/src/llvm/build_list.rs +++ b/compiler/gen/src/llvm/build_list.rs @@ -207,7 +207,6 @@ pub fn list_prepend<'a, 'ctx, 'env>( let ptr_bytes = env.ptr_bytes; // Allocate space for the new array that we'll copy into. - let elem_type = basic_type_from_layout(env.arena, ctx, elem_layout, env.ptr_bytes); let clone_ptr = allocate_list(env, elem_layout, new_list_len); let int_type = ptr_int(ctx, ptr_bytes); let ptr_as_int = builder.build_ptr_to_int(clone_ptr, int_type, "list_cast_ptr"); diff --git a/compiler/mono/src/borrow.rs b/compiler/mono/src/borrow.rs index 6d6ed46bbe..553e75f321 100644 --- a/compiler/mono/src/borrow.rs +++ b/compiler/mono/src/borrow.rs @@ -313,7 +313,7 @@ impl<'a> BorrowInfState<'a> { .. } => { // get the borrow signature of the applied function - let ps = match self.param_map.get_symbol(call_type.into_inner()) { + let ps = match self.param_map.get_symbol(call_type.get_inner()) { Some(slice) => slice, None => Vec::from_iter_in( arg_layouts.iter().cloned().map(|layout| Param { @@ -356,7 +356,7 @@ impl<'a> BorrowInfState<'a> { Stmt::Ret(z), ) = (v, b) { - let g = call_type.into_inner(); + let g = call_type.get_inner(); if self.current_proc == g && x == *z { // anonymous functions (for which the ps may not be known) // can never be tail-recursive, so this is fine @@ -460,7 +460,7 @@ impl<'a> BorrowInfState<'a> { } } -pub fn lowlevel_borrow_signature<'a>(arena: &'a Bump, op: LowLevel) -> &'a [bool] { +pub fn lowlevel_borrow_signature(arena: &Bump, op: LowLevel) -> &[bool] { use LowLevel::*; // TODO is true or false more efficient for non-refcounted layouts? diff --git a/compiler/mono/src/inc_dec.rs b/compiler/mono/src/inc_dec.rs index c4af16e96d..c0b43138f4 100644 --- a/compiler/mono/src/inc_dec.rs +++ b/compiler/mono/src/inc_dec.rs @@ -444,10 +444,8 @@ impl<'a> Context<'a> { call_type, .. } => { - let symbol = call_type.into_inner(); - // get the borrow signature - let ps = match self.param_map.get_symbol(call_type.into_inner()) { + let ps = match self.param_map.get_symbol(call_type.get_inner()) { Some(slice) => slice, None => Vec::from_iter_in( arg_layouts.iter().cloned().map(|layout| Param { @@ -786,13 +784,9 @@ pub fn collect_stmt( vars.extend(arguments.iter().copied()); // NOTE deviation from Lean - match jp_live_vars.get(id) { - Some(jvars) => { - vars.extend(jvars); - } - None => { - // a jump occured in the "remainder" of the join point, e.g. - } + // we fall through when no join point is available + if let Some(jvars) = jp_live_vars.get(id) { + vars.extend(jvars); } vars diff --git a/compiler/mono/src/ir.rs b/compiler/mono/src/ir.rs index 7b4a0d6d74..d6dff5a32b 100644 --- a/compiler/mono/src/ir.rs +++ b/compiler/mono/src/ir.rs @@ -525,7 +525,7 @@ pub enum CallType { } impl CallType { - pub fn into_inner(&self) -> Symbol { + pub fn get_inner(&self) -> Symbol { match self { CallType::ByName(s) => *s, CallType::ByPointer(s) => *s,