diff --git a/compiler/gen/src/llvm/build.rs b/compiler/gen/src/llvm/build.rs index 766a7ab6b2..1042065bee 100644 --- a/compiler/gen/src/llvm/build.rs +++ b/compiler/gen/src/llvm/build.rs @@ -3339,7 +3339,7 @@ pub fn build_proc<'a, 'ctx, 'env>( let evaluator_layout = env.arena.alloc(top_level).full(); let evaluator_name = layout_ids - .get_new(symbol, evaluator_layout) + .get(symbol, &evaluator_layout) .to_symbol_string(symbol, &env.interns); let evaluator = function_value_by_name_help( @@ -3416,7 +3416,7 @@ fn function_value_by_name<'a, 'ctx, 'env>( symbol: Symbol, ) -> FunctionValue<'ctx> { let fn_name = layout_ids - .get_new(symbol, layout) + .get(symbol, &layout) .to_symbol_string(symbol, &env.interns); let fn_name = fn_name.as_str(); diff --git a/compiler/mono/src/layout.rs b/compiler/mono/src/layout.rs index 141ca58ad6..b13bc1a4ef 100644 --- a/compiler/mono/src/layout.rs +++ b/compiler/mono/src/layout.rs @@ -1894,10 +1894,6 @@ impl<'a> LayoutIds<'a> { /// Returns a LayoutId which is unique for the given symbol and layout. /// If given the same symbol and same layout, returns the same LayoutId. pub fn get<'b>(&mut self, symbol: Symbol, layout: &'b Layout<'a>) -> LayoutId { - self.get_new(symbol, *layout) - } - - pub fn get_new(&mut self, symbol: Symbol, layout: Layout<'a>) -> LayoutId { // Note: this function does some weird stuff to satisfy the borrow checker. // There's probably a nicer way to write it that still works. let ids = self.by_symbol.entry(symbol).or_insert_with(|| IdsByLayout { @@ -1911,7 +1907,7 @@ impl<'a> LayoutIds<'a> { // If we had to default to next_id, it must not have been found; // store the ID we're going to return and increment next_id. if answer == ids.next_id { - ids.by_id.insert(layout, ids.next_id); + ids.by_id.insert(*layout, ids.next_id); ids.next_id += 1; }