From fbbc45c20a55e5a64905ce77696fd9a131004fb5 Mon Sep 17 00:00:00 2001 From: Lucian Popescu Date: Thu, 4 Jun 2026 18:24:10 +0100 Subject: [PATCH] Don't hoist literal arguments --- cpp2rust/converter/converter.cpp | 2 +- cpp2rust/converter/converter_lib.cpp | 8 ++ cpp2rust/converter/converter_lib.h | 2 + tests/benchmarks/out/refcount/bfs.rs | 3 +- tests/benchmarks/out/refcount/fibonacci.rs | 5 +- tests/benchmarks/out/unsafe/bfs.rs | 3 +- tests/benchmarks/out/unsafe/fibonacci.rs | 5 +- .../out/refcount/extern_functions.rs | 8 +- .../out/unsafe/extern_functions.rs | 8 +- .../out/refcount/header_function.rs | 8 +- .../out/unsafe/header_function.rs | 8 +- tests/unit/out/refcount/alloc_array.rs | 3 +- .../out/refcount/bool_condition_logical.rs | 14 +-- .../out/refcount/bool_condition_logical_c.rs | 16 +-- tests/unit/out/refcount/break.rs | 5 +- tests/unit/out/refcount/bst.rs | 18 +-- tests/unit/out/refcount/class.rs | 10 +- tests/unit/out/refcount/doubly_linked_list.rs | 108 ++++++------------ tests/unit/out/refcount/dowhile.rs | 5 +- tests/unit/out/refcount/enum_int_interop.rs | 10 +- tests/unit/out/refcount/enum_int_interop_c.rs | 10 +- tests/unit/out/refcount/expr_as_bool_c.rs | 8 +- tests/unit/out/refcount/expr_as_bool_cpp.rs | 7 +- tests/unit/out/refcount/fcall.rs | 6 +- tests/unit/out/refcount/fn_ptr_array.rs | 24 +--- tests/unit/out/refcount/fn_ptr_cast.rs | 31 +---- tests/unit/out/refcount/fn_ptr_conditional.rs | 29 +---- tests/unit/out/refcount/fn_ptr_default_arg.rs | 12 +- tests/unit/out/refcount/fn_ptr_global.rs | 28 +---- tests/unit/out/refcount/fn_ptr_reassign.rs | 32 +----- tests/unit/out/refcount/fn_ptr_return.rs | 28 +---- .../out/refcount/fn_ptr_stdlib_compare.rs | 16 +-- tests/unit/out/refcount/fn_ptr_struct.rs | 21 +--- tests/unit/out/refcount/fn_ptr_vtable.rs | 7 +- tests/unit/out/refcount/function_call.rs | 8 +- .../unit/out/refcount/function_overloading.rs | 21 +--- .../out/refcount/goto_aggregate_default.rs | 8 +- tests/unit/out/refcount/goto_backward.rs | 8 +- tests/unit/out/refcount/goto_cleanup.rs | 40 +------ tests/unit/out/refcount/goto_multi_label.rs | 16 +-- tests/unit/out/refcount/goto_nested_label.rs | 8 +- .../out/refcount/goto_switch_fallthrough.rs | 24 +--- tests/unit/out/refcount/huffman.rs | 8 +- tests/unit/out/refcount/kruskal.rs | 3 +- .../unit/out/refcount/lambda_capture_pass.rs | 9 +- tests/unit/out/refcount/lambda_nested.rs | 20 +--- tests/unit/out/refcount/linked_list.rs | 24 ++-- tests/unit/out/refcount/macros.rs | 4 +- tests/unit/out/refcount/matmul.rs | 9 +- tests/unit/out/refcount/new_bst.rs | 30 ++--- tests/unit/out/refcount/push_emplace_back.rs | 6 +- tests/unit/out/refcount/refs_as_args.rs | 4 +- tests/unit/out/refcount/reserved_keywords.rs | 80 +------------ tests/unit/out/refcount/static_shadow.rs | 8 +- tests/unit/out/refcount/string_literals.rs | 10 +- tests/unit/out/refcount/string_literals_c.rs | 15 +-- .../out/refcount/string_literals_return.rs | 7 +- .../out/refcount/string_literals_return_c.rs | 7 +- tests/unit/out/refcount/strlen_rec.rs | 3 +- tests/unit/out/refcount/switch_basic.rs | 21 +--- .../switch_borrow_in_condition_and_in_body.rs | 14 +-- .../out/refcount/switch_case_then_default.rs | 21 +--- .../switch_cases_and_default_stacked.rs | 28 +---- tests/unit/out/refcount/switch_char.rs | 35 +----- .../unit/out/refcount/switch_complex_cond.rs | 9 +- .../out/refcount/switch_compound_case_body.rs | 21 +--- .../refcount/switch_continue_inside_switch.rs | 7 +- .../unit/out/refcount/switch_default_first.rs | 14 +-- .../out/refcount/switch_default_middle.rs | 21 +--- .../out/refcount/switch_default_then_case.rs | 28 +---- .../refcount/switch_empty_case_with_break.rs | 21 +--- .../unit/out/refcount/switch_empty_switch.rs | 7 +- .../out/refcount/switch_fallthrough_chain.rs | 35 +----- .../refcount/switch_fallthrough_default.rs | 24 +--- .../refcount/switch_fallthrough_into_block.rs | 21 +--- .../out/refcount/switch_fallthrough_one.rs | 21 +--- .../refcount/switch_for_in_switch_break.rs | 14 +-- .../refcount/switch_for_in_switch_continue.rs | 14 +-- .../refcount/switch_for_switch_for_break.rs | 7 +- tests/unit/out/refcount/switch_in_dowhile.rs | 14 +-- tests/unit/out/refcount/switch_in_loop.rs | 7 +- .../refcount/switch_mixed_literal_cases.rs | 21 +--- .../out/refcount/switch_mixed_return_break.rs | 28 +---- tests/unit/out/refcount/switch_nested.rs | 32 +----- tests/unit/out/refcount/switch_no_default.rs | 14 +-- .../unit/out/refcount/switch_on_assignment.rs | 21 +--- tests/unit/out/refcount/switch_on_call.rs | 28 +---- .../unit/out/refcount/switch_only_default.rs | 7 +- tests/unit/out/refcount/switch_stacked.rs | 28 +---- .../unit/out/refcount/switch_stacked_block.rs | 14 +-- .../switch_stacked_with_inner_fallthrough.rs | 24 +--- .../refcount/switch_while_in_switch_break.rs | 14 +-- tests/unit/out/refcount/templates.rs | 16 +-- tests/unit/out/refcount/unique_ptr.rs | 10 +- .../out/refcount/unique_ptr_const_deref.rs | 3 +- .../out/refcount/user_defined_same_as_libc.rs | 7 +- tests/unit/out/refcount/va_arg_chain.rs | 19 +-- tests/unit/out/refcount/va_arg_concat.rs | 16 +-- tests/unit/out/refcount/va_arg_conditional.rs | 14 +-- tests/unit/out/refcount/va_arg_copy.rs | 5 +- tests/unit/out/refcount/va_arg_fn_ptr.rs | 19 +-- tests/unit/out/refcount/va_arg_forward.rs | 24 +--- .../unit/out/refcount/va_arg_mixed_int_ptr.rs | 16 +-- tests/unit/out/refcount/va_arg_mixed_types.rs | 14 +-- .../unit/out/refcount/va_arg_null_int_ptr.rs | 20 +--- tests/unit/out/refcount/va_arg_printf.rs | 9 +- tests/unit/out/refcount/va_arg_promotion.rs | 3 +- tests/unit/out/refcount/va_arg_snprintf.rs | 8 +- tests/unit/out/refcount/va_arg_struct_ctx.rs | 6 +- tests/unit/out/refcount/va_arg_two_passes.rs | 6 +- tests/unit/out/refcount/void_cast.rs | 5 +- tests/unit/out/unsafe/alloc_array.rs | 3 +- .../unit/out/unsafe/bool_condition_logical.rs | 14 +-- .../out/unsafe/bool_condition_logical_c.rs | 16 +-- tests/unit/out/unsafe/break.rs | 5 +- tests/unit/out/unsafe/bst.rs | 18 +-- tests/unit/out/unsafe/class.rs | 10 +- tests/unit/out/unsafe/doubly_linked_list.rs | 108 ++++++------------ tests/unit/out/unsafe/dowhile.rs | 5 +- tests/unit/out/unsafe/enum_int_interop.rs | 10 +- tests/unit/out/unsafe/enum_int_interop_c.rs | 10 +- tests/unit/out/unsafe/expr_as_bool_c.rs | 8 +- tests/unit/out/unsafe/expr_as_bool_cpp.rs | 7 +- tests/unit/out/unsafe/fcall.rs | 6 +- tests/unit/out/unsafe/fn_ptr_array.rs | 24 +--- tests/unit/out/unsafe/fn_ptr_cast.rs | 31 +---- tests/unit/out/unsafe/fn_ptr_conditional.rs | 31 +---- tests/unit/out/unsafe/fn_ptr_default_arg.rs | 12 +- tests/unit/out/unsafe/fn_ptr_global.rs | 28 +---- tests/unit/out/unsafe/fn_ptr_reassign.rs | 32 +----- tests/unit/out/unsafe/fn_ptr_return.rs | 24 +--- .../unit/out/unsafe/fn_ptr_stdlib_compare.rs | 16 +-- tests/unit/out/unsafe/fn_ptr_struct.rs | 21 +--- tests/unit/out/unsafe/fn_ptr_vtable.rs | 5 +- tests/unit/out/unsafe/function_call.rs | 6 +- tests/unit/out/unsafe/function_overloading.rs | 21 +--- .../unit/out/unsafe/goto_aggregate_default.rs | 8 +- tests/unit/out/unsafe/goto_backward.rs | 8 +- tests/unit/out/unsafe/goto_cleanup.rs | 40 +------ tests/unit/out/unsafe/goto_multi_label.rs | 16 +-- tests/unit/out/unsafe/goto_nested_label.rs | 8 +- .../out/unsafe/goto_switch_fallthrough.rs | 24 +--- tests/unit/out/unsafe/huffman.rs | 8 +- tests/unit/out/unsafe/kruskal.rs | 3 +- tests/unit/out/unsafe/lambda_capture_pass.rs | 9 +- tests/unit/out/unsafe/lambda_nested.rs | 12 +- tests/unit/out/unsafe/linked_list.rs | 24 ++-- tests/unit/out/unsafe/macros.rs | 4 +- tests/unit/out/unsafe/malloc_realloc_free.rs | 3 +- tests/unit/out/unsafe/matmul.rs | 9 +- tests/unit/out/unsafe/new_bst.rs | 30 ++--- tests/unit/out/unsafe/push_emplace_back.rs | 6 +- tests/unit/out/unsafe/refs_as_args.rs | 4 +- tests/unit/out/unsafe/reserved_keywords.rs | 80 +------------ tests/unit/out/unsafe/static_shadow.rs | 8 +- tests/unit/out/unsafe/string_literals.rs | 10 +- tests/unit/out/unsafe/string_literals_c.rs | 15 +-- .../unit/out/unsafe/string_literals_return.rs | 5 +- .../out/unsafe/string_literals_return_c.rs | 5 +- tests/unit/out/unsafe/strlen_rec.rs | 3 +- tests/unit/out/unsafe/switch_basic.rs | 21 +--- .../switch_borrow_in_condition_and_in_body.rs | 14 +-- .../out/unsafe/switch_case_then_default.rs | 21 +--- .../switch_cases_and_default_stacked.rs | 28 +---- tests/unit/out/unsafe/switch_char.rs | 35 +----- tests/unit/out/unsafe/switch_complex_cond.rs | 9 +- .../out/unsafe/switch_compound_case_body.rs | 21 +--- .../unsafe/switch_continue_inside_switch.rs | 7 +- tests/unit/out/unsafe/switch_default_first.rs | 14 +-- .../unit/out/unsafe/switch_default_middle.rs | 21 +--- .../out/unsafe/switch_default_then_case.rs | 28 +---- .../unsafe/switch_empty_case_with_break.rs | 21 +--- tests/unit/out/unsafe/switch_empty_switch.rs | 7 +- .../out/unsafe/switch_fallthrough_chain.rs | 35 +----- .../out/unsafe/switch_fallthrough_default.rs | 24 +--- .../unsafe/switch_fallthrough_into_block.rs | 21 +--- .../unit/out/unsafe/switch_fallthrough_one.rs | 21 +--- .../out/unsafe/switch_for_in_switch_break.rs | 14 +-- .../unsafe/switch_for_in_switch_continue.rs | 14 +-- .../out/unsafe/switch_for_switch_for_break.rs | 7 +- tests/unit/out/unsafe/switch_in_dowhile.rs | 14 +-- tests/unit/out/unsafe/switch_in_loop.rs | 7 +- .../out/unsafe/switch_mixed_literal_cases.rs | 21 +--- .../out/unsafe/switch_mixed_return_break.rs | 28 +---- tests/unit/out/unsafe/switch_nested.rs | 32 +----- tests/unit/out/unsafe/switch_no_default.rs | 14 +-- tests/unit/out/unsafe/switch_on_assignment.rs | 21 +--- tests/unit/out/unsafe/switch_on_call.rs | 28 +---- tests/unit/out/unsafe/switch_only_default.rs | 7 +- tests/unit/out/unsafe/switch_stacked.rs | 28 +---- tests/unit/out/unsafe/switch_stacked_block.rs | 14 +-- .../switch_stacked_with_inner_fallthrough.rs | 24 +--- .../unsafe/switch_while_in_switch_break.rs | 14 +-- tests/unit/out/unsafe/templates.rs | 16 +-- .../out/unsafe/union_void_ptr_sized_deref.rs | 9 +- tests/unit/out/unsafe/unique_ptr.rs | 10 +- .../unit/out/unsafe/unique_ptr_const_deref.rs | 3 +- .../out/unsafe/user_defined_same_as_libc.rs | 7 +- tests/unit/out/unsafe/va_arg_chain.rs | 20 +--- tests/unit/out/unsafe/va_arg_concat.rs | 17 +-- tests/unit/out/unsafe/va_arg_conditional.rs | 16 ++- tests/unit/out/unsafe/va_arg_copy.rs | 6 +- tests/unit/out/unsafe/va_arg_fn_ptr.rs | 12 +- tests/unit/out/unsafe/va_arg_forward.rs | 21 +--- tests/unit/out/unsafe/va_arg_mixed_int_ptr.rs | 15 +-- tests/unit/out/unsafe/va_arg_mixed_types.rs | 14 +-- tests/unit/out/unsafe/va_arg_null_int_ptr.rs | 12 +- tests/unit/out/unsafe/va_arg_printf.rs | 9 +- tests/unit/out/unsafe/va_arg_promotion.rs | 3 +- tests/unit/out/unsafe/va_arg_snprintf.rs | 18 ++- tests/unit/out/unsafe/va_arg_struct_ctx.rs | 14 ++- tests/unit/out/unsafe/va_arg_two_passes.rs | 6 +- tests/unit/out/unsafe/void_cast.rs | 5 +- 213 files changed, 656 insertions(+), 2768 deletions(-) diff --git a/cpp2rust/converter/converter.cpp b/cpp2rust/converter/converter.cpp index 3c96df3c..f6702629 100644 --- a/cpp2rust/converter/converter.cpp +++ b/cpp2rust/converter/converter.cpp @@ -1635,7 +1635,7 @@ Converter::CallInfo Converter::CollectCallInfo(clang::CallExpr *expr) { : proto->getParamType(i), .expr = arg, .has_default = function && function->getParamDecl(i)->hasDefaultArg(), - .kind = Kind::Hoisted, + .kind = IsLiteral(arg) ? Kind::Inline : Kind::Hoisted, }; bool is_materialize = clang::isa(arg); if (is_materialize && ca.param_type->isLValueReferenceType()) { diff --git a/cpp2rust/converter/converter_lib.cpp b/cpp2rust/converter/converter_lib.cpp index 474eaecd..227a7d2a 100644 --- a/cpp2rust/converter/converter_lib.cpp +++ b/cpp2rust/converter/converter_lib.cpp @@ -265,6 +265,14 @@ bool IsAsciiStringLiteral(const clang::StringLiteral *str) { return true; } +bool IsLiteral(const clang::Expr *expr) { + expr = expr->IgnoreParenImpCasts(); + return clang::isa(expr); +} + bool IsInitExprOfStringLiteral(const clang::InitListExpr *expr) { auto type = expr->getType(); return expr->getNumInits() == 1 && type->isArrayType() && diff --git a/cpp2rust/converter/converter_lib.h b/cpp2rust/converter/converter_lib.h index 34c94da4..e606a2e3 100644 --- a/cpp2rust/converter/converter_lib.h +++ b/cpp2rust/converter/converter_lib.h @@ -71,6 +71,8 @@ bool IsAsciiStringLiteral(const clang::StringLiteral *str); bool IsInitExprOfStringLiteral(const clang::InitListExpr *expr); +bool IsLiteral(const clang::Expr *expr); + std::vector GetTemplateInstantiatedCtors(clang::CXXRecordDecl *decl); diff --git a/tests/benchmarks/out/refcount/bfs.rs b/tests/benchmarks/out/refcount/bfs.rs index bd7a1bb4..ac31d5dc 100644 --- a/tests/benchmarks/out/refcount/bfs.rs +++ b/tests/benchmarks/out/refcount/bfs.rs @@ -225,8 +225,7 @@ fn main_0() -> i32 { let pred: Value> = Rc::new(RefCell::new( ({ let _graph: Ptr = graph.as_pointer(); - let _start_vertex: u32 = 0_u32; - BFS_0(_graph, _start_vertex) + BFS_0(_graph, 0_u32) }), )); let i: Value = Rc::new(RefCell::new(0_u32)); diff --git a/tests/benchmarks/out/refcount/fibonacci.rs b/tests/benchmarks/out/refcount/fibonacci.rs index 4cbde375..ad57828b 100644 --- a/tests/benchmarks/out/refcount/fibonacci.rs +++ b/tests/benchmarks/out/refcount/fibonacci.rs @@ -27,8 +27,5 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - return (({ - let _n: u64 = 46_u64; - fib_0(_n) - }) as i32); + return (({ fib_0(46_u64) }) as i32); } diff --git a/tests/benchmarks/out/unsafe/bfs.rs b/tests/benchmarks/out/unsafe/bfs.rs index 95278efe..1d9f1ba5 100644 --- a/tests/benchmarks/out/unsafe/bfs.rs +++ b/tests/benchmarks/out/unsafe/bfs.rs @@ -159,8 +159,7 @@ unsafe fn main_0() -> i32 { } let mut pred: *mut u32 = (unsafe { let _graph: *const Graph = &graph as *const Graph; - let _start_vertex: u32 = 0_u32; - BFS_0(_graph, _start_vertex) + BFS_0(_graph, 0_u32) }); let mut i: u32 = 0_u32; 'loop_: while ((i as u64) < (V)) { diff --git a/tests/benchmarks/out/unsafe/fibonacci.rs b/tests/benchmarks/out/unsafe/fibonacci.rs index d67f49e3..665833ee 100644 --- a/tests/benchmarks/out/unsafe/fibonacci.rs +++ b/tests/benchmarks/out/unsafe/fibonacci.rs @@ -28,8 +28,5 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - return ((unsafe { - let _n: u64 = 46_u64; - fib_0(_n) - }) as i32); + return ((unsafe { fib_0(46_u64) }) as i32); } diff --git a/tests/multi-file/extern_functions/out/refcount/extern_functions.rs b/tests/multi-file/extern_functions/out/refcount/extern_functions.rs index c28f4d2e..a890fa5e 100644 --- a/tests/multi-file/extern_functions/out/refcount/extern_functions.rs +++ b/tests/multi-file/extern_functions/out/refcount/extern_functions.rs @@ -10,13 +10,7 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (((({ - let _x: i32 = 42; - helper_0(_x) - }) == 43) as i32) - != 0) - ); + assert!((((({ helper_0(42,) }) == 43) as i32) != 0)); return 0; } pub fn unrelated1_1() -> i32 { diff --git a/tests/multi-file/extern_functions/out/unsafe/extern_functions.rs b/tests/multi-file/extern_functions/out/unsafe/extern_functions.rs index b8829b8f..2c594f5a 100644 --- a/tests/multi-file/extern_functions/out/unsafe/extern_functions.rs +++ b/tests/multi-file/extern_functions/out/unsafe/extern_functions.rs @@ -12,13 +12,7 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((((unsafe { - let _x: i32 = 42; - helper_0(_x) - }) == (43)) as i32) - != 0) - ); + assert!(((((unsafe { helper_0(42,) }) == (43)) as i32) != 0)); return 0; } pub unsafe fn unrelated1_1() -> i32 { diff --git a/tests/multi-file/header_function/out/refcount/header_function.rs b/tests/multi-file/header_function/out/refcount/header_function.rs index c28f4d2e..a890fa5e 100644 --- a/tests/multi-file/header_function/out/refcount/header_function.rs +++ b/tests/multi-file/header_function/out/refcount/header_function.rs @@ -10,13 +10,7 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (((({ - let _x: i32 = 42; - helper_0(_x) - }) == 43) as i32) - != 0) - ); + assert!((((({ helper_0(42,) }) == 43) as i32) != 0)); return 0; } pub fn unrelated1_1() -> i32 { diff --git a/tests/multi-file/header_function/out/unsafe/header_function.rs b/tests/multi-file/header_function/out/unsafe/header_function.rs index b8829b8f..2c594f5a 100644 --- a/tests/multi-file/header_function/out/unsafe/header_function.rs +++ b/tests/multi-file/header_function/out/unsafe/header_function.rs @@ -12,13 +12,7 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((((unsafe { - let _x: i32 = 42; - helper_0(_x) - }) == (43)) as i32) - != 0) - ); + assert!(((((unsafe { helper_0(42,) }) == (43)) as i32) != 0)); return 0; } pub unsafe fn unrelated1_1() -> i32 { diff --git a/tests/unit/out/refcount/alloc_array.rs b/tests/unit/out/refcount/alloc_array.rs index 3b8d1e27..42ec910e 100644 --- a/tests/unit/out/refcount/alloc_array.rs +++ b/tests/unit/out/refcount/alloc_array.rs @@ -47,8 +47,7 @@ fn main_0() -> i32 { ({ let _arr: Ptr>>> = arr.as_pointer(); let _N: i32 = (*N.borrow()); - let _element: i32 = 1; - All_0(_arr, _N, _element) + All_0(_arr, _N, 1) }); return ({ let _arr: Option>> = (*arr.borrow_mut()).take(); diff --git a/tests/unit/out/refcount/bool_condition_logical.rs b/tests/unit/out/refcount/bool_condition_logical.rs index 727d1721..9b340849 100644 --- a/tests/unit/out/refcount/bool_condition_logical.rs +++ b/tests/unit/out/refcount/bool_condition_logical.rs @@ -67,21 +67,11 @@ fn main_0() -> i32 { assert!(true); } (*side_effect_0.with(Value::clone).borrow_mut()) = 0; - if ((*zero.borrow()) != 0) - && (({ - let _v: i32 = 1; - observe_1(_v) - }) != 0) - { + if ((*zero.borrow()) != 0) && (({ observe_1(1) }) != 0) { assert!(false); } assert!(((*side_effect_0.with(Value::clone).borrow()) == 0)); - if ((*n.borrow()) != 0) - || (({ - let _v: i32 = 1; - observe_1(_v) - }) != 0) - { + if ((*n.borrow()) != 0) || (({ observe_1(1) }) != 0) { assert!(true); } assert!(((*side_effect_0.with(Value::clone).borrow()) == 0)); diff --git a/tests/unit/out/refcount/bool_condition_logical_c.rs b/tests/unit/out/refcount/bool_condition_logical_c.rs index da893412..a878ce93 100644 --- a/tests/unit/out/refcount/bool_condition_logical_c.rs +++ b/tests/unit/out/refcount/bool_condition_logical_c.rs @@ -71,23 +71,11 @@ fn main_0() -> i32 { assert!((1 != 0)); } (*side_effect_0.with(Value::clone).borrow_mut()) = 0; - if (((((*zero.borrow()) != 0) - && (({ - let _v: i32 = 1; - observe_1(_v) - }) != 0)) as i32) - != 0) - { + if (((((*zero.borrow()) != 0) && (({ observe_1(1) }) != 0)) as i32) != 0) { assert!((0 != 0)); } assert!(((((*side_effect_0.with(Value::clone).borrow()) == 0) as i32) != 0)); - if (((((*n.borrow()) != 0) - || (({ - let _v: i32 = 1; - observe_1(_v) - }) != 0)) as i32) - != 0) - { + if (((((*n.borrow()) != 0) || (({ observe_1(1) }) != 0)) as i32) != 0) { assert!((1 != 0)); } assert!(((((*side_effect_0.with(Value::clone).borrow()) == 0) as i32) != 0)); diff --git a/tests/unit/out/refcount/break.rs b/tests/unit/out/refcount/break.rs index 436f62d1..b1fe3aa0 100644 --- a/tests/unit/out/refcount/break.rs +++ b/tests/unit/out/refcount/break.rs @@ -35,8 +35,5 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - return ({ - let _n: i32 = 200; - for_test_0(_n) - }); + return ({ for_test_0(200) }); } diff --git a/tests/unit/out/refcount/bst.rs b/tests/unit/out/refcount/bst.rs index a9e2163a..bead4d4a 100644 --- a/tests/unit/out/refcount/bst.rs +++ b/tests/unit/out/refcount/bst.rs @@ -146,8 +146,7 @@ fn main_0() -> i32 { (*ptr1.borrow_mut()) = __rhs; return ((((((((*(*({ let _node: Ptr = (*ptr1.borrow()).clone(); - let _value: i32 = 0; - find_0(_node, _value) + find_0(_node, 0) }) .upgrade() .deref()) @@ -156,8 +155,7 @@ fn main_0() -> i32 { == 0) && ((*(*({ let _node: Ptr = (*ptr1.borrow()).clone(); - let _value: i32 = 1; - find_0(_node, _value) + find_0(_node, 1) }) .upgrade() .deref()) @@ -166,8 +164,7 @@ fn main_0() -> i32 { == 1)) && ((*(*({ let _node: Ptr = (*ptr1.borrow()).clone(); - let _value: i32 = 2; - find_0(_node, _value) + find_0(_node, 2) }) .upgrade() .deref()) @@ -176,8 +173,7 @@ fn main_0() -> i32 { == 2)) && ((*(*({ let _node: Ptr = (*ptr1.borrow()).clone(); - let _value: i32 = 3; - find_0(_node, _value) + find_0(_node, 3) }) .upgrade() .deref()) @@ -186,8 +182,7 @@ fn main_0() -> i32 { == 3)) && ((*(*({ let _node: Ptr = (*ptr1.borrow()).clone(); - let _value: i32 = 4; - find_0(_node, _value) + find_0(_node, 4) }) .upgrade() .deref()) @@ -196,8 +191,7 @@ fn main_0() -> i32 { == 4)) && (({ let _node: Ptr = (*ptr1.borrow()).clone(); - let _value: i32 = 5; - find_0(_node, _value) + find_0(_node, 5) }) .is_null())) as i32); } diff --git a/tests/unit/out/refcount/class.rs b/tests/unit/out/refcount/class.rs index 82c14f3f..6bed63d3 100644 --- a/tests/unit/out/refcount/class.rs +++ b/tests/unit/out/refcount/class.rs @@ -93,10 +93,7 @@ impl ByteRepr for Route {} pub fn RandomRoute_0(route: Ptr) -> i32 { if (((*(*(*route.upgrade().deref()).path.borrow()).first.borrow()) % 2) != 0) { return ({ - let _new_first: i32 = ({ - let _new_second: i32 = 10; - (*(*route.upgrade().deref()).path.borrow()).SetSecond(_new_second) - }); + let _new_first: i32 = ({ (*(*route.upgrade().deref()).path.borrow()).SetSecond(10) }); (*(*route.upgrade().deref()).path.borrow()).SetFirst(_new_first) }); } else { @@ -130,10 +127,7 @@ fn main_0() -> i32 { })); let old_cost: Value = Rc::new(RefCell::new( ({ - let _new_cost: f64 = ({ - let _new_cost: f64 = 15_f64; - (*route2.borrow()).SetCost(_new_cost) - }); + let _new_cost: f64 = ({ (*route2.borrow()).SetCost(15_f64) }); (*route1.borrow()).SetCost(_new_cost) }), )); diff --git a/tests/unit/out/refcount/doubly_linked_list.rs b/tests/unit/out/refcount/doubly_linked_list.rs index bd8e68b3..ff45aed2 100644 --- a/tests/unit/out/refcount/doubly_linked_list.rs +++ b/tests/unit/out/refcount/doubly_linked_list.rs @@ -197,14 +197,12 @@ fn main_0() -> i32 { }); let __rhs = ({ let _head: Ptr = (*head.borrow()).clone(); - let _val: i32 = 5; - Delete_3(_head, _val) + Delete_3(_head, 5) }); (*head.borrow_mut()) = __rhs; let __rhs = ({ let _head: Ptr = (*head.borrow()).clone(); - let _val: i32 = 0; - Delete_3(_head, _val) + Delete_3(_head, 0) }); (*head.borrow_mut()) = __rhs; let __rhs = ({ @@ -222,8 +220,7 @@ fn main_0() -> i32 { assert!( ((*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 0; - Find_0(_head, _idx) + Find_0(_head, 0) }) .upgrade() .deref()) @@ -234,8 +231,7 @@ fn main_0() -> i32 { assert!( ((*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 1; - Find_0(_head, _idx) + Find_0(_head, 1) }) .upgrade() .deref()) @@ -246,8 +242,7 @@ fn main_0() -> i32 { assert!( ((*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 2; - Find_0(_head, _idx) + Find_0(_head, 2) }) .upgrade() .deref()) @@ -258,8 +253,7 @@ fn main_0() -> i32 { assert!( ((*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 3; - Find_0(_head, _idx) + Find_0(_head, 3) }) .upgrade() .deref()) @@ -270,8 +264,7 @@ fn main_0() -> i32 { assert!( ((*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 4; - Find_0(_head, _idx) + Find_0(_head, 4) }) .upgrade() .deref()) @@ -281,15 +274,13 @@ fn main_0() -> i32 { ); assert!(({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 5; - Find_0(_head, _idx) + Find_0(_head, 5) }) .is_null()); assert!( ((*(*({ let _tail: Ptr = (*tail.borrow()).clone(); - let _idx: i32 = 0; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 0) }) .upgrade() .deref()) @@ -300,8 +291,7 @@ fn main_0() -> i32 { assert!( ((*(*({ let _tail: Ptr = (*tail.borrow()).clone(); - let _idx: i32 = 1; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 1) }) .upgrade() .deref()) @@ -312,8 +302,7 @@ fn main_0() -> i32 { assert!( ((*(*({ let _tail: Ptr = (*tail.borrow()).clone(); - let _idx: i32 = 2; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 2) }) .upgrade() .deref()) @@ -324,8 +313,7 @@ fn main_0() -> i32 { assert!( ((*(*({ let _tail: Ptr = (*tail.borrow()).clone(); - let _idx: i32 = 3; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 3) }) .upgrade() .deref()) @@ -336,8 +324,7 @@ fn main_0() -> i32 { assert!( ((*(*({ let _tail: Ptr = (*tail.borrow()).clone(); - let _idx: i32 = 4; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 4) }) .upgrade() .deref()) @@ -347,8 +334,7 @@ fn main_0() -> i32 { ); assert!((*(*({ let _tail: Ptr = (*tail.borrow()).clone(); - let _idx: i32 = 4; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 4) }) .upgrade() .deref()) @@ -358,8 +344,7 @@ fn main_0() -> i32 { assert!( ((*(*(*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 0; - Find_0(_head, _idx) + Find_0(_head, 0) }) .upgrade() .deref()) @@ -374,8 +359,7 @@ fn main_0() -> i32 { assert!( ((*(*(*(*(*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 1; - Find_0(_head, _idx) + Find_0(_head, 1) }) .upgrade() .deref()) @@ -394,8 +378,7 @@ fn main_0() -> i32 { assert!( ((*(*(*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 2; - Find_0(_head, _idx) + Find_0(_head, 2) }) .upgrade() .deref()) @@ -409,8 +392,7 @@ fn main_0() -> i32 { ); assert!((*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 4; - Find_0(_head, _idx) + Find_0(_head, 4) }) .upgrade() .deref()) @@ -420,8 +402,7 @@ fn main_0() -> i32 { assert!( ((*(*(*(*(*(*({ let _tail: Ptr = (*tail.borrow()).clone(); - let _idx: i32 = 1; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 1) }) .upgrade() .deref()) @@ -439,8 +420,7 @@ fn main_0() -> i32 { ); (*(*(*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 0; - Find_0(_head, _idx) + Find_0(_head, 0) }) .upgrade() .deref()) @@ -453,8 +433,7 @@ fn main_0() -> i32 { assert!( ((*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 1; - Find_0(_head, _idx) + Find_0(_head, 1) }) .upgrade() .deref()) @@ -464,8 +443,7 @@ fn main_0() -> i32 { ); let __rhs = ((*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 0; - Find_0(_head, _idx) + Find_0(_head, 0) }) .upgrade() .deref()) @@ -473,8 +451,7 @@ fn main_0() -> i32 { .borrow()) + (*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 3; - Find_0(_head, _idx) + Find_0(_head, 3) }) .upgrade() .deref()) @@ -482,8 +459,7 @@ fn main_0() -> i32 { .borrow())); (*(*(*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 1; - Find_0(_head, _idx) + Find_0(_head, 1) }) .upgrade() .deref()) @@ -496,8 +472,7 @@ fn main_0() -> i32 { assert!( ((*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 2; - Find_0(_head, _idx) + Find_0(_head, 2) }) .upgrade() .deref()) @@ -508,8 +483,7 @@ fn main_0() -> i32 { let sum: Value = Rc::new(RefCell::new( (((((*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 0; - Find_0(_head, _idx) + Find_0(_head, 0) }) .upgrade() .deref()) @@ -517,8 +491,7 @@ fn main_0() -> i32 { .borrow()) + (*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 1; - Find_0(_head, _idx) + Find_0(_head, 1) }) .upgrade() .deref()) @@ -526,8 +499,7 @@ fn main_0() -> i32 { .borrow())) + (*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 2; - Find_0(_head, _idx) + Find_0(_head, 2) }) .upgrade() .deref()) @@ -535,8 +507,7 @@ fn main_0() -> i32 { .borrow())) + (*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 3; - Find_0(_head, _idx) + Find_0(_head, 3) }) .upgrade() .deref()) @@ -544,8 +515,7 @@ fn main_0() -> i32 { .borrow())) + (*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 4; - Find_0(_head, _idx) + Find_0(_head, 4) }) .upgrade() .deref()) @@ -557,8 +527,7 @@ fn main_0() -> i32 { ({ let _lhs = (*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 0; - Find_0(_head, _idx) + Find_0(_head, 0) }) .upgrade() .deref()) @@ -566,8 +535,7 @@ fn main_0() -> i32 { .borrow()); _lhs + (*(*({ let _tail: Ptr = (*tail.borrow()).clone(); - let _idx: i32 = 0; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 0) }) .upgrade() .deref()) @@ -578,8 +546,7 @@ fn main_0() -> i32 { assert!({ let _lhs = (*(*(*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 2; - Find_0(_head, _idx) + Find_0(_head, 2) }) .upgrade() .deref()) @@ -591,8 +558,7 @@ fn main_0() -> i32 { .borrow()); _lhs == (*(*({ let _tail: Ptr = (*tail.borrow()).clone(); - let _idx: i32 = 1; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 1) }) .upgrade() .deref()) @@ -602,8 +568,7 @@ fn main_0() -> i32 { assert!({ let _lhs = (*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 0; - Find_0(_head, _idx) + Find_0(_head, 0) }) .upgrade() .deref()) @@ -612,8 +577,7 @@ fn main_0() -> i32 { .clone(); _lhs == (*(*({ let _tail: Ptr = (*tail.borrow()).clone(); - let _idx: i32 = 4; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 4) }) .upgrade() .deref()) diff --git a/tests/unit/out/refcount/dowhile.rs b/tests/unit/out/refcount/dowhile.rs index 9efe9e68..c0176e69 100644 --- a/tests/unit/out/refcount/dowhile.rs +++ b/tests/unit/out/refcount/dowhile.rs @@ -26,8 +26,5 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - return ({ - let _x: i32 = 0; - dowhile_0(_x) - }); + return ({ dowhile_0(0) }); } diff --git a/tests/unit/out/refcount/enum_int_interop.rs b/tests/unit/out/refcount/enum_int_interop.rs index 3354d952..01a28cd8 100644 --- a/tests/unit/out/refcount/enum_int_interop.rs +++ b/tests/unit/out/refcount/enum_int_interop.rs @@ -174,10 +174,7 @@ fn main_0() -> i32 { (*c.borrow_mut()) = Color::from(2); assert!((((*c.borrow()) as i32) == (Color::BLUE as i32))); assert!((((*c.borrow()) as i32) == 2)); - (*c.borrow_mut()) = ({ - let _n: i32 = 1; - make_color_6(_n) - }); + (*c.borrow_mut()) = ({ make_color_6(1) }); assert!((((*c.borrow()) as i32) == (Color::GREEN as i32))); let cmp: Value = Rc::new(RefCell::new(Color::from((((*c.borrow()) as i32) + 1)))); assert!((((*cmp.borrow()) as i32) == (Color::BLUE as i32))); @@ -195,10 +192,7 @@ fn main_0() -> i32 { }), )); assert!(((*rc.borrow()) == 2)); - (*rc.borrow_mut()) = ({ - let _option: i32 = 20; - classify_option_5(_option) - }); + (*rc.borrow_mut()) = ({ classify_option_5(20) }); assert!(((*rc.borrow()) == 2)); (*rc.borrow_mut()) = ({ let _option: i32 = (Option::OPT_C as i32); diff --git a/tests/unit/out/refcount/enum_int_interop_c.rs b/tests/unit/out/refcount/enum_int_interop_c.rs index 817170c6..decaf0dc 100644 --- a/tests/unit/out/refcount/enum_int_interop_c.rs +++ b/tests/unit/out/refcount/enum_int_interop_c.rs @@ -166,10 +166,7 @@ fn main_0() -> i32 { (*c.borrow_mut()) = Color::from(2); assert!((((((*c.borrow()) as u32) == ((Color::BLUE as i32) as u32)) as i32) != 0)); assert!((((((*c.borrow()) as u32) == 2_u32) as i32) != 0)); - (*c.borrow_mut()) = ({ - let _n: i32 = 1; - make_color_6(_n) - }); + (*c.borrow_mut()) = ({ make_color_6(1) }); assert!((((((*c.borrow()) as u32) == ((Color::GREEN as i32) as u32)) as i32) != 0)); let cmp: Value = Rc::new(RefCell::new(Color::from( (((*c.borrow()) as u32).wrapping_add(1_u32)) as i32, @@ -189,10 +186,7 @@ fn main_0() -> i32 { }), )); assert!(((((*rc.borrow()) == 2) as i32) != 0)); - (*rc.borrow_mut()) = ({ - let _option: i32 = 20; - classify_option_5(_option) - }); + (*rc.borrow_mut()) = ({ classify_option_5(20) }); assert!(((((*rc.borrow()) == 2) as i32) != 0)); (*rc.borrow_mut()) = ({ let _option: i32 = (Option::OPT_C as i32); diff --git a/tests/unit/out/refcount/expr_as_bool_c.rs b/tests/unit/out/refcount/expr_as_bool_c.rs index b50641a3..120df9ce 100644 --- a/tests/unit/out/refcount/expr_as_bool_c.rs +++ b/tests/unit/out/refcount/expr_as_bool_c.rs @@ -88,13 +88,7 @@ fn main_0() -> i32 { }) == 1) as i32) != 0) ); - assert!( - (((({ - let _rc: i32 = 0; - cmp_eq_0(_rc) - }) == 0) as i32) - != 0) - ); + assert!((((({ cmp_eq_0(0,) }) == 0) as i32) != 0)); assert!( (((({ let _p: Ptr = (*p1.borrow()).clone(); diff --git a/tests/unit/out/refcount/expr_as_bool_cpp.rs b/tests/unit/out/refcount/expr_as_bool_cpp.rs index 80509b93..887e2300 100644 --- a/tests/unit/out/refcount/expr_as_bool_cpp.rs +++ b/tests/unit/out/refcount/expr_as_bool_cpp.rs @@ -82,12 +82,7 @@ fn main_0() -> i32 { cmp_eq_0(_rc) }) == 1) ); - assert!( - (({ - let _rc: i32 = 0; - cmp_eq_0(_rc) - }) == 0) - ); + assert!((({ cmp_eq_0(0,) }) == 0)); assert!( (({ let _p: Ptr = (*p1.borrow()).clone(); diff --git a/tests/unit/out/refcount/fcall.rs b/tests/unit/out/refcount/fcall.rs index f2d9dd8c..5a72e679 100644 --- a/tests/unit/out/refcount/fcall.rs +++ b/tests/unit/out/refcount/fcall.rs @@ -74,9 +74,5 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - return (({ - let _x: f64 = 1.0E+0; - let _y: f64 = 2.0E+0; - f1_2(_x, _y) - }) as i32); + return (({ f1_2(1.0E+0, 2.0E+0) }) as i32); } diff --git a/tests/unit/out/refcount/fn_ptr_array.rs b/tests/unit/out/refcount/fn_ptr_array.rs index d2e41364..df1347fc 100644 --- a/tests/unit/out/refcount/fn_ptr_array.rs +++ b/tests/unit/out/refcount/fn_ptr_array.rs @@ -30,27 +30,9 @@ fn main_0() -> i32 { FnPtr:: i32>::new(sub_1), FnPtr:: i32>::new(mul_2), ]))); - assert!( - (({ - let _arg0: i32 = 2; - let _arg1: i32 = 3; - (*(*ops.borrow())[(0) as usize])(_arg0, _arg1) - }) == 5) - ); - assert!( - (({ - let _arg0: i32 = 7; - let _arg1: i32 = 4; - (*(*ops.borrow())[(1) as usize])(_arg0, _arg1) - }) == 3) - ); - assert!( - (({ - let _arg0: i32 = 6; - let _arg1: i32 = 5; - (*(*ops.borrow())[(2) as usize])(_arg0, _arg1) - }) == 30) - ); + assert!((({ (*(*ops.borrow())[(0) as usize])(2, 3,) }) == 5)); + assert!((({ (*(*ops.borrow())[(1) as usize])(7, 4,) }) == 3)); + assert!((({ (*(*ops.borrow())[(2) as usize])(6, 5,) }) == 30)); assert!(!(((*ops.borrow())[(0) as usize]).is_null())); assert!(((*ops.borrow())[(0) as usize] == FnPtr:: i32>::new(add_0))); assert!(((*ops.borrow())[(0) as usize] != FnPtr:: i32>::new(sub_1))); diff --git a/tests/unit/out/refcount/fn_ptr_cast.rs b/tests/unit/out/refcount/fn_ptr_cast.rs index c7a229d1..3ab34704 100644 --- a/tests/unit/out/refcount/fn_ptr_cast.rs +++ b/tests/unit/out/refcount/fn_ptr_cast.rs @@ -13,24 +13,14 @@ pub fn double_it_0(x: i32) -> i32 { pub fn test_roundtrip_1() { let fn_: Value i32>> = Rc::new(RefCell::new(FnPtr:: i32>::new(double_it_0))); - assert!( - (({ - let _arg0: i32 = 5; - (*(*fn_.borrow()))(_arg0) - }) == 10) - ); + assert!((({ (*(*fn_.borrow()))(5,) }) == 10)); let gfn: Value> = Rc::new(RefCell::new(((*fn_.borrow()).cast::(None)).clone())); assert!(!((*gfn.borrow()).is_null())); let fn2: Value i32>> = Rc::new(RefCell::new( ((*gfn.borrow()).cast:: i32>(None)).clone(), )); - assert!( - (({ - let _arg0: i32 = 5; - (*(*fn2.borrow()))(_arg0) - }) == 10) - ); + assert!((({ (*(*fn2.borrow()))(5,) }) == 10)); assert!({ let _lhs = (*fn2.borrow()).clone(); _lhs == (*fn_.borrow()).clone() @@ -45,12 +35,7 @@ pub fn test_double_cast_2() { .cast:: i32>(None)) .clone(), )); - assert!( - (({ - let _arg0: i32 = 5; - (*(*fn2.borrow()))(_arg0) - }) == 10) - ); + assert!((({ (*(*fn2.borrow()))(5,) }) == 10)); assert!({ let _lhs = (*fn2.borrow()).clone(); _lhs == (*fn_.borrow()).clone() @@ -78,12 +63,7 @@ pub fn test_void_ptr_to_fn_3() { .expect("ub:wrong fn type")) .clone(), )); - assert!( - (({ - let _arg0: i32 = 5; - (*(*fn_.borrow()))(_arg0) - }) == 10) - ); + assert!((({ (*(*fn_.borrow()))(5,) }) == 10)); } pub fn add_offset_4(base: Ptr, offset: i32) -> i32 { let base: Value> = Rc::new(RefCell::new(base)); @@ -104,8 +84,7 @@ pub fn test_call_through_cast_5() { let result: Value = Rc::new(RefCell::new( ({ let _arg0: AnyPtr = ((val.as_pointer()) as Ptr).to_any(); - let _arg1: i32 = 42; - (*(*gfn.borrow()))(_arg0, _arg1) + (*(*gfn.borrow()))(_arg0, 42) }), )); assert!(((*result.borrow()) == 142)); diff --git a/tests/unit/out/refcount/fn_ptr_conditional.rs b/tests/unit/out/refcount/fn_ptr_conditional.rs index c360befa..089720c0 100644 --- a/tests/unit/out/refcount/fn_ptr_conditional.rs +++ b/tests/unit/out/refcount/fn_ptr_conditional.rs @@ -48,45 +48,26 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { + assert!((({ (*({ pick_3(1,) }))(10,) }) == 11)); assert!( (({ - let _arg0: i32 = 10; - (*({ - let _mode: i32 = 1; - pick_3(_mode) - }))(_arg0) - }) == 11) - ); - assert!( - (({ - let _arg0: i32 = 10; (*({ let _mode: i32 = -1_i32; pick_3(_mode) - }))(_arg0) + }))(10) }) == 9) ); - assert!( - (({ - let _arg0: i32 = 10; - (*({ - let _mode: i32 = 0; - pick_3(_mode) - }))(_arg0) - }) == 10) - ); + assert!((({ (*({ pick_3(0,) }))(10,) }) == 10)); assert!( (({ let _fn: FnPtr i32> = FnPtr:: i32>::new(inc_0); - let _x: i32 = 5; - apply_4(_fn, _x) + apply_4(_fn, 5) }) == 6) ); assert!( (({ let _fn: FnPtr i32> = FnPtr::null(); - let _x: i32 = 5; - apply_4(_fn, _x) + apply_4(_fn, 5) }) == 5) ); return 0; diff --git a/tests/unit/out/refcount/fn_ptr_default_arg.rs b/tests/unit/out/refcount/fn_ptr_default_arg.rs index 65eabe36..f29c13bb 100644 --- a/tests/unit/out/refcount/fn_ptr_default_arg.rs +++ b/tests/unit/out/refcount/fn_ptr_default_arg.rs @@ -27,23 +27,20 @@ pub fn main() { fn main_0() -> i32 { assert!( (({ - let _x: i32 = 5; let _fn: FnPtr i32> = Default::default(); - apply_1(_x, Some(_fn)) + apply_1(5, Some(_fn)) }) == 5) ); assert!( (({ - let _x: i32 = 5; let _fn: FnPtr i32> = FnPtr::null(); - apply_1(_x, Some(_fn)) + apply_1(5, Some(_fn)) }) == 5) ); assert!( (({ - let _x: i32 = 5; let _fn: FnPtr i32> = FnPtr:: i32>::new(identity_0); - apply_1(_x, Some(_fn)) + apply_1(5, Some(_fn)) }) == 5) ); let negate: Value i32>> = Rc::new(RefCell::new(FnPtr::new( @@ -54,9 +51,8 @@ fn main_0() -> i32 { ))); assert!( (({ - let _x: i32 = 5; let _fn: FnPtr i32> = (*negate.borrow()).clone(); - apply_1(_x, Some(_fn)) + apply_1(5, Some(_fn)) }) == -5_i32) ); return 0; diff --git a/tests/unit/out/refcount/fn_ptr_global.rs b/tests/unit/out/refcount/fn_ptr_global.rs index 31072d79..943d8a26 100644 --- a/tests/unit/out/refcount/fn_ptr_global.rs +++ b/tests/unit/out/refcount/fn_ptr_global.rs @@ -35,12 +35,7 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 5; - call_op_4(_x) - }) == 5) - ); + assert!((({ call_op_4(5,) }) == 5)); ({ let _fn: FnPtr i32> = FnPtr:: i32>::new(double_it_0); set_op_3(_fn) @@ -50,12 +45,7 @@ fn main_0() -> i32 { let _lhs = (*g_op_2.with(Value::clone).borrow()).clone(); _lhs == FnPtr:: i32>::new(double_it_0) }); - assert!( - (({ - let _x: i32 = 5; - call_op_4(_x) - }) == 10) - ); + assert!((({ call_op_4(5,) }) == 10)); ({ let _fn: FnPtr i32> = FnPtr:: i32>::new(triple_it_1); set_op_3(_fn) @@ -64,22 +54,12 @@ fn main_0() -> i32 { let _lhs = (*g_op_2.with(Value::clone).borrow()).clone(); _lhs == FnPtr:: i32>::new(triple_it_1) }); - assert!( - (({ - let _x: i32 = 5; - call_op_4(_x) - }) == 15) - ); + assert!((({ call_op_4(5,) }) == 15)); ({ let _fn: FnPtr i32> = FnPtr::null(); set_op_3(_fn) }); assert!((*g_op_2.with(Value::clone).borrow()).is_null()); - assert!( - (({ - let _x: i32 = 5; - call_op_4(_x) - }) == 5) - ); + assert!((({ call_op_4(5,) }) == 5)); return 0; } diff --git a/tests/unit/out/refcount/fn_ptr_reassign.rs b/tests/unit/out/refcount/fn_ptr_reassign.rs index 6e3465ba..d5e08a65 100644 --- a/tests/unit/out/refcount/fn_ptr_reassign.rs +++ b/tests/unit/out/refcount/fn_ptr_reassign.rs @@ -27,39 +27,15 @@ pub fn main() { fn main_0() -> i32 { let fn_: Value i32>> = Rc::new(RefCell::new(FnPtr:: i32>::new(add_0))); - assert!( - (({ - let _arg0: i32 = 3; - let _arg1: i32 = 4; - (*(*fn_.borrow()))(_arg0, _arg1) - }) == 7) - ); + assert!((({ (*(*fn_.borrow()))(3, 4,) }) == 7)); (*fn_.borrow_mut()) = FnPtr:: i32>::new(sub_1); - assert!( - (({ - let _arg0: i32 = 10; - let _arg1: i32 = 3; - (*(*fn_.borrow()))(_arg0, _arg1) - }) == 7) - ); + assert!((({ (*(*fn_.borrow()))(10, 3,) }) == 7)); (*fn_.borrow_mut()) = FnPtr:: i32>::new(mul_2); - assert!( - (({ - let _arg0: i32 = 6; - let _arg1: i32 = 7; - (*(*fn_.borrow()))(_arg0, _arg1) - }) == 42) - ); + assert!((({ (*(*fn_.borrow()))(6, 7,) }) == 42)); (*fn_.borrow_mut()) = FnPtr::null(); assert!((*fn_.borrow()).is_null()); (*fn_.borrow_mut()) = FnPtr:: i32>::new(add_0); assert!(!((*fn_.borrow()).is_null())); - assert!( - (({ - let _arg0: i32 = 1; - let _arg1: i32 = 1; - (*(*fn_.borrow()))(_arg0, _arg1) - }) == 2) - ); + assert!((({ (*(*fn_.borrow()))(1, 1,) }) == 2)); return 0; } diff --git a/tests/unit/out/refcount/fn_ptr_return.rs b/tests/unit/out/refcount/fn_ptr_return.rs index 38edb92f..5fc0dfaf 100644 --- a/tests/unit/out/refcount/fn_ptr_return.rs +++ b/tests/unit/out/refcount/fn_ptr_return.rs @@ -25,39 +25,19 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - let f: Value i32>> = Rc::new(RefCell::new( - ({ - let _choose_inc: i32 = 1; - pick_2(_choose_inc) - }), - )); + let f: Value i32>> = Rc::new(RefCell::new(({ pick_2(1) }))); assert!(!((*f.borrow()).is_null())); assert!({ let _lhs = (*f.borrow()).clone(); _lhs == FnPtr:: i32>::new(inc_0) }); - assert!( - (({ - let _arg0: i32 = 10; - (*(*f.borrow()))(_arg0) - }) == 11) - ); - let g: Value i32>> = Rc::new(RefCell::new( - ({ - let _choose_inc: i32 = 0; - pick_2(_choose_inc) - }), - )); + assert!((({ (*(*f.borrow()))(10,) }) == 11)); + let g: Value i32>> = Rc::new(RefCell::new(({ pick_2(0) }))); assert!({ let _lhs = (*g.borrow()).clone(); _lhs == FnPtr:: i32>::new(dec_1) }); - assert!( - (({ - let _arg0: i32 = 10; - (*(*g.borrow()))(_arg0) - }) == 9) - ); + assert!((({ (*(*g.borrow()))(10,) }) == 9)); assert!({ let _lhs = (*f.borrow()).clone(); _lhs != (*g.borrow()).clone() diff --git a/tests/unit/out/refcount/fn_ptr_stdlib_compare.rs b/tests/unit/out/refcount/fn_ptr_stdlib_compare.rs index 3402eca2..4ed2ae58 100644 --- a/tests/unit/out/refcount/fn_ptr_stdlib_compare.rs +++ b/tests/unit/out/refcount/fn_ptr_stdlib_compare.rs @@ -67,10 +67,8 @@ fn main_0() -> i32 { assert!( (({ let _arg0: AnyPtr = AnyPtr::default(); - let _arg1: u64 = 0_u64; - let _arg2: u64 = 0_u64; let _arg3: Ptr<::std::fs::File> = Ptr::null(); - (*(*f3.borrow()))(_arg0, _arg1, _arg2, _arg3) + (*(*f3.borrow()))(_arg0, 0_u64, 0_u64, _arg3) }) == 22_u64) ); let mut __do_while = true; @@ -161,10 +159,8 @@ fn main_0() -> i32 { let n: Value = Rc::new(RefCell::new( ({ let _arg0: AnyPtr = ((buf.as_pointer() as Ptr) as Ptr).to_any(); - let _arg1: u64 = 1_u64; - let _arg2: u64 = 10_u64; let _arg3: Ptr<::std::fs::File> = (*stream.borrow()).clone(); - (*(*fn1.borrow()))(_arg0, _arg1, _arg2, _arg3) + (*(*fn1.borrow()))(_arg0, 1_u64, 10_u64, _arg3) }), )); assert!(((*n.borrow()) == 10_u64)); @@ -231,10 +227,8 @@ fn main_0() -> i32 { assert!( (({ let _arg0: AnyPtr = AnyPtr::default(); - let _arg1: u64 = 0_u64; - let _arg2: u64 = 0_u64; let _arg3: Ptr<::std::fs::File> = Ptr::null(); - (*(*g3.borrow()))(_arg0, _arg1, _arg2, _arg3) + (*(*g3.borrow()))(_arg0, 0_u64, 0_u64, _arg3) }) == 33_u64) ); let mut __do_while = true; @@ -315,10 +309,8 @@ fn main_0() -> i32 { let n: Value = Rc::new(RefCell::new( ({ let _arg0: AnyPtr = ((buf.as_pointer() as Ptr) as Ptr).to_any(); - let _arg1: u64 = 1_u64; - let _arg2: u64 = 10_u64; let _arg3: Ptr<::std::fs::File> = (*stream.borrow()).clone(); - (*(*gn1.borrow()))(_arg0, _arg1, _arg2, _arg3) + (*(*gn1.borrow()))(_arg0, 1_u64, 10_u64, _arg3) }), )); assert!(((*n.borrow()) == 10_u64)); diff --git a/tests/unit/out/refcount/fn_ptr_struct.rs b/tests/unit/out/refcount/fn_ptr_struct.rs index bccbaa42..95d9d840 100644 --- a/tests/unit/out/refcount/fn_ptr_struct.rs +++ b/tests/unit/out/refcount/fn_ptr_struct.rs @@ -50,25 +50,10 @@ fn main_0() -> i32 { cb: Rc::new(RefCell::new(FnPtr:: i32>::new(negate_1))), })); assert!(!((*(*h1.borrow()).cb.borrow()).is_null())); - assert!( - (({ - let _arg0: i32 = 5; - (*(*(*h1.borrow()).cb.borrow()))(_arg0) - }) == 10) - ); - assert!( - (({ - let _arg0: i32 = 7; - (*(*(*h2.borrow()).cb.borrow()))(_arg0) - }) == -7_i32) - ); + assert!((({ (*(*(*h1.borrow()).cb.borrow()))(5,) }) == 10)); + assert!((({ (*(*(*h2.borrow()).cb.borrow()))(7,) }) == -7_i32)); (*(*h1.borrow()).cb.borrow_mut()) = FnPtr:: i32>::new(negate_1); - assert!( - (({ - let _arg0: i32 = 3; - (*(*(*h1.borrow()).cb.borrow()))(_arg0) - }) == -3_i32) - ); + assert!((({ (*(*(*h1.borrow()).cb.borrow()))(3,) }) == -3_i32)); assert!({ let _lhs = (*(*h1.borrow()).cb.borrow()).clone(); _lhs == (*(*h2.borrow()).cb.borrow()).clone() diff --git a/tests/unit/out/refcount/fn_ptr_vtable.rs b/tests/unit/out/refcount/fn_ptr_vtable.rs index 50eb19b3..34934d52 100644 --- a/tests/unit/out/refcount/fn_ptr_vtable.rs +++ b/tests/unit/out/refcount/fn_ptr_vtable.rs @@ -62,12 +62,7 @@ fn main_0() -> i32 { assert!(!((*(*vt.borrow()).create.borrow()).is_null())); assert!(!((*(*vt.borrow()).get.borrow()).is_null())); assert!(!((*(*vt.borrow()).destroy.borrow()).is_null())); - let obj: Value = Rc::new(RefCell::new( - ({ - let _arg0: i32 = 42; - (*(*(*vt.borrow()).create.borrow()))(_arg0) - }), - )); + let obj: Value = Rc::new(RefCell::new(({ (*(*(*vt.borrow()).create.borrow()))(42) }))); assert!( (({ let _arg0: AnyPtr = (*obj.borrow()).clone(); diff --git a/tests/unit/out/refcount/function_call.rs b/tests/unit/out/refcount/function_call.rs index dde0802a..69b55047 100644 --- a/tests/unit/out/refcount/function_call.rs +++ b/tests/unit/out/refcount/function_call.rs @@ -16,12 +16,6 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - let y: Value = Rc::new(RefCell::new( - ({ - let _y: i32 = 10; - let _z: i32 = 1; - function_0(_y, _z) - }), - )); + let y: Value = Rc::new(RefCell::new(({ function_0(10, 1) }))); return (*y.borrow()); } diff --git a/tests/unit/out/refcount/function_overloading.rs b/tests/unit/out/refcount/function_overloading.rs index 00aa3599..1d43def8 100644 --- a/tests/unit/out/refcount/function_overloading.rs +++ b/tests/unit/out/refcount/function_overloading.rs @@ -82,10 +82,7 @@ pub fn main() { fn main_0() -> i32 { let x: Value = Rc::new(RefCell::new(1)); let out: Value = Rc::new(RefCell::new(0)); - (*out.borrow_mut()) += ({ - let _x: i32 = 0; - foo_0(_x) - }); + (*out.borrow_mut()) += ({ foo_0(0) }); (*out.borrow_mut()) += ({ let _x: Ptr = (x.as_pointer()); foo_1(_x) @@ -106,11 +103,7 @@ fn main_0() -> i32 { foo_2(_x, _y) }); let bar: Value = Rc::new(RefCell::new(5)); - (*out.borrow_mut()) += (((*bar.borrow()) - + ({ - let _x: i32 = 0; - foo_0(_x) - })) + (*out.borrow_mut()) += (((*bar.borrow()) + ({ foo_0(0) })) + ({ let _x: Ptr = (x.as_pointer()); foo_1(_x) @@ -118,14 +111,8 @@ fn main_0() -> i32 { let foo1: Value = Rc::new(RefCell::new(Foo {})); let foo2: Value = Rc::new(RefCell::new(Foo {})); ({ (*foo1.borrow()).foo() }); - ({ - let _x: i32 = 1; - (*foo1.borrow()).method_i32(_x) - }); + ({ (*foo1.borrow()).method_i32(1) }); ({ (*foo2.borrow()).foo_const() }); - ({ - let _x: i32 = 2; - (*foo2.borrow()).method_i32_const(_x) - }); + ({ (*foo2.borrow()).method_i32_const(2) }); return (*out.borrow()); } diff --git a/tests/unit/out/refcount/goto_aggregate_default.rs b/tests/unit/out/refcount/goto_aggregate_default.rs index d3cd131d..4eb6fee0 100644 --- a/tests/unit/out/refcount/goto_aggregate_default.rs +++ b/tests/unit/out/refcount/goto_aggregate_default.rs @@ -67,12 +67,6 @@ fn main_0() -> i32 { }) == 0) as i32) != 0) ); - assert!( - (((({ - let _n: i32 = 1; - agg_0(_n) - }) == 1) as i32) - != 0) - ); + assert!((((({ agg_0(1,) }) == 1) as i32) != 0)); return 0; } diff --git a/tests/unit/out/refcount/goto_backward.rs b/tests/unit/out/refcount/goto_backward.rs index fbfe8a33..fa72c1fb 100644 --- a/tests/unit/out/refcount/goto_backward.rs +++ b/tests/unit/out/refcount/goto_backward.rs @@ -30,12 +30,6 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (((({ - let _n: i32 = 4; - retry_0(_n) - }) == 12) as i32) - != 0) - ); + assert!((((({ retry_0(4,) }) == 12) as i32) != 0)); return 0; } diff --git a/tests/unit/out/refcount/goto_cleanup.rs b/tests/unit/out/refcount/goto_cleanup.rs index 4ba868ee..a29dbce5 100644 --- a/tests/unit/out/refcount/goto_cleanup.rs +++ b/tests/unit/out/refcount/goto_cleanup.rs @@ -85,40 +85,10 @@ fn main_0() -> i32 { }) == -1_i32) as i32) != 0) ); - assert!( - (((({ - let _n: i32 = 5; - early_0(_n) - }) == 100) as i32) - != 0) - ); - assert!( - (((({ - let _n: i32 = 2; - from_loop_1(_n) - }) == 999) as i32) - != 0) - ); - assert!( - (((({ - let _n: i32 = 10; - from_loop_1(_n) - }) == 7) as i32) - != 0) - ); - assert!( - (((({ - let _n: i32 = 1; - from_switch_2(_n) - }) == 10) as i32) - != 0) - ); - assert!( - (((({ - let _n: i32 = 2; - from_switch_2(_n) - }) == 999) as i32) - != 0) - ); + assert!((((({ early_0(5,) }) == 100) as i32) != 0)); + assert!((((({ from_loop_1(2,) }) == 999) as i32) != 0)); + assert!((((({ from_loop_1(10,) }) == 7) as i32) != 0)); + assert!((((({ from_switch_2(1,) }) == 10) as i32) != 0)); + assert!((((({ from_switch_2(2,) }) == 999) as i32) != 0)); return 0; } diff --git a/tests/unit/out/refcount/goto_multi_label.rs b/tests/unit/out/refcount/goto_multi_label.rs index 4a3c74bf..5ceb62aa 100644 --- a/tests/unit/out/refcount/goto_multi_label.rs +++ b/tests/unit/out/refcount/goto_multi_label.rs @@ -34,20 +34,8 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (((({ - let _n: i32 = 5; - classify_0(_n) - }) == 5) as i32) - != 0) - ); - assert!( - (((({ - let _n: i32 = 0; - classify_0(_n) - }) == 0) as i32) - != 0) - ); + assert!((((({ classify_0(5,) }) == 5) as i32) != 0)); + assert!((((({ classify_0(0,) }) == 0) as i32) != 0)); assert!( (((({ let _n: i32 = -2_i32; diff --git a/tests/unit/out/refcount/goto_nested_label.rs b/tests/unit/out/refcount/goto_nested_label.rs index 8dec8dd8..de16925c 100644 --- a/tests/unit/out/refcount/goto_nested_label.rs +++ b/tests/unit/out/refcount/goto_nested_label.rs @@ -36,12 +36,6 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (((({ - let _n: i32 = 2; - scan_0(_n) - }) == 2010) as i32) - != 0) - ); + assert!((((({ scan_0(2,) }) == 2010) as i32) != 0)); return 0; } diff --git a/tests/unit/out/refcount/goto_switch_fallthrough.rs b/tests/unit/out/refcount/goto_switch_fallthrough.rs index 68d74f8d..579cb515 100644 --- a/tests/unit/out/refcount/goto_switch_fallthrough.rs +++ b/tests/unit/out/refcount/goto_switch_fallthrough.rs @@ -37,26 +37,8 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (((({ - let _n: i32 = 0; - sm_0(_n) - }) == 11) as i32) - != 0) - ); - assert!( - (((({ - let _n: i32 = 1; - sm_0(_n) - }) == 10) as i32) - != 0) - ); - assert!( - (((({ - let _n: i32 = 9; - sm_0(_n) - }) == 1100) as i32) - != 0) - ); + assert!((((({ sm_0(0,) }) == 11) as i32) != 0)); + assert!((((({ sm_0(1,) }) == 10) as i32) != 0)); + assert!((((({ sm_0(9,) }) == 1100) as i32) != 0)); return 0; } diff --git a/tests/unit/out/refcount/huffman.rs b/tests/unit/out/refcount/huffman.rs index 4c17c7ed..a1935027 100644 --- a/tests/unit/out/refcount/huffman.rs +++ b/tests/unit/out/refcount/huffman.rs @@ -148,10 +148,7 @@ impl MinHeap { [((*self.size.borrow()) as u64) as usize]) .clone(); (*self.arr.borrow()).as_ref().unwrap().borrow_mut()[(0_u64) as usize] = __rhs; - ({ - let _idx: i32 = 0; - self.Heapify(_idx) - }); + ({ self.Heapify(0) }); return (*out.borrow()).clone(); } pub fn Insert(&self, node: Ptr) { @@ -261,12 +258,11 @@ pub fn Huffman_2( )); let top: Value> = Rc::new(RefCell::new( ({ - let _data: u8 = ('$' as u8); let _freq: i32 = { let _lhs = (*(*(*left.borrow()).upgrade().deref()).freq.borrow()); _lhs + (*(*(*right.borrow()).upgrade().deref()).freq.borrow()) }; - (*(*minHeap.borrow()).as_ref().unwrap().borrow()).Alloc(_data, _freq) + (*(*minHeap.borrow()).as_ref().unwrap().borrow()).Alloc(('$' as u8), _freq) }), )); (*(*(*top.borrow()).upgrade().deref()).left.borrow_mut()) = (*left.borrow()).clone(); diff --git a/tests/unit/out/refcount/kruskal.rs b/tests/unit/out/refcount/kruskal.rs index 39b39ca4..b311229c 100644 --- a/tests/unit/out/refcount/kruskal.rs +++ b/tests/unit/out/refcount/kruskal.rs @@ -295,9 +295,8 @@ impl ByteRepr for Graph {} pub fn MSTKruskal_2(graph: Ptr) -> f64 { ({ let _arr: Ptr>>> = (*graph.upgrade().deref()).edges.as_pointer(); - let _start: i32 = 0; let _end: i32 = ((*(*graph.upgrade().deref()).E.borrow()) - 1); - quicksort_1(_arr, _start, _end) + quicksort_1(_arr, 0, _end) }); let set: Value = Rc::new(RefCell::new(DisjointSet { rank: Rc::new(RefCell::new(Some(Rc::new(RefCell::new( diff --git a/tests/unit/out/refcount/lambda_capture_pass.rs b/tests/unit/out/refcount/lambda_capture_pass.rs index 5029433f..119325b2 100644 --- a/tests/unit/out/refcount/lambda_capture_pass.rs +++ b/tests/unit/out/refcount/lambda_capture_pass.rs @@ -38,16 +38,14 @@ fn main_0() -> i32 { assert!( (({ let _fn: _ = (*add_base.borrow()).clone(); - let _x: i32 = 5; - apply_0(_fn, _x) + apply_0(_fn, 5) }) == 15) ); (*base.borrow_mut()) = 100; assert!( (({ let _fn: _ = (*add_base.borrow()).clone(); - let _x: i32 = 5; - apply_0(_fn, _x) + apply_0(_fn, 5) }) == 105) ); let factor: Value = Rc::new(RefCell::new(3)); @@ -60,8 +58,7 @@ fn main_0() -> i32 { assert!( (({ let _fn: _ = (*scale.borrow()).clone(); - let _x: i32 = 4; - apply_1(_fn, _x) + apply_1(_fn, 4) }) == 12) ); return 0; diff --git a/tests/unit/out/refcount/lambda_nested.rs b/tests/unit/out/refcount/lambda_nested.rs index 9bdd91f0..a1e03c77 100644 --- a/tests/unit/out/refcount/lambda_nested.rs +++ b/tests/unit/out/refcount/lambda_nested.rs @@ -20,25 +20,11 @@ fn main_0() -> i32 { return (((*x.borrow()) + (*y.borrow())) + (*z.borrow())); }), )); - return ({ - let _z: i32 = 1; - (*inner.borrow_mut())(_z) - }) - .clone(); + return ({ (*inner.borrow_mut())(1) }); }), )); - assert!( - (({ - let _y: i32 = 20; - (*outer.borrow_mut())(_y) - }) == 31) - ); + assert!((({ (*outer.borrow_mut())(20,) }) == 31)); (*x.borrow_mut()) = 100; - assert!( - (({ - let _y: i32 = 20; - (*outer.borrow_mut())(_y) - }) == 121) - ); + assert!((({ (*outer.borrow_mut())(20,) }) == 121)); return 0; } diff --git a/tests/unit/out/refcount/linked_list.rs b/tests/unit/out/refcount/linked_list.rs index 17af3b14..9fe91c8a 100644 --- a/tests/unit/out/refcount/linked_list.rs +++ b/tests/unit/out/refcount/linked_list.rs @@ -148,14 +148,12 @@ fn main_0() -> i32 { }); let __rhs = ({ let _head: Ptr = (*head.borrow()).clone(); - let _val: i32 = 5; - Delete_2(_head, _val) + Delete_2(_head, 5) }); (*head.borrow_mut()) = __rhs; let __rhs = ({ let _head: Ptr = (*head.borrow()).clone(); - let _val: i32 = 0; - Delete_2(_head, _val) + Delete_2(_head, 0) }); (*head.borrow_mut()) = __rhs; let __rhs = ({ @@ -166,8 +164,7 @@ fn main_0() -> i32 { (*head.borrow_mut()) = __rhs; return (((((((*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 0; - Find_0(_head, _idx) + Find_0(_head, 0) }) .upgrade() .deref()) @@ -176,8 +173,7 @@ fn main_0() -> i32 { == 4) && ((*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 1; - Find_0(_head, _idx) + Find_0(_head, 1) }) .upgrade() .deref()) @@ -186,8 +182,7 @@ fn main_0() -> i32 { == 3)) && ((*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 2; - Find_0(_head, _idx) + Find_0(_head, 2) }) .upgrade() .deref()) @@ -196,8 +191,7 @@ fn main_0() -> i32 { == 2)) && ((*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 3; - Find_0(_head, _idx) + Find_0(_head, 3) }) .upgrade() .deref()) @@ -206,8 +200,7 @@ fn main_0() -> i32 { == 1)) && (((*(*({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 4; - Find_0(_head, _idx) + Find_0(_head, 4) }) .upgrade() .deref()) @@ -216,8 +209,7 @@ fn main_0() -> i32 { == -1_i32) && (({ let _head: Ptr = (*head.borrow()).clone(); - let _idx: i32 = 5; - Find_0(_head, _idx) + Find_0(_head, 5) }) .is_null()))) as i32); } diff --git a/tests/unit/out/refcount/macros.rs b/tests/unit/out/refcount/macros.rs index 3231fb0f..53324408 100644 --- a/tests/unit/out/refcount/macros.rs +++ b/tests/unit/out/refcount/macros.rs @@ -28,10 +28,8 @@ fn main_0() -> i32 { Ptr::from_string_literal(b"main") ); ({ - let _file: Ptr = Ptr::from_string_literal(b"macros.cpp"); - let _line: i32 = 9; let _func: Ptr = Ptr::from_string_literal(b"main"); - log_0(_file, _line, _func) + log_0(Ptr::from_string_literal(b"macros.cpp"), 9, _func) }); return 0; } diff --git a/tests/unit/out/refcount/matmul.rs b/tests/unit/out/refcount/matmul.rs index 2080936c..db979541 100644 --- a/tests/unit/out/refcount/matmul.rs +++ b/tests/unit/out/refcount/matmul.rs @@ -54,8 +54,7 @@ pub fn matmul_1( ({ let _n: i32 = (*n1.borrow()); let _p: i32 = (*p2.borrow()); - let _e: i32 = 0; - matalloc_0(_n, _p, _e) + matalloc_0(_n, _p, 0) }), )); let i: Value = Rc::new(RefCell::new(0)); @@ -96,16 +95,14 @@ fn main_0() -> i32 { ({ let _n: i32 = (*n.borrow()); let _p: i32 = (*p.borrow()); - let _e: i32 = 1; - matalloc_0(_n, _p, _e) + matalloc_0(_n, _p, 1) }), )); let m2: Value>>]>>>> = Rc::new(RefCell::new( ({ let _n: i32 = (*p.borrow()); let _p: i32 = (*n.borrow()); - let _e: i32 = 2; - matalloc_0(_n, _p, _e) + matalloc_0(_n, _p, 2) }), )); let m3: Value>>]>>>> = Rc::new(RefCell::new( diff --git a/tests/unit/out/refcount/new_bst.rs b/tests/unit/out/refcount/new_bst.rs index db448740..4469be62 100644 --- a/tests/unit/out/refcount/new_bst.rs +++ b/tests/unit/out/refcount/new_bst.rs @@ -117,33 +117,28 @@ fn main_0() -> i32 { }))); let __rhs = ({ let _node: Ptr = (*root.borrow()).clone(); - let _value: i32 = 1; - insert_1(_node, _value) + insert_1(_node, 1) }); (*root.borrow_mut()) = __rhs; let __rhs = ({ let _node: Ptr = (*root.borrow()).clone(); - let _value: i32 = 2; - insert_1(_node, _value) + insert_1(_node, 2) }); (*root.borrow_mut()) = __rhs; let __rhs = ({ let _node: Ptr = (*root.borrow()).clone(); - let _value: i32 = 3; - insert_1(_node, _value) + insert_1(_node, 3) }); (*root.borrow_mut()) = __rhs; let __rhs = ({ let _node: Ptr = (*root.borrow()).clone(); - let _value: i32 = 4; - insert_1(_node, _value) + insert_1(_node, 4) }); (*root.borrow_mut()) = __rhs; let out: Value = Rc::new(RefCell::new( ((((((*(*({ let _node: Ptr = (*root.borrow()).clone(); - let _value: i32 = 0; - find_0(_node, _value) + find_0(_node, 0) }) .upgrade() .deref()) @@ -152,8 +147,7 @@ fn main_0() -> i32 { == 0) && ((*(*({ let _node: Ptr = (*root.borrow()).clone(); - let _value: i32 = 1; - find_0(_node, _value) + find_0(_node, 1) }) .upgrade() .deref()) @@ -162,8 +156,7 @@ fn main_0() -> i32 { == 1)) && ((*(*({ let _node: Ptr = (*root.borrow()).clone(); - let _value: i32 = 2; - find_0(_node, _value) + find_0(_node, 2) }) .upgrade() .deref()) @@ -172,8 +165,7 @@ fn main_0() -> i32 { == 2)) && ((*(*({ let _node: Ptr = (*root.borrow()).clone(); - let _value: i32 = 3; - find_0(_node, _value) + find_0(_node, 3) }) .upgrade() .deref()) @@ -182,8 +174,7 @@ fn main_0() -> i32 { == 3)) && ((*(*({ let _node: Ptr = (*root.borrow()).clone(); - let _value: i32 = 4; - find_0(_node, _value) + find_0(_node, 4) }) .upgrade() .deref()) @@ -192,8 +183,7 @@ fn main_0() -> i32 { == 4)) && (({ let _node: Ptr = (*root.borrow()).clone(); - let _value: i32 = 5; - find_0(_node, _value) + find_0(_node, 5) }) .is_null()), )); diff --git a/tests/unit/out/refcount/push_emplace_back.rs b/tests/unit/out/refcount/push_emplace_back.rs index f55751ff..613bddb6 100644 --- a/tests/unit/out/refcount/push_emplace_back.rs +++ b/tests/unit/out/refcount/push_emplace_back.rs @@ -182,8 +182,7 @@ fn main_0() -> i32 { let jpg: Value = Rc::new(RefCell::new(::default())); ({ let _jpg: Ptr = (jpg.as_pointer()); - let _cond: bool = true; - push_local_from_field_1(_jpg, _cond) + push_local_from_field_1(_jpg, true) }); assert!(((*(*jpg.borrow()).com_data.borrow()).len() as u64 == 1_u64)); assert!( @@ -253,8 +252,7 @@ fn main_0() -> i32 { ); ({ let _jpg: Ptr = (jpg.as_pointer()); - let _cond: bool = false; - emplace_local_from_field_4(_jpg, _cond) + emplace_local_from_field_4(_jpg, false) }); assert!(((*(*jpg.borrow()).app_data.borrow()).len() as u64 == 1_u64)); assert!( diff --git a/tests/unit/out/refcount/refs_as_args.rs b/tests/unit/out/refcount/refs_as_args.rs index 0d85da47..66b865a1 100644 --- a/tests/unit/out/refcount/refs_as_args.rs +++ b/tests/unit/out/refcount/refs_as_args.rs @@ -49,11 +49,9 @@ fn main_0() -> i32 { let x1: Value = Rc::new(RefCell::new(1)); let x2: Value = Rc::new(RefCell::new(2)); ({ - let _x1: i32 = 3; - let _x2: i32 = 4; let _r1: Ptr = x1.as_pointer(); let _r2: Ptr = x2.as_pointer(); - more_refs_0(_x1, _x2, _r1, _r2) + more_refs_0(3, 4, _r1, _r2) }); return ((*x1.borrow()) + (*x2.borrow())); } diff --git a/tests/unit/out/refcount/reserved_keywords.rs b/tests/unit/out/refcount/reserved_keywords.rs index a8b2ea80..b670988f 100644 --- a/tests/unit/out/refcount/reserved_keywords.rs +++ b/tests/unit/out/refcount/reserved_keywords.rs @@ -341,85 +341,9 @@ fn main_0() -> i32 { let safe_: Value = Rc::new(RefCell::new(0)); let vec_: Value = Rc::new(RefCell::new(0)); return ({ - let _as: i32 = 0; - let _async: i32 = 0; - let _await: i32 = 0; - let _crate: i32 = 0; - let _dyn: i32 = 0; - let _fn: i32 = 0; - let _impl: i32 = 0; - let _in: i32 = 0; - let _let: i32 = 0; - let _loop: i32 = 0; - let _match: i32 = 0; - let _mod: i32 = 0; - let _move: i32 = 0; - let _mut: i32 = 0; - let _pub: i32 = 0; - let _ref: i32 = 0; - let _self: i32 = 0; - let _Self: i32 = 0; - let _super: i32 = 0; - let _trait: i32 = 0; - let _type: i32 = 0; - let _unsafe: i32 = 0; - let _use: i32 = 0; - let _where: i32 = 0; - let _abstract: i32 = 0; - let _become: i32 = 0; - let _box: i32 = 0; - let _final: i32 = 0; - let _gen: i32 = 0; - let _macro: i32 = 0; - let _override: i32 = 0; - let _priv: i32 = 0; - let _unsized: i32 = 0; - let _yield: i32 = 0; - let _macro_rules: i32 = 0; - let _raw: i32 = 0; - let _safe: i32 = 0; - let _vec: i32 = 0; - let _dummy: i32 = 0; foo_0( - _as, - _async, - _await, - _crate, - _dyn, - _fn, - _impl, - _in, - _let, - _loop, - _match, - _mod, - _move, - _mut, - _pub, - _ref, - _self, - _Self, - _super, - _trait, - _type, - _unsafe, - _use, - _where, - _abstract, - _become, - _box, - _final, - _gen, - _macro, - _override, - _priv, - _unsized, - _yield, - _macro_rules, - _raw, - _safe, - _vec, - _dummy, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ) }); } diff --git a/tests/unit/out/refcount/static_shadow.rs b/tests/unit/out/refcount/static_shadow.rs index 52352895..9a4ee6ef 100644 --- a/tests/unit/out/refcount/static_shadow.rs +++ b/tests/unit/out/refcount/static_shadow.rs @@ -24,13 +24,7 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (((({ - let _value: i32 = 10; - param_shadow_1(_value) - }) == 11) as i32) - != 0) - ); + assert!((((({ param_shadow_1(10,) }) == 11) as i32) != 0)); assert!((((({ local_shadow_2() }) == 99) as i32) != 0)); assert!((((({ read_global_3() }) == 5) as i32) != 0)); return 0; diff --git a/tests/unit/out/refcount/string_literals.rs b/tests/unit/out/refcount/string_literals.rs index 4cc09dbc..b640404a 100644 --- a/tests/unit/out/refcount/string_literals.rs +++ b/tests/unit/out/refcount/string_literals.rs @@ -36,10 +36,7 @@ fn main_0() -> i32 { let _str: Ptr = (mutable_string_arr.as_pointer() as Ptr); foo_mut_0(_str) }); - ({ - let _str: Ptr = Ptr::from_string_literal(b"world"); - foo_const_1(_str) - }); + ({ foo_const_1(Ptr::from_string_literal(b"world")) }); ({ let _str: Ptr = (*immutable_string.borrow()).clone(); foo_const_1(_str) @@ -48,10 +45,7 @@ fn main_0() -> i32 { let _str: Ptr = (immutable_string_arr.as_pointer() as Ptr); foo_const_1(_str) }); - ({ - let _str: Ptr = Ptr::from_string_literal(b""); - foo_const_1(_str) - }); + ({ foo_const_1(Ptr::from_string_literal(b"")) }); ({ let _str: Ptr = (*immutable_empty.borrow()).clone(); foo_const_1(_str) diff --git a/tests/unit/out/refcount/string_literals_c.rs b/tests/unit/out/refcount/string_literals_c.rs index 4706b590..4165daf6 100644 --- a/tests/unit/out/refcount/string_literals_c.rs +++ b/tests/unit/out/refcount/string_literals_c.rs @@ -39,10 +39,7 @@ fn main_0() -> i32 { Rc::new(RefCell::new(vec![0u8; 1].into_boxed_slice())); let immutable_empty_arr: Value> = Rc::new(RefCell::new(vec![0u8; 1].into_boxed_slice())); - ({ - let _str: Ptr = Ptr::from_string_literal(b"world"); - foo_mut_0(_str) - }); + ({ foo_mut_0(Ptr::from_string_literal(b"world")) }); ({ let _str: Ptr = (*mutable_string.borrow()).clone(); foo_mut_0(_str) @@ -51,10 +48,7 @@ fn main_0() -> i32 { let _str: Ptr = (mutable_string_arr.as_pointer() as Ptr); foo_mut_0(_str) }); - ({ - let _str: Ptr = Ptr::from_string_literal(b"world"); - foo_const_1(_str) - }); + ({ foo_const_1(Ptr::from_string_literal(b"world")) }); ({ let _str: Ptr = (*mutable_string.borrow()).clone(); foo_const_1(_str) @@ -71,10 +65,7 @@ fn main_0() -> i32 { let _str: Ptr = (immutable_string_arr.as_pointer() as Ptr); foo_const_1(_str) }); - ({ - let _str: Ptr = Ptr::from_string_literal(b""); - foo_const_1(_str) - }); + ({ foo_const_1(Ptr::from_string_literal(b"")) }); ({ let _str: Ptr = (*mutable_empty.borrow()).clone(); foo_const_1(_str) diff --git a/tests/unit/out/refcount/string_literals_return.rs b/tests/unit/out/refcount/string_literals_return.rs index ac18cff7..2b4445d1 100644 --- a/tests/unit/out/refcount/string_literals_return.rs +++ b/tests/unit/out/refcount/string_literals_return.rs @@ -29,12 +29,7 @@ fn main_0() -> i32 { assert!(((((*a.borrow()).offset((5) as isize).read()) as i32) == (('\0' as u8) as i32))); let b: Value> = Rc::new(RefCell::new(({ get_empty_1() }))); assert!(((((*b.borrow()).offset((0) as isize).read()) as i32) == (('\0' as u8) as i32))); - let c: Value> = Rc::new(RefCell::new( - ({ - let _x: i32 = 1; - get_branch_2(_x) - }), - )); + let c: Value> = Rc::new(RefCell::new(({ get_branch_2(1) }))); assert!(((((*c.borrow()).offset((0) as isize).read()) as i32) == (('p' as u8) as i32))); assert!(((((*c.borrow()).offset((7) as isize).read()) as i32) == (('e' as u8) as i32))); assert!(((((*c.borrow()).offset((8) as isize).read()) as i32) == (('\0' as u8) as i32))); diff --git a/tests/unit/out/refcount/string_literals_return_c.rs b/tests/unit/out/refcount/string_literals_return_c.rs index 95cea21a..b98f24aa 100644 --- a/tests/unit/out/refcount/string_literals_return_c.rs +++ b/tests/unit/out/refcount/string_literals_return_c.rs @@ -33,12 +33,7 @@ fn main_0() -> i32 { assert!( ((((((*b.borrow()).offset((0) as isize).read()) as i32) == ('\0' as i32)) as i32) != 0) ); - let c: Value> = Rc::new(RefCell::new( - ({ - let _x: i32 = 1; - get_branch_2(_x) - }), - )); + let c: Value> = Rc::new(RefCell::new(({ get_branch_2(1) }))); assert!(((((((*c.borrow()).offset((0) as isize).read()) as i32) == ('p' as i32)) as i32) != 0)); assert!(((((((*c.borrow()).offset((7) as isize).read()) as i32) == ('e' as i32)) as i32) != 0)); assert!( diff --git a/tests/unit/out/refcount/strlen_rec.rs b/tests/unit/out/refcount/strlen_rec.rs index cdf487d0..2b66af0e 100644 --- a/tests/unit/out/refcount/strlen_rec.rs +++ b/tests/unit/out/refcount/strlen_rec.rs @@ -31,7 +31,6 @@ fn main_0() -> i32 { ]))); return ({ let _s: Ptr = ((s.as_pointer() as Ptr).offset(0 as isize)); - let _n: i32 = 0; - strlen_0(_s, _n) + strlen_0(_s, 0) }); } diff --git a/tests/unit/out/refcount/switch_basic.rs b/tests/unit/out/refcount/switch_basic.rs index 38b3b7d7..25b60600 100644 --- a/tests/unit/out/refcount/switch_basic.rs +++ b/tests/unit/out/refcount/switch_basic.rs @@ -37,23 +37,8 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 0; - basic_0(_x) - }) == 10) - ); - assert!( - (({ - let _x: i32 = 2; - basic_0(_x) - }) == 30) - ); - assert!( - (({ - let _x: i32 = 99; - basic_0(_x) - }) == 40) - ); + assert!((({ basic_0(0,) }) == 10)); + assert!((({ basic_0(2,) }) == 30)); + assert!((({ basic_0(99,) }) == 40)); return 0; } diff --git a/tests/unit/out/refcount/switch_borrow_in_condition_and_in_body.rs b/tests/unit/out/refcount/switch_borrow_in_condition_and_in_body.rs index 7bb749f0..e13f444e 100644 --- a/tests/unit/out/refcount/switch_borrow_in_condition_and_in_body.rs +++ b/tests/unit/out/refcount/switch_borrow_in_condition_and_in_body.rs @@ -20,17 +20,7 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 0; - borrow_in_condition_and_in_body_0(_x) - }) == 1) - ); - assert!( - (({ - let _x: i32 = 1; - borrow_in_condition_and_in_body_0(_x) - }) == 2) - ); + assert!((({ borrow_in_condition_and_in_body_0(0,) }) == 1)); + assert!((({ borrow_in_condition_and_in_body_0(1,) }) == 2)); return 0; } diff --git a/tests/unit/out/refcount/switch_case_then_default.rs b/tests/unit/out/refcount/switch_case_then_default.rs index fe82b175..ae6b216a 100644 --- a/tests/unit/out/refcount/switch_case_then_default.rs +++ b/tests/unit/out/refcount/switch_case_then_default.rs @@ -28,23 +28,8 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 1; - case_then_default_0(_x) - }) == 10) - ); - assert!( - (({ - let _x: i32 = 2; - case_then_default_0(_x) - }) == 20) - ); - assert!( - (({ - let _x: i32 = 99; - case_then_default_0(_x) - }) == 10) - ); + assert!((({ case_then_default_0(1,) }) == 10)); + assert!((({ case_then_default_0(2,) }) == 20)); + assert!((({ case_then_default_0(99,) }) == 10)); return 0; } diff --git a/tests/unit/out/refcount/switch_cases_and_default_stacked.rs b/tests/unit/out/refcount/switch_cases_and_default_stacked.rs index 4b5765ec..2f11539a 100644 --- a/tests/unit/out/refcount/switch_cases_and_default_stacked.rs +++ b/tests/unit/out/refcount/switch_cases_and_default_stacked.rs @@ -28,29 +28,9 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 1; - cases_and_default_stacked_0(_x) - }) == 42) - ); - assert!( - (({ - let _x: i32 = 2; - cases_and_default_stacked_0(_x) - }) == 42) - ); - assert!( - (({ - let _x: i32 = 3; - cases_and_default_stacked_0(_x) - }) == 3) - ); - assert!( - (({ - let _x: i32 = 99; - cases_and_default_stacked_0(_x) - }) == 42) - ); + assert!((({ cases_and_default_stacked_0(1,) }) == 42)); + assert!((({ cases_and_default_stacked_0(2,) }) == 42)); + assert!((({ cases_and_default_stacked_0(3,) }) == 3)); + assert!((({ cases_and_default_stacked_0(99,) }) == 42)); return 0; } diff --git a/tests/unit/out/refcount/switch_char.rs b/tests/unit/out/refcount/switch_char.rs index 59128d68..d6513ca2 100644 --- a/tests/unit/out/refcount/switch_char.rs +++ b/tests/unit/out/refcount/switch_char.rs @@ -52,35 +52,10 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _c: u8 = ('a' as u8); - switch_char_0(_c) - }) == 1) - ); - assert!( - (({ - let _c: u8 = ('b' as u8); - switch_char_0(_c) - }) == 2) - ); - assert!( - (({ - let _c: u8 = ('\n' as u8); - switch_char_0(_c) - }) == 3) - ); - assert!( - (({ - let _c: u8 = ('\0' as u8); - switch_char_0(_c) - }) == 4) - ); - assert!( - (({ - let _c: u8 = ('z' as u8); - switch_char_0(_c) - }) == 0) - ); + assert!((({ switch_char_0(('a' as u8),) }) == 1)); + assert!((({ switch_char_0(('b' as u8),) }) == 2)); + assert!((({ switch_char_0(('\n' as u8),) }) == 3)); + assert!((({ switch_char_0(('\0' as u8),) }) == 4)); + assert!((({ switch_char_0(('z' as u8),) }) == 0)); return 0; } diff --git a/tests/unit/out/refcount/switch_complex_cond.rs b/tests/unit/out/refcount/switch_complex_cond.rs index 0d7496ac..cec42130 100644 --- a/tests/unit/out/refcount/switch_complex_cond.rs +++ b/tests/unit/out/refcount/switch_complex_cond.rs @@ -39,15 +39,13 @@ fn main_0() -> i32 { assert!( (({ let _p: Ptr = (p_val.as_pointer()); - let _bias: i32 = 0; - switch_complex_cond_0(_p, _bias) + switch_complex_cond_0(_p, 0) }) == 2) ); assert!( (({ let _p: Ptr = (p_val.as_pointer()); - let _bias: i32 = 5; - switch_complex_cond_0(_p, _bias) + switch_complex_cond_0(_p, 5) }) == 3) ); assert!( @@ -60,8 +58,7 @@ fn main_0() -> i32 { assert!( (({ let _p: Ptr = (p_val.as_pointer()); - let _bias: i32 = 99; - switch_complex_cond_0(_p, _bias) + switch_complex_cond_0(_p, 99) }) == 0) ); return 0; diff --git a/tests/unit/out/refcount/switch_compound_case_body.rs b/tests/unit/out/refcount/switch_compound_case_body.rs index 3fe3e0b5..c4a17f1c 100644 --- a/tests/unit/out/refcount/switch_compound_case_body.rs +++ b/tests/unit/out/refcount/switch_compound_case_body.rs @@ -35,23 +35,8 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 1; - compound_case_body_0(_x) - }) == 30) - ); - assert!( - (({ - let _x: i32 = 2; - compound_case_body_0(_x) - }) == 99) - ); - assert!( - (({ - let _x: i32 = 9; - compound_case_body_0(_x) - }) == -1_i32) - ); + assert!((({ compound_case_body_0(1,) }) == 30)); + assert!((({ compound_case_body_0(2,) }) == 99)); + assert!((({ compound_case_body_0(9,) }) == -1_i32)); return 0; } diff --git a/tests/unit/out/refcount/switch_continue_inside_switch.rs b/tests/unit/out/refcount/switch_continue_inside_switch.rs index c2929f6d..068f9658 100644 --- a/tests/unit/out/refcount/switch_continue_inside_switch.rs +++ b/tests/unit/out/refcount/switch_continue_inside_switch.rs @@ -33,11 +33,6 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _n: i32 = 6; - continue_inside_switch_0(_n) - }) == (((1 + 3) + 5) + (3 * 1000))) - ); + assert!((({ continue_inside_switch_0(6,) }) == (((1 + 3) + 5) + (3 * 1000)))); return 0; } diff --git a/tests/unit/out/refcount/switch_default_first.rs b/tests/unit/out/refcount/switch_default_first.rs index 378329b3..57f0ab01 100644 --- a/tests/unit/out/refcount/switch_default_first.rs +++ b/tests/unit/out/refcount/switch_default_first.rs @@ -32,17 +32,7 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 1; - default_first_0(_x) - }) == 1) - ); - assert!( - (({ - let _x: i32 = 99; - default_first_0(_x) - }) == 7) - ); + assert!((({ default_first_0(1,) }) == 1)); + assert!((({ default_first_0(99,) }) == 7)); return 0; } diff --git a/tests/unit/out/refcount/switch_default_middle.rs b/tests/unit/out/refcount/switch_default_middle.rs index cdcd173a..48aee8b7 100644 --- a/tests/unit/out/refcount/switch_default_middle.rs +++ b/tests/unit/out/refcount/switch_default_middle.rs @@ -32,23 +32,8 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 1; - default_middle_0(_x) - }) == 1) - ); - assert!( - (({ - let _x: i32 = 2; - default_middle_0(_x) - }) == 2) - ); - assert!( - (({ - let _x: i32 = 99; - default_middle_0(_x) - }) == 99) - ); + assert!((({ default_middle_0(1,) }) == 1)); + assert!((({ default_middle_0(2,) }) == 2)); + assert!((({ default_middle_0(99,) }) == 99)); return 0; } diff --git a/tests/unit/out/refcount/switch_default_then_case.rs b/tests/unit/out/refcount/switch_default_then_case.rs index 7ae25e2a..1eb6cb21 100644 --- a/tests/unit/out/refcount/switch_default_then_case.rs +++ b/tests/unit/out/refcount/switch_default_then_case.rs @@ -32,29 +32,9 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 1; - default_then_case_0(_x) - }) == 1) - ); - assert!( - (({ - let _x: i32 = 2; - default_then_case_0(_x) - }) == 77) - ); - assert!( - (({ - let _x: i32 = 3; - default_then_case_0(_x) - }) == 3) - ); - assert!( - (({ - let _x: i32 = 99; - default_then_case_0(_x) - }) == 77) - ); + assert!((({ default_then_case_0(1,) }) == 1)); + assert!((({ default_then_case_0(2,) }) == 77)); + assert!((({ default_then_case_0(3,) }) == 3)); + assert!((({ default_then_case_0(99,) }) == 77)); return 0; } diff --git a/tests/unit/out/refcount/switch_empty_case_with_break.rs b/tests/unit/out/refcount/switch_empty_case_with_break.rs index 60ae9b72..a3783ef0 100644 --- a/tests/unit/out/refcount/switch_empty_case_with_break.rs +++ b/tests/unit/out/refcount/switch_empty_case_with_break.rs @@ -31,23 +31,8 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 1; - empty_case_with_break_0(_x) - }) == 5) - ); - assert!( - (({ - let _x: i32 = 2; - empty_case_with_break_0(_x) - }) == 2) - ); - assert!( - (({ - let _x: i32 = 9; - empty_case_with_break_0(_x) - }) == 9) - ); + assert!((({ empty_case_with_break_0(1,) }) == 5)); + assert!((({ empty_case_with_break_0(2,) }) == 2)); + assert!((({ empty_case_with_break_0(9,) }) == 9)); return 0; } diff --git a/tests/unit/out/refcount/switch_empty_switch.rs b/tests/unit/out/refcount/switch_empty_switch.rs index ce1d9a97..109d2542 100644 --- a/tests/unit/out/refcount/switch_empty_switch.rs +++ b/tests/unit/out/refcount/switch_empty_switch.rs @@ -20,11 +20,6 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 5; - empty_switch_0(_x) - }) == 5) - ); + assert!((({ empty_switch_0(5,) }) == 5)); return 0; } diff --git a/tests/unit/out/refcount/switch_fallthrough_chain.rs b/tests/unit/out/refcount/switch_fallthrough_chain.rs index 091e0daf..fee2cd2d 100644 --- a/tests/unit/out/refcount/switch_fallthrough_chain.rs +++ b/tests/unit/out/refcount/switch_fallthrough_chain.rs @@ -34,35 +34,10 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 1; - fallthrough_chain_0(_x) - }) == 15) - ); - assert!( - (({ - let _x: i32 = 2; - fallthrough_chain_0(_x) - }) == 14) - ); - assert!( - (({ - let _x: i32 = 3; - fallthrough_chain_0(_x) - }) == 12) - ); - assert!( - (({ - let _x: i32 = 4; - fallthrough_chain_0(_x) - }) == 8) - ); - assert!( - (({ - let _x: i32 = 99; - fallthrough_chain_0(_x) - }) == -1_i32) - ); + assert!((({ fallthrough_chain_0(1,) }) == 15)); + assert!((({ fallthrough_chain_0(2,) }) == 14)); + assert!((({ fallthrough_chain_0(3,) }) == 12)); + assert!((({ fallthrough_chain_0(4,) }) == 8)); + assert!((({ fallthrough_chain_0(99,) }) == -1_i32)); return 0; } diff --git a/tests/unit/out/refcount/switch_fallthrough_default.rs b/tests/unit/out/refcount/switch_fallthrough_default.rs index 459bdf12..9e819b00 100644 --- a/tests/unit/out/refcount/switch_fallthrough_default.rs +++ b/tests/unit/out/refcount/switch_fallthrough_default.rs @@ -28,26 +28,8 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 7; - let _flag: i32 = 0; - fallthrough_default_0(_x, _flag) - }) == 42) - ); - assert!( - (({ - let _x: i32 = 7; - let _flag: i32 = 1; - fallthrough_default_0(_x, _flag) - }) == 100) - ); - assert!( - (({ - let _x: i32 = 99; - let _flag: i32 = 0; - fallthrough_default_0(_x, _flag) - }) == 42) - ); + assert!((({ fallthrough_default_0(7, 0,) }) == 42)); + assert!((({ fallthrough_default_0(7, 1,) }) == 100)); + assert!((({ fallthrough_default_0(99, 0,) }) == 42)); return 0; } diff --git a/tests/unit/out/refcount/switch_fallthrough_into_block.rs b/tests/unit/out/refcount/switch_fallthrough_into_block.rs index 71a53d6d..fbb1d84f 100644 --- a/tests/unit/out/refcount/switch_fallthrough_into_block.rs +++ b/tests/unit/out/refcount/switch_fallthrough_into_block.rs @@ -29,23 +29,8 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 1; - fallthrough_into_block_0(_x) - }) == 15) - ); - assert!( - (({ - let _x: i32 = 2; - fallthrough_into_block_0(_x) - }) == 5) - ); - assert!( - (({ - let _x: i32 = 99; - fallthrough_into_block_0(_x) - }) == -1_i32) - ); + assert!((({ fallthrough_into_block_0(1,) }) == 15)); + assert!((({ fallthrough_into_block_0(2,) }) == 5)); + assert!((({ fallthrough_into_block_0(99,) }) == -1_i32)); return 0; } diff --git a/tests/unit/out/refcount/switch_fallthrough_one.rs b/tests/unit/out/refcount/switch_fallthrough_one.rs index c328009b..b4fe92e9 100644 --- a/tests/unit/out/refcount/switch_fallthrough_one.rs +++ b/tests/unit/out/refcount/switch_fallthrough_one.rs @@ -28,23 +28,8 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 1; - fallthrough_one_0(_x) - }) == 30) - ); - assert!( - (({ - let _x: i32 = 2; - fallthrough_one_0(_x) - }) == 20) - ); - assert!( - (({ - let _x: i32 = 99; - fallthrough_one_0(_x) - }) == -1_i32) - ); + assert!((({ fallthrough_one_0(1,) }) == 30)); + assert!((({ fallthrough_one_0(2,) }) == 20)); + assert!((({ fallthrough_one_0(99,) }) == -1_i32)); return 0; } diff --git a/tests/unit/out/refcount/switch_for_in_switch_break.rs b/tests/unit/out/refcount/switch_for_in_switch_break.rs index c543eaba..e255e589 100644 --- a/tests/unit/out/refcount/switch_for_in_switch_break.rs +++ b/tests/unit/out/refcount/switch_for_in_switch_break.rs @@ -36,17 +36,7 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _n: i32 = 0; - for_in_switch_break_0(_n) - }) == 103) - ); - assert!( - (({ - let _n: i32 = 99; - for_in_switch_break_0(_n) - }) == -1_i32) - ); + assert!((({ for_in_switch_break_0(0,) }) == 103)); + assert!((({ for_in_switch_break_0(99,) }) == -1_i32)); return 0; } diff --git a/tests/unit/out/refcount/switch_for_in_switch_continue.rs b/tests/unit/out/refcount/switch_for_in_switch_continue.rs index b98f3d36..b436be23 100644 --- a/tests/unit/out/refcount/switch_for_in_switch_continue.rs +++ b/tests/unit/out/refcount/switch_for_in_switch_continue.rs @@ -36,17 +36,7 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _n: i32 = 0; - for_in_switch_continue_0(_n) - }) == 4) - ); - assert!( - (({ - let _n: i32 = 99; - for_in_switch_continue_0(_n) - }) == -1_i32) - ); + assert!((({ for_in_switch_continue_0(0,) }) == 4)); + assert!((({ for_in_switch_continue_0(99,) }) == -1_i32)); return 0; } diff --git a/tests/unit/out/refcount/switch_for_switch_for_break.rs b/tests/unit/out/refcount/switch_for_switch_for_break.rs index e7c070af..87ad0ab0 100644 --- a/tests/unit/out/refcount/switch_for_switch_for_break.rs +++ b/tests/unit/out/refcount/switch_for_switch_for_break.rs @@ -40,11 +40,6 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _n: i32 = 3; - for_switch_for_break_0(_n) - }) == 122) - ); + assert!((({ for_switch_for_break_0(3,) }) == 122)); return 0; } diff --git a/tests/unit/out/refcount/switch_in_dowhile.rs b/tests/unit/out/refcount/switch_in_dowhile.rs index d7b72a1d..fb0c62d2 100644 --- a/tests/unit/out/refcount/switch_in_dowhile.rs +++ b/tests/unit/out/refcount/switch_in_dowhile.rs @@ -38,17 +38,7 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _n: i32 = 1; - switch_in_dowhile_0(_n) - }) == 1) - ); - assert!( - (({ - let _n: i32 = 3; - switch_in_dowhile_0(_n) - }) == ((1 + 10) + 100)) - ); + assert!((({ switch_in_dowhile_0(1,) }) == 1)); + assert!((({ switch_in_dowhile_0(3,) }) == ((1 + 10) + 100))); return 0; } diff --git a/tests/unit/out/refcount/switch_in_loop.rs b/tests/unit/out/refcount/switch_in_loop.rs index 15d10c25..1847fa6c 100644 --- a/tests/unit/out/refcount/switch_in_loop.rs +++ b/tests/unit/out/refcount/switch_in_loop.rs @@ -37,11 +37,6 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _n: i32 = 6; - switch_in_loop_0(_n) - }) == 72) - ); + assert!((({ switch_in_loop_0(6,) }) == 72)); return 0; } diff --git a/tests/unit/out/refcount/switch_mixed_literal_cases.rs b/tests/unit/out/refcount/switch_mixed_literal_cases.rs index b22b50e1..782bd99b 100644 --- a/tests/unit/out/refcount/switch_mixed_literal_cases.rs +++ b/tests/unit/out/refcount/switch_mixed_literal_cases.rs @@ -40,29 +40,14 @@ fn main_0() -> i32 { mixed_literal_cases_0(_x) }) == 1) ); - assert!( - (({ - let _x: i32 = 16; - mixed_literal_cases_0(_x) - }) == 2) - ); - assert!( - (({ - let _x: i32 = 65152; - mixed_literal_cases_0(_x) - }) == 3) - ); + assert!((({ mixed_literal_cases_0(16,) }) == 2)); + assert!((({ mixed_literal_cases_0(65152,) }) == 3)); assert!( (({ let _x: i32 = -255_i32; mixed_literal_cases_0(_x) }) == 4) ); - assert!( - (({ - let _x: i32 = 7; - mixed_literal_cases_0(_x) - }) == 0) - ); + assert!((({ mixed_literal_cases_0(7,) }) == 0)); return 0; } diff --git a/tests/unit/out/refcount/switch_mixed_return_break.rs b/tests/unit/out/refcount/switch_mixed_return_break.rs index b4feeb4b..d0562185 100644 --- a/tests/unit/out/refcount/switch_mixed_return_break.rs +++ b/tests/unit/out/refcount/switch_mixed_return_break.rs @@ -34,29 +34,9 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 0; - mixed_return_break_0(_x) - }) == 100) - ); - assert!( - (({ - let _x: i32 = 1; - mixed_return_break_0(_x) - }) == 10) - ); - assert!( - (({ - let _x: i32 = 2; - mixed_return_break_0(_x) - }) == 200) - ); - assert!( - (({ - let _x: i32 = 99; - mixed_return_break_0(_x) - }) == 99) - ); + assert!((({ mixed_return_break_0(0,) }) == 100)); + assert!((({ mixed_return_break_0(1,) }) == 10)); + assert!((({ mixed_return_break_0(2,) }) == 200)); + assert!((({ mixed_return_break_0(99,) }) == 99)); return 0; } diff --git a/tests/unit/out/refcount/switch_nested.rs b/tests/unit/out/refcount/switch_nested.rs index 807e4965..959be2d9 100644 --- a/tests/unit/out/refcount/switch_nested.rs +++ b/tests/unit/out/refcount/switch_nested.rs @@ -50,33 +50,9 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _a: i32 = 1; - let _b: i32 = 10; - nested_0(_a, _b) - }) == 12) - ); - assert!( - (({ - let _a: i32 = 1; - let _b: i32 = 99; - nested_0(_a, _b) - }) == 14) - ); - assert!( - (({ - let _a: i32 = 2; - let _b: i32 = 0; - nested_0(_a, _b) - }) == 2) - ); - assert!( - (({ - let _a: i32 = 3; - let _b: i32 = 3; - nested_0(_a, _b) - }) == -1_i32) - ); + assert!((({ nested_0(1, 10,) }) == 12)); + assert!((({ nested_0(1, 99,) }) == 14)); + assert!((({ nested_0(2, 0,) }) == 2)); + assert!((({ nested_0(3, 3,) }) == -1_i32)); return 0; } diff --git a/tests/unit/out/refcount/switch_no_default.rs b/tests/unit/out/refcount/switch_no_default.rs index a9ab2aba..a4551fb4 100644 --- a/tests/unit/out/refcount/switch_no_default.rs +++ b/tests/unit/out/refcount/switch_no_default.rs @@ -29,17 +29,7 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 7; - no_default_0(_x) - }) == 1) - ); - assert!( - (({ - let _x: i32 = 42; - no_default_0(_x) - }) == -1_i32) - ); + assert!((({ no_default_0(7,) }) == 1)); + assert!((({ no_default_0(42,) }) == -1_i32)); return 0; } diff --git a/tests/unit/out/refcount/switch_on_assignment.rs b/tests/unit/out/refcount/switch_on_assignment.rs index b67d6609..96ebd4b2 100644 --- a/tests/unit/out/refcount/switch_on_assignment.rs +++ b/tests/unit/out/refcount/switch_on_assignment.rs @@ -36,23 +36,8 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 0; - switch_on_assignment_0(_x) - }) == 10) - ); - assert!( - (({ - let _x: i32 = 1; - switch_on_assignment_0(_x) - }) == 20) - ); - assert!( - (({ - let _x: i32 = 9; - switch_on_assignment_0(_x) - }) == 10) - ); + assert!((({ switch_on_assignment_0(0,) }) == 10)); + assert!((({ switch_on_assignment_0(1,) }) == 20)); + assert!((({ switch_on_assignment_0(9,) }) == 10)); return 0; } diff --git a/tests/unit/out/refcount/switch_on_call.rs b/tests/unit/out/refcount/switch_on_call.rs index 912bac39..e056986f 100644 --- a/tests/unit/out/refcount/switch_on_call.rs +++ b/tests/unit/out/refcount/switch_on_call.rs @@ -38,29 +38,9 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 0; - switch_on_call_1(_x) - }) == 100) - ); - assert!( - (({ - let _x: i32 = 1; - switch_on_call_1(_x) - }) == 200) - ); - assert!( - (({ - let _x: i32 = 2; - switch_on_call_1(_x) - }) == 400) - ); - assert!( - (({ - let _x: i32 = 99; - switch_on_call_1(_x) - }) == -1_i32) - ); + assert!((({ switch_on_call_1(0,) }) == 100)); + assert!((({ switch_on_call_1(1,) }) == 200)); + assert!((({ switch_on_call_1(2,) }) == 400)); + assert!((({ switch_on_call_1(99,) }) == -1_i32)); return 0; } diff --git a/tests/unit/out/refcount/switch_only_default.rs b/tests/unit/out/refcount/switch_only_default.rs index 4432e531..e2a36c86 100644 --- a/tests/unit/out/refcount/switch_only_default.rs +++ b/tests/unit/out/refcount/switch_only_default.rs @@ -24,11 +24,6 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 1; - only_default_0(_x) - }) == 42) - ); + assert!((({ only_default_0(1,) }) == 42)); return 0; } diff --git a/tests/unit/out/refcount/switch_stacked.rs b/tests/unit/out/refcount/switch_stacked.rs index 4f6c512d..b3f87d6a 100644 --- a/tests/unit/out/refcount/switch_stacked.rs +++ b/tests/unit/out/refcount/switch_stacked.rs @@ -32,29 +32,9 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 1; - stacked_0(_x) - }) == 100) - ); - assert!( - (({ - let _x: i32 = 3; - stacked_0(_x) - }) == 100) - ); - assert!( - (({ - let _x: i32 = 5; - stacked_0(_x) - }) == 200) - ); - assert!( - (({ - let _x: i32 = 9; - stacked_0(_x) - }) == 300) - ); + assert!((({ stacked_0(1,) }) == 100)); + assert!((({ stacked_0(3,) }) == 100)); + assert!((({ stacked_0(5,) }) == 200)); + assert!((({ stacked_0(9,) }) == 300)); return 0; } diff --git a/tests/unit/out/refcount/switch_stacked_block.rs b/tests/unit/out/refcount/switch_stacked_block.rs index c9d94645..18acfad4 100644 --- a/tests/unit/out/refcount/switch_stacked_block.rs +++ b/tests/unit/out/refcount/switch_stacked_block.rs @@ -29,17 +29,7 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 2; - stacked_block_0(_x) - }) == 5) - ); - assert!( - (({ - let _x: i32 = 9; - stacked_block_0(_x) - }) == 0) - ); + assert!((({ stacked_block_0(2,) }) == 5)); + assert!((({ stacked_block_0(9,) }) == 0)); return 0; } diff --git a/tests/unit/out/refcount/switch_stacked_with_inner_fallthrough.rs b/tests/unit/out/refcount/switch_stacked_with_inner_fallthrough.rs index d96ef1a8..e0aa3f15 100644 --- a/tests/unit/out/refcount/switch_stacked_with_inner_fallthrough.rs +++ b/tests/unit/out/refcount/switch_stacked_with_inner_fallthrough.rs @@ -28,26 +28,8 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _x: i32 = 1; - let _flag: i32 = 0; - stacked_with_inner_fallthrough_0(_x, _flag) - }) == 50) - ); - assert!( - (({ - let _x: i32 = 2; - let _flag: i32 = 1; - stacked_with_inner_fallthrough_0(_x, _flag) - }) == 999) - ); - assert!( - (({ - let _x: i32 = 99; - let _flag: i32 = 0; - stacked_with_inner_fallthrough_0(_x, _flag) - }) == 999) - ); + assert!((({ stacked_with_inner_fallthrough_0(1, 0,) }) == 50)); + assert!((({ stacked_with_inner_fallthrough_0(2, 1,) }) == 999)); + assert!((({ stacked_with_inner_fallthrough_0(99, 0,) }) == 999)); return 0; } diff --git a/tests/unit/out/refcount/switch_while_in_switch_break.rs b/tests/unit/out/refcount/switch_while_in_switch_break.rs index 09adb582..5f2184b2 100644 --- a/tests/unit/out/refcount/switch_while_in_switch_break.rs +++ b/tests/unit/out/refcount/switch_while_in_switch_break.rs @@ -36,17 +36,7 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (({ - let _n: i32 = 0; - while_in_switch_break_0(_n) - }) == 1006) - ); - assert!( - (({ - let _n: i32 = 99; - while_in_switch_break_0(_n) - }) == -1_i32) - ); + assert!((({ while_in_switch_break_0(0,) }) == 1006)); + assert!((({ while_in_switch_break_0(99,) }) == -1_i32)); return 0; } diff --git a/tests/unit/out/refcount/templates.rs b/tests/unit/out/refcount/templates.rs index da0ddbae..ebd08dce 100644 --- a/tests/unit/out/refcount/templates.rs +++ b/tests/unit/out/refcount/templates.rs @@ -60,26 +60,18 @@ fn main_0() -> i32 { })) + ((({ let _p: Ptr = (x.as_pointer()); - let _flag: bool = true; - bar_2(_p, _flag) + bar_2(_p, true) }) .read()) as f64)) + (({ let _p: Ptr = (y.as_pointer()); - let _flag: bool = true; - bar_3(_p, _flag) + bar_3(_p, true) }) .read())) + + (({ func_4(1, 2, 3) }) as f64)) + (({ - let _x1: i32 = 1; - let _x2: i32 = 2; - let _x3: i32 = 3; - func_4(_x1, _x2, _x3) - }) as f64)) - + (({ - let _x1: f64 = 2.0E+0; let _x2: i32 = (*x.borrow()); let _x3: f64 = (*y.borrow()); - func_5(_x1, _x2, _x3) + func_5(2.0E+0, _x2, _x3) }) as f64)) as i32); } diff --git a/tests/unit/out/refcount/unique_ptr.rs b/tests/unit/out/refcount/unique_ptr.rs index 43cb80ba..d1a55324 100644 --- a/tests/unit/out/refcount/unique_ptr.rs +++ b/tests/unit/out/refcount/unique_ptr.rs @@ -77,10 +77,7 @@ pub fn DoStuffWithSafePointer_0(safe_ptr: Ptr>>) { x: Rc::new(RefCell::new(((*raw_ptr2.borrow()).read()))), y: Rc::new(RefCell::new(5)), }))))); - ({ - let _k: i32 = 10; - (*(*pair.borrow()).as_ref().unwrap().borrow()).inc(_k) - }); + ({ (*(*pair.borrow()).as_ref().unwrap().borrow()).inc(10) }); let __rhs = { let _lhs = { let _lhs = (*(*(*(*safe_ptr.upgrade().deref()).as_ref().unwrap().borrow()) @@ -176,10 +173,7 @@ pub fn RndStuff_2() { .borrow()) == 2) ); - ({ - let _k: i32 = 10; - (*x3.borrow()).as_ref().unwrap().borrow()[((*i.borrow()) as u64) as usize].inc(_k) - }); + ({ (*x3.borrow()).as_ref().unwrap().borrow()[((*i.borrow()) as u64) as usize].inc(10) }); assert!( ((*(*(*p3_0.borrow()) .offset((*i.borrow()) as isize) diff --git a/tests/unit/out/refcount/unique_ptr_const_deref.rs b/tests/unit/out/refcount/unique_ptr_const_deref.rs index 0d097128..d1598432 100644 --- a/tests/unit/out/refcount/unique_ptr_const_deref.rs +++ b/tests/unit/out/refcount/unique_ptr_const_deref.rs @@ -34,8 +34,7 @@ fn main_0() -> i32 { (*(*h.borrow()).val.borrow_mut()) = Some(Rc::new(RefCell::new(10))); ({ let _h: Ptr = (h.as_pointer()); - let _v: i32 = 42; - write_val_1(_h, _v) + write_val_1(_h, 42) }); return ({ let _h: Ptr = (h.as_pointer()); diff --git a/tests/unit/out/refcount/user_defined_same_as_libc.rs b/tests/unit/out/refcount/user_defined_same_as_libc.rs index 15156ebb..f52ec539 100644 --- a/tests/unit/out/refcount/user_defined_same_as_libc.rs +++ b/tests/unit/out/refcount/user_defined_same_as_libc.rs @@ -19,9 +19,10 @@ pub fn main() { fn main_0() -> i32 { let fp: Value> = Rc::new(RefCell::new( ({ - let _path: Ptr = Ptr::from_string_literal(b"/tmp/irrelevant-file"); - let _mode: Ptr = Ptr::from_string_literal(b"r"); - fopen_0(_path, _mode) + fopen_0( + Ptr::from_string_literal(b"/tmp/irrelevant-file"), + Ptr::from_string_literal(b"r"), + ) }), )); assert!(((((*fp.borrow()).is_null()) as i32) != 0)); diff --git a/tests/unit/out/refcount/va_arg_chain.rs b/tests/unit/out/refcount/va_arg_chain.rs index d902d358..0daf7f13 100644 --- a/tests/unit/out/refcount/va_arg_chain.rs +++ b/tests/unit/out/refcount/va_arg_chain.rs @@ -44,26 +44,13 @@ pub fn main() { fn main_0() -> i32 { assert!( (((({ - let _n: i32 = 2; - top_level_2( - _n, - &[(100).into(), (200).into(), (300).into(), (400).into()], - ) + top_level_2(2, &[(100).into(), (200).into(), (300).into(), (400).into()]) }) == 300) as i32) != 0) ); + assert!((((({ top_level_2(0, &[(42).into(), (99).into(),]) }) == 42) as i32) != 0)); assert!( - (((({ - let _n: i32 = 0; - top_level_2(_n, &[(42).into(), (99).into()]) - }) == 42) as i32) - != 0) - ); - assert!( - (((({ - let _n: i32 = 3; - top_level_2(_n, &[(1).into(), (2).into(), (3).into(), (4).into()]) - }) == 4) as i32) + (((({ top_level_2(3, &[(1).into(), (2).into(), (3).into(), (4).into(),]) }) == 4) as i32) != 0) ); return 0; diff --git a/tests/unit/out/refcount/va_arg_concat.rs b/tests/unit/out/refcount/va_arg_concat.rs index 9f594ccc..0e86d494 100644 --- a/tests/unit/out/refcount/va_arg_concat.rs +++ b/tests/unit/out/refcount/va_arg_concat.rs @@ -27,24 +27,14 @@ pub fn main() { } fn main_0() -> i32 { assert!( - (((({ - let _first: i32 = 1; - sum_ints_0(_first, &[(2).into(), (3).into(), (4).into(), (0).into()]) - }) == 10) as i32) - != 0) - ); - assert!( - (((({ - let _first: i32 = 100; - sum_ints_0(_first, &[(0).into()]) - }) == 100) as i32) + (((({ sum_ints_0(1, &[(2).into(), (3).into(), (4).into(), (0).into(),]) }) == 10) as i32) != 0) ); + assert!((((({ sum_ints_0(100, &[(0).into(),]) }) == 100) as i32) != 0)); assert!( (((({ - let _first: i32 = 5; sum_ints_0( - _first, + 5, &[(5).into(), (5).into(), (5).into(), (5).into(), (0).into()], ) }) == 25) as i32) diff --git a/tests/unit/out/refcount/va_arg_conditional.rs b/tests/unit/out/refcount/va_arg_conditional.rs index 3dd65378..a226eb39 100644 --- a/tests/unit/out/refcount/va_arg_conditional.rs +++ b/tests/unit/out/refcount/va_arg_conditional.rs @@ -22,19 +22,13 @@ pub fn main() { } fn main_0() -> i32 { assert!( - (((({ - let _verbose: i32 = 1; - let _fmt: Ptr = Ptr::from_string_literal(b"%d"); - conditional_log_0(_verbose, _fmt, &[(42).into()]) - }) == 42) as i32) + (((({ conditional_log_0(1, Ptr::from_string_literal(b"%d"), &[(42).into(),]) }) == 42) + as i32) != 0) ); assert!( - (((({ - let _verbose: i32 = 0; - let _fmt: Ptr = Ptr::from_string_literal(b"%d"); - conditional_log_0(_verbose, _fmt, &[(99).into()]) - }) == -1_i32) as i32) + (((({ conditional_log_0(0, Ptr::from_string_literal(b"%d"), &[(99).into(),]) }) == -1_i32) + as i32) != 0) ); return 0; diff --git a/tests/unit/out/refcount/va_arg_copy.rs b/tests/unit/out/refcount/va_arg_copy.rs index 13ddecd7..f34cac3a 100644 --- a/tests/unit/out/refcount/va_arg_copy.rs +++ b/tests/unit/out/refcount/va_arg_copy.rs @@ -32,10 +32,7 @@ pub fn main() { } fn main_0() -> i32 { assert!( - (((({ - let _count: i32 = 3; - sum_with_copy_0(_count, &[(10).into(), (20).into(), (30).into()]) - }) == 120) as i32) + (((({ sum_with_copy_0(3, &[(10).into(), (20).into(), (30).into(),]) }) == 120) as i32) != 0) ); return 0; diff --git a/tests/unit/out/refcount/va_arg_fn_ptr.rs b/tests/unit/out/refcount/va_arg_fn_ptr.rs index 2e448fd7..7d6115e5 100644 --- a/tests/unit/out/refcount/va_arg_fn_ptr.rs +++ b/tests/unit/out/refcount/va_arg_fn_ptr.rs @@ -56,25 +56,18 @@ pub fn main() { } fn main_0() -> i32 { assert!( - (((({ - let _x: i32 = 5; - apply_unary_3(_x, &[(FnPtr:: i32>::new(square_0)).into()]) - }) == 25) as i32) + (((({ apply_unary_3(5, &[(FnPtr:: i32>::new(square_0)).into(),]) }) == 25) + as i32) != 0) ); assert!( - (((({ - let _x: i32 = 7; - apply_unary_3(_x, &[(FnPtr:: i32>::new(negate_1)).into()]) - }) == -7_i32) as i32) + (((({ apply_unary_3(7, &[(FnPtr:: i32>::new(negate_1)).into(),]) }) == -7_i32) + as i32) != 0) ); assert!( - (((({ - let _a: i32 = 3; - let _b: i32 = 4; - apply_binary_4(_a, _b, &[(FnPtr:: i32>::new(add_2)).into()]) - }) == 7) as i32) + (((({ apply_binary_4(3, 4, &[(FnPtr:: i32>::new(add_2)).into(),]) }) == 7) + as i32) != 0) ); return 0; diff --git a/tests/unit/out/refcount/va_arg_forward.rs b/tests/unit/out/refcount/va_arg_forward.rs index 2a55116e..57d7d1e2 100644 --- a/tests/unit/out/refcount/va_arg_forward.rs +++ b/tests/unit/out/refcount/va_arg_forward.rs @@ -34,26 +34,8 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - assert!( - (((({ - let _count: i32 = 3; - outer_1(_count, &[(10).into(), (20).into(), (30).into()]) - }) == 60) as i32) - != 0) - ); - assert!( - (((({ - let _count: i32 = 1; - outer_1(_count, &[(42).into()]) - }) == 42) as i32) - != 0) - ); - assert!( - (((({ - let _count: i32 = 0; - outer_1(_count, &[]) - }) == 0) as i32) - != 0) - ); + assert!((((({ outer_1(3, &[(10).into(), (20).into(), (30).into(),]) }) == 60) as i32) != 0)); + assert!((((({ outer_1(1, &[(42).into(),]) }) == 42) as i32) != 0)); + assert!((((({ outer_1(0, &[]) }) == 0) as i32) != 0)); return 0; } diff --git a/tests/unit/out/refcount/va_arg_mixed_int_ptr.rs b/tests/unit/out/refcount/va_arg_mixed_int_ptr.rs index 07a4ef11..2731c07f 100644 --- a/tests/unit/out/refcount/va_arg_mixed_int_ptr.rs +++ b/tests/unit/out/refcount/va_arg_mixed_int_ptr.rs @@ -33,9 +33,8 @@ fn main_0() -> i32 { let x: Value = Rc::new(RefCell::new(100)); assert!( (((({ - let _count: i32 = 3; mixed_args_0( - _count, + 3, &[ (0).into(), (10).into(), @@ -49,18 +48,9 @@ fn main_0() -> i32 { != 0) ); let y: Value = Rc::new(RefCell::new(50)); + assert!((((({ mixed_args_0(1, &[(1).into(), (y.as_pointer()).into(),]) }) == 50) as i32) != 0)); assert!( - (((({ - let _count: i32 = 1; - mixed_args_0(_count, &[(1).into(), (y.as_pointer()).into()]) - }) == 50) as i32) - != 0) - ); - assert!( - (((({ - let _count: i32 = 2; - mixed_args_0(_count, &[(0).into(), (5).into(), (0).into(), (3).into()]) - }) == 8) as i32) + (((({ mixed_args_0(2, &[(0).into(), (5).into(), (0).into(), (3).into(),]) }) == 8) as i32) != 0) ); return 0; diff --git a/tests/unit/out/refcount/va_arg_mixed_types.rs b/tests/unit/out/refcount/va_arg_mixed_types.rs index c8b86c32..023a0f91 100644 --- a/tests/unit/out/refcount/va_arg_mixed_types.rs +++ b/tests/unit/out/refcount/va_arg_mixed_types.rs @@ -32,9 +32,8 @@ pub fn main() { fn main_0() -> i32 { assert!( (((({ - let _count: i32 = 3; sum_mixed_0( - _count, + 3, &[ (0).into(), (10).into(), @@ -47,18 +46,11 @@ fn main_0() -> i32 { }) == 60) as i32) != 0) ); + assert!((((({ sum_mixed_0(1, &[(0).into(), (42).into(),]) }) == 42) as i32) != 0)); assert!( (((({ - let _count: i32 = 1; - sum_mixed_0(_count, &[(0).into(), (42).into()]) - }) == 42) as i32) - != 0) - ); - assert!( - (((({ - let _count: i32 = 2; sum_mixed_0( - _count, + 2, &[(1).into(), (3.7E+0).into(), (2).into(), (100_i64).into()], ) }) == 103) as i32) diff --git a/tests/unit/out/refcount/va_arg_null_int_ptr.rs b/tests/unit/out/refcount/va_arg_null_int_ptr.rs index bcf3abb4..d8e665c7 100644 --- a/tests/unit/out/refcount/va_arg_null_int_ptr.rs +++ b/tests/unit/out/refcount/va_arg_null_int_ptr.rs @@ -30,20 +30,14 @@ pub fn main() { fn main_0() -> i32 { let x: Value = Rc::new(RefCell::new(42)); assert!( - (((({ - let _count: i32 = 2; - first_nonnull_0( - _count, - &[(AnyPtr::default()).into(), (x.as_pointer()).into()], - ) - }) == 42) as i32) + (((({ first_nonnull_0(2, &[(AnyPtr::default()).into(), (x.as_pointer()).into(),]) }) == 42) + as i32) != 0) ); assert!( (((({ - let _count: i32 = 3; first_nonnull_0( - _count, + 3, &[ (AnyPtr::default()).into(), (AnyPtr::default()).into(), @@ -53,12 +47,6 @@ fn main_0() -> i32 { }) == 42) as i32) != 0) ); - assert!( - (((({ - let _count: i32 = 1; - first_nonnull_0(_count, &[(AnyPtr::default()).into()]) - }) == -1_i32) as i32) - != 0) - ); + assert!((((({ first_nonnull_0(1, &[(AnyPtr::default()).into(),]) }) == -1_i32) as i32) != 0)); return 0; } diff --git a/tests/unit/out/refcount/va_arg_printf.rs b/tests/unit/out/refcount/va_arg_printf.rs index 0c1850e3..5208ba52 100644 --- a/tests/unit/out/refcount/va_arg_printf.rs +++ b/tests/unit/out/refcount/va_arg_printf.rs @@ -35,9 +35,8 @@ fn main_0() -> i32 { let dummy: Value> = Rc::new(RefCell::new(Ptr::from_string_literal(b"dummy"))); assert!( (((({ - let _fmt: Ptr = Ptr::from_string_literal(b"hello %d %d"); logf_1( - _fmt, + Ptr::from_string_literal(b"hello %d %d"), &[ (10).into(), ((*dummy.borrow()).to_string_iterator().count() as u64).into(), @@ -48,8 +47,10 @@ fn main_0() -> i32 { ); assert!( (((({ - let _fmt: Ptr = Ptr::from_string_literal(b"x %d %d"); - logf_1(_fmt, &[(1).into(), (2).into()]) + logf_1( + Ptr::from_string_literal(b"x %d %d"), + &[(1).into(), (2).into()], + ) }) == 3) as i32) != 0) ); diff --git a/tests/unit/out/refcount/va_arg_promotion.rs b/tests/unit/out/refcount/va_arg_promotion.rs index 03a8e5be..e6946aec 100644 --- a/tests/unit/out/refcount/va_arg_promotion.rs +++ b/tests/unit/out/refcount/va_arg_promotion.rs @@ -27,9 +27,8 @@ fn main_0() -> i32 { let z: Value = Rc::new(RefCell::new(3.0E+0)); assert!( (((({ - let _count: i32 = 3; test_promotions_0( - _count, + 3, &[ ((*x.borrow()) as i32).into(), ((*y.borrow()) as i32).into(), diff --git a/tests/unit/out/refcount/va_arg_snprintf.rs b/tests/unit/out/refcount/va_arg_snprintf.rs index e18d2d72..e7a6b247 100644 --- a/tests/unit/out/refcount/va_arg_snprintf.rs +++ b/tests/unit/out/refcount/va_arg_snprintf.rs @@ -27,9 +27,7 @@ fn main_0() -> i32 { assert!( (((({ let _buf: Ptr = (buf.as_pointer() as Ptr); - let _size: i32 = 1; - let _fmt: Ptr = Ptr::from_string_literal(b"%d"); - extract_first_0(_buf, _size, _fmt, &[(42).into()]) + extract_first_0(_buf, 1, Ptr::from_string_literal(b"%d"), &[(42).into()]) }) == 42) as i32) != 0) ); @@ -37,9 +35,7 @@ fn main_0() -> i32 { assert!( (((({ let _buf: Ptr = (buf.as_pointer() as Ptr); - let _size: i32 = 1; - let _fmt: Ptr = Ptr::from_string_literal(b"%d"); - extract_first_0(_buf, _size, _fmt, &[(65).into()]) + extract_first_0(_buf, 1, Ptr::from_string_literal(b"%d"), &[(65).into()]) }) == 65) as i32) != 0) ); diff --git a/tests/unit/out/refcount/va_arg_struct_ctx.rs b/tests/unit/out/refcount/va_arg_struct_ctx.rs index e6e9ad73..bc607d65 100644 --- a/tests/unit/out/refcount/va_arg_struct_ctx.rs +++ b/tests/unit/out/refcount/va_arg_struct_ctx.rs @@ -42,15 +42,13 @@ fn main_0() -> i32 { (*(*ctx.borrow()).last_error.borrow_mut()) = 0; ({ let _ctx: Ptr = (ctx.as_pointer()); - let _fmt: Ptr = Ptr::from_string_literal(b"error %d"); - set_error_0(_ctx, _fmt, &[(42).into()]) + set_error_0(_ctx, Ptr::from_string_literal(b"error %d"), &[(42).into()]) }); assert!(((((*(*ctx.borrow()).last_error.borrow()) == 42) as i32) != 0)); (*(*ctx.borrow()).verbose.borrow_mut()) = 0; ({ let _ctx: Ptr = (ctx.as_pointer()); - let _fmt: Ptr = Ptr::from_string_literal(b"error %d"); - set_error_0(_ctx, _fmt, &[(99).into()]) + set_error_0(_ctx, Ptr::from_string_literal(b"error %d"), &[(99).into()]) }); assert!(((((*(*ctx.borrow()).last_error.borrow()) == 42) as i32) != 0)); return 0; diff --git a/tests/unit/out/refcount/va_arg_two_passes.rs b/tests/unit/out/refcount/va_arg_two_passes.rs index 7ba541ad..95e1bd89 100644 --- a/tests/unit/out/refcount/va_arg_two_passes.rs +++ b/tests/unit/out/refcount/va_arg_two_passes.rs @@ -37,11 +37,7 @@ pub fn main() { } fn main_0() -> i32 { assert!( - (((({ - let _first: i32 = 2; - sum_then_product_0(_first, &[(3).into(), (4).into(), (0).into()]) - }) == 33) as i32) - != 0) + (((({ sum_then_product_0(2, &[(3).into(), (4).into(), (0).into(),]) }) == 33) as i32) != 0) ); return 0; } diff --git a/tests/unit/out/refcount/void_cast.rs b/tests/unit/out/refcount/void_cast.rs index c5c77b62..4a070cbc 100644 --- a/tests/unit/out/refcount/void_cast.rs +++ b/tests/unit/out/refcount/void_cast.rs @@ -63,10 +63,7 @@ pub fn main() { std::process::exit(main_0()); } fn main_0() -> i32 { - ({ - let _x: i32 = 42; - unused_param_0(_x) - }); + ({ unused_param_0(42) }); let y: Value = Rc::new(RefCell::new(5)); (*y.borrow_mut()); let z: Value = Rc::new(RefCell::new({ diff --git a/tests/unit/out/unsafe/alloc_array.rs b/tests/unit/out/unsafe/alloc_array.rs index 7a8dcf5b..d7f8aaf3 100644 --- a/tests/unit/out/unsafe/alloc_array.rs +++ b/tests/unit/out/unsafe/alloc_array.rs @@ -42,8 +42,7 @@ unsafe fn main_0() -> i32 { (unsafe { let _arr: *mut Option> = &mut arr as *mut Option>; let _N: i32 = N; - let _element: i32 = 1; - All_0(_arr, _N, _element) + All_0(_arr, _N, 1) }); return (unsafe { let _arr: Option> = arr; diff --git a/tests/unit/out/unsafe/bool_condition_logical.rs b/tests/unit/out/unsafe/bool_condition_logical.rs index dd1dc5de..d48fc729 100644 --- a/tests/unit/out/unsafe/bool_condition_logical.rs +++ b/tests/unit/out/unsafe/bool_condition_logical.rs @@ -64,21 +64,11 @@ unsafe fn main_0() -> i32 { assert!(true); } side_effect_0 = 0; - if (zero != 0) - && ((unsafe { - let _v: i32 = 1; - observe_1(_v) - }) != 0) - { + if (zero != 0) && ((unsafe { observe_1(1) }) != 0) { assert!(false); } assert!(((side_effect_0) == (0))); - if (n != 0) - || ((unsafe { - let _v: i32 = 1; - observe_1(_v) - }) != 0) - { + if (n != 0) || ((unsafe { observe_1(1) }) != 0) { assert!(true); } assert!(((side_effect_0) == (0))); diff --git a/tests/unit/out/unsafe/bool_condition_logical_c.rs b/tests/unit/out/unsafe/bool_condition_logical_c.rs index 05279a31..ef45ccdb 100644 --- a/tests/unit/out/unsafe/bool_condition_logical_c.rs +++ b/tests/unit/out/unsafe/bool_condition_logical_c.rs @@ -67,23 +67,11 @@ unsafe fn main_0() -> i32 { assert!((1 != 0)); } side_effect_0 = 0; - if ((((zero != 0) - && ((unsafe { - let _v: i32 = 1; - observe_1(_v) - }) != 0)) as i32) - != 0) - { + if ((((zero != 0) && ((unsafe { observe_1(1) }) != 0)) as i32) != 0) { assert!((0 != 0)); } assert!(((((side_effect_0) == (0)) as i32) != 0)); - if ((((n != 0) - || ((unsafe { - let _v: i32 = 1; - observe_1(_v) - }) != 0)) as i32) - != 0) - { + if ((((n != 0) || ((unsafe { observe_1(1) }) != 0)) as i32) != 0) { assert!((1 != 0)); } assert!(((((side_effect_0) == (0)) as i32) != 0)); diff --git a/tests/unit/out/unsafe/break.rs b/tests/unit/out/unsafe/break.rs index 68f33e7f..9d2cdf4e 100644 --- a/tests/unit/out/unsafe/break.rs +++ b/tests/unit/out/unsafe/break.rs @@ -35,8 +35,5 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - return (unsafe { - let _n: i32 = 200; - for_test_0(_n) - }); + return (unsafe { for_test_0(200) }); } diff --git a/tests/unit/out/unsafe/bst.rs b/tests/unit/out/unsafe/bst.rs index edd27c2e..263fe9e1 100644 --- a/tests/unit/out/unsafe/bst.rs +++ b/tests/unit/out/unsafe/bst.rs @@ -104,43 +104,37 @@ unsafe fn main_0() -> i32 { }); return (((((((((*(unsafe { let _node: *mut node_t = ptr1; - let _value: i32 = 0; - find_0(_node, _value) + find_0(_node, 0) })) .value) == (0)) && (((*(unsafe { let _node: *mut node_t = ptr1; - let _value: i32 = 1; - find_0(_node, _value) + find_0(_node, 1) })) .value) == (1))) && (((*(unsafe { let _node: *mut node_t = ptr1; - let _value: i32 = 2; - find_0(_node, _value) + find_0(_node, 2) })) .value) == (2))) && (((*(unsafe { let _node: *mut node_t = ptr1; - let _value: i32 = 3; - find_0(_node, _value) + find_0(_node, 3) })) .value) == (3))) && (((*(unsafe { let _node: *mut node_t = ptr1; - let _value: i32 = 4; - find_0(_node, _value) + find_0(_node, 4) })) .value) == (4))) && ((unsafe { let _node: *mut node_t = ptr1; - let _value: i32 = 5; - find_0(_node, _value) + find_0(_node, 5) }) .is_null())) as i32); } diff --git a/tests/unit/out/unsafe/class.rs b/tests/unit/out/unsafe/class.rs index 2e098d4f..c9a8d8ae 100644 --- a/tests/unit/out/unsafe/class.rs +++ b/tests/unit/out/unsafe/class.rs @@ -59,10 +59,7 @@ impl Route { pub unsafe fn RandomRoute_0(route: *mut Route) -> i32 { if ((((*route).path.first) % (2)) != 0) { return (unsafe { - let _new_first: i32 = (unsafe { - let _new_second: i32 = 10; - (*route).path.SetSecond(_new_second) - }); + let _new_first: i32 = (unsafe { (*route).path.SetSecond(10) }); (*route).path.SetFirst(_new_first) }); } else { @@ -97,10 +94,7 @@ unsafe fn main_0() -> i32 { cost: 10_f64, }; let mut old_cost: f64 = (unsafe { - let _new_cost: f64 = (unsafe { - let _new_cost: f64 = 15_f64; - route2.SetCost(_new_cost) - }); + let _new_cost: f64 = (unsafe { route2.SetCost(15_f64) }); route1.SetCost(_new_cost) }); return (((((unsafe { diff --git a/tests/unit/out/unsafe/doubly_linked_list.rs b/tests/unit/out/unsafe/doubly_linked_list.rs index a6ef48c2..b933c523 100644 --- a/tests/unit/out/unsafe/doubly_linked_list.rs +++ b/tests/unit/out/unsafe/doubly_linked_list.rs @@ -166,13 +166,11 @@ unsafe fn main_0() -> i32 { }); head = (unsafe { let _head: *mut Node = head; - let _val: i32 = 5; - Delete_3(_head, _val) + Delete_3(_head, 5) }); head = (unsafe { let _head: *mut Node = head; - let _val: i32 = 0; - Delete_3(_head, _val) + Delete_3(_head, 0) }); head = (unsafe { let _head: *mut Node = head; @@ -186,8 +184,7 @@ unsafe fn main_0() -> i32 { assert!( (((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 0; - Find_0(_head, _idx) + Find_0(_head, 0) })) .val) == (4)) @@ -195,8 +192,7 @@ unsafe fn main_0() -> i32 { assert!( (((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 1; - Find_0(_head, _idx) + Find_0(_head, 1) })) .val) == (3)) @@ -204,8 +200,7 @@ unsafe fn main_0() -> i32 { assert!( (((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 2; - Find_0(_head, _idx) + Find_0(_head, 2) })) .val) == (2)) @@ -213,8 +208,7 @@ unsafe fn main_0() -> i32 { assert!( (((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 3; - Find_0(_head, _idx) + Find_0(_head, 3) })) .val) == (1)) @@ -222,23 +216,20 @@ unsafe fn main_0() -> i32 { assert!( (((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 4; - Find_0(_head, _idx) + Find_0(_head, 4) })) .val) == (-1_i32)) ); assert!((unsafe { let _head: *mut Node = head; - let _idx: i32 = 5; - Find_0(_head, _idx) + Find_0(_head, 5) }) .is_null()); assert!( (((*(unsafe { let _tail: *mut Node = tail; - let _idx: i32 = 0; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 0) })) .val) == (-1_i32)) @@ -246,8 +237,7 @@ unsafe fn main_0() -> i32 { assert!( (((*(unsafe { let _tail: *mut Node = tail; - let _idx: i32 = 1; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 1) })) .val) == (1)) @@ -255,8 +245,7 @@ unsafe fn main_0() -> i32 { assert!( (((*(unsafe { let _tail: *mut Node = tail; - let _idx: i32 = 2; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 2) })) .val) == (2)) @@ -264,8 +253,7 @@ unsafe fn main_0() -> i32 { assert!( (((*(unsafe { let _tail: *mut Node = tail; - let _idx: i32 = 3; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 3) })) .val) == (3)) @@ -273,24 +261,21 @@ unsafe fn main_0() -> i32 { assert!( (((*(unsafe { let _tail: *mut Node = tail; - let _idx: i32 = 4; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 4) })) .val) == (4)) ); assert!(((*(unsafe { let _tail: *mut Node = tail; - let _idx: i32 = 4; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 4) })) .prev) .is_null()); assert!( (((*(*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 0; - Find_0(_head, _idx) + Find_0(_head, 0) })) .next) .val) @@ -299,8 +284,7 @@ unsafe fn main_0() -> i32 { assert!( (((*(*(*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 1; - Find_0(_head, _idx) + Find_0(_head, 1) })) .next) .next) @@ -310,8 +294,7 @@ unsafe fn main_0() -> i32 { assert!( (((*(*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 2; - Find_0(_head, _idx) + Find_0(_head, 2) })) .prev) .val) @@ -319,16 +302,14 @@ unsafe fn main_0() -> i32 { ); assert!(((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 4; - Find_0(_head, _idx) + Find_0(_head, 4) })) .next) .is_null()); assert!( (((*(*(*(unsafe { let _tail: *mut Node = tail; - let _idx: i32 = 1; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 1) })) .prev) .prev) @@ -337,89 +318,76 @@ unsafe fn main_0() -> i32 { ); (*(*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 0; - Find_0(_head, _idx) + Find_0(_head, 0) })) .next) .val = 30; assert!( (((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 1; - Find_0(_head, _idx) + Find_0(_head, 1) })) .val) == (30)) ); (*(*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 1; - Find_0(_head, _idx) + Find_0(_head, 1) })) .next) .val = (((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 0; - Find_0(_head, _idx) + Find_0(_head, 0) })) .val) + ((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 3; - Find_0(_head, _idx) + Find_0(_head, 3) })) .val)); assert!( (((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 2; - Find_0(_head, _idx) + Find_0(_head, 2) })) .val) == ((4) + (1))) ); let mut sum: i32 = ((((((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 0; - Find_0(_head, _idx) + Find_0(_head, 0) })) .val) + ((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 1; - Find_0(_head, _idx) + Find_0(_head, 1) })) .val)) + ((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 2; - Find_0(_head, _idx) + Find_0(_head, 2) })) .val)) + ((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 3; - Find_0(_head, _idx) + Find_0(_head, 3) })) .val)) + ((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 4; - Find_0(_head, _idx) + Find_0(_head, 4) })) .val)); assert!(((sum) == (((((4) + (30)) + (5)) + (1)) + (-1_i32)))); assert!( ((((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 0; - Find_0(_head, _idx) + Find_0(_head, 0) })) .val) + ((*(unsafe { let _tail: *mut Node = tail; - let _idx: i32 = 0; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 0) })) .val)) == ((4) + (-1_i32))) @@ -427,29 +395,25 @@ unsafe fn main_0() -> i32 { assert!( (((*(*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 2; - Find_0(_head, _idx) + Find_0(_head, 2) })) .next) .val) == ((*(unsafe { let _tail: *mut Node = tail; - let _idx: i32 = 1; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 1) })) .val)) ); assert!( (((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 0; - Find_0(_head, _idx) + Find_0(_head, 0) })) .prev) == ((*(unsafe { let _tail: *mut Node = tail; - let _idx: i32 = 4; - FindBack_1(_tail, _idx) + FindBack_1(_tail, 4) })) .prev)) ); diff --git a/tests/unit/out/unsafe/dowhile.rs b/tests/unit/out/unsafe/dowhile.rs index 42197a4b..2c591f09 100644 --- a/tests/unit/out/unsafe/dowhile.rs +++ b/tests/unit/out/unsafe/dowhile.rs @@ -27,8 +27,5 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - return (unsafe { - let _x: i32 = 0; - dowhile_0(_x) - }); + return (unsafe { dowhile_0(0) }); } diff --git a/tests/unit/out/unsafe/enum_int_interop.rs b/tests/unit/out/unsafe/enum_int_interop.rs index c89f0afd..dea3c759 100644 --- a/tests/unit/out/unsafe/enum_int_interop.rs +++ b/tests/unit/out/unsafe/enum_int_interop.rs @@ -157,10 +157,7 @@ unsafe fn main_0() -> i32 { c = Color::from(2); assert!(((c as i32) == (Color::BLUE as i32))); assert!(((c as i32) == (2))); - c = (unsafe { - let _n: i32 = 1; - make_color_6(_n) - }); + c = (unsafe { make_color_6(1) }); assert!(((c as i32) == (Color::GREEN as i32))); let mut cmp: Color = Color::from(((c as i32) + (1))); assert!(((cmp as i32) == (Color::BLUE as i32))); @@ -176,10 +173,7 @@ unsafe fn main_0() -> i32 { classify_option_5(_option) }); assert!(((rc) == (2))); - rc = (unsafe { - let _option: i32 = 20; - classify_option_5(_option) - }); + rc = (unsafe { classify_option_5(20) }); assert!(((rc) == (2))); rc = (unsafe { let _option: i32 = (Option::OPT_C as i32); diff --git a/tests/unit/out/unsafe/enum_int_interop_c.rs b/tests/unit/out/unsafe/enum_int_interop_c.rs index f4e9feeb..0ffb916e 100644 --- a/tests/unit/out/unsafe/enum_int_interop_c.rs +++ b/tests/unit/out/unsafe/enum_int_interop_c.rs @@ -157,10 +157,7 @@ unsafe fn main_0() -> i32 { c = Color::from(2); assert!(((((c as u32) == ((Color::BLUE as i32) as u32)) as i32) != 0)); assert!(((((c as u32) == (2_u32)) as i32) != 0)); - c = (unsafe { - let _n: i32 = 1; - make_color_6(_n) - }); + c = (unsafe { make_color_6(1) }); assert!(((((c as u32) == ((Color::GREEN as i32) as u32)) as i32) != 0)); let mut cmp: Color = Color::from(((c as u32).wrapping_add(1_u32)) as i32); assert!(((((cmp as u32) == ((Color::BLUE as i32) as u32)) as i32) != 0)); @@ -176,10 +173,7 @@ unsafe fn main_0() -> i32 { classify_option_5(_option) }); assert!(((((rc) == (2)) as i32) != 0)); - rc = (unsafe { - let _option: i32 = 20; - classify_option_5(_option) - }); + rc = (unsafe { classify_option_5(20) }); assert!(((((rc) == (2)) as i32) != 0)); rc = (unsafe { let _option: i32 = (Option::OPT_C as i32); diff --git a/tests/unit/out/unsafe/expr_as_bool_c.rs b/tests/unit/out/unsafe/expr_as_bool_c.rs index 6e1caefb..cf3fd951 100644 --- a/tests/unit/out/unsafe/expr_as_bool_c.rs +++ b/tests/unit/out/unsafe/expr_as_bool_c.rs @@ -79,13 +79,7 @@ unsafe fn main_0() -> i32 { }) == (1)) as i32) != 0) ); - assert!( - ((((unsafe { - let _rc: i32 = 0; - cmp_eq_0(_rc) - }) == (0)) as i32) - != 0) - ); + assert!(((((unsafe { cmp_eq_0(0,) }) == (0)) as i32) != 0)); assert!( ((((unsafe { let _p: *const u8 = p1; diff --git a/tests/unit/out/unsafe/expr_as_bool_cpp.rs b/tests/unit/out/unsafe/expr_as_bool_cpp.rs index 0aadb19b..d4d71225 100644 --- a/tests/unit/out/unsafe/expr_as_bool_cpp.rs +++ b/tests/unit/out/unsafe/expr_as_bool_cpp.rs @@ -75,12 +75,7 @@ unsafe fn main_0() -> i32 { cmp_eq_0(_rc) }) == (1)) ); - assert!( - ((unsafe { - let _rc: i32 = 0; - cmp_eq_0(_rc) - }) == (0)) - ); + assert!(((unsafe { cmp_eq_0(0,) }) == (0))); assert!( ((unsafe { let _p: *const u8 = p1; diff --git a/tests/unit/out/unsafe/fcall.rs b/tests/unit/out/unsafe/fcall.rs index c02bdb0f..9a0a4809 100644 --- a/tests/unit/out/unsafe/fcall.rs +++ b/tests/unit/out/unsafe/fcall.rs @@ -65,9 +65,5 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - return ((unsafe { - let _x: f64 = 1.0E+0; - let _y: f64 = 2.0E+0; - f1_2(_x, _y) - }) as i32); + return ((unsafe { f1_2(1.0E+0, 2.0E+0) }) as i32); } diff --git a/tests/unit/out/unsafe/fn_ptr_array.rs b/tests/unit/out/unsafe/fn_ptr_array.rs index 2096bddb..c41968b9 100644 --- a/tests/unit/out/unsafe/fn_ptr_array.rs +++ b/tests/unit/out/unsafe/fn_ptr_array.rs @@ -22,27 +22,9 @@ pub fn main() { } unsafe fn main_0() -> i32 { let mut ops: [Option i32>; 3] = [Some(add_0), Some(sub_1), Some(mul_2)]; - assert!( - ((unsafe { - let _arg0: i32 = 2; - let _arg1: i32 = 3; - (ops[(0) as usize]).unwrap()(_arg0, _arg1) - }) == (5)) - ); - assert!( - ((unsafe { - let _arg0: i32 = 7; - let _arg1: i32 = 4; - (ops[(1) as usize]).unwrap()(_arg0, _arg1) - }) == (3)) - ); - assert!( - ((unsafe { - let _arg0: i32 = 6; - let _arg1: i32 = 5; - (ops[(2) as usize]).unwrap()(_arg0, _arg1) - }) == (30)) - ); + assert!(((unsafe { (ops[(0) as usize]).unwrap()(2, 3,) }) == (5))); + assert!(((unsafe { (ops[(1) as usize]).unwrap()(7, 4,) }) == (3))); + assert!(((unsafe { (ops[(2) as usize]).unwrap()(6, 5,) }) == (30))); assert!(!((ops[(0) as usize]).is_none())); assert!(((ops[(0) as usize]) == (Some(add_0)))); assert!(((ops[(0) as usize]) != (Some(sub_1)))); diff --git a/tests/unit/out/unsafe/fn_ptr_cast.rs b/tests/unit/out/unsafe/fn_ptr_cast.rs index 9951cc7b..12dc7625 100644 --- a/tests/unit/out/unsafe/fn_ptr_cast.rs +++ b/tests/unit/out/unsafe/fn_ptr_cast.rs @@ -11,23 +11,13 @@ pub unsafe fn double_it_0(mut x: i32) -> i32 { } pub unsafe fn test_roundtrip_1() { let mut fn_: Option i32> = Some(double_it_0); - assert!( - ((unsafe { - let _arg0: i32 = 5; - (fn_).unwrap()(_arg0) - }) == (10)) - ); + assert!(((unsafe { (fn_).unwrap()(5,) }) == (10))); let mut gfn: Option = std::mem::transmute:: i32>, Option>(fn_); assert!(!((gfn).is_none())); let mut fn2: Option i32> = std::mem::transmute::, Option i32>>(gfn); - assert!( - ((unsafe { - let _arg0: i32 = 5; - (fn2).unwrap()(_arg0) - }) == (10)) - ); + assert!(((unsafe { (fn2).unwrap()(5,) }) == (10))); assert!(((fn2) == (fn_))); } pub unsafe fn test_double_cast_2() { @@ -36,12 +26,7 @@ pub unsafe fn test_double_cast_2() { std::mem::transmute::, Option i32>>( std::mem::transmute:: i32>, Option>(fn_), ); - assert!( - ((unsafe { - let _arg0: i32 = 5; - (fn2).unwrap()(_arg0) - }) == (10)) - ); + assert!(((unsafe { (fn2).unwrap()(5,) }) == (10))); assert!(((fn2) == (fn_))); } #[repr(C)] @@ -56,12 +41,7 @@ pub unsafe fn test_void_ptr_to_fn_3() { )); let mut fn_: Option i32> = std::mem::transmute::<*mut ::libc::c_void, Option i32>>(cmd.data); - assert!( - ((unsafe { - let _arg0: i32 = 5; - (fn_).unwrap()(_arg0) - }) == (10)) - ); + assert!(((unsafe { (fn_).unwrap()(5,) }) == (10))); } pub unsafe fn add_offset_4(mut base: *mut i32, mut offset: i32) -> i32 { return ((*base) + (offset)); @@ -75,8 +55,7 @@ pub unsafe fn test_call_through_cast_5() { let mut result: i32 = (unsafe { let _arg0: *mut ::libc::c_void = ((&mut val as *mut i32) as *mut i32 as *mut ::libc::c_void); - let _arg1: i32 = 42; - (gfn).unwrap()(_arg0, _arg1) + (gfn).unwrap()(_arg0, 42) }); assert!(((result) == (142))); } diff --git a/tests/unit/out/unsafe/fn_ptr_conditional.rs b/tests/unit/out/unsafe/fn_ptr_conditional.rs index ae09f250..87e3c4a4 100644 --- a/tests/unit/out/unsafe/fn_ptr_conditional.rs +++ b/tests/unit/out/unsafe/fn_ptr_conditional.rs @@ -43,48 +43,27 @@ pub fn main() { } } unsafe fn main_0() -> i32 { + assert!(((unsafe { (unsafe { pick_3(1,) }).unwrap()(10,) }) == (11))); assert!( ((unsafe { - let _arg0: i32 = 10; - (unsafe { - let _mode: i32 = 1; - pick_3(_mode) - }) - .unwrap()(_arg0) - }) == (11)) - ); - assert!( - ((unsafe { - let _arg0: i32 = 10; (unsafe { let _mode: i32 = -1_i32; pick_3(_mode) }) - .unwrap()(_arg0) + .unwrap()(10) }) == (9)) ); - assert!( - ((unsafe { - let _arg0: i32 = 10; - (unsafe { - let _mode: i32 = 0; - pick_3(_mode) - }) - .unwrap()(_arg0) - }) == (10)) - ); + assert!(((unsafe { (unsafe { pick_3(0,) }).unwrap()(10,) }) == (10))); assert!( ((unsafe { let _fn: Option i32> = Some(inc_0); - let _x: i32 = 5; - apply_4(_fn, _x) + apply_4(_fn, 5) }) == (6)) ); assert!( ((unsafe { let _fn: Option i32> = None; - let _x: i32 = 5; - apply_4(_fn, _x) + apply_4(_fn, 5) }) == (5)) ); return 0; diff --git a/tests/unit/out/unsafe/fn_ptr_default_arg.rs b/tests/unit/out/unsafe/fn_ptr_default_arg.rs index bffd1504..b05d6466 100644 --- a/tests/unit/out/unsafe/fn_ptr_default_arg.rs +++ b/tests/unit/out/unsafe/fn_ptr_default_arg.rs @@ -27,23 +27,20 @@ pub fn main() { unsafe fn main_0() -> i32 { assert!( ((unsafe { - let _x: i32 = 5; let _fn: Option i32> = Default::default(); - apply_1(_x, Some(_fn)) + apply_1(5, Some(_fn)) }) == (5)) ); assert!( ((unsafe { - let _x: i32 = 5; let _fn: Option i32> = None; - apply_1(_x, Some(_fn)) + apply_1(5, Some(_fn)) }) == (5)) ); assert!( ((unsafe { - let _x: i32 = 5; let _fn: Option i32> = Some(identity_0); - apply_1(_x, Some(_fn)) + apply_1(5, Some(_fn)) }) == (5)) ); let mut negate: Option i32> = Some(|x: i32| { @@ -51,9 +48,8 @@ unsafe fn main_0() -> i32 { }); assert!( ((unsafe { - let _x: i32 = 5; let _fn: Option i32> = negate; - apply_1(_x, Some(_fn)) + apply_1(5, Some(_fn)) }) == (-5_i32)) ); return 0; diff --git a/tests/unit/out/unsafe/fn_ptr_global.rs b/tests/unit/out/unsafe/fn_ptr_global.rs index 9e77d34a..e3b897b4 100644 --- a/tests/unit/out/unsafe/fn_ptr_global.rs +++ b/tests/unit/out/unsafe/fn_ptr_global.rs @@ -31,45 +31,25 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 5; - call_op_4(_x) - }) == (5)) - ); + assert!(((unsafe { call_op_4(5,) }) == (5))); (unsafe { let _fn: Option i32> = Some(double_it_0); set_op_3(_fn) }); assert!(!((g_op_2).is_none())); assert!(((g_op_2) == (Some(double_it_0)))); - assert!( - ((unsafe { - let _x: i32 = 5; - call_op_4(_x) - }) == (10)) - ); + assert!(((unsafe { call_op_4(5,) }) == (10))); (unsafe { let _fn: Option i32> = Some(triple_it_1); set_op_3(_fn) }); assert!(((g_op_2) == (Some(triple_it_1)))); - assert!( - ((unsafe { - let _x: i32 = 5; - call_op_4(_x) - }) == (15)) - ); + assert!(((unsafe { call_op_4(5,) }) == (15))); (unsafe { let _fn: Option i32> = None; set_op_3(_fn) }); assert!((g_op_2).is_none()); - assert!( - ((unsafe { - let _x: i32 = 5; - call_op_4(_x) - }) == (5)) - ); + assert!(((unsafe { call_op_4(5,) }) == (5))); return 0; } diff --git a/tests/unit/out/unsafe/fn_ptr_reassign.rs b/tests/unit/out/unsafe/fn_ptr_reassign.rs index 34dac006..4c8b0e3f 100644 --- a/tests/unit/out/unsafe/fn_ptr_reassign.rs +++ b/tests/unit/out/unsafe/fn_ptr_reassign.rs @@ -22,39 +22,15 @@ pub fn main() { } unsafe fn main_0() -> i32 { let mut fn_: Option i32> = Some(add_0); - assert!( - ((unsafe { - let _arg0: i32 = 3; - let _arg1: i32 = 4; - (fn_).unwrap()(_arg0, _arg1) - }) == (7)) - ); + assert!(((unsafe { (fn_).unwrap()(3, 4,) }) == (7))); fn_ = Some(sub_1); - assert!( - ((unsafe { - let _arg0: i32 = 10; - let _arg1: i32 = 3; - (fn_).unwrap()(_arg0, _arg1) - }) == (7)) - ); + assert!(((unsafe { (fn_).unwrap()(10, 3,) }) == (7))); fn_ = Some(mul_2); - assert!( - ((unsafe { - let _arg0: i32 = 6; - let _arg1: i32 = 7; - (fn_).unwrap()(_arg0, _arg1) - }) == (42)) - ); + assert!(((unsafe { (fn_).unwrap()(6, 7,) }) == (42))); fn_ = None; assert!((fn_).is_none()); fn_ = Some(add_0); assert!(!((fn_).is_none())); - assert!( - ((unsafe { - let _arg0: i32 = 1; - let _arg1: i32 = 1; - (fn_).unwrap()(_arg0, _arg1) - }) == (2)) - ); + assert!(((unsafe { (fn_).unwrap()(1, 1,) }) == (2))); return 0; } diff --git a/tests/unit/out/unsafe/fn_ptr_return.rs b/tests/unit/out/unsafe/fn_ptr_return.rs index 8f9673be..5f3b8ec7 100644 --- a/tests/unit/out/unsafe/fn_ptr_return.rs +++ b/tests/unit/out/unsafe/fn_ptr_return.rs @@ -24,29 +24,13 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - let mut f: Option i32> = (unsafe { - let _choose_inc: i32 = 1; - pick_2(_choose_inc) - }); + let mut f: Option i32> = (unsafe { pick_2(1) }); assert!(!((f).is_none())); assert!(((f) == (Some(inc_0)))); - assert!( - ((unsafe { - let _arg0: i32 = 10; - (f).unwrap()(_arg0) - }) == (11)) - ); - let mut g: Option i32> = (unsafe { - let _choose_inc: i32 = 0; - pick_2(_choose_inc) - }); + assert!(((unsafe { (f).unwrap()(10,) }) == (11))); + let mut g: Option i32> = (unsafe { pick_2(0) }); assert!(((g) == (Some(dec_1)))); - assert!( - ((unsafe { - let _arg0: i32 = 10; - (g).unwrap()(_arg0) - }) == (9)) - ); + assert!(((unsafe { (g).unwrap()(10,) }) == (9))); assert!(((f) != (g))); return 0; } diff --git a/tests/unit/out/unsafe/fn_ptr_stdlib_compare.rs b/tests/unit/out/unsafe/fn_ptr_stdlib_compare.rs index 1bbc3c0f..8aeccbfa 100644 --- a/tests/unit/out/unsafe/fn_ptr_stdlib_compare.rs +++ b/tests/unit/out/unsafe/fn_ptr_stdlib_compare.rs @@ -52,10 +52,8 @@ unsafe fn main_0() -> i32 { assert!( ((unsafe { let _arg0: *mut ::libc::c_void = std::ptr::null_mut(); - let _arg1: u64 = 0_u64; - let _arg2: u64 = 0_u64; let _arg3: *mut ::libc::FILE = std::ptr::null_mut(); - (f3).unwrap()(_arg0, _arg1, _arg2, _arg3) + (f3).unwrap()(_arg0, 0_u64, 0_u64, _arg3) }) == (22_u64)) ); let mut __do_while = true; @@ -111,10 +109,8 @@ unsafe fn main_0() -> i32 { }; let mut n: u64 = (unsafe { let _arg0: *mut ::libc::c_void = (buf.as_mut_ptr() as *mut u8 as *mut ::libc::c_void); - let _arg1: u64 = 1_u64; - let _arg2: u64 = 10_u64; let _arg3: *mut ::libc::FILE = stream; - (fn1).unwrap()(_arg0, _arg1, _arg2, _arg3) + (fn1).unwrap()(_arg0, 1_u64, 10_u64, _arg3) }); assert!(((n) == (10_u64))); let mut i: i32 = 0; @@ -153,10 +149,8 @@ unsafe fn main_0() -> i32 { assert!( ((unsafe { let _arg0: *const ::libc::c_void = std::ptr::null(); - let _arg1: u64 = 0_u64; - let _arg2: u64 = 0_u64; let _arg3: *mut ::libc::FILE = std::ptr::null_mut(); - (g3).unwrap()(_arg0, _arg1, _arg2, _arg3) + (g3).unwrap()(_arg0, 0_u64, 0_u64, _arg3) }) == (33_u64)) ); let mut __do_while = true; @@ -203,10 +197,8 @@ unsafe fn main_0() -> i32 { let mut n: u64 = (unsafe { let _arg0: *const ::libc::c_void = (buf.as_mut_ptr() as *const u8 as *const ::libc::c_void); - let _arg1: u64 = 1_u64; - let _arg2: u64 = 10_u64; let _arg3: *mut ::libc::FILE = stream; - (gn1).unwrap()(_arg0, _arg1, _arg2, _arg3) + (gn1).unwrap()(_arg0, 1_u64, 10_u64, _arg3) }); assert!(((n) == (10_u64))); libc::fclose(stream); diff --git a/tests/unit/out/unsafe/fn_ptr_struct.rs b/tests/unit/out/unsafe/fn_ptr_struct.rs index 25e2ec47..c8480075 100644 --- a/tests/unit/out/unsafe/fn_ptr_struct.rs +++ b/tests/unit/out/unsafe/fn_ptr_struct.rs @@ -41,25 +41,10 @@ unsafe fn main_0() -> i32 { cb: Some(negate_1), }; assert!(!((h1.cb).is_none())); - assert!( - ((unsafe { - let _arg0: i32 = 5; - (h1.cb).unwrap()(_arg0) - }) == (10)) - ); - assert!( - ((unsafe { - let _arg0: i32 = 7; - (h2.cb).unwrap()(_arg0) - }) == (-7_i32)) - ); + assert!(((unsafe { (h1.cb).unwrap()(5,) }) == (10))); + assert!(((unsafe { (h2.cb).unwrap()(7,) }) == (-7_i32))); (h1.cb) = Some(negate_1); - assert!( - ((unsafe { - let _arg0: i32 = 3; - (h1.cb).unwrap()(_arg0) - }) == (-3_i32)) - ); + assert!(((unsafe { (h1.cb).unwrap()(3,) }) == (-3_i32))); assert!(((h1.cb) == (h2.cb))); return 0; } diff --git a/tests/unit/out/unsafe/fn_ptr_vtable.rs b/tests/unit/out/unsafe/fn_ptr_vtable.rs index 2e446e4d..93175c05 100644 --- a/tests/unit/out/unsafe/fn_ptr_vtable.rs +++ b/tests/unit/out/unsafe/fn_ptr_vtable.rs @@ -47,10 +47,7 @@ unsafe fn main_0() -> i32 { assert!(!((vt.create).is_none())); assert!(!((vt.get).is_none())); assert!(!((vt.destroy).is_none())); - let mut obj: *mut ::libc::c_void = (unsafe { - let _arg0: i32 = 42; - (vt.create).unwrap()(_arg0) - }); + let mut obj: *mut ::libc::c_void = (unsafe { (vt.create).unwrap()(42) }); assert!( ((unsafe { let _arg0: *mut ::libc::c_void = obj; diff --git a/tests/unit/out/unsafe/function_call.rs b/tests/unit/out/unsafe/function_call.rs index 05966bbf..80e80ce6 100644 --- a/tests/unit/out/unsafe/function_call.rs +++ b/tests/unit/out/unsafe/function_call.rs @@ -16,10 +16,6 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - let mut y: i32 = (unsafe { - let _y: i32 = 10; - let _z: i32 = 1; - function_0(_y, _z) - }); + let mut y: i32 = (unsafe { function_0(10, 1) }); return y; } diff --git a/tests/unit/out/unsafe/function_overloading.rs b/tests/unit/out/unsafe/function_overloading.rs index effb483d..d3c6ef8b 100644 --- a/tests/unit/out/unsafe/function_overloading.rs +++ b/tests/unit/out/unsafe/function_overloading.rs @@ -46,10 +46,7 @@ pub fn main() { unsafe fn main_0() -> i32 { let mut x: i32 = 1; let mut out: i32 = 0; - out += (unsafe { - let _x: i32 = 0; - foo_0(_x) - }); + out += (unsafe { foo_0(0) }); out += (unsafe { let _x: *mut i32 = (&mut x as *mut i32); foo_1(_x) @@ -70,11 +67,7 @@ unsafe fn main_0() -> i32 { foo_2(_x, _y) }); let mut bar: i32 = 5; - out += (((bar) - + (unsafe { - let _x: i32 = 0; - foo_0(_x) - })) + out += (((bar) + (unsafe { foo_0(0) })) + (unsafe { let _x: *mut i32 = (&mut x as *mut i32); foo_1(_x) @@ -82,14 +75,8 @@ unsafe fn main_0() -> i32 { let mut foo1: Foo = Foo {}; let foo2: Foo = Foo {}; (unsafe { foo1.foo() }); - (unsafe { - let _x: i32 = 1; - foo1.method_i32(_x) - }); + (unsafe { foo1.method_i32(1) }); (unsafe { foo2.foo_const() }); - (unsafe { - let _x: i32 = 2; - foo2.method_i32_const(_x) - }); + (unsafe { foo2.method_i32_const(2) }); return out; } diff --git a/tests/unit/out/unsafe/goto_aggregate_default.rs b/tests/unit/out/unsafe/goto_aggregate_default.rs index caca070a..11bd0d7a 100644 --- a/tests/unit/out/unsafe/goto_aggregate_default.rs +++ b/tests/unit/out/unsafe/goto_aggregate_default.rs @@ -49,12 +49,6 @@ unsafe fn main_0() -> i32 { }) == (0)) as i32) != 0) ); - assert!( - ((((unsafe { - let _n: i32 = 1; - agg_0(_n) - }) == (1)) as i32) - != 0) - ); + assert!(((((unsafe { agg_0(1,) }) == (1)) as i32) != 0)); return 0; } diff --git a/tests/unit/out/unsafe/goto_backward.rs b/tests/unit/out/unsafe/goto_backward.rs index 312d7241..4966418a 100644 --- a/tests/unit/out/unsafe/goto_backward.rs +++ b/tests/unit/out/unsafe/goto_backward.rs @@ -31,12 +31,6 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((((unsafe { - let _n: i32 = 4; - retry_0(_n) - }) == (12)) as i32) - != 0) - ); + assert!(((((unsafe { retry_0(4,) }) == (12)) as i32) != 0)); return 0; } diff --git a/tests/unit/out/unsafe/goto_cleanup.rs b/tests/unit/out/unsafe/goto_cleanup.rs index 6cba984d..cfca0762 100644 --- a/tests/unit/out/unsafe/goto_cleanup.rs +++ b/tests/unit/out/unsafe/goto_cleanup.rs @@ -84,40 +84,10 @@ unsafe fn main_0() -> i32 { }) == (-1_i32)) as i32) != 0) ); - assert!( - ((((unsafe { - let _n: i32 = 5; - early_0(_n) - }) == (100)) as i32) - != 0) - ); - assert!( - ((((unsafe { - let _n: i32 = 2; - from_loop_1(_n) - }) == (999)) as i32) - != 0) - ); - assert!( - ((((unsafe { - let _n: i32 = 10; - from_loop_1(_n) - }) == (7)) as i32) - != 0) - ); - assert!( - ((((unsafe { - let _n: i32 = 1; - from_switch_2(_n) - }) == (10)) as i32) - != 0) - ); - assert!( - ((((unsafe { - let _n: i32 = 2; - from_switch_2(_n) - }) == (999)) as i32) - != 0) - ); + assert!(((((unsafe { early_0(5,) }) == (100)) as i32) != 0)); + assert!(((((unsafe { from_loop_1(2,) }) == (999)) as i32) != 0)); + assert!(((((unsafe { from_loop_1(10,) }) == (7)) as i32) != 0)); + assert!(((((unsafe { from_switch_2(1,) }) == (10)) as i32) != 0)); + assert!(((((unsafe { from_switch_2(2,) }) == (999)) as i32) != 0)); return 0; } diff --git a/tests/unit/out/unsafe/goto_multi_label.rs b/tests/unit/out/unsafe/goto_multi_label.rs index 518fa85c..77e2e974 100644 --- a/tests/unit/out/unsafe/goto_multi_label.rs +++ b/tests/unit/out/unsafe/goto_multi_label.rs @@ -35,20 +35,8 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((((unsafe { - let _n: i32 = 5; - classify_0(_n) - }) == (5)) as i32) - != 0) - ); - assert!( - ((((unsafe { - let _n: i32 = 0; - classify_0(_n) - }) == (0)) as i32) - != 0) - ); + assert!(((((unsafe { classify_0(5,) }) == (5)) as i32) != 0)); + assert!(((((unsafe { classify_0(0,) }) == (0)) as i32) != 0)); assert!( ((((unsafe { let _n: i32 = -2_i32; diff --git a/tests/unit/out/unsafe/goto_nested_label.rs b/tests/unit/out/unsafe/goto_nested_label.rs index aeb474c8..b33975c3 100644 --- a/tests/unit/out/unsafe/goto_nested_label.rs +++ b/tests/unit/out/unsafe/goto_nested_label.rs @@ -37,12 +37,6 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((((unsafe { - let _n: i32 = 2; - scan_0(_n) - }) == (2010)) as i32) - != 0) - ); + assert!(((((unsafe { scan_0(2,) }) == (2010)) as i32) != 0)); return 0; } diff --git a/tests/unit/out/unsafe/goto_switch_fallthrough.rs b/tests/unit/out/unsafe/goto_switch_fallthrough.rs index 81961849..dfe4ad60 100644 --- a/tests/unit/out/unsafe/goto_switch_fallthrough.rs +++ b/tests/unit/out/unsafe/goto_switch_fallthrough.rs @@ -38,26 +38,8 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((((unsafe { - let _n: i32 = 0; - sm_0(_n) - }) == (11)) as i32) - != 0) - ); - assert!( - ((((unsafe { - let _n: i32 = 1; - sm_0(_n) - }) == (10)) as i32) - != 0) - ); - assert!( - ((((unsafe { - let _n: i32 = 9; - sm_0(_n) - }) == (1100)) as i32) - != 0) - ); + assert!(((((unsafe { sm_0(0,) }) == (11)) as i32) != 0)); + assert!(((((unsafe { sm_0(1,) }) == (10)) as i32) != 0)); + assert!(((((unsafe { sm_0(9,) }) == (1100)) as i32) != 0)); return 0; } diff --git a/tests/unit/out/unsafe/huffman.rs b/tests/unit/out/unsafe/huffman.rs index aef6c3be..23a9e79d 100644 --- a/tests/unit/out/unsafe/huffman.rs +++ b/tests/unit/out/unsafe/huffman.rs @@ -97,10 +97,7 @@ impl MinHeap { self.size.prefix_dec(); self.arr.as_mut().unwrap()[(0_u64) as usize] = self.arr.as_mut().unwrap()[(self.size as u64) as usize]; - (unsafe { - let _idx: i32 = 0; - self.Heapify(_idx) - }); + (unsafe { self.Heapify(0) }); return out; } pub unsafe fn Insert(&mut self, mut node: *mut MinHeapNode) { @@ -180,9 +177,8 @@ pub unsafe fn Huffman_2( let mut right: *mut MinHeapNode = (unsafe { (*minHeap.as_deref_mut().unwrap()).ExtractMin() }); let mut top: *mut MinHeapNode = (unsafe { - let _data: u8 = ('$' as u8); let _freq: i32 = (((*left).freq) + ((*right).freq)); - (*minHeap.as_deref_mut().unwrap()).Alloc(_data, _freq) + (*minHeap.as_deref_mut().unwrap()).Alloc(('$' as u8), _freq) }); (*top).left = left; (*top).right = right; diff --git a/tests/unit/out/unsafe/kruskal.rs b/tests/unit/out/unsafe/kruskal.rs index e5d94c53..a0774b6f 100644 --- a/tests/unit/out/unsafe/kruskal.rs +++ b/tests/unit/out/unsafe/kruskal.rs @@ -156,9 +156,8 @@ pub struct Graph { pub unsafe fn MSTKruskal_2(graph: *mut Graph) -> f64 { (unsafe { let _arr: *mut Option> = &mut (*graph).edges as *mut Option>; - let _start: i32 = 0; let _end: i32 = (((*graph).E) - (1)); - quicksort_1(_arr, _start, _end) + quicksort_1(_arr, 0, _end) }); let mut set: DisjointSet = DisjointSet { rank: Some( diff --git a/tests/unit/out/unsafe/lambda_capture_pass.rs b/tests/unit/out/unsafe/lambda_capture_pass.rs index 5514b885..f96e0fbf 100644 --- a/tests/unit/out/unsafe/lambda_capture_pass.rs +++ b/tests/unit/out/unsafe/lambda_capture_pass.rs @@ -31,8 +31,7 @@ unsafe fn main_0() -> i32 { return ((x) + (base)); }) .clone(); - let _x: i32 = 5; - apply_0(_fn, _x) + apply_0(_fn, 5) }) == (15)) ); base = 100; @@ -42,8 +41,7 @@ unsafe fn main_0() -> i32 { return ((x) + (base)); }) .clone(); - let _x: i32 = 5; - apply_0(_fn, _x) + apply_0(_fn, 5) }) == (105)) ); let mut factor: i32 = 3; @@ -53,8 +51,7 @@ unsafe fn main_0() -> i32 { return ((x) * (factor)); }) .clone(); - let _x: i32 = 4; - apply_1(_fn, _x) + apply_1(_fn, 4) }) == (12)) ); return 0; diff --git a/tests/unit/out/unsafe/lambda_nested.rs b/tests/unit/out/unsafe/lambda_nested.rs index 4de0181d..a117ad16 100644 --- a/tests/unit/out/unsafe/lambda_nested.rs +++ b/tests/unit/out/unsafe/lambda_nested.rs @@ -15,29 +15,25 @@ unsafe fn main_0() -> i32 { let mut x: i32 = 10; assert!( ((unsafe { - let _y: i32 = 20; (|y: i32| { return (unsafe { - let _z: i32 = 1; (|z: i32| { return (((x) + (y)) + (z)); - })(_z) + })(1) }); - })(_y) + })(20) }) == (31)) ); x = 100; assert!( ((unsafe { - let _y: i32 = 20; (|y: i32| { return (unsafe { - let _z: i32 = 1; (|z: i32| { return (((x) + (y)) + (z)); - })(_z) + })(1) }); - })(_y) + })(20) }) == (121)) ); return 0; diff --git a/tests/unit/out/unsafe/linked_list.rs b/tests/unit/out/unsafe/linked_list.rs index 4ef86d5b..c1f67893 100644 --- a/tests/unit/out/unsafe/linked_list.rs +++ b/tests/unit/out/unsafe/linked_list.rs @@ -129,13 +129,11 @@ unsafe fn main_0() -> i32 { }); head = (unsafe { let _head: *mut Node = head; - let _val: i32 = 5; - Delete_2(_head, _val) + Delete_2(_head, 5) }); head = (unsafe { let _head: *mut Node = head; - let _val: i32 = 0; - Delete_2(_head, _val) + Delete_2(_head, 0) }); head = (unsafe { let _head: *mut Node = head; @@ -144,43 +142,37 @@ unsafe fn main_0() -> i32 { }); return ((((((((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 0; - Find_0(_head, _idx) + Find_0(_head, 0) })) .val) == (4)) && (((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 1; - Find_0(_head, _idx) + Find_0(_head, 1) })) .val) == (3))) && (((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 2; - Find_0(_head, _idx) + Find_0(_head, 2) })) .val) == (2))) && (((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 3; - Find_0(_head, _idx) + Find_0(_head, 3) })) .val) == (1))) && ((((*(unsafe { let _head: *mut Node = head; - let _idx: i32 = 4; - Find_0(_head, _idx) + Find_0(_head, 4) })) .val) == (-1_i32)) && ((unsafe { let _head: *mut Node = head; - let _idx: i32 = 5; - Find_0(_head, _idx) + Find_0(_head, 5) }) .is_null()))) as i32); } diff --git a/tests/unit/out/unsafe/macros.rs b/tests/unit/out/unsafe/macros.rs index 56bb12ff..ab18a354 100644 --- a/tests/unit/out/unsafe/macros.rs +++ b/tests/unit/out/unsafe/macros.rs @@ -22,10 +22,8 @@ unsafe fn main_0() -> i32 { b"main\0".as_ptr(), ); (unsafe { - let _file: *const u8 = b"macros.cpp\0".as_ptr(); - let _line: i32 = 9; let _func: *const u8 = b"main\0".as_ptr(); - log_0(_file, _line, _func) + log_0(b"macros.cpp\0".as_ptr(), 9, _func) }); return 0; } diff --git a/tests/unit/out/unsafe/malloc_realloc_free.rs b/tests/unit/out/unsafe/malloc_realloc_free.rs index 4075cb12..87e7ba31 100644 --- a/tests/unit/out/unsafe/malloc_realloc_free.rs +++ b/tests/unit/out/unsafe/malloc_realloc_free.rs @@ -112,9 +112,8 @@ unsafe fn main_0() -> i32 { (pfree).unwrap()(_arg0) }); let mut zeros: *mut i32 = ((unsafe { - let _arg0: u64 = 4_u64; let _arg1: u64 = ::std::mem::size_of::() as u64; - (pcalloc).unwrap()(_arg0, _arg1) + (pcalloc).unwrap()(4_u64, _arg1) }) as *mut i32); let mut i: i32 = 0; 'loop_: while ((((i) < (4)) as i32) != 0) { diff --git a/tests/unit/out/unsafe/matmul.rs b/tests/unit/out/unsafe/matmul.rs index 23be486f..e8143660 100644 --- a/tests/unit/out/unsafe/matmul.rs +++ b/tests/unit/out/unsafe/matmul.rs @@ -39,8 +39,7 @@ pub unsafe fn matmul_1( let mut m3: Option>]>> = (unsafe { let _n: i32 = n1; let _p: i32 = p2; - let _e: i32 = 0; - matalloc_0(_n, _p, _e) + matalloc_0(_n, _p, 0) }); let mut i: i32 = 0; 'loop_: while ((i) < (n1)) { @@ -73,14 +72,12 @@ unsafe fn main_0() -> i32 { let mut m1: Option>]>> = (unsafe { let _n: i32 = n; let _p: i32 = p; - let _e: i32 = 1; - matalloc_0(_n, _p, _e) + matalloc_0(_n, _p, 1) }); let mut m2: Option>]>> = (unsafe { let _n: i32 = p; let _p: i32 = n; - let _e: i32 = 2; - matalloc_0(_n, _p, _e) + matalloc_0(_n, _p, 2) }); let mut m3: Option>]>> = (unsafe { let _m1: Option>]>> = m1; diff --git a/tests/unit/out/unsafe/new_bst.rs b/tests/unit/out/unsafe/new_bst.rs index 394b13c2..f02f98e7 100644 --- a/tests/unit/out/unsafe/new_bst.rs +++ b/tests/unit/out/unsafe/new_bst.rs @@ -82,63 +82,53 @@ unsafe fn main_0() -> i32 { })) as *mut node_t); root = (unsafe { let _node: *mut node_t = root; - let _value: i32 = 1; - insert_1(_node, _value) + insert_1(_node, 1) }); root = (unsafe { let _node: *mut node_t = root; - let _value: i32 = 2; - insert_1(_node, _value) + insert_1(_node, 2) }); root = (unsafe { let _node: *mut node_t = root; - let _value: i32 = 3; - insert_1(_node, _value) + insert_1(_node, 3) }); root = (unsafe { let _node: *mut node_t = root; - let _value: i32 = 4; - insert_1(_node, _value) + insert_1(_node, 4) }); let mut out: bool = (((((((*(unsafe { let _node: *mut node_t = root; - let _value: i32 = 0; - find_0(_node, _value) + find_0(_node, 0) })) .value) == (0)) && (((*(unsafe { let _node: *mut node_t = root; - let _value: i32 = 1; - find_0(_node, _value) + find_0(_node, 1) })) .value) == (1))) && (((*(unsafe { let _node: *mut node_t = root; - let _value: i32 = 2; - find_0(_node, _value) + find_0(_node, 2) })) .value) == (2))) && (((*(unsafe { let _node: *mut node_t = root; - let _value: i32 = 3; - find_0(_node, _value) + find_0(_node, 3) })) .value) == (3))) && (((*(unsafe { let _node: *mut node_t = root; - let _value: i32 = 4; - find_0(_node, _value) + find_0(_node, 4) })) .value) == (4))) && ((unsafe { let _node: *mut node_t = root; - let _value: i32 = 5; - find_0(_node, _value) + find_0(_node, 5) }) .is_null()); (unsafe { diff --git a/tests/unit/out/unsafe/push_emplace_back.rs b/tests/unit/out/unsafe/push_emplace_back.rs index e044d375..0917a7a2 100644 --- a/tests/unit/out/unsafe/push_emplace_back.rs +++ b/tests/unit/out/unsafe/push_emplace_back.rs @@ -93,8 +93,7 @@ unsafe fn main_0() -> i32 { let mut jpg: JPEGData = ::default(); (unsafe { let _jpg: *mut JPEGData = (&mut jpg as *mut JPEGData); - let _cond: bool = true; - push_local_from_field_1(_jpg, _cond) + push_local_from_field_1(_jpg, true) }); assert!(((jpg.com_data.len() as u64) == (1_u64))); assert!(((jpg.com_data[(0_u64) as usize].len() as u64) == (3_u64))); @@ -119,8 +118,7 @@ unsafe fn main_0() -> i32 { assert!(((chunks[(0_u64) as usize].data) == (42))); (unsafe { let _jpg: *mut JPEGData = (&mut jpg as *mut JPEGData); - let _cond: bool = false; - emplace_local_from_field_4(_jpg, _cond) + emplace_local_from_field_4(_jpg, false) }); assert!(((jpg.app_data.len() as u64) == (1_u64))); assert!(((jpg.app_data[(0_u64) as usize].len() as u64) == (3_u64))); diff --git a/tests/unit/out/unsafe/refs_as_args.rs b/tests/unit/out/unsafe/refs_as_args.rs index 656b163a..3bbcfbfe 100644 --- a/tests/unit/out/unsafe/refs_as_args.rs +++ b/tests/unit/out/unsafe/refs_as_args.rs @@ -26,11 +26,9 @@ unsafe fn main_0() -> i32 { let mut x1: i32 = 1; let x2: i32 = 2; (unsafe { - let _x1: i32 = 3; - let _x2: i32 = 4; let _r1: *mut i32 = &mut x1 as *mut i32; let _r2: *const i32 = &x2 as *const i32; - more_refs_0(_x1, _x2, _r1, _r2) + more_refs_0(3, 4, _r1, _r2) }); return ((x1) + (x2)); } diff --git a/tests/unit/out/unsafe/reserved_keywords.rs b/tests/unit/out/unsafe/reserved_keywords.rs index d90eabda..ec361c5f 100644 --- a/tests/unit/out/unsafe/reserved_keywords.rs +++ b/tests/unit/out/unsafe/reserved_keywords.rs @@ -176,85 +176,9 @@ unsafe fn main_0() -> i32 { let mut safe_: i32 = 0; let mut vec_: i32 = 0; return (unsafe { - let _as: i32 = 0; - let _async: i32 = 0; - let _await: i32 = 0; - let _crate: i32 = 0; - let _dyn: i32 = 0; - let _fn: i32 = 0; - let _impl: i32 = 0; - let _in: i32 = 0; - let _let: i32 = 0; - let _loop: i32 = 0; - let _match: i32 = 0; - let _mod: i32 = 0; - let _move: i32 = 0; - let _mut: i32 = 0; - let _pub: i32 = 0; - let _ref: i32 = 0; - let _self: i32 = 0; - let _Self: i32 = 0; - let _super: i32 = 0; - let _trait: i32 = 0; - let _type: i32 = 0; - let _unsafe: i32 = 0; - let _use: i32 = 0; - let _where: i32 = 0; - let _abstract: i32 = 0; - let _become: i32 = 0; - let _box: i32 = 0; - let _final: i32 = 0; - let _gen: i32 = 0; - let _macro: i32 = 0; - let _override: i32 = 0; - let _priv: i32 = 0; - let _unsized: i32 = 0; - let _yield: i32 = 0; - let _macro_rules: i32 = 0; - let _raw: i32 = 0; - let _safe: i32 = 0; - let _vec: i32 = 0; - let _dummy: i32 = 0; foo_0( - _as, - _async, - _await, - _crate, - _dyn, - _fn, - _impl, - _in, - _let, - _loop, - _match, - _mod, - _move, - _mut, - _pub, - _ref, - _self, - _Self, - _super, - _trait, - _type, - _unsafe, - _use, - _where, - _abstract, - _become, - _box, - _final, - _gen, - _macro, - _override, - _priv, - _unsized, - _yield, - _macro_rules, - _raw, - _safe, - _vec, - _dummy, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ) }); } diff --git a/tests/unit/out/unsafe/static_shadow.rs b/tests/unit/out/unsafe/static_shadow.rs index e4a00be8..37309291 100644 --- a/tests/unit/out/unsafe/static_shadow.rs +++ b/tests/unit/out/unsafe/static_shadow.rs @@ -23,13 +23,7 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((((unsafe { - let _value: i32 = 10; - param_shadow_1(_value) - }) == (11)) as i32) - != 0) - ); + assert!(((((unsafe { param_shadow_1(10,) }) == (11)) as i32) != 0)); assert!(((((unsafe { local_shadow_2() }) == (99)) as i32) != 0)); assert!(((((unsafe { read_global_3() }) == (5)) as i32) != 0)); return 0; diff --git a/tests/unit/out/unsafe/string_literals.rs b/tests/unit/out/unsafe/string_literals.rs index 4d565613..42472c7b 100644 --- a/tests/unit/out/unsafe/string_literals.rs +++ b/tests/unit/out/unsafe/string_literals.rs @@ -25,10 +25,7 @@ unsafe fn main_0() -> i32 { let _str: *mut u8 = mutable_string_arr.as_mut_ptr(); foo_mut_0(_str) }); - (unsafe { - let _str: *const u8 = b"world\0".as_ptr(); - foo_const_1(_str) - }); + (unsafe { foo_const_1(b"world\0".as_ptr()) }); (unsafe { let _str: *const u8 = immutable_string; foo_const_1(_str) @@ -37,10 +34,7 @@ unsafe fn main_0() -> i32 { let _str: *const u8 = immutable_string_arr.as_ptr(); foo_const_1(_str) }); - (unsafe { - let _str: *const u8 = b"\0".as_ptr(); - foo_const_1(_str) - }); + (unsafe { foo_const_1(b"\0".as_ptr()) }); (unsafe { let _str: *const u8 = immutable_empty; foo_const_1(_str) diff --git a/tests/unit/out/unsafe/string_literals_c.rs b/tests/unit/out/unsafe/string_literals_c.rs index 5d175c15..99daee62 100644 --- a/tests/unit/out/unsafe/string_literals_c.rs +++ b/tests/unit/out/unsafe/string_literals_c.rs @@ -32,10 +32,7 @@ unsafe fn main_0() -> i32 { let mut immutable_empty: *const u8 = (b"\0".as_ptr().cast_mut()).cast_const(); let mut mutable_empty_arr: [u8; 1] = [0u8; 1]; let immutable_empty_arr: [u8; 1] = [0u8; 1]; - (unsafe { - let _str: *mut u8 = b"world\0".as_ptr().cast_mut(); - foo_mut_0(_str) - }); + (unsafe { foo_mut_0(b"world\0".as_ptr().cast_mut()) }); (unsafe { let _str: *mut u8 = mutable_string; foo_mut_0(_str) @@ -44,10 +41,7 @@ unsafe fn main_0() -> i32 { let _str: *mut u8 = mutable_string_arr.as_mut_ptr(); foo_mut_0(_str) }); - (unsafe { - let _str: *const u8 = (b"world\0".as_ptr().cast_mut()).cast_const(); - foo_const_1(_str) - }); + (unsafe { foo_const_1((b"world\0".as_ptr().cast_mut()).cast_const()) }); (unsafe { let _str: *const u8 = (mutable_string).cast_const(); foo_const_1(_str) @@ -64,10 +58,7 @@ unsafe fn main_0() -> i32 { let _str: *const u8 = immutable_string_arr.as_ptr(); foo_const_1(_str) }); - (unsafe { - let _str: *const u8 = (b"\0".as_ptr().cast_mut()).cast_const(); - foo_const_1(_str) - }); + (unsafe { foo_const_1((b"\0".as_ptr().cast_mut()).cast_const()) }); (unsafe { let _str: *const u8 = (mutable_empty).cast_const(); foo_const_1(_str) diff --git a/tests/unit/out/unsafe/string_literals_return.rs b/tests/unit/out/unsafe/string_literals_return.rs index 06d1d65e..69aba201 100644 --- a/tests/unit/out/unsafe/string_literals_return.rs +++ b/tests/unit/out/unsafe/string_literals_return.rs @@ -30,10 +30,7 @@ unsafe fn main_0() -> i32 { assert!((((*a.offset((5) as isize)) as i32) == (('\0' as u8) as i32))); let mut b: *const u8 = (unsafe { get_empty_1() }); assert!((((*b.offset((0) as isize)) as i32) == (('\0' as u8) as i32))); - let mut c: *const u8 = (unsafe { - let _x: i32 = 1; - get_branch_2(_x) - }); + let mut c: *const u8 = (unsafe { get_branch_2(1) }); assert!((((*c.offset((0) as isize)) as i32) == (('p' as u8) as i32))); assert!((((*c.offset((7) as isize)) as i32) == (('e' as u8) as i32))); assert!((((*c.offset((8) as isize)) as i32) == (('\0' as u8) as i32))); diff --git a/tests/unit/out/unsafe/string_literals_return_c.rs b/tests/unit/out/unsafe/string_literals_return_c.rs index b2d0532c..03548805 100644 --- a/tests/unit/out/unsafe/string_literals_return_c.rs +++ b/tests/unit/out/unsafe/string_literals_return_c.rs @@ -30,10 +30,7 @@ unsafe fn main_0() -> i32 { assert!((((((*a.offset((5) as isize)) as i32) == ('\0' as i32)) as i32) != 0)); let mut b: *const u8 = (unsafe { get_empty_1() }); assert!((((((*b.offset((0) as isize)) as i32) == ('\0' as i32)) as i32) != 0)); - let mut c: *const u8 = (unsafe { - let _x: i32 = 1; - get_branch_2(_x) - }); + let mut c: *const u8 = (unsafe { get_branch_2(1) }); assert!((((((*c.offset((0) as isize)) as i32) == ('p' as i32)) as i32) != 0)); assert!((((((*c.offset((7) as isize)) as i32) == ('e' as i32)) as i32) != 0)); assert!((((((*c.offset((8) as isize)) as i32) == ('\0' as i32)) as i32) != 0)); diff --git a/tests/unit/out/unsafe/strlen_rec.rs b/tests/unit/out/unsafe/strlen_rec.rs index 8979d49d..5d8e5ed7 100644 --- a/tests/unit/out/unsafe/strlen_rec.rs +++ b/tests/unit/out/unsafe/strlen_rec.rs @@ -26,7 +26,6 @@ unsafe fn main_0() -> i32 { let s: [u8; 4] = [('s' as u8), ('t' as u8), ('r' as u8), ('\0' as u8)]; return (unsafe { let _s: *const u8 = (&s[(0) as usize] as *const u8); - let _n: i32 = 0; - strlen_0(_s, _n) + strlen_0(_s, 0) }); } diff --git a/tests/unit/out/unsafe/switch_basic.rs b/tests/unit/out/unsafe/switch_basic.rs index e35a27c9..9a4bfbe9 100644 --- a/tests/unit/out/unsafe/switch_basic.rs +++ b/tests/unit/out/unsafe/switch_basic.rs @@ -38,23 +38,8 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 0; - basic_0(_x) - }) == (10)) - ); - assert!( - ((unsafe { - let _x: i32 = 2; - basic_0(_x) - }) == (30)) - ); - assert!( - ((unsafe { - let _x: i32 = 99; - basic_0(_x) - }) == (40)) - ); + assert!(((unsafe { basic_0(0,) }) == (10))); + assert!(((unsafe { basic_0(2,) }) == (30))); + assert!(((unsafe { basic_0(99,) }) == (40))); return 0; } diff --git a/tests/unit/out/unsafe/switch_borrow_in_condition_and_in_body.rs b/tests/unit/out/unsafe/switch_borrow_in_condition_and_in_body.rs index 06fcf40a..c63299ff 100644 --- a/tests/unit/out/unsafe/switch_borrow_in_condition_and_in_body.rs +++ b/tests/unit/out/unsafe/switch_borrow_in_condition_and_in_body.rs @@ -21,17 +21,7 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 0; - borrow_in_condition_and_in_body_0(_x) - }) == (1)) - ); - assert!( - ((unsafe { - let _x: i32 = 1; - borrow_in_condition_and_in_body_0(_x) - }) == (2)) - ); + assert!(((unsafe { borrow_in_condition_and_in_body_0(0,) }) == (1))); + assert!(((unsafe { borrow_in_condition_and_in_body_0(1,) }) == (2))); return 0; } diff --git a/tests/unit/out/unsafe/switch_case_then_default.rs b/tests/unit/out/unsafe/switch_case_then_default.rs index fb7f2c08..e3ef2e7d 100644 --- a/tests/unit/out/unsafe/switch_case_then_default.rs +++ b/tests/unit/out/unsafe/switch_case_then_default.rs @@ -29,23 +29,8 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 1; - case_then_default_0(_x) - }) == (10)) - ); - assert!( - ((unsafe { - let _x: i32 = 2; - case_then_default_0(_x) - }) == (20)) - ); - assert!( - ((unsafe { - let _x: i32 = 99; - case_then_default_0(_x) - }) == (10)) - ); + assert!(((unsafe { case_then_default_0(1,) }) == (10))); + assert!(((unsafe { case_then_default_0(2,) }) == (20))); + assert!(((unsafe { case_then_default_0(99,) }) == (10))); return 0; } diff --git a/tests/unit/out/unsafe/switch_cases_and_default_stacked.rs b/tests/unit/out/unsafe/switch_cases_and_default_stacked.rs index b5213372..033c0f66 100644 --- a/tests/unit/out/unsafe/switch_cases_and_default_stacked.rs +++ b/tests/unit/out/unsafe/switch_cases_and_default_stacked.rs @@ -29,29 +29,9 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 1; - cases_and_default_stacked_0(_x) - }) == (42)) - ); - assert!( - ((unsafe { - let _x: i32 = 2; - cases_and_default_stacked_0(_x) - }) == (42)) - ); - assert!( - ((unsafe { - let _x: i32 = 3; - cases_and_default_stacked_0(_x) - }) == (3)) - ); - assert!( - ((unsafe { - let _x: i32 = 99; - cases_and_default_stacked_0(_x) - }) == (42)) - ); + assert!(((unsafe { cases_and_default_stacked_0(1,) }) == (42))); + assert!(((unsafe { cases_and_default_stacked_0(2,) }) == (42))); + assert!(((unsafe { cases_and_default_stacked_0(3,) }) == (3))); + assert!(((unsafe { cases_and_default_stacked_0(99,) }) == (42))); return 0; } diff --git a/tests/unit/out/unsafe/switch_char.rs b/tests/unit/out/unsafe/switch_char.rs index 7dbfb4e8..bccb5ee2 100644 --- a/tests/unit/out/unsafe/switch_char.rs +++ b/tests/unit/out/unsafe/switch_char.rs @@ -53,35 +53,10 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _c: u8 = ('a' as u8); - switch_char_0(_c) - }) == (1)) - ); - assert!( - ((unsafe { - let _c: u8 = ('b' as u8); - switch_char_0(_c) - }) == (2)) - ); - assert!( - ((unsafe { - let _c: u8 = ('\n' as u8); - switch_char_0(_c) - }) == (3)) - ); - assert!( - ((unsafe { - let _c: u8 = ('\0' as u8); - switch_char_0(_c) - }) == (4)) - ); - assert!( - ((unsafe { - let _c: u8 = ('z' as u8); - switch_char_0(_c) - }) == (0)) - ); + assert!(((unsafe { switch_char_0(('a' as u8),) }) == (1))); + assert!(((unsafe { switch_char_0(('b' as u8),) }) == (2))); + assert!(((unsafe { switch_char_0(('\n' as u8),) }) == (3))); + assert!(((unsafe { switch_char_0(('\0' as u8),) }) == (4))); + assert!(((unsafe { switch_char_0(('z' as u8),) }) == (0))); return 0; } diff --git a/tests/unit/out/unsafe/switch_complex_cond.rs b/tests/unit/out/unsafe/switch_complex_cond.rs index ffec14d3..4dd1b35e 100644 --- a/tests/unit/out/unsafe/switch_complex_cond.rs +++ b/tests/unit/out/unsafe/switch_complex_cond.rs @@ -36,15 +36,13 @@ unsafe fn main_0() -> i32 { assert!( ((unsafe { let _p: *mut i32 = (&mut p_val as *mut i32); - let _bias: i32 = 0; - switch_complex_cond_0(_p, _bias) + switch_complex_cond_0(_p, 0) }) == (2)) ); assert!( ((unsafe { let _p: *mut i32 = (&mut p_val as *mut i32); - let _bias: i32 = 5; - switch_complex_cond_0(_p, _bias) + switch_complex_cond_0(_p, 5) }) == (3)) ); assert!( @@ -57,8 +55,7 @@ unsafe fn main_0() -> i32 { assert!( ((unsafe { let _p: *mut i32 = (&mut p_val as *mut i32); - let _bias: i32 = 99; - switch_complex_cond_0(_p, _bias) + switch_complex_cond_0(_p, 99) }) == (0)) ); return 0; diff --git a/tests/unit/out/unsafe/switch_compound_case_body.rs b/tests/unit/out/unsafe/switch_compound_case_body.rs index ce6a4d21..1b558c8b 100644 --- a/tests/unit/out/unsafe/switch_compound_case_body.rs +++ b/tests/unit/out/unsafe/switch_compound_case_body.rs @@ -36,23 +36,8 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 1; - compound_case_body_0(_x) - }) == (30)) - ); - assert!( - ((unsafe { - let _x: i32 = 2; - compound_case_body_0(_x) - }) == (99)) - ); - assert!( - ((unsafe { - let _x: i32 = 9; - compound_case_body_0(_x) - }) == (-1_i32)) - ); + assert!(((unsafe { compound_case_body_0(1,) }) == (30))); + assert!(((unsafe { compound_case_body_0(2,) }) == (99))); + assert!(((unsafe { compound_case_body_0(9,) }) == (-1_i32))); return 0; } diff --git a/tests/unit/out/unsafe/switch_continue_inside_switch.rs b/tests/unit/out/unsafe/switch_continue_inside_switch.rs index ab55021b..62bdb1c1 100644 --- a/tests/unit/out/unsafe/switch_continue_inside_switch.rs +++ b/tests/unit/out/unsafe/switch_continue_inside_switch.rs @@ -34,11 +34,6 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _n: i32 = 6; - continue_inside_switch_0(_n) - }) == ((((1) + (3)) + (5)) + ((3) * (1000)))) - ); + assert!(((unsafe { continue_inside_switch_0(6,) }) == ((((1) + (3)) + (5)) + ((3) * (1000))))); return 0; } diff --git a/tests/unit/out/unsafe/switch_default_first.rs b/tests/unit/out/unsafe/switch_default_first.rs index fb32f4f7..28042b5e 100644 --- a/tests/unit/out/unsafe/switch_default_first.rs +++ b/tests/unit/out/unsafe/switch_default_first.rs @@ -33,17 +33,7 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 1; - default_first_0(_x) - }) == (1)) - ); - assert!( - ((unsafe { - let _x: i32 = 99; - default_first_0(_x) - }) == (7)) - ); + assert!(((unsafe { default_first_0(1,) }) == (1))); + assert!(((unsafe { default_first_0(99,) }) == (7))); return 0; } diff --git a/tests/unit/out/unsafe/switch_default_middle.rs b/tests/unit/out/unsafe/switch_default_middle.rs index ac17606e..2b99f665 100644 --- a/tests/unit/out/unsafe/switch_default_middle.rs +++ b/tests/unit/out/unsafe/switch_default_middle.rs @@ -33,23 +33,8 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 1; - default_middle_0(_x) - }) == (1)) - ); - assert!( - ((unsafe { - let _x: i32 = 2; - default_middle_0(_x) - }) == (2)) - ); - assert!( - ((unsafe { - let _x: i32 = 99; - default_middle_0(_x) - }) == (99)) - ); + assert!(((unsafe { default_middle_0(1,) }) == (1))); + assert!(((unsafe { default_middle_0(2,) }) == (2))); + assert!(((unsafe { default_middle_0(99,) }) == (99))); return 0; } diff --git a/tests/unit/out/unsafe/switch_default_then_case.rs b/tests/unit/out/unsafe/switch_default_then_case.rs index e2d69e82..9313072c 100644 --- a/tests/unit/out/unsafe/switch_default_then_case.rs +++ b/tests/unit/out/unsafe/switch_default_then_case.rs @@ -33,29 +33,9 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 1; - default_then_case_0(_x) - }) == (1)) - ); - assert!( - ((unsafe { - let _x: i32 = 2; - default_then_case_0(_x) - }) == (77)) - ); - assert!( - ((unsafe { - let _x: i32 = 3; - default_then_case_0(_x) - }) == (3)) - ); - assert!( - ((unsafe { - let _x: i32 = 99; - default_then_case_0(_x) - }) == (77)) - ); + assert!(((unsafe { default_then_case_0(1,) }) == (1))); + assert!(((unsafe { default_then_case_0(2,) }) == (77))); + assert!(((unsafe { default_then_case_0(3,) }) == (3))); + assert!(((unsafe { default_then_case_0(99,) }) == (77))); return 0; } diff --git a/tests/unit/out/unsafe/switch_empty_case_with_break.rs b/tests/unit/out/unsafe/switch_empty_case_with_break.rs index d9b35993..ea1e1ec8 100644 --- a/tests/unit/out/unsafe/switch_empty_case_with_break.rs +++ b/tests/unit/out/unsafe/switch_empty_case_with_break.rs @@ -32,23 +32,8 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 1; - empty_case_with_break_0(_x) - }) == (5)) - ); - assert!( - ((unsafe { - let _x: i32 = 2; - empty_case_with_break_0(_x) - }) == (2)) - ); - assert!( - ((unsafe { - let _x: i32 = 9; - empty_case_with_break_0(_x) - }) == (9)) - ); + assert!(((unsafe { empty_case_with_break_0(1,) }) == (5))); + assert!(((unsafe { empty_case_with_break_0(2,) }) == (2))); + assert!(((unsafe { empty_case_with_break_0(9,) }) == (9))); return 0; } diff --git a/tests/unit/out/unsafe/switch_empty_switch.rs b/tests/unit/out/unsafe/switch_empty_switch.rs index 04c4c15d..1816a14f 100644 --- a/tests/unit/out/unsafe/switch_empty_switch.rs +++ b/tests/unit/out/unsafe/switch_empty_switch.rs @@ -21,11 +21,6 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 5; - empty_switch_0(_x) - }) == (5)) - ); + assert!(((unsafe { empty_switch_0(5,) }) == (5))); return 0; } diff --git a/tests/unit/out/unsafe/switch_fallthrough_chain.rs b/tests/unit/out/unsafe/switch_fallthrough_chain.rs index b0318e7f..8ed878c4 100644 --- a/tests/unit/out/unsafe/switch_fallthrough_chain.rs +++ b/tests/unit/out/unsafe/switch_fallthrough_chain.rs @@ -35,35 +35,10 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 1; - fallthrough_chain_0(_x) - }) == (15)) - ); - assert!( - ((unsafe { - let _x: i32 = 2; - fallthrough_chain_0(_x) - }) == (14)) - ); - assert!( - ((unsafe { - let _x: i32 = 3; - fallthrough_chain_0(_x) - }) == (12)) - ); - assert!( - ((unsafe { - let _x: i32 = 4; - fallthrough_chain_0(_x) - }) == (8)) - ); - assert!( - ((unsafe { - let _x: i32 = 99; - fallthrough_chain_0(_x) - }) == (-1_i32)) - ); + assert!(((unsafe { fallthrough_chain_0(1,) }) == (15))); + assert!(((unsafe { fallthrough_chain_0(2,) }) == (14))); + assert!(((unsafe { fallthrough_chain_0(3,) }) == (12))); + assert!(((unsafe { fallthrough_chain_0(4,) }) == (8))); + assert!(((unsafe { fallthrough_chain_0(99,) }) == (-1_i32))); return 0; } diff --git a/tests/unit/out/unsafe/switch_fallthrough_default.rs b/tests/unit/out/unsafe/switch_fallthrough_default.rs index cab70056..3bdaf74f 100644 --- a/tests/unit/out/unsafe/switch_fallthrough_default.rs +++ b/tests/unit/out/unsafe/switch_fallthrough_default.rs @@ -28,26 +28,8 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 7; - let _flag: i32 = 0; - fallthrough_default_0(_x, _flag) - }) == (42)) - ); - assert!( - ((unsafe { - let _x: i32 = 7; - let _flag: i32 = 1; - fallthrough_default_0(_x, _flag) - }) == (100)) - ); - assert!( - ((unsafe { - let _x: i32 = 99; - let _flag: i32 = 0; - fallthrough_default_0(_x, _flag) - }) == (42)) - ); + assert!(((unsafe { fallthrough_default_0(7, 0,) }) == (42))); + assert!(((unsafe { fallthrough_default_0(7, 1,) }) == (100))); + assert!(((unsafe { fallthrough_default_0(99, 0,) }) == (42))); return 0; } diff --git a/tests/unit/out/unsafe/switch_fallthrough_into_block.rs b/tests/unit/out/unsafe/switch_fallthrough_into_block.rs index fe4e0973..c1137f6b 100644 --- a/tests/unit/out/unsafe/switch_fallthrough_into_block.rs +++ b/tests/unit/out/unsafe/switch_fallthrough_into_block.rs @@ -30,23 +30,8 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 1; - fallthrough_into_block_0(_x) - }) == (15)) - ); - assert!( - ((unsafe { - let _x: i32 = 2; - fallthrough_into_block_0(_x) - }) == (5)) - ); - assert!( - ((unsafe { - let _x: i32 = 99; - fallthrough_into_block_0(_x) - }) == (-1_i32)) - ); + assert!(((unsafe { fallthrough_into_block_0(1,) }) == (15))); + assert!(((unsafe { fallthrough_into_block_0(2,) }) == (5))); + assert!(((unsafe { fallthrough_into_block_0(99,) }) == (-1_i32))); return 0; } diff --git a/tests/unit/out/unsafe/switch_fallthrough_one.rs b/tests/unit/out/unsafe/switch_fallthrough_one.rs index 6c6b5fd6..a61417c2 100644 --- a/tests/unit/out/unsafe/switch_fallthrough_one.rs +++ b/tests/unit/out/unsafe/switch_fallthrough_one.rs @@ -29,23 +29,8 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 1; - fallthrough_one_0(_x) - }) == (30)) - ); - assert!( - ((unsafe { - let _x: i32 = 2; - fallthrough_one_0(_x) - }) == (20)) - ); - assert!( - ((unsafe { - let _x: i32 = 99; - fallthrough_one_0(_x) - }) == (-1_i32)) - ); + assert!(((unsafe { fallthrough_one_0(1,) }) == (30))); + assert!(((unsafe { fallthrough_one_0(2,) }) == (20))); + assert!(((unsafe { fallthrough_one_0(99,) }) == (-1_i32))); return 0; } diff --git a/tests/unit/out/unsafe/switch_for_in_switch_break.rs b/tests/unit/out/unsafe/switch_for_in_switch_break.rs index 78b117d4..ef231435 100644 --- a/tests/unit/out/unsafe/switch_for_in_switch_break.rs +++ b/tests/unit/out/unsafe/switch_for_in_switch_break.rs @@ -37,17 +37,7 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _n: i32 = 0; - for_in_switch_break_0(_n) - }) == (103)) - ); - assert!( - ((unsafe { - let _n: i32 = 99; - for_in_switch_break_0(_n) - }) == (-1_i32)) - ); + assert!(((unsafe { for_in_switch_break_0(0,) }) == (103))); + assert!(((unsafe { for_in_switch_break_0(99,) }) == (-1_i32))); return 0; } diff --git a/tests/unit/out/unsafe/switch_for_in_switch_continue.rs b/tests/unit/out/unsafe/switch_for_in_switch_continue.rs index 91e5dd4f..dfa7c04b 100644 --- a/tests/unit/out/unsafe/switch_for_in_switch_continue.rs +++ b/tests/unit/out/unsafe/switch_for_in_switch_continue.rs @@ -37,17 +37,7 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _n: i32 = 0; - for_in_switch_continue_0(_n) - }) == (4)) - ); - assert!( - ((unsafe { - let _n: i32 = 99; - for_in_switch_continue_0(_n) - }) == (-1_i32)) - ); + assert!(((unsafe { for_in_switch_continue_0(0,) }) == (4))); + assert!(((unsafe { for_in_switch_continue_0(99,) }) == (-1_i32))); return 0; } diff --git a/tests/unit/out/unsafe/switch_for_switch_for_break.rs b/tests/unit/out/unsafe/switch_for_switch_for_break.rs index 245401fe..57082b04 100644 --- a/tests/unit/out/unsafe/switch_for_switch_for_break.rs +++ b/tests/unit/out/unsafe/switch_for_switch_for_break.rs @@ -41,11 +41,6 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _n: i32 = 3; - for_switch_for_break_0(_n) - }) == (122)) - ); + assert!(((unsafe { for_switch_for_break_0(3,) }) == (122))); return 0; } diff --git a/tests/unit/out/unsafe/switch_in_dowhile.rs b/tests/unit/out/unsafe/switch_in_dowhile.rs index a9b42531..aab80da6 100644 --- a/tests/unit/out/unsafe/switch_in_dowhile.rs +++ b/tests/unit/out/unsafe/switch_in_dowhile.rs @@ -39,17 +39,7 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _n: i32 = 1; - switch_in_dowhile_0(_n) - }) == (1)) - ); - assert!( - ((unsafe { - let _n: i32 = 3; - switch_in_dowhile_0(_n) - }) == (((1) + (10)) + (100))) - ); + assert!(((unsafe { switch_in_dowhile_0(1,) }) == (1))); + assert!(((unsafe { switch_in_dowhile_0(3,) }) == (((1) + (10)) + (100)))); return 0; } diff --git a/tests/unit/out/unsafe/switch_in_loop.rs b/tests/unit/out/unsafe/switch_in_loop.rs index d0746af1..21d41061 100644 --- a/tests/unit/out/unsafe/switch_in_loop.rs +++ b/tests/unit/out/unsafe/switch_in_loop.rs @@ -38,11 +38,6 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _n: i32 = 6; - switch_in_loop_0(_n) - }) == (72)) - ); + assert!(((unsafe { switch_in_loop_0(6,) }) == (72))); return 0; } diff --git a/tests/unit/out/unsafe/switch_mixed_literal_cases.rs b/tests/unit/out/unsafe/switch_mixed_literal_cases.rs index c791ff07..f79ad81f 100644 --- a/tests/unit/out/unsafe/switch_mixed_literal_cases.rs +++ b/tests/unit/out/unsafe/switch_mixed_literal_cases.rs @@ -41,29 +41,14 @@ unsafe fn main_0() -> i32 { mixed_literal_cases_0(_x) }) == (1)) ); - assert!( - ((unsafe { - let _x: i32 = 16; - mixed_literal_cases_0(_x) - }) == (2)) - ); - assert!( - ((unsafe { - let _x: i32 = 65152; - mixed_literal_cases_0(_x) - }) == (3)) - ); + assert!(((unsafe { mixed_literal_cases_0(16,) }) == (2))); + assert!(((unsafe { mixed_literal_cases_0(65152,) }) == (3))); assert!( ((unsafe { let _x: i32 = -255_i32; mixed_literal_cases_0(_x) }) == (4)) ); - assert!( - ((unsafe { - let _x: i32 = 7; - mixed_literal_cases_0(_x) - }) == (0)) - ); + assert!(((unsafe { mixed_literal_cases_0(7,) }) == (0))); return 0; } diff --git a/tests/unit/out/unsafe/switch_mixed_return_break.rs b/tests/unit/out/unsafe/switch_mixed_return_break.rs index 5f59a747..ee451f6c 100644 --- a/tests/unit/out/unsafe/switch_mixed_return_break.rs +++ b/tests/unit/out/unsafe/switch_mixed_return_break.rs @@ -35,29 +35,9 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 0; - mixed_return_break_0(_x) - }) == (100)) - ); - assert!( - ((unsafe { - let _x: i32 = 1; - mixed_return_break_0(_x) - }) == (10)) - ); - assert!( - ((unsafe { - let _x: i32 = 2; - mixed_return_break_0(_x) - }) == (200)) - ); - assert!( - ((unsafe { - let _x: i32 = 99; - mixed_return_break_0(_x) - }) == (99)) - ); + assert!(((unsafe { mixed_return_break_0(0,) }) == (100))); + assert!(((unsafe { mixed_return_break_0(1,) }) == (10))); + assert!(((unsafe { mixed_return_break_0(2,) }) == (200))); + assert!(((unsafe { mixed_return_break_0(99,) }) == (99))); return 0; } diff --git a/tests/unit/out/unsafe/switch_nested.rs b/tests/unit/out/unsafe/switch_nested.rs index 5335743f..fa89c0a2 100644 --- a/tests/unit/out/unsafe/switch_nested.rs +++ b/tests/unit/out/unsafe/switch_nested.rs @@ -50,33 +50,9 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _a: i32 = 1; - let _b: i32 = 10; - nested_0(_a, _b) - }) == (12)) - ); - assert!( - ((unsafe { - let _a: i32 = 1; - let _b: i32 = 99; - nested_0(_a, _b) - }) == (14)) - ); - assert!( - ((unsafe { - let _a: i32 = 2; - let _b: i32 = 0; - nested_0(_a, _b) - }) == (2)) - ); - assert!( - ((unsafe { - let _a: i32 = 3; - let _b: i32 = 3; - nested_0(_a, _b) - }) == (-1_i32)) - ); + assert!(((unsafe { nested_0(1, 10,) }) == (12))); + assert!(((unsafe { nested_0(1, 99,) }) == (14))); + assert!(((unsafe { nested_0(2, 0,) }) == (2))); + assert!(((unsafe { nested_0(3, 3,) }) == (-1_i32))); return 0; } diff --git a/tests/unit/out/unsafe/switch_no_default.rs b/tests/unit/out/unsafe/switch_no_default.rs index fa409611..abc23d70 100644 --- a/tests/unit/out/unsafe/switch_no_default.rs +++ b/tests/unit/out/unsafe/switch_no_default.rs @@ -30,17 +30,7 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 7; - no_default_0(_x) - }) == (1)) - ); - assert!( - ((unsafe { - let _x: i32 = 42; - no_default_0(_x) - }) == (-1_i32)) - ); + assert!(((unsafe { no_default_0(7,) }) == (1))); + assert!(((unsafe { no_default_0(42,) }) == (-1_i32))); return 0; } diff --git a/tests/unit/out/unsafe/switch_on_assignment.rs b/tests/unit/out/unsafe/switch_on_assignment.rs index 4011c7d4..5dd1b505 100644 --- a/tests/unit/out/unsafe/switch_on_assignment.rs +++ b/tests/unit/out/unsafe/switch_on_assignment.rs @@ -37,23 +37,8 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 0; - switch_on_assignment_0(_x) - }) == (10)) - ); - assert!( - ((unsafe { - let _x: i32 = 1; - switch_on_assignment_0(_x) - }) == (20)) - ); - assert!( - ((unsafe { - let _x: i32 = 9; - switch_on_assignment_0(_x) - }) == (10)) - ); + assert!(((unsafe { switch_on_assignment_0(0,) }) == (10))); + assert!(((unsafe { switch_on_assignment_0(1,) }) == (20))); + assert!(((unsafe { switch_on_assignment_0(9,) }) == (10))); return 0; } diff --git a/tests/unit/out/unsafe/switch_on_call.rs b/tests/unit/out/unsafe/switch_on_call.rs index c5f406ab..a1294d81 100644 --- a/tests/unit/out/unsafe/switch_on_call.rs +++ b/tests/unit/out/unsafe/switch_on_call.rs @@ -38,29 +38,9 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 0; - switch_on_call_1(_x) - }) == (100)) - ); - assert!( - ((unsafe { - let _x: i32 = 1; - switch_on_call_1(_x) - }) == (200)) - ); - assert!( - ((unsafe { - let _x: i32 = 2; - switch_on_call_1(_x) - }) == (400)) - ); - assert!( - ((unsafe { - let _x: i32 = 99; - switch_on_call_1(_x) - }) == (-1_i32)) - ); + assert!(((unsafe { switch_on_call_1(0,) }) == (100))); + assert!(((unsafe { switch_on_call_1(1,) }) == (200))); + assert!(((unsafe { switch_on_call_1(2,) }) == (400))); + assert!(((unsafe { switch_on_call_1(99,) }) == (-1_i32))); return 0; } diff --git a/tests/unit/out/unsafe/switch_only_default.rs b/tests/unit/out/unsafe/switch_only_default.rs index 8ac87ba4..bd23bb44 100644 --- a/tests/unit/out/unsafe/switch_only_default.rs +++ b/tests/unit/out/unsafe/switch_only_default.rs @@ -25,11 +25,6 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 1; - only_default_0(_x) - }) == (42)) - ); + assert!(((unsafe { only_default_0(1,) }) == (42))); return 0; } diff --git a/tests/unit/out/unsafe/switch_stacked.rs b/tests/unit/out/unsafe/switch_stacked.rs index 133db86a..eac997bf 100644 --- a/tests/unit/out/unsafe/switch_stacked.rs +++ b/tests/unit/out/unsafe/switch_stacked.rs @@ -33,29 +33,9 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 1; - stacked_0(_x) - }) == (100)) - ); - assert!( - ((unsafe { - let _x: i32 = 3; - stacked_0(_x) - }) == (100)) - ); - assert!( - ((unsafe { - let _x: i32 = 5; - stacked_0(_x) - }) == (200)) - ); - assert!( - ((unsafe { - let _x: i32 = 9; - stacked_0(_x) - }) == (300)) - ); + assert!(((unsafe { stacked_0(1,) }) == (100))); + assert!(((unsafe { stacked_0(3,) }) == (100))); + assert!(((unsafe { stacked_0(5,) }) == (200))); + assert!(((unsafe { stacked_0(9,) }) == (300))); return 0; } diff --git a/tests/unit/out/unsafe/switch_stacked_block.rs b/tests/unit/out/unsafe/switch_stacked_block.rs index f2358ad5..7e6db996 100644 --- a/tests/unit/out/unsafe/switch_stacked_block.rs +++ b/tests/unit/out/unsafe/switch_stacked_block.rs @@ -30,17 +30,7 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 2; - stacked_block_0(_x) - }) == (5)) - ); - assert!( - ((unsafe { - let _x: i32 = 9; - stacked_block_0(_x) - }) == (0)) - ); + assert!(((unsafe { stacked_block_0(2,) }) == (5))); + assert!(((unsafe { stacked_block_0(9,) }) == (0))); return 0; } diff --git a/tests/unit/out/unsafe/switch_stacked_with_inner_fallthrough.rs b/tests/unit/out/unsafe/switch_stacked_with_inner_fallthrough.rs index 3045d9a1..183bd893 100644 --- a/tests/unit/out/unsafe/switch_stacked_with_inner_fallthrough.rs +++ b/tests/unit/out/unsafe/switch_stacked_with_inner_fallthrough.rs @@ -28,26 +28,8 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _x: i32 = 1; - let _flag: i32 = 0; - stacked_with_inner_fallthrough_0(_x, _flag) - }) == (50)) - ); - assert!( - ((unsafe { - let _x: i32 = 2; - let _flag: i32 = 1; - stacked_with_inner_fallthrough_0(_x, _flag) - }) == (999)) - ); - assert!( - ((unsafe { - let _x: i32 = 99; - let _flag: i32 = 0; - stacked_with_inner_fallthrough_0(_x, _flag) - }) == (999)) - ); + assert!(((unsafe { stacked_with_inner_fallthrough_0(1, 0,) }) == (50))); + assert!(((unsafe { stacked_with_inner_fallthrough_0(2, 1,) }) == (999))); + assert!(((unsafe { stacked_with_inner_fallthrough_0(99, 0,) }) == (999))); return 0; } diff --git a/tests/unit/out/unsafe/switch_while_in_switch_break.rs b/tests/unit/out/unsafe/switch_while_in_switch_break.rs index 9a27d89a..36c4a664 100644 --- a/tests/unit/out/unsafe/switch_while_in_switch_break.rs +++ b/tests/unit/out/unsafe/switch_while_in_switch_break.rs @@ -37,17 +37,7 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - assert!( - ((unsafe { - let _n: i32 = 0; - while_in_switch_break_0(_n) - }) == (1006)) - ); - assert!( - ((unsafe { - let _n: i32 = 99; - while_in_switch_break_0(_n) - }) == (-1_i32)) - ); + assert!(((unsafe { while_in_switch_break_0(0,) }) == (1006))); + assert!(((unsafe { while_in_switch_break_0(99,) }) == (-1_i32))); return 0; } diff --git a/tests/unit/out/unsafe/templates.rs b/tests/unit/out/unsafe/templates.rs index b0594e8a..c3a2e329 100644 --- a/tests/unit/out/unsafe/templates.rs +++ b/tests/unit/out/unsafe/templates.rs @@ -42,24 +42,16 @@ unsafe fn main_0() -> i32 { })) + ((*(unsafe { let _p: *mut i32 = (&mut x as *mut i32); - let _flag: bool = true; - bar_2(_p, _flag) + bar_2(_p, true) })) as f64)) + (*(unsafe { let _p: *mut f64 = (&mut y as *mut f64); - let _flag: bool = true; - bar_3(_p, _flag) + bar_3(_p, true) }))) + + ((unsafe { func_4(1, 2, 3) }) as f64)) + ((unsafe { - let _x1: i32 = 1; - let _x2: i32 = 2; - let _x3: i32 = 3; - func_4(_x1, _x2, _x3) - }) as f64)) - + ((unsafe { - let _x1: f64 = 2.0E+0; let _x2: i32 = x; let _x3: f64 = y; - func_5(_x1, _x2, _x3) + func_5(2.0E+0, _x2, _x3) }) as f64)) as i32); } diff --git a/tests/unit/out/unsafe/union_void_ptr_sized_deref.rs b/tests/unit/out/unsafe/union_void_ptr_sized_deref.rs index 25afdaa7..1e8830a3 100644 --- a/tests/unit/out/unsafe/union_void_ptr_sized_deref.rs +++ b/tests/unit/out/unsafe/union_void_ptr_sized_deref.rs @@ -77,24 +77,21 @@ unsafe fn main_0() -> i32 { s.out.handle = ((&mut buf64 as *mut i64) as *mut i64 as *mut ::libc::c_void); (unsafe { let _s: *mut Sink = (&mut s as *mut Sink); - let _count: i64 = 1234605616436508552_i64; - write_count_1(_s, _count) + write_count_1(_s, 1234605616436508552_i64) }); assert!(((((buf64) == (1234605616436508552_i64)) as i32) != 0)); s.width = Width_enum::W_32; s.out.handle = ((&mut buf32 as *mut i32) as *mut i32 as *mut ::libc::c_void); (unsafe { let _s: *mut Sink = (&mut s as *mut Sink); - let _count: i64 = 305419896_i64; - write_count_1(_s, _count) + write_count_1(_s, 305419896_i64) }); assert!(((((buf32) == (305419896)) as i32) != 0)); s.width = Width_enum::W_16; s.out.handle = ((&mut buf16 as *mut i16) as *mut i16 as *mut ::libc::c_void); (unsafe { let _s: *mut Sink = (&mut s as *mut Sink); - let _count: i64 = 4660_i64; - write_count_1(_s, _count) + write_count_1(_s, 4660_i64) }); assert!(((((buf16 as i32) == (4660)) as i32) != 0)); return 0; diff --git a/tests/unit/out/unsafe/unique_ptr.rs b/tests/unit/out/unsafe/unique_ptr.rs index dba60cdd..35bf7bc9 100644 --- a/tests/unit/out/unsafe/unique_ptr.rs +++ b/tests/unit/out/unsafe/unique_ptr.rs @@ -48,10 +48,7 @@ pub unsafe fn DoStuffWithSafePointer_0(safe_ptr: *mut Option>) x: (*raw_ptr2), y: 5, })); - (unsafe { - let _k: i32 = 10; - (*pair.as_deref_mut().unwrap()).inc(_k) - }); + (unsafe { (*pair.as_deref_mut().unwrap()).inc(10) }); (*(*(*safe_ptr).as_deref_mut().unwrap()) .ptr .as_deref_mut() @@ -110,10 +107,7 @@ pub unsafe fn RndStuff_2() { 'loop_: while ((i) < (10)) { assert!((((*p3_0.offset((i) as isize)).x) == (1))); assert!((((*p3_0.offset((i) as isize)).y) == (2))); - (unsafe { - let _k: i32 = 10; - x3.as_mut().unwrap()[(i as u64) as usize].inc(_k) - }); + (unsafe { x3.as_mut().unwrap()[(i as u64) as usize].inc(10) }); assert!((((*p3_0.offset((i) as isize)).x) == (11))); assert!((((*p3_0.offset((i) as isize)).y) == (12))); i.prefix_inc(); diff --git a/tests/unit/out/unsafe/unique_ptr_const_deref.rs b/tests/unit/out/unsafe/unique_ptr_const_deref.rs index edf42cc6..1b8de4a5 100644 --- a/tests/unit/out/unsafe/unique_ptr_const_deref.rs +++ b/tests/unit/out/unsafe/unique_ptr_const_deref.rs @@ -31,8 +31,7 @@ unsafe fn main_0() -> i32 { h.val = Some(Box::new(10)); (unsafe { let _h: *const Holder = (&mut h as *mut Holder).cast_const(); - let _v: i32 = 42; - write_val_1(_h, _v) + write_val_1(_h, 42) }); return (unsafe { let _h: *const Holder = (&mut h as *mut Holder).cast_const(); diff --git a/tests/unit/out/unsafe/user_defined_same_as_libc.rs b/tests/unit/out/unsafe/user_defined_same_as_libc.rs index 6fe49b5f..c793ca05 100644 --- a/tests/unit/out/unsafe/user_defined_same_as_libc.rs +++ b/tests/unit/out/unsafe/user_defined_same_as_libc.rs @@ -18,9 +18,10 @@ pub fn main() { } unsafe fn main_0() -> i32 { let mut fp: *mut ::libc::FILE = (unsafe { - let _path: *const u8 = (b"/tmp/irrelevant-file\0".as_ptr().cast_mut()).cast_const(); - let _mode: *const u8 = (b"r\0".as_ptr().cast_mut()).cast_const(); - fopen_0(_path, _mode) + fopen_0( + (b"/tmp/irrelevant-file\0".as_ptr().cast_mut()).cast_const(), + (b"r\0".as_ptr().cast_mut()).cast_const(), + ) }); assert!(((((fp).is_null()) as i32) != 0)); return 0; diff --git a/tests/unit/out/unsafe/va_arg_chain.rs b/tests/unit/out/unsafe/va_arg_chain.rs index 711bded5..fe20ae0c 100644 --- a/tests/unit/out/unsafe/va_arg_chain.rs +++ b/tests/unit/out/unsafe/va_arg_chain.rs @@ -39,26 +39,14 @@ pub fn main() { unsafe fn main_0() -> i32 { assert!( ((((unsafe { - let _n: i32 = 2; - top_level_2( - _n, - &[(100).into(), (200).into(), (300).into(), (400).into()], - ) + top_level_2(2, &[(100).into(), (200).into(), (300).into(), (400).into()]) }) == (300)) as i32) != 0) ); + assert!(((((unsafe { top_level_2(0, &[(42).into(), (99).into(),]) }) == (42)) as i32) != 0)); assert!( - ((((unsafe { - let _n: i32 = 0; - top_level_2(_n, &[(42).into(), (99).into()]) - }) == (42)) as i32) - != 0) - ); - assert!( - ((((unsafe { - let _n: i32 = 3; - top_level_2(_n, &[(1).into(), (2).into(), (3).into(), (4).into()]) - }) == (4)) as i32) + ((((unsafe { top_level_2(3, &[(1).into(), (2).into(), (3).into(), (4).into(),]) }) == (4)) + as i32) != 0) ); return 0; diff --git a/tests/unit/out/unsafe/va_arg_concat.rs b/tests/unit/out/unsafe/va_arg_concat.rs index de8a33ca..37a60e62 100644 --- a/tests/unit/out/unsafe/va_arg_concat.rs +++ b/tests/unit/out/unsafe/va_arg_concat.rs @@ -28,24 +28,15 @@ pub fn main() { } unsafe fn main_0() -> i32 { assert!( - ((((unsafe { - let _first: i32 = 1; - sum_ints_0(_first, &[(2).into(), (3).into(), (4).into(), (0).into()]) - }) == (10)) as i32) - != 0) - ); - assert!( - ((((unsafe { - let _first: i32 = 100; - sum_ints_0(_first, &[(0).into()]) - }) == (100)) as i32) + ((((unsafe { sum_ints_0(1, &[(2).into(), (3).into(), (4).into(), (0).into(),]) }) == (10)) + as i32) != 0) ); + assert!(((((unsafe { sum_ints_0(100, &[(0).into(),]) }) == (100)) as i32) != 0)); assert!( ((((unsafe { - let _first: i32 = 5; sum_ints_0( - _first, + 5, &[(5).into(), (5).into(), (5).into(), (5).into(), (0).into()], ) }) == (25)) as i32) diff --git a/tests/unit/out/unsafe/va_arg_conditional.rs b/tests/unit/out/unsafe/va_arg_conditional.rs index 4c7a6816..67f560db 100644 --- a/tests/unit/out/unsafe/va_arg_conditional.rs +++ b/tests/unit/out/unsafe/va_arg_conditional.rs @@ -23,17 +23,21 @@ pub fn main() { unsafe fn main_0() -> i32 { assert!( ((((unsafe { - let _verbose: i32 = 1; - let _fmt: *const u8 = (b"%d\0".as_ptr().cast_mut()).cast_const(); - conditional_log_0(_verbose, _fmt, &[(42).into()]) + conditional_log_0( + 1, + (b"%d\0".as_ptr().cast_mut()).cast_const(), + &[(42).into()], + ) }) == (42)) as i32) != 0) ); assert!( ((((unsafe { - let _verbose: i32 = 0; - let _fmt: *const u8 = (b"%d\0".as_ptr().cast_mut()).cast_const(); - conditional_log_0(_verbose, _fmt, &[(99).into()]) + conditional_log_0( + 0, + (b"%d\0".as_ptr().cast_mut()).cast_const(), + &[(99).into()], + ) }) == (-1_i32)) as i32) != 0) ); diff --git a/tests/unit/out/unsafe/va_arg_copy.rs b/tests/unit/out/unsafe/va_arg_copy.rs index cda85224..6ddd53ea 100644 --- a/tests/unit/out/unsafe/va_arg_copy.rs +++ b/tests/unit/out/unsafe/va_arg_copy.rs @@ -33,10 +33,8 @@ pub fn main() { } unsafe fn main_0() -> i32 { assert!( - ((((unsafe { - let _count: i32 = 3; - sum_with_copy_0(_count, &[(10).into(), (20).into(), (30).into()]) - }) == (120)) as i32) + ((((unsafe { sum_with_copy_0(3, &[(10).into(), (20).into(), (30).into(),]) }) == (120)) + as i32) != 0) ); return 0; diff --git a/tests/unit/out/unsafe/va_arg_fn_ptr.rs b/tests/unit/out/unsafe/va_arg_fn_ptr.rs index 1c2ce83d..a69c7b59 100644 --- a/tests/unit/out/unsafe/va_arg_fn_ptr.rs +++ b/tests/unit/out/unsafe/va_arg_fn_ptr.rs @@ -50,9 +50,8 @@ pub fn main() { unsafe fn main_0() -> i32 { assert!( ((((unsafe { - let _x: i32 = 5; apply_unary_3( - _x, + 5, &[ (Some(square_0).map_or(::std::ptr::null_mut(), |f| f as *mut ::libc::c_void)) .into(), @@ -63,9 +62,8 @@ unsafe fn main_0() -> i32 { ); assert!( ((((unsafe { - let _x: i32 = 7; apply_unary_3( - _x, + 7, &[ (Some(negate_1).map_or(::std::ptr::null_mut(), |f| f as *mut ::libc::c_void)) .into(), @@ -76,11 +74,9 @@ unsafe fn main_0() -> i32 { ); assert!( ((((unsafe { - let _a: i32 = 3; - let _b: i32 = 4; apply_binary_4( - _a, - _b, + 3, + 4, &[ (Some(add_2).map_or(::std::ptr::null_mut(), |f| f as *mut ::libc::c_void)) .into(), diff --git a/tests/unit/out/unsafe/va_arg_forward.rs b/tests/unit/out/unsafe/va_arg_forward.rs index 62acfb6c..7368ed38 100644 --- a/tests/unit/out/unsafe/va_arg_forward.rs +++ b/tests/unit/out/unsafe/va_arg_forward.rs @@ -32,25 +32,10 @@ pub fn main() { } unsafe fn main_0() -> i32 { assert!( - ((((unsafe { - let _count: i32 = 3; - outer_1(_count, &[(10).into(), (20).into(), (30).into()]) - }) == (60)) as i32) - != 0) - ); - assert!( - ((((unsafe { - let _count: i32 = 1; - outer_1(_count, &[(42).into()]) - }) == (42)) as i32) - != 0) - ); - assert!( - ((((unsafe { - let _count: i32 = 0; - outer_1(_count, &[]) - }) == (0)) as i32) + ((((unsafe { outer_1(3, &[(10).into(), (20).into(), (30).into(),]) }) == (60)) as i32) != 0) ); + assert!(((((unsafe { outer_1(1, &[(42).into(),]) }) == (42)) as i32) != 0)); + assert!(((((unsafe { outer_1(0, &[]) }) == (0)) as i32) != 0)); return 0; } diff --git a/tests/unit/out/unsafe/va_arg_mixed_int_ptr.rs b/tests/unit/out/unsafe/va_arg_mixed_int_ptr.rs index 333b398f..bd810d5f 100644 --- a/tests/unit/out/unsafe/va_arg_mixed_int_ptr.rs +++ b/tests/unit/out/unsafe/va_arg_mixed_int_ptr.rs @@ -32,9 +32,8 @@ unsafe fn main_0() -> i32 { let mut x: i32 = 100; assert!( ((((unsafe { - let _count: i32 = 3; mixed_args_0( - _count, + 3, &[ (0).into(), (10).into(), @@ -49,17 +48,13 @@ unsafe fn main_0() -> i32 { ); let mut y: i32 = 50; assert!( - ((((unsafe { - let _count: i32 = 1; - mixed_args_0(_count, &[(1).into(), (&mut y as *mut i32).into()]) - }) == (50)) as i32) + ((((unsafe { mixed_args_0(1, &[(1).into(), (&mut y as *mut i32).into(),]) }) == (50)) + as i32) != 0) ); assert!( - ((((unsafe { - let _count: i32 = 2; - mixed_args_0(_count, &[(0).into(), (5).into(), (0).into(), (3).into()]) - }) == (8)) as i32) + ((((unsafe { mixed_args_0(2, &[(0).into(), (5).into(), (0).into(), (3).into(),]) }) == (8)) + as i32) != 0) ); return 0; diff --git a/tests/unit/out/unsafe/va_arg_mixed_types.rs b/tests/unit/out/unsafe/va_arg_mixed_types.rs index 3b929e12..fa4a9d2c 100644 --- a/tests/unit/out/unsafe/va_arg_mixed_types.rs +++ b/tests/unit/out/unsafe/va_arg_mixed_types.rs @@ -33,9 +33,8 @@ pub fn main() { unsafe fn main_0() -> i32 { assert!( ((((unsafe { - let _count: i32 = 3; sum_mixed_0( - _count, + 3, &[ (0).into(), (10).into(), @@ -48,18 +47,11 @@ unsafe fn main_0() -> i32 { }) == (60)) as i32) != 0) ); + assert!(((((unsafe { sum_mixed_0(1, &[(0).into(), (42).into(),]) }) == (42)) as i32) != 0)); assert!( ((((unsafe { - let _count: i32 = 1; - sum_mixed_0(_count, &[(0).into(), (42).into()]) - }) == (42)) as i32) - != 0) - ); - assert!( - ((((unsafe { - let _count: i32 = 2; sum_mixed_0( - _count, + 2, &[(1).into(), (3.7E+0).into(), (2).into(), (100_i64).into()], ) }) == (103)) as i32) diff --git a/tests/unit/out/unsafe/va_arg_null_int_ptr.rs b/tests/unit/out/unsafe/va_arg_null_int_ptr.rs index 8eeb0261..b9bd236d 100644 --- a/tests/unit/out/unsafe/va_arg_null_int_ptr.rs +++ b/tests/unit/out/unsafe/va_arg_null_int_ptr.rs @@ -30,9 +30,8 @@ unsafe fn main_0() -> i32 { let mut x: i32 = 42; assert!( ((((unsafe { - let _count: i32 = 2; first_nonnull_0( - _count, + 2, &[ (0 as *mut ::libc::c_void).into(), (&mut x as *mut i32).into(), @@ -43,9 +42,8 @@ unsafe fn main_0() -> i32 { ); assert!( ((((unsafe { - let _count: i32 = 3; first_nonnull_0( - _count, + 3, &[ (0 as *mut ::libc::c_void).into(), (0 as *mut ::libc::c_void).into(), @@ -56,10 +54,8 @@ unsafe fn main_0() -> i32 { != 0) ); assert!( - ((((unsafe { - let _count: i32 = 1; - first_nonnull_0(_count, &[(0 as *mut ::libc::c_void).into()]) - }) == (-1_i32)) as i32) + ((((unsafe { first_nonnull_0(1, &[(0 as *mut ::libc::c_void).into(),]) }) == (-1_i32)) + as i32) != 0) ); return 0; diff --git a/tests/unit/out/unsafe/va_arg_printf.rs b/tests/unit/out/unsafe/va_arg_printf.rs index 33cdcce4..a6de4724 100644 --- a/tests/unit/out/unsafe/va_arg_printf.rs +++ b/tests/unit/out/unsafe/va_arg_printf.rs @@ -29,9 +29,8 @@ unsafe fn main_0() -> i32 { let mut dummy: *const u8 = (b"dummy\0".as_ptr().cast_mut()).cast_const(); assert!( ((((unsafe { - let _fmt: *const u8 = (b"hello %d %d\0".as_ptr().cast_mut()).cast_const(); logf_1( - _fmt, + (b"hello %d %d\0".as_ptr().cast_mut()).cast_const(), &[ (10).into(), (libc::strlen(dummy as *const i8) as u64).into(), @@ -42,8 +41,10 @@ unsafe fn main_0() -> i32 { ); assert!( ((((unsafe { - let _fmt: *const u8 = (b"x %d %d\0".as_ptr().cast_mut()).cast_const(); - logf_1(_fmt, &[(1).into(), (2).into()]) + logf_1( + (b"x %d %d\0".as_ptr().cast_mut()).cast_const(), + &[(1).into(), (2).into()], + ) }) == (3)) as i32) != 0) ); diff --git a/tests/unit/out/unsafe/va_arg_promotion.rs b/tests/unit/out/unsafe/va_arg_promotion.rs index ddae810c..fca69dea 100644 --- a/tests/unit/out/unsafe/va_arg_promotion.rs +++ b/tests/unit/out/unsafe/va_arg_promotion.rs @@ -28,9 +28,8 @@ unsafe fn main_0() -> i32 { let mut z: f32 = 3.0E+0; assert!( ((((unsafe { - let _count: i32 = 3; test_promotions_0( - _count, + 3, &[(x as i32).into(), (y as i32).into(), (z as f64).into()], ) }) == (78)) as i32) diff --git a/tests/unit/out/unsafe/va_arg_snprintf.rs b/tests/unit/out/unsafe/va_arg_snprintf.rs index f4e6a8a6..6d79183b 100644 --- a/tests/unit/out/unsafe/va_arg_snprintf.rs +++ b/tests/unit/out/unsafe/va_arg_snprintf.rs @@ -28,9 +28,12 @@ unsafe fn main_0() -> i32 { assert!( ((((unsafe { let _buf: *mut u8 = buf.as_mut_ptr(); - let _size: i32 = 1; - let _fmt: *const u8 = (b"%d\0".as_ptr().cast_mut()).cast_const(); - extract_first_0(_buf, _size, _fmt, &[(42).into()]) + extract_first_0( + _buf, + 1, + (b"%d\0".as_ptr().cast_mut()).cast_const(), + &[(42).into()], + ) }) == (42)) as i32) != 0) ); @@ -38,9 +41,12 @@ unsafe fn main_0() -> i32 { assert!( ((((unsafe { let _buf: *mut u8 = buf.as_mut_ptr(); - let _size: i32 = 1; - let _fmt: *const u8 = (b"%d\0".as_ptr().cast_mut()).cast_const(); - extract_first_0(_buf, _size, _fmt, &[(65).into()]) + extract_first_0( + _buf, + 1, + (b"%d\0".as_ptr().cast_mut()).cast_const(), + &[(65).into()], + ) }) == (65)) as i32) != 0) ); diff --git a/tests/unit/out/unsafe/va_arg_struct_ctx.rs b/tests/unit/out/unsafe/va_arg_struct_ctx.rs index 8e73ec02..24147ba6 100644 --- a/tests/unit/out/unsafe/va_arg_struct_ctx.rs +++ b/tests/unit/out/unsafe/va_arg_struct_ctx.rs @@ -30,15 +30,21 @@ unsafe fn main_0() -> i32 { ctx.last_error = 0; (unsafe { let _ctx: *mut context = (&mut ctx as *mut context); - let _fmt: *const u8 = (b"error %d\0".as_ptr().cast_mut()).cast_const(); - set_error_0(_ctx, _fmt, &[(42).into()]) + set_error_0( + _ctx, + (b"error %d\0".as_ptr().cast_mut()).cast_const(), + &[(42).into()], + ) }); assert!(((((ctx.last_error) == (42)) as i32) != 0)); ctx.verbose = 0; (unsafe { let _ctx: *mut context = (&mut ctx as *mut context); - let _fmt: *const u8 = (b"error %d\0".as_ptr().cast_mut()).cast_const(); - set_error_0(_ctx, _fmt, &[(99).into()]) + set_error_0( + _ctx, + (b"error %d\0".as_ptr().cast_mut()).cast_const(), + &[(99).into()], + ) }); assert!(((((ctx.last_error) == (42)) as i32) != 0)); return 0; diff --git a/tests/unit/out/unsafe/va_arg_two_passes.rs b/tests/unit/out/unsafe/va_arg_two_passes.rs index 24b60846..bfbaf987 100644 --- a/tests/unit/out/unsafe/va_arg_two_passes.rs +++ b/tests/unit/out/unsafe/va_arg_two_passes.rs @@ -38,10 +38,8 @@ pub fn main() { } unsafe fn main_0() -> i32 { assert!( - ((((unsafe { - let _first: i32 = 2; - sum_then_product_0(_first, &[(3).into(), (4).into(), (0).into()]) - }) == (33)) as i32) + ((((unsafe { sum_then_product_0(2, &[(3).into(), (4).into(), (0).into(),]) }) == (33)) + as i32) != 0) ); return 0; diff --git a/tests/unit/out/unsafe/void_cast.rs b/tests/unit/out/unsafe/void_cast.rs index 1b4b5978..226850b4 100644 --- a/tests/unit/out/unsafe/void_cast.rs +++ b/tests/unit/out/unsafe/void_cast.rs @@ -36,10 +36,7 @@ pub fn main() { } } unsafe fn main_0() -> i32 { - (unsafe { - let _x: i32 = 42; - unused_param_0(_x) - }); + (unsafe { unused_param_0(42) }); let mut y: i32 = 5; &(y); let mut z: i32 = {