From 6783b66db70b20baf49a0054e963cf2424b11ce1 Mon Sep 17 00:00:00 2001 From: Folkert Date: Wed, 27 Apr 2022 16:44:29 +0200 Subject: [PATCH] stop using env.closures --- compiler/can/src/def.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/compiler/can/src/def.rs b/compiler/can/src/def.rs index 6115566172..f41b8cd377 100644 --- a/compiler/can/src/def.rs +++ b/compiler/can/src/def.rs @@ -1181,17 +1181,9 @@ fn canonicalize_pending_value_def<'a>( // reset the tailcallable_symbol env.tailcallable_symbol = outer_identifier; + let closure_references = can_output.references.clone(); output.references.union_mut(&can_output.references); - // Since everywhere in the code it'll be referred to by its defined name, - // remove its generated name from the closure map. (We'll re-insert it later.) - let closure_references = env.closures.remove(&closure_data.name).unwrap_or_else(|| { - panic!( - "Tried to remove symbol {:?} from procedures, but it was not found: {:?}", - closure_data.name, env.closures - ) - }); - // The closure is self tail recursive iff it tail calls itself (by defined name). let is_recursive = match can_output.tail_call { Some(tail_symbol) if tail_symbol == *symbol => Recursive::TailRecursive,