@@ -78,7 +78,7 @@ fn test_compilation_pipeline_simple_function() {
7878 span : test_span ( ) ,
7979 } ;
8080
81- let program = create_test_program ( & mut arena, "return_42" , body) ;
81+ let mut program = create_test_program ( & mut arena, "return_42" , body) ;
8282
8383 // Run compilation pipeline
8484 let config = CompilationConfig {
@@ -88,7 +88,7 @@ fn test_compilation_pipeline_simple_function() {
8888 ..Default :: default ( )
8989 } ;
9090
91- let result = compile_to_hir ( & program, type_registry, config) ;
91+ let result = compile_to_hir ( & mut program, type_registry, config) ;
9292 assert ! ( result. is_ok( ) , "Compilation should succeed: {:?}" , result. err( ) ) ;
9393
9494 let hir_module = result. unwrap ( ) ;
@@ -153,7 +153,7 @@ fn test_compilation_pipeline_binary_operation() {
153153 span : test_span ( ) ,
154154 } ;
155155
156- let program = create_test_program ( & mut arena, "add_numbers" , body) ;
156+ let mut program = create_test_program ( & mut arena, "add_numbers" , body) ;
157157
158158 // Run compilation pipeline
159159 let config = CompilationConfig {
@@ -163,7 +163,7 @@ fn test_compilation_pipeline_binary_operation() {
163163 ..Default :: default ( )
164164 } ;
165165
166- let result = compile_to_hir ( & program, type_registry, config) ;
166+ let result = compile_to_hir ( & mut program, type_registry, config) ;
167167 assert ! ( result. is_ok( ) , "Compilation should succeed: {:?}" , result. err( ) ) ;
168168
169169 let hir_module = result. unwrap ( ) ;
@@ -328,7 +328,7 @@ fn test_compilation_pipeline_with_analysis() {
328328 span : test_span ( ) ,
329329 } ;
330330
331- let program = create_test_program ( & mut arena, "test_analysis" , body) ;
331+ let mut program = create_test_program ( & mut arena, "test_analysis" , body) ;
332332
333333 // Run compilation with all passes enabled
334334 let config = CompilationConfig {
@@ -338,7 +338,7 @@ fn test_compilation_pipeline_with_analysis() {
338338 ..Default :: default ( )
339339 } ;
340340
341- let result = compile_to_hir ( & program, type_registry, config) ;
341+ let result = compile_to_hir ( & mut program, type_registry, config) ;
342342 assert ! ( result. is_ok( ) , "Compilation with analysis should succeed" ) ;
343343
344344 let hir_module = result. unwrap ( ) ;
@@ -370,7 +370,7 @@ fn test_compilation_pipeline_with_memory_management() {
370370 span : test_span ( ) ,
371371 } ;
372372
373- let program = create_test_program ( & mut arena, "test_memory" , body) ;
373+ let mut program = create_test_program ( & mut arena, "test_memory" , body) ;
374374
375375 // Run compilation with ARC memory strategy
376376 let config = CompilationConfig {
@@ -381,7 +381,7 @@ fn test_compilation_pipeline_with_memory_management() {
381381 ..Default :: default ( )
382382 } ;
383383
384- let result = compile_to_hir ( & program, type_registry, config) ;
384+ let result = compile_to_hir ( & mut program, type_registry, config) ;
385385 assert ! ( result. is_ok( ) , "Compilation with ARC should succeed" ) ;
386386
387387 let hir_module = result. unwrap ( ) ;
@@ -411,7 +411,7 @@ fn test_compilation_pipeline_without_memory_management() {
411411 span : test_span ( ) ,
412412 } ;
413413
414- let program = create_test_program ( & mut arena, "test_no_memory" , body) ;
414+ let mut program = create_test_program ( & mut arena, "test_no_memory" , body) ;
415415
416416 // Run compilation with memory management disabled
417417 let config = CompilationConfig {
@@ -422,7 +422,7 @@ fn test_compilation_pipeline_without_memory_management() {
422422 ..Default :: default ( )
423423 } ;
424424
425- let result = compile_to_hir ( & program, type_registry, config) ;
425+ let result = compile_to_hir ( & mut program, type_registry, config) ;
426426 assert ! ( result. is_ok( ) , "Compilation without memory management should succeed" ) ;
427427
428428 let hir_module = result. unwrap ( ) ;
@@ -452,7 +452,7 @@ fn test_compilation_pipeline_with_gc_strategy() {
452452 span : test_span ( ) ,
453453 } ;
454454
455- let program = create_test_program ( & mut arena, "test_gc" , body) ;
455+ let mut program = create_test_program ( & mut arena, "test_gc" , body) ;
456456
457457 // Run compilation with GC memory strategy
458458 let config = CompilationConfig {
@@ -463,7 +463,7 @@ fn test_compilation_pipeline_with_gc_strategy() {
463463 ..Default :: default ( )
464464 } ;
465465
466- let result = compile_to_hir ( & program, type_registry, config) ;
466+ let result = compile_to_hir ( & mut program, type_registry, config) ;
467467 assert ! ( result. is_ok( ) , "Compilation with GC should succeed" ) ;
468468
469469 let hir_module = result. unwrap ( ) ;
@@ -509,7 +509,7 @@ fn test_compilation_pipeline_all_features() {
509509 span : test_span ( ) ,
510510 } ;
511511
512- let program = create_test_program ( & mut arena, "test_all_features" , body) ;
512+ let mut program = create_test_program ( & mut arena, "test_all_features" , body) ;
513513
514514 // Run compilation with ALL features enabled
515515 let config = CompilationConfig {
@@ -523,7 +523,7 @@ fn test_compilation_pipeline_all_features() {
523523 import_resolver : None ,
524524 } ;
525525
526- let result = compile_to_hir ( & program, type_registry, config) ;
526+ let result = compile_to_hir ( & mut program, type_registry, config) ;
527527 assert ! ( result. is_ok( ) , "Compilation with all features should succeed" ) ;
528528
529529 let hir_module = result. unwrap ( ) ;
@@ -576,7 +576,7 @@ fn test_compilation_pipeline_with_memory_optimizations() {
576576 span : test_span ( ) ,
577577 } ;
578578
579- let program = create_test_program ( & mut arena, "test_opt" , body) ;
579+ let mut program = create_test_program ( & mut arena, "test_opt" , body) ;
580580
581581 // Run compilation with full optimization including memory optimizations
582582 let config = CompilationConfig {
@@ -590,7 +590,7 @@ fn test_compilation_pipeline_with_memory_optimizations() {
590590 import_resolver : None ,
591591 } ;
592592
593- let result = compile_to_hir ( & program, type_registry, config) ;
593+ let result = compile_to_hir ( & mut program, type_registry, config) ;
594594 assert ! ( result. is_ok( ) , "Compilation with memory optimizations should succeed" ) ;
595595
596596 let hir_module = result. unwrap ( ) ;
@@ -658,7 +658,7 @@ fn test_compilation_pipeline_with_async_function() -> CompilerResult<()> {
658658 ..Default :: default ( )
659659 } ;
660660
661- let hir_module = compile_to_hir ( & program, type_registry, config) ?;
661+ let hir_module = compile_to_hir ( & mut program, type_registry, config) ?;
662662
663663 // Verify module was created
664664 // Async functions generate additional state machine functions, so we expect >= 1
@@ -728,7 +728,7 @@ fn test_compilation_pipeline_without_async_runtime() -> CompilerResult<()> {
728728 ..Default :: default ( )
729729 } ;
730730
731- let hir_module = compile_to_hir ( & program, type_registry, config) ?;
731+ let hir_module = compile_to_hir ( & mut program, type_registry, config) ?;
732732
733733 // Verify module was created
734734 assert ! ( hir_module. functions. len( ) >= 1 , "Should have at least one function" ) ;
@@ -835,7 +835,7 @@ fn test_compilation_pipeline_mixed_sync_async() -> CompilerResult<()> {
835835 ..Default :: default ( )
836836 } ;
837837
838- let hir_module = compile_to_hir ( & program, type_registry, config) ?;
838+ let hir_module = compile_to_hir ( & mut program, type_registry, config) ?;
839839
840840 // Verify both functions were created
841841 // Async functions may generate additional state machine functions
@@ -879,7 +879,7 @@ fn test_compilation_pipeline_while_loop() {
879879 span : test_span ( ) ,
880880 } ;
881881
882- let program = create_test_program ( & mut arena, "test_while" , body) ;
882+ let mut program = create_test_program ( & mut arena, "test_while" , body) ;
883883
884884 let config = CompilationConfig {
885885 opt_level : 0 ,
@@ -888,7 +888,7 @@ fn test_compilation_pipeline_while_loop() {
888888 ..Default :: default ( )
889889 } ;
890890
891- let result = compile_to_hir ( & program, type_registry, config) ;
891+ let result = compile_to_hir ( & mut program, type_registry, config) ;
892892 assert ! ( result. is_ok( ) , "While loop compilation should succeed: {:?}" , result. err( ) ) ;
893893
894894 let hir_module = result. unwrap ( ) ;
@@ -937,7 +937,7 @@ fn test_compilation_pipeline_infinite_loop_with_break() {
937937 span : test_span ( ) ,
938938 } ;
939939
940- let program = create_test_program ( & mut arena, "test_loop_break" , body) ;
940+ let mut program = create_test_program ( & mut arena, "test_loop_break" , body) ;
941941
942942 let config = CompilationConfig {
943943 opt_level : 0 ,
@@ -946,7 +946,7 @@ fn test_compilation_pipeline_infinite_loop_with_break() {
946946 ..Default :: default ( )
947947 } ;
948948
949- let result = compile_to_hir ( & program, type_registry, config) ;
949+ let result = compile_to_hir ( & mut program, type_registry, config) ;
950950 assert ! ( result. is_ok( ) , "Infinite loop with break should compile: {:?}" , result. err( ) ) ;
951951
952952 let hir_module = result. unwrap ( ) ;
@@ -978,7 +978,7 @@ fn test_compilation_pipeline_nested_blocks() {
978978 span : test_span ( ) ,
979979 } ;
980980
981- let program = create_test_program ( & mut arena, "test_nested_blocks" , outer_block) ;
981+ let mut program = create_test_program ( & mut arena, "test_nested_blocks" , outer_block) ;
982982
983983 let config = CompilationConfig {
984984 opt_level : 0 ,
@@ -987,7 +987,7 @@ fn test_compilation_pipeline_nested_blocks() {
987987 ..Default :: default ( )
988988 } ;
989989
990- let result = compile_to_hir ( & program, type_registry, config) ;
990+ let result = compile_to_hir ( & mut program, type_registry, config) ;
991991 assert ! ( result. is_ok( ) , "Nested blocks should compile: {:?}" , result. err( ) ) ;
992992
993993 let hir_module = result. unwrap ( ) ;
0 commit comments