@@ -315,7 +315,7 @@ impl<'ctx> BlockContext<'ctx> {
315315
316316 for key in c. possibilities . keys ( ) {
317317 for changed_var_id in changed_var_ids {
318- if changed_var_id == key || var_has_root ( key, changed_var_id) {
318+ if changed_var_id == key || var_has_root ( * key, * changed_var_id) {
319319 rejected_clauses. push ( c. clone ( ) ) ;
320320 continue ' outer;
321321 }
@@ -353,7 +353,7 @@ impl<'ctx> BlockContext<'ctx> {
353353
354354 pub ( crate ) fn filter_clauses < ' arena > (
355355 context : & mut Context < ' ctx , ' arena > ,
356- remove_var_id : & Atom ,
356+ remove_var_id : Atom ,
357357 clauses : Vec < Rc < Clause > > ,
358358 new_type : Option < & TUnion > ,
359359 ) -> Vec < Rc < Clause > > {
@@ -362,7 +362,7 @@ impl<'ctx> BlockContext<'ctx> {
362362
363363 ' outer: for clause in clauses {
364364 for var_id in clause. possibilities . keys ( ) {
365- if var_has_root ( var_id, remove_var_id) {
365+ if var_has_root ( * var_id, remove_var_id) {
366366 continue ' outer;
367367 }
368368 }
@@ -381,7 +381,7 @@ impl<'ctx> BlockContext<'ctx> {
381381 {
382382 for clause in other_clauses {
383383 let mut type_changed = false ;
384- let Some ( possibilities) = clause. possibilities . get ( remove_var_id) else {
384+ let Some ( possibilities) = clause. possibilities . get ( & remove_var_id) else {
385385 clauses_to_keep. push ( clause. clone ( ) ) ;
386386
387387 continue ;
@@ -422,18 +422,18 @@ impl<'ctx> BlockContext<'ctx> {
422422 pub ( crate ) fn remove_variable_from_conflicting_clauses < ' arena > (
423423 & mut self ,
424424 context : & mut Context < ' ctx , ' arena > ,
425- remove_var_id : & Atom ,
425+ remove_var_id : Atom ,
426426 new_type : Option < & TUnion > ,
427427 ) {
428428 self . clauses = BlockContext :: filter_clauses ( context, remove_var_id, self . clauses . clone ( ) , new_type) ;
429429
430- self . parent_conflicting_clause_variables . insert ( * remove_var_id) ;
430+ self . parent_conflicting_clause_variables . insert ( remove_var_id) ;
431431 }
432432
433433 pub ( crate ) fn remove_descendants < ' arena > (
434434 & mut self ,
435435 context : & mut Context < ' ctx , ' arena > ,
436- remove_var_id : & Atom ,
436+ remove_var_id : Atom ,
437437 existing_type : & TUnion ,
438438 new_type : Option < & TUnion > ,
439439 ) {
@@ -452,7 +452,7 @@ impl<'ctx> BlockContext<'ctx> {
452452 let keys = self . locals . keys ( ) . copied ( ) . collect :: < Vec < _ > > ( ) ;
453453
454454 for var_id in keys {
455- if var_has_root ( & var_id, remove_var_id) {
455+ if var_has_root ( var_id, remove_var_id) {
456456 self . locals . remove ( & var_id) ;
457457 }
458458 }
@@ -505,7 +505,7 @@ impl<'ctx> BlockContext<'ctx> {
505505 if let Some ( existing_type) = self . locals . remove ( & var_atom)
506506 && remove_descendants
507507 {
508- self . remove_descendants ( context, & var_atom, & existing_type, None ) ;
508+ self . remove_descendants ( context, var_atom, & existing_type, None ) ;
509509 }
510510
511511 self . assigned_variable_ids . remove ( & var_atom) ;
@@ -565,7 +565,7 @@ impl<'ctx> BlockContext<'ctx> {
565565 start_block_context : & Self ,
566566 end_block_context : & mut Self ,
567567 has_leaving_statements : bool ,
568- vars_to_update : AtomSet ,
568+ vars_to_update : & AtomSet ,
569569 updated_vars : & mut AtomSet ,
570570 ) {
571571 for ( variable_id, old_type) in & start_block_context. locals {
@@ -709,8 +709,8 @@ pub fn subtract_union_types(context: &mut Context<'_, '_>, existing_type: TUnion
709709 result
710710}
711711
712- fn should_keep_clause ( clause : & Rc < Clause > , remove_var_id : & Atom , new_type : Option < & TUnion > ) -> bool {
713- if let Some ( possibilities) = clause. possibilities . get ( remove_var_id) {
712+ fn should_keep_clause ( clause : & Rc < Clause > , remove_var_id : Atom , new_type : Option < & TUnion > ) -> bool {
713+ if let Some ( possibilities) = clause. possibilities . get ( & remove_var_id) {
714714 if possibilities. len ( ) == 1
715715 && let Some ( ( _, Assertion :: IsType ( assertion_type) ) ) = possibilities. first ( )
716716 && let Some ( new_type) = new_type
0 commit comments