From ee6436ac921b2cf8cad339c3ee7394cff93cb078 Mon Sep 17 00:00:00 2001 From: Everett Hildenbrandt Date: Fri, 23 May 2025 18:38:47 +0000 Subject: [PATCH 01/12] src/printer: dump mangled name for json --- src/printer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/printer.rs b/src/printer.rs index bcecd44..a6b062b 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -412,8 +412,8 @@ fn fn_inst_sym<'tcx>( let internal_inst = rustc_internal::internal(tcx, inst); let sym_type = if inst.is_empty_shim() { NoOpSym(String::from("")) - } else if let Some(intrinsic_name) = inst.intrinsic_name() { - IntrinsicSym(intrinsic_name) + } else if let Some(_intrinsic_name) = inst.intrinsic_name() { + IntrinsicSym(inst.mangled_name()) } else { NormalSym(inst.mangled_name()) }; From 1a87359643fc07cd7684086767f2fabb65d47409 Mon Sep 17 00:00:00 2001 From: Everett Hildenbrandt Date: Fri, 23 May 2025 18:45:01 +0000 Subject: [PATCH 02/12] tests/integration: add test exercising cold_path --- .../programs/checked_arithmetic.rs | 21 + .../checked_arithmetic.smir.json.expected | 3705 +++++++++++++++++ 2 files changed, 3726 insertions(+) create mode 100644 tests/integration/programs/checked_arithmetic.rs create mode 100644 tests/integration/programs/checked_arithmetic.smir.json.expected diff --git a/tests/integration/programs/checked_arithmetic.rs b/tests/integration/programs/checked_arithmetic.rs new file mode 100644 index 0000000..a8ce467 --- /dev/null +++ b/tests/integration/programs/checked_arithmetic.rs @@ -0,0 +1,21 @@ +fn main() { + checked_add_i32(1,2); +} + +/// If the precondition is not met, the program is not executed (exits cleanly, ex falso quodlibet) +macro_rules! precondition { + ($pre:expr, $block:expr) => { + if $pre { $block } + }; +} + +fn checked_add_i32(a: i32, b: i32) { + + precondition!( + a.checked_add(b).is_some(), + unsafe { + let result = a.unchecked_add(b); + assert!(result as i64 == a as i64 + b as i64) + } + ); +} diff --git a/tests/integration/programs/checked_arithmetic.smir.json.expected b/tests/integration/programs/checked_arithmetic.smir.json.expected new file mode 100644 index 0000000..b169282 --- /dev/null +++ b/tests/integration/programs/checked_arithmetic.smir.json.expected @@ -0,0 +1,3705 @@ +{ + "allocs": [ + [ + { + "Memory": { + "align": 1, + "bytes": [ + 97, + 115, + 115, + 101, + 114, + 116, + 105, + 111, + 110, + 32, + 102, + 97, + 105, + 108, + 101, + 100, + 58, + 32, + 114, + 101, + 115, + 117, + 108, + 116, + 32, + 97, + 115, + 32, + 105, + 54, + 52, + 32, + 61, + 61, + 32, + 97, + 32, + 97, + 115, + 32, + 105, + 54, + 52, + 32, + 43, + 32, + 98, + 32, + 97, + 115, + 32, + 105, + 54, + 52 + ], + "mutability": "Not", + "provenance": { + "ptrs": [] + } + } + } + ], + [ + { + "Memory": { + "align": 1, + "bytes": [ + 117, + 110, + 115, + 97, + 102, + 101, + 32, + 112, + 114, + 101, + 99, + 111, + 110, + 100, + 105, + 116, + 105, + 111, + 110, + 40, + 115, + 41, + 32, + 118, + 105, + 111, + 108, + 97, + 116, + 101, + 100, + 58, + 32, + 105, + 51, + 50, + 58, + 58, + 117, + 110, + 99, + 104, + 101, + 99, + 107, + 101, + 100, + 95, + 97, + 100, + 100, + 32, + 99, + 97, + 110, + 110, + 111, + 116, + 32, + 111, + 118, + 101, + 114, + 102, + 108, + 111, + 119 + ], + "mutability": "Not", + "provenance": { + "ptrs": [] + } + } + } + ] + ], + "functions": [ + [ + { + "NormalSym": "_ZN3std2rt19lang_start_internal17h" + } + ], + [ + { + "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + } + ], + [ + { + "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + } + ], + [ + { + "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + } + ], + [ + { + "IntrinsicSym": "_ZN4core10intrinsics9black_box17h264fbed7175b8627E" + } + ], + [ + { + "IntrinsicSym": "_ZN4core10intrinsics9cold_path17hf51dae334946aea4E" + } + ], + [ + { + "NormalSym": "_ZN4core3num21_$LT$impl$u20$i32$GT$13unchecked_add18precondition_check17h" + } + ], + [ + { + "NormalSym": "_ZN4core9panicking14panic_nounwind17h" + } + ], + [ + { + "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + } + ], + [ + { + "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + } + ], + [ + { + "NormalSym": "_ZN18checked_arithmetic15checked_add_i3217h" + } + ], + [ + { + "NormalSym": "_ZN4core3num21_$LT$impl$u20$i32$GT$11checked_add17h" + } + ], + [ + { + "NormalSym": "_ZN4core6option15Option$LT$T$GT$7is_some17h" + } + ], + [ + { + "NormalSym": "_ZN4core3num21_$LT$impl$u20$i32$GT$13unchecked_add17h" + } + ], + [ + { + "NormalSym": "_ZN4core9panicking5panic17h" + } + ], + [ + { + "NoOpSym": "" + } + ] + ], + "items": [ + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Copy": { + "local": 2, + "projection": [] + } + } + ], + "destination": { + "local": 5, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 19, + "kind": "ZeroSized", + "ty": 35 + }, + "span": 109, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 110 + } + }, + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 5, + "projection": [] + } + ] + } + ] + }, + "span": 110 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 4, + "projection": [] + } + } + ], + "destination": { + "local": 3, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 20, + "kind": "ZeroSized", + "ty": 36 + }, + "span": 111, + "user_ty": null + } + }, + "target": 2, + "unwind": "Continue" + } + }, + "span": 112 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 3, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 7 + ] + ], + "otherwise": 3 + } + } + }, + "span": 112 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Copy": { + "local": 2, + "projection": [] + } + } + ], + "destination": { + "local": 6, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 21, + "kind": "ZeroSized", + "ty": 37 + }, + "span": 113, + "user_ty": null + } + }, + "target": 4, + "unwind": "Continue" + } + }, + "span": 114 + } + }, + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 8, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Copy": { + "local": 6, + "projection": [] + } + }, + 38 + ] + } + ] + }, + "span": 116 + }, + { + "kind": { + "Assign": [ + { + "local": 10, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Copy": { + "local": 1, + "projection": [] + } + }, + 38 + ] + } + ] + }, + "span": 117 + }, + { + "kind": { + "Assign": [ + { + "local": 11, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Copy": { + "local": 2, + "projection": [] + } + }, + 38 + ] + } + ] + }, + "span": 118 + }, + { + "kind": { + "Assign": [ + { + "local": 12, + "projection": [] + }, + { + "CheckedBinaryOp": [ + "Add", + { + "Copy": { + "local": 10, + "projection": [] + } + }, + { + "Copy": { + "local": 11, + "projection": [] + } + } + ] + } + ] + }, + "span": 115 + } + ], + "terminator": { + "kind": { + "Assert": { + "cond": { + "Move": { + "local": 12, + "projection": [ + { + "Field": [ + 1, + 21 + ] + } + ] + } + }, + "expected": false, + "msg": { + "Overflow": [ + "Add", + { + "Move": { + "local": 10, + "projection": [] + } + }, + { + "Move": { + "local": 11, + "projection": [] + } + } + ] + }, + "target": 5, + "unwind": "Continue" + } + }, + "span": 115 + } + }, + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 9, + "projection": [] + }, + { + "Use": { + "Move": { + "local": 12, + "projection": [ + { + "Field": [ + 0, + 38 + ] + } + ] + } + } + } + ] + }, + "span": 115 + }, + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "BinaryOp": [ + "Eq", + { + "Move": { + "local": 8, + "projection": [] + } + }, + { + "Move": { + "local": 9, + "projection": [] + } + } + ] + } + ] + }, + "span": 119 + } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 7, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 6 + ] + ], + "otherwise": 7 + } + } + }, + "span": 119 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 23, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 54, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 1 + ] + ] + } + } + }, + "ty": 27 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 13, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 22, + "kind": "ZeroSized", + "ty": 39 + }, + "span": 120, + "user_ty": null + } + }, + "target": null, + "unwind": "Continue" + } + }, + "span": 120 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 121 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 122, + "ty": 1 + }, + { + "mutability": "Not", + "span": 123, + "ty": 16 + }, + { + "mutability": "Not", + "span": 124, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 112, + "ty": 21 + }, + { + "mutability": "Mut", + "span": 110, + "ty": 33 + }, + { + "mutability": "Not", + "span": 110, + "ty": 23 + }, + { + "mutability": "Not", + "span": 125, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 119, + "ty": 21 + }, + { + "mutability": "Mut", + "span": 116, + "ty": 38 + }, + { + "mutability": "Mut", + "span": 115, + "ty": 38 + }, + { + "mutability": "Mut", + "span": 117, + "ty": 38 + }, + { + "mutability": "Mut", + "span": 118, + "ty": 38 + }, + { + "mutability": "Mut", + "span": 115, + "ty": 40 + }, + { + "mutability": "Mut", + "span": 120, + "ty": 28 + } + ], + "span": 126, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "a", + "source_info": { + "scope": 0, + "span": 123 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "b", + "source_info": { + "scope": 0, + "span": 124 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 125 + }, + "value": { + "Place": { + "local": 6, + "projection": [] + } + } + } + ] + }, + "id": 13, + "name": "checked_add_i32" + } + }, + "symbol_name": "_ZN18checked_arithmetic15checked_add_i3217h" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 0, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 17, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 103, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 18, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 2, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 104, + "user_ty": null + } + } + ], + "destination": { + "local": 1, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 16, + "kind": "ZeroSized", + "ty": 34 + }, + "span": 102, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 105 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 106 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 107, + "ty": 1 + }, + { + "mutability": "Not", + "span": 105, + "ty": 1 + } + ], + "span": 108, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 12, + "name": "main" + } + }, + "symbol_name": "_ZN18checked_arithmetic4main17h" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 4, + "blocks": [ + { + "statements": [ + { + "kind": { + "StorageLive": 5 + }, + "span": 1 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 8, + "projection": [] + }, + { + "Aggregate": [ + { + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] + }, + [ + { + "Copy": { + "local": 1, + "projection": [] + } + } + ] + ] + } + ] + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] + } + ] + } + ] + }, + "span": 2 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Cast": [ + { + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, + "projection": [] + } + }, + 5 + ] + } + ] + }, + "span": 2 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 6, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] + } + } + ], + "destination": { + "local": 5, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 0, + "kind": "ZeroSized", + "ty": 0 + }, + "span": 0, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 1 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 6 + }, + "span": 5 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 + }, + { + "Field": [ + 0, + 6 + ] + } + ] + } + } + } + ] + }, + "span": 6 + }, + { + "kind": { + "StorageDead": 8 + }, + "span": 7 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 7 + } + ], + "terminator": { + "kind": "Return", + "span": 4 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 8, + "ty": 6 + }, + { + "mutability": "Not", + "span": 9, + "ty": 7 + }, + { + "mutability": "Not", + "span": 10, + "ty": 6 + }, + { + "mutability": "Not", + "span": 11, + "ty": 8 + }, + { + "mutability": "Not", + "span": 12, + "ty": 9 + }, + { + "mutability": "Mut", + "span": 1, + "ty": 10 + }, + { + "mutability": "Mut", + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 + } + ], + "span": 13, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "argc", + "source_info": { + "scope": 0, + "span": 10 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 3, + "composite": null, + "name": "argv", + "source_info": { + "scope": 0, + "span": 11 + }, + "value": { + "Place": { + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + } + ] + }, + "id": 0, + "name": "std::rt::lang_start::<()>" + } + }, + "symbol_name": "_ZN3std2rt10lang_start17h" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + } + ] + }, + "span": 17 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 4, + "projection": [] + } + } + ], + "destination": { + "local": 3, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 1, + "kind": "ZeroSized", + "ty": 13 + }, + "span": 14, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 15 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 4 + }, + "span": 19 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 3, + "projection": [] + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 2, + "kind": "ZeroSized", + "ty": 14 + }, + "span": 18, + "user_ty": null + } + }, + "target": 2, + "unwind": "Continue" + } + }, + "span": 16 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] + } + ] + } + ] + }, + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + }, + { + "Field": [ + 0, + 9 + ] + } + ] + } + } + } + ] + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] + } + ] + }, + "span": 24 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 + } + ], + "terminator": { + "kind": "Return", + "span": 20 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 28, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 3, + "ty": 11 + }, + { + "mutability": "Mut", + "span": 16, + "ty": 17 + }, + { + "mutability": "Mut", + "span": 15, + "ty": 1 + }, + { + "mutability": "Mut", + "span": 17, + "ty": 7 + }, + { + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 + } + ], + "span": 3, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": null, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 29 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } + } + ] + }, + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" + } + }, + "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 1, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 3, + "kind": "ZeroSized", + "ty": 19 + }, + "span": 31, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 33 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 5, + "kind": "ZeroSized", + "ty": 20 + }, + "span": 34, + "user_ty": null + } + }, + "target": 2, + "unwind": "Unreachable" + } + }, + "span": 35 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 36 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 37, + "ty": 1 + }, + { + "mutability": "Not", + "span": 38, + "ty": 7 + }, + { + "mutability": "Not", + "span": 39, + "ty": 1 + } + ], + "span": 42, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "f", + "source_info": { + "scope": 0, + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 40 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "dummy", + "source_info": { + "scope": 2, + "span": 41 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" + } + }, + "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 0, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 + } + ], + "span": 45, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 3, + "name": "std::intrinsics::cold_path" + } + }, + "symbol_name": "_ZN4core10intrinsics9cold_path17h" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ + { + "kind": { + "StorageLive": 5 + }, + "span": 47 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "CheckedBinaryOp": [ + "Add", + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Copy": { + "local": 2, + "projection": [] + } + } + ] + } + ] + }, + "span": 47 + }, + { + "kind": { + "Assign": [ + { + "local": 3, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Field": [ + 0, + 16 + ] + } + ] + } + } + } + ] + }, + "span": 48 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Field": [ + 1, + 21 + ] + } + ] + } + } + } + ] + }, + "span": 49 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 50 + } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Copy": { + "local": 4, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 4 + ] + ], + "otherwise": 2 + } + } + }, + "span": 46 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 51 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 6, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 6, + "kind": "ZeroSized", + "ty": 22 + }, + "span": 52, + "user_ty": null + } + }, + "target": 3, + "unwind": "Unreachable" + } + }, + "span": 53 + } + }, + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 7, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 0, + 0, + 0, + 0, + null, + null, + null, + null + ], + "mutability": "Not", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 23 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "span": 55 + } + ], + "terminator": { + "kind": { + "Goto": { + "target": 1 + } + }, + "span": 54 + } + }, + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Aggregate": [ + { + "Adt": [ + 5, + 1, + [ + { + "Type": 16 + } + ], + null, + null + ] + }, + [ + { + "Copy": { + "local": 3, + "projection": [] + } + } + ] + ] + } + ] + }, + "span": 56 + } + ], + "terminator": { + "kind": { + "Goto": { + "target": 1 + } + }, + "span": 54 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 57, + "ty": 23 + }, + { + "mutability": "Not", + "span": 58, + "ty": 16 + }, + { + "mutability": "Not", + "span": 59, + "ty": 16 + }, + { + "mutability": "Not", + "span": 48, + "ty": 16 + }, + { + "mutability": "Not", + "span": 49, + "ty": 21 + }, + { + "mutability": "Mut", + "span": 47, + "ty": 24 + }, + { + "mutability": "Not", + "span": 53, + "ty": 1 + } + ], + "span": 65, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 58 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "rhs", + "source_info": { + "scope": 0, + "span": 59 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "a", + "source_info": { + "scope": 1, + "span": 60 + }, + "value": { + "Place": { + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "b", + "source_info": { + "scope": 1, + "span": 61 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 62 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "rhs", + "source_info": { + "scope": 2, + "span": 63 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "a", + "source_info": { + "scope": 3, + "span": 48 + }, + "value": { + "Place": { + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "b", + "source_info": { + "scope": 3, + "span": 49 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "b", + "source_info": { + "scope": 4, + "span": 64 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + } + ] + }, + "id": 4, + "name": "core::num::::checked_add" + } + }, + "symbol_name": "_ZN4core3num21_$LT$impl$u20$i32$GT$11checked_add17h" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ + { + "kind": { + "StorageLive": 3 + }, + "span": 66 + }, + { + "kind": { + "Assign": [ + { + "local": 3, + "projection": [] + }, + { + "NullaryOp": [ + "UbChecks", + 21 + ] + } + ] + }, + "span": 67 + } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 3, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 2 + ] + ], + "otherwise": 1 + } + } + }, + "span": 66 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Copy": { + "local": 2, + "projection": [] + } + } + ], + "destination": { + "local": 4, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 8, + "kind": "ZeroSized", + "ty": 25 + }, + "span": 68, + "user_ty": null + } + }, + "target": 2, + "unwind": "Unreachable" + } + }, + "span": 69 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 71 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "BinaryOp": [ + "AddUnchecked", + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Copy": { + "local": 2, + "projection": [] + } + } + ] + } + ] + }, + "span": 72 + } + ], + "terminator": { + "kind": "Return", + "span": 70 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 73, + "ty": 16 + }, + { + "mutability": "Not", + "span": 74, + "ty": 16 + }, + { + "mutability": "Not", + "span": 75, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 66, + "ty": 21 + }, + { + "mutability": "Not", + "span": 69, + "ty": 1 + } + ], + "span": 76, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 74 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "rhs", + "source_info": { + "scope": 0, + "span": 75 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + } + ] + }, + "id": 6, + "name": "core::num::::unchecked_add" + } + }, + "symbol_name": "_ZN4core3num21_$LT$impl$u20$i32$GT$13unchecked_add17h" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ + { + "kind": { + "StorageLive": 4 + }, + "span": 78 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 47 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "CheckedBinaryOp": [ + "Add", + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Copy": { + "local": 2, + "projection": [] + } + } + ] + } + ] + }, + "span": 47 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 6, + "projection": [ + { + "Field": [ + 0, + 16 + ] + } + ] + } + } + } + ] + }, + "span": 48 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 6, + "projection": [ + { + "Field": [ + 1, + 21 + ] + } + ] + } + } + } + ] + }, + "span": 49 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 50 + }, + { + "kind": { + "StorageDead": 4 + }, + "span": 78 + } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Copy": { + "local": 5, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 2 + ] + ], + "otherwise": 1 + } + } + }, + "span": 77 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 67, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 0 + ] + ] + } + } + }, + "ty": 27 + }, + "span": 80, + "user_ty": null + } + } + ], + "destination": { + "local": 3, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 9, + "kind": "ZeroSized", + "ty": 26 + }, + "span": 79, + "user_ty": null + } + }, + "target": null, + "unwind": "Unreachable" + } + }, + "span": 81 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 82 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 83, + "ty": 1 + }, + { + "mutability": "Not", + "span": 84, + "ty": 16 + }, + { + "mutability": "Not", + "span": 84, + "ty": 16 + }, + { + "mutability": "Not", + "span": 81, + "ty": 28 + }, + { + "mutability": "Not", + "span": 48, + "ty": 16 + }, + { + "mutability": "Not", + "span": 49, + "ty": 21 + }, + { + "mutability": "Mut", + "span": 47, + "ty": 24 + } + ], + "span": 85, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "lhs", + "source_info": { + "scope": 0, + "span": 84 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "rhs", + "source_info": { + "scope": 0, + "span": 84 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 62 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "rhs", + "source_info": { + "scope": 1, + "span": 63 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "a", + "source_info": { + "scope": 2, + "span": 48 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "b", + "source_info": { + "scope": 2, + "span": 49 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } + } + ] + }, + "id": 7, + "name": "core::num::::unchecked_add::precondition_check" + } + }, + "symbol_name": "_ZN4core3num21_$LT$impl$u20$i32$GT$13unchecked_add18precondition_check17h" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + } + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 11, + "kind": "ZeroSized", + "ty": 29 + }, + "span": 86, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 86 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 86 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 86, + "ty": 16 + }, + { + "mutability": "Not", + "span": 86, + "ty": 30 + }, + { + "mutability": "Not", + "span": 86, + "ty": 1 + } + ], + "span": 86, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 8, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 3, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + { + "Mut": { + "kind": "Default" + } + }, + { + "local": 1, + "projection": [] + } + ] + } + ] + }, + "span": 86 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + } + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 12, + "kind": "ZeroSized", + "ty": 31 + }, + "span": 86, + "user_ty": null + } + }, + "target": 1, + "unwind": { + "Cleanup": 3 + } + } + }, + "span": 86 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, + "unwind": "Continue" + } + }, + "span": 86 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 86 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } + }, + "span": 86 + } + }, + { + "statements": [], + "terminator": { + "kind": "Resume", + "span": 86 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 86, + "ty": 16 + }, + { + "mutability": "Not", + "span": 86, + "ty": 12 + }, + { + "mutability": "Not", + "span": 86, + "ty": 1 + }, + { + "mutability": "Not", + "span": 86, + "ty": 32 + } + ], + "span": 86, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 8, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, + "projection": [] + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 86 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 86 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 86, + "ty": 1 + }, + { + "mutability": "Not", + "span": 86, + "ty": 7 + }, + { + "mutability": "Not", + "span": 86, + "ty": 1 + } + ], + "span": 86, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 8, + "name": ">::call_once" + } + }, + "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 87 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 87, + "ty": 1 + }, + { + "mutability": "Not", + "span": 87, + "ty": 30 + } + ], + "span": 87, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 9, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 2, + "projection": [] + }, + { + "Discriminant": { + "local": 1, + "projection": [ + "Deref" + ] + } + } + ] + }, + "span": 89 + } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 2, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 1, + 2 + ], + [ + 0, + 1 + ] + ], + "otherwise": 4 + } + } + }, + "span": 88 + } + }, + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 13, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 21 + }, + "span": 90, + "user_ty": null + } + } + } + ] + }, + "span": 90 + } + ], + "terminator": { + "kind": { + "Goto": { + "target": 3 + } + }, + "span": 90 + } + }, + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 14, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 1 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 21 + }, + "span": 91, + "user_ty": null + } + } + } + ] + }, + "span": 91 + } + ], + "terminator": { + "kind": { + "Goto": { + "target": 3 + } + }, + "span": 91 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 92 + } + }, + { + "statements": [], + "terminator": { + "kind": "Unreachable", + "span": 93 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 94, + "ty": 21 + }, + { + "mutability": "Not", + "span": 95, + "ty": 33 + }, + { + "mutability": "Mut", + "span": 96, + "ty": 6 + } + ], + "span": 93, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 95 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + } + ] + }, + "id": 10, + "name": "std::option::Option::::is_some" + } + }, + "symbol_name": "_ZN4core6option15Option$LT$T$GT$7is_some17h" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 15, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 17 + }, + "span": 98, + "user_ty": null + } + } + } + ] + }, + "span": 98 + } + ], + "terminator": { + "kind": "Return", + "span": 97 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 99, + "ty": 17 + }, + { + "mutability": "Not", + "span": 100, + "ty": 1 + } + ], + "span": 101, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 100 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 11, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + } + ], + "types": [ + [ + { + "PrimitiveType": "Bool" + } + ], + [ + { + "PrimitiveType": "Str" + } + ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": { + "Int": "I64" + } + } + ], + [ + { + "PrimitiveType": { + "Int": "Isize" + } + } + ], + [ + { + "PrimitiveType": { + "Uint": "U8" + } + } + ], + [ + { + "EnumType": { + "discriminants": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "name": "std::option::Option" + } + } + ], + [ + { + "EnumType": { + "discriminants": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "name": "std::result::Result" + } + } + ], + [ + { + "StructType": { + "fields": "elided", + "name": "std::panic::Location" + } + } + ], + [ + { + "StructType": { + "fields": "elided", + "name": "std::process::ExitCode" + } + } + ], + [ + { + "StructType": { + "fields": "elided", + "name": "std::sys::pal::unix::process::process_common::ExitCode" + } + } + ], + [ + { + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ] + ] +} From 4dad2e50e825a9e42e7b8117f83bcc7867cd8b41 Mon Sep 17 00:00:00 2001 From: Everett Hildenbrandt Date: Fri, 23 May 2025 18:45:16 +0000 Subject: [PATCH 03/12] tests/integration: update expected output --- tests/integration/programs/assert_eq.smir.json.expected | 2 +- tests/integration/programs/binop.smir.json.expected | 2 +- tests/integration/programs/char-trivial.smir.json.expected | 2 +- tests/integration/programs/closure-args.smir.json.expected | 2 +- tests/integration/programs/closure-no-args.smir.json.expected | 2 +- .../programs/const-arithm-simple.smir.json.expected | 2 +- tests/integration/programs/div.smir.json.expected | 2 +- .../integration/programs/double-ref-deref.smir.json.expected | 2 +- tests/integration/programs/enum.smir.json.expected | 2 +- tests/integration/programs/fibonacci.smir.json.expected | 2 +- tests/integration/programs/float.smir.json.expected | 2 +- tests/integration/programs/modulo.smir.json.expected | 2 +- .../integration/programs/mutual_recursion.smir.json.expected | 2 +- .../programs/option-construction.smir.json.expected | 2 +- .../programs/primitive-type-bounds.smir.json.expected | 2 +- .../programs/recursion-simple-match.smir.json.expected | 2 +- .../integration/programs/recursion-simple.smir.json.expected | 2 +- tests/integration/programs/ref-deref.smir.json.expected | 2 +- tests/integration/programs/shl_min.smir.json.expected | 2 +- tests/integration/programs/slice.smir.json.expected | 4 ++-- .../integration/programs/strange-ref-deref.smir.json.expected | 2 +- tests/integration/programs/struct.smir.json.expected | 2 +- tests/integration/programs/sum-to-n.smir.json.expected | 2 +- tests/integration/programs/tuple-eq.smir.json.expected | 2 +- tests/integration/programs/tuples-simple.smir.json.expected | 2 +- 25 files changed, 26 insertions(+), 26 deletions(-) diff --git a/tests/integration/programs/assert_eq.smir.json.expected b/tests/integration/programs/assert_eq.smir.json.expected index b1b9e52..c73ba0a 100644 --- a/tests/integration/programs/assert_eq.smir.json.expected +++ b/tests/integration/programs/assert_eq.smir.json.expected @@ -23,7 +23,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17h422cafb34137ccebE" } ], [ diff --git a/tests/integration/programs/binop.smir.json.expected b/tests/integration/programs/binop.smir.json.expected index 2edfbc7..69d05bb 100644 --- a/tests/integration/programs/binop.smir.json.expected +++ b/tests/integration/programs/binop.smir.json.expected @@ -1127,7 +1127,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17h241585995e0a474bE" } ], [ diff --git a/tests/integration/programs/char-trivial.smir.json.expected b/tests/integration/programs/char-trivial.smir.json.expected index 04ca180..8823cec 100644 --- a/tests/integration/programs/char-trivial.smir.json.expected +++ b/tests/integration/programs/char-trivial.smir.json.expected @@ -63,7 +63,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17ha16ea91007d49fe5E" } ], [ diff --git a/tests/integration/programs/closure-args.smir.json.expected b/tests/integration/programs/closure-args.smir.json.expected index 9c34168..9d606bc 100644 --- a/tests/integration/programs/closure-args.smir.json.expected +++ b/tests/integration/programs/closure-args.smir.json.expected @@ -72,7 +72,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17h3aa5de4463bc0661E" } ], [ diff --git a/tests/integration/programs/closure-no-args.smir.json.expected b/tests/integration/programs/closure-no-args.smir.json.expected index 642f5af..b236bc3 100644 --- a/tests/integration/programs/closure-no-args.smir.json.expected +++ b/tests/integration/programs/closure-no-args.smir.json.expected @@ -66,7 +66,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17hbf338400c1894304E" } ], [ diff --git a/tests/integration/programs/const-arithm-simple.smir.json.expected b/tests/integration/programs/const-arithm-simple.smir.json.expected index 4017f61..71c40db 100644 --- a/tests/integration/programs/const-arithm-simple.smir.json.expected +++ b/tests/integration/programs/const-arithm-simple.smir.json.expected @@ -56,7 +56,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17h391cc993d03dc5f6E" } ], [ diff --git a/tests/integration/programs/div.smir.json.expected b/tests/integration/programs/div.smir.json.expected index 0378460..ff4ae27 100644 --- a/tests/integration/programs/div.smir.json.expected +++ b/tests/integration/programs/div.smir.json.expected @@ -69,7 +69,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17he93d51ca0987a8a7E" } ], [ diff --git a/tests/integration/programs/double-ref-deref.smir.json.expected b/tests/integration/programs/double-ref-deref.smir.json.expected index 5d7f7fc..94baeea 100644 --- a/tests/integration/programs/double-ref-deref.smir.json.expected +++ b/tests/integration/programs/double-ref-deref.smir.json.expected @@ -64,7 +64,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17h00f7118557981147E" } ], [ diff --git a/tests/integration/programs/enum.smir.json.expected b/tests/integration/programs/enum.smir.json.expected index 9e42375..5ca5bd4 100644 --- a/tests/integration/programs/enum.smir.json.expected +++ b/tests/integration/programs/enum.smir.json.expected @@ -23,7 +23,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17hcfe6ff2b60e0659bE" } ], [ diff --git a/tests/integration/programs/fibonacci.smir.json.expected b/tests/integration/programs/fibonacci.smir.json.expected index 4dadef9..17dfd15 100644 --- a/tests/integration/programs/fibonacci.smir.json.expected +++ b/tests/integration/programs/fibonacci.smir.json.expected @@ -63,7 +63,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17h709d6c5a599a175bE" } ], [ diff --git a/tests/integration/programs/float.smir.json.expected b/tests/integration/programs/float.smir.json.expected index a47af87..b8c08ef 100644 --- a/tests/integration/programs/float.smir.json.expected +++ b/tests/integration/programs/float.smir.json.expected @@ -110,7 +110,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17hd0067deb00467d1eE" } ], [ diff --git a/tests/integration/programs/modulo.smir.json.expected b/tests/integration/programs/modulo.smir.json.expected index 27f0fde..837f6e5 100644 --- a/tests/integration/programs/modulo.smir.json.expected +++ b/tests/integration/programs/modulo.smir.json.expected @@ -67,7 +67,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17h6d8a95155536c7a5E" } ], [ diff --git a/tests/integration/programs/mutual_recursion.smir.json.expected b/tests/integration/programs/mutual_recursion.smir.json.expected index a8616e2..e6b347b 100644 --- a/tests/integration/programs/mutual_recursion.smir.json.expected +++ b/tests/integration/programs/mutual_recursion.smir.json.expected @@ -66,7 +66,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17h6276fda256daf032E" } ], [ diff --git a/tests/integration/programs/option-construction.smir.json.expected b/tests/integration/programs/option-construction.smir.json.expected index 117471f..87f2c7d 100644 --- a/tests/integration/programs/option-construction.smir.json.expected +++ b/tests/integration/programs/option-construction.smir.json.expected @@ -23,7 +23,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17h4d94af3175a49dd5E" } ], [ diff --git a/tests/integration/programs/primitive-type-bounds.smir.json.expected b/tests/integration/programs/primitive-type-bounds.smir.json.expected index c3bd408..914d463 100644 --- a/tests/integration/programs/primitive-type-bounds.smir.json.expected +++ b/tests/integration/programs/primitive-type-bounds.smir.json.expected @@ -61,7 +61,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17hef36cab61d18ff7aE" } ], [ diff --git a/tests/integration/programs/recursion-simple-match.smir.json.expected b/tests/integration/programs/recursion-simple-match.smir.json.expected index b867356..7c83395 100644 --- a/tests/integration/programs/recursion-simple-match.smir.json.expected +++ b/tests/integration/programs/recursion-simple-match.smir.json.expected @@ -64,7 +64,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17hbb3607ac69f14664E" } ], [ diff --git a/tests/integration/programs/recursion-simple.smir.json.expected b/tests/integration/programs/recursion-simple.smir.json.expected index 82c7323..919e435 100644 --- a/tests/integration/programs/recursion-simple.smir.json.expected +++ b/tests/integration/programs/recursion-simple.smir.json.expected @@ -64,7 +64,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17h2e645b1867a314c1E" } ], [ diff --git a/tests/integration/programs/ref-deref.smir.json.expected b/tests/integration/programs/ref-deref.smir.json.expected index e3f520e..9707336 100644 --- a/tests/integration/programs/ref-deref.smir.json.expected +++ b/tests/integration/programs/ref-deref.smir.json.expected @@ -62,7 +62,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17h3a4f306e74a8f932E" } ], [ diff --git a/tests/integration/programs/shl_min.smir.json.expected b/tests/integration/programs/shl_min.smir.json.expected index 2e37932..ac646c4 100644 --- a/tests/integration/programs/shl_min.smir.json.expected +++ b/tests/integration/programs/shl_min.smir.json.expected @@ -330,7 +330,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17hc474a1f231ffa8ebE" } ], [ diff --git a/tests/integration/programs/slice.smir.json.expected b/tests/integration/programs/slice.smir.json.expected index 052ee0e..cbf1a43 100644 --- a/tests/integration/programs/slice.smir.json.expected +++ b/tests/integration/programs/slice.smir.json.expected @@ -97,7 +97,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17hb31027c02ee3a17bE" } ], [ @@ -132,7 +132,7 @@ ], [ { - "IntrinsicSym": "raw_eq" + "IntrinsicSym": "_ZN4core10intrinsics6raw_eq17h56b82731e6ecdd06E" } ], [ diff --git a/tests/integration/programs/strange-ref-deref.smir.json.expected b/tests/integration/programs/strange-ref-deref.smir.json.expected index 9e0e99a..8250aad 100644 --- a/tests/integration/programs/strange-ref-deref.smir.json.expected +++ b/tests/integration/programs/strange-ref-deref.smir.json.expected @@ -63,7 +63,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17ha7d224fd12b7abb0E" } ], [ diff --git a/tests/integration/programs/struct.smir.json.expected b/tests/integration/programs/struct.smir.json.expected index fd1ec2c..08b7588 100644 --- a/tests/integration/programs/struct.smir.json.expected +++ b/tests/integration/programs/struct.smir.json.expected @@ -69,7 +69,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17hc7a573f7e71a7cefE" } ], [ diff --git a/tests/integration/programs/sum-to-n.smir.json.expected b/tests/integration/programs/sum-to-n.smir.json.expected index b52b5d9..b61f6c0 100644 --- a/tests/integration/programs/sum-to-n.smir.json.expected +++ b/tests/integration/programs/sum-to-n.smir.json.expected @@ -61,7 +61,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17h3017e6b5a4bf14a5E" } ], [ diff --git a/tests/integration/programs/tuple-eq.smir.json.expected b/tests/integration/programs/tuple-eq.smir.json.expected index ba0c1e3..7c83625 100644 --- a/tests/integration/programs/tuple-eq.smir.json.expected +++ b/tests/integration/programs/tuple-eq.smir.json.expected @@ -91,7 +91,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17h30c7811834fd88c0E" } ], [ diff --git a/tests/integration/programs/tuples-simple.smir.json.expected b/tests/integration/programs/tuples-simple.smir.json.expected index 55ffc13..ea9e84e 100644 --- a/tests/integration/programs/tuples-simple.smir.json.expected +++ b/tests/integration/programs/tuples-simple.smir.json.expected @@ -69,7 +69,7 @@ ], [ { - "IntrinsicSym": "black_box" + "IntrinsicSym": "_ZN4core10intrinsics9black_box17hc1f9cf2af38719e2E" } ], [ From 505e6d4185c2190dadbf8ca9e65dd8cd4657d083 Mon Sep 17 00:00:00 2001 From: Everett Hildenbrandt Date: Fri, 23 May 2025 19:07:31 +0000 Subject: [PATCH 04/12] Cargo.toml, Cargo.lock: add rustc_demangle --- Cargo.lock | 7 +++++++ Cargo.toml | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 885c0ab..0e82c4d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,6 +23,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + [[package]] name = "stable_mir_json" version = "0.1.0" @@ -30,6 +36,7 @@ dependencies = [ "anyhow", "dot-writer", "home", + "rustc-demangle", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 8dd6ffb..726a687 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ default-run = "stable_mir_json" dot-writer = "0.1.4" anyhow = "1" home = "0.5" +rustc-demangle = "0.1.24" [[bin]] name = "cargo_stable_mir_json" @@ -17,4 +18,4 @@ path = "src/bin/cargo_stable_mir_json.rs" [package.metadata.rust-analyzer] # This package uses rustc crates. -rustc_private=true \ No newline at end of file +rustc_private=true From dcc7e366944f25ab354208ba999d8575997dc42c Mon Sep 17 00:00:00 2001 From: Everett Hildenbrandt Date: Fri, 23 May 2025 19:07:57 +0000 Subject: [PATCH 05/12] src/printer: use demangled name --- src/printer.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/printer.rs b/src/printer.rs index a6b062b..3417fa7 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -1,3 +1,4 @@ +use rustc_demangle::try_demangle; use std::hash::Hash; use std::io::Write; use std::ops::ControlFlow; @@ -413,7 +414,7 @@ fn fn_inst_sym<'tcx>( let sym_type = if inst.is_empty_shim() { NoOpSym(String::from("")) } else if let Some(_intrinsic_name) = inst.intrinsic_name() { - IntrinsicSym(inst.mangled_name()) + IntrinsicSym(try_demangle(&inst.mangled_name()).unwrap().to_string()) } else { NormalSym(inst.mangled_name()) }; From e4eca2645a39a0beb99872a8f4f8c577c8f0b511 Mon Sep 17 00:00:00 2001 From: Everett Hildenbrandt Date: Fri, 23 May 2025 19:23:17 +0000 Subject: [PATCH 06/12] tests/integration/programs: update expected output --- tests/integration/programs/assert_eq.smir.json.expected | 2 +- tests/integration/programs/binop.smir.json.expected | 2 +- tests/integration/programs/char-trivial.smir.json.expected | 2 +- tests/integration/programs/closure-args.smir.json.expected | 2 +- tests/integration/programs/closure-no-args.smir.json.expected | 2 +- .../programs/const-arithm-simple.smir.json.expected | 2 +- tests/integration/programs/div.smir.json.expected | 2 +- .../integration/programs/double-ref-deref.smir.json.expected | 2 +- tests/integration/programs/enum.smir.json.expected | 2 +- tests/integration/programs/fibonacci.smir.json.expected | 2 +- tests/integration/programs/float.smir.json.expected | 2 +- tests/integration/programs/modulo.smir.json.expected | 2 +- .../integration/programs/mutual_recursion.smir.json.expected | 2 +- .../programs/option-construction.smir.json.expected | 2 +- .../programs/primitive-type-bounds.smir.json.expected | 2 +- .../programs/recursion-simple-match.smir.json.expected | 2 +- .../integration/programs/recursion-simple.smir.json.expected | 2 +- tests/integration/programs/ref-deref.smir.json.expected | 2 +- tests/integration/programs/shl_min.smir.json.expected | 2 +- tests/integration/programs/slice.smir.json.expected | 4 ++-- .../integration/programs/strange-ref-deref.smir.json.expected | 2 +- tests/integration/programs/struct.smir.json.expected | 2 +- tests/integration/programs/sum-to-n.smir.json.expected | 2 +- tests/integration/programs/tuple-eq.smir.json.expected | 2 +- tests/integration/programs/tuples-simple.smir.json.expected | 2 +- 25 files changed, 26 insertions(+), 26 deletions(-) diff --git a/tests/integration/programs/assert_eq.smir.json.expected b/tests/integration/programs/assert_eq.smir.json.expected index c73ba0a..6f71c1b 100644 --- a/tests/integration/programs/assert_eq.smir.json.expected +++ b/tests/integration/programs/assert_eq.smir.json.expected @@ -23,7 +23,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17h422cafb34137ccebE" + "IntrinsicSym": "core::intrinsics::black_box::h422cafb34137cceb" } ], [ diff --git a/tests/integration/programs/binop.smir.json.expected b/tests/integration/programs/binop.smir.json.expected index 69d05bb..8f2b46b 100644 --- a/tests/integration/programs/binop.smir.json.expected +++ b/tests/integration/programs/binop.smir.json.expected @@ -1127,7 +1127,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17h241585995e0a474bE" + "IntrinsicSym": "core::intrinsics::black_box::h241585995e0a474b" } ], [ diff --git a/tests/integration/programs/char-trivial.smir.json.expected b/tests/integration/programs/char-trivial.smir.json.expected index 8823cec..75b76d6 100644 --- a/tests/integration/programs/char-trivial.smir.json.expected +++ b/tests/integration/programs/char-trivial.smir.json.expected @@ -63,7 +63,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17ha16ea91007d49fe5E" + "IntrinsicSym": "core::intrinsics::black_box::ha16ea91007d49fe5" } ], [ diff --git a/tests/integration/programs/closure-args.smir.json.expected b/tests/integration/programs/closure-args.smir.json.expected index 9d606bc..2249b50 100644 --- a/tests/integration/programs/closure-args.smir.json.expected +++ b/tests/integration/programs/closure-args.smir.json.expected @@ -72,7 +72,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17h3aa5de4463bc0661E" + "IntrinsicSym": "core::intrinsics::black_box::h3aa5de4463bc0661" } ], [ diff --git a/tests/integration/programs/closure-no-args.smir.json.expected b/tests/integration/programs/closure-no-args.smir.json.expected index b236bc3..1e67536 100644 --- a/tests/integration/programs/closure-no-args.smir.json.expected +++ b/tests/integration/programs/closure-no-args.smir.json.expected @@ -66,7 +66,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17hbf338400c1894304E" + "IntrinsicSym": "core::intrinsics::black_box::hbf338400c1894304" } ], [ diff --git a/tests/integration/programs/const-arithm-simple.smir.json.expected b/tests/integration/programs/const-arithm-simple.smir.json.expected index 71c40db..3b5f860 100644 --- a/tests/integration/programs/const-arithm-simple.smir.json.expected +++ b/tests/integration/programs/const-arithm-simple.smir.json.expected @@ -56,7 +56,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17h391cc993d03dc5f6E" + "IntrinsicSym": "core::intrinsics::black_box::h391cc993d03dc5f6" } ], [ diff --git a/tests/integration/programs/div.smir.json.expected b/tests/integration/programs/div.smir.json.expected index ff4ae27..06ab880 100644 --- a/tests/integration/programs/div.smir.json.expected +++ b/tests/integration/programs/div.smir.json.expected @@ -69,7 +69,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17he93d51ca0987a8a7E" + "IntrinsicSym": "core::intrinsics::black_box::he93d51ca0987a8a7" } ], [ diff --git a/tests/integration/programs/double-ref-deref.smir.json.expected b/tests/integration/programs/double-ref-deref.smir.json.expected index 94baeea..7fee94b 100644 --- a/tests/integration/programs/double-ref-deref.smir.json.expected +++ b/tests/integration/programs/double-ref-deref.smir.json.expected @@ -64,7 +64,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17h00f7118557981147E" + "IntrinsicSym": "core::intrinsics::black_box::h00f7118557981147" } ], [ diff --git a/tests/integration/programs/enum.smir.json.expected b/tests/integration/programs/enum.smir.json.expected index 5ca5bd4..66725a6 100644 --- a/tests/integration/programs/enum.smir.json.expected +++ b/tests/integration/programs/enum.smir.json.expected @@ -23,7 +23,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17hcfe6ff2b60e0659bE" + "IntrinsicSym": "core::intrinsics::black_box::hcfe6ff2b60e0659b" } ], [ diff --git a/tests/integration/programs/fibonacci.smir.json.expected b/tests/integration/programs/fibonacci.smir.json.expected index 17dfd15..ffece1f 100644 --- a/tests/integration/programs/fibonacci.smir.json.expected +++ b/tests/integration/programs/fibonacci.smir.json.expected @@ -63,7 +63,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17h709d6c5a599a175bE" + "IntrinsicSym": "core::intrinsics::black_box::h709d6c5a599a175b" } ], [ diff --git a/tests/integration/programs/float.smir.json.expected b/tests/integration/programs/float.smir.json.expected index b8c08ef..7006b09 100644 --- a/tests/integration/programs/float.smir.json.expected +++ b/tests/integration/programs/float.smir.json.expected @@ -110,7 +110,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17hd0067deb00467d1eE" + "IntrinsicSym": "core::intrinsics::black_box::hd0067deb00467d1e" } ], [ diff --git a/tests/integration/programs/modulo.smir.json.expected b/tests/integration/programs/modulo.smir.json.expected index 837f6e5..248370f 100644 --- a/tests/integration/programs/modulo.smir.json.expected +++ b/tests/integration/programs/modulo.smir.json.expected @@ -67,7 +67,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17h6d8a95155536c7a5E" + "IntrinsicSym": "core::intrinsics::black_box::h6d8a95155536c7a5" } ], [ diff --git a/tests/integration/programs/mutual_recursion.smir.json.expected b/tests/integration/programs/mutual_recursion.smir.json.expected index e6b347b..df20f73 100644 --- a/tests/integration/programs/mutual_recursion.smir.json.expected +++ b/tests/integration/programs/mutual_recursion.smir.json.expected @@ -66,7 +66,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17h6276fda256daf032E" + "IntrinsicSym": "core::intrinsics::black_box::h6276fda256daf032" } ], [ diff --git a/tests/integration/programs/option-construction.smir.json.expected b/tests/integration/programs/option-construction.smir.json.expected index 87f2c7d..e98e649 100644 --- a/tests/integration/programs/option-construction.smir.json.expected +++ b/tests/integration/programs/option-construction.smir.json.expected @@ -23,7 +23,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17h4d94af3175a49dd5E" + "IntrinsicSym": "core::intrinsics::black_box::h4d94af3175a49dd5" } ], [ diff --git a/tests/integration/programs/primitive-type-bounds.smir.json.expected b/tests/integration/programs/primitive-type-bounds.smir.json.expected index 914d463..075952e 100644 --- a/tests/integration/programs/primitive-type-bounds.smir.json.expected +++ b/tests/integration/programs/primitive-type-bounds.smir.json.expected @@ -61,7 +61,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17hef36cab61d18ff7aE" + "IntrinsicSym": "core::intrinsics::black_box::hef36cab61d18ff7a" } ], [ diff --git a/tests/integration/programs/recursion-simple-match.smir.json.expected b/tests/integration/programs/recursion-simple-match.smir.json.expected index 7c83395..8d188b8 100644 --- a/tests/integration/programs/recursion-simple-match.smir.json.expected +++ b/tests/integration/programs/recursion-simple-match.smir.json.expected @@ -64,7 +64,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17hbb3607ac69f14664E" + "IntrinsicSym": "core::intrinsics::black_box::hbb3607ac69f14664" } ], [ diff --git a/tests/integration/programs/recursion-simple.smir.json.expected b/tests/integration/programs/recursion-simple.smir.json.expected index 919e435..1081e19 100644 --- a/tests/integration/programs/recursion-simple.smir.json.expected +++ b/tests/integration/programs/recursion-simple.smir.json.expected @@ -64,7 +64,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17h2e645b1867a314c1E" + "IntrinsicSym": "core::intrinsics::black_box::h2e645b1867a314c1" } ], [ diff --git a/tests/integration/programs/ref-deref.smir.json.expected b/tests/integration/programs/ref-deref.smir.json.expected index 9707336..66fc7a6 100644 --- a/tests/integration/programs/ref-deref.smir.json.expected +++ b/tests/integration/programs/ref-deref.smir.json.expected @@ -62,7 +62,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17h3a4f306e74a8f932E" + "IntrinsicSym": "core::intrinsics::black_box::h3a4f306e74a8f932" } ], [ diff --git a/tests/integration/programs/shl_min.smir.json.expected b/tests/integration/programs/shl_min.smir.json.expected index ac646c4..a555bed 100644 --- a/tests/integration/programs/shl_min.smir.json.expected +++ b/tests/integration/programs/shl_min.smir.json.expected @@ -330,7 +330,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17hc474a1f231ffa8ebE" + "IntrinsicSym": "core::intrinsics::black_box::hc474a1f231ffa8eb" } ], [ diff --git a/tests/integration/programs/slice.smir.json.expected b/tests/integration/programs/slice.smir.json.expected index cbf1a43..c5fbfe6 100644 --- a/tests/integration/programs/slice.smir.json.expected +++ b/tests/integration/programs/slice.smir.json.expected @@ -97,7 +97,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17hb31027c02ee3a17bE" + "IntrinsicSym": "core::intrinsics::black_box::hb31027c02ee3a17b" } ], [ @@ -132,7 +132,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics6raw_eq17h56b82731e6ecdd06E" + "IntrinsicSym": "core::intrinsics::raw_eq::h56b82731e6ecdd06" } ], [ diff --git a/tests/integration/programs/strange-ref-deref.smir.json.expected b/tests/integration/programs/strange-ref-deref.smir.json.expected index 8250aad..56a480e 100644 --- a/tests/integration/programs/strange-ref-deref.smir.json.expected +++ b/tests/integration/programs/strange-ref-deref.smir.json.expected @@ -63,7 +63,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17ha7d224fd12b7abb0E" + "IntrinsicSym": "core::intrinsics::black_box::ha7d224fd12b7abb0" } ], [ diff --git a/tests/integration/programs/struct.smir.json.expected b/tests/integration/programs/struct.smir.json.expected index 08b7588..906f263 100644 --- a/tests/integration/programs/struct.smir.json.expected +++ b/tests/integration/programs/struct.smir.json.expected @@ -69,7 +69,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17hc7a573f7e71a7cefE" + "IntrinsicSym": "core::intrinsics::black_box::hc7a573f7e71a7cef" } ], [ diff --git a/tests/integration/programs/sum-to-n.smir.json.expected b/tests/integration/programs/sum-to-n.smir.json.expected index b61f6c0..7a5e47c 100644 --- a/tests/integration/programs/sum-to-n.smir.json.expected +++ b/tests/integration/programs/sum-to-n.smir.json.expected @@ -61,7 +61,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17h3017e6b5a4bf14a5E" + "IntrinsicSym": "core::intrinsics::black_box::h3017e6b5a4bf14a5" } ], [ diff --git a/tests/integration/programs/tuple-eq.smir.json.expected b/tests/integration/programs/tuple-eq.smir.json.expected index 7c83625..5d7b604 100644 --- a/tests/integration/programs/tuple-eq.smir.json.expected +++ b/tests/integration/programs/tuple-eq.smir.json.expected @@ -91,7 +91,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17h30c7811834fd88c0E" + "IntrinsicSym": "core::intrinsics::black_box::h30c7811834fd88c0" } ], [ diff --git a/tests/integration/programs/tuples-simple.smir.json.expected b/tests/integration/programs/tuples-simple.smir.json.expected index ea9e84e..19d8066 100644 --- a/tests/integration/programs/tuples-simple.smir.json.expected +++ b/tests/integration/programs/tuples-simple.smir.json.expected @@ -69,7 +69,7 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17hc1f9cf2af38719e2E" + "IntrinsicSym": "core::intrinsics::black_box::hc1f9cf2af38719e2" } ], [ From b83ac8a7d92d1eff52dd9ee4a7ca8f9ab88bd8d8 Mon Sep 17 00:00:00 2001 From: Everett Hildenbrandt Date: Fri, 23 May 2025 19:35:43 +0000 Subject: [PATCH 07/12] src/printer: compute item name inside mk_item --- src/printer.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/printer.rs b/src/printer.rs index 3417fa7..a1f89d0 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -332,7 +332,8 @@ impl Ord for Item { } } -fn mk_item(tcx: TyCtxt<'_>, item: MonoItem, sym_name: String) -> Item { +fn mk_item(tcx: TyCtxt<'_>, item: MonoItem) -> Item { + let symbol_name = mono_item_name(tcx, &item).to_string(); match item { MonoItem::Fn(inst) => { let id = inst.def.def_id(); @@ -340,7 +341,7 @@ fn mk_item(tcx: TyCtxt<'_>, item: MonoItem, sym_name: String) -> Item { let internal_id = rustc_internal::internal(tcx, id); Item { mono_item: item, - symbol_name: sym_name.clone(), + symbol_name, mono_item_kind: MonoItemKind::MonoItemFn { name: name.clone(), id, @@ -363,7 +364,7 @@ fn mk_item(tcx: TyCtxt<'_>, item: MonoItem, sym_name: String) -> Item { }; Item { mono_item: item, - symbol_name: sym_name, + symbol_name, mono_item_kind: MonoItemKind::MonoItemStatic { name: static_def.name(), id: static_def.def_id(), @@ -376,7 +377,7 @@ fn mk_item(tcx: TyCtxt<'_>, item: MonoItem, sym_name: String) -> Item { let asm = format!("{:#?}", asm); Item { mono_item: item, - symbol_name: sym_name, + symbol_name, mono_item_kind: MonoItemKind::MonoItemGlobalAsm { asm }, details: None, } @@ -900,7 +901,6 @@ impl MirVisitor for UnevaluatedConstCollector<'_, '_> { mk_item( self.tcx, rustc_internal::stable(internal_mono_item), - item_name, ), ); } @@ -970,7 +970,7 @@ fn collect_items(tcx: TyCtxt<'_>) -> HashMap { .iter() .map(|item| { let name = mono_item_name(tcx, item); - (name.clone(), mk_item(tcx, item.clone(), name)) + (name.clone(), mk_item(tcx, item.clone())) }) .collect::>() } @@ -1122,7 +1122,7 @@ pub fn collect_smir(tcx: TyCtxt<'_>) -> SmirJson { "Items missing static with id {:?} and name {:?}", def, item_name ); - items.push(mk_item(tcx, mono_item, item_name.clone())); + items.push(mk_item(tcx, mono_item)); } } } From f7e5d62bd3869eac79fe2fa784b0b76f0b78c2ef Mon Sep 17 00:00:00 2001 From: Everett Hildenbrandt Date: Fri, 23 May 2025 19:36:17 +0000 Subject: [PATCH 08/12] tests/integration: update expected output --- .../programs/checked_arithmetic.smir.json.expected | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/programs/checked_arithmetic.smir.json.expected b/tests/integration/programs/checked_arithmetic.smir.json.expected index b169282..57d2893 100644 --- a/tests/integration/programs/checked_arithmetic.smir.json.expected +++ b/tests/integration/programs/checked_arithmetic.smir.json.expected @@ -171,12 +171,12 @@ ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9black_box17h264fbed7175b8627E" + "IntrinsicSym": "core::intrinsics::black_box::h264fbed7175b8627" } ], [ { - "IntrinsicSym": "_ZN4core10intrinsics9cold_path17hf51dae334946aea4E" + "IntrinsicSym": "core::intrinsics::cold_path::hf51dae334946aea4" } ], [ From 47009c9ccbe5a8b4d68413d66e6762019e79a348 Mon Sep 17 00:00:00 2001 From: dkcumming Date: Fri, 23 May 2025 15:42:04 -0400 Subject: [PATCH 09/12] Simplified mangled name functions --- src/printer.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/printer.rs b/src/printer.rs index a1f89d0..cbe308f 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -223,17 +223,13 @@ pub fn has_attr(tcx: TyCtxt<'_>, item: &stable_mir::CrateItem, attr: symbol::Sym } fn mono_item_name(tcx: TyCtxt<'_>, item: &MonoItem) -> String { - if let MonoItem::GlobalAsm(data) = item { - hash(data).to_string() - } else { - mono_item_name_int(tcx, &rustc_internal::internal(tcx, item)) + match item { + MonoItem::Fn(instance) => try_demangle(&instance.mangled_name()).unwrap().to_string(), + MonoItem::Static(_static_def) => rustc_internal::internal(tcx, item).symbol_name(tcx).name.into(), + MonoItem::GlobalAsm(opaque) => hash(opaque).to_string(), } } -fn mono_item_name_int<'a>(tcx: TyCtxt<'a>, item: &rustc_middle::mir::mono::MonoItem<'a>) -> String { - item.symbol_name(tcx).name.into() -} - fn fn_inst_for_ty(ty: stable_mir::ty::Ty, direct_call: bool) -> Option { ty.kind().fn_def().and_then(|(fn_def, args)| { if direct_call { @@ -886,7 +882,7 @@ impl MirVisitor for UnevaluatedConstCollector<'_, '_> { .flatten() .unwrap_or_else(|| panic!("Failed to resolve mono item for {:?}", uconst)); let internal_mono_item = rustc_middle::mir::mono::MonoItem::Fn(inst); - let item_name = mono_item_name_int(self.tcx, &internal_mono_item); + let item_name = mono_item_name(self.tcx, &MonoItem::Fn(rustc_internal::stable(inst))); if !(self.processed_items.contains_key(&item_name) || self.pending_items.contains_key(&item_name) || self.current_item == hash(&item_name)) From e3ecb71b368e5b8ce1a5a9df7feb614460174446 Mon Sep 17 00:00:00 2001 From: Everett Hildenbrandt Date: Fri, 23 May 2025 19:47:53 +0000 Subject: [PATCH 10/12] tests/integration: update expected output --- .../programs/assert_eq.smir.json.expected | 3804 ++++----- .../programs/binop.smir.json.expected | 6944 ++++++++--------- .../programs/char-trivial.smir.json.expected | 1724 ++-- .../checked_arithmetic.smir.json.expected | 3556 ++++----- .../programs/closure-args.smir.json.expected | 1796 ++--- .../closure-no-args.smir.json.expected | 1796 ++--- .../const-arithm-simple.smir.json.expected | 1726 ++-- .../programs/div.smir.json.expected | 2768 +++---- .../double-ref-deref.smir.json.expected | 2112 ++--- .../programs/enum.smir.json.expected | 1886 ++--- .../programs/fibonacci.smir.json.expected | 3220 ++++---- .../programs/float.smir.json.expected | 2896 +++---- .../programs/modulo.smir.json.expected | 2772 +++---- .../mutual_recursion.smir.json.expected | 2462 +++--- .../option-construction.smir.json.expected | 2322 +++--- .../primitive-type-bounds.smir.json.expected | 2406 +++--- .../recursion-simple-match.smir.json.expected | 2426 +++--- .../recursion-simple.smir.json.expected | 2302 +++--- .../programs/ref-deref.smir.json.expected | 2112 ++--- .../programs/shl_min.smir.json.expected | 4710 +++++------ .../programs/slice.smir.json.expected | 4416 +++++------ .../strange-ref-deref.smir.json.expected | 1152 +-- .../programs/struct.smir.json.expected | 1778 ++--- .../programs/sum-to-n.smir.json.expected | 3150 ++++---- .../programs/tuple-eq.smir.json.expected | 2522 +++--- .../programs/tuples-simple.smir.json.expected | 1250 +-- 26 files changed, 35004 insertions(+), 35004 deletions(-) diff --git a/tests/integration/programs/assert_eq.smir.json.expected b/tests/integration/programs/assert_eq.smir.json.expected index 6f71c1b..c51aa30 100644 --- a/tests/integration/programs/assert_eq.smir.json.expected +++ b/tests/integration/programs/assert_eq.smir.json.expected @@ -78,135 +78,36 @@ "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 2, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, { "kind": { "Assign": [ { - "local": 8, + "local": 3, "projection": [] }, { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 - } - ] + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref" ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] - } - ] - }, - "span": 3 - }, - { - "kind": { - "Assign": [ - { - "local": 7, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 8, - "projection": [] } - ] - } - ] - }, - "span": 2 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, - { - "Copy": { - "local": 7, - "projection": [] - } - }, - 5 - ] + } } ] }, - "span": 2 + "span": 45 } ], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, { "Move": { "local": 3, @@ -215,23 +116,23 @@ }, { "Move": { - "local": 4, + "local": 2, "projection": [] } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 6, "kind": "ZeroSized", - "ty": 0 + "ty": 21 }, - "span": 0, + "span": 43, "user_ty": null } }, @@ -239,122 +140,49 @@ "unwind": "Continue" } }, - "span": 1 + "span": 44 } }, { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 5 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 - } - ], + "statements": [], "terminator": { "kind": "Return", - "span": 4 + "span": 46 } } ], "locals": [ { "mutability": "Mut", - "span": 8, - "ty": 6 - }, - { - "mutability": "Not", - "span": 9, - "ty": 7 - }, - { - "mutability": "Not", - "span": 10, - "ty": 6 + "span": 47, + "ty": 22 }, { "mutability": "Not", - "span": 11, - "ty": 8 + "span": 48, + "ty": 23 }, { "mutability": "Not", - "span": 12, - "ty": 9 - }, - { - "mutability": "Mut", - "span": 1, - "ty": 10 + "span": 49, + "ty": 24 }, { "mutability": "Mut", - "span": 2, - "ty": 5 - }, - { - "mutability": "Not", - "span": 2, - "ty": 11 - }, - { - "mutability": "Not", - "span": 3, - "ty": 12 + "span": 48, + "ty": 25 } ], - "span": 13, + "span": 50, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "main", + "name": "self", "source_info": { "scope": 0, - "span": 9 + "span": 48 }, "value": { "Place": { @@ -366,10 +194,10 @@ { "argument_index": 2, "composite": null, - "name": "argc", + "name": "f", "source_info": { "scope": 0, - "span": 10 + "span": 49 }, "value": { "Place": { @@ -377,262 +205,320 @@ "projection": [] } } - }, + } + ] + }, + "id": 3, + "name": "<&i32 as std::fmt::Debug>::fmt" + } + }, + "symbol_name": "<&T as core::fmt::Debug>::fmt::hd2d7ac44d6bb35d3" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 15, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 17 + }, + "span": 86, + "user_ty": null + } + } + } + ] + }, + "span": 86 } + ], + "terminator": { + "kind": "Return", + "span": 85 } - }, + } + ], + "locals": [ { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } + "mutability": "Mut", + "span": 87, + "ty": 17 }, { - "argument_index": null, + "mutability": "Not", + "span": 88, + "ty": 1 + } + ], + "span": 89, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, "composite": null, - "name": "v", + "name": "self", "source_info": { - "scope": 1, - "span": 6 + "scope": 0, + "span": 88 }, "value": { - "Place": { - "local": 0, - "projection": [] + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null } } } ] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 8, + "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "<() as std::process::Termination>::report::h7d4db6223e0d9d0b" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 0, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 16 - }, - { - "kind": { - "StorageLive": 3 - }, - "span": 15 - }, - { - "kind": { - "StorageLive": 4 - }, - "span": 17 - }, { "kind": { "Assign": [ { - "local": 4, + "local": 1, "projection": [] }, { "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] + "Constant": { + "const_": { + "id": 18, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 42, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 93, + "user_ty": null } } } ] }, - "span": 17 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 4, - "projection": [] - } - } - ], - "destination": { - "local": 3, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 1, - "kind": "ZeroSized", - "ty": 13 - }, - "span": 14, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 15 - } - }, - { - "statements": [ - { - "kind": { - "StorageDead": 4 - }, - "span": 19 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 3, - "projection": [] - } - } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 2, - "kind": "ZeroSized", - "ty": 14 - }, - "span": 18, - "user_ty": null - } - }, - "target": 2, - "unwind": "Continue" - } - }, - "span": 16 - } - }, - { - "statements": [ - { - "kind": { - "StorageDead": 3 - }, - "span": 21 - }, - { - "kind": { - "StorageLive": 5 - }, - "span": 22 + "span": 93 }, { "kind": { "Assign": [ { - "local": 5, + "local": 3, "projection": [] }, { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", + "CheckedBinaryOp": [ + "Add", { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - } - ] + "Constant": { + "const_": { + "id": 16, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 3, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 90, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 17, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 39, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 91, + "user_ty": null + } } ] } ] }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 + "span": 92 + } + ], + "terminator": { + "kind": { + "Assert": { + "cond": { + "Move": { + "local": 3, + "projection": [ + { + "Field": [ + 1, + 40 + ] + } + ] + } + }, + "expected": false, + "msg": { + "Overflow": [ + "Add", + { + "Constant": { + "const_": { + "id": 16, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 3, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 90, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 17, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 39, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 91, + "user_ty": null + } + } + ] + }, + "target": 1, + "unwind": "Continue" + } }, + "span": 92 + } + }, + { + "statements": [ { "kind": { "Assign": [ { - "local": 6, + "local": 2, "projection": [] }, { "Use": { - "Copy": { - "local": 2, + "Move": { + "local": 3, "projection": [ { "Field": [ 0, - 15 - ] - }, - { - "Field": [ - 0, - 9 + 16 ] } ] @@ -641,289 +527,467 @@ } ] }, - "span": 23 + "span": 92 }, { "kind": { "Assign": [ { - "local": 0, + "local": 5, "projection": [] }, { - "Cast": [ - "IntToInt", + "Ref": [ { - "Move": { - "local": 6, - "projection": [] - } + "kind": "ReErased" }, - 16 + "Shared", + { + "local": 2, + "projection": [] + } ] } ] }, - "span": 24 + "span": 95 }, { "kind": { - "StorageDead": 6 + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 1, + "projection": [] + } + ] + } + ] }, - "span": 25 + "span": 96 }, { "kind": { - "StorageDead": 5 + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Aggregate": [ + "Tuple", + [ + { + "Move": { + "local": 5, + "projection": [] + } + }, + { + "Move": { + "local": 6, + "projection": [] + } + } + ] + ] + } + ] }, - "span": 26 + "span": 97 }, { "kind": { - "StorageDead": 2 + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 4, + "projection": [ + { + "Field": [ + 0, + 25 + ] + } + ] + } + } + } + ] }, - "span": 27 - } - ], - "terminator": { - "kind": "Return", - "span": 20 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 28, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 3, - "ty": 11 - }, - { - "mutability": "Mut", - "span": 16, - "ty": 17 - }, - { - "mutability": "Mut", - "span": 15, - "ty": 1 - }, - { - "mutability": "Mut", - "span": 17, - "ty": 7 - }, - { - "mutability": "Mut", - "span": 22, - "ty": 18 - }, - { - "mutability": "Mut", - "span": 23, - "ty": 9 - } - ], - "span": 3, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": null, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] + "span": 98 + }, + { + "kind": { + "Assign": [ + { + "local": 8, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 4, + "projection": [ + { + "Field": [ + 1, + 25 + ] + } + ] + } + } + } + ] + }, + "span": 99 + }, + { + "kind": { + "Assign": [ + { + "local": 10, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 7, + "projection": [ + "Deref" + ] + } + } + } + ] + }, + "span": 100 + }, + { + "kind": { + "Assign": [ + { + "local": 11, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 8, + "projection": [ + "Deref" + ] + } + } + } + ] + }, + "span": 101 + }, + { + "kind": { + "Assign": [ + { + "local": 9, + "projection": [] + }, + { + "BinaryOp": [ + "Eq", + { + "Move": { + "local": 10, + "projection": [] + } + }, + { + "Move": { + "local": 11, + "projection": [] + } + } + ] + } + ] + }, + "span": 94 } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 9, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 3 + ] + ], + "otherwise": 2 + } + } + }, + "span": 94 } }, { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 1, - "span": 29 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } + "statements": [], + "terminator": { + "kind": "Return", + "span": 102 } }, { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 2, - "span": 30 - }, - "value": { - "Place": { - "local": 5, - "projection": [] + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 12, + "projection": [] + }, + { + "Aggregate": [ + { + "Adt": [ + 10, + 0, + [], + null, + null + ] + }, + [] + ] + } + ] + }, + "span": 105 + }, + { + "kind": { + "Assign": [ + { + "local": 14, + "projection": [] + }, + { + "Aggregate": [ + { + "Adt": [ + 11, + 0, + [ + { + "Type": 42 + } + ], + null, + null + ] + }, + [] + ] + } + ] + }, + "span": 106 } - } - } - ] - }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" - } - }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [], + ], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, + "local": 12, "projection": [] } }, { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Copy": { + "local": 7, + "projection": [] } - } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 3, - "kind": "ZeroSized", - "ty": 19 - }, - "span": 31, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 33 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + }, { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Copy": { + "local": 8, + "projection": [] + } + }, + { + "Move": { + "local": 14, + "projection": [] } } ], "destination": { - "local": 2, + "local": 13, "projection": [] }, "func": { "Constant": { "const_": { - "id": 5, + "id": 19, "kind": "ZeroSized", - "ty": 20 + "ty": 41 }, - "span": 34, + "span": 103, "user_ty": null } }, - "target": 2, - "unwind": "Unreachable" + "target": null, + "unwind": "Continue" } }, - "span": 35 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 36 + "span": 104 } } ], "locals": [ { "mutability": "Mut", - "span": 37, + "span": 107, "ty": 1 }, { - "mutability": "Not", - "span": 38, - "ty": 7 + "mutability": "Not", + "span": 108, + "ty": 16 + }, + { + "mutability": "Not", + "span": 109, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 92, + "ty": 43 + }, + { + "mutability": "Mut", + "span": 97, + "ty": 44 + }, + { + "mutability": "Mut", + "span": 95, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 96, + "ty": 25 + }, + { + "mutability": "Not", + "span": 98, + "ty": 25 + }, + { + "mutability": "Not", + "span": 99, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 94, + "ty": 40 + }, + { + "mutability": "Mut", + "span": 100, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 101, + "ty": 16 + }, + { + "mutability": "Not", + "span": 110, + "ty": 38 + }, + { + "mutability": "Not", + "span": 104, + "ty": 37 + }, + { + "mutability": "Mut", + "span": 106, + "ty": 39 + } + ], + "span": 111, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": null, + "composite": null, + "name": "a", + "source_info": { + "scope": 1, + "span": 108 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "b", + "source_info": { + "scope": 2, + "span": 109 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } }, { - "mutability": "Not", - "span": 39, - "ty": 1 - } - ], - "span": 42, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "f", + "name": "left_val", "source_info": { - "scope": 0, - "span": 38 + "scope": 3, + "span": 98 }, "value": { "Place": { - "local": 1, + "local": 7, "projection": [] } } @@ -931,45 +995,40 @@ { "argument_index": null, "composite": null, - "name": "result", + "name": "right_val", "source_info": { - "scope": 1, - "span": 40 + "scope": 3, + "span": 99 }, "value": { "Place": { - "local": 0, + "local": 8, "projection": [] } } }, { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "dummy", + "name": "kind", "source_info": { - "scope": 2, - "span": 41 + "scope": 4, + "span": 110 }, "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Place": { + "local": 12, + "projection": [] } } } ] }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" + "id": 9, + "name": "main" } }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "symbol_name": "assert_eq::main::h8a389146e7c5df5f" }, { "details": null, @@ -980,26 +1039,129 @@ "blocks": [ { "statements": [ + { + "kind": { + "StorageLive": 3 + }, + "span": 52 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 53 + }, { "kind": { "Assign": [ { - "local": 3, + "local": 4, "projection": [] }, { "Use": { "Copy": { - "local": 1, + "local": 2, "projection": [ - "Deref" + "Deref", + { + "Field": [ + 0, + 26 + ] + } ] } } } ] }, - "span": 45 + "span": 53 + }, + { + "kind": { + "Assign": [ + { + "local": 3, + "projection": [] + }, + { + "BinaryOp": [ + "BitAnd", + { + "Move": { + "local": 4, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 7, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 16, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 32, + "user_ty": null + } + } + ] + } + ] + }, + "span": 52 + }, + { + "kind": { + "StorageDead": 4 + }, + "span": 54 + } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 3, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 2 + ] + ], + "otherwise": 1 + } + } + }, + "span": 51 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 51 } ], "terminator": { @@ -1008,7 +1170,7 @@ "args": [ { "Move": { - "local": 3, + "local": 1, "projection": [] } }, @@ -1026,118 +1188,46 @@ "func": { "Constant": { "const_": { - "id": 6, + "id": 8, "kind": "ZeroSized", - "ty": 21 + "ty": 27 }, - "span": 43, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 44 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 46 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 47, - "ty": 22 - }, - { - "mutability": "Not", - "span": 48, - "ty": 23 - }, - { - "mutability": "Not", - "span": 49, - "ty": 24 - }, - { - "mutability": "Mut", - "span": 48, - "ty": 25 - } - ], - "span": 50, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 0, - "span": 48 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 2, - "composite": null, - "name": "f", - "source_info": { - "scope": 0, - "span": 49 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } + "span": 55, + "user_ty": null + } + }, + "target": 6, + "unwind": "Continue" + } + }, + "span": 56 } - } - ] - }, - "id": 3, - "name": "<&i32 as std::fmt::Debug>::fmt" - } - }, - "symbol_name": "_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ + }, { "statements": [ { "kind": { - "StorageLive": 3 + "StorageDead": 3 }, - "span": 52 + "span": 51 }, { "kind": { - "StorageLive": 4 + "StorageLive": 5 }, - "span": 53 + "span": 58 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 59 }, { "kind": { "Assign": [ { - "local": 4, + "local": 6, "projection": [] }, { @@ -1158,13 +1248,13 @@ } ] }, - "span": 53 + "span": 59 }, { "kind": { "Assign": [ { - "local": 3, + "local": 5, "projection": [] }, { @@ -1172,19 +1262,19 @@ "BitAnd", { "Move": { - "local": 4, + "local": 6, "projection": [] } }, { "Constant": { "const_": { - "id": 7, + "id": 9, "kind": { "Allocated": { "align": 4, "bytes": [ - 16, + 32, 0, 0, 0 @@ -1205,13 +1295,13 @@ } ] }, - "span": 52 + "span": 58 }, { "kind": { - "StorageDead": 4 + "StorageDead": 6 }, - "span": 54 + "span": 60 } ], "terminator": { @@ -1219,7 +1309,7 @@ "SwitchInt": { "discr": { "Move": { - "local": 3, + "local": 5, "projection": [] } }, @@ -1227,23 +1317,23 @@ "branches": [ [ 0, - 2 + 4 ] ], - "otherwise": 1 + "otherwise": 3 } } }, - "span": 51 + "span": 57 } }, { "statements": [ { "kind": { - "StorageDead": 3 + "StorageDead": 5 }, - "span": 51 + "span": 57 } ], "terminator": { @@ -1270,152 +1360,231 @@ "func": { "Constant": { "const_": { - "id": 8, + "id": 10, "kind": "ZeroSized", - "ty": 27 + "ty": 28 }, - "span": 55, + "span": 61, "user_ty": null } }, - "target": 6, + "target": 5, "unwind": "Continue" } }, - "span": 56 + "span": 62 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 5 + }, + "span": 57 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 1, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + } + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 11, + "kind": "ZeroSized", + "ty": 29 + }, + "span": 63, + "user_ty": null + } + }, + "target": 5, + "unwind": "Continue" + } + }, + "span": 64 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Goto": { + "target": 6 + } + }, + "span": 65 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 66 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 67, + "ty": 22 + }, + { + "mutability": "Not", + "span": 68, + "ty": 25 + }, + { + "mutability": "Not", + "span": 69, + "ty": 24 + }, + { + "mutability": "Mut", + "span": 52, + "ty": 26 + }, + { + "mutability": "Mut", + "span": 53, + "ty": 26 + }, + { + "mutability": "Mut", + "span": 58, + "ty": 26 + }, + { + "mutability": "Mut", + "span": 59, + "ty": 26 + } + ], + "span": 72, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 68 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "f", + "source_info": { + "scope": 0, + "span": 69 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 70 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } } }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 71 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + } + ] + }, + "id": 4, + "name": "core::fmt::num::::fmt" + } + }, + "symbol_name": "core::fmt::num::::fmt::heee3c70c53a1fbd7" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { "statements": [ - { - "kind": { - "StorageDead": 3 - }, - "span": 51 - }, - { - "kind": { - "StorageLive": 5 - }, - "span": 58 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 59 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 2, - "projection": [ - "Deref", - { - "Field": [ - 0, - 26 - ] - } - ] - } - } - } - ] - }, - "span": 59 - }, { "kind": { "Assign": [ { - "local": 5, + "local": 3, "projection": [] }, { - "BinaryOp": [ - "BitAnd", + "Ref": [ { - "Move": { - "local": 6, - "projection": [] - } + "kind": "ReErased" }, { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 32, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 32, - "user_ty": null + "Mut": { + "kind": "Default" } + }, + { + "local": 1, + "projection": [] } ] } ] }, - "span": 58 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 60 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 5, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 0, - 4 - ] - ], - "otherwise": 3 - } - } - }, - "span": 57 - } - }, - { - "statements": [ - { - "kind": { - "StorageDead": 5 - }, - "span": 57 + "span": 73 } ], "terminator": { @@ -1424,7 +1593,7 @@ "args": [ { "Move": { - "local": 1, + "local": 3, "projection": [] } }, @@ -1442,195 +1611,166 @@ "func": { "Constant": { "const_": { - "id": 10, + "id": 13, "kind": "ZeroSized", - "ty": 28 + "ty": 32 }, - "span": 61, + "span": 73, "user_ty": null } }, - "target": 5, - "unwind": "Continue" + "target": 1, + "unwind": { + "Cleanup": 3 + } } }, - "span": 62 + "span": 73 } }, { - "statements": [ - { - "kind": { - "StorageDead": 5 - }, - "span": 57 - } - ], + "statements": [], "terminator": { "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 1, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - } - ], - "destination": { - "local": 0, + "Drop": { + "place": { + "local": 1, "projection": [] }, - "func": { - "Constant": { - "const_": { - "id": 11, - "kind": "ZeroSized", - "ty": 29 - }, - "span": 63, - "user_ty": null - } - }, - "target": 5, + "target": 2, "unwind": "Continue" } }, - "span": 64 + "span": 73 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 73 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } + }, + "span": 73 + } + }, + { + "statements": [], + "terminator": { + "kind": "Resume", + "span": 73 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 73, + "ty": 16 }, + { + "mutability": "Not", + "span": 73, + "ty": 12 + }, + { + "mutability": "Not", + "span": 73, + "ty": 1 + }, + { + "mutability": "Not", + "span": 73, + "ty": 33 + } + ], + "span": 73, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 5, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h1054626952e55724" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { "statements": [], "terminator": { "kind": { - "Goto": { - "target": 6 + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, + "projection": [] + } + }, + "target": 1, + "unwind": "Continue" } }, - "span": 65 + "span": 73 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 66 + "span": 73 } } ], "locals": [ { "mutability": "Mut", - "span": 67, - "ty": 22 + "span": 73, + "ty": 1 }, { "mutability": "Not", - "span": 68, - "ty": 25 + "span": 73, + "ty": 7 }, { "mutability": "Not", - "span": 69, - "ty": 24 - }, - { - "mutability": "Mut", - "span": 52, - "ty": 26 - }, - { - "mutability": "Mut", - "span": 53, - "ty": 26 - }, - { - "mutability": "Mut", - "span": 58, - "ty": 26 - }, - { - "mutability": "Mut", - "span": 59, - "ty": 26 + "span": 73, + "ty": 1 } ], - "span": 72, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 0, - "span": 68 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 2, - "composite": null, - "name": "f", - "source_info": { - "scope": 0, - "span": 69 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 1, - "span": 70 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 2, - "span": 71 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - } - ] + "span": 73, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 4, - "name": "core::fmt::num::::fmt" + "id": 5, + "name": ">::call_once" } }, - "symbol_name": "_ZN4core3fmt3num50_$LT$impl$u20$core..fmt..Debug$u20$for$u20$i32$GT$3fmt17h" + "symbol_name": "core::ops::function::FnOnce::call_once::he92c129a11d345cf" }, { "details": null, @@ -1715,22 +1855,28 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hc275a054a290317d" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 4, "blocks": [ { "statements": [ + { + "kind": { + "StorageLive": 5 + }, + "span": 77 + }, { "kind": { "Assign": [ { - "local": 3, + "local": 6, "projection": [] }, { @@ -1738,20 +1884,95 @@ { "kind": "ReErased" }, + "Shared", { - "Mut": { - "kind": "Default" + "local": 2, + "projection": [] + } + ] + } + ] + }, + "span": 77 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "Cast": [ + { + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 6, + "projection": [] } }, + 36 + ] + } + ] + }, + "span": 77 + }, + { + "kind": { + "StorageLive": 7 + }, + "span": 78 + }, + { + "kind": { + "Assign": [ + { + "local": 8, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", { - "local": 1, + "local": 3, "projection": [] } ] } ] }, - "span": 73 + "span": 78 + }, + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "Cast": [ + { + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 8, + "projection": [] + } + }, + 36 + ] + } + ] + }, + "span": 78 } ], "terminator": { @@ -1760,13 +1981,25 @@ "args": [ { "Move": { - "local": 3, + "local": 1, "projection": [] } }, { "Move": { - "local": 2, + "local": 5, + "projection": [] + } + }, + { + "Move": { + "local": 7, + "projection": [] + } + }, + { + "Move": { + "local": 4, "projection": [] } } @@ -1778,166 +2011,139 @@ "func": { "Constant": { "const_": { - "id": 13, + "id": 14, "kind": "ZeroSized", - "ty": 32 + "ty": 35 }, - "span": 73, + "span": 75, "user_ty": null } }, - "target": 1, - "unwind": { - "Cleanup": 3 - } - } - }, - "span": 73 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 2, + "target": null, "unwind": "Continue" } }, - "span": 73 + "span": 76 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 79, + "ty": 37 }, { - "statements": [], - "terminator": { - "kind": "Return", - "span": 73 - } + "mutability": "Not", + "span": 80, + "ty": 38 }, { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } - }, - "span": 73 - } + "mutability": "Not", + "span": 81, + "ty": 25 }, { - "statements": [], - "terminator": { - "kind": "Resume", - "span": 73 - } - } - ], - "locals": [ + "mutability": "Not", + "span": 82, + "ty": 25 + }, + { + "mutability": "Not", + "span": 83, + "ty": 39 + }, { "mutability": "Mut", - "span": 73, - "ty": 16 + "span": 77, + "ty": 36 }, { "mutability": "Not", - "span": 73, - "ty": 12 + "span": 77, + "ty": 23 }, { - "mutability": "Not", - "span": 73, - "ty": 1 + "mutability": "Mut", + "span": 78, + "ty": 36 }, { "mutability": "Not", - "span": 73, - "ty": 33 + "span": 78, + "ty": 23 } ], - "span": 73, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 5, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ + "span": 84, + "spread_arg": null, + "var_debug_info": [ { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Move": { - "local": 1, - "projection": [] - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 73 + "argument_index": 1, + "composite": null, + "name": "kind", + "source_info": { + "scope": 0, + "span": 80 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } } }, { - "statements": [], - "terminator": { - "kind": "Return", - "span": 73 + "argument_index": 2, + "composite": null, + "name": "left", + "source_info": { + "scope": 0, + "span": 81 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 73, - "ty": 1 }, { - "mutability": "Not", - "span": 73, - "ty": 7 + "argument_index": 3, + "composite": null, + "name": "right", + "source_info": { + "scope": 0, + "span": 82 + }, + "value": { + "Place": { + "local": 3, + "projection": [] + } + } }, { - "mutability": "Not", - "span": 73, - "ty": 1 + "argument_index": 4, + "composite": null, + "name": "args", + "source_info": { + "scope": 0, + "span": 83 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } } - ], - "span": 73, - "spread_arg": 2, - "var_debug_info": [] + ] }, - "id": 5, - "name": ">::call_once" + "id": 7, + "name": "core::panicking::assert_failed::" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" + "symbol_name": "core::panicking::assert_failed::h7f58e98e35e6ded9" }, { "details": null, @@ -1974,7 +2180,7 @@ "name": "std::ptr::drop_in_place::<&i32>" } }, - "symbol_name": "_ZN4core3ptr28drop_in_place$LT$$RF$i32$GT$17h" + "symbol_name": "core::ptr::drop_in_place<&i32>::h6bae2758e369a544" }, { "details": null, @@ -2011,7 +2217,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::hd85af45124e99a76" }, { "details": null, @@ -2026,67 +2232,67 @@ "kind": { "StorageLive": 5 }, - "span": 77 + "span": 1 }, { "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 2, - "projection": [] - } - ] - } - ] + "StorageLive": 6 }, - "span": 77 + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 }, { "kind": { "Assign": [ { - "local": 5, + "local": 8, "projection": [] }, { - "Cast": [ + "Aggregate": [ { - "PointerCoercion": "Unsize" + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] }, - { - "Copy": { - "local": 6, - "projection": [] + [ + { + "Copy": { + "local": 1, + "projection": [] + } } - }, - 36 + ] ] } ] }, - "span": 77 - }, - { - "kind": { - "StorageLive": 7 - }, - "span": 78 + "span": 3 }, { "kind": { "Assign": [ { - "local": 8, + "local": 7, "projection": [] }, { @@ -2096,20 +2302,20 @@ }, "Shared", { - "local": 3, + "local": 8, "projection": [] } ] } ] }, - "span": 78 + "span": 2 }, { "kind": { "Assign": [ { - "local": 7, + "local": 6, "projection": [] }, { @@ -2119,16 +2325,16 @@ }, { "Copy": { - "local": 8, + "local": 7, "projection": [] } }, - 36 + 5 ] } ] }, - "span": 78 + "span": 2 } ], "terminator": { @@ -2137,19 +2343,19 @@ "args": [ { "Move": { - "local": 1, + "local": 6, "projection": [] } }, { "Move": { - "local": 5, + "local": 2, "projection": [] } }, { "Move": { - "local": 7, + "local": 3, "projection": [] } }, @@ -2161,506 +2367,242 @@ } ], "destination": { - "local": 0, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 14, + "id": 0, "kind": "ZeroSized", - "ty": 35 + "ty": 0 }, - "span": 75, + "span": 0, "user_ty": null } - }, - "target": null, - "unwind": "Continue" - } - }, - "span": 76 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 79, - "ty": 37 - }, - { - "mutability": "Not", - "span": 80, - "ty": 38 - }, - { - "mutability": "Not", - "span": 81, - "ty": 25 - }, - { - "mutability": "Not", - "span": 82, - "ty": 25 - }, - { - "mutability": "Not", - "span": 83, - "ty": 39 - }, - { - "mutability": "Mut", - "span": 77, - "ty": 36 - }, - { - "mutability": "Not", - "span": 77, - "ty": 23 - }, - { - "mutability": "Mut", - "span": 78, - "ty": 36 - }, - { - "mutability": "Not", - "span": 78, - "ty": 23 - } - ], - "span": 84, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "kind", - "source_info": { - "scope": 0, - "span": 80 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 2, - "composite": null, - "name": "left", - "source_info": { - "scope": 0, - "span": 81 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 3, - "composite": null, - "name": "right", - "source_info": { - "scope": 0, - "span": 82 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - }, - { - "argument_index": 4, - "composite": null, - "name": "args", - "source_info": { - "scope": 0, - "span": 83 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } - } - ] - }, - "id": 7, - "name": "core::panicking::assert_failed::" - } - }, - "symbol_name": "_ZN4core9panicking13assert_failed17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 15, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 86, - "user_ty": null - } - } - } - ] - }, - "span": 86 - } - ], - "terminator": { - "kind": "Return", - "span": 85 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 87, - "ty": 17 - }, - { - "mutability": "Not", - "span": 88, - "ty": 1 - } - ], - "span": 89, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 0, - "span": 88 - }, - "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } - } - } - ] - }, - "id": 8, - "name": "<() as std::process::Termination>::report" - } - }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 0, - "blocks": [ + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 1 + } + }, { "statements": [ + { + "kind": { + "StorageDead": 6 + }, + "span": 5 + }, { "kind": { "Assign": [ { - "local": 1, + "local": 0, "projection": [] }, { "Use": { - "Constant": { - "const_": { - "id": 18, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 42, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 }, - "ty": 16 - }, - "span": 93, - "user_ty": null + { + "Field": [ + 0, + 6 + ] + } + ] } } } ] }, - "span": 93 + "span": 6 }, { "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "CheckedBinaryOp": [ - "Add", - { - "Constant": { - "const_": { - "id": 16, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 3, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 90, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 17, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 39, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 91, - "user_ty": null - } - } - ] - } - ] + "StorageDead": 8 }, - "span": 92 + "span": 7 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 7 } ], "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 3, - "projection": [ - { - "Field": [ - 1, - 40 - ] - } - ] - } - }, - "expected": false, - "msg": { - "Overflow": [ - "Add", - { - "Constant": { - "const_": { - "id": 16, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 3, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 90, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 17, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 39, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 91, - "user_ty": null - } - } - ] - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 92 + "kind": "Return", + "span": 4 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 8, + "ty": 6 + }, + { + "mutability": "Not", + "span": 9, + "ty": 7 + }, + { + "mutability": "Not", + "span": 10, + "ty": 6 + }, + { + "mutability": "Not", + "span": 11, + "ty": 8 + }, + { + "mutability": "Not", + "span": 12, + "ty": 9 + }, + { + "mutability": "Mut", + "span": 1, + "ty": 10 + }, + { + "mutability": "Mut", + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 + } + ], + "span": 13, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "argc", + "source_info": { + "scope": 0, + "span": 10 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 3, + "composite": null, + "name": "argv", + "source_info": { + "scope": 0, + "span": 11 + }, + "value": { + "Place": { + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } } }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + } + ] + }, + "id": 0, + "name": "std::rt::lang_start::<()>" + } + }, + "symbol_name": "std::rt::lang_start::h80c141f0d9d6e81d" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ { "statements": [ { "kind": { - "Assign": [ - { - "local": 2, - "projection": [] - }, - { - "Use": { - "Move": { - "local": 3, - "projection": [ - { - "Field": [ - 0, - 16 - ] - } - ] - } - } - } - ] + "StorageLive": 2 }, - "span": 92 + "span": 16 }, { "kind": { - "Assign": [ - { - "local": 5, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 2, - "projection": [] - } - ] - } - ] + "StorageLive": 3 }, - "span": 95 + "span": 15 }, { "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 1, - "projection": [] - } - ] - } - ] + "StorageLive": 4 }, - "span": 96 + "span": 17 }, { "kind": { @@ -2669,45 +2611,16 @@ "local": 4, "projection": [] }, - { - "Aggregate": [ - "Tuple", - [ - { - "Move": { - "local": 5, - "projection": [] - } - }, - { - "Move": { - "local": 6, - "projection": [] - } - } - ] - ] - } - ] - }, - "span": 97 - }, - { - "kind": { - "Assign": [ - { - "local": 7, - "projection": [] - }, { "Use": { "Copy": { - "local": 4, + "local": 1, "projection": [ + "Deref", { "Field": [ 0, - 25 + 7 ] } ] @@ -2716,346 +2629,284 @@ } ] }, - "span": 98 + "span": 17 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 4, + "projection": [] + } + } + ], + "destination": { + "local": 3, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 1, + "kind": "ZeroSized", + "ty": 13 + }, + "span": 14, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 15 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 4 + }, + "span": 19 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 3, + "projection": [] + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 2, + "kind": "ZeroSized", + "ty": 14 + }, + "span": 18, + "user_ty": null + } + }, + "target": 2, + "unwind": "Continue" + } + }, + "span": 16 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 }, { "kind": { "Assign": [ { - "local": 8, + "local": 5, "projection": [] }, { - "Use": { - "Copy": { - "local": 4, + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, "projection": [ { "Field": [ - 1, - 25 + 0, + 15 ] } ] } - } + ] } ] }, - "span": 99 + "span": 22 }, { "kind": { - "Assign": [ - { - "local": 10, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 7, - "projection": [ - "Deref" - ] - } - } - } - ] + "StorageLive": 6 }, - "span": 100 + "span": 23 }, { "kind": { "Assign": [ { - "local": 11, + "local": 6, "projection": [] }, { "Use": { "Copy": { - "local": 8, + "local": 2, "projection": [ - "Deref" + { + "Field": [ + 0, + 15 + ] + }, + { + "Field": [ + 0, + 9 + ] + } ] } } } ] }, - "span": 101 + "span": 23 }, { "kind": { "Assign": [ { - "local": 9, + "local": 0, "projection": [] }, { - "BinaryOp": [ - "Eq", + "Cast": [ + "IntToInt", { "Move": { - "local": 10, + "local": 6, "projection": [] } }, - { - "Move": { - "local": 11, - "projection": [] - } - } + 16 ] } ] }, - "span": 94 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 9, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 0, - 3 - ] - ], - "otherwise": 2 - } - } + "span": 24 }, - "span": 94 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 102 - } - }, - { - "statements": [ { "kind": { - "Assign": [ - { - "local": 12, - "projection": [] - }, - { - "Aggregate": [ - { - "Adt": [ - 10, - 0, - [], - null, - null - ] - }, - [] - ] - } - ] + "StorageDead": 6 }, - "span": 105 + "span": 25 }, { "kind": { - "Assign": [ - { - "local": 14, - "projection": [] - }, - { - "Aggregate": [ - { - "Adt": [ - 11, - 0, - [ - { - "Type": 42 - } - ], - null, - null - ] - }, - [] - ] - } - ] + "StorageDead": 5 }, - "span": 106 + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 } ], "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 12, - "projection": [] - } - }, - { - "Copy": { - "local": 7, - "projection": [] - } - }, - { - "Copy": { - "local": 8, - "projection": [] - } - }, - { - "Move": { - "local": 14, - "projection": [] - } - } - ], - "destination": { - "local": 13, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 19, - "kind": "ZeroSized", - "ty": 41 - }, - "span": 103, - "user_ty": null - } - }, - "target": null, - "unwind": "Continue" - } - }, - "span": 104 + "kind": "Return", + "span": 20 } } - ], - "locals": [ - { - "mutability": "Mut", - "span": 107, - "ty": 1 - }, - { - "mutability": "Not", - "span": 108, - "ty": 16 - }, - { - "mutability": "Not", - "span": 109, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 92, - "ty": 43 - }, + ], + "locals": [ { "mutability": "Mut", - "span": 97, - "ty": 44 + "span": 28, + "ty": 16 }, { "mutability": "Mut", - "span": 95, - "ty": 25 + "span": 3, + "ty": 11 }, { "mutability": "Mut", - "span": 96, - "ty": 25 - }, - { - "mutability": "Not", - "span": 98, - "ty": 25 - }, - { - "mutability": "Not", - "span": 99, - "ty": 25 + "span": 16, + "ty": 17 }, { "mutability": "Mut", - "span": 94, - "ty": 40 + "span": 15, + "ty": 1 }, { "mutability": "Mut", - "span": 100, - "ty": 16 + "span": 17, + "ty": 7 }, { "mutability": "Mut", - "span": 101, - "ty": 16 - }, - { - "mutability": "Not", - "span": 110, - "ty": 38 - }, - { - "mutability": "Not", - "span": 104, - "ty": 37 + "span": 22, + "ty": 18 }, { "mutability": "Mut", - "span": 106, - "ty": 39 + "span": 23, + "ty": 9 } ], - "span": 111, + "span": 3, "spread_arg": null, "var_debug_info": [ { "argument_index": null, "composite": null, - "name": "a", + "name": "main", "source_info": { - "scope": 1, - "span": 108 + "scope": 0, + "span": 9 }, "value": { "Place": { "local": 1, - "projection": [] + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] } } }, { - "argument_index": null, + "argument_index": 1, "composite": null, - "name": "b", + "name": "self", "source_info": { - "scope": 2, - "span": 109 + "scope": 1, + "span": 29 }, "value": { "Place": { @@ -3065,31 +2916,160 @@ } }, { - "argument_index": null, + "argument_index": 1, "composite": null, - "name": "left_val", + "name": "self", "source_info": { - "scope": 3, - "span": 98 + "scope": 2, + "span": 30 }, "value": { "Place": { - "local": 7, + "local": 5, "projection": [] } } + } + ] + }, + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" + } + }, + "symbol_name": "std::rt::lang_start::{{closure}}::hdbc73f1d13420fe6" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 1, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 3, + "kind": "ZeroSized", + "ty": 19 + }, + "span": 31, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 33 + } }, { - "argument_index": null, + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 5, + "kind": "ZeroSized", + "ty": 20 + }, + "span": 34, + "user_ty": null + } + }, + "target": 2, + "unwind": "Unreachable" + } + }, + "span": 35 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 36 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 37, + "ty": 1 + }, + { + "mutability": "Not", + "span": 38, + "ty": 7 + }, + { + "mutability": "Not", + "span": 39, + "ty": 1 + } + ], + "span": 42, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, "composite": null, - "name": "right_val", + "name": "f", "source_info": { - "scope": 3, - "span": 99 + "scope": 0, + "span": 38 }, "value": { "Place": { - "local": 8, + "local": 1, "projection": [] } } @@ -3097,25 +3077,45 @@ { "argument_index": null, "composite": null, - "name": "kind", + "name": "result", "source_info": { - "scope": 4, - "span": 110 + "scope": 1, + "span": 40 }, "value": { "Place": { - "local": 12, + "local": 0, "projection": [] } } + }, + { + "argument_index": 1, + "composite": null, + "name": "dummy", + "source_info": { + "scope": 2, + "span": 41 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } } ] }, - "id": 9, - "name": "main" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN9assert_eq4main17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h00ff7e7333413e27" } ], "types": [ diff --git a/tests/integration/programs/binop.smir.json.expected b/tests/integration/programs/binop.smir.json.expected index 8f2b46b..9c58542 100644 --- a/tests/integration/programs/binop.smir.json.expected +++ b/tests/integration/programs/binop.smir.json.expected @@ -1162,129 +1162,185 @@ "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 1, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, { "kind": { "Assign": [ { - "local": 8, + "local": 0, "projection": [] }, { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 + "Use": { + "Constant": { + "const_": { + "id": 8, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] + }, + "ty": 17 + }, + "span": 46, + "user_ty": null + } + } } ] }, - "span": 3 - }, + "span": 46 + } + ], + "terminator": { + "kind": "Return", + "span": 45 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 + }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::hd6646cac15cc2d57" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 0, + "blocks": [ + { + "statements": [ { "kind": { "Assign": [ { - "local": 7, + "local": 2, "projection": [] }, { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 8, - "projection": [] + "Use": { + "Constant": { + "const_": { + "id": 42, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 42, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 163, + "user_ty": null } - ] + } } ] }, - "span": 2 + "span": 164 }, { "kind": { "Assign": [ { - "local": 6, + "local": 3, "projection": [] }, { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, - { - "Copy": { - "local": 7, - "projection": [] - } - }, - 5 - ] + "Use": { + "Constant": { + "const_": { + "id": 43, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 10, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 165, + "user_ty": null + } + } } ] }, - "span": 2 + "span": 166 } ], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, { "Move": { "local": 2, @@ -1296,26 +1352,20 @@ "local": 3, "projection": [] } - }, - { - "Move": { - "local": 4, - "projection": [] - } } ], "destination": { - "local": 5, + "local": 1, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 41, "kind": "ZeroSized", - "ty": 0 + "ty": 31 }, - "span": 0, + "span": 161, "user_ty": null } }, @@ -1323,225 +1373,127 @@ "unwind": "Continue" } }, - "span": 1 + "span": 162 } }, { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 5 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 - } - ], + "statements": [], "terminator": { "kind": "Return", - "span": 4 + "span": 167 } } ], "locals": [ { "mutability": "Mut", - "span": 8, - "ty": 6 - }, - { - "mutability": "Not", - "span": 9, - "ty": 7 - }, - { - "mutability": "Not", - "span": 10, - "ty": 6 - }, - { - "mutability": "Not", - "span": 11, - "ty": 8 + "span": 168, + "ty": 1 }, { "mutability": "Not", - "span": 12, - "ty": 9 + "span": 162, + "ty": 1 }, { "mutability": "Mut", - "span": 1, - "ty": 10 + "span": 164, + "ty": 16 }, { "mutability": "Mut", - "span": 2, - "ty": 5 - }, - { - "mutability": "Not", - "span": 2, - "ty": 11 - }, - { - "mutability": "Not", - "span": 3, - "ty": 12 + "span": 166, + "ty": 16 } ], - "span": 13, + "span": 171, "spread_arg": null, "var_debug_info": [ { - "argument_index": 1, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - }, - { - "argument_index": 4, + "argument_index": null, "composite": null, - "name": "sigpipe", + "name": "x", "source_info": { - "scope": 0, - "span": 12 + "scope": 1, + "span": 169 }, "value": { - "Place": { - "local": 4, - "projection": [] + "Const": { + "const_": { + "id": 42, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 42, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 163, + "user_ty": null } } }, { "argument_index": null, "composite": null, - "name": "v", + "name": "y", "source_info": { - "scope": 1, - "span": 6 + "scope": 2, + "span": 170 }, "value": { - "Place": { - "local": 0, - "projection": [] + "Const": { + "const_": { + "id": 43, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 10, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 165, + "user_ty": null } } } ] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 7, + "name": "main" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "binop::main::h7dc164dcac1665b8" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 2, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 16 - }, - { - "kind": { - "StorageLive": 3 - }, - "span": 15 - }, - { - "kind": { - "StorageLive": 4 - }, - "span": 17 - }, { "kind": { "Assign": [ @@ -1550,383 +1502,385 @@ "projection": [] }, { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] + "CheckedBinaryOp": [ + "Add", + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Copy": { + "local": 2, + "projection": [] + } } - } + ] } ] }, - "span": 17 + "span": 50 } ], "terminator": { "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 4, - "projection": [] - } + "Assert": { + "cond": { + "Move": { + "local": 4, + "projection": [ + { + "Field": [ + 1, + 25 + ] + } + ] } - ], - "destination": { - "local": 3, - "projection": [] }, - "func": { - "Constant": { - "const_": { - "id": 1, - "kind": "ZeroSized", - "ty": 13 + "expected": false, + "msg": { + "Overflow": [ + "Add", + { + "Copy": { + "local": 1, + "projection": [] + } }, - "span": 14, - "user_ty": null - } + { + "Copy": { + "local": 2, + "projection": [] + } + } + ] }, "target": 1, "unwind": "Continue" } }, - "span": 15 + "span": 50 } }, { "statements": [ { "kind": { - "StorageDead": 4 + "Assign": [ + { + "local": 3, + "projection": [] + }, + { + "Use": { + "Move": { + "local": 4, + "projection": [ + { + "Field": [ + 0, + 16 + ] + } + ] + } + } + } + ] }, - "span": 19 + "span": 50 + } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 3, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 52, + 2 + ] + ], + "otherwise": 3 + } + } + }, + "span": 51 + } + }, + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "CheckedBinaryOp": [ + "Add", + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Copy": { + "local": 2, + "projection": [] + } + } + ] + } + ] + }, + "span": 52 } ], + "terminator": { + "kind": { + "Assert": { + "cond": { + "Move": { + "local": 7, + "projection": [ + { + "Field": [ + 1, + 25 + ] + } + ] + } + }, + "expected": false, + "msg": { + "Overflow": [ + "Add", + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Copy": { + "local": 2, + "projection": [] + } + } + ] + }, + "target": 4, + "unwind": "Continue" + } + }, + "span": 52 + } + }, + { + "statements": [], "terminator": { "kind": { "Call": { "args": [ { - "Move": { - "local": 3, - "projection": [] + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 29, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 0 + ] + ] + } + } + }, + "ty": 27 + }, + "span": 32, + "user_ty": null } } ], "destination": { - "local": 2, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 2, + "id": 9, "kind": "ZeroSized", - "ty": 14 + "ty": 26 }, - "span": 18, + "span": 53, "user_ty": null } }, - "target": 2, + "target": null, "unwind": "Continue" } }, - "span": 16 + "span": 53 } }, { "statements": [ - { - "kind": { - "StorageDead": 3 - }, - "span": 21 - }, - { - "kind": { - "StorageLive": 5 - }, - "span": 22 - }, { "kind": { "Assign": [ { - "local": 5, + "local": 6, "projection": [] }, { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 2, + "Use": { + "Move": { + "local": 7, "projection": [ { "Field": [ 0, - 15 + 16 ] } ] } - ] + } } ] }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 - }, - { - "kind": { - "Assign": [ - { + "span": 52 + } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Move": { "local": 6, "projection": [] - }, - { - "Use": { - "Copy": { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - }, - { - "Field": [ - 0, - 9 - ] - } - ] - } - } } - ] - }, - "span": 23 + }, + "targets": { + "branches": [ + [ + 52, + 5 + ] + ], + "otherwise": 6 + } + } }, + "span": 54 + } + }, + { + "statements": [ { "kind": { "Assign": [ { - "local": 0, + "local": 11, "projection": [] }, { - "Cast": [ - "IntToInt", + "CheckedBinaryOp": [ + "Add", { - "Move": { - "local": 6, + "Copy": { + "local": 1, "projection": [] } }, - 16 + { + "Copy": { + "local": 2, + "projection": [] + } + } ] } ] }, - "span": 24 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 25 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 + "span": 55 } ], - "terminator": { - "kind": "Return", - "span": 20 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 28, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 3, - "ty": 11 - }, - { - "mutability": "Mut", - "span": 16, - "ty": 17 - }, - { - "mutability": "Mut", - "span": 15, - "ty": 1 - }, - { - "mutability": "Mut", - "span": 17, - "ty": 7 - }, - { - "mutability": "Mut", - "span": 22, - "ty": 18 - }, - { - "mutability": "Mut", - "span": 23, - "ty": 9 - } - ], - "span": 3, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": null, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 1, - "span": 29 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 2, - "span": 30 - }, - "value": { - "Place": { - "local": 5, - "projection": [] - } - } - } - ] - }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" - } - }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [], "terminator": { "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 1, - "projection": [] - } - }, - { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } + "Assert": { + "cond": { + "Move": { + "local": 11, + "projection": [ + { + "Field": [ + 1, + 25 + ] + } + ] } - ], - "destination": { - "local": 0, - "projection": [] }, - "func": { - "Constant": { - "const_": { - "id": 3, - "kind": "ZeroSized", - "ty": 19 + "expected": false, + "msg": { + "Overflow": [ + "Add", + { + "Copy": { + "local": 1, + "projection": [] + } }, - "span": 31, - "user_ty": null - } + { + "Copy": { + "local": 2, + "projection": [] + } + } + ] }, - "target": 1, + "target": 7, "unwind": "Continue" } }, - "span": 33 + "span": 55 } }, { @@ -1938,713 +1892,462 @@ { "Constant": { "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "id": 11, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 29, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 1 + ] + ] + } + } + }, + "ty": 27 + }, + "span": 32, + "user_ty": null } } ], "destination": { - "local": 2, + "local": 8, "projection": [] }, "func": { "Constant": { "const_": { - "id": 5, + "id": 9, "kind": "ZeroSized", - "ty": 20 + "ty": 26 }, - "span": 34, + "span": 56, "user_ty": null } }, - "target": 2, - "unwind": "Unreachable" + "target": null, + "unwind": "Continue" } }, - "span": 35 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 36 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 37, - "ty": 1 - }, - { - "mutability": "Not", - "span": 38, - "ty": 7 - }, - { - "mutability": "Not", - "span": 39, - "ty": 1 - } - ], - "span": 42, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "f", - "source_info": { - "scope": 0, - "span": 38 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "result", - "source_info": { - "scope": 1, - "span": 40 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } + "span": 56 } }, { - "argument_index": 1, - "composite": null, - "name": "dummy", - "source_info": { - "scope": 2, - "span": 41 - }, - "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } - } - } - ] - }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" - } - }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "Assign": [ { - "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } + "local": 10, + "projection": [] }, { - "Move": { - "local": 2, - "projection": [] + "Use": { + "Move": { + "local": 11, + "projection": [ + { + "Field": [ + 0, + 16 + ] + } + ] + } } } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 21 - }, - "span": 43, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } + ] + }, + "span": 55 }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 22 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [ { "kind": { "Assign": [ { - "local": 3, + "local": 13, "projection": [] }, { - "Ref": [ - { - "kind": "ReErased" - }, + "CheckedBinaryOp": [ + "Add", { - "Mut": { - "kind": "Default" + "Copy": { + "local": 2, + "projection": [] } }, { - "local": 1, - "projection": [] + "Copy": { + "local": 1, + "projection": [] + } } ] } ] }, - "span": 43 + "span": 57 } ], "terminator": { "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 3, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } + "Assert": { + "cond": { + "Move": { + "local": 13, + "projection": [ + { + "Field": [ + 1, + 25 + ] + } + ] } - ], - "destination": { - "local": 0, - "projection": [] }, - "func": { - "Constant": { - "const_": { - "id": 7, - "kind": "ZeroSized", - "ty": 23 + "expected": false, + "msg": { + "Overflow": [ + "Add", + { + "Copy": { + "local": 2, + "projection": [] + } }, - "span": 43, - "user_ty": null - } + { + "Copy": { + "local": 1, + "projection": [] + } + } + ] }, - "target": 1, - "unwind": { - "Cleanup": 3 - } + "target": 8, + "unwind": "Continue" } }, - "span": 43 + "span": 57 } }, { - "statements": [], + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 12, + "projection": [] + }, + { + "Use": { + "Move": { + "local": 13, + "projection": [ + { + "Field": [ + 0, + 16 + ] + } + ] + } + } + } + ] + }, + "span": 57 + }, + { + "kind": { + "Assign": [ + { + "local": 9, + "projection": [] + }, + { + "BinaryOp": [ + "Eq", + { + "Move": { + "local": 10, + "projection": [] + } + }, + { + "Move": { + "local": 12, + "projection": [] + } + } + ] + } + ] + }, + "span": 58 + } + ], "terminator": { "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] + "SwitchInt": { + "discr": { + "Move": { + "local": 9, + "projection": [] + } }, - "target": 2, - "unwind": "Continue" + "targets": { + "branches": [ + [ + 0, + 10 + ] + ], + "otherwise": 9 + } } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 + "span": 58 } }, { - "statements": [], + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 16, + "projection": [] + }, + { + "CheckedBinaryOp": [ + "Sub", + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Copy": { + "local": 2, + "projection": [] + } + } + ] + } + ] + }, + "span": 59 + } + ], "terminator": { "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] + "Assert": { + "cond": { + "Move": { + "local": 16, + "projection": [ + { + "Field": [ + 1, + 25 + ] + } + ] + } }, - "target": 4, - "unwind": "Terminate" + "expected": false, + "msg": { + "Overflow": [ + "Sub", + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Copy": { + "local": 2, + "projection": [] + } + } + ] + }, + "target": 11, + "unwind": "Continue" } }, - "span": 43 + "span": 59 } }, - { - "statements": [], - "terminator": { - "kind": "Resume", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 12 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 24 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ { "statements": [], "terminator": { "kind": { "Call": { - "args": [], + "args": [ + { + "Constant": { + "const_": { + "id": 12, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 32, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 2 + ] + ] + } + } + }, + "ty": 27 + }, + "span": 32, + "user_ty": null + } + } + ], "destination": { - "local": 0, + "local": 14, "projection": [] }, "func": { - "Move": { - "local": 1, - "projection": [] + "Constant": { + "const_": { + "id": 9, + "kind": "ZeroSized", + "ty": 26 + }, + "span": 60, + "user_ty": null } }, - "target": 1, + "target": null, "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 7 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 44 + "span": 60 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 44, - "ty": 1 }, - { - "mutability": "Not", - "span": 44, - "ty": 22 - } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] - }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" - } - }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ { "statements": [ { "kind": { "Assign": [ { - "local": 0, + "local": 15, "projection": [] }, { "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 46, - "user_ty": null + "Move": { + "local": 16, + "projection": [ + { + "Field": [ + 0, + 16 + ] + } + ] } } } ] }, - "span": 46 + "span": 59 } ], "terminator": { - "kind": "Return", - "span": 45 + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 15, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 32, + 12 + ] + ], + "otherwise": 13 + } + } + }, + "span": 61 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 47, - "ty": 17 }, - { - "mutability": "Not", - "span": 48, - "ty": 1 - } - ], - "span": 49, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 0, - "span": 48 - }, - "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } - } - } - ] - }, - "id": 5, - "name": "<() as std::process::Termination>::report" - } - }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ { "statements": [ { "kind": { "Assign": [ { - "local": 4, + "local": 19, "projection": [] }, { "CheckedBinaryOp": [ - "Add", - { - "Copy": { - "local": 1, - "projection": [] - } - }, + "Sub", { "Copy": { "local": 2, "projection": [] } - } - ] - } - ] - }, - "span": 50 - } - ], - "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 4, - "projection": [ - { - "Field": [ - 1, - 25 - ] - } - ] - } - }, - "expected": false, - "msg": { - "Overflow": [ - "Add", - { - "Copy": { - "local": 1, - "projection": [] - } - }, - { - "Copy": { - "local": 2, - "projection": [] - } - } - ] - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 50 - } - }, - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Use": { - "Move": { - "local": 4, - "projection": [ - { - "Field": [ - 0, - 16 - ] - } - ] - } - } - } - ] - }, - "span": 50 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 3, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 52, - 2 - ] - ], - "otherwise": 3 - } - } - }, - "span": 51 - } - }, - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 7, - "projection": [] - }, - { - "CheckedBinaryOp": [ - "Add", - { - "Copy": { - "local": 1, - "projection": [] - } }, { "Copy": { - "local": 2, + "local": 1, "projection": [] } } @@ -2652,7 +2355,7 @@ } ] }, - "span": 52 + "span": 62 } ], "terminator": { @@ -2660,7 +2363,7 @@ "Assert": { "cond": { "Move": { - "local": 7, + "local": 19, "projection": [ { "Field": [ @@ -2674,26 +2377,26 @@ "expected": false, "msg": { "Overflow": [ - "Add", + "Sub", { "Copy": { - "local": 1, + "local": 2, "projection": [] } }, { "Copy": { - "local": 2, + "local": 1, "projection": [] } } ] }, - "target": 4, + "target": 14, "unwind": "Continue" } }, - "span": 52 + "span": 62 } }, { @@ -2705,7 +2408,7 @@ { "Constant": { "const_": { - "id": 10, + "id": 13, "kind": { "Allocated": { "align": 8, @@ -2732,7 +2435,7 @@ "ptrs": [ [ 0, - 0 + 3 ] ] } @@ -2746,7 +2449,7 @@ } ], "destination": { - "local": 5, + "local": 17, "projection": [] }, "func": { @@ -2756,7 +2459,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 53, + "span": 63, "user_ty": null } }, @@ -2764,7 +2467,7 @@ "unwind": "Continue" } }, - "span": 53 + "span": 63 } }, { @@ -2773,13 +2476,13 @@ "kind": { "Assign": [ { - "local": 6, + "local": 18, "projection": [] }, { "Use": { "Move": { - "local": 7, + "local": 19, "projection": [ { "Field": [ @@ -2793,7 +2496,7 @@ } ] }, - "span": 52 + "span": 62 } ], "terminator": { @@ -2801,22 +2504,22 @@ "SwitchInt": { "discr": { "Move": { - "local": 6, + "local": 18, "projection": [] } }, "targets": { "branches": [ [ - 52, - 5 + 4294967264, + 15 ] ], - "otherwise": 6 + "otherwise": 16 } } }, - "span": 54 + "span": 64 } }, { @@ -2825,21 +2528,21 @@ "kind": { "Assign": [ { - "local": 11, + "local": 23, "projection": [] }, { "CheckedBinaryOp": [ - "Add", + "Sub", { "Copy": { - "local": 1, + "local": 2, "projection": [] } }, { "Copy": { - "local": 2, + "local": 1, "projection": [] } } @@ -2847,7 +2550,7 @@ } ] }, - "span": 55 + "span": 65 } ], "terminator": { @@ -2855,7 +2558,7 @@ "Assert": { "cond": { "Move": { - "local": 11, + "local": 23, "projection": [ { "Field": [ @@ -2869,26 +2572,26 @@ "expected": false, "msg": { "Overflow": [ - "Add", + "Sub", { "Copy": { - "local": 1, + "local": 2, "projection": [] } }, { "Copy": { - "local": 2, + "local": 1, "projection": [] } } ] }, - "target": 7, + "target": 17, "unwind": "Continue" } }, - "span": 55 + "span": 65 } }, { @@ -2900,7 +2603,7 @@ { "Constant": { "const_": { - "id": 11, + "id": 14, "kind": { "Allocated": { "align": 8, @@ -2913,7 +2616,7 @@ 0, 0, 0, - 29, + 30, 0, 0, 0, @@ -2927,7 +2630,7 @@ "ptrs": [ [ 0, - 1 + 4 ] ] } @@ -2941,7 +2644,7 @@ } ], "destination": { - "local": 8, + "local": 20, "projection": [] }, "func": { @@ -2951,7 +2654,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 56, + "span": 66, "user_ty": null } }, @@ -2959,7 +2662,7 @@ "unwind": "Continue" } }, - "span": 56 + "span": 66 } }, { @@ -2968,13 +2671,13 @@ "kind": { "Assign": [ { - "local": 10, + "local": 22, "projection": [] }, { "Use": { "Move": { - "local": 11, + "local": 23, "projection": [ { "Field": [ @@ -2988,27 +2691,27 @@ } ] }, - "span": 55 + "span": 65 }, { "kind": { "Assign": [ { - "local": 13, + "local": 25, "projection": [] }, { "CheckedBinaryOp": [ - "Add", + "Sub", { "Copy": { - "local": 2, + "local": 1, "projection": [] } }, { "Copy": { - "local": 1, + "local": 2, "projection": [] } } @@ -3016,7 +2719,7 @@ } ] }, - "span": 57 + "span": 67 } ], "terminator": { @@ -3024,7 +2727,7 @@ "Assert": { "cond": { "Move": { - "local": 13, + "local": 25, "projection": [ { "Field": [ @@ -3038,26 +2741,26 @@ "expected": false, "msg": { "Overflow": [ - "Add", + "Sub", { "Copy": { - "local": 2, + "local": 1, "projection": [] } }, { "Copy": { - "local": 1, + "local": 2, "projection": [] } } ] }, - "target": 8, + "target": 18, "unwind": "Continue" } }, - "span": 57 + "span": 67 } }, { @@ -3066,13 +2769,13 @@ "kind": { "Assign": [ { - "local": 12, + "local": 24, "projection": [] }, { "Use": { "Move": { - "local": 13, + "local": 25, "projection": [ { "Field": [ @@ -3086,27 +2789,27 @@ } ] }, - "span": 57 + "span": 67 }, { "kind": { "Assign": [ { - "local": 9, + "local": 21, "projection": [] }, { "BinaryOp": [ - "Eq", + "Ne", { "Move": { - "local": 10, + "local": 22, "projection": [] } }, { "Move": { - "local": 12, + "local": 24, "projection": [] } } @@ -3114,7 +2817,7 @@ } ] }, - "span": 58 + "span": 68 } ], "terminator": { @@ -3122,7 +2825,7 @@ "SwitchInt": { "discr": { "Move": { - "local": 9, + "local": 21, "projection": [] } }, @@ -3130,14 +2833,14 @@ "branches": [ [ 0, - 10 + 20 ] ], - "otherwise": 9 + "otherwise": 19 } } }, - "span": 58 + "span": 68 } }, { @@ -3146,12 +2849,12 @@ "kind": { "Assign": [ { - "local": 16, + "local": 28, "projection": [] }, { "CheckedBinaryOp": [ - "Sub", + "Mul", { "Copy": { "local": 1, @@ -3168,7 +2871,7 @@ } ] }, - "span": 59 + "span": 69 } ], "terminator": { @@ -3176,7 +2879,7 @@ "Assert": { "cond": { "Move": { - "local": 16, + "local": 28, "projection": [ { "Field": [ @@ -3190,7 +2893,7 @@ "expected": false, "msg": { "Overflow": [ - "Sub", + "Mul", { "Copy": { "local": 1, @@ -3205,11 +2908,11 @@ } ] }, - "target": 11, + "target": 21, "unwind": "Continue" } }, - "span": 59 + "span": 69 } }, { @@ -3221,7 +2924,7 @@ { "Constant": { "const_": { - "id": 12, + "id": 15, "kind": { "Allocated": { "align": 8, @@ -3248,7 +2951,7 @@ "ptrs": [ [ 0, - 2 + 5 ] ] } @@ -3262,7 +2965,7 @@ } ], "destination": { - "local": 14, + "local": 26, "projection": [] }, "func": { @@ -3272,7 +2975,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 60, + "span": 70, "user_ty": null } }, @@ -3280,7 +2983,7 @@ "unwind": "Continue" } }, - "span": 60 + "span": 70 } }, { @@ -3289,13 +2992,13 @@ "kind": { "Assign": [ { - "local": 15, + "local": 27, "projection": [] }, { "Use": { "Move": { - "local": 16, + "local": 28, "projection": [ { "Field": [ @@ -3309,7 +3012,7 @@ } ] }, - "span": 59 + "span": 69 } ], "terminator": { @@ -3317,22 +3020,22 @@ "SwitchInt": { "discr": { "Move": { - "local": 15, + "local": 27, "projection": [] } }, "targets": { "branches": [ [ - 32, - 12 + 420, + 22 ] ], - "otherwise": 13 + "otherwise": 23 } } }, - "span": 61 + "span": 71 } }, { @@ -3341,12 +3044,12 @@ "kind": { "Assign": [ { - "local": 19, + "local": 32, "projection": [] }, { - "CheckedBinaryOp": [ - "Sub", + "BinaryOp": [ + "Eq", { "Copy": { "local": 2, @@ -3354,16 +3057,35 @@ } }, { - "Copy": { - "local": 1, - "projection": [] + "Constant": { + "const_": { + "id": 16, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 0, + 0, + 0, + 128 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 72, + "user_ty": null } } ] } ] }, - "span": 62 + "span": 72 } ], "terminator": { @@ -3371,40 +3093,24 @@ "Assert": { "cond": { "Move": { - "local": 19, - "projection": [ - { - "Field": [ - 1, - 25 - ] - } - ] + "local": 32, + "projection": [] } }, "expected": false, "msg": { - "Overflow": [ - "Sub", - { - "Copy": { - "local": 2, - "projection": [] - } - }, - { - "Copy": { - "local": 1, - "projection": [] - } + "OverflowNeg": { + "Copy": { + "local": 2, + "projection": [] } - ] + } }, - "target": 14, + "target": 24, "unwind": "Continue" } }, - "span": 62 + "span": 72 } }, { @@ -3416,7 +3122,7 @@ { "Constant": { "const_": { - "id": 13, + "id": 17, "kind": { "Allocated": { "align": 8, @@ -3429,7 +3135,7 @@ 0, 0, 0, - 29, + 30, 0, 0, 0, @@ -3443,7 +3149,7 @@ "ptrs": [ [ 0, - 3 + 6 ] ] } @@ -3457,7 +3163,7 @@ } ], "destination": { - "local": 17, + "local": 29, "projection": [] }, "func": { @@ -3467,7 +3173,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 63, + "span": 73, "user_ty": null } }, @@ -3475,7 +3181,7 @@ "unwind": "Continue" } }, - "span": 63 + "span": 73 } }, { @@ -3484,73 +3190,43 @@ "kind": { "Assign": [ { - "local": 18, + "local": 31, "projection": [] }, { - "Use": { - "Move": { - "local": 19, - "projection": [ - { - "Field": [ - 0, - 16 - ] - } - ] + "UnaryOp": [ + "Neg", + { + "Copy": { + "local": 2, + "projection": [] + } } - } + ] } ] }, - "span": 62 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 18, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 4294967264, - 15 - ] - ], - "otherwise": 16 - } - } + "span": 72 }, - "span": 64 - } - }, - { - "statements": [ { "kind": { "Assign": [ { - "local": 23, + "local": 33, "projection": [] }, { "CheckedBinaryOp": [ - "Sub", + "Mul", { "Copy": { - "local": 2, + "local": 1, "projection": [] } }, { "Copy": { - "local": 1, + "local": 31, "projection": [] } } @@ -3558,7 +3234,7 @@ } ] }, - "span": 65 + "span": 74 } ], "terminator": { @@ -3566,7 +3242,7 @@ "Assert": { "cond": { "Move": { - "local": 23, + "local": 33, "projection": [ { "Field": [ @@ -3580,79 +3256,206 @@ "expected": false, "msg": { "Overflow": [ - "Sub", + "Mul", { "Copy": { - "local": 2, + "local": 1, "projection": [] } }, { - "Copy": { - "local": 1, + "Move": { + "local": 31, "projection": [] } } ] }, - "target": 17, + "target": 25, "unwind": "Continue" } }, - "span": 65 + "span": 74 } }, { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "Assign": [ { - "Constant": { - "const_": { - "id": 14, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 30, - 0, - 0, - 0, - 0, - 0, + "local": 30, + "projection": [] + }, + { + "Use": { + "Move": { + "local": 33, + "projection": [ + { + "Field": [ 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 4 - ] - ] - } + 16 + ] } - }, - "ty": 27 - }, + ] + } + } + } + ] + }, + "span": 74 + } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 30, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 4294966876, + 26 + ] + ], + "otherwise": 27 + } + } + }, + "span": 75 + } + }, + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 37, + "projection": [] + }, + { + "BinaryOp": [ + "Eq", + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 16, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 0, + 0, + 0, + 128 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 76, + "user_ty": null + } + } + ] + } + ] + }, + "span": 76 + } + ], + "terminator": { + "kind": { + "Assert": { + "cond": { + "Move": { + "local": 37, + "projection": [] + } + }, + "expected": false, + "msg": { + "OverflowNeg": { + "Copy": { + "local": 1, + "projection": [] + } + } + }, + "target": 28, + "unwind": "Continue" + } + }, + "span": 76 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 18, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 32, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 7 + ] + ] + } + } + }, + "ty": 27 + }, "span": 32, "user_ty": null } } ], "destination": { - "local": 20, + "local": 34, "projection": [] }, "func": { @@ -3662,7 +3465,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 66, + "span": 77, "user_ty": null } }, @@ -3670,7 +3473,7 @@ "unwind": "Continue" } }, - "span": 66 + "span": 77 } }, { @@ -3679,41 +3482,37 @@ "kind": { "Assign": [ { - "local": 22, + "local": 36, "projection": [] }, { - "Use": { - "Move": { - "local": 23, - "projection": [ - { - "Field": [ - 0, - 16 - ] - } - ] + "UnaryOp": [ + "Neg", + { + "Copy": { + "local": 1, + "projection": [] + } } - } + ] } ] }, - "span": 65 + "span": 76 }, { "kind": { "Assign": [ { - "local": 25, + "local": 38, "projection": [] }, { "CheckedBinaryOp": [ - "Sub", + "Mul", { "Copy": { - "local": 1, + "local": 36, "projection": [] } }, @@ -3727,7 +3526,7 @@ } ] }, - "span": 67 + "span": 78 } ], "terminator": { @@ -3735,7 +3534,7 @@ "Assert": { "cond": { "Move": { - "local": 25, + "local": 38, "projection": [ { "Field": [ @@ -3749,10 +3548,10 @@ "expected": false, "msg": { "Overflow": [ - "Sub", + "Mul", { - "Copy": { - "local": 1, + "Move": { + "local": 36, "projection": [] } }, @@ -3764,11 +3563,11 @@ } ] }, - "target": 18, + "target": 29, "unwind": "Continue" } }, - "span": 67 + "span": 78 } }, { @@ -3777,13 +3576,13 @@ "kind": { "Assign": [ { - "local": 24, + "local": 35, "projection": [] }, { "Use": { "Move": { - "local": 25, + "local": 38, "projection": [ { "Field": [ @@ -3797,35 +3596,7 @@ } ] }, - "span": 67 - }, - { - "kind": { - "Assign": [ - { - "local": 21, - "projection": [] - }, - { - "BinaryOp": [ - "Ne", - { - "Move": { - "local": 22, - "projection": [] - } - }, - { - "Move": { - "local": 24, - "projection": [] - } - } - ] - } - ] - }, - "span": 68 + "span": 78 } ], "terminator": { @@ -3833,22 +3604,22 @@ "SwitchInt": { "discr": { "Move": { - "local": 21, + "local": 35, "projection": [] } }, "targets": { "branches": [ [ - 0, - 20 + 4294966876, + 30 ] ], - "otherwise": 19 + "otherwise": 31 } } }, - "span": 68 + "span": 79 } }, { @@ -3857,12 +3628,12 @@ "kind": { "Assign": [ { - "local": 28, + "local": 42, "projection": [] }, { - "CheckedBinaryOp": [ - "Mul", + "BinaryOp": [ + "Eq", { "Copy": { "local": 1, @@ -3870,16 +3641,35 @@ } }, { - "Copy": { - "local": 2, - "projection": [] - } - } + "Constant": { + "const_": { + "id": 16, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 0, + 0, + 0, + 128 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 80, + "user_ty": null + } + } ] } ] }, - "span": 69 + "span": 80 } ], "terminator": { @@ -3887,40 +3677,24 @@ "Assert": { "cond": { "Move": { - "local": 28, - "projection": [ - { - "Field": [ - 1, - 25 - ] - } - ] + "local": 42, + "projection": [] } }, "expected": false, "msg": { - "Overflow": [ - "Mul", - { - "Copy": { - "local": 1, - "projection": [] - } - }, - { - "Copy": { - "local": 2, - "projection": [] - } + "OverflowNeg": { + "Copy": { + "local": 1, + "projection": [] } - ] + } }, - "target": 21, + "target": 32, "unwind": "Continue" } }, - "span": 69 + "span": 80 } }, { @@ -3932,7 +3706,7 @@ { "Constant": { "const_": { - "id": 15, + "id": 19, "kind": { "Allocated": { "align": 8, @@ -3959,7 +3733,7 @@ "ptrs": [ [ 0, - 5 + 8 ] ] } @@ -3973,7 +3747,7 @@ } ], "destination": { - "local": 26, + "local": 39, "projection": [] }, "func": { @@ -3983,7 +3757,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 70, + "span": 81, "user_ty": null } }, @@ -3991,7 +3765,7 @@ "unwind": "Continue" } }, - "span": 70 + "span": 81 } }, { @@ -4000,59 +3774,29 @@ "kind": { "Assign": [ { - "local": 27, + "local": 41, "projection": [] }, { - "Use": { - "Move": { - "local": 28, - "projection": [ - { - "Field": [ - 0, - 16 - ] - } - ] + "UnaryOp": [ + "Neg", + { + "Copy": { + "local": 1, + "projection": [] + } } - } + ] } ] }, - "span": 69 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 27, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 420, - 22 - ] - ], - "otherwise": 23 - } - } + "span": 80 }, - "span": 71 - } - }, - { - "statements": [ { "kind": { "Assign": [ { - "local": 32, + "local": 44, "projection": [] }, { @@ -4085,7 +3829,7 @@ }, "ty": 16 }, - "span": 72, + "span": 82, "user_ty": null } } @@ -4093,7 +3837,7 @@ } ] }, - "span": 72 + "span": 82 } ], "terminator": { @@ -4101,7 +3845,7 @@ "Assert": { "cond": { "Move": { - "local": 32, + "local": 44, "projection": [] } }, @@ -4114,82 +3858,11 @@ } } }, - "target": 24, - "unwind": "Continue" - } - }, - "span": 72 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Constant": { - "const_": { - "id": 17, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 30, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 6 - ] - ] - } - } - }, - "ty": 27 - }, - "span": 32, - "user_ty": null - } - } - ], - "destination": { - "local": 29, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 9, - "kind": "ZeroSized", - "ty": 26 - }, - "span": 73, - "user_ty": null - } - }, - "target": null, + "target": 33, "unwind": "Continue" } }, - "span": 73 + "span": 82 } }, { @@ -4198,7 +3871,7 @@ "kind": { "Assign": [ { - "local": 31, + "local": 43, "projection": [] }, { @@ -4214,13 +3887,13 @@ } ] }, - "span": 72 + "span": 82 }, { "kind": { "Assign": [ { - "local": 33, + "local": 45, "projection": [] }, { @@ -4228,13 +3901,13 @@ "Mul", { "Copy": { - "local": 1, + "local": 41, "projection": [] } }, { "Copy": { - "local": 31, + "local": 43, "projection": [] } } @@ -4242,7 +3915,7 @@ } ] }, - "span": 74 + "span": 83 } ], "terminator": { @@ -4250,7 +3923,7 @@ "Assert": { "cond": { "Move": { - "local": 33, + "local": 45, "projection": [ { "Field": [ @@ -4266,24 +3939,24 @@ "Overflow": [ "Mul", { - "Copy": { - "local": 1, + "Move": { + "local": 41, "projection": [] } }, { "Move": { - "local": 31, + "local": 43, "projection": [] } } ] }, - "target": 25, + "target": 34, "unwind": "Continue" } }, - "span": 74 + "span": 83 } }, { @@ -4292,13 +3965,13 @@ "kind": { "Assign": [ { - "local": 30, + "local": 40, "projection": [] }, { "Use": { "Move": { - "local": 33, + "local": 45, "projection": [ { "Field": [ @@ -4312,7 +3985,7 @@ } ] }, - "span": 74 + "span": 83 } ], "terminator": { @@ -4320,22 +3993,22 @@ "SwitchInt": { "discr": { "Move": { - "local": 30, + "local": 40, "projection": [] } }, "targets": { "branches": [ [ - 4294966876, - 26 + 420, + 35 ] ], - "otherwise": 27 + "otherwise": 36 } } }, - "span": 75 + "span": 84 } }, { @@ -4344,30 +4017,49 @@ "kind": { "Assign": [ { - "local": 37, + "local": 47, "projection": [] }, { "BinaryOp": [ - "Eq", - { - "Copy": { - "local": 1, - "projection": [] - } - }, + "BitXor", { "Constant": { "const_": { - "id": 16, + "id": 20, "kind": { "Allocated": { "align": 4, "bytes": [ + 1, 0, 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 86, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 21, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 2, 0, - 128 + 0, + 0 ], "mutability": "Mut", "provenance": { @@ -4377,7 +4069,7 @@ }, "ty": 16 }, - "span": 76, + "span": 87, "user_ty": null } } @@ -4385,32 +4077,30 @@ } ] }, - "span": 76 + "span": 88 } ], "terminator": { "kind": { - "Assert": { - "cond": { + "SwitchInt": { + "discr": { "Move": { - "local": 37, + "local": 47, "projection": [] } }, - "expected": false, - "msg": { - "OverflowNeg": { - "Copy": { - "local": 1, - "projection": [] - } - } - }, - "target": 28, - "unwind": "Continue" + "targets": { + "branches": [ + [ + 3, + 37 + ] + ], + "otherwise": 38 + } } }, - "span": 76 + "span": 85 } }, { @@ -4422,7 +4112,7 @@ { "Constant": { "const_": { - "id": 18, + "id": 22, "kind": { "Allocated": { "align": 8, @@ -4449,7 +4139,7 @@ "ptrs": [ [ 0, - 7 + 9 ] ] } @@ -4463,7 +4153,7 @@ } ], "destination": { - "local": 34, + "local": 46, "projection": [] }, "func": { @@ -4473,7 +4163,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 77, + "span": 89, "user_ty": null } }, @@ -4481,153 +4171,7 @@ "unwind": "Continue" } }, - "span": 77 - } - }, - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 36, - "projection": [] - }, - { - "UnaryOp": [ - "Neg", - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - } - ] - }, - "span": 76 - }, - { - "kind": { - "Assign": [ - { - "local": 38, - "projection": [] - }, - { - "CheckedBinaryOp": [ - "Mul", - { - "Copy": { - "local": 36, - "projection": [] - } - }, - { - "Copy": { - "local": 2, - "projection": [] - } - } - ] - } - ] - }, - "span": 78 - } - ], - "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 38, - "projection": [ - { - "Field": [ - 1, - 25 - ] - } - ] - } - }, - "expected": false, - "msg": { - "Overflow": [ - "Mul", - { - "Move": { - "local": 36, - "projection": [] - } - }, - { - "Copy": { - "local": 2, - "projection": [] - } - } - ] - }, - "target": 29, - "unwind": "Continue" - } - }, - "span": 78 - } - }, - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 35, - "projection": [] - }, - { - "Use": { - "Move": { - "local": 38, - "projection": [ - { - "Field": [ - 0, - 16 - ] - } - ] - } - } - } - ] - }, - "span": 78 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 35, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 4294966876, - 30 - ] - ], - "otherwise": 31 - } - } - }, - "span": 79 + "span": 89 } }, { @@ -4636,30 +4180,49 @@ "kind": { "Assign": [ { - "local": 42, + "local": 49, "projection": [] }, { "BinaryOp": [ - "Eq", + "BitXor", { - "Copy": { - "local": 1, - "projection": [] + "Constant": { + "const_": { + "id": 20, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 91, + "user_ty": null } }, { "Constant": { "const_": { - "id": 16, + "id": 23, "kind": { "Allocated": { "align": 4, "bytes": [ + 3, 0, 0, - 0, - 128 + 0 ], "mutability": "Mut", "provenance": { @@ -4669,7 +4232,7 @@ }, "ty": 16 }, - "span": 80, + "span": 92, "user_ty": null } } @@ -4677,32 +4240,30 @@ } ] }, - "span": 80 + "span": 93 } ], "terminator": { "kind": { - "Assert": { - "cond": { - "Move": { - "local": 42, + "SwitchInt": { + "discr": { + "Move": { + "local": 49, "projection": [] } }, - "expected": false, - "msg": { - "OverflowNeg": { - "Copy": { - "local": 1, - "projection": [] - } - } - }, - "target": 32, - "unwind": "Continue" + "targets": { + "branches": [ + [ + 2, + 39 + ] + ], + "otherwise": 40 + } } }, - "span": 80 + "span": 90 } }, { @@ -4714,7 +4275,7 @@ { "Constant": { "const_": { - "id": 19, + "id": 24, "kind": { "Allocated": { "align": 8, @@ -4727,7 +4288,7 @@ 0, 0, 0, - 32, + 28, 0, 0, 0, @@ -4741,7 +4302,7 @@ "ptrs": [ [ 0, - 8 + 10 ] ] } @@ -4755,7 +4316,7 @@ } ], "destination": { - "local": 39, + "local": 48, "projection": [] }, "func": { @@ -4765,7 +4326,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 81, + "span": 94, "user_ty": null } }, @@ -4773,7 +4334,7 @@ "unwind": "Continue" } }, - "span": 81 + "span": 94 } }, { @@ -4782,52 +4343,49 @@ "kind": { "Assign": [ { - "local": 41, - "projection": [] - }, - { - "UnaryOp": [ - "Neg", - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - } - ] - }, - "span": 80 - }, - { - "kind": { - "Assign": [ - { - "local": 44, + "local": 51, "projection": [] }, { "BinaryOp": [ - "Eq", + "BitOr", { - "Copy": { - "local": 2, - "projection": [] + "Constant": { + "const_": { + "id": 20, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 96, + "user_ty": null } }, { "Constant": { "const_": { - "id": 16, + "id": 21, "kind": { "Allocated": { "align": 4, "bytes": [ + 2, 0, 0, - 0, - 128 + 0 ], "mutability": "Mut", "provenance": { @@ -4837,7 +4395,7 @@ }, "ty": 16 }, - "span": 82, + "span": 97, "user_ty": null } } @@ -4845,32 +4403,101 @@ } ] }, - "span": 82 + "span": 98 } ], "terminator": { "kind": { - "Assert": { - "cond": { + "SwitchInt": { + "discr": { "Move": { - "local": 44, + "local": 51, "projection": [] } }, - "expected": false, - "msg": { - "OverflowNeg": { - "Copy": { - "local": 2, - "projection": [] + "targets": { + "branches": [ + [ + 3, + 41 + ] + ], + "otherwise": 42 + } + } + }, + "span": 95 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 25, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 28, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 11 + ] + ] + } + } + }, + "ty": 27 + }, + "span": 32, + "user_ty": null } } + ], + "destination": { + "local": 50, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 9, + "kind": "ZeroSized", + "ty": 26 + }, + "span": 99, + "user_ty": null + } }, - "target": 33, + "target": null, "unwind": "Continue" } }, - "span": 82 + "span": 99 } }, { @@ -4879,144 +4506,161 @@ "kind": { "Assign": [ { - "local": 43, + "local": 53, "projection": [] }, { - "UnaryOp": [ - "Neg", + "BinaryOp": [ + "BitOr", { - "Copy": { - "local": 2, - "projection": [] + "Constant": { + "const_": { + "id": 20, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 101, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 23, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 3, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 102, + "user_ty": null } } ] } ] }, - "span": 82 - }, - { - "kind": { - "Assign": [ - { - "local": 45, - "projection": [] - }, - { - "CheckedBinaryOp": [ - "Mul", - { - "Copy": { - "local": 41, - "projection": [] - } - }, - { - "Copy": { - "local": 43, - "projection": [] - } - } - ] - } - ] - }, - "span": 83 + "span": 103 } ], "terminator": { "kind": { - "Assert": { - "cond": { + "SwitchInt": { + "discr": { "Move": { - "local": 45, - "projection": [ - { - "Field": [ - 1, - 25 - ] - } - ] + "local": 53, + "projection": [] } }, - "expected": false, - "msg": { - "Overflow": [ - "Mul", - { - "Move": { - "local": 41, - "projection": [] - } - }, - { - "Move": { - "local": 43, - "projection": [] - } - } - ] - }, - "target": 34, - "unwind": "Continue" + "targets": { + "branches": [ + [ + 3, + 43 + ] + ], + "otherwise": 44 + } } }, - "span": 83 + "span": 100 } }, { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 40, - "projection": [] - }, + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ { - "Use": { - "Move": { - "local": 45, - "projection": [ - { - "Field": [ + "Constant": { + "const_": { + "id": 26, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ 0, - 16 - ] + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 28, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 12 + ] + ] + } } - ] - } + }, + "ty": 27 + }, + "span": 32, + "user_ty": null } } - ] - }, - "span": 83 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 40, - "projection": [] + ], + "destination": { + "local": 52, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 9, + "kind": "ZeroSized", + "ty": 26 + }, + "span": 104, + "user_ty": null } }, - "targets": { - "branches": [ - [ - 420, - 35 - ] - ], - "otherwise": 36 - } + "target": null, + "unwind": "Continue" } }, - "span": 84 + "span": 104 } }, { @@ -5025,12 +4669,12 @@ "kind": { "Assign": [ { - "local": 47, + "local": 55, "projection": [] }, { "BinaryOp": [ - "BitXor", + "BitAnd", { "Constant": { "const_": { @@ -5052,7 +4696,7 @@ }, "ty": 16 }, - "span": 86, + "span": 106, "user_ty": null } }, @@ -5077,7 +4721,7 @@ }, "ty": 16 }, - "span": 87, + "span": 107, "user_ty": null } } @@ -5085,7 +4729,7 @@ } ] }, - "span": 88 + "span": 108 } ], "terminator": { @@ -5093,22 +4737,22 @@ "SwitchInt": { "discr": { "Move": { - "local": 47, + "local": 55, "projection": [] } }, "targets": { "branches": [ [ - 3, - 37 + 0, + 45 ] ], - "otherwise": 38 + "otherwise": 46 } } }, - "span": 85 + "span": 105 } }, { @@ -5120,7 +4764,7 @@ { "Constant": { "const_": { - "id": 22, + "id": 27, "kind": { "Allocated": { "align": 8, @@ -5133,7 +4777,7 @@ 0, 0, 0, - 32, + 28, 0, 0, 0, @@ -5147,7 +4791,7 @@ "ptrs": [ [ 0, - 9 + 13 ] ] } @@ -5161,7 +4805,7 @@ } ], "destination": { - "local": 46, + "local": 54, "projection": [] }, "func": { @@ -5171,7 +4815,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 89, + "span": 109, "user_ty": null } }, @@ -5179,7 +4823,7 @@ "unwind": "Continue" } }, - "span": 89 + "span": 109 } }, { @@ -5188,12 +4832,12 @@ "kind": { "Assign": [ { - "local": 49, + "local": 57, "projection": [] }, { "BinaryOp": [ - "BitXor", + "BitAnd", { "Constant": { "const_": { @@ -5215,7 +4859,7 @@ }, "ty": 16 }, - "span": 91, + "span": 111, "user_ty": null } }, @@ -5240,7 +4884,7 @@ }, "ty": 16 }, - "span": 92, + "span": 112, "user_ty": null } } @@ -5248,7 +4892,7 @@ } ] }, - "span": 93 + "span": 113 } ], "terminator": { @@ -5256,22 +4900,22 @@ "SwitchInt": { "discr": { "Move": { - "local": 49, + "local": 57, "projection": [] } }, "targets": { "branches": [ [ - 2, - 39 + 1, + 47 ] ], - "otherwise": 40 + "otherwise": 48 } } }, - "span": 90 + "span": 110 } }, { @@ -5283,7 +4927,7 @@ { "Constant": { "const_": { - "id": 24, + "id": 28, "kind": { "Allocated": { "align": 8, @@ -5310,7 +4954,7 @@ "ptrs": [ [ 0, - 10 + 14 ] ] } @@ -5324,7 +4968,7 @@ } ], "destination": { - "local": 48, + "local": 56, "projection": [] }, "func": { @@ -5334,7 +4978,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 94, + "span": 114, "user_ty": null } }, @@ -5342,7 +4986,7 @@ "unwind": "Continue" } }, - "span": 94 + "span": 114 } }, { @@ -5351,12 +4995,12 @@ "kind": { "Assign": [ { - "local": 51, + "local": 60, "projection": [] }, { - "BinaryOp": [ - "BitOr", + "Cast": [ + "IntToInt", { "Constant": { "const_": { @@ -5378,19 +5022,42 @@ }, "ty": 16 }, - "span": 96, + "span": 116, "user_ty": null } }, + 28 + ] + } + ] + }, + "span": 117 + }, + { + "kind": { + "Assign": [ + { + "local": 61, + "projection": [] + }, + { + "BinaryOp": [ + "Lt", { - "Constant": { - "const_": { - "id": 21, + "Move": { + "local": 60, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 29, "kind": { "Allocated": { "align": 4, "bytes": [ - 2, + 32, 0, 0, 0 @@ -5401,9 +5068,9 @@ } } }, - "ty": 16 + "ty": 28 }, - "span": 97, + "span": 117, "user_ty": null } } @@ -5411,30 +5078,79 @@ } ] }, - "span": 98 + "span": 117 } ], "terminator": { "kind": { - "SwitchInt": { - "discr": { + "Assert": { + "cond": { "Move": { - "local": 51, + "local": 61, "projection": [] } }, - "targets": { - "branches": [ - [ - 3, - 41 - ] - ], - "otherwise": 42 - } + "expected": true, + "msg": { + "Overflow": [ + "Shl", + { + "Constant": { + "const_": { + "id": 21, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 2, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 115, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 20, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 116, + "user_ty": null + } + } + ] + }, + "target": 49, + "unwind": "Continue" } }, - "span": 95 + "span": 117 } }, { @@ -5446,7 +5162,7 @@ { "Constant": { "const_": { - "id": 25, + "id": 30, "kind": { "Allocated": { "align": 8, @@ -5473,7 +5189,7 @@ "ptrs": [ [ 0, - 11 + 15 ] ] } @@ -5487,7 +5203,7 @@ } ], "destination": { - "local": 50, + "local": 58, "projection": [] }, "func": { @@ -5497,7 +5213,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 99, + "span": 118, "user_ty": null } }, @@ -5505,7 +5221,7 @@ "unwind": "Continue" } }, - "span": 99 + "span": 118 } }, { @@ -5514,21 +5230,21 @@ "kind": { "Assign": [ { - "local": 53, + "local": 59, "projection": [] }, { "BinaryOp": [ - "BitOr", + "Shl", { "Constant": { "const_": { - "id": 20, + "id": 21, "kind": { "Allocated": { "align": 4, "bytes": [ - 1, + 2, 0, 0, 0 @@ -5541,19 +5257,19 @@ }, "ty": 16 }, - "span": 101, + "span": 115, "user_ty": null } }, { "Constant": { "const_": { - "id": 23, + "id": 20, "kind": { "Allocated": { "align": 4, "bytes": [ - 3, + 1, 0, 0, 0 @@ -5566,7 +5282,7 @@ }, "ty": 16 }, - "span": 102, + "span": 116, "user_ty": null } } @@ -5574,7 +5290,7 @@ } ] }, - "span": 103 + "span": 117 } ], "terminator": { @@ -5582,93 +5298,22 @@ "SwitchInt": { "discr": { "Move": { - "local": 53, + "local": 59, "projection": [] } }, "targets": { "branches": [ [ - 3, - 43 + 4, + 50 ] ], - "otherwise": 44 + "otherwise": 51 } } }, - "span": 100 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Constant": { - "const_": { - "id": 26, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 28, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 12 - ] - ] - } - } - }, - "ty": 27 - }, - "span": 32, - "user_ty": null - } - } - ], - "destination": { - "local": 52, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 9, - "kind": "ZeroSized", - "ty": 26 - }, - "span": 104, - "user_ty": null - } - }, - "target": null, - "unwind": "Continue" - } - }, - "span": 104 + "span": 119 } }, { @@ -5677,12 +5322,12 @@ "kind": { "Assign": [ { - "local": 55, + "local": 64, "projection": [] }, { - "BinaryOp": [ - "BitAnd", + "Cast": [ + "IntToInt", { "Constant": { "const_": { @@ -5704,19 +5349,42 @@ }, "ty": 16 }, - "span": 106, + "span": 121, "user_ty": null } }, + 28 + ] + } + ] + }, + "span": 122 + }, + { + "kind": { + "Assign": [ + { + "local": 65, + "projection": [] + }, + { + "BinaryOp": [ + "Lt", + { + "Move": { + "local": 64, + "projection": [] + } + }, { "Constant": { "const_": { - "id": 21, + "id": 29, "kind": { "Allocated": { "align": 4, "bytes": [ - 2, + 32, 0, 0, 0 @@ -5727,9 +5395,9 @@ } } }, - "ty": 16 + "ty": 28 }, - "span": 107, + "span": 122, "user_ty": null } } @@ -5737,30 +5405,79 @@ } ] }, - "span": 108 + "span": 122 } ], "terminator": { "kind": { - "SwitchInt": { - "discr": { + "Assert": { + "cond": { "Move": { - "local": 55, + "local": 65, "projection": [] } }, - "targets": { - "branches": [ - [ - 0, - 45 - ] - ], - "otherwise": 46 - } + "expected": true, + "msg": { + "Overflow": [ + "Shr", + { + "Constant": { + "const_": { + "id": 21, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 2, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 120, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 20, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 121, + "user_ty": null + } + } + ] + }, + "target": 52, + "unwind": "Continue" } }, - "span": 105 + "span": 122 } }, { @@ -5772,7 +5489,7 @@ { "Constant": { "const_": { - "id": 27, + "id": 31, "kind": { "Allocated": { "align": 8, @@ -5785,7 +5502,7 @@ 0, 0, 0, - 28, + 29, 0, 0, 0, @@ -5799,7 +5516,7 @@ "ptrs": [ [ 0, - 13 + 16 ] ] } @@ -5813,7 +5530,7 @@ } ], "destination": { - "local": 54, + "local": 62, "projection": [] }, "func": { @@ -5823,7 +5540,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 109, + "span": 123, "user_ty": null } }, @@ -5831,7 +5548,7 @@ "unwind": "Continue" } }, - "span": 109 + "span": 123 } }, { @@ -5840,21 +5557,21 @@ "kind": { "Assign": [ { - "local": 57, + "local": 63, "projection": [] }, { "BinaryOp": [ - "BitAnd", + "Shr", { "Constant": { "const_": { - "id": 20, + "id": 21, "kind": { "Allocated": { "align": 4, "bytes": [ - 1, + 2, 0, 0, 0 @@ -5867,19 +5584,19 @@ }, "ty": 16 }, - "span": 111, + "span": 120, "user_ty": null } }, { "Constant": { "const_": { - "id": 23, + "id": 20, "kind": { "Allocated": { "align": 4, "bytes": [ - 3, + 1, 0, 0, 0 @@ -5892,7 +5609,7 @@ }, "ty": 16 }, - "span": 112, + "span": 121, "user_ty": null } } @@ -5900,7 +5617,7 @@ } ] }, - "span": 113 + "span": 122 } ], "terminator": { @@ -5908,7 +5625,7 @@ "SwitchInt": { "discr": { "Move": { - "local": 57, + "local": 63, "projection": [] } }, @@ -5916,85 +5633,14 @@ "branches": [ [ 1, - 47 + 53 ] ], - "otherwise": 48 + "otherwise": 54 } } }, - "span": 110 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Constant": { - "const_": { - "id": 28, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 28, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 14 - ] - ] - } - } - }, - "ty": 27 - }, - "span": 32, - "user_ty": null - } - } - ], - "destination": { - "local": 56, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 9, - "kind": "ZeroSized", - "ty": 26 - }, - "span": 114, - "user_ty": null - } - }, - "target": null, - "unwind": "Continue" - } - }, - "span": 114 + "span": 124 } }, { @@ -6003,7 +5649,7 @@ "kind": { "Assign": [ { - "local": 60, + "local": 68, "projection": [] }, { @@ -6030,7 +5676,7 @@ }, "ty": 16 }, - "span": 116, + "span": 126, "user_ty": null } }, @@ -6039,13 +5685,13 @@ } ] }, - "span": 117 + "span": 127 }, { "kind": { "Assign": [ { - "local": 61, + "local": 69, "projection": [] }, { @@ -6053,7 +5699,7 @@ "Lt", { "Move": { - "local": 60, + "local": 68, "projection": [] } }, @@ -6078,7 +5724,7 @@ }, "ty": 28 }, - "span": 117, + "span": 127, "user_ty": null } } @@ -6086,7 +5732,7 @@ } ] }, - "span": 117 + "span": 127 } ], "terminator": { @@ -6094,23 +5740,23 @@ "Assert": { "cond": { "Move": { - "local": 61, + "local": 69, "projection": [] } }, "expected": true, "msg": { "Overflow": [ - "Shl", + "Shr", { "Constant": { "const_": { - "id": 21, + "id": 23, "kind": { "Allocated": { "align": 4, "bytes": [ - 2, + 3, 0, 0, 0 @@ -6123,7 +5769,7 @@ }, "ty": 16 }, - "span": 115, + "span": 125, "user_ty": null } }, @@ -6148,17 +5794,17 @@ }, "ty": 16 }, - "span": 116, + "span": 126, "user_ty": null } } ] }, - "target": 49, + "target": 55, "unwind": "Continue" } }, - "span": 117 + "span": 127 } }, { @@ -6170,7 +5816,7 @@ { "Constant": { "const_": { - "id": 30, + "id": 32, "kind": { "Allocated": { "align": 8, @@ -6183,7 +5829,7 @@ 0, 0, 0, - 28, + 29, 0, 0, 0, @@ -6197,7 +5843,7 @@ "ptrs": [ [ 0, - 15 + 17 ] ] } @@ -6211,7 +5857,7 @@ } ], "destination": { - "local": 58, + "local": 66, "projection": [] }, "func": { @@ -6221,7 +5867,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 118, + "span": 128, "user_ty": null } }, @@ -6229,7 +5875,7 @@ "unwind": "Continue" } }, - "span": 118 + "span": 128 } }, { @@ -6238,21 +5884,21 @@ "kind": { "Assign": [ { - "local": 59, + "local": 67, "projection": [] }, { "BinaryOp": [ - "Shl", + "Shr", { "Constant": { "const_": { - "id": 21, + "id": 23, "kind": { "Allocated": { "align": 4, "bytes": [ - 2, + 3, 0, 0, 0 @@ -6265,7 +5911,7 @@ }, "ty": 16 }, - "span": 115, + "span": 125, "user_ty": null } }, @@ -6290,7 +5936,7 @@ }, "ty": 16 }, - "span": 116, + "span": 126, "user_ty": null } } @@ -6298,7 +5944,7 @@ } ] }, - "span": 117 + "span": 127 } ], "terminator": { @@ -6306,22 +5952,22 @@ "SwitchInt": { "discr": { "Move": { - "local": 59, + "local": 67, "projection": [] } }, "targets": { "branches": [ [ - 4, - 50 + 1, + 56 ] ], - "otherwise": 51 + "otherwise": 57 } } }, - "span": 119 + "span": 129 } }, { @@ -6330,7 +5976,7 @@ "kind": { "Assign": [ { - "local": 64, + "local": 72, "projection": [] }, { @@ -6357,7 +6003,7 @@ }, "ty": 16 }, - "span": 121, + "span": 131, "user_ty": null } }, @@ -6366,13 +6012,13 @@ } ] }, - "span": 122 + "span": 132 }, { "kind": { "Assign": [ { - "local": 65, + "local": 73, "projection": [] }, { @@ -6380,7 +6026,7 @@ "Lt", { "Move": { - "local": 64, + "local": 72, "projection": [] } }, @@ -6405,7 +6051,7 @@ }, "ty": 28 }, - "span": 122, + "span": 132, "user_ty": null } } @@ -6413,7 +6059,7 @@ } ] }, - "span": 122 + "span": 132 } ], "terminator": { @@ -6421,7 +6067,7 @@ "Assert": { "cond": { "Move": { - "local": 65, + "local": 73, "projection": [] } }, @@ -6432,12 +6078,12 @@ { "Constant": { "const_": { - "id": 21, + "id": 20, "kind": { "Allocated": { "align": 4, "bytes": [ - 2, + 1, 0, 0, 0 @@ -6450,7 +6096,7 @@ }, "ty": 16 }, - "span": 120, + "span": 130, "user_ty": null } }, @@ -6475,17 +6121,17 @@ }, "ty": 16 }, - "span": 121, + "span": 131, "user_ty": null } } ] }, - "target": 52, + "target": 58, "unwind": "Continue" } }, - "span": 122 + "span": 132 } }, { @@ -6497,7 +6143,7 @@ { "Constant": { "const_": { - "id": 31, + "id": 33, "kind": { "Allocated": { "align": 8, @@ -6524,7 +6170,7 @@ "ptrs": [ [ 0, - 16 + 18 ] ] } @@ -6538,7 +6184,7 @@ } ], "destination": { - "local": 62, + "local": 70, "projection": [] }, "func": { @@ -6548,7 +6194,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 123, + "span": 133, "user_ty": null } }, @@ -6556,7 +6202,7 @@ "unwind": "Continue" } }, - "span": 123 + "span": 133 } }, { @@ -6565,7 +6211,7 @@ "kind": { "Assign": [ { - "local": 63, + "local": 71, "projection": [] }, { @@ -6574,12 +6220,12 @@ { "Constant": { "const_": { - "id": 21, + "id": 20, "kind": { "Allocated": { "align": 4, "bytes": [ - 2, + 1, 0, 0, 0 @@ -6592,7 +6238,7 @@ }, "ty": 16 }, - "span": 120, + "span": 130, "user_ty": null } }, @@ -6617,7 +6263,7 @@ }, "ty": 16 }, - "span": 121, + "span": 131, "user_ty": null } } @@ -6625,7 +6271,7 @@ } ] }, - "span": 122 + "span": 132 } ], "terminator": { @@ -6633,22 +6279,22 @@ "SwitchInt": { "discr": { "Move": { - "local": 63, + "local": 71, "projection": [] } }, "targets": { "branches": [ [ - 1, - 53 + 0, + 59 ] ], - "otherwise": 54 + "otherwise": 60 } } }, - "span": 124 + "span": 134 } }, { @@ -6657,90 +6303,29 @@ "kind": { "Assign": [ { - "local": 68, - "projection": [] - }, - { - "Cast": [ - "IntToInt", - { - "Constant": { - "const_": { - "id": 20, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 126, - "user_ty": null - } - }, - 28 - ] - } - ] - }, - "span": 127 - }, - { - "kind": { - "Assign": [ - { - "local": 69, + "local": 77, "projection": [] }, { - "BinaryOp": [ - "Lt", + "CheckedBinaryOp": [ + "Add", { - "Move": { - "local": 68, + "Copy": { + "local": 1, "projection": [] } }, { - "Constant": { - "const_": { - "id": 29, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 32, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 28 - }, - "span": 127, - "user_ty": null + "Copy": { + "local": 2, + "projection": [] } } ] } ] }, - "span": 127 + "span": 135 } ], "terminator": { @@ -6748,71 +6333,40 @@ "Assert": { "cond": { "Move": { - "local": 69, - "projection": [] + "local": 77, + "projection": [ + { + "Field": [ + 1, + 25 + ] + } + ] } }, - "expected": true, + "expected": false, "msg": { "Overflow": [ - "Shr", + "Add", { - "Constant": { - "const_": { - "id": 23, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 3, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 125, - "user_ty": null + "Copy": { + "local": 1, + "projection": [] } }, { - "Constant": { - "const_": { - "id": 20, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 126, - "user_ty": null + "Copy": { + "local": 2, + "projection": [] } } ] }, - "target": 55, + "target": 61, "unwind": "Continue" } }, - "span": 127 + "span": 135 } }, { @@ -6824,7 +6378,7 @@ { "Constant": { "const_": { - "id": 32, + "id": 34, "kind": { "Allocated": { "align": 8, @@ -6851,7 +6405,7 @@ "ptrs": [ [ 0, - 17 + 19 ] ] } @@ -6865,7 +6419,7 @@ } ], "destination": { - "local": 66, + "local": 74, "projection": [] }, "func": { @@ -6875,7 +6429,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 128, + "span": 136, "user_ty": null } }, @@ -6883,7 +6437,7 @@ "unwind": "Continue" } }, - "span": 128 + "span": 136 } }, { @@ -6892,67 +6446,55 @@ "kind": { "Assign": [ { - "local": 67, + "local": 76, + "projection": [] + }, + { + "Use": { + "Move": { + "local": 77, + "projection": [ + { + "Field": [ + 0, + 16 + ] + } + ] + } + } + } + ] + }, + "span": 135 + }, + { + "kind": { + "Assign": [ + { + "local": 75, "projection": [] }, { "BinaryOp": [ - "Shr", + "Lt", { - "Constant": { - "const_": { - "id": 23, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 3, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 125, - "user_ty": null + "Copy": { + "local": 1, + "projection": [] } }, { - "Constant": { - "const_": { - "id": 20, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 126, - "user_ty": null + "Move": { + "local": 76, + "projection": [] } } ] } ] }, - "span": 127 + "span": 137 } ], "terminator": { @@ -6960,22 +6502,22 @@ "SwitchInt": { "discr": { "Move": { - "local": 67, + "local": 75, "projection": [] } }, "targets": { "branches": [ [ - 1, - 56 + 0, + 63 ] ], - "otherwise": 57 + "otherwise": 62 } } }, - "span": 129 + "span": 137 } }, { @@ -6984,90 +6526,29 @@ "kind": { "Assign": [ { - "local": 72, - "projection": [] - }, - { - "Cast": [ - "IntToInt", - { - "Constant": { - "const_": { - "id": 20, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 131, - "user_ty": null - } - }, - 28 - ] - } - ] - }, - "span": 132 - }, - { - "kind": { - "Assign": [ - { - "local": 73, + "local": 81, "projection": [] }, { - "BinaryOp": [ - "Lt", + "CheckedBinaryOp": [ + "Add", { - "Move": { - "local": 72, + "Copy": { + "local": 1, "projection": [] } }, { - "Constant": { - "const_": { - "id": 29, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 32, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 28 - }, - "span": 132, - "user_ty": null + "Copy": { + "local": 2, + "projection": [] } } ] } ] }, - "span": 132 + "span": 138 } ], "terminator": { @@ -7075,71 +6556,40 @@ "Assert": { "cond": { "Move": { - "local": 73, - "projection": [] + "local": 81, + "projection": [ + { + "Field": [ + 1, + 25 + ] + } + ] } }, - "expected": true, + "expected": false, "msg": { "Overflow": [ - "Shr", + "Add", { - "Constant": { - "const_": { - "id": 20, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 130, - "user_ty": null + "Copy": { + "local": 1, + "projection": [] } }, { - "Constant": { - "const_": { - "id": 20, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 131, - "user_ty": null + "Copy": { + "local": 2, + "projection": [] } } ] }, - "target": 58, + "target": 64, "unwind": "Continue" } }, - "span": 132 + "span": 138 } }, { @@ -7151,7 +6601,7 @@ { "Constant": { "const_": { - "id": 33, + "id": 35, "kind": { "Allocated": { "align": 8, @@ -7164,7 +6614,7 @@ 0, 0, 0, - 29, + 27, 0, 0, 0, @@ -7178,7 +6628,7 @@ "ptrs": [ [ 0, - 18 + 20 ] ] } @@ -7192,7 +6642,7 @@ } ], "destination": { - "local": 70, + "local": 78, "projection": [] }, "func": { @@ -7202,7 +6652,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 133, + "span": 139, "user_ty": null } }, @@ -7210,7 +6660,7 @@ "unwind": "Continue" } }, - "span": 133 + "span": 139 } }, { @@ -7219,67 +6669,55 @@ "kind": { "Assign": [ { - "local": 71, + "local": 80, + "projection": [] + }, + { + "Use": { + "Move": { + "local": 81, + "projection": [ + { + "Field": [ + 0, + 16 + ] + } + ] + } + } + } + ] + }, + "span": 138 + }, + { + "kind": { + "Assign": [ + { + "local": 79, "projection": [] }, { "BinaryOp": [ - "Shr", + "Le", { - "Constant": { - "const_": { - "id": 20, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 130, - "user_ty": null + "Copy": { + "local": 1, + "projection": [] } }, { - "Constant": { - "const_": { - "id": 20, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 131, - "user_ty": null + "Move": { + "local": 80, + "projection": [] } } ] } ] }, - "span": 132 + "span": 140 } ], "terminator": { @@ -7287,7 +6725,7 @@ "SwitchInt": { "discr": { "Move": { - "local": 71, + "local": 79, "projection": [] } }, @@ -7295,14 +6733,14 @@ "branches": [ [ 0, - 59 + 66 ] ], - "otherwise": 60 + "otherwise": 65 } } }, - "span": 134 + "span": 140 } }, { @@ -7311,7 +6749,7 @@ "kind": { "Assign": [ { - "local": 77, + "local": 86, "projection": [] }, { @@ -7333,7 +6771,7 @@ } ] }, - "span": 135 + "span": 141 } ], "terminator": { @@ -7341,7 +6779,7 @@ "Assert": { "cond": { "Move": { - "local": 77, + "local": 86, "projection": [ { "Field": [ @@ -7370,11 +6808,11 @@ } ] }, - "target": 61, + "target": 67, "unwind": "Continue" } }, - "span": 135 + "span": 141 } }, { @@ -7386,7 +6824,7 @@ { "Constant": { "const_": { - "id": 34, + "id": 36, "kind": { "Allocated": { "align": 8, @@ -7399,7 +6837,7 @@ 0, 0, 0, - 29, + 28, 0, 0, 0, @@ -7413,7 +6851,7 @@ "ptrs": [ [ 0, - 19 + 21 ] ] } @@ -7427,7 +6865,7 @@ } ], "destination": { - "local": 74, + "local": 82, "projection": [] }, "func": { @@ -7437,7 +6875,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 136, + "span": 142, "user_ty": null } }, @@ -7445,7 +6883,7 @@ "unwind": "Continue" } }, - "span": 136 + "span": 142 } }, { @@ -7454,13 +6892,13 @@ "kind": { "Assign": [ { - "local": 76, + "local": 85, "projection": [] }, { "Use": { "Move": { - "local": 77, + "local": 86, "projection": [ { "Field": [ @@ -7474,18 +6912,116 @@ } ] }, - "span": 135 + "span": 141 }, { "kind": { "Assign": [ { - "local": 75, + "local": 87, + "projection": [] + }, + { + "CheckedBinaryOp": [ + "Sub", + { + "Copy": { + "local": 85, + "projection": [] + } + }, + { + "Copy": { + "local": 2, + "projection": [] + } + } + ] + } + ] + }, + "span": 143 + } + ], + "terminator": { + "kind": { + "Assert": { + "cond": { + "Move": { + "local": 87, + "projection": [ + { + "Field": [ + 1, + 25 + ] + } + ] + } + }, + "expected": false, + "msg": { + "Overflow": [ + "Sub", + { + "Move": { + "local": 85, + "projection": [] + } + }, + { + "Copy": { + "local": 2, + "projection": [] + } + } + ] + }, + "target": 68, + "unwind": "Continue" + } + }, + "span": 143 + } + }, + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 84, + "projection": [] + }, + { + "Use": { + "Move": { + "local": 87, + "projection": [ + { + "Field": [ + 0, + 16 + ] + } + ] + } + } + } + ] + }, + "span": 143 + }, + { + "kind": { + "Assign": [ + { + "local": 83, "projection": [] }, { "BinaryOp": [ - "Lt", + "Le", { "Copy": { "local": 1, @@ -7494,7 +7030,7 @@ }, { "Move": { - "local": 76, + "local": 84, "projection": [] } } @@ -7502,7 +7038,7 @@ } ] }, - "span": 137 + "span": 144 } ], "terminator": { @@ -7510,7 +7046,7 @@ "SwitchInt": { "discr": { "Move": { - "local": 75, + "local": 83, "projection": [] } }, @@ -7518,14 +7054,14 @@ "branches": [ [ 0, - 63 + 70 ] ], - "otherwise": 62 + "otherwise": 69 } } }, - "span": 137 + "span": 144 } }, { @@ -7534,7 +7070,7 @@ "kind": { "Assign": [ { - "local": 81, + "local": 91, "projection": [] }, { @@ -7556,7 +7092,7 @@ } ] }, - "span": 138 + "span": 145 } ], "terminator": { @@ -7564,7 +7100,7 @@ "Assert": { "cond": { "Move": { - "local": 81, + "local": 91, "projection": [ { "Field": [ @@ -7593,11 +7129,11 @@ } ] }, - "target": 64, + "target": 71, "unwind": "Continue" } }, - "span": 138 + "span": 145 } }, { @@ -7609,7 +7145,7 @@ { "Constant": { "const_": { - "id": 35, + "id": 37, "kind": { "Allocated": { "align": 8, @@ -7622,7 +7158,7 @@ 0, 0, 0, - 27, + 32, 0, 0, 0, @@ -7636,7 +7172,7 @@ "ptrs": [ [ 0, - 20 + 22 ] ] } @@ -7650,7 +7186,7 @@ } ], "destination": { - "local": 78, + "local": 88, "projection": [] }, "func": { @@ -7660,7 +7196,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 139, + "span": 146, "user_ty": null } }, @@ -7668,7 +7204,7 @@ "unwind": "Continue" } }, - "span": 139 + "span": 146 } }, { @@ -7677,13 +7213,13 @@ "kind": { "Assign": [ { - "local": 80, + "local": 90, "projection": [] }, { "Use": { "Move": { - "local": 81, + "local": 91, "projection": [ { "Field": [ @@ -7697,27 +7233,27 @@ } ] }, - "span": 138 + "span": 145 }, { "kind": { "Assign": [ { - "local": 79, + "local": 89, "projection": [] }, { "BinaryOp": [ - "Le", + "Gt", { - "Copy": { - "local": 1, + "Move": { + "local": 90, "projection": [] } }, { - "Move": { - "local": 80, + "Copy": { + "local": 1, "projection": [] } } @@ -7725,7 +7261,7 @@ } ] }, - "span": 140 + "span": 147 } ], "terminator": { @@ -7733,7 +7269,7 @@ "SwitchInt": { "discr": { "Move": { - "local": 79, + "local": 89, "projection": [] } }, @@ -7741,14 +7277,14 @@ "branches": [ [ 0, - 66 + 73 ] ], - "otherwise": 65 + "otherwise": 72 } } }, - "span": 140 + "span": 147 } }, { @@ -7757,7 +7293,7 @@ "kind": { "Assign": [ { - "local": 86, + "local": 95, "projection": [] }, { @@ -7779,7 +7315,7 @@ } ] }, - "span": 141 + "span": 148 } ], "terminator": { @@ -7787,7 +7323,7 @@ "Assert": { "cond": { "Move": { - "local": 86, + "local": 95, "projection": [ { "Field": [ @@ -7816,11 +7352,11 @@ } ] }, - "target": 67, + "target": 74, "unwind": "Continue" } }, - "span": 141 + "span": 148 } }, { @@ -7832,7 +7368,7 @@ { "Constant": { "const_": { - "id": 36, + "id": 38, "kind": { "Allocated": { "align": 8, @@ -7845,7 +7381,7 @@ 0, 0, 0, - 28, + 27, 0, 0, 0, @@ -7859,7 +7395,7 @@ "ptrs": [ [ 0, - 21 + 23 ] ] } @@ -7873,7 +7409,7 @@ } ], "destination": { - "local": 82, + "local": 92, "projection": [] }, "func": { @@ -7883,7 +7419,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 142, + "span": 149, "user_ty": null } }, @@ -7891,7 +7427,7 @@ "unwind": "Continue" } }, - "span": 142 + "span": 149 } }, { @@ -7900,13 +7436,13 @@ "kind": { "Assign": [ { - "local": 85, + "local": 94, "projection": [] }, { "Use": { "Move": { - "local": 86, + "local": 95, "projection": [ { "Field": [ @@ -7920,133 +7456,35 @@ } ] }, - "span": 141 + "span": 148 }, { "kind": { "Assign": [ { - "local": 87, + "local": 93, "projection": [] }, { - "CheckedBinaryOp": [ - "Sub", + "BinaryOp": [ + "Ge", { - "Copy": { - "local": 85, + "Move": { + "local": 94, "projection": [] } }, - { - "Copy": { - "local": 2, - "projection": [] - } - } - ] - } - ] - }, - "span": 143 - } - ], - "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 87, - "projection": [ - { - "Field": [ - 1, - 25 - ] - } - ] - } - }, - "expected": false, - "msg": { - "Overflow": [ - "Sub", - { - "Move": { - "local": 85, - "projection": [] - } - }, - { - "Copy": { - "local": 2, - "projection": [] - } - } - ] - }, - "target": 68, - "unwind": "Continue" - } - }, - "span": 143 - } - }, - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 84, - "projection": [] - }, - { - "Use": { - "Move": { - "local": 87, - "projection": [ - { - "Field": [ - 0, - 16 - ] - } - ] - } - } - } - ] - }, - "span": 143 - }, - { - "kind": { - "Assign": [ - { - "local": 83, - "projection": [] - }, - { - "BinaryOp": [ - "Le", { "Copy": { "local": 1, "projection": [] } - }, - { - "Move": { - "local": 84, - "projection": [] - } } ] } ] }, - "span": 144 + "span": 150 } ], "terminator": { @@ -8054,7 +7492,7 @@ "SwitchInt": { "discr": { "Move": { - "local": 83, + "local": 93, "projection": [] } }, @@ -8062,14 +7500,14 @@ "branches": [ [ 0, - 70 + 76 ] ], - "otherwise": 69 + "otherwise": 75 } } }, - "span": 144 + "span": 150 } }, { @@ -8078,7 +7516,7 @@ "kind": { "Assign": [ { - "local": 91, + "local": 100, "projection": [] }, { @@ -8100,7 +7538,7 @@ } ] }, - "span": 145 + "span": 151 } ], "terminator": { @@ -8108,7 +7546,7 @@ "Assert": { "cond": { "Move": { - "local": 91, + "local": 100, "projection": [ { "Field": [ @@ -8137,11 +7575,11 @@ } ] }, - "target": 71, + "target": 77, "unwind": "Continue" } }, - "span": 145 + "span": 151 } }, { @@ -8153,7 +7591,7 @@ { "Constant": { "const_": { - "id": 37, + "id": 39, "kind": { "Allocated": { "align": 8, @@ -8166,7 +7604,7 @@ 0, 0, 0, - 32, + 28, 0, 0, 0, @@ -8180,7 +7618,7 @@ "ptrs": [ [ 0, - 22 + 24 ] ] } @@ -8194,7 +7632,7 @@ } ], "destination": { - "local": 88, + "local": 96, "projection": [] }, "func": { @@ -8204,7 +7642,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 146, + "span": 152, "user_ty": null } }, @@ -8212,7 +7650,7 @@ "unwind": "Continue" } }, - "span": 146 + "span": 152 } }, { @@ -8221,13 +7659,13 @@ "kind": { "Assign": [ { - "local": 90, + "local": 99, "projection": [] }, { "Use": { "Move": { - "local": 91, + "local": 100, "projection": [ { "Field": [ @@ -8241,75 +7679,21 @@ } ] }, - "span": 145 - }, - { - "kind": { - "Assign": [ - { - "local": 89, - "projection": [] - }, - { - "BinaryOp": [ - "Gt", - { - "Move": { - "local": 90, - "projection": [] - } - }, - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - } - ] - }, - "span": 147 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 89, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 0, - 73 - ] - ], - "otherwise": 72 - } - } + "span": 151 }, - "span": 147 - } - }, - { - "statements": [ { "kind": { "Assign": [ { - "local": 95, + "local": 101, "projection": [] }, { "CheckedBinaryOp": [ - "Add", + "Sub", { "Copy": { - "local": 1, + "local": 99, "projection": [] } }, @@ -8323,7 +7707,7 @@ } ] }, - "span": 148 + "span": 153 } ], "terminator": { @@ -8331,7 +7715,7 @@ "Assert": { "cond": { "Move": { - "local": 95, + "local": 101, "projection": [ { "Field": [ @@ -8345,10 +7729,10 @@ "expected": false, "msg": { "Overflow": [ - "Add", + "Sub", { - "Copy": { - "local": 1, + "Move": { + "local": 99, "projection": [] } }, @@ -8360,100 +7744,29 @@ } ] }, - "target": 74, + "target": 78, "unwind": "Continue" } }, - "span": 148 + "span": 153 } }, { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "Assign": [ { - "Constant": { - "const_": { - "id": 38, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 27, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 23 - ] - ] - } - } - }, - "ty": 27 - }, - "span": 32, - "user_ty": null - } - } - ], - "destination": { - "local": 92, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 9, - "kind": "ZeroSized", - "ty": 26 - }, - "span": 149, - "user_ty": null - } - }, - "target": null, - "unwind": "Continue" - } - }, - "span": 149 - } - }, - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 94, - "projection": [] - }, - { - "Use": { - "Move": { - "local": 95, - "projection": [ - { - "Field": [ + "local": 98, + "projection": [] + }, + { + "Use": { + "Move": { + "local": 101, + "projection": [ + { + "Field": [ 0, 16 ] @@ -8464,13 +7777,13 @@ } ] }, - "span": 148 + "span": 153 }, { "kind": { "Assign": [ { - "local": 93, + "local": 97, "projection": [] }, { @@ -8478,7 +7791,7 @@ "Ge", { "Move": { - "local": 94, + "local": 98, "projection": [] } }, @@ -8492,7 +7805,7 @@ } ] }, - "span": 150 + "span": 154 } ], "terminator": { @@ -8500,7 +7813,7 @@ "SwitchInt": { "discr": { "Move": { - "local": 93, + "local": 97, "projection": [] } }, @@ -8508,86 +7821,21 @@ "branches": [ [ 0, - 76 + 80 ] ], - "otherwise": 75 + "otherwise": 79 } } }, - "span": 150 + "span": 154 } }, { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 100, - "projection": [] - }, - { - "CheckedBinaryOp": [ - "Add", - { - "Copy": { - "local": 1, - "projection": [] - } - }, - { - "Copy": { - "local": 2, - "projection": [] - } - } - ] - } - ] - }, - "span": 151 - } - ], + "statements": [], "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 100, - "projection": [ - { - "Field": [ - 1, - 25 - ] - } - ] - } - }, - "expected": false, - "msg": { - "Overflow": [ - "Add", - { - "Copy": { - "local": 1, - "projection": [] - } - }, - { - "Copy": { - "local": 2, - "projection": [] - } - } - ] - }, - "target": 77, - "unwind": "Continue" - } - }, - "span": 151 + "kind": "Return", + "span": 155 } }, { @@ -8599,7 +7847,7 @@ { "Constant": { "const_": { - "id": 39, + "id": 40, "kind": { "Allocated": { "align": 8, @@ -8612,7 +7860,7 @@ 0, 0, 0, - 28, + 32, 0, 0, 0, @@ -8626,7 +7874,7 @@ "ptrs": [ [ 0, - 24 + 25 ] ] } @@ -8640,7 +7888,7 @@ } ], "destination": { - "local": 96, + "local": 102, "projection": [] }, "func": { @@ -8650,7 +7898,7 @@ "kind": "ZeroSized", "ty": 26 }, - "span": 152, + "span": 156, "user_ty": null } }, @@ -8658,271 +7906,15 @@ "unwind": "Continue" } }, - "span": 152 + "span": 156 } - }, - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 99, - "projection": [] - }, - { - "Use": { - "Move": { - "local": 100, - "projection": [ - { - "Field": [ - 0, - 16 - ] - } - ] - } - } - } - ] - }, - "span": 151 - }, - { - "kind": { - "Assign": [ - { - "local": 101, - "projection": [] - }, - { - "CheckedBinaryOp": [ - "Sub", - { - "Copy": { - "local": 99, - "projection": [] - } - }, - { - "Copy": { - "local": 2, - "projection": [] - } - } - ] - } - ] - }, - "span": 153 - } - ], - "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 101, - "projection": [ - { - "Field": [ - 1, - 25 - ] - } - ] - } - }, - "expected": false, - "msg": { - "Overflow": [ - "Sub", - { - "Move": { - "local": 99, - "projection": [] - } - }, - { - "Copy": { - "local": 2, - "projection": [] - } - } - ] - }, - "target": 78, - "unwind": "Continue" - } - }, - "span": 153 - } - }, - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 98, - "projection": [] - }, - { - "Use": { - "Move": { - "local": 101, - "projection": [ - { - "Field": [ - 0, - 16 - ] - } - ] - } - } - } - ] - }, - "span": 153 - }, - { - "kind": { - "Assign": [ - { - "local": 97, - "projection": [] - }, - { - "BinaryOp": [ - "Ge", - { - "Move": { - "local": 98, - "projection": [] - } - }, - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - } - ] - }, - "span": 154 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 97, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 0, - 80 - ] - ], - "otherwise": 79 - } - } - }, - "span": 154 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 155 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Constant": { - "const_": { - "id": 40, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 32, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 25 - ] - ] - } - } - }, - "ty": 27 - }, - "span": 32, - "user_ty": null - } - } - ], - "destination": { - "local": 102, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 9, - "kind": "ZeroSized", - "ty": 26 - }, - "span": 156, - "user_ty": null - } - }, - "target": null, - "unwind": "Continue" - } - }, - "span": 156 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 157, - "ty": 1 + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 157, + "ty": 1 }, { "mutability": "Not", @@ -9380,217 +8372,1208 @@ "ty": 29 }, { - "mutability": "Mut", - "span": 149, - "ty": 30 + "mutability": "Mut", + "span": 149, + "ty": 30 + }, + { + "mutability": "Mut", + "span": 150, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 148, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 148, + "ty": 29 + }, + { + "mutability": "Mut", + "span": 152, + "ty": 30 + }, + { + "mutability": "Mut", + "span": 154, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 153, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 151, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 151, + "ty": 29 + }, + { + "mutability": "Mut", + "span": 153, + "ty": 29 + }, + { + "mutability": "Mut", + "span": 156, + "ty": 30 + } + ], + "span": 160, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "x", + "source_info": { + "scope": 0, + "span": 158 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "y", + "source_info": { + "scope": 0, + "span": 159 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + } + ] + }, + "id": 6, + "name": "test_binop" + } + }, + "symbol_name": "binop::test_binop::h9a8f345ced0a25a7" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 3, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + { + "Mut": { + "kind": "Default" + } + }, + { + "local": 1, + "projection": [] + } + ] + } + ] + }, + "span": 43 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + } + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 7, + "kind": "ZeroSized", + "ty": 23 + }, + "span": 43, + "user_ty": null + } + }, + "target": 1, + "unwind": { + "Cleanup": 3 + } + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, + "unwind": "Continue" + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Resume", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 16 + }, + { + "mutability": "Not", + "span": 43, + "ty": 12 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + }, + { + "mutability": "Not", + "span": 43, + "ty": 24 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h6ce06013cf5bfa21" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, + "projection": [] + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 1 + }, + { + "mutability": "Not", + "span": 43, + "ty": 7 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": ">::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h91974ef3cf0211bd" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + } + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 6, + "kind": "ZeroSized", + "ty": 21 + }, + "span": 43, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 16 + }, + { + "mutability": "Not", + "span": 43, + "ty": 22 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hdf9201ffa3990219" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 + }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h527f3a94a57a2646" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 4, + "blocks": [ + { + "statements": [ + { + "kind": { + "StorageLive": 5 + }, + "span": 1 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 8, + "projection": [] + }, + { + "Aggregate": [ + { + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] + }, + [ + { + "Copy": { + "local": 1, + "projection": [] + } + } + ] + ] + } + ] + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] + } + ] + } + ] + }, + "span": 2 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Cast": [ + { + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, + "projection": [] + } + }, + 5 + ] + } + ] + }, + "span": 2 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 6, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] + } + } + ], + "destination": { + "local": 5, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 0, + "kind": "ZeroSized", + "ty": 0 + }, + "span": 0, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 1 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 6 + }, + "span": 5 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 + }, + { + "Field": [ + 0, + 6 + ] + } + ] + } + } + } + ] + }, + "span": 6 + }, + { + "kind": { + "StorageDead": 8 + }, + "span": 7 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 7 + } + ], + "terminator": { + "kind": "Return", + "span": 4 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 8, + "ty": 6 + }, + { + "mutability": "Not", + "span": 9, + "ty": 7 + }, + { + "mutability": "Not", + "span": 10, + "ty": 6 + }, + { + "mutability": "Not", + "span": 11, + "ty": 8 + }, + { + "mutability": "Not", + "span": 12, + "ty": 9 + }, + { + "mutability": "Mut", + "span": 1, + "ty": 10 + }, + { + "mutability": "Mut", + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 + } + ], + "span": 13, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "argc", + "source_info": { + "scope": 0, + "span": 10 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 3, + "composite": null, + "name": "argv", + "source_info": { + "scope": 0, + "span": 11 + }, + "value": { + "Place": { + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + } + ] + }, + "id": 0, + "name": "std::rt::lang_start::<()>" + } + }, + "symbol_name": "std::rt::lang_start::hf780de05a7c8e5bf" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + } + ] + }, + "span": 17 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 4, + "projection": [] + } + } + ], + "destination": { + "local": 3, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 1, + "kind": "ZeroSized", + "ty": 13 + }, + "span": 14, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 15 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 4 + }, + "span": 19 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 3, + "projection": [] + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 2, + "kind": "ZeroSized", + "ty": 14 + }, + "span": 18, + "user_ty": null + } + }, + "target": 2, + "unwind": "Continue" + } + }, + "span": 16 + } }, { - "mutability": "Mut", - "span": 150, - "ty": 25 - }, + "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] + } + ] + } + ] + }, + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + }, + { + "Field": [ + 0, + 9 + ] + } + ] + } + } + } + ] + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] + } + ] + }, + "span": 24 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 + } + ], + "terminator": { + "kind": "Return", + "span": 20 + } + } + ], + "locals": [ { "mutability": "Mut", - "span": 148, + "span": 28, "ty": 16 }, { "mutability": "Mut", - "span": 148, - "ty": 29 - }, - { - "mutability": "Mut", - "span": 152, - "ty": 30 - }, - { - "mutability": "Mut", - "span": 154, - "ty": 25 + "span": 3, + "ty": 11 }, { "mutability": "Mut", - "span": 153, - "ty": 16 + "span": 16, + "ty": 17 }, { "mutability": "Mut", - "span": 151, - "ty": 16 + "span": 15, + "ty": 1 }, { "mutability": "Mut", - "span": 151, - "ty": 29 + "span": 17, + "ty": 7 }, { "mutability": "Mut", - "span": 153, - "ty": 29 + "span": 22, + "ty": 18 }, { "mutability": "Mut", - "span": 156, - "ty": 30 + "span": 23, + "ty": 9 } ], - "span": 160, + "span": 3, "spread_arg": null, "var_debug_info": [ { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "x", + "name": "main", "source_info": { "scope": 0, - "span": 158 + "span": 9 }, "value": { "Place": { "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 29 + }, + "value": { + "Place": { + "local": 2, "projection": [] } } }, { - "argument_index": 2, + "argument_index": 1, "composite": null, - "name": "y", + "name": "self", "source_info": { - "scope": 0, - "span": 159 + "scope": 2, + "span": 30 }, "value": { "Place": { - "local": 2, + "local": 5, "projection": [] } } } ] }, - "id": 6, - "name": "test_binop" + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "_ZN5binop10test_binop17h" + "symbol_name": "std::rt::lang_start::{{closure}}::h868c92f8b10a0adf" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 0, + "arg_count": 1, "blocks": [ { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 2, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 42, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 42, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 163, - "user_ty": null - } - } - } - ] - }, - "span": 164 - }, - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 43, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 10, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 165, - "user_ty": null - } - } - } - ] - }, - "span": 166 - } - ], + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 2, + "local": 1, "projection": [] } }, { - "Move": { - "local": 3, - "projection": [] + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null } } ], "destination": { - "local": 1, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 41, + "id": 3, "kind": "ZeroSized", - "ty": 31 + "ty": 19 }, - "span": 161, + "span": 31, "user_ty": null } }, @@ -9598,117 +9581,134 @@ "unwind": "Continue" } }, - "span": 162 + "span": 33 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 5, + "kind": "ZeroSized", + "ty": 20 + }, + "span": 34, + "user_ty": null + } + }, + "target": 2, + "unwind": "Unreachable" + } + }, + "span": 35 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 167 + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 168, + "span": 37, "ty": 1 }, { "mutability": "Not", - "span": 162, - "ty": 1 - }, - { - "mutability": "Mut", - "span": 164, - "ty": 16 + "span": 38, + "ty": 7 }, { - "mutability": "Mut", - "span": 166, - "ty": 16 + "mutability": "Not", + "span": 39, + "ty": 1 } ], - "span": 171, + "span": 42, "spread_arg": null, "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "f", + "source_info": { + "scope": 0, + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, { "argument_index": null, "composite": null, - "name": "x", + "name": "result", "source_info": { "scope": 1, - "span": 169 + "span": 40 }, "value": { - "Const": { - "const_": { - "id": 42, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 42, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 163, - "user_ty": null + "Place": { + "local": 0, + "projection": [] } } }, { - "argument_index": null, + "argument_index": 1, "composite": null, - "name": "y", + "name": "dummy", "source_info": { "scope": 2, - "span": 170 + "span": 41 }, "value": { "Const": { "const_": { - "id": 43, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 10, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 + "id": 4, + "kind": "ZeroSized", + "ty": 1 }, - "span": 165, + "span": 32, "user_ty": null } } } ] }, - "id": 7, - "name": "main" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN5binop4main17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::hd8346b624166a9e2" } ], "types": [ diff --git a/tests/integration/programs/char-trivial.smir.json.expected b/tests/integration/programs/char-trivial.smir.json.expected index 75b76d6..6d0fb42 100644 --- a/tests/integration/programs/char-trivial.smir.json.expected +++ b/tests/integration/programs/char-trivial.smir.json.expected @@ -88,6 +88,100 @@ ] ], "items": [ + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 8, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 17 + }, + "span": 46, + "user_ty": null + } + } + } + ] + }, + "span": 46 + } + ], + "terminator": { + "kind": "Return", + "span": 45 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 + }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::h248d6d971143272d" + }, { "details": null, "mono_item_kind": { @@ -298,82 +392,87 @@ "name": "main" } }, - "symbol_name": "_ZN12char_trivial4main17h" + "symbol_name": "char_trivial::main::h8ae0afee3cb776ae" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 2, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, - { - "kind": { - "Assign": [ - { - "local": 8, + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, "projection": [] - }, - { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 - } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] } - ] - }, - "span": 3 + }, + "target": 1, + "unwind": "Continue" + } }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 1 + }, + { + "mutability": "Not", + "span": 43, + "ty": 7 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": ">::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h6f2db1d97052cdd0" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ { "kind": { "Assign": [ { - "local": 7, + "local": 3, "projection": [] }, { @@ -381,41 +480,20 @@ { "kind": "ReErased" }, - "Shared", - { - "local": 8, - "projection": [] - } - ] - } - ] - }, - "span": 2 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, { - "Copy": { - "local": 7, - "projection": [] + "Mut": { + "kind": "Default" } }, - 5 + { + "local": 1, + "projection": [] + } ] } ] }, - "span": 2 + "span": 43 } ], "terminator": { @@ -424,7 +502,7 @@ "args": [ { "Move": { - "local": 6, + "local": 3, "projection": [] } }, @@ -433,433 +511,429 @@ "local": 2, "projection": [] } - }, - { - "Move": { - "local": 3, - "projection": [] - } - }, - { - "Move": { - "local": 4, - "projection": [] - } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 7, "kind": "ZeroSized", - "ty": 0 + "ty": 23 }, - "span": 0, + "span": 43, "user_ty": null } }, "target": 1, - "unwind": "Continue" + "unwind": { + "Cleanup": 3 + } } }, - "span": 1 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 5 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, + "unwind": "Continue" + } }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 - } - ], + "span": 43 + } + }, + { + "statements": [], "terminator": { "kind": "Return", - "span": 4 + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Resume", + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 8, - "ty": 6 + "span": 43, + "ty": 16 }, { "mutability": "Not", - "span": 9, - "ty": 7 + "span": 43, + "ty": 12 }, { "mutability": "Not", - "span": 10, - "ty": 6 + "span": 43, + "ty": 1 }, { "mutability": "Not", - "span": 11, - "ty": 8 - }, + "span": 43, + "ty": 24 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h818acb7c04214d2e" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { - "mutability": "Not", - "span": 12, - "ty": 9 + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + } + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 6, + "kind": "ZeroSized", + "ty": 21 + }, + "span": 43, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 43 + } }, { - "mutability": "Mut", - "span": 1, - "ty": 10 - }, + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ { "mutability": "Mut", - "span": 2, - "ty": 5 + "span": 43, + "ty": 16 }, { "mutability": "Not", - "span": 2, - "ty": 11 + "span": 43, + "ty": 22 }, { "mutability": "Not", - "span": 3, - "ty": 12 + "span": 43, + "ty": 1 } ], - "span": 13, - "spread_arg": null, - "var_debug_info": [ + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h351d27d2c74ca6a0" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ { - "argument_index": 1, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 } - }, + } + ], + "locals": [ { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - }, - { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } + "mutability": "Mut", + "span": 44, + "ty": 1 }, { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } + "mutability": "Not", + "span": 44, + "ty": 22 } - ] + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h7f6809e87e5bdf40" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 4, "blocks": [ { "statements": [ { "kind": { - "StorageLive": 2 + "StorageLive": 5 }, - "span": 16 + "span": 1 }, { "kind": { - "StorageLive": 3 + "StorageLive": 6 }, - "span": 15 + "span": 2 }, { "kind": { - "StorageLive": 4 + "StorageLive": 8 }, - "span": 17 + "span": 3 }, { "kind": { "Assign": [ { - "local": 4, + "local": 8, "projection": [] }, { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } + "Aggregate": [ + { + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] ] - } - } + }, + [ + { + "Copy": { + "local": 1, + "projection": [] + } + } + ] + ] } ] }, - "span": 17 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ + "span": 3 + }, + { + "kind": { + "Assign": [ { - "Move": { - "local": 4, - "projection": [] - } - } - ], - "destination": { - "local": 3, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 1, - "kind": "ZeroSized", - "ty": 13 - }, - "span": 14, - "user_ty": null + "local": 7, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] + } + ] } - }, - "target": 1, - "unwind": "Continue" - } + ] + }, + "span": 2 }, - "span": 15 - } - }, - { - "statements": [ { "kind": { - "StorageDead": 4 + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Cast": [ + { + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, + "projection": [] + } + }, + 5 + ] + } + ] }, - "span": 19 + "span": 2 } ], "terminator": { "kind": { "Call": { "args": [ + { + "Move": { + "local": 6, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + }, { "Move": { "local": 3, "projection": [] } + }, + { + "Move": { + "local": 4, + "projection": [] + } } ], "destination": { - "local": 2, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 2, + "id": 0, "kind": "ZeroSized", - "ty": 14 + "ty": 0 }, - "span": 18, + "span": 0, "user_ty": null } }, - "target": 2, + "target": 1, "unwind": "Continue" } }, - "span": 16 + "span": 1 } }, { "statements": [ { "kind": { - "StorageDead": 3 - }, - "span": 21 - }, - { - "kind": { - "StorageLive": 5 + "StorageDead": 6 }, - "span": 22 + "span": 5 }, { "kind": { "Assign": [ { - "local": 5, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - } - ] - } - ] - } - ] - }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 - }, - { - "kind": { - "Assign": [ - { - "local": 6, + "local": 0, "projection": [] }, { "Use": { "Copy": { - "local": 2, + "local": 5, "projection": [ { - "Field": [ - 0, - 15 - ] + "Downcast": 0 }, { "Field": [ 0, - 9 + 6 ] } ] @@ -868,98 +942,79 @@ } ] }, - "span": 23 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Cast": [ - "IntToInt", - { - "Move": { - "local": 6, - "projection": [] - } - }, - 16 - ] - } - ] - }, - "span": 24 + "span": 6 }, { "kind": { - "StorageDead": 6 + "StorageDead": 8 }, - "span": 25 + "span": 7 }, { "kind": { "StorageDead": 5 }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 + "span": 7 } ], "terminator": { "kind": "Return", - "span": 20 + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 28, - "ty": 16 + "span": 8, + "ty": 6 }, { - "mutability": "Mut", - "span": 3, - "ty": 11 + "mutability": "Not", + "span": 9, + "ty": 7 }, { - "mutability": "Mut", - "span": 16, - "ty": 17 + "mutability": "Not", + "span": 10, + "ty": 6 }, { - "mutability": "Mut", - "span": 15, - "ty": 1 + "mutability": "Not", + "span": 11, + "ty": 8 }, { - "mutability": "Mut", - "span": 17, - "ty": 7 + "mutability": "Not", + "span": 12, + "ty": 9 }, { "mutability": "Mut", - "span": 22, - "ty": 18 + "span": 1, + "ty": 10 }, { "mutability": "Mut", - "span": 23, - "ty": 9 + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 } ], - "span": 3, + "span": 13, "spread_arg": null, "var_debug_info": [ { - "argument_index": null, + "argument_index": 1, "composite": null, "name": "main", "source_info": { @@ -969,25 +1024,17 @@ "value": { "Place": { "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] + "projection": [] } } }, { - "argument_index": 1, + "argument_index": 2, "composite": null, - "name": "self", + "name": "argc", "source_info": { - "scope": 1, - "span": 29 + "scope": 0, + "span": 10 }, "value": { "Place": { @@ -997,27 +1044,57 @@ } }, { - "argument_index": 1, + "argument_index": 3, "composite": null, - "name": "self", + "name": "argv", "source_info": { - "scope": 2, - "span": 30 + "scope": 0, + "span": 11 }, "value": { "Place": { - "local": 5, + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, "projection": [] } } } ] }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "symbol_name": "std::rt::lang_start::h6cc119f686fc5602" }, { "details": null, @@ -1027,41 +1104,76 @@ "arg_count": 1, "blocks": [ { - "statements": [], + "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + } + ] + }, + "span": 17 + } + ], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, + "local": 4, "projection": [] } - }, - { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } } ], "destination": { - "local": 0, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 3, + "id": 1, "kind": "ZeroSized", - "ty": 19 + "ty": 13 }, - "span": 31, + "span": 14, "user_ty": null } }, @@ -1069,24 +1181,26 @@ "unwind": "Continue" } }, - "span": 33 + "span": 15 } }, { - "statements": [], + "statements": [ + { + "kind": { + "StorageDead": 4 + }, + "span": 19 + } + ], "terminator": { "kind": { "Call": { "args": [ { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 3, + "projection": [] } } ], @@ -1097,75 +1211,225 @@ "func": { "Constant": { "const_": { - "id": 5, + "id": 2, "kind": "ZeroSized", - "ty": 20 + "ty": 14 }, - "span": 34, + "span": 18, "user_ty": null } }, "target": 2, - "unwind": "Unreachable" + "unwind": "Continue" } }, - "span": 35 + "span": 16 } }, { - "statements": [], + "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] + } + ] + } + ] + }, + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + }, + { + "Field": [ + 0, + 9 + ] + } + ] + } + } + } + ] + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] + } + ] + }, + "span": 24 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 + } + ], "terminator": { "kind": "Return", - "span": 36 + "span": 20 } } ], "locals": [ { "mutability": "Mut", - "span": 37, + "span": 28, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 3, + "ty": 11 + }, + { + "mutability": "Mut", + "span": 16, + "ty": 17 + }, + { + "mutability": "Mut", + "span": 15, "ty": 1 }, { - "mutability": "Not", - "span": 38, + "mutability": "Mut", + "span": 17, "ty": 7 }, { - "mutability": "Not", - "span": 39, - "ty": 1 + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 } ], - "span": 42, + "span": 3, "spread_arg": null, "var_debug_info": [ { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "f", + "name": "main", "source_info": { "scope": 0, - "span": 38 + "span": 9 }, "value": { "Place": { "local": 1, - "projection": [] + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] } } }, { - "argument_index": null, + "argument_index": 1, "composite": null, - "name": "result", + "name": "self", "source_info": { "scope": 1, - "span": 40 + "span": 29 }, "value": { "Place": { - "local": 0, + "local": 2, "projection": [] } } @@ -1173,232 +1437,54 @@ { "argument_index": 1, "composite": null, - "name": "dummy", + "name": "self", "source_info": { "scope": 2, - "span": 41 + "span": 30 }, "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Place": { + "local": 5, + "projection": [] } } - } - ] - }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" - } - }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 21 - }, - "span": 43, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 22 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Move": { - "local": 1, - "projection": [] - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 7 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - { - "Mut": { - "kind": "Default" - } - }, - { - "local": 1, - "projection": [] - } - ] - } - ] - }, - "span": 43 - } - ], + } + ] + }, + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" + } + }, + "symbol_name": "std::rt::lang_start::{{closure}}::h9537d1266973544f" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 3, + "local": 1, "projection": [] } }, { - "Move": { - "local": 2, - "projection": [] + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null } } ], @@ -1409,212 +1495,126 @@ "func": { "Constant": { "const_": { - "id": 7, + "id": 3, "kind": "ZeroSized", - "ty": 23 + "ty": 19 }, - "span": 43, + "span": 31, "user_ty": null } }, "target": 1, - "unwind": { - "Cleanup": 3 - } + "unwind": "Continue" } }, - "span": 43 + "span": 33 } }, { "statements": [], "terminator": { "kind": { - "Drop": { - "place": { - "local": 1, + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 2, "projection": [] }, + "func": { + "Constant": { + "const_": { + "id": 5, + "kind": "ZeroSized", + "ty": 20 + }, + "span": 34, + "user_ty": null + } + }, "target": 2, - "unwind": "Continue" + "unwind": "Unreachable" } }, - "span": 43 + "span": 35 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Resume", - "span": 43 + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 43, - "ty": 16 + "span": 37, + "ty": 1 }, { "mutability": "Not", - "span": 43, - "ty": 12 + "span": 38, + "ty": 7 }, { "mutability": "Not", - "span": 43, + "span": 39, "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 24 } ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ + "span": 42, + "spread_arg": null, + "var_debug_info": [ { - "statements": [], - "terminator": { - "kind": "Return", - "span": 44 + "argument_index": 1, + "composite": null, + "name": "f", + "source_info": { + "scope": 0, + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 44, - "ty": 1 }, { - "mutability": "Not", - "span": 44, - "ty": 22 - } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] - }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" - } - }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 46, - "user_ty": null - } - } - } - ] - }, - "span": 46 + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 40 + }, + "value": { + "Place": { + "local": 0, + "projection": [] } - ], - "terminator": { - "kind": "Return", - "span": 45 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 47, - "ty": 17 }, - { - "mutability": "Not", - "span": 48, - "ty": 1 - } - ], - "span": 49, - "spread_arg": null, - "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "self", + "name": "dummy", "source_info": { - "scope": 0, - "span": 48 + "scope": 2, + "span": 41 }, "value": { "Const": { @@ -1630,11 +1630,11 @@ } ] }, - "id": 5, - "name": "<() as std::process::Termination>::report" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h74ad275823b6d3ca" } ], "types": [ diff --git a/tests/integration/programs/checked_arithmetic.smir.json.expected b/tests/integration/programs/checked_arithmetic.smir.json.expected index 57d2893..c915589 100644 --- a/tests/integration/programs/checked_arithmetic.smir.json.expected +++ b/tests/integration/programs/checked_arithmetic.smir.json.expected @@ -1,72 +1,5 @@ { "allocs": [ - [ - { - "Memory": { - "align": 1, - "bytes": [ - 97, - 115, - 115, - 101, - 114, - 116, - 105, - 111, - 110, - 32, - 102, - 97, - 105, - 108, - 101, - 100, - 58, - 32, - 114, - 101, - 115, - 117, - 108, - 116, - 32, - 97, - 115, - 32, - 105, - 54, - 52, - 32, - 61, - 61, - 32, - 97, - 32, - 97, - 115, - 32, - 105, - 54, - 52, - 32, - 43, - 32, - 98, - 32, - 97, - 115, - 32, - 105, - 54, - 52 - ], - "mutability": "Not", - "provenance": { - "ptrs": [] - } - } - } - ], [ { "Memory": { @@ -146,6 +79,73 @@ } } } + ], + [ + { + "Memory": { + "align": 1, + "bytes": [ + 97, + 115, + 115, + 101, + 114, + 116, + 105, + 111, + 110, + 32, + 102, + 97, + 105, + 108, + 101, + 100, + 58, + 32, + 114, + 101, + 115, + 117, + 108, + 116, + 32, + 97, + 115, + 32, + 105, + 54, + 52, + 32, + 61, + 61, + 32, + 97, + 32, + 97, + 115, + 32, + 105, + 54, + 52, + 32, + 43, + 32, + 98, + 32, + 97, + 115, + 32, + 105, + 54, + 52 + ], + "mutability": "Not", + "provenance": { + "ptrs": [] + } + } + } ] ], "functions": [ @@ -231,6 +231,100 @@ ] ], "items": [ + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 15, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 17 + }, + "span": 98, + "user_ty": null + } + } + } + ] + }, + "span": 98 + } + ], + "terminator": { + "kind": "Return", + "span": 97 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 99, + "ty": 17 + }, + { + "mutability": "Not", + "span": 100, + "ty": 1 + } + ], + "span": 101, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 100 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 11, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::h13465de462ec78d6" + }, { "details": null, "mono_item_kind": { @@ -830,7 +924,7 @@ "name": "checked_add_i32" } }, - "symbol_name": "_ZN18checked_arithmetic15checked_add_i3217h" + "symbol_name": "checked_arithmetic::checked_add_i32::h654ae0fb73c8084e" }, { "details": null, @@ -946,190 +1040,114 @@ "name": "main" } }, - "symbol_name": "_ZN18checked_arithmetic4main17h" + "symbol_name": "checked_arithmetic::main::h916fc99227d4b902" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 0, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, - { - "kind": { - "Assign": [ - { - "local": 8, - "projection": [] - }, - { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 - } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] - } - ] + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 + } + ], + "span": 45, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 3, + "name": "std::intrinsics::cold_path" + } + }, + "symbol_name": "core::intrinsics::cold_path::ha65a9598ce5f50b2" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ + { + "kind": { + "StorageLive": 5 }, - "span": 3 + "span": 47 }, { "kind": { "Assign": [ { - "local": 7, + "local": 5, "projection": [] }, { - "Ref": [ + "CheckedBinaryOp": [ + "Add", { - "kind": "ReErased" + "Copy": { + "local": 1, + "projection": [] + } }, - "Shared", { - "local": 8, - "projection": [] + "Copy": { + "local": 2, + "projection": [] + } } ] } ] }, - "span": 2 + "span": 47 }, { "kind": { "Assign": [ { - "local": 6, + "local": 3, "projection": [] }, { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, - { - "Copy": { - "local": 7, - "projection": [] - } - }, - 5 - ] - } - ] - }, - "span": 2 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, - { - "Move": { - "local": 3, - "projection": [] - } - }, - { - "Move": { - "local": 4, - "projection": [] + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Field": [ + 0, + 16 + ] + } + ] + } } } - ], - "destination": { - "local": 5, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 0, - "kind": "ZeroSized", - "ty": 0 - }, - "span": 0, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 1 - } - }, - { - "statements": [ - { - "kind": { - "StorageDead": 6 + ] }, - "span": 5 + "span": 48 }, { "kind": { "Assign": [ { - "local": 0, + "local": 4, "projection": [] }, { @@ -1137,13 +1155,10 @@ "Copy": { "local": 5, "projection": [ - { - "Downcast": 0 - }, { "Field": [ - 0, - 6 + 1, + 21 ] } ] @@ -1152,84 +1167,223 @@ } ] }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 + "span": 49 }, { "kind": { "StorageDead": 5 }, - "span": 7 + "span": 50 } ], "terminator": { - "kind": "Return", - "span": 4 + "kind": { + "SwitchInt": { + "discr": { + "Copy": { + "local": 4, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 4 + ] + ], + "otherwise": 2 + } + } + }, + "span": 46 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 8, - "ty": 6 }, { - "mutability": "Not", - "span": 9, - "ty": 7 - }, - { - "mutability": "Not", - "span": 10, - "ty": 6 - }, - { - "mutability": "Not", - "span": 11, - "ty": 8 - }, - { - "mutability": "Not", - "span": 12, - "ty": 9 - }, - { - "mutability": "Mut", - "span": 1, - "ty": 10 + "statements": [], + "terminator": { + "kind": "Return", + "span": 51 + } }, { - "mutability": "Mut", - "span": 2, - "ty": 5 - }, + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 6, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 6, + "kind": "ZeroSized", + "ty": 22 + }, + "span": 52, + "user_ty": null + } + }, + "target": 3, + "unwind": "Unreachable" + } + }, + "span": 53 + } + }, + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 7, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 0, + 0, + 0, + 0, + null, + null, + null, + null + ], + "mutability": "Not", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 23 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "span": 55 + } + ], + "terminator": { + "kind": { + "Goto": { + "target": 1 + } + }, + "span": 54 + } + }, + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Aggregate": [ + { + "Adt": [ + 5, + 1, + [ + { + "Type": 16 + } + ], + null, + null + ] + }, + [ + { + "Copy": { + "local": 3, + "projection": [] + } + } + ] + ] + } + ] + }, + "span": 56 + } + ], + "terminator": { + "kind": { + "Goto": { + "target": 1 + } + }, + "span": 54 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 57, + "ty": 23 + }, { "mutability": "Not", - "span": 2, - "ty": 11 + "span": 58, + "ty": 16 }, { "mutability": "Not", - "span": 3, - "ty": 12 + "span": 59, + "ty": 16 + }, + { + "mutability": "Not", + "span": 48, + "ty": 16 + }, + { + "mutability": "Not", + "span": 49, + "ty": 21 + }, + { + "mutability": "Mut", + "span": 47, + "ty": 24 + }, + { + "mutability": "Not", + "span": 53, + "ty": 1 } ], - "span": 13, + "span": 65, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "main", + "name": "self", "source_info": { "scope": 0, - "span": 9 + "span": 58 }, "value": { "Place": { @@ -1241,10 +1395,10 @@ { "argument_index": 2, "composite": null, - "name": "argc", + "name": "rhs", "source_info": { "scope": 0, - "span": 10 + "span": 59 }, "value": { "Place": { @@ -1254,12 +1408,12 @@ } }, { - "argument_index": 3, + "argument_index": null, "composite": null, - "name": "argv", + "name": "a", "source_info": { - "scope": 0, - "span": 11 + "scope": 1, + "span": 60 }, "value": { "Place": { @@ -1269,12 +1423,12 @@ } }, { - "argument_index": 4, + "argument_index": null, "composite": null, - "name": "sigpipe", + "name": "b", "source_info": { - "scope": 0, - "span": 12 + "scope": 1, + "span": 61 }, "value": { "Place": { @@ -1283,157 +1437,184 @@ } } }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 62 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "rhs", + "source_info": { + "scope": 2, + "span": 63 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, { "argument_index": null, "composite": null, - "name": "v", + "name": "a", "source_info": { - "scope": 1, - "span": 6 + "scope": 3, + "span": 48 }, "value": { "Place": { - "local": 0, + "local": 3, "projection": [] } } - } - ] - }, - "id": 0, - "name": "std::rt::lang_start::<()>" - } - }, - "symbol_name": "_ZN3std2rt10lang_start17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ + }, { - "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 16 - }, - { - "kind": { - "StorageLive": 3 - }, - "span": 15 - }, + "argument_index": null, + "composite": null, + "name": "b", + "source_info": { + "scope": 3, + "span": 49 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "b", + "source_info": { + "scope": 4, + "span": 64 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + } + ] + }, + "id": 4, + "name": "core::num::::checked_add" + } + }, + "symbol_name": "core::num::::checked_add::h29858f34f436425d" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ { "kind": { - "StorageLive": 4 + "StorageLive": 3 }, - "span": 17 + "span": 66 }, { "kind": { "Assign": [ { - "local": 4, + "local": 3, "projection": [] }, { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } + "NullaryOp": [ + "UbChecks", + 21 + ] } ] }, - "span": 17 + "span": 67 } ], "terminator": { "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 4, - "projection": [] - } - } - ], - "destination": { - "local": 3, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 1, - "kind": "ZeroSized", - "ty": 13 - }, - "span": 14, - "user_ty": null + "SwitchInt": { + "discr": { + "Move": { + "local": 3, + "projection": [] } }, - "target": 1, - "unwind": "Continue" + "targets": { + "branches": [ + [ + 0, + 2 + ] + ], + "otherwise": 1 + } } }, - "span": 15 + "span": 66 } }, { - "statements": [ - { - "kind": { - "StorageDead": 4 - }, - "span": 19 - } - ], + "statements": [], "terminator": { "kind": { "Call": { "args": [ { - "Move": { - "local": 3, + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Copy": { + "local": 2, "projection": [] } } ], "destination": { - "local": 2, + "local": 4, "projection": [] }, "func": { "Constant": { "const_": { - "id": 2, + "id": 8, "kind": "ZeroSized", - "ty": 14 + "ty": 25 }, - "span": 18, + "span": 68, "user_ty": null } }, "target": 2, - "unwind": "Continue" + "unwind": "Unreachable" } }, - "span": 16 + "span": 69 } }, { @@ -1442,81 +1623,7 @@ "kind": { "StorageDead": 3 }, - "span": 21 - }, - { - "kind": { - "StorageLive": 5 - }, - "span": 22 - }, - { - "kind": { - "Assign": [ - { - "local": 5, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - } - ] - } - ] - } - ] - }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - }, - { - "Field": [ - 0, - 9 - ] - } - ] - } - } - } - ] - }, - "span": 23 + "span": 71 }, { "kind": { @@ -1526,198 +1633,236 @@ "projection": [] }, { - "Cast": [ - "IntToInt", + "BinaryOp": [ + "AddUnchecked", { - "Move": { - "local": 6, + "Copy": { + "local": 1, "projection": [] } }, - 16 + { + "Copy": { + "local": 2, + "projection": [] + } + } ] } ] }, - "span": 24 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 25 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 + "span": 72 } ], "terminator": { "kind": "Return", - "span": 20 + "span": 70 } } ], "locals": [ { "mutability": "Mut", - "span": 28, + "span": 73, "ty": 16 }, { - "mutability": "Mut", - "span": 3, - "ty": 11 - }, - { - "mutability": "Mut", - "span": 16, - "ty": 17 - }, - { - "mutability": "Mut", - "span": 15, - "ty": 1 + "mutability": "Not", + "span": 74, + "ty": 16 }, { - "mutability": "Mut", - "span": 17, - "ty": 7 + "mutability": "Not", + "span": 75, + "ty": 16 }, { "mutability": "Mut", - "span": 22, - "ty": 18 + "span": 66, + "ty": 21 }, { - "mutability": "Mut", - "span": 23, - "ty": 9 + "mutability": "Not", + "span": 69, + "ty": 1 } ], - "span": 3, + "span": 76, "spread_arg": null, "var_debug_info": [ - { - "argument_index": null, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - }, { "argument_index": 1, "composite": null, "name": "self", "source_info": { - "scope": 1, - "span": 29 + "scope": 0, + "span": 74 }, "value": { "Place": { - "local": 2, + "local": 1, "projection": [] } } }, { - "argument_index": 1, + "argument_index": 2, "composite": null, - "name": "self", + "name": "rhs", "source_info": { - "scope": 2, - "span": 30 + "scope": 0, + "span": 75 }, "value": { "Place": { - "local": 5, + "local": 2, "projection": [] } } } ] }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" + "id": 6, + "name": "core::num::::unchecked_add" } }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "symbol_name": "core::num::::unchecked_add::h8a262b3a5be3f6e8" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 2, "blocks": [ { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "StorageLive": 4 + }, + "span": 78 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 47 + }, + { + "kind": { + "Assign": [ { - "Move": { - "local": 1, - "projection": [] - } + "local": 6, + "projection": [] }, { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 + "CheckedBinaryOp": [ + "Add", + { + "Copy": { + "local": 1, + "projection": [] + } }, - "span": 32, - "user_ty": null + { + "Copy": { + "local": 2, + "projection": [] + } + } + ] + } + ] + }, + "span": 47 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 6, + "projection": [ + { + "Field": [ + 0, + 16 + ] + } + ] + } } } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 3, - "kind": "ZeroSized", - "ty": 19 - }, - "span": 31, - "user_ty": null + ] + }, + "span": 48 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 6, + "projection": [ + { + "Field": [ + 1, + 21 + ] + } + ] + } + } + } + ] + }, + "span": 49 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 50 + }, + { + "kind": { + "StorageDead": 4 + }, + "span": 78 + } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Copy": { + "local": 5, + "projection": [] } }, - "target": 1, - "unwind": "Continue" + "targets": { + "branches": [ + [ + 0, + 2 + ] + ], + "otherwise": 1 + } } }, - "span": 33 + "span": 77 } }, { @@ -1729,72 +1874,123 @@ { "Constant": { "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } - } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 5, - "kind": "ZeroSized", - "ty": 20 - }, - "span": 34, - "user_ty": null - } - }, - "target": 2, + "id": 10, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 67, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 0 + ] + ] + } + } + }, + "ty": 27 + }, + "span": 80, + "user_ty": null + } + } + ], + "destination": { + "local": 3, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 9, + "kind": "ZeroSized", + "ty": 26 + }, + "span": 79, + "user_ty": null + } + }, + "target": null, "unwind": "Unreachable" } }, - "span": 35 + "span": 81 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 36 + "span": 82 } } ], "locals": [ { "mutability": "Mut", - "span": 37, + "span": 83, "ty": 1 }, { "mutability": "Not", - "span": 38, - "ty": 7 + "span": 84, + "ty": 16 }, { "mutability": "Not", - "span": 39, - "ty": 1 + "span": 84, + "ty": 16 + }, + { + "mutability": "Not", + "span": 81, + "ty": 28 + }, + { + "mutability": "Not", + "span": 48, + "ty": 16 + }, + { + "mutability": "Not", + "span": 49, + "ty": 21 + }, + { + "mutability": "Mut", + "span": 47, + "ty": 24 } ], - "span": 42, + "span": 85, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "f", + "name": "lhs", "source_info": { "scope": 0, - "span": 38 + "span": 84 }, "value": { "Place": { @@ -1804,16 +2000,16 @@ } }, { - "argument_index": null, + "argument_index": 2, "composite": null, - "name": "result", + "name": "rhs", "source_info": { - "scope": 1, - "span": 40 + "scope": 0, + "span": 84 }, "value": { "Place": { - "local": 0, + "local": 2, "projection": [] } } @@ -1821,62 +2017,70 @@ { "argument_index": 1, "composite": null, - "name": "dummy", + "name": "self", "source_info": { - "scope": 2, - "span": 41 + "scope": 1, + "span": 62 }, "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Place": { + "local": 1, + "projection": [] } } - } - ] - }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" - } - }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 0, - "blocks": [ + }, { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 + "argument_index": 2, + "composite": null, + "name": "rhs", + "source_info": { + "scope": 1, + "span": 63 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } } - } - ], - "locals": [ + }, { - "mutability": "Mut", - "span": 44, - "ty": 1 + "argument_index": null, + "composite": null, + "name": "a", + "source_info": { + "scope": 2, + "span": 48 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "b", + "source_info": { + "scope": 2, + "span": 49 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } } - ], - "span": 45, - "spread_arg": null, - "var_debug_info": [] + ] }, - "id": 3, - "name": "std::intrinsics::cold_path" + "id": 7, + "name": "core::num::::unchecked_add::precondition_check" } }, - "symbol_name": "_ZN4core10intrinsics9cold_path17h" + "symbol_name": "core::num::::unchecked_add::precondition_check::ha7005eb2e592fd41" }, { "details": null, @@ -1887,442 +2091,153 @@ "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 47 - }, { "kind": { "Assign": [ { - "local": 5, + "local": 3, "projection": [] }, { - "CheckedBinaryOp": [ - "Add", + "Ref": [ { - "Copy": { - "local": 1, - "projection": [] - } + "kind": "ReErased" }, { - "Copy": { - "local": 2, - "projection": [] + "Mut": { + "kind": "Default" } + }, + { + "local": 1, + "projection": [] } ] } ] }, - "span": 47 - }, - { - "kind": { - "Assign": [ + "span": 86 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ { - "local": 3, - "projection": [] + "Move": { + "local": 3, + "projection": [] + } }, { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Field": [ - 0, - 16 - ] - } - ] - } - } - } - ] - }, - "span": 48 - }, - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Field": [ - 1, - 21 - ] - } - ] - } + "Move": { + "local": 2, + "projection": [] } } - ] - }, - "span": 49 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 50 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Copy": { - "local": 4, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 0, - 4 - ] - ], - "otherwise": 2 - } - } - }, - "span": 46 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 51 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [], + ], "destination": { - "local": 6, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 6, + "id": 12, "kind": "ZeroSized", - "ty": 22 + "ty": 31 }, - "span": 52, + "span": 86, "user_ty": null } }, - "target": 3, - "unwind": "Unreachable" + "target": 1, + "unwind": { + "Cleanup": 3 + } } }, - "span": 53 + "span": 86 } }, { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 7, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 0, - 0, - 0, - 0, - null, - null, - null, - null - ], - "mutability": "Not", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 23 - }, - "span": 32, - "user_ty": null - } - } - } - ] - }, - "span": 55 - } - ], + "statements": [], "terminator": { "kind": { - "Goto": { - "target": 1 + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, + "unwind": "Continue" } }, - "span": 54 + "span": 86 } }, { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Aggregate": [ - { - "Adt": [ - 5, - 1, - [ - { - "Type": 16 - } - ], - null, - null - ] - }, - [ - { - "Copy": { - "local": 3, - "projection": [] - } - } - ] - ] - } - ] - }, - "span": 56 - } - ], + "statements": [], + "terminator": { + "kind": "Return", + "span": 86 + } + }, + { + "statements": [], "terminator": { "kind": { - "Goto": { - "target": 1 + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" } }, - "span": 54 + "span": 86 + } + }, + { + "statements": [], + "terminator": { + "kind": "Resume", + "span": 86 } } ], "locals": [ { "mutability": "Mut", - "span": 57, - "ty": 23 - }, - { - "mutability": "Not", - "span": 58, - "ty": 16 - }, - { - "mutability": "Not", - "span": 59, + "span": 86, "ty": 16 }, { "mutability": "Not", - "span": 48, - "ty": 16 + "span": 86, + "ty": 12 }, { "mutability": "Not", - "span": 49, - "ty": 21 - }, - { - "mutability": "Mut", - "span": 47, - "ty": 24 + "span": 86, + "ty": 1 }, { "mutability": "Not", - "span": 53, - "ty": 1 + "span": 86, + "ty": 32 } ], - "span": 65, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 0, - "span": 58 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 2, - "composite": null, - "name": "rhs", - "source_info": { - "scope": 0, - "span": 59 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "a", - "source_info": { - "scope": 1, - "span": 60 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "b", - "source_info": { - "scope": 1, - "span": 61 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 2, - "span": 62 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 2, - "composite": null, - "name": "rhs", - "source_info": { - "scope": 2, - "span": 63 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "a", - "source_info": { - "scope": 3, - "span": 48 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "b", - "source_info": { - "scope": 3, - "span": 49 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "b", - "source_info": { - "scope": 4, - "span": 64 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } - } - ] + "span": 86, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 4, - "name": "core::num::::checked_add" + "id": 8, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "_ZN4core3num21_$LT$impl$u20$i32$GT$11checked_add17h" + "symbol_name": "core::ops::function::FnOnce::call_once::he521a4b7c95d8a37" }, { "details": null, @@ -2332,54 +2247,70 @@ "arg_count": 2, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 3 - }, - "span": 66 - }, - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "NullaryOp": [ - "UbChecks", - 21 - ] - } - ] - }, - "span": 67 - } - ], + "statements": [], "terminator": { "kind": { - "SwitchInt": { - "discr": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { "Move": { - "local": 3, + "local": 1, "projection": [] } }, - "targets": { - "branches": [ - [ - 0, - 2 - ] - ], - "otherwise": 1 - } + "target": 1, + "unwind": "Continue" } }, - "span": 66 + "span": 86 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 86 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 86, + "ty": 1 + }, + { + "mutability": "Not", + "span": 86, + "ty": 7 }, + { + "mutability": "Not", + "span": 86, + "ty": 1 + } + ], + "span": 86, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 8, + "name": ">::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::hea697340843a0c99" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { "statements": [], "terminator": { @@ -2387,444 +2318,269 @@ "Call": { "args": [ { - "Copy": { + "Move": { "local": 1, - "projection": [] + "projection": [ + "Deref" + ] } }, { - "Copy": { + "Move": { "local": 2, "projection": [] } } ], "destination": { - "local": 4, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 8, + "id": 11, "kind": "ZeroSized", - "ty": 25 + "ty": 29 }, - "span": 68, + "span": 86, "user_ty": null } }, - "target": 2, - "unwind": "Unreachable" + "target": 1, + "unwind": "Continue" } }, - "span": 69 + "span": 86 } }, { - "statements": [ - { - "kind": { - "StorageDead": 3 - }, - "span": 71 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "BinaryOp": [ - "AddUnchecked", - { - "Copy": { - "local": 1, - "projection": [] - } - }, - { - "Copy": { - "local": 2, - "projection": [] - } - } - ] - } - ] - }, - "span": 72 - } - ], + "statements": [], "terminator": { "kind": "Return", - "span": 70 + "span": 86 } } ], "locals": [ { "mutability": "Mut", - "span": 73, - "ty": 16 - }, - { - "mutability": "Not", - "span": 74, + "span": 86, "ty": 16 }, { "mutability": "Not", - "span": 75, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 66, - "ty": 21 + "span": 86, + "ty": 30 }, { "mutability": "Not", - "span": 69, + "span": 86, "ty": 1 } ], - "span": 76, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 0, - "span": 74 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 2, - "composite": null, - "name": "rhs", - "source_info": { - "scope": 0, - "span": 75 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - } - ] + "span": 86, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 6, - "name": "core::num::::unchecked_add" + "id": 8, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "_ZN4core3num21_$LT$impl$u20$i32$GT$13unchecked_add17h" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hfd45ce6305bbcc85" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 1, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 4 - }, - "span": 78 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 47 - }, { "kind": { "Assign": [ { - "local": 6, + "local": 2, "projection": [] }, { - "CheckedBinaryOp": [ - "Add", - { - "Copy": { - "local": 1, - "projection": [] - } - }, - { - "Copy": { - "local": 2, - "projection": [] - } - } - ] + "Discriminant": { + "local": 1, + "projection": [ + "Deref" + ] + } } ] }, - "span": 47 + "span": 89 + } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 2, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 1, + 2 + ], + [ + 0, + 1 + ] + ], + "otherwise": 4 + } + } }, + "span": 88 + } + }, + { + "statements": [ { "kind": { "Assign": [ { - "local": 4, + "local": 0, "projection": [] }, { "Use": { - "Copy": { - "local": 6, - "projection": [ - { - "Field": [ - 0, - 16 - ] - } - ] + "Constant": { + "const_": { + "id": 13, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 21 + }, + "span": 90, + "user_ty": null } } } ] }, - "span": 48 + "span": 90 + } + ], + "terminator": { + "kind": { + "Goto": { + "target": 3 + } }, + "span": 90 + } + }, + { + "statements": [ { "kind": { "Assign": [ { - "local": 5, + "local": 0, "projection": [] }, { "Use": { - "Copy": { - "local": 6, - "projection": [ - { - "Field": [ - 1, - 21 - ] - } - ] + "Constant": { + "const_": { + "id": 14, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 1 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 21 + }, + "span": 91, + "user_ty": null } } } ] }, - "span": 49 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 50 - }, - { - "kind": { - "StorageDead": 4 - }, - "span": 78 + "span": 91 } ], "terminator": { "kind": { - "SwitchInt": { - "discr": { - "Copy": { - "local": 5, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 0, - 2 - ] - ], - "otherwise": 1 - } + "Goto": { + "target": 3 } }, - "span": 77 + "span": 91 } }, { "statements": [], "terminator": { - "kind": { - "Call": { - "args": [ - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 67, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 0 - ] - ] - } - } - }, - "ty": 27 - }, - "span": 80, - "user_ty": null - } - } - ], - "destination": { - "local": 3, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 9, - "kind": "ZeroSized", - "ty": 26 - }, - "span": 79, - "user_ty": null - } - }, - "target": null, - "unwind": "Unreachable" - } - }, - "span": 81 + "kind": "Return", + "span": 92 } }, { "statements": [], "terminator": { - "kind": "Return", - "span": 82 + "kind": "Unreachable", + "span": 93 } } ], "locals": [ { "mutability": "Mut", - "span": 83, - "ty": 1 - }, - { - "mutability": "Not", - "span": 84, - "ty": 16 - }, - { - "mutability": "Not", - "span": 84, - "ty": 16 - }, - { - "mutability": "Not", - "span": 81, - "ty": 28 - }, - { - "mutability": "Not", - "span": 48, - "ty": 16 + "span": 94, + "ty": 21 }, { "mutability": "Not", - "span": 49, - "ty": 21 + "span": 95, + "ty": 33 }, { "mutability": "Mut", - "span": 47, - "ty": 24 + "span": 96, + "ty": 6 } ], - "span": 85, + "span": 93, "spread_arg": null, "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "lhs", - "source_info": { - "scope": 0, - "span": 84 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 2, - "composite": null, - "name": "rhs", - "source_info": { - "scope": 0, - "span": 84 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, { "argument_index": 1, "composite": null, "name": "self", "source_info": { - "scope": 1, - "span": 62 + "scope": 0, + "span": 95 }, "value": { "Place": { @@ -2832,180 +2588,168 @@ "projection": [] } } - }, - { - "argument_index": 2, - "composite": null, - "name": "rhs", - "source_info": { - "scope": 1, - "span": 63 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "a", - "source_info": { - "scope": 2, - "span": 48 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "b", - "source_info": { - "scope": 2, - "span": 49 - }, - "value": { - "Place": { - "local": 5, - "projection": [] - } - } } ] }, - "id": 7, - "name": "core::num::::unchecked_add::precondition_check" + "id": 10, + "name": "std::option::Option::::is_some" } }, - "symbol_name": "_ZN4core3num21_$LT$impl$u20$i32$GT$13unchecked_add18precondition_check17h" + "symbol_name": "core::option::Option::is_some::h2c87b9367138524d" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 1, "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 11, - "kind": "ZeroSized", - "ty": 29 - }, - "span": 86, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 86 - } - }, { "statements": [], "terminator": { "kind": "Return", - "span": 86 + "span": 87 } } ], "locals": [ { "mutability": "Mut", - "span": 86, - "ty": 16 + "span": 87, + "ty": 1 }, { "mutability": "Not", - "span": 86, + "span": 87, "ty": 30 - }, - { - "mutability": "Not", - "span": 86, - "ty": 1 } ], - "span": 86, - "spread_arg": 2, + "span": 87, + "spread_arg": null, "var_debug_info": [] }, - "id": 8, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + "id": 9, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h5b58bc3117200b3a" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 4, "blocks": [ { "statements": [ + { + "kind": { + "StorageLive": 5 + }, + "span": 1 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 + }, { "kind": { "Assign": [ { - "local": 3, + "local": 8, "projection": [] }, { - "Ref": [ + "Aggregate": [ { - "kind": "ReErased" + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] }, - { - "Mut": { - "kind": "Default" + [ + { + "Copy": { + "local": 1, + "projection": [] + } } + ] + ] + } + ] + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" }, + "Shared", { - "local": 1, + "local": 8, "projection": [] } ] } ] }, - "span": 86 + "span": 2 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Cast": [ + { + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, + "projection": [] + } + }, + 5 + ] + } + ] + }, + "span": 2 } ], "terminator": { @@ -3014,7 +2758,7 @@ "args": [ { "Move": { - "local": 3, + "local": 6, "projection": [] } }, @@ -3023,212 +2767,230 @@ "local": 2, "projection": [] } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] + } } ], "destination": { - "local": 0, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 12, + "id": 0, "kind": "ZeroSized", - "ty": 31 + "ty": 0 }, - "span": 86, + "span": 0, "user_ty": null } }, "target": 1, - "unwind": { - "Cleanup": 3 - } - } - }, - "span": 86 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 2, "unwind": "Continue" } }, - "span": 86 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 86 + "span": 1 } }, { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } + "statements": [ + { + "kind": { + "StorageDead": 6 + }, + "span": 5 }, - "span": 86 - } - }, - { - "statements": [], + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 + }, + { + "Field": [ + 0, + 6 + ] + } + ] + } + } + } + ] + }, + "span": 6 + }, + { + "kind": { + "StorageDead": 8 + }, + "span": 7 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 7 + } + ], "terminator": { - "kind": "Resume", - "span": 86 + "kind": "Return", + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 86, - "ty": 16 + "span": 8, + "ty": 6 }, { "mutability": "Not", - "span": 86, - "ty": 12 + "span": 9, + "ty": 7 }, { "mutability": "Not", - "span": 86, - "ty": 1 + "span": 10, + "ty": 6 }, { "mutability": "Not", - "span": 86, - "ty": 32 - } - ], - "span": 86, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 8, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Move": { - "local": 1, - "projection": [] - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 86 - } + "span": 11, + "ty": 8 }, { - "statements": [], - "terminator": { - "kind": "Return", - "span": 86 - } - } - ], - "locals": [ + "mutability": "Not", + "span": 12, + "ty": 9 + }, { "mutability": "Mut", - "span": 86, - "ty": 1 + "span": 1, + "ty": 10 + }, + { + "mutability": "Mut", + "span": 2, + "ty": 5 }, { "mutability": "Not", - "span": 86, - "ty": 7 + "span": 2, + "ty": 11 }, { "mutability": "Not", - "span": 86, - "ty": 1 + "span": 3, + "ty": 12 } ], - "span": 86, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 8, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ + "span": 13, + "spread_arg": null, + "var_debug_info": [ { - "statements": [], - "terminator": { - "kind": "Return", - "span": 87 + "argument_index": 1, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } } - } - ], - "locals": [ + }, { - "mutability": "Mut", - "span": 87, - "ty": 1 + "argument_index": 2, + "composite": null, + "name": "argc", + "source_info": { + "scope": 0, + "span": 10 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } }, { - "mutability": "Not", - "span": 87, - "ty": 30 + "argument_index": 3, + "composite": null, + "name": "argv", + "source_info": { + "scope": 0, + "span": 11 + }, + "value": { + "Place": { + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } } - ], - "span": 87, - "spread_arg": null, - "var_debug_info": [] + ] }, - "id": 9, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" + "symbol_name": "std::rt::lang_start::he93191565b350026" }, { "details": null, @@ -3239,204 +3001,357 @@ "blocks": [ { "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, { "kind": { "Assign": [ { - "local": 2, + "local": 4, "projection": [] }, { - "Discriminant": { - "local": 1, - "projection": [ - "Deref" - ] + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } } } ] }, - "span": 89 + "span": 17 } ], "terminator": { "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 2, - "projection": [] + "Call": { + "args": [ + { + "Move": { + "local": 4, + "projection": [] + } } + ], + "destination": { + "local": 3, + "projection": [] }, - "targets": { - "branches": [ - [ - 1, - 2 - ], - [ - 0, - 1 - ] - ], - "otherwise": 4 - } + "func": { + "Constant": { + "const_": { + "id": 1, + "kind": "ZeroSized", + "ty": 13 + }, + "span": 14, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" } }, - "span": 88 + "span": 15 } }, { "statements": [ { "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 13, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 21 - }, - "span": 90, - "user_ty": null - } - } - } - ] + "StorageDead": 4 }, - "span": 90 + "span": 19 } ], "terminator": { "kind": { - "Goto": { - "target": 3 + "Call": { + "args": [ + { + "Move": { + "local": 3, + "projection": [] + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 2, + "kind": "ZeroSized", + "ty": 14 + }, + "span": 18, + "user_ty": null + } + }, + "target": 2, + "unwind": "Continue" } }, - "span": 90 + "span": 16 } }, { "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, { "kind": { "Assign": [ { - "local": 0, + "local": 5, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] + } + ] + } + ] + }, + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 6, "projection": [] }, { "Use": { - "Constant": { - "const_": { - "id": 14, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 1 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] }, - "ty": 21 - }, - "span": 91, - "user_ty": null + { + "Field": [ + 0, + 9 + ] + } + ] } } } ] }, - "span": 91 - } - ], - "terminator": { - "kind": { - "Goto": { - "target": 3 - } + "span": 23 }, - "span": 91 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 92 - } - }, - { - "statements": [], + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] + } + ] + }, + "span": 24 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 + } + ], "terminator": { - "kind": "Unreachable", - "span": 93 + "kind": "Return", + "span": 20 } } ], "locals": [ { "mutability": "Mut", - "span": 94, - "ty": 21 + "span": 28, + "ty": 16 }, { - "mutability": "Not", - "span": 95, - "ty": 33 + "mutability": "Mut", + "span": 3, + "ty": 11 }, { "mutability": "Mut", - "span": 96, - "ty": 6 + "span": 16, + "ty": 17 + }, + { + "mutability": "Mut", + "span": 15, + "ty": 1 + }, + { + "mutability": "Mut", + "span": 17, + "ty": 7 + }, + { + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 } ], - "span": 93, + "span": 3, "spread_arg": null, "var_debug_info": [ { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "self", + "name": "main", "source_info": { "scope": 0, - "span": 95 + "span": 9 }, "value": { "Place": { "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 29 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, "projection": [] } } } ] }, - "id": 10, - "name": "std::option::Option::::is_some" + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "_ZN4core6option15Option$LT$T$GT$7is_some17h" + "symbol_name": "std::rt::lang_start::{{closure}}::h1d9733ed32ea155d" }, { "details": null, @@ -3446,71 +3361,156 @@ "arg_count": 1, "blocks": [ { - "statements": [ - { - "kind": { - "Assign": [ + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ { - "local": 0, - "projection": [] + "Move": { + "local": 1, + "projection": [] + } }, { - "Use": { - "Constant": { - "const_": { - "id": 15, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 98, - "user_ty": null - } + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null } } - ] - }, - "span": 98 - } - ], + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 3, + "kind": "ZeroSized", + "ty": 19 + }, + "span": 31, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 33 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 5, + "kind": "ZeroSized", + "ty": 20 + }, + "span": 34, + "user_ty": null + } + }, + "target": 2, + "unwind": "Unreachable" + } + }, + "span": 35 + } + }, + { + "statements": [], "terminator": { "kind": "Return", - "span": 97 + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 99, - "ty": 17 + "span": 37, + "ty": 1 }, { "mutability": "Not", - "span": 100, + "span": 38, + "ty": 7 + }, + { + "mutability": "Not", + "span": 39, "ty": 1 } ], - "span": 101, + "span": 42, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "self", + "name": "f", "source_info": { "scope": 0, - "span": 100 + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 40 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "dummy", + "source_info": { + "scope": 2, + "span": 41 }, "value": { "Const": { @@ -3526,11 +3526,11 @@ } ] }, - "id": 11, - "name": "<() as std::process::Termination>::report" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::hcc79370e4f5a26a5" } ], "types": [ diff --git a/tests/integration/programs/closure-args.smir.json.expected b/tests/integration/programs/closure-args.smir.json.expected index 2249b50..6b81dea 100644 --- a/tests/integration/programs/closure-args.smir.json.expected +++ b/tests/integration/programs/closure-args.smir.json.expected @@ -102,6 +102,100 @@ ] ], "items": [ + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 8, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 17 + }, + "span": 46, + "user_ty": null + } + } + } + ] + }, + "span": 46 + } + ], + "terminator": { + "kind": "Return", + "span": 45 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 + }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::h371ab09429d1950e" + }, { "details": null, "mono_item_kind": { @@ -407,7 +501,7 @@ "name": "main" } }, - "symbol_name": "_ZN12closure_args4main17h" + "symbol_name": "closure_args::main::h1fc4146de98d22f6" }, { "details": null, @@ -589,82 +683,22 @@ "name": "main::{closure#0}" } }, - "symbol_name": "_ZN12closure_args4main28_$u7b$$u7b$closure$u7d$$u7d$17h" + "symbol_name": "closure_args::main::{{closure}}::h1c6a9b8f477b14a8" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 2, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, - { - "kind": { - "Assign": [ - { - "local": 8, - "projection": [] - }, - { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 - } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] - } - ] - }, - "span": 3 - }, { "kind": { "Assign": [ { - "local": 7, + "local": 3, "projection": [] }, { @@ -672,59 +706,26 @@ { "kind": "ReErased" }, - "Shared", - { - "local": 8, - "projection": [] - } - ] - } - ] - }, - "span": 2 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, { - "Copy": { - "local": 7, - "projection": [] + "Mut": { + "kind": "Default" } }, - 5 + { + "local": 1, + "projection": [] + } ] } ] }, - "span": 2 + "span": 43 } ], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, { "Move": { "local": 3, @@ -733,626 +734,460 @@ }, { "Move": { - "local": 4, + "local": 2, "projection": [] } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 7, "kind": "ZeroSized", - "ty": 0 + "ty": 23 }, - "span": 0, + "span": 43, "user_ty": null } }, "target": 1, - "unwind": "Continue" + "unwind": { + "Cleanup": 3 + } } }, - "span": 1 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 5 + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, + "unwind": "Continue" + } }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 - } - ], - "terminator": { - "kind": "Return", - "span": 4 + "span": 43 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 8, - "ty": 6 - }, - { - "mutability": "Not", - "span": 9, - "ty": 7 }, { - "mutability": "Not", - "span": 10, - "ty": 6 + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } }, { - "mutability": "Not", - "span": 11, - "ty": 8 + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } + }, + "span": 43 + } }, { - "mutability": "Not", - "span": 12, - "ty": 9 - }, + "statements": [], + "terminator": { + "kind": "Resume", + "span": 43 + } + } + ], + "locals": [ { "mutability": "Mut", - "span": 1, - "ty": 10 + "span": 43, + "ty": 16 }, { - "mutability": "Mut", - "span": 2, - "ty": 5 + "mutability": "Not", + "span": 43, + "ty": 12 }, { "mutability": "Not", - "span": 2, - "ty": 11 + "span": 43, + "ty": 1 }, { "mutability": "Not", - "span": 3, - "ty": 12 + "span": 43, + "ty": 24 } ], - "span": 13, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - }, - { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } - } - ] + "span": 43, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "core::ops::function::FnOnce::call_once::h6c3ca0aaab63cf48" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 2, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 16 - }, - { - "kind": { - "StorageLive": 3 - }, - "span": 15 - }, - { - "kind": { - "StorageLive": 4 - }, - "span": 17 - }, - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - } - ] - }, - "span": 17 - } - ], + "statements": [], "terminator": { "kind": { "Call": { - "args": [ - { - "Move": { - "local": 4, - "projection": [] - } - } - ], + "args": [], "destination": { - "local": 3, + "local": 0, "projection": [] }, "func": { - "Constant": { - "const_": { - "id": 1, - "kind": "ZeroSized", - "ty": 13 - }, - "span": 14, - "user_ty": null + "Move": { + "local": 1, + "projection": [] } }, "target": 1, "unwind": "Continue" } }, - "span": 15 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 4 - }, - "span": 19 - } - ], + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 1 + }, + { + "mutability": "Not", + "span": 43, + "ty": 7 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": ">::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::hcaf9623b4a8cad5c" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 3, + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, "projection": [] } } ], "destination": { - "local": 2, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 2, + "id": 6, "kind": "ZeroSized", - "ty": 14 + "ty": 21 }, - "span": 18, + "span": 43, "user_ty": null } }, - "target": 2, + "target": 1, "unwind": "Continue" } }, - "span": 16 + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 16 + }, + { + "mutability": "Not", + "span": 43, + "ty": 22 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h5aa6a622dea0c8c7" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::hb26ff286dfd63c67" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 4, + "blocks": [ { "statements": [ { "kind": { - "StorageDead": 3 + "StorageLive": 5 }, - "span": 21 + "span": 1 }, { "kind": { - "StorageLive": 5 + "StorageLive": 6 }, - "span": 22 + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 }, { "kind": { "Assign": [ { - "local": 5, + "local": 8, "projection": [] }, { - "Ref": [ + "Aggregate": [ { - "kind": "ReErased" + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] }, - "Shared", - { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] + [ + { + "Copy": { + "local": 1, + "projection": [] } - ] - } + } + ] ] } ] }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 + "span": 3 }, { "kind": { "Assign": [ { - "local": 6, + "local": 7, "projection": [] }, { - "Use": { - "Copy": { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - }, - { - "Field": [ - 0, - 9 - ] - } - ] + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] } - } + ] } ] }, - "span": 23 + "span": 2 }, { "kind": { "Assign": [ { - "local": 0, + "local": 6, "projection": [] }, { "Cast": [ - "IntToInt", { - "Move": { - "local": 6, + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, "projection": [] } }, - 16 + 5 ] } ] }, - "span": 24 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 25 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 + "span": 2 } ], - "terminator": { - "kind": "Return", - "span": 20 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 28, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 3, - "ty": 11 - }, - { - "mutability": "Mut", - "span": 16, - "ty": 17 - }, - { - "mutability": "Mut", - "span": 15, - "ty": 1 - }, - { - "mutability": "Mut", - "span": 17, - "ty": 7 - }, - { - "mutability": "Mut", - "span": 22, - "ty": 18 - }, - { - "mutability": "Mut", - "span": 23, - "ty": 9 - } - ], - "span": 3, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": null, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 1, - "span": 29 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 2, - "span": 30 - }, - "value": { - "Place": { - "local": 5, - "projection": [] - } - } - } - ] - }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" - } - }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, + "local": 6, "projection": [] } }, { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 2, + "projection": [] + } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] } } ], "destination": { - "local": 0, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 3, + "id": 0, "kind": "ZeroSized", - "ty": 19 + "ty": 0 }, - "span": 31, + "span": 0, "user_ty": null } }, @@ -1360,84 +1195,122 @@ "unwind": "Continue" } }, - "span": 33 + "span": 1 } }, { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "StorageDead": 6 + }, + "span": 5 + }, + { + "kind": { + "Assign": [ { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "local": 0, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 + }, + { + "Field": [ + 0, + 6 + ] + } + ] + } } } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 5, - "kind": "ZeroSized", - "ty": 20 - }, - "span": 34, - "user_ty": null - } - }, - "target": 2, - "unwind": "Unreachable" - } + ] + }, + "span": 6 }, - "span": 35 - } - }, - { - "statements": [], + { + "kind": { + "StorageDead": 8 + }, + "span": 7 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 7 + } + ], "terminator": { "kind": "Return", - "span": 36 + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 37, - "ty": 1 + "span": 8, + "ty": 6 }, { "mutability": "Not", - "span": 38, + "span": 9, "ty": 7 }, { "mutability": "Not", - "span": 39, - "ty": 1 + "span": 10, + "ty": 6 + }, + { + "mutability": "Not", + "span": 11, + "ty": 8 + }, + { + "mutability": "Not", + "span": 12, + "ty": 9 + }, + { + "mutability": "Mut", + "span": 1, + "ty": 10 + }, + { + "mutability": "Mut", + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 } ], - "span": 42, + "span": 13, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "f", + "name": "main", "source_info": { "scope": 0, - "span": 38 + "span": 9 }, "value": { "Place": { @@ -1447,88 +1320,151 @@ } }, { - "argument_index": null, + "argument_index": 2, "composite": null, - "name": "result", + "name": "argc", "source_info": { - "scope": 1, - "span": 40 + "scope": 0, + "span": 10 }, "value": { "Place": { - "local": 0, + "local": 2, "projection": [] } } }, { - "argument_index": 1, + "argument_index": 3, "composite": null, - "name": "dummy", + "name": "argv", "source_info": { - "scope": 2, - "span": 41 + "scope": 0, + "span": 11 }, "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Place": { + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, + "projection": [] } } } ] }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "symbol_name": "std::rt::lang_start::hbbf83a02f1458567" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 1, "blocks": [ { - "statements": [], + "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + } + ] + }, + "span": 17 + } + ], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } - }, - { - "Move": { - "local": 2, + "local": 4, "projection": [] } } ], "destination": { - "local": 0, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 6, + "id": 1, "kind": "ZeroSized", - "ty": 21 + "ty": 13 }, - "span": 43, + "span": 14, "user_ty": null } }, @@ -1536,79 +1472,16 @@ "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 + "span": 15 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 22 }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - { - "Mut": { - "kind": "Default" - } - }, - { - "local": 1, - "projection": [] - } - ] - } - ] + { + "statements": [ + { + "kind": { + "StorageDead": 4 }, - "span": 43 + "span": 19 } ], "terminator": { @@ -1620,292 +1493,419 @@ "local": 3, "projection": [] } - }, - { - "Move": { - "local": 2, - "projection": [] - } } ], "destination": { - "local": 0, + "local": 2, "projection": [] }, "func": { "Constant": { "const_": { - "id": 7, + "id": 2, "kind": "ZeroSized", - "ty": 23 + "ty": 14 }, - "span": 43, + "span": 18, "user_ty": null } }, - "target": 1, - "unwind": { - "Cleanup": 3 - } - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, "target": 2, "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 + "span": 16 } }, { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } + "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 21 }, - "span": 43 - } - }, - { - "statements": [], + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] + } + ] + } + ] + }, + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + }, + { + "Field": [ + 0, + 9 + ] + } + ] + } + } + } + ] + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] + } + ] + }, + "span": 24 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 + } + ], "terminator": { - "kind": "Resume", - "span": 43 + "kind": "Return", + "span": 20 } } ], "locals": [ { "mutability": "Mut", - "span": 43, + "span": 28, "ty": 16 }, { - "mutability": "Not", - "span": 43, - "ty": 12 + "mutability": "Mut", + "span": 3, + "ty": 11 }, { - "mutability": "Not", - "span": 43, + "mutability": "Mut", + "span": 16, + "ty": 17 + }, + { + "mutability": "Mut", + "span": 15, "ty": 1 }, { - "mutability": "Not", - "span": 43, - "ty": 24 + "mutability": "Mut", + "span": 17, + "ty": 7 + }, + { + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 + } + ], + "span": 3, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": null, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 29 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] + ] }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" + "symbol_name": "std::rt::lang_start::{{closure}}::hb385a02feb05c4e9" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 1, "blocks": [ { "statements": [], "terminator": { "kind": { "Call": { - "args": [], + "args": [ + { + "Move": { + "local": 1, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], "destination": { "local": 0, "projection": [] }, "func": { - "Move": { - "local": 1, - "projection": [] + "Constant": { + "const_": { + "id": 3, + "kind": "ZeroSized", + "ty": 19 + }, + "span": 31, + "user_ty": null } }, "target": 1, "unwind": "Continue" } }, - "span": 43 + "span": 33 } }, { "statements": [], "terminator": { - "kind": "Return", - "span": 43 + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 5, + "kind": "ZeroSized", + "ty": 20 + }, + "span": 34, + "user_ty": null + } + }, + "target": 2, + "unwind": "Unreachable" + } + }, + "span": 35 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 1 }, - { - "mutability": "Not", - "span": 43, - "ty": 7 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ { "statements": [], "terminator": { "kind": "Return", - "span": 44 + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 44, + "span": 37, "ty": 1 }, { "mutability": "Not", - "span": 44, - "ty": 22 - } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] - }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" - } - }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 46, - "user_ty": null - } - } - } - ] - }, - "span": 46 - } - ], - "terminator": { - "kind": "Return", - "span": 45 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 47, - "ty": 17 + "span": 38, + "ty": 7 }, { "mutability": "Not", - "span": 48, + "span": 39, "ty": 1 } ], - "span": 49, + "span": 42, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "self", + "name": "f", "source_info": { "scope": 0, - "span": 48 + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 40 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "dummy", + "source_info": { + "scope": 2, + "span": 41 }, "value": { "Const": { @@ -1921,11 +1921,11 @@ } ] }, - "id": 5, - "name": "<() as std::process::Termination>::report" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::hf8a8faab4f42c2ab" } ], "types": [ diff --git a/tests/integration/programs/closure-no-args.smir.json.expected b/tests/integration/programs/closure-no-args.smir.json.expected index 1e67536..af5024e 100644 --- a/tests/integration/programs/closure-no-args.smir.json.expected +++ b/tests/integration/programs/closure-no-args.smir.json.expected @@ -96,6 +96,100 @@ ] ], "items": [ + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 8, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 17 + }, + "span": 46, + "user_ty": null + } + } + } + ] + }, + "span": 46 + } + ], + "terminator": { + "kind": "Return", + "span": 45 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 + }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::h61e6d5839a127881" + }, { "details": null, "mono_item_kind": { @@ -333,7 +427,7 @@ "name": "main" } }, - "symbol_name": "_ZN15closure_no_args4main17h" + "symbol_name": "closure_no_args::main::h40a3d87758fcab99" }, { "details": null, @@ -409,82 +503,22 @@ "name": "main::{closure#0}" } }, - "symbol_name": "_ZN15closure_no_args4main28_$u7b$$u7b$closure$u7d$$u7d$17h" + "symbol_name": "closure_no_args::main::{{closure}}::h639e282b1db87e78" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 2, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, - { - "kind": { - "Assign": [ - { - "local": 8, - "projection": [] - }, - { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 - } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] - } - ] - }, - "span": 3 - }, { "kind": { "Assign": [ { - "local": 7, + "local": 3, "projection": [] }, { @@ -492,59 +526,26 @@ { "kind": "ReErased" }, - "Shared", - { - "local": 8, - "projection": [] - } - ] - } - ] - }, - "span": 2 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, { - "Copy": { - "local": 7, - "projection": [] + "Mut": { + "kind": "Default" } }, - 5 + { + "local": 1, + "projection": [] + } ] } ] }, - "span": 2 + "span": 43 } ], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, { "Move": { "local": 3, @@ -553,626 +554,460 @@ }, { "Move": { - "local": 4, + "local": 2, "projection": [] } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 7, "kind": "ZeroSized", - "ty": 0 + "ty": 23 }, - "span": 0, + "span": 43, "user_ty": null } }, "target": 1, - "unwind": "Continue" + "unwind": { + "Cleanup": 3 + } } }, - "span": 1 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 5 + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, + "unwind": "Continue" + } }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 - } - ], - "terminator": { - "kind": "Return", - "span": 4 + "span": 43 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 8, - "ty": 6 - }, - { - "mutability": "Not", - "span": 9, - "ty": 7 }, { - "mutability": "Not", - "span": 10, - "ty": 6 + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } }, { - "mutability": "Not", - "span": 11, - "ty": 8 + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } + }, + "span": 43 + } }, { - "mutability": "Not", - "span": 12, - "ty": 9 - }, + "statements": [], + "terminator": { + "kind": "Resume", + "span": 43 + } + } + ], + "locals": [ { "mutability": "Mut", - "span": 1, - "ty": 10 + "span": 43, + "ty": 16 }, { - "mutability": "Mut", - "span": 2, - "ty": 5 + "mutability": "Not", + "span": 43, + "ty": 12 }, { "mutability": "Not", - "span": 2, - "ty": 11 + "span": 43, + "ty": 1 }, { "mutability": "Not", - "span": 3, - "ty": 12 + "span": 43, + "ty": 24 } ], - "span": 13, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - }, - { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } - } - ] + "span": 43, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "core::ops::function::FnOnce::call_once::h4789014b7ab97533" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 2, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 16 - }, - { - "kind": { - "StorageLive": 3 - }, - "span": 15 - }, - { - "kind": { - "StorageLive": 4 - }, - "span": 17 - }, - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - } - ] - }, - "span": 17 - } - ], + "statements": [], "terminator": { "kind": { "Call": { - "args": [ - { - "Move": { - "local": 4, - "projection": [] - } - } - ], + "args": [], "destination": { - "local": 3, + "local": 0, "projection": [] }, "func": { - "Constant": { - "const_": { - "id": 1, - "kind": "ZeroSized", - "ty": 13 - }, - "span": 14, - "user_ty": null + "Move": { + "local": 1, + "projection": [] } }, "target": 1, "unwind": "Continue" } }, - "span": 15 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 4 - }, - "span": 19 - } - ], + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 1 + }, + { + "mutability": "Not", + "span": 43, + "ty": 7 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": ">::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h8cc5009eee7caadb" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 3, + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, "projection": [] } } ], "destination": { - "local": 2, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 2, + "id": 6, "kind": "ZeroSized", - "ty": 14 + "ty": 21 }, - "span": 18, + "span": 43, "user_ty": null } }, - "target": 2, + "target": 1, "unwind": "Continue" } }, - "span": 16 + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 16 + }, + { + "mutability": "Not", + "span": 43, + "ty": 22 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h87acc9e24679a685" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::hb4c2e343837f21a7" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 4, + "blocks": [ { "statements": [ { "kind": { - "StorageDead": 3 + "StorageLive": 5 }, - "span": 21 + "span": 1 }, { "kind": { - "StorageLive": 5 + "StorageLive": 6 }, - "span": 22 + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 }, { "kind": { "Assign": [ { - "local": 5, + "local": 8, "projection": [] }, { - "Ref": [ + "Aggregate": [ { - "kind": "ReErased" + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] }, - "Shared", - { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] + [ + { + "Copy": { + "local": 1, + "projection": [] } - ] - } + } + ] ] } ] }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 + "span": 3 }, { "kind": { "Assign": [ { - "local": 6, + "local": 7, "projection": [] }, { - "Use": { - "Copy": { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - }, - { - "Field": [ - 0, - 9 - ] - } - ] + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] } - } + ] } ] }, - "span": 23 + "span": 2 }, { "kind": { "Assign": [ { - "local": 0, + "local": 6, "projection": [] }, { "Cast": [ - "IntToInt", { - "Move": { - "local": 6, + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, "projection": [] } }, - 16 + 5 ] } ] }, - "span": 24 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 25 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 + "span": 2 } ], - "terminator": { - "kind": "Return", - "span": 20 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 28, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 3, - "ty": 11 - }, - { - "mutability": "Mut", - "span": 16, - "ty": 17 - }, - { - "mutability": "Mut", - "span": 15, - "ty": 1 - }, - { - "mutability": "Mut", - "span": 17, - "ty": 7 - }, - { - "mutability": "Mut", - "span": 22, - "ty": 18 - }, - { - "mutability": "Mut", - "span": 23, - "ty": 9 - } - ], - "span": 3, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": null, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 1, - "span": 29 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 2, - "span": 30 - }, - "value": { - "Place": { - "local": 5, - "projection": [] - } - } - } - ] - }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" - } - }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, + "local": 6, "projection": [] } }, { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 2, + "projection": [] + } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] } } ], "destination": { - "local": 0, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 3, + "id": 0, "kind": "ZeroSized", - "ty": 19 + "ty": 0 }, - "span": 31, + "span": 0, "user_ty": null } }, @@ -1180,84 +1015,122 @@ "unwind": "Continue" } }, - "span": 33 + "span": 1 } }, { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "StorageDead": 6 + }, + "span": 5 + }, + { + "kind": { + "Assign": [ { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "local": 0, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 + }, + { + "Field": [ + 0, + 6 + ] + } + ] + } } } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 5, - "kind": "ZeroSized", - "ty": 20 - }, - "span": 34, - "user_ty": null - } - }, - "target": 2, - "unwind": "Unreachable" - } + ] + }, + "span": 6 }, - "span": 35 - } - }, - { - "statements": [], + { + "kind": { + "StorageDead": 8 + }, + "span": 7 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 7 + } + ], "terminator": { "kind": "Return", - "span": 36 + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 37, - "ty": 1 + "span": 8, + "ty": 6 }, { "mutability": "Not", - "span": 38, + "span": 9, "ty": 7 }, { "mutability": "Not", - "span": 39, - "ty": 1 + "span": 10, + "ty": 6 + }, + { + "mutability": "Not", + "span": 11, + "ty": 8 + }, + { + "mutability": "Not", + "span": 12, + "ty": 9 + }, + { + "mutability": "Mut", + "span": 1, + "ty": 10 + }, + { + "mutability": "Mut", + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 } ], - "span": 42, + "span": 13, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "f", + "name": "main", "source_info": { "scope": 0, - "span": 38 + "span": 9 }, "value": { "Place": { @@ -1267,88 +1140,151 @@ } }, { - "argument_index": null, + "argument_index": 2, "composite": null, - "name": "result", + "name": "argc", "source_info": { - "scope": 1, - "span": 40 + "scope": 0, + "span": 10 }, "value": { "Place": { - "local": 0, + "local": 2, "projection": [] } } }, { - "argument_index": 1, + "argument_index": 3, "composite": null, - "name": "dummy", + "name": "argv", "source_info": { - "scope": 2, - "span": 41 + "scope": 0, + "span": 11 }, "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Place": { + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, + "projection": [] } } } ] }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "symbol_name": "std::rt::lang_start::h06386e0d5dd9bb9f" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 1, "blocks": [ { - "statements": [], + "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + } + ] + }, + "span": 17 + } + ], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } - }, - { - "Move": { - "local": 2, + "local": 4, "projection": [] } } ], "destination": { - "local": 0, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 6, + "id": 1, "kind": "ZeroSized", - "ty": 21 + "ty": 13 }, - "span": 43, + "span": 14, "user_ty": null } }, @@ -1356,79 +1292,16 @@ "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 + "span": 15 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 22 }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - { - "Mut": { - "kind": "Default" - } - }, - { - "local": 1, - "projection": [] - } - ] - } - ] + { + "statements": [ + { + "kind": { + "StorageDead": 4 }, - "span": 43 + "span": 19 } ], "terminator": { @@ -1440,292 +1313,419 @@ "local": 3, "projection": [] } - }, - { - "Move": { - "local": 2, - "projection": [] - } } ], "destination": { - "local": 0, + "local": 2, "projection": [] }, "func": { "Constant": { "const_": { - "id": 7, + "id": 2, "kind": "ZeroSized", - "ty": 23 + "ty": 14 }, - "span": 43, + "span": 18, "user_ty": null } }, - "target": 1, - "unwind": { - "Cleanup": 3 - } - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, "target": 2, "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 + "span": 16 } }, { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } + "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 21 }, - "span": 43 - } - }, - { - "statements": [], + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] + } + ] + } + ] + }, + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + }, + { + "Field": [ + 0, + 9 + ] + } + ] + } + } + } + ] + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] + } + ] + }, + "span": 24 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 + } + ], "terminator": { - "kind": "Resume", - "span": 43 + "kind": "Return", + "span": 20 } } ], "locals": [ { "mutability": "Mut", - "span": 43, + "span": 28, "ty": 16 }, { - "mutability": "Not", - "span": 43, - "ty": 12 + "mutability": "Mut", + "span": 3, + "ty": 11 }, { - "mutability": "Not", - "span": 43, + "mutability": "Mut", + "span": 16, + "ty": 17 + }, + { + "mutability": "Mut", + "span": 15, "ty": 1 }, { - "mutability": "Not", - "span": 43, - "ty": 24 + "mutability": "Mut", + "span": 17, + "ty": 7 + }, + { + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 + } + ], + "span": 3, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": null, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 29 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] + ] }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" + "symbol_name": "std::rt::lang_start::{{closure}}::h6f7dfdf9b356f278" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 1, "blocks": [ { "statements": [], "terminator": { "kind": { "Call": { - "args": [], + "args": [ + { + "Move": { + "local": 1, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], "destination": { "local": 0, "projection": [] }, "func": { - "Move": { - "local": 1, - "projection": [] + "Constant": { + "const_": { + "id": 3, + "kind": "ZeroSized", + "ty": 19 + }, + "span": 31, + "user_ty": null } }, "target": 1, "unwind": "Continue" } }, - "span": 43 + "span": 33 } }, { "statements": [], "terminator": { - "kind": "Return", - "span": 43 + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 5, + "kind": "ZeroSized", + "ty": 20 + }, + "span": 34, + "user_ty": null + } + }, + "target": 2, + "unwind": "Unreachable" + } + }, + "span": 35 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 1 }, - { - "mutability": "Not", - "span": 43, - "ty": 7 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ { "statements": [], "terminator": { "kind": "Return", - "span": 44 + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 44, + "span": 37, "ty": 1 }, { "mutability": "Not", - "span": 44, - "ty": 22 - } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] - }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" - } - }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 46, - "user_ty": null - } - } - } - ] - }, - "span": 46 - } - ], - "terminator": { - "kind": "Return", - "span": 45 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 47, - "ty": 17 + "span": 38, + "ty": 7 }, { "mutability": "Not", - "span": 48, + "span": 39, "ty": 1 } ], - "span": 49, + "span": 42, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "self", + "name": "f", "source_info": { "scope": 0, - "span": 48 + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 40 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "dummy", + "source_info": { + "scope": 2, + "span": 41 }, "value": { "Const": { @@ -1741,11 +1741,11 @@ } ] }, - "id": 5, - "name": "<() as std::process::Termination>::report" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h070d140d5cdaa56e" } ], "types": [ diff --git a/tests/integration/programs/const-arithm-simple.smir.json.expected b/tests/integration/programs/const-arithm-simple.smir.json.expected index 3b5f860..f34fa84 100644 --- a/tests/integration/programs/const-arithm-simple.smir.json.expected +++ b/tests/integration/programs/const-arithm-simple.smir.json.expected @@ -86,6 +86,100 @@ ] ], "items": [ + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 8, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 17 + }, + "span": 46, + "user_ty": null + } + } + } + ] + }, + "span": 46 + } + ], + "terminator": { + "kind": "Return", + "span": 45 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 + }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::h083c88785663c143" + }, { "details": null, "mono_item_kind": { @@ -450,7 +544,7 @@ "name": "main" } }, - "symbol_name": "_ZN19const_arithm_simple4main17h" + "symbol_name": "const_arithm_simple::main::h08de8e55ad719e81" }, { "details": null, @@ -552,82 +646,87 @@ "name": "test" } }, - "symbol_name": "_ZN19const_arithm_simple4test17h" + "symbol_name": "const_arithm_simple::test::hd8d9211e783fc31b" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 2, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, - { - "kind": { - "Assign": [ - { - "local": 8, + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, "projection": [] - }, - { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 - } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] } - ] - }, - "span": 3 + }, + "target": 1, + "unwind": "Continue" + } }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 1 + }, + { + "mutability": "Not", + "span": 43, + "ty": 7 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": ">::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::ha8c8daee0971cff6" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ { "kind": { "Assign": [ { - "local": 7, + "local": 3, "projection": [] }, { @@ -635,41 +734,20 @@ { "kind": "ReErased" }, - "Shared", - { - "local": 8, - "projection": [] - } - ] - } - ] - }, - "span": 2 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, { - "Copy": { - "local": 7, - "projection": [] + "Mut": { + "kind": "Default" } }, - 5 + { + "local": 1, + "projection": [] + } ] } ] }, - "span": 2 + "span": 43 } ], "terminator": { @@ -678,7 +756,7 @@ "args": [ { "Move": { - "local": 6, + "local": 3, "projection": [] } }, @@ -687,433 +765,429 @@ "local": 2, "projection": [] } - }, - { - "Move": { - "local": 3, - "projection": [] - } - }, - { - "Move": { - "local": 4, - "projection": [] - } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 7, "kind": "ZeroSized", - "ty": 0 + "ty": 23 }, - "span": 0, + "span": 43, "user_ty": null } }, "target": 1, - "unwind": "Continue" + "unwind": { + "Cleanup": 3 + } } }, - "span": 1 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 5 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, + "unwind": "Continue" + } }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 - } - ], + "span": 43 + } + }, + { + "statements": [], "terminator": { "kind": "Return", - "span": 4 + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Resume", + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 8, - "ty": 6 + "span": 43, + "ty": 16 }, { "mutability": "Not", - "span": 9, - "ty": 7 + "span": 43, + "ty": 12 }, { "mutability": "Not", - "span": 10, - "ty": 6 + "span": 43, + "ty": 1 }, { "mutability": "Not", - "span": 11, - "ty": 8 - }, + "span": 43, + "ty": 24 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::hffbeef369d0221d1" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { - "mutability": "Not", - "span": 12, - "ty": 9 + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + } + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 6, + "kind": "ZeroSized", + "ty": 21 + }, + "span": 43, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 43 + } }, { - "mutability": "Mut", - "span": 1, - "ty": 10 - }, + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ { "mutability": "Mut", - "span": 2, - "ty": 5 + "span": 43, + "ty": 16 }, { "mutability": "Not", - "span": 2, - "ty": 11 + "span": 43, + "ty": 22 }, { "mutability": "Not", - "span": 3, - "ty": 12 + "span": 43, + "ty": 1 } ], - "span": 13, - "spread_arg": null, - "var_debug_info": [ + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h5deecba3a8731f38" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ { - "argument_index": 1, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 } - }, + } + ], + "locals": [ { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - }, - { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } + "mutability": "Mut", + "span": 44, + "ty": 1 }, { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } + "mutability": "Not", + "span": 44, + "ty": 22 } - ] + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h321ca032a25ec1c2" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 4, "blocks": [ { "statements": [ { "kind": { - "StorageLive": 2 + "StorageLive": 5 }, - "span": 16 + "span": 1 }, { "kind": { - "StorageLive": 3 + "StorageLive": 6 }, - "span": 15 + "span": 2 }, { "kind": { - "StorageLive": 4 + "StorageLive": 8 }, - "span": 17 + "span": 3 }, { "kind": { "Assign": [ { - "local": 4, + "local": 8, "projection": [] }, { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } + "Aggregate": [ + { + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] ] - } - } + }, + [ + { + "Copy": { + "local": 1, + "projection": [] + } + } + ] + ] } ] }, - "span": 17 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ + "span": 3 + }, + { + "kind": { + "Assign": [ { - "Move": { - "local": 4, - "projection": [] - } - } - ], - "destination": { - "local": 3, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 1, - "kind": "ZeroSized", - "ty": 13 - }, - "span": 14, - "user_ty": null + "local": 7, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] + } + ] } - }, - "target": 1, - "unwind": "Continue" - } + ] + }, + "span": 2 }, - "span": 15 - } - }, - { - "statements": [ { "kind": { - "StorageDead": 4 + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Cast": [ + { + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, + "projection": [] + } + }, + 5 + ] + } + ] }, - "span": 19 + "span": 2 } ], "terminator": { "kind": { "Call": { "args": [ + { + "Move": { + "local": 6, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + }, { "Move": { "local": 3, "projection": [] } + }, + { + "Move": { + "local": 4, + "projection": [] + } } ], "destination": { - "local": 2, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 2, + "id": 0, "kind": "ZeroSized", - "ty": 14 + "ty": 0 }, - "span": 18, + "span": 0, "user_ty": null } }, - "target": 2, + "target": 1, "unwind": "Continue" } }, - "span": 16 + "span": 1 } }, { "statements": [ { "kind": { - "StorageDead": 3 - }, - "span": 21 - }, - { - "kind": { - "StorageLive": 5 + "StorageDead": 6 }, - "span": 22 + "span": 5 }, { "kind": { "Assign": [ { - "local": 5, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - } - ] - } - ] - } - ] - }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 - }, - { - "kind": { - "Assign": [ - { - "local": 6, + "local": 0, "projection": [] }, { "Use": { "Copy": { - "local": 2, + "local": 5, "projection": [ { - "Field": [ - 0, - 15 - ] + "Downcast": 0 }, { "Field": [ 0, - 9 + 6 ] } ] @@ -1122,98 +1196,79 @@ } ] }, - "span": 23 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Cast": [ - "IntToInt", - { - "Move": { - "local": 6, - "projection": [] - } - }, - 16 - ] - } - ] - }, - "span": 24 + "span": 6 }, { "kind": { - "StorageDead": 6 + "StorageDead": 8 }, - "span": 25 + "span": 7 }, { "kind": { "StorageDead": 5 }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 + "span": 7 } ], "terminator": { "kind": "Return", - "span": 20 + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 28, - "ty": 16 + "span": 8, + "ty": 6 }, { - "mutability": "Mut", - "span": 3, - "ty": 11 + "mutability": "Not", + "span": 9, + "ty": 7 }, { - "mutability": "Mut", - "span": 16, - "ty": 17 + "mutability": "Not", + "span": 10, + "ty": 6 }, { - "mutability": "Mut", - "span": 15, - "ty": 1 + "mutability": "Not", + "span": 11, + "ty": 8 }, { - "mutability": "Mut", - "span": 17, - "ty": 7 + "mutability": "Not", + "span": 12, + "ty": 9 }, { "mutability": "Mut", - "span": 22, - "ty": 18 + "span": 1, + "ty": 10 }, { "mutability": "Mut", - "span": 23, - "ty": 9 + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 } ], - "span": 3, + "span": 13, "spread_arg": null, "var_debug_info": [ { - "argument_index": null, + "argument_index": 1, "composite": null, "name": "main", "source_info": { @@ -1223,25 +1278,17 @@ "value": { "Place": { "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] + "projection": [] } } }, { - "argument_index": 1, + "argument_index": 2, "composite": null, - "name": "self", + "name": "argc", "source_info": { - "scope": 1, - "span": 29 + "scope": 0, + "span": 10 }, "value": { "Place": { @@ -1251,27 +1298,57 @@ } }, { - "argument_index": 1, + "argument_index": 3, "composite": null, - "name": "self", + "name": "argv", "source_info": { - "scope": 2, - "span": 30 + "scope": 0, + "span": 11 }, "value": { "Place": { - "local": 5, + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, "projection": [] } } } ] }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "symbol_name": "std::rt::lang_start::h1f0fee22f554814b" }, { "details": null, @@ -1281,41 +1358,76 @@ "arg_count": 1, "blocks": [ { - "statements": [], + "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + } + ] + }, + "span": 17 + } + ], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, + "local": 4, "projection": [] } - }, - { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } } ], "destination": { - "local": 0, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 3, + "id": 1, "kind": "ZeroSized", - "ty": 19 + "ty": 13 }, - "span": 31, + "span": 14, "user_ty": null } }, @@ -1323,24 +1435,26 @@ "unwind": "Continue" } }, - "span": 33 + "span": 15 } }, { - "statements": [], + "statements": [ + { + "kind": { + "StorageDead": 4 + }, + "span": 19 + } + ], "terminator": { "kind": { "Call": { "args": [ { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 3, + "projection": [] } } ], @@ -1351,75 +1465,225 @@ "func": { "Constant": { "const_": { - "id": 5, + "id": 2, "kind": "ZeroSized", - "ty": 20 + "ty": 14 }, - "span": 34, + "span": 18, "user_ty": null } }, "target": 2, - "unwind": "Unreachable" + "unwind": "Continue" } }, - "span": 35 + "span": 16 } }, { - "statements": [], + "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] + } + ] + } + ] + }, + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + }, + { + "Field": [ + 0, + 9 + ] + } + ] + } + } + } + ] + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] + } + ] + }, + "span": 24 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 + } + ], "terminator": { "kind": "Return", - "span": 36 + "span": 20 } } ], "locals": [ { "mutability": "Mut", - "span": 37, + "span": 28, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 3, + "ty": 11 + }, + { + "mutability": "Mut", + "span": 16, + "ty": 17 + }, + { + "mutability": "Mut", + "span": 15, "ty": 1 }, { - "mutability": "Not", - "span": 38, + "mutability": "Mut", + "span": 17, "ty": 7 }, { - "mutability": "Not", - "span": 39, - "ty": 1 + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 } ], - "span": 42, + "span": 3, "spread_arg": null, "var_debug_info": [ { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "f", + "name": "main", "source_info": { "scope": 0, - "span": 38 + "span": 9 }, "value": { "Place": { "local": 1, - "projection": [] + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] } } }, { - "argument_index": null, + "argument_index": 1, "composite": null, - "name": "result", + "name": "self", "source_info": { "scope": 1, - "span": 40 + "span": 29 }, "value": { "Place": { - "local": 0, + "local": 2, "projection": [] } } @@ -1427,232 +1691,54 @@ { "argument_index": 1, "composite": null, - "name": "dummy", + "name": "self", "source_info": { "scope": 2, - "span": 41 + "span": 30 }, "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Place": { + "local": 5, + "projection": [] } } - } - ] - }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" - } - }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 21 - }, - "span": 43, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 22 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Move": { - "local": 1, - "projection": [] - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 7 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - { - "Mut": { - "kind": "Default" - } - }, - { - "local": 1, - "projection": [] - } - ] - } - ] - }, - "span": 43 - } - ], + } + ] + }, + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" + } + }, + "symbol_name": "std::rt::lang_start::{{closure}}::h88bb633d4b3818f8" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 3, + "local": 1, "projection": [] } }, { - "Move": { - "local": 2, - "projection": [] + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null } } ], @@ -1663,212 +1749,126 @@ "func": { "Constant": { "const_": { - "id": 7, + "id": 3, "kind": "ZeroSized", - "ty": 23 + "ty": 19 }, - "span": 43, + "span": 31, "user_ty": null } }, "target": 1, - "unwind": { - "Cleanup": 3 - } + "unwind": "Continue" } }, - "span": 43 + "span": 33 } }, { "statements": [], "terminator": { "kind": { - "Drop": { - "place": { - "local": 1, + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 2, "projection": [] }, + "func": { + "Constant": { + "const_": { + "id": 5, + "kind": "ZeroSized", + "ty": 20 + }, + "span": 34, + "user_ty": null + } + }, "target": 2, - "unwind": "Continue" + "unwind": "Unreachable" } }, - "span": 43 + "span": 35 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Resume", - "span": 43 + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 43, - "ty": 16 + "span": 37, + "ty": 1 }, { "mutability": "Not", - "span": 43, - "ty": 12 + "span": 38, + "ty": 7 }, { "mutability": "Not", - "span": 43, + "span": 39, "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 24 } ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ + "span": 42, + "spread_arg": null, + "var_debug_info": [ { - "statements": [], - "terminator": { - "kind": "Return", - "span": 44 + "argument_index": 1, + "composite": null, + "name": "f", + "source_info": { + "scope": 0, + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 44, - "ty": 1 }, { - "mutability": "Not", - "span": 44, - "ty": 22 - } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] - }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" - } - }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 46, - "user_ty": null - } - } - } - ] - }, - "span": 46 + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 40 + }, + "value": { + "Place": { + "local": 0, + "projection": [] } - ], - "terminator": { - "kind": "Return", - "span": 45 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 47, - "ty": 17 }, - { - "mutability": "Not", - "span": 48, - "ty": 1 - } - ], - "span": 49, - "spread_arg": null, - "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "self", + "name": "dummy", "source_info": { - "scope": 0, - "span": 48 + "scope": 2, + "span": 41 }, "value": { "Const": { @@ -1884,11 +1884,11 @@ } ] }, - "id": 5, - "name": "<() as std::process::Termination>::report" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::hd29a5f9896722427" } ], "types": [ diff --git a/tests/integration/programs/div.smir.json.expected b/tests/integration/programs/div.smir.json.expected index 06ab880..74b55a6 100644 --- a/tests/integration/programs/div.smir.json.expected +++ b/tests/integration/programs/div.smir.json.expected @@ -99,7 +99,7 @@ "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 0, + "arg_count": 1, "blocks": [ { "statements": [ @@ -107,113 +107,94 @@ "kind": { "Assign": [ { - "local": 2, + "local": 0, "projection": [] }, { - "BinaryOp": [ - "Eq", - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 10, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 52, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 11, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } + "Use": { + "Constant": { + "const_": { + "id": 8, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] } - }, - "ty": 16 + } }, - "span": 51, - "user_ty": null - } + "ty": 17 + }, + "span": 46, + "user_ty": null } - ] + } } ] }, - "span": 51 + "span": 46 } ], "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 2, - "projection": [] - } - }, - "expected": false, - "msg": { - "DivisionByZero": { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 164, - 1, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 50, - "user_ty": null - } - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 51 + "kind": "Return", + "span": 45 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::hffbdb66f6c1d9211" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { "statements": [ { @@ -224,608 +205,251 @@ "projection": [] }, { - "BinaryOp": [ - "Eq", + "Ref": [ { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 10, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 52, - "user_ty": null - } + "kind": "ReErased" }, { - "Constant": { - "const_": { - "id": 12, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 255, - 255, - 255, - 255 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 51, - "user_ty": null + "Mut": { + "kind": "Default" } + }, + { + "local": 1, + "projection": [] } ] } ] }, - "span": 51 - }, - { - "kind": { - "Assign": [ + "span": 43 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ { - "local": 4, - "projection": [] + "Move": { + "local": 3, + "projection": [] + } }, { - "BinaryOp": [ - "Eq", - { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 164, - 1, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 50, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 13, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 0, - 0, - 0, - 128 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 51, - "user_ty": null - } - } - ] - } - ] - }, - "span": 51 - }, - { - "kind": { - "Assign": [ - { - "local": 5, - "projection": [] - }, - { - "BinaryOp": [ - "BitAnd", - { - "Move": { - "local": 3, - "projection": [] - } - }, - { - "Move": { - "local": 4, - "projection": [] - } - } - ] - } - ] - }, - "span": 51 - } - ], - "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 5, - "projection": [] + "Move": { + "local": 2, + "projection": [] + } } + ], + "destination": { + "local": 0, + "projection": [] }, - "expected": false, - "msg": { - "Overflow": [ - "Div", - { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 164, - 1, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 50, - "user_ty": null - } + "func": { + "Constant": { + "const_": { + "id": 7, + "kind": "ZeroSized", + "ty": 23 }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 10, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 52, - "user_ty": null - } - } - ] + "span": 43, + "user_ty": null + } }, - "target": 2, - "unwind": "Continue" + "target": 1, + "unwind": { + "Cleanup": 3 + } } }, - "span": 51 + "span": 43 } }, { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 1, - "projection": [] - }, - { - "BinaryOp": [ - "Div", - { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 164, - 1, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 50, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 10, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 52, - "user_ty": null - } - } - ] - } - ] - }, - "span": 51 - } - ], + "statements": [], "terminator": { "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 1, - "projection": [] - } + "Drop": { + "place": { + "local": 1, + "projection": [] }, - "targets": { - "branches": [ - [ - 42, - 3 - ] - ], - "otherwise": 4 - } + "target": 2, + "unwind": "Continue" } }, - "span": 53 + "span": 43 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 54 + "span": 43 } }, { "statements": [], "terminator": { "kind": { - "Call": { - "args": [ - { - "Constant": { - "const_": { - "id": 15, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 32, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 0 - ] - ] - } - } - }, - "ty": 26 - }, - "span": 32, - "user_ty": null - } - } - ], - "destination": { - "local": 6, + "Drop": { + "place": { + "local": 1, "projection": [] }, - "func": { - "Constant": { - "const_": { - "id": 14, - "kind": "ZeroSized", - "ty": 25 - }, - "span": 55, - "user_ty": null - } - }, - "target": null, - "unwind": "Continue" + "target": 4, + "unwind": "Terminate" } }, - "span": 55 + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Resume", + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 56, - "ty": 1 + "span": 43, + "ty": 16 }, { - "mutability": "Mut", - "span": 51, - "ty": 16 + "mutability": "Not", + "span": 43, + "ty": 12 }, { - "mutability": "Mut", - "span": 51, - "ty": 27 + "mutability": "Not", + "span": 43, + "ty": 1 }, { - "mutability": "Mut", - "span": 51, - "ty": 27 + "mutability": "Not", + "span": 43, + "ty": 24 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h7d8ca50f4bcee240" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, + "projection": [] + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 43 + } }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ { "mutability": "Mut", - "span": 51, - "ty": 27 + "span": 43, + "ty": 1 }, { - "mutability": "Mut", - "span": 51, - "ty": 27 + "mutability": "Not", + "span": 43, + "ty": 7 }, { - "mutability": "Mut", - "span": 55, - "ty": 28 + "mutability": "Not", + "span": 43, + "ty": 1 } ], - "span": 57, - "spread_arg": null, + "span": 43, + "spread_arg": 2, "var_debug_info": [] }, - "id": 6, - "name": "main" + "id": 3, + "name": ">::call_once" } }, - "symbol_name": "_ZN3div4main17h" + "symbol_name": "core::ops::function::FnOnce::call_once::h91a3d65f2d111ab4" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 2, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, - { - "kind": { - "Assign": [ - { - "local": 8, - "projection": [] - }, + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 - } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } + "Move": { + "local": 1, + "projection": [ + "Deref" ] - ] - } - ] - }, - "span": 3 - }, - { - "kind": { - "Assign": [ - { - "local": 7, - "projection": [] + } }, { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 8, - "projection": [] - } - ] - } - ] - }, - "span": 2 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, - { - "Copy": { - "local": 7, - "projection": [] - } - }, - 5 - ] - } - ] - }, - "span": 2 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, - { - "Move": { - "local": 3, - "projection": [] - } - }, - { - "Move": { - "local": 4, - "projection": [] - } + "Move": { + "local": 2, + "projection": [] + } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 6, "kind": "ZeroSized", - "ty": 0 + "ty": 21 }, - "span": 0, + "span": 43, "user_ty": null } }, @@ -833,197 +457,43 @@ "unwind": "Continue" } }, - "span": 1 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 5 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 - } - ], + "statements": [], "terminator": { "kind": "Return", - "span": 4 + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 8, - "ty": 6 - }, - { - "mutability": "Not", - "span": 9, - "ty": 7 - }, - { - "mutability": "Not", - "span": 10, - "ty": 6 - }, - { - "mutability": "Not", - "span": 11, - "ty": 8 - }, - { - "mutability": "Not", - "span": 12, - "ty": 9 - }, - { - "mutability": "Mut", - "span": 1, - "ty": 10 - }, - { - "mutability": "Mut", - "span": 2, - "ty": 5 + "span": 43, + "ty": 16 }, { "mutability": "Not", - "span": 2, - "ty": 11 + "span": 43, + "ty": 22 }, { "mutability": "Not", - "span": 3, - "ty": 12 + "span": 43, + "ty": 1 } ], - "span": 13, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - }, - { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } - } - ] + "span": 43, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hebc2f0665a24f4af" }, { "details": null, @@ -1033,24 +503,222 @@ "arg_count": 1, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 16 - }, - { + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 + }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::ha94291a6e18f1b4d" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 0, + "blocks": [ + { + "statements": [ + { "kind": { - "StorageLive": 3 + "Assign": [ + { + "local": 2, + "projection": [] + }, + { + "BinaryOp": [ + "Eq", + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 10, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 52, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 11, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 51, + "user_ty": null + } + } + ] + } + ] }, - "span": 15 + "span": 51 + } + ], + "terminator": { + "kind": { + "Assert": { + "cond": { + "Move": { + "local": 2, + "projection": [] + } + }, + "expected": false, + "msg": { + "DivisionByZero": { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 164, + 1, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 50, + "user_ty": null + } + } + }, + "target": 1, + "unwind": "Continue" + } }, + "span": 51 + } + }, + { + "statements": [ { "kind": { - "StorageLive": 4 + "Assign": [ + { + "local": 3, + "projection": [] + }, + { + "BinaryOp": [ + "Eq", + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 10, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 52, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 12, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 255, + 255, + 255, + 255 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 51, + "user_ty": null + } + } + ] + } + ] }, - "span": 17 + "span": 51 }, { "kind": { @@ -1060,375 +728,542 @@ "projection": [] }, { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] + "BinaryOp": [ + "Eq", + { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 164, + 1, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 50, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 13, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 0, + 0, + 0, + 128 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 51, + "user_ty": null + } } - } + ] } ] }, - "span": 17 + "span": 51 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "BinaryOp": [ + "BitAnd", + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] + } + } + ] + } + ] + }, + "span": 51 } ], "terminator": { "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 4, - "projection": [] + "Assert": { + "cond": { + "Move": { + "local": 5, + "projection": [] + } + }, + "expected": false, + "msg": { + "Overflow": [ + "Div", + { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 164, + 1, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 50, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 10, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 52, + "user_ty": null + } } + ] + }, + "target": 2, + "unwind": "Continue" + } + }, + "span": 51 + } + }, + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 1, + "projection": [] + }, + { + "BinaryOp": [ + "Div", + { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 164, + 1, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 50, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 10, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 52, + "user_ty": null + } + } + ] } - ], - "destination": { - "local": 3, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 1, - "kind": "ZeroSized", - "ty": 13 - }, - "span": 14, - "user_ty": null + ] + }, + "span": 51 + } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 1, + "projection": [] } }, - "target": 1, - "unwind": "Continue" + "targets": { + "branches": [ + [ + 42, + 3 + ] + ], + "otherwise": 4 + } } }, - "span": 15 + "span": 53 } }, { - "statements": [ - { - "kind": { - "StorageDead": 4 - }, - "span": 19 - } - ], + "statements": [], + "terminator": { + "kind": "Return", + "span": 54 + } + }, + { + "statements": [], "terminator": { "kind": { "Call": { "args": [ { - "Move": { - "local": 3, - "projection": [] + "Constant": { + "const_": { + "id": 15, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 32, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 0 + ] + ] + } + } + }, + "ty": 26 + }, + "span": 32, + "user_ty": null } } ], "destination": { - "local": 2, + "local": 6, "projection": [] }, "func": { "Constant": { "const_": { - "id": 2, + "id": 14, "kind": "ZeroSized", - "ty": 14 + "ty": 25 }, - "span": 18, + "span": 55, "user_ty": null } }, - "target": 2, + "target": null, "unwind": "Continue" } }, - "span": 16 + "span": 55 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 56, + "ty": 1 + }, + { + "mutability": "Mut", + "span": 51, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 51, + "ty": 27 + }, + { + "mutability": "Mut", + "span": 51, + "ty": 27 + }, + { + "mutability": "Mut", + "span": 51, + "ty": 27 }, + { + "mutability": "Mut", + "span": 51, + "ty": 27 + }, + { + "mutability": "Mut", + "span": 55, + "ty": 28 + } + ], + "span": 57, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 6, + "name": "main" + } + }, + "symbol_name": "div::main::h23e287fa42b34ef6" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 4, + "blocks": [ { "statements": [ { "kind": { - "StorageDead": 3 + "StorageLive": 5 }, - "span": 21 + "span": 1 }, { "kind": { - "StorageLive": 5 + "StorageLive": 6 }, - "span": 22 + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 }, { "kind": { "Assign": [ { - "local": 5, + "local": 8, "projection": [] }, { - "Ref": [ + "Aggregate": [ { - "kind": "ReErased" + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] }, - "Shared", - { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] + [ + { + "Copy": { + "local": 1, + "projection": [] } - ] - } + } + ] ] } ] }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 + "span": 3 }, { "kind": { "Assign": [ { - "local": 6, + "local": 7, "projection": [] }, { - "Use": { - "Copy": { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - }, - { - "Field": [ - 0, - 9 - ] - } - ] + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] } - } + ] } ] }, - "span": 23 + "span": 2 }, { "kind": { "Assign": [ { - "local": 0, + "local": 6, "projection": [] }, { "Cast": [ - "IntToInt", { - "Move": { - "local": 6, + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, "projection": [] } }, - 16 + 5 ] } ] }, - "span": 24 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 25 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 + "span": 2 } ], - "terminator": { - "kind": "Return", - "span": 20 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 28, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 3, - "ty": 11 - }, - { - "mutability": "Mut", - "span": 16, - "ty": 17 - }, - { - "mutability": "Mut", - "span": 15, - "ty": 1 - }, - { - "mutability": "Mut", - "span": 17, - "ty": 7 - }, - { - "mutability": "Mut", - "span": 22, - "ty": 18 - }, - { - "mutability": "Mut", - "span": 23, - "ty": 9 - } - ], - "span": 3, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": null, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 1, - "span": 29 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 2, - "span": 30 - }, - "value": { - "Place": { - "local": 5, - "projection": [] - } - } - } - ] - }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" - } - }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, + "local": 6, "projection": [] } }, { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 2, + "projection": [] + } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] } } ], "destination": { - "local": 0, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 3, + "id": 0, "kind": "ZeroSized", - "ty": 19 + "ty": 0 }, - "span": 31, + "span": 0, "user_ty": null } }, @@ -1436,84 +1271,122 @@ "unwind": "Continue" } }, - "span": 33 + "span": 1 } }, { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "StorageDead": 6 + }, + "span": 5 + }, + { + "kind": { + "Assign": [ { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "local": 0, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 + }, + { + "Field": [ + 0, + 6 + ] + } + ] + } } } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 5, - "kind": "ZeroSized", - "ty": 20 - }, - "span": 34, - "user_ty": null - } - }, - "target": 2, - "unwind": "Unreachable" - } + ] + }, + "span": 6 }, - "span": 35 - } - }, - { - "statements": [], + { + "kind": { + "StorageDead": 8 + }, + "span": 7 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 7 + } + ], "terminator": { "kind": "Return", - "span": 36 + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 37, - "ty": 1 + "span": 8, + "ty": 6 }, { "mutability": "Not", - "span": 38, + "span": 9, "ty": 7 }, { "mutability": "Not", - "span": 39, - "ty": 1 + "span": 10, + "ty": 6 + }, + { + "mutability": "Not", + "span": 11, + "ty": 8 + }, + { + "mutability": "Not", + "span": 12, + "ty": 9 + }, + { + "mutability": "Mut", + "span": 1, + "ty": 10 + }, + { + "mutability": "Mut", + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 } ], - "span": 42, + "span": 13, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "f", + "name": "main", "source_info": { "scope": 0, - "span": 38 + "span": 9 }, "value": { "Place": { @@ -1523,88 +1396,151 @@ } }, { - "argument_index": null, + "argument_index": 2, "composite": null, - "name": "result", + "name": "argc", "source_info": { - "scope": 1, - "span": 40 + "scope": 0, + "span": 10 }, "value": { "Place": { - "local": 0, + "local": 2, "projection": [] } } }, { - "argument_index": 1, + "argument_index": 3, "composite": null, - "name": "dummy", + "name": "argv", "source_info": { - "scope": 2, - "span": 41 + "scope": 0, + "span": 11 }, "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Place": { + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, + "projection": [] } } } ] }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "symbol_name": "std::rt::lang_start::hbd108b6d97f9b06a" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 1, "blocks": [ { - "statements": [], + "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + } + ] + }, + "span": 17 + } + ], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } - }, - { - "Move": { - "local": 2, + "local": 4, "projection": [] } } ], "destination": { - "local": 0, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 6, + "id": 1, "kind": "ZeroSized", - "ty": 21 + "ty": 13 }, - "span": 43, + "span": 14, "user_ty": null } }, @@ -1612,79 +1548,16 @@ "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 + "span": 15 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 22 }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - { - "Mut": { - "kind": "Default" - } - }, - { - "local": 1, - "projection": [] - } - ] - } - ] + { + "statements": [ + { + "kind": { + "StorageDead": 4 }, - "span": 43 + "span": 19 } ], "terminator": { @@ -1696,292 +1569,419 @@ "local": 3, "projection": [] } - }, - { - "Move": { - "local": 2, - "projection": [] - } } ], "destination": { - "local": 0, + "local": 2, "projection": [] }, "func": { "Constant": { "const_": { - "id": 7, + "id": 2, "kind": "ZeroSized", - "ty": 23 + "ty": 14 }, - "span": 43, + "span": 18, "user_ty": null } }, - "target": 1, - "unwind": { - "Cleanup": 3 - } - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, "target": 2, "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 + "span": 16 } }, { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } + "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 21 }, - "span": 43 - } - }, - { - "statements": [], + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] + } + ] + } + ] + }, + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + }, + { + "Field": [ + 0, + 9 + ] + } + ] + } + } + } + ] + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] + } + ] + }, + "span": 24 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 + } + ], "terminator": { - "kind": "Resume", - "span": 43 + "kind": "Return", + "span": 20 } } ], "locals": [ { "mutability": "Mut", - "span": 43, + "span": 28, "ty": 16 }, { - "mutability": "Not", - "span": 43, - "ty": 12 + "mutability": "Mut", + "span": 3, + "ty": 11 }, { - "mutability": "Not", - "span": 43, + "mutability": "Mut", + "span": 16, + "ty": 17 + }, + { + "mutability": "Mut", + "span": 15, "ty": 1 }, { - "mutability": "Not", - "span": 43, - "ty": 24 + "mutability": "Mut", + "span": 17, + "ty": 7 + }, + { + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 + } + ], + "span": 3, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": null, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 29 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] + ] }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" + "symbol_name": "std::rt::lang_start::{{closure}}::hb3cdf57509f37c7b" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 1, "blocks": [ { "statements": [], "terminator": { "kind": { "Call": { - "args": [], + "args": [ + { + "Move": { + "local": 1, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], "destination": { "local": 0, "projection": [] }, "func": { - "Move": { - "local": 1, - "projection": [] + "Constant": { + "const_": { + "id": 3, + "kind": "ZeroSized", + "ty": 19 + }, + "span": 31, + "user_ty": null } }, "target": 1, "unwind": "Continue" } }, - "span": 43 + "span": 33 } }, { "statements": [], "terminator": { - "kind": "Return", - "span": 43 + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 5, + "kind": "ZeroSized", + "ty": 20 + }, + "span": 34, + "user_ty": null + } + }, + "target": 2, + "unwind": "Unreachable" + } + }, + "span": 35 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 1 }, - { - "mutability": "Not", - "span": 43, - "ty": 7 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ { "statements": [], "terminator": { "kind": "Return", - "span": 44 + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 44, + "span": 37, "ty": 1 }, { "mutability": "Not", - "span": 44, - "ty": 22 - } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] - }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" - } - }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 46, - "user_ty": null - } - } - } - ] - }, - "span": 46 - } - ], - "terminator": { - "kind": "Return", - "span": 45 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 47, - "ty": 17 + "span": 38, + "ty": 7 }, { "mutability": "Not", - "span": 48, + "span": 39, "ty": 1 } ], - "span": 49, + "span": 42, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "self", + "name": "f", "source_info": { "scope": 0, - "span": 48 + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 40 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "dummy", + "source_info": { + "scope": 2, + "span": 41 }, "value": { "Const": { @@ -1997,11 +1997,11 @@ } ] }, - "id": 5, - "name": "<() as std::process::Termination>::report" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h5249a92c895d39c3" } ], "types": [ diff --git a/tests/integration/programs/double-ref-deref.smir.json.expected b/tests/integration/programs/double-ref-deref.smir.json.expected index 7fee94b..f9e1313 100644 --- a/tests/integration/programs/double-ref-deref.smir.json.expected +++ b/tests/integration/programs/double-ref-deref.smir.json.expected @@ -94,7 +94,7 @@ "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 0, + "arg_count": 1, "blocks": [ { "statements": [ @@ -102,21 +102,18 @@ "kind": { "Assign": [ { - "local": 1, + "local": 0, "projection": [] }, { "Use": { "Constant": { "const_": { - "id": 9, + "id": 8, "kind": { "Allocated": { - "align": 4, + "align": 1, "bytes": [ - 42, - 0, - 0, 0 ], "mutability": "Mut", @@ -125,40 +122,141 @@ } } }, - "ty": 16 + "ty": 17 }, - "span": 51, + "span": 46, "user_ty": null } } } ] }, - "span": 51 - }, - { - "kind": { - "Assign": [ - { - "local": 2, + "span": 46 + } + ], + "terminator": { + "kind": "Return", + "span": 45 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 + }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::h71dbfd421f052d36" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 1, - "projection": [] - } - ] } - ] - }, - "span": 52 + }, + "target": 1, + "unwind": "Continue" + } }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 1 + }, + { + "mutability": "Not", + "span": 43, + "ty": 7 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": ">::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h20e447a0f0a879b1" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ { "kind": { "Assign": [ @@ -171,327 +269,316 @@ { "kind": "ReErased" }, - "Shared", { - "local": 2, + "Mut": { + "kind": "Default" + } + }, + { + "local": 1, "projection": [] } ] } ] }, - "span": 53 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, + "span": 43 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ { - "CopyForDeref": { + "Move": { "local": 3, - "projection": [ - "Deref" - ] + "projection": [] } - } - ] - }, - "span": 54 - }, - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] }, { - "Use": { - "Copy": { - "local": 6, - "projection": [ - "Deref" - ] - } + "Move": { + "local": 2, + "projection": [] } } - ] - }, - "span": 54 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 4, - "projection": [] + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 7, + "kind": "ZeroSized", + "ty": 23 + }, + "span": 43, + "user_ty": null } }, - "targets": { - "branches": [ - [ - 42, - 1 - ] - ], - "otherwise": 2 + "target": 1, + "unwind": { + "Cleanup": 3 } } }, - "span": 50 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 55 + "span": 43 } }, { "statements": [], "terminator": { "kind": { - "Call": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, + "unwind": "Continue" + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Resume", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 16 + }, + { + "mutability": "Not", + "span": 43, + "ty": 12 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + }, + { + "mutability": "Not", + "span": 43, + "ty": 24 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h3b6dcfc9104bd68b" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { "args": [ { - "Constant": { - "const_": { - "id": 11, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 27, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 0 - ] - ] - } - } - }, - "ty": 26 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, + "projection": [] } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 10, + "id": 6, "kind": "ZeroSized", - "ty": 25 + "ty": 21 }, - "span": 56, + "span": 43, "user_ty": null } }, - "target": null, + "target": 1, "unwind": "Continue" } }, - "span": 56 + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 57, - "ty": 1 - }, - { - "mutability": "Not", - "span": 58, + "span": 43, "ty": 16 }, { "mutability": "Not", - "span": 59, - "ty": 27 + "span": 43, + "ty": 22 }, { "mutability": "Not", - "span": 60, - "ty": 28 - }, - { - "mutability": "Mut", - "span": 54, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 56, - "ty": 29 - }, - { - "mutability": "Mut", - "span": 60, - "ty": 27 + "span": 43, + "ty": 1 } ], - "span": 61, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": null, - "composite": null, - "name": "a", - "source_info": { - "scope": 1, - "span": 58 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "b", - "source_info": { - "scope": 2, - "span": 59 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "c", - "source_info": { - "scope": 3, - "span": 60 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - } - ] + "span": 43, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 6, - "name": "main" + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "_ZN16double_ref_deref4main17h" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::he4b509a5aa7fe926" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 1, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 + }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h68baa37de5021c80" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 0, + "blocks": [ + { + "statements": [ { "kind": { "Assign": [ { - "local": 8, + "local": 1, "projection": [] }, { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 + "Use": { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 42, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] + }, + "ty": 16 + }, + "span": 51, + "user_ty": null + } + } } ] }, - "span": 3 + "span": 51 }, { "kind": { "Assign": [ { - "local": 7, + "local": 2, "projection": [] }, { @@ -501,205 +588,228 @@ }, "Shared", { - "local": 8, + "local": 1, "projection": [] } ] } ] }, - "span": 2 + "span": 52 }, { "kind": { "Assign": [ { - "local": 6, + "local": 3, "projection": [] }, { - "Cast": [ + "Ref": [ { - "PointerCoercion": "Unsize" + "kind": "ReErased" }, + "Shared", { - "Copy": { - "local": 7, - "projection": [] - } - }, - 5 + "local": 2, + "projection": [] + } ] } ] }, - "span": 2 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, + "span": 53 + }, + { + "kind": { + "Assign": [ { - "Move": { - "local": 2, - "projection": [] - } + "local": 6, + "projection": [] }, { - "Move": { + "CopyForDeref": { "local": 3, - "projection": [] - } - }, - { - "Move": { - "local": 4, - "projection": [] + "projection": [ + "Deref" + ] } } - ], - "destination": { - "local": 5, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 0, - "kind": "ZeroSized", - "ty": 0 - }, - "span": 0, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 1 - } - }, - { - "statements": [ - { - "kind": { - "StorageDead": 6 + ] }, - "span": 5 + "span": 54 }, { "kind": { "Assign": [ { - "local": 0, + "local": 4, "projection": [] }, { "Use": { "Copy": { - "local": 5, + "local": 6, "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } + "Deref" ] } } } ] }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 + "span": 54 } ], "terminator": { - "kind": "Return", - "span": 4 + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 4, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 42, + 1 + ] + ], + "otherwise": 2 + } + } + }, + "span": 50 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 8, - "ty": 6 }, { - "mutability": "Not", - "span": 9, - "ty": 7 + "statements": [], + "terminator": { + "kind": "Return", + "span": 55 + } }, { - "mutability": "Not", - "span": 10, - "ty": 6 + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 11, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 27, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 0 + ] + ] + } + } + }, + "ty": 26 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 5, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 10, + "kind": "ZeroSized", + "ty": 25 + }, + "span": 56, + "user_ty": null + } + }, + "target": null, + "unwind": "Continue" + } + }, + "span": 56 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 57, + "ty": 1 }, { "mutability": "Not", - "span": 11, - "ty": 8 + "span": 58, + "ty": 16 }, { "mutability": "Not", - "span": 12, - "ty": 9 + "span": 59, + "ty": 27 }, { - "mutability": "Mut", - "span": 1, - "ty": 10 + "mutability": "Not", + "span": 60, + "ty": 28 }, { "mutability": "Mut", - "span": 2, - "ty": 5 + "span": 54, + "ty": 16 }, { - "mutability": "Not", - "span": 2, - "ty": 11 + "mutability": "Mut", + "span": 56, + "ty": 29 }, { - "mutability": "Not", - "span": 3, - "ty": 12 + "mutability": "Mut", + "span": 60, + "ty": 27 } ], - "span": 13, + "span": 61, "spread_arg": null, "var_debug_info": [ { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "main", + "name": "a", "source_info": { - "scope": 0, - "span": 9 + "scope": 1, + "span": 58 }, "value": { "Place": { @@ -709,12 +819,12 @@ } }, { - "argument_index": 2, + "argument_index": null, "composite": null, - "name": "argc", + "name": "b", "source_info": { - "scope": 0, - "span": 10 + "scope": 2, + "span": 59 }, "value": { "Place": { @@ -723,261 +833,225 @@ } } }, - { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - }, - { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } - }, { "argument_index": null, "composite": null, - "name": "v", + "name": "c", "source_info": { - "scope": 1, - "span": 6 + "scope": 3, + "span": 60 }, "value": { "Place": { - "local": 0, + "local": 3, "projection": [] } } } ] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 6, + "name": "main" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "double_ref_deref::main::hea5f0cb84b044abc" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 4, "blocks": [ { "statements": [ { "kind": { - "StorageLive": 2 + "StorageLive": 5 }, - "span": 16 + "span": 1 }, { "kind": { - "StorageLive": 3 + "StorageLive": 6 }, - "span": 15 + "span": 2 }, { "kind": { - "StorageLive": 4 + "StorageLive": 8 }, - "span": 17 + "span": 3 }, { "kind": { "Assign": [ { - "local": 4, + "local": 8, "projection": [] }, { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } + "Aggregate": [ + { + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] ] - } - } + }, + [ + { + "Copy": { + "local": 1, + "projection": [] + } + } + ] + ] } ] }, - "span": 17 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ + "span": 3 + }, + { + "kind": { + "Assign": [ { - "Move": { - "local": 4, - "projection": [] - } + "local": 7, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] + } + ] } - ], - "destination": { - "local": 3, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 1, - "kind": "ZeroSized", - "ty": 13 - }, - "span": 14, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } + ] + }, + "span": 2 }, - "span": 15 - } - }, - { - "statements": [ { "kind": { - "StorageDead": 4 + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Cast": [ + { + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, + "projection": [] + } + }, + 5 + ] + } + ] }, - "span": 19 + "span": 2 } ], "terminator": { "kind": { "Call": { "args": [ + { + "Move": { + "local": 6, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + }, { "Move": { "local": 3, "projection": [] } + }, + { + "Move": { + "local": 4, + "projection": [] + } } ], "destination": { - "local": 2, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 2, + "id": 0, "kind": "ZeroSized", - "ty": 14 + "ty": 0 }, - "span": 18, + "span": 0, "user_ty": null } }, - "target": 2, + "target": 1, "unwind": "Continue" } }, - "span": 16 + "span": 1 } }, { "statements": [ { "kind": { - "StorageDead": 3 - }, - "span": 21 - }, - { - "kind": { - "StorageLive": 5 - }, - "span": 22 - }, - { - "kind": { - "Assign": [ - { - "local": 5, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - } - ] - } - ] - } - ] - }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 + "StorageDead": 6 }, - "span": 23 + "span": 5 }, { "kind": { "Assign": [ { - "local": 6, + "local": 0, "projection": [] }, { "Use": { "Copy": { - "local": 2, + "local": 5, "projection": [ { - "Field": [ - 0, - 15 - ] + "Downcast": 0 }, { "Field": [ 0, - 9 + 6 ] } ] @@ -986,98 +1060,79 @@ } ] }, - "span": 23 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Cast": [ - "IntToInt", - { - "Move": { - "local": 6, - "projection": [] - } - }, - 16 - ] - } - ] - }, - "span": 24 + "span": 6 }, { "kind": { - "StorageDead": 6 + "StorageDead": 8 }, - "span": 25 + "span": 7 }, { "kind": { "StorageDead": 5 }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 + "span": 7 } ], "terminator": { "kind": "Return", - "span": 20 + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 28, - "ty": 16 + "span": 8, + "ty": 6 }, { - "mutability": "Mut", - "span": 3, - "ty": 11 + "mutability": "Not", + "span": 9, + "ty": 7 }, { - "mutability": "Mut", - "span": 16, - "ty": 17 + "mutability": "Not", + "span": 10, + "ty": 6 }, { - "mutability": "Mut", - "span": 15, - "ty": 1 + "mutability": "Not", + "span": 11, + "ty": 8 }, { - "mutability": "Mut", - "span": 17, - "ty": 7 + "mutability": "Not", + "span": 12, + "ty": 9 }, { "mutability": "Mut", - "span": 22, - "ty": 18 + "span": 1, + "ty": 10 }, { "mutability": "Mut", - "span": 23, - "ty": 9 + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 } ], - "span": 3, + "span": 13, "spread_arg": null, "var_debug_info": [ { - "argument_index": null, + "argument_index": 1, "composite": null, "name": "main", "source_info": { @@ -1087,25 +1142,17 @@ "value": { "Place": { "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] + "projection": [] } } }, { - "argument_index": 1, + "argument_index": 2, "composite": null, - "name": "self", + "name": "argc", "source_info": { - "scope": 1, - "span": 29 + "scope": 0, + "span": 10 }, "value": { "Place": { @@ -1115,27 +1162,57 @@ } }, { - "argument_index": 1, + "argument_index": 3, "composite": null, - "name": "self", + "name": "argv", "source_info": { - "scope": 2, - "span": 30 + "scope": 0, + "span": 11 }, "value": { "Place": { - "local": 5, + "local": 3, "projection": [] } } - } - ] - }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + } + ] + }, + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "symbol_name": "std::rt::lang_start::hae09cd2855e0e1e5" }, { "details": null, @@ -1145,41 +1222,76 @@ "arg_count": 1, "blocks": [ { - "statements": [], + "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + } + ] + }, + "span": 17 + } + ], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, + "local": 4, "projection": [] } - }, - { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } } ], "destination": { - "local": 0, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 3, + "id": 1, "kind": "ZeroSized", - "ty": 19 + "ty": 13 }, - "span": 31, + "span": 14, "user_ty": null } }, @@ -1187,24 +1299,26 @@ "unwind": "Continue" } }, - "span": 33 + "span": 15 } }, { - "statements": [], + "statements": [ + { + "kind": { + "StorageDead": 4 + }, + "span": 19 + } + ], "terminator": { "kind": { "Call": { "args": [ { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 3, + "projection": [] } } ], @@ -1215,308 +1329,280 @@ "func": { "Constant": { "const_": { - "id": 5, + "id": 2, "kind": "ZeroSized", - "ty": 20 + "ty": 14 }, - "span": 34, + "span": 18, "user_ty": null } }, "target": 2, - "unwind": "Unreachable" + "unwind": "Continue" } }, - "span": 35 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 36 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 37, - "ty": 1 - }, - { - "mutability": "Not", - "span": 38, - "ty": 7 - }, - { - "mutability": "Not", - "span": 39, - "ty": 1 - } - ], - "span": 42, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "f", - "source_info": { - "scope": 0, - "span": 38 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "result", - "source_info": { - "scope": 1, - "span": 40 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } + "span": 16 } }, { - "argument_index": 1, - "composite": null, - "name": "dummy", - "source_info": { - "scope": 2, - "span": 41 - }, - "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 + "statements": [ + { + "kind": { + "StorageDead": 3 }, - "span": 32, - "user_ty": null - } - } - } - ] - }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" - } - }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, + { + "kind": { + "Assign": [ { - "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } + "local": 5, + "projection": [] }, { - "Move": { - "local": 2, - "projection": [] + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] + } + ] + } + ] + }, + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + }, + { + "Field": [ + 0, + 9 + ] + } + ] + } } } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 21 - }, - "span": 43, - "user_ty": null + ] + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] } - }, - "target": 1, - "unwind": "Continue" - } + ] + }, + "span": 24 }, - "span": 43 - } - }, - { - "statements": [], + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 + } + ], "terminator": { "kind": "Return", - "span": 43 + "span": 20 } } ], "locals": [ { "mutability": "Mut", - "span": 43, + "span": 28, "ty": 16 }, { - "mutability": "Not", - "span": 43, - "ty": 22 + "mutability": "Mut", + "span": 3, + "ty": 11 }, { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Move": { - "local": 1, - "projection": [] - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 43 - } + "mutability": "Mut", + "span": 16, + "ty": 17 }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ { "mutability": "Mut", - "span": 43, + "span": 15, "ty": 1 }, { - "mutability": "Not", - "span": 43, + "mutability": "Mut", + "span": 17, "ty": 7 }, { - "mutability": "Not", - "span": 43, - "ty": 1 + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 } ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ + "span": 3, + "spread_arg": null, + "var_debug_info": [ { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - { - "Mut": { - "kind": "Default" - } - }, - { - "local": 1, - "projection": [] - } - ] - } - ] - }, - "span": 43 + "argument_index": null, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] } - ], + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 29 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } + } + ] + }, + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" + } + }, + "symbol_name": "std::rt::lang_start::{{closure}}::h2b63106f11ec1841" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 3, + "local": 1, "projection": [] } }, { - "Move": { - "local": 2, - "projection": [] + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null } } ], @@ -1527,212 +1613,126 @@ "func": { "Constant": { "const_": { - "id": 7, + "id": 3, "kind": "ZeroSized", - "ty": 23 + "ty": 19 }, - "span": 43, + "span": 31, "user_ty": null } }, "target": 1, - "unwind": { - "Cleanup": 3 - } + "unwind": "Continue" } }, - "span": 43 + "span": 33 } }, { "statements": [], "terminator": { "kind": { - "Drop": { - "place": { - "local": 1, + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 2, "projection": [] }, + "func": { + "Constant": { + "const_": { + "id": 5, + "kind": "ZeroSized", + "ty": 20 + }, + "span": 34, + "user_ty": null + } + }, "target": 2, - "unwind": "Continue" + "unwind": "Unreachable" } }, - "span": 43 + "span": 35 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Resume", - "span": 43 + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 43, - "ty": 16 + "span": 37, + "ty": 1 }, { "mutability": "Not", - "span": 43, - "ty": 12 + "span": 38, + "ty": 7 }, { "mutability": "Not", - "span": 43, + "span": 39, "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 24 } ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ + "span": 42, + "spread_arg": null, + "var_debug_info": [ { - "statements": [], - "terminator": { - "kind": "Return", - "span": 44 + "argument_index": 1, + "composite": null, + "name": "f", + "source_info": { + "scope": 0, + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 44, - "ty": 1 }, { - "mutability": "Not", - "span": 44, - "ty": 22 - } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] - }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" - } - }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 46, - "user_ty": null - } - } - } - ] - }, - "span": 46 + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 40 + }, + "value": { + "Place": { + "local": 0, + "projection": [] } - ], - "terminator": { - "kind": "Return", - "span": 45 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 47, - "ty": 17 }, - { - "mutability": "Not", - "span": 48, - "ty": 1 - } - ], - "span": 49, - "spread_arg": null, - "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "self", + "name": "dummy", "source_info": { - "scope": 0, - "span": 48 + "scope": 2, + "span": 41 }, "value": { "Const": { @@ -1748,11 +1748,11 @@ } ] }, - "id": 5, - "name": "<() as std::process::Termination>::report" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h0a7e1d374729816d" } ], "types": [ diff --git a/tests/integration/programs/enum.smir.json.expected b/tests/integration/programs/enum.smir.json.expected index 66725a6..41eb114 100644 --- a/tests/integration/programs/enum.smir.json.expected +++ b/tests/integration/programs/enum.smir.json.expected @@ -48,75 +48,109 @@ "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 1, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, { "kind": { "Assign": [ { - "local": 8, + "local": 0, "projection": [] }, { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 + "Use": { + "Constant": { + "const_": { + "id": 8, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] + }, + "ty": 17 + }, + "span": 46, + "user_ty": null + } + } } ] }, - "span": 3 - }, + "span": 46 + } + ], + "terminator": { + "kind": "Return", + "span": 45 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 + }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::ha9d971e2d2747189" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ { "kind": { "Assign": [ { - "local": 7, + "local": 3, "projection": [] }, { @@ -124,59 +158,26 @@ { "kind": "ReErased" }, - "Shared", - { - "local": 8, - "projection": [] - } - ] - } - ] - }, - "span": 2 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, { - "Copy": { - "local": 7, - "projection": [] + "Mut": { + "kind": "Default" } }, - 5 + { + "local": 1, + "projection": [] + } ] } ] }, - "span": 2 + "span": 43 } ], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, { "Move": { "local": 3, @@ -185,300 +186,219 @@ }, { "Move": { - "local": 4, + "local": 2, "projection": [] } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 7, "kind": "ZeroSized", - "ty": 0 + "ty": 23 }, - "span": 0, + "span": 43, "user_ty": null } }, "target": 1, + "unwind": { + "Cleanup": 3 + } + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, "unwind": "Continue" } }, - "span": 1 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 5 + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 - } - ], + "span": 43 + } + }, + { + "statements": [], "terminator": { - "kind": "Return", - "span": 4 + "kind": "Resume", + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 8, - "ty": 6 - }, - { - "mutability": "Not", - "span": 9, - "ty": 7 - }, - { - "mutability": "Not", - "span": 10, - "ty": 6 - }, - { - "mutability": "Not", - "span": 11, - "ty": 8 + "span": 43, + "ty": 16 }, { "mutability": "Not", - "span": 12, - "ty": 9 - }, - { - "mutability": "Mut", - "span": 1, - "ty": 10 - }, - { - "mutability": "Mut", - "span": 2, - "ty": 5 + "span": 43, + "ty": 12 }, { "mutability": "Not", - "span": 2, - "ty": 11 + "span": 43, + "ty": 1 }, { "mutability": "Not", - "span": 3, - "ty": 12 + "span": 43, + "ty": 24 } ], - "span": 13, - "spread_arg": null, - "var_debug_info": [ + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h6a981edc9897eac7" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { - "argument_index": 1, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, + "projection": [] + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 43 } }, { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 } - }, + } + ], + "locals": [ { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } + "mutability": "Mut", + "span": 43, + "ty": 1 }, { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } + "mutability": "Not", + "span": 43, + "ty": 7 }, { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } + "mutability": "Not", + "span": 43, + "ty": 1 } - ] + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 3, + "name": ">::call_once" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "core::ops::function::FnOnce::call_once::hfaffbd6f83919b14" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 2, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 16 - }, - { - "kind": { - "StorageLive": 3 - }, - "span": 15 - }, - { - "kind": { - "StorageLive": 4 - }, - "span": 17 - }, - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - } - ] - }, - "span": 17 - } - ], + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 4, - "projection": [] + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, + "projection": [] } } ], "destination": { - "local": 3, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 1, + "id": 6, "kind": "ZeroSized", - "ty": 13 + "ty": 21 }, - "span": 14, + "span": 43, "user_ty": null } }, @@ -486,223 +406,437 @@ "unwind": "Continue" } }, - "span": 15 + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 16 + }, + { + "mutability": "Not", + "span": 43, + "ty": 22 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h435d5fb91f4c9d83" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h45c21786305dd377" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 0, + "blocks": [ { "statements": [ { "kind": { - "StorageDead": 4 + "Assign": [ + { + "local": 1, + "projection": [] + }, + { + "Aggregate": [ + { + "Adt": [ + 7, + 0, + [], + null, + null + ] + }, + [] + ] + } + ] }, - "span": 19 + "span": 51 } ], "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 3, - "projection": [] - } - } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 2, - "kind": "ZeroSized", - "ty": 14 - }, - "span": 18, - "user_ty": null - } - }, - "target": 2, - "unwind": "Continue" - } - }, - "span": 16 + "kind": "Return", + "span": 50 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 52, + "ty": 1 }, + { + "mutability": "Not", + "span": 53, + "ty": 25 + } + ], + "span": 54, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": null, + "composite": null, + "name": "a", + "source_info": { + "scope": 1, + "span": 53 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + } + ] + }, + "id": 6, + "name": "main" + } + }, + "symbol_name": "enum::main::ha50c10f11a117309" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 4, + "blocks": [ { "statements": [ { "kind": { - "StorageDead": 3 + "StorageLive": 5 }, - "span": 21 + "span": 1 }, { "kind": { - "StorageLive": 5 + "StorageLive": 6 }, - "span": 22 + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 }, { "kind": { "Assign": [ { - "local": 5, + "local": 8, "projection": [] }, { - "Ref": [ + "Aggregate": [ { - "kind": "ReErased" + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] }, - "Shared", - { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] + [ + { + "Copy": { + "local": 1, + "projection": [] } - ] - } + } + ] ] } ] }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 + "span": 3 }, { "kind": { "Assign": [ { - "local": 6, + "local": 7, "projection": [] }, { - "Use": { - "Copy": { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - }, - { - "Field": [ - 0, - 9 - ] - } - ] + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] } - } + ] } ] }, - "span": 23 + "span": 2 }, { "kind": { "Assign": [ { - "local": 0, + "local": 6, "projection": [] }, { "Cast": [ - "IntToInt", { - "Move": { - "local": 6, + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, "projection": [] } }, - 16 + 5 ] } ] }, - "span": 24 + "span": 2 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 6, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] + } + } + ], + "destination": { + "local": 5, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 0, + "kind": "ZeroSized", + "ty": 0 + }, + "span": 0, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } }, + "span": 1 + } + }, + { + "statements": [ { "kind": { "StorageDead": 6 }, - "span": 25 + "span": 5 }, { "kind": { - "StorageDead": 5 + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 + }, + { + "Field": [ + 0, + 6 + ] + } + ] + } + } + } + ] }, - "span": 26 + "span": 6 }, { "kind": { - "StorageDead": 2 + "StorageDead": 8 }, - "span": 27 + "span": 7 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 7 } ], "terminator": { "kind": "Return", - "span": 20 + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 28, - "ty": 16 + "span": 8, + "ty": 6 }, { - "mutability": "Mut", - "span": 3, - "ty": 11 + "mutability": "Not", + "span": 9, + "ty": 7 }, { - "mutability": "Mut", - "span": 16, - "ty": 17 + "mutability": "Not", + "span": 10, + "ty": 6 }, { - "mutability": "Mut", - "span": 15, - "ty": 1 + "mutability": "Not", + "span": 11, + "ty": 8 }, { - "mutability": "Mut", - "span": 17, - "ty": 7 + "mutability": "Not", + "span": 12, + "ty": 9 }, { "mutability": "Mut", - "span": 22, - "ty": 18 + "span": 1, + "ty": 10 }, { "mutability": "Mut", - "span": 23, - "ty": 9 + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 } ], - "span": 3, + "span": 13, "spread_arg": null, "var_debug_info": [ { - "argument_index": null, + "argument_index": 1, "composite": null, "name": "main", "source_info": { @@ -712,25 +846,17 @@ "value": { "Place": { "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] + "projection": [] } } }, { - "argument_index": 1, + "argument_index": 2, "composite": null, - "name": "self", + "name": "argc", "source_info": { - "scope": 1, - "span": 29 + "scope": 0, + "span": 10 }, "value": { "Place": { @@ -740,27 +866,57 @@ } }, { - "argument_index": 1, + "argument_index": 3, "composite": null, - "name": "self", + "name": "argv", "source_info": { - "scope": 2, - "span": 30 + "scope": 0, + "span": 11 }, "value": { "Place": { - "local": 5, + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, "projection": [] } } } ] }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "symbol_name": "std::rt::lang_start::h88f5d079fbb5d449" }, { "details": null, @@ -770,276 +926,147 @@ "arg_count": 1, "blocks": [ { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, + { + "kind": { + "Assign": [ { - "Move": { - "local": 1, - "projection": [] - } + "local": 4, + "projection": [] }, { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } } } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 3, - "kind": "ZeroSized", - "ty": 19 - }, - "span": 31, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 33 - } - }, - { - "statements": [], + ] + }, + "span": 17 + } + ], "terminator": { "kind": { "Call": { "args": [ { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 4, + "projection": [] } } ], "destination": { - "local": 2, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 5, + "id": 1, "kind": "ZeroSized", - "ty": 20 + "ty": 13 }, - "span": 34, + "span": 14, "user_ty": null } }, - "target": 2, - "unwind": "Unreachable" + "target": 1, + "unwind": "Continue" } }, - "span": 35 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 36 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 37, - "ty": 1 - }, - { - "mutability": "Not", - "span": 38, - "ty": 7 - }, - { - "mutability": "Not", - "span": 39, - "ty": 1 - } - ], - "span": 42, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "f", - "source_info": { - "scope": 0, - "span": 38 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "result", - "source_info": { - "scope": 1, - "span": 40 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } + "span": 15 } }, { - "argument_index": 1, - "composite": null, - "name": "dummy", - "source_info": { - "scope": 2, - "span": 41 - }, - "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 + "statements": [ + { + "kind": { + "StorageDead": 4 }, - "span": 32, - "user_ty": null + "span": 19 } - } - } - ] - }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" - } - }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], + ], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } - }, - { - "Move": { - "local": 2, + "local": 3, "projection": [] } } ], "destination": { - "local": 0, + "local": 2, "projection": [] }, "func": { "Constant": { "const_": { - "id": 6, + "id": 2, "kind": "ZeroSized", - "ty": 21 + "ty": 14 }, - "span": 43, + "span": 18, "user_ty": null } }, - "target": 1, + "target": 2, "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 + "span": 16 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 22 }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ { "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, { "kind": { "Assign": [ { - "local": 3, + "local": 5, "projection": [] }, { @@ -1047,322 +1074,210 @@ { "kind": "ReErased" }, + "Shared", { - "Mut": { - "kind": "Default" - } - }, - { - "local": 1, - "projection": [] + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] } ] } ] }, - "span": 43 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ { - "Move": { - "local": 3, - "projection": [] - } + "local": 6, + "projection": [] }, { - "Move": { - "local": 2, - "projection": [] + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + }, + { + "Field": [ + 0, + 9 + ] + } + ] + } } } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 7, - "kind": "ZeroSized", - "ty": 23 - }, - "span": 43, - "user_ty": null - } - }, - "target": 1, - "unwind": { - "Cleanup": 3 - } - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 2, - "unwind": "Continue" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Resume", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 12 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 24 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Move": { - "local": 1, - "projection": [] - } - }, - "target": 1, - "unwind": "Continue" - } + ] + }, + "span": 23 }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 7 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 44 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 44, - "ty": 1 - }, - { - "mutability": "Not", - "span": 44, - "ty": 22 - } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] - }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" - } - }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 0, - "blocks": [ - { - "statements": [ { "kind": { "Assign": [ { - "local": 1, + "local": 0, "projection": [] }, { - "Aggregate": [ + "Cast": [ + "IntToInt", { - "Adt": [ - 7, - 0, - [], - null, - null - ] + "Move": { + "local": 6, + "projection": [] + } }, - [] + 16 ] } ] }, - "span": 51 + "span": 24 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 } ], "terminator": { "kind": "Return", - "span": 50 + "span": 20 } } ], "locals": [ { "mutability": "Mut", - "span": 52, + "span": 28, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 3, + "ty": 11 + }, + { + "mutability": "Mut", + "span": 16, + "ty": 17 + }, + { + "mutability": "Mut", + "span": 15, "ty": 1 }, { - "mutability": "Not", - "span": 53, - "ty": 25 + "mutability": "Mut", + "span": 17, + "ty": 7 + }, + { + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 } ], - "span": 54, + "span": 3, "spread_arg": null, "var_debug_info": [ { "argument_index": null, "composite": null, - "name": "a", + "name": "main", "source_info": { - "scope": 1, - "span": 53 + "scope": 0, + "span": 9 }, "value": { "Place": { "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 29 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, "projection": [] } } } ] }, - "id": 6, - "name": "main" + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "_ZN4enum4main17h" + "symbol_name": "std::rt::lang_start::{{closure}}::h821f64d86117c6aa" }, { "details": null, @@ -1372,71 +1287,156 @@ "arg_count": 1, "blocks": [ { - "statements": [ - { - "kind": { - "Assign": [ + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ { - "local": 0, - "projection": [] + "Move": { + "local": 1, + "projection": [] + } }, { - "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 46, - "user_ty": null - } + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null } } - ] - }, - "span": 46 - } - ], + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 3, + "kind": "ZeroSized", + "ty": 19 + }, + "span": 31, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 33 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 5, + "kind": "ZeroSized", + "ty": 20 + }, + "span": 34, + "user_ty": null + } + }, + "target": 2, + "unwind": "Unreachable" + } + }, + "span": 35 + } + }, + { + "statements": [], "terminator": { "kind": "Return", - "span": 45 + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 47, - "ty": 17 + "span": 37, + "ty": 1 }, { "mutability": "Not", - "span": 48, + "span": 38, + "ty": 7 + }, + { + "mutability": "Not", + "span": 39, "ty": 1 } ], - "span": 49, + "span": 42, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "self", + "name": "f", "source_info": { "scope": 0, - "span": 48 + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 40 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "dummy", + "source_info": { + "scope": 2, + "span": 41 }, "value": { "Const": { @@ -1452,11 +1452,11 @@ } ] }, - "id": 5, - "name": "<() as std::process::Termination>::report" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h6d6ca95b552c258b" } ], "types": [ diff --git a/tests/integration/programs/fibonacci.smir.json.expected b/tests/integration/programs/fibonacci.smir.json.expected index ffece1f..049a93c 100644 --- a/tests/integration/programs/fibonacci.smir.json.expected +++ b/tests/integration/programs/fibonacci.smir.json.expected @@ -98,75 +98,109 @@ "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 1, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, { "kind": { "Assign": [ { - "local": 8, + "local": 0, "projection": [] }, { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 + "Use": { + "Constant": { + "const_": { + "id": 8, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] + }, + "ty": 17 + }, + "span": 46, + "user_ty": null + } + } } ] }, - "span": 3 - }, + "span": 46 + } + ], + "terminator": { + "kind": "Return", + "span": 45 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 + }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::h37f278b9f12a46b1" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ { "kind": { "Assign": [ { - "local": 7, + "local": 3, "projection": [] }, { @@ -174,59 +208,26 @@ { "kind": "ReErased" }, - "Shared", - { - "local": 8, - "projection": [] - } - ] - } - ] - }, - "span": 2 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, { - "Copy": { - "local": 7, - "projection": [] + "Mut": { + "kind": "Default" } }, - 5 + { + "local": 1, + "projection": [] + } ] } ] }, - "span": 2 + "span": 43 } ], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, { "Move": { "local": 3, @@ -235,300 +236,219 @@ }, { "Move": { - "local": 4, + "local": 2, "projection": [] } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 7, "kind": "ZeroSized", - "ty": 0 + "ty": 23 }, - "span": 0, + "span": 43, "user_ty": null } }, "target": 1, + "unwind": { + "Cleanup": 3 + } + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, "unwind": "Continue" } }, - "span": 1 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 5 + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 - } - ], + "span": 43 + } + }, + { + "statements": [], "terminator": { - "kind": "Return", - "span": 4 + "kind": "Resume", + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 8, - "ty": 6 - }, - { - "mutability": "Not", - "span": 9, - "ty": 7 - }, - { - "mutability": "Not", - "span": 10, - "ty": 6 - }, - { - "mutability": "Not", - "span": 11, - "ty": 8 + "span": 43, + "ty": 16 }, { "mutability": "Not", - "span": 12, - "ty": 9 - }, - { - "mutability": "Mut", - "span": 1, - "ty": 10 - }, - { - "mutability": "Mut", - "span": 2, - "ty": 5 + "span": 43, + "ty": 12 }, { "mutability": "Not", - "span": 2, - "ty": 11 + "span": 43, + "ty": 1 }, { "mutability": "Not", - "span": 3, - "ty": 12 + "span": 43, + "ty": 24 } ], - "span": 13, - "spread_arg": null, - "var_debug_info": [ + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h45c3b3c26335d738" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { - "argument_index": 1, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, + "projection": [] + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 43 } }, { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 } - }, + } + ], + "locals": [ { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } + "mutability": "Mut", + "span": 43, + "ty": 1 }, { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } + "mutability": "Not", + "span": 43, + "ty": 7 }, { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } + "mutability": "Not", + "span": 43, + "ty": 1 } - ] + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 3, + "name": ">::call_once" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "core::ops::function::FnOnce::call_once::h7f03fb3ec7475c2e" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 2, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 16 - }, - { - "kind": { - "StorageLive": 3 - }, - "span": 15 - }, - { - "kind": { - "StorageLive": 4 - }, - "span": 17 - }, - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - } - ] - }, - "span": 17 - } - ], + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 4, - "projection": [] + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, + "projection": [] } } ], "destination": { - "local": 3, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 1, + "id": 6, "kind": "ZeroSized", - "ty": 13 + "ty": 21 }, - "span": 14, + "span": 43, "user_ty": null } }, @@ -536,950 +456,1119 @@ "unwind": "Continue" } }, - "span": 15 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 4 - }, - "span": 19 - } - ], + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 16 + }, + { + "mutability": "Not", + "span": 43, + "ty": 22 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hd1d6c8c7028d0e29" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 + }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::hff2ea6338b6cd636" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], "terminator": { "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 3, - "projection": [] - } - } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 2, - "kind": "ZeroSized", - "ty": 14 - }, - "span": 18, - "user_ty": null + "SwitchInt": { + "discr": { + "Copy": { + "local": 1, + "projection": [] } }, - "target": 2, - "unwind": "Continue" + "targets": { + "branches": [ + [ + 0, + 3 + ], + [ + 1, + 2 + ] + ], + "otherwise": 1 + } } }, - "span": 16 + "span": 50 } }, { "statements": [ - { - "kind": { - "StorageDead": 3 - }, - "span": 21 - }, - { - "kind": { - "StorageLive": 5 - }, - "span": 22 - }, { "kind": { "Assign": [ { - "local": 5, + "local": 4, "projection": [] }, { - "Ref": [ + "CheckedBinaryOp": [ + "Sub", { - "kind": "ReErased" + "Copy": { + "local": 1, + "projection": [] + } }, - "Shared", { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - } - ] + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 2, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 51, + "user_ty": null + } } ] } ] }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - }, - { - "Field": [ - 0, - 9 - ] - } + "span": 52 + } + ], + "terminator": { + "kind": { + "Assert": { + "cond": { + "Move": { + "local": 4, + "projection": [ + { + "Field": [ + 1, + 25 ] } - } + ] } - ] - }, - "span": 23 - }, - { - "kind": { - "Assign": [ + }, + "expected": false, + "msg": { + "Overflow": [ + "Sub", + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 2, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 51, + "user_ty": null + } + } + ] + }, + "target": 4, + "unwind": "Continue" + } + }, + "span": 52 + } + }, + { + "statements": [ + { + "kind": { + "Assign": [ { "local": 0, "projection": [] }, { - "Cast": [ - "IntToInt", - { - "Move": { - "local": 6, - "projection": [] - } - }, - 16 - ] + "Use": { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 53, + "user_ty": null + } + } } ] }, - "span": 24 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 25 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 + "span": 53 } ], "terminator": { - "kind": "Return", - "span": 20 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 28, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 3, - "ty": 11 - }, - { - "mutability": "Mut", - "span": 16, - "ty": 17 - }, - { - "mutability": "Mut", - "span": 15, - "ty": 1 - }, - { - "mutability": "Mut", - "span": 17, - "ty": 7 - }, - { - "mutability": "Mut", - "span": 22, - "ty": 18 - }, - { - "mutability": "Mut", - "span": 23, - "ty": 9 - } - ], - "span": 3, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": null, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } + "kind": { + "Goto": { + "target": 9 + } + }, + "span": 53 } }, { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 1, - "span": 29 - }, - "value": { - "Place": { - "local": 2, - "projection": [] + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 11, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 54, + "user_ty": null + } + } + } + ] + }, + "span": 54 } + ], + "terminator": { + "kind": { + "Goto": { + "target": 9 + } + }, + "span": 54 } }, { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 2, - "span": 30 - }, - "value": { - "Place": { - "local": 5, - "projection": [] + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 3, + "projection": [] + }, + { + "Use": { + "Move": { + "local": 4, + "projection": [ + { + "Field": [ + 0, + 26 + ] + } + ] + } + } + } + ] + }, + "span": 52 } - } - } - ] - }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" - } - }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [], + ], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, + "local": 3, "projection": [] } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 12, + "kind": "ZeroSized", + "ty": 27 + }, + "span": 55, + "user_ty": null + } + }, + "target": 5, + "unwind": "Continue" + } + }, + "span": 56 + } + }, + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] }, { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 + "CheckedBinaryOp": [ + "Sub", + { + "Copy": { + "local": 1, + "projection": [] + } }, - "span": 32, - "user_ty": null - } + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 57, + "user_ty": null + } + } + ] + } + ] + }, + "span": 58 + } + ], + "terminator": { + "kind": { + "Assert": { + "cond": { + "Move": { + "local": 7, + "projection": [ + { + "Field": [ + 1, + 25 + ] + } + ] } - ], - "destination": { - "local": 0, - "projection": [] }, - "func": { - "Constant": { - "const_": { - "id": 3, - "kind": "ZeroSized", - "ty": 19 + "expected": false, + "msg": { + "Overflow": [ + "Sub", + { + "Copy": { + "local": 1, + "projection": [] + } }, - "span": 31, - "user_ty": null - } + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 57, + "user_ty": null + } + } + ] }, - "target": 1, + "target": 6, "unwind": "Continue" } }, - "span": 33 + "span": 58 } }, { - "statements": [], + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Use": { + "Move": { + "local": 7, + "projection": [ + { + "Field": [ + 0, + 26 + ] + } + ] + } + } + } + ] + }, + "span": 58 + } + ], "terminator": { "kind": { "Call": { "args": [ { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 6, + "projection": [] } } ], "destination": { - "local": 2, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 5, + "id": 12, "kind": "ZeroSized", - "ty": 20 + "ty": 27 }, - "span": 34, + "span": 59, "user_ty": null } }, - "target": 2, - "unwind": "Unreachable" + "target": 7, + "unwind": "Continue" } }, - "span": 35 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 36 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 37, - "ty": 1 - }, - { - "mutability": "Not", - "span": 38, - "ty": 7 - }, - { - "mutability": "Not", - "span": 39, - "ty": 1 - } - ], - "span": 42, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "f", - "source_info": { - "scope": 0, - "span": 38 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "result", - "source_info": { - "scope": 1, - "span": 40 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } + "span": 60 } }, { - "argument_index": 1, - "composite": null, - "name": "dummy", - "source_info": { - "scope": 2, - "span": 41 - }, - "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 8, + "projection": [] + }, + { + "CheckedBinaryOp": [ + "Add", + { + "Copy": { + "local": 2, + "projection": [] + } + }, + { + "Copy": { + "local": 5, + "projection": [] + } + } + ] + } + ] }, - "span": 32, - "user_ty": null + "span": 61 } - } - } - ] - }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" - } - }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ + ], + "terminator": { + "kind": { + "Assert": { + "cond": { + "Move": { + "local": 8, + "projection": [ + { + "Field": [ + 1, + 25 + ] + } + ] + } + }, + "expected": false, + "msg": { + "Overflow": [ + "Add", + { + "Move": { + "local": 2, + "projection": [] + } + }, + { + "Move": { + "local": 5, + "projection": [] + } + } + ] + }, + "target": 8, + "unwind": "Continue" + } + }, + "span": 61 + } + }, { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "Assign": [ { - "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } + "local": 0, + "projection": [] }, { - "Move": { - "local": 2, - "projection": [] + "Use": { + "Move": { + "local": 8, + "projection": [ + { + "Field": [ + 0, + 26 + ] + } + ] + } } } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 21 - }, - "span": 43, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" + ] + }, + "span": 61 + } + ], + "terminator": { + "kind": { + "Goto": { + "target": 9 } }, - "span": 43 + "span": 62 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 43 + "span": 63 } } ], "locals": [ { "mutability": "Mut", - "span": 43, - "ty": 16 + "span": 64, + "ty": 26 }, { "mutability": "Not", - "span": 43, - "ty": 22 + "span": 65, + "ty": 26 }, { - "mutability": "Not", - "span": 43, - "ty": 1 + "mutability": "Mut", + "span": 56, + "ty": 26 + }, + { + "mutability": "Mut", + "span": 52, + "ty": 26 + }, + { + "mutability": "Mut", + "span": 52, + "ty": 28 + }, + { + "mutability": "Mut", + "span": 60, + "ty": 26 + }, + { + "mutability": "Mut", + "span": 58, + "ty": 26 + }, + { + "mutability": "Mut", + "span": 58, + "ty": 28 + }, + { + "mutability": "Mut", + "span": 61, + "ty": 28 } ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] + "span": 66, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "n", + "source_info": { + "scope": 0, + "span": 65 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + } + ] }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + "id": 6, + "name": "fibonacci" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" + "symbol_name": "fibonacci::fibonacci::h0f21316c520fb28a" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 0, "blocks": [ { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - { - "Mut": { - "kind": "Default" - } - }, - { - "local": 1, - "projection": [] - } - ] - } - ] - }, - "span": 43 - } - ], + "statements": [], "terminator": { "kind": { "Call": { "args": [ { - "Move": { - "local": 3, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] + "Constant": { + "const_": { + "id": 13, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 5, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 68, + "user_ty": null } } ], "destination": { - "local": 0, + "local": 1, "projection": [] }, "func": { "Constant": { "const_": { - "id": 7, + "id": 12, "kind": "ZeroSized", - "ty": 23 + "ty": 27 }, - "span": 43, + "span": 67, "user_ty": null } }, "target": 1, - "unwind": { - "Cleanup": 3 - } - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 2, "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 + "span": 69 } }, { "statements": [], "terminator": { "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] + "SwitchInt": { + "discr": { + "Copy": { + "local": 1, + "projection": [] + } }, - "target": 4, - "unwind": "Terminate" + "targets": { + "branches": [ + [ + 5, + 2 + ] + ], + "otherwise": 3 + } } }, - "span": 43 + "span": 70 } }, { "statements": [], "terminator": { - "kind": "Resume", - "span": 43 + "kind": "Return", + "span": 71 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 12 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 }, - { - "mutability": "Not", - "span": 43, - "ty": 24 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ { "statements": [], "terminator": { "kind": { "Call": { - "args": [], + "args": [ + { + "Constant": { + "const_": { + "id": 15, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 26, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 0 + ] + ] + } + } + }, + "ty": 30 + }, + "span": 32, + "user_ty": null + } + } + ], "destination": { - "local": 0, + "local": 2, "projection": [] }, "func": { - "Move": { - "local": 1, - "projection": [] + "Constant": { + "const_": { + "id": 14, + "kind": "ZeroSized", + "ty": 29 + }, + "span": 72, + "user_ty": null } }, - "target": 1, + "target": null, "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 + "span": 72 } } ], "locals": [ { "mutability": "Mut", - "span": 43, + "span": 73, "ty": 1 }, { "mutability": "Not", - "span": 43, - "ty": 7 + "span": 74, + "ty": 26 }, { - "mutability": "Not", - "span": 43, - "ty": 1 + "mutability": "Mut", + "span": 72, + "ty": 31 } ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ + "span": 75, + "spread_arg": null, + "var_debug_info": [ { - "statements": [], - "terminator": { - "kind": "Return", - "span": 44 + "argument_index": null, + "composite": null, + "name": "ans", + "source_info": { + "scope": 1, + "span": 74 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } } } - ], - "locals": [ - { - "mutability": "Mut", - "span": 44, - "ty": 1 - }, - { - "mutability": "Not", - "span": 44, - "ty": 22 - } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] + ] }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + "id": 7, + "name": "main" } }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" + "symbol_name": "fibonacci::main::had681b5951da2694" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 4, "blocks": [ { "statements": [ + { + "kind": { + "StorageLive": 5 + }, + "span": 1 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 8, + "projection": [] + }, + { + "Aggregate": [ + { + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] + }, + [ + { + "Copy": { + "local": 1, + "projection": [] + } + } + ] + ] + } + ] + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] + } + ] + } + ] + }, + "span": 2 + }, { "kind": { "Assign": [ { - "local": 0, + "local": 6, "projection": [] }, { - "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 46, - "user_ty": null - } - } + "Cast": [ + { + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, + "projection": [] + } + }, + 5 + ] } ] }, - "span": 46 + "span": 2 } ], - "terminator": { - "kind": "Return", - "span": 45 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 47, - "ty": 17 - }, - { - "mutability": "Not", - "span": 48, - "ty": 1 - } - ], - "span": 49, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 0, - "span": 48 - }, - "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } - } - } - ] - }, - "id": 5, - "name": "<() as std::process::Termination>::report" - } - }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 0, - "blocks": [ - { - "statements": [], "terminator": { "kind": { "Call": { "args": [ { - "Constant": { - "const_": { - "id": 13, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 5, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 68, - "user_ty": null + "Move": { + "local": 6, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] } } ], "destination": { - "local": 1, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 12, + "id": 0, "kind": "ZeroSized", - "ty": 27 + "ty": 0 }, - "span": 67, + "span": 0, "user_ty": null } }, @@ -1487,140 +1576,122 @@ "unwind": "Continue" } }, - "span": 69 + "span": 1 } }, { - "statements": [], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Copy": { - "local": 1, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 5, - 2 - ] - ], - "otherwise": 3 - } - } + "statements": [ + { + "kind": { + "StorageDead": 6 + }, + "span": 5 }, - "span": 70 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 71 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + { + "kind": { + "Assign": [ { - "Constant": { - "const_": { - "id": 15, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 26, - 0, - 0, - 0, - 0, - 0, + "local": 0, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 + }, + { + "Field": [ 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 0 - ] - ] - } + 6 + ] } - }, - "ty": 30 - }, - "span": 32, - "user_ty": null + ] + } } } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 14, - "kind": "ZeroSized", - "ty": 29 - }, - "span": 72, - "user_ty": null - } - }, - "target": null, - "unwind": "Continue" - } + ] + }, + "span": 6 }, - "span": 72 + { + "kind": { + "StorageDead": 8 + }, + "span": 7 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 7 + } + ], + "terminator": { + "kind": "Return", + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 73, - "ty": 1 + "span": 8, + "ty": 6 }, { "mutability": "Not", - "span": 74, - "ty": 26 + "span": 9, + "ty": 7 + }, + { + "mutability": "Not", + "span": 10, + "ty": 6 + }, + { + "mutability": "Not", + "span": 11, + "ty": 8 + }, + { + "mutability": "Not", + "span": 12, + "ty": 9 }, { "mutability": "Mut", - "span": 72, - "ty": 31 + "span": 1, + "ty": 10 + }, + { + "mutability": "Mut", + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 } ], - "span": 75, + "span": 13, "spread_arg": null, "var_debug_info": [ { - "argument_index": null, + "argument_index": 1, "composite": null, - "name": "ans", + "name": "main", "source_info": { - "scope": 1, - "span": 74 + "scope": 0, + "span": 9 }, "value": { "Place": { @@ -1628,279 +1699,119 @@ "projection": [] } } - } - ] - }, - "id": 7, - "name": "main" - } - }, - "symbol_name": "_ZN9fibonacci4main17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Copy": { - "local": 1, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 0, - 3 - ], - [ - 1, - 2 - ] - ], - "otherwise": 1 - } - } - }, - "span": 50 - } }, { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "CheckedBinaryOp": [ - "Sub", - { - "Copy": { - "local": 1, - "projection": [] - } - }, - { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 2, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 51, - "user_ty": null - } - } - ] - } - ] - }, - "span": 52 - } - ], - "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 4, - "projection": [ - { - "Field": [ - 1, - 25 - ] - } - ] - } - }, - "expected": false, - "msg": { - "Overflow": [ - "Sub", - { - "Copy": { - "local": 1, - "projection": [] - } - }, - { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 2, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 51, - "user_ty": null - } - } - ] - }, - "target": 4, - "unwind": "Continue" - } - }, - "span": 52 + "argument_index": 2, + "composite": null, + "name": "argc", + "source_info": { + "scope": 0, + "span": 10 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } } }, { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 53, - "user_ty": null - } - } - } - ] - }, - "span": 53 + "argument_index": 3, + "composite": null, + "name": "argv", + "source_info": { + "scope": 0, + "span": 11 + }, + "value": { + "Place": { + "local": 3, + "projection": [] } - ], - "terminator": { - "kind": { - "Goto": { - "target": 9 - } - }, - "span": 53 } }, { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 11, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 54, - "user_ty": null - } - } - } - ] - }, - "span": 54 + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] } - ], - "terminator": { - "kind": { - "Goto": { - "target": 9 - } - }, - "span": 54 } }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + } + ] + }, + "id": 0, + "name": "std::rt::lang_start::<()>" + } + }, + "symbol_name": "std::rt::lang_start::h82e920d882b90fe9" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ { "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, { "kind": { "Assign": [ { - "local": 3, + "local": 4, "projection": [] }, { "Use": { - "Move": { - "local": 4, + "Copy": { + "local": 1, "projection": [ + "Deref", { "Field": [ 0, - 26 + 7 ] } ] @@ -1909,7 +1820,7 @@ } ] }, - "span": 52 + "span": 17 } ], "terminator": { @@ -1918,145 +1829,125 @@ "args": [ { "Move": { - "local": 3, + "local": 4, "projection": [] } } ], "destination": { - "local": 2, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 12, + "id": 1, "kind": "ZeroSized", - "ty": 27 + "ty": 13 }, - "span": 55, + "span": 14, "user_ty": null } }, - "target": 5, + "target": 1, "unwind": "Continue" } }, - "span": 56 + "span": 15 } }, { "statements": [ { "kind": { - "Assign": [ - { - "local": 7, - "projection": [] - }, - { - "CheckedBinaryOp": [ - "Sub", - { - "Copy": { - "local": 1, - "projection": [] - } - }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 57, - "user_ty": null - } - } - ] - } - ] + "StorageDead": 4 }, - "span": 58 + "span": 19 } ], "terminator": { "kind": { - "Assert": { - "cond": { - "Move": { - "local": 7, - "projection": [ - { - "Field": [ - 1, - 25 - ] - } - ] + "Call": { + "args": [ + { + "Move": { + "local": 3, + "projection": [] + } } + ], + "destination": { + "local": 2, + "projection": [] }, - "expected": false, - "msg": { - "Overflow": [ - "Sub", - { - "Copy": { - "local": 1, - "projection": [] - } + "func": { + "Constant": { + "const_": { + "id": 2, + "kind": "ZeroSized", + "ty": 14 }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 57, - "user_ty": null - } - } - ] + "span": 18, + "user_ty": null + } }, - "target": 6, + "target": 2, "unwind": "Continue" } }, - "span": 58 + "span": 16 } }, { "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] + } + ] + } + ] + }, + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, { "kind": { "Assign": [ @@ -2066,13 +1957,19 @@ }, { "Use": { - "Move": { - "local": 7, + "Copy": { + "local": 2, "projection": [ { "Field": [ 0, - 26 + 15 + ] + }, + { + "Field": [ + 0, + 9 ] } ] @@ -2081,217 +1978,285 @@ } ] }, - "span": 58 + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] + } + ] + }, + "span": 24 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 } ], + "terminator": { + "kind": "Return", + "span": 20 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 28, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 3, + "ty": 11 + }, + { + "mutability": "Mut", + "span": 16, + "ty": 17 + }, + { + "mutability": "Mut", + "span": 15, + "ty": 1 + }, + { + "mutability": "Mut", + "span": 17, + "ty": 7 + }, + { + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 + } + ], + "span": 3, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": null, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 29 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } + } + ] + }, + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" + } + }, + "symbol_name": "std::rt::lang_start::{{closure}}::hf43aa668c9718a25" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 6, + "local": 1, "projection": [] } + }, + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 12, + "id": 3, "kind": "ZeroSized", - "ty": 27 + "ty": 19 }, - "span": 59, + "span": 31, "user_ty": null } }, - "target": 7, + "target": 1, "unwind": "Continue" } }, - "span": 60 + "span": 33 } }, { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 8, - "projection": [] - }, - { - "CheckedBinaryOp": [ - "Add", - { - "Copy": { - "local": 2, - "projection": [] - } - }, - { - "Copy": { - "local": 5, - "projection": [] - } - } - ] - } - ] - }, - "span": 61 - } - ], + "statements": [], "terminator": { "kind": { - "Assert": { - "cond": { - "Move": { - "local": 8, - "projection": [ - { - "Field": [ - 1, - 25 - ] - } - ] + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } } + ], + "destination": { + "local": 2, + "projection": [] }, - "expected": false, - "msg": { - "Overflow": [ - "Add", - { - "Move": { - "local": 2, - "projection": [] - } + "func": { + "Constant": { + "const_": { + "id": 5, + "kind": "ZeroSized", + "ty": 20 }, - { - "Move": { - "local": 5, - "projection": [] - } - } - ] - }, - "target": 8, - "unwind": "Continue" - } - }, - "span": 61 - } - }, - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Move": { - "local": 8, - "projection": [ - { - "Field": [ - 0, - 26 - ] - } - ] - } - } + "span": 34, + "user_ty": null } - ] - }, - "span": 61 - } - ], - "terminator": { - "kind": { - "Goto": { - "target": 9 + }, + "target": 2, + "unwind": "Unreachable" } }, - "span": 62 + "span": 35 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 63 + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 64, - "ty": 26 + "span": 37, + "ty": 1 }, { "mutability": "Not", - "span": 65, - "ty": 26 - }, - { - "mutability": "Mut", - "span": 56, - "ty": 26 - }, - { - "mutability": "Mut", - "span": 52, - "ty": 26 - }, - { - "mutability": "Mut", - "span": 52, - "ty": 28 - }, - { - "mutability": "Mut", - "span": 60, - "ty": 26 - }, - { - "mutability": "Mut", - "span": 58, - "ty": 26 - }, - { - "mutability": "Mut", - "span": 58, - "ty": 28 + "span": 38, + "ty": 7 }, { - "mutability": "Mut", - "span": 61, - "ty": 28 + "mutability": "Not", + "span": 39, + "ty": 1 } ], - "span": 66, + "span": 42, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "n", + "name": "f", "source_info": { "scope": 0, - "span": 65 + "span": 38 }, "value": { "Place": { @@ -2299,14 +2264,49 @@ "projection": [] } } + }, + { + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 40 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "dummy", + "source_info": { + "scope": 2, + "span": 41 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } } ] }, - "id": 6, - "name": "fibonacci" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN9fibonacci9fibonacci17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::hda9056ae1880857e" } ], "types": [ diff --git a/tests/integration/programs/float.smir.json.expected b/tests/integration/programs/float.smir.json.expected index 7006b09..8d62fba 100644 --- a/tests/integration/programs/float.smir.json.expected +++ b/tests/integration/programs/float.smir.json.expected @@ -140,75 +140,109 @@ "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 1, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, { "kind": { "Assign": [ { - "local": 8, + "local": 0, "projection": [] }, { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 + "Use": { + "Constant": { + "const_": { + "id": 8, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] + }, + "ty": 17 + }, + "span": 46, + "user_ty": null + } + } } ] }, - "span": 3 - }, + "span": 46 + } + ], + "terminator": { + "kind": "Return", + "span": 45 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 + }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::h5b7c1648725573f1" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ { "kind": { "Assign": [ { - "local": 7, + "local": 3, "projection": [] }, { @@ -216,59 +250,26 @@ { "kind": "ReErased" }, - "Shared", - { - "local": 8, - "projection": [] - } - ] - } - ] - }, - "span": 2 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, { - "Copy": { - "local": 7, - "projection": [] + "Mut": { + "kind": "Default" } }, - 5 + { + "local": 1, + "projection": [] + } ] } ] }, - "span": 2 + "span": 43 } ], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, { "Move": { "local": 3, @@ -277,300 +278,219 @@ }, { "Move": { - "local": 4, + "local": 2, "projection": [] } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 7, "kind": "ZeroSized", - "ty": 0 + "ty": 23 }, - "span": 0, + "span": 43, "user_ty": null } }, "target": 1, + "unwind": { + "Cleanup": 3 + } + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, "unwind": "Continue" } }, - "span": 1 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 5 + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 - } - ], + "span": 43 + } + }, + { + "statements": [], "terminator": { - "kind": "Return", - "span": 4 + "kind": "Resume", + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 8, - "ty": 6 - }, - { - "mutability": "Not", - "span": 9, - "ty": 7 - }, - { - "mutability": "Not", - "span": 10, - "ty": 6 - }, - { - "mutability": "Not", - "span": 11, - "ty": 8 + "span": 43, + "ty": 16 }, { "mutability": "Not", - "span": 12, - "ty": 9 - }, - { - "mutability": "Mut", - "span": 1, - "ty": 10 - }, - { - "mutability": "Mut", - "span": 2, - "ty": 5 + "span": 43, + "ty": 12 }, { "mutability": "Not", - "span": 2, - "ty": 11 + "span": 43, + "ty": 1 }, { "mutability": "Not", - "span": 3, - "ty": 12 + "span": 43, + "ty": 24 } ], - "span": 13, - "spread_arg": null, - "var_debug_info": [ + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h2739793cd611786c" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { - "argument_index": 1, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, + "projection": [] + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 43 } }, { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 } - }, + } + ], + "locals": [ { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } + "mutability": "Mut", + "span": 43, + "ty": 1 }, { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } + "mutability": "Not", + "span": 43, + "ty": 7 }, { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } + "mutability": "Not", + "span": 43, + "ty": 1 } - ] + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 3, + "name": ">::call_once" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "core::ops::function::FnOnce::call_once::hfef7d456f3c6afa0" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 2, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 16 - }, - { - "kind": { - "StorageLive": 3 - }, - "span": 15 - }, - { - "kind": { - "StorageLive": 4 - }, - "span": 17 - }, - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - } - ] - }, - "span": 17 - } - ], + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 4, - "projection": [] + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, + "projection": [] } } ], "destination": { - "local": 3, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 1, + "id": 6, "kind": "ZeroSized", - "ty": 13 + "ty": 21 }, - "span": 14, + "span": 43, "user_ty": null } }, @@ -578,307 +498,497 @@ "unwind": "Continue" } }, - "span": 15 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 4 - }, - "span": 19 - } - ], + "statements": [], "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 3, - "projection": [] - } - } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 2, - "kind": "ZeroSized", - "ty": 14 - }, - "span": 18, - "user_ty": null - } - }, - "target": 2, - "unwind": "Continue" - } - }, - "span": 16 + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 16 + }, + { + "mutability": "Not", + "span": 43, + "ty": 22 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h2137f1231538a0d9" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h794fad15324f211a" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 0, + "blocks": [ { "statements": [ - { - "kind": { - "StorageDead": 3 - }, - "span": 21 - }, - { - "kind": { - "StorageLive": 5 - }, - "span": 22 - }, { "kind": { "Assign": [ { - "local": 5, + "local": 3, "projection": [] }, { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - } - ] + "Use": { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 0, + 0, + 96, + 64 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 25 + }, + "span": 51, + "user_ty": null } - ] + } } ] }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 + "span": 52 }, { "kind": { "Assign": [ { - "local": 6, + "local": 4, "projection": [] }, { "Use": { - "Copy": { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 154, + 153, + 153, + 63 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } }, - { - "Field": [ - 0, - 9 - ] - } - ] + "ty": 25 + }, + "span": 53, + "user_ty": null } } } ] }, - "span": 23 + "span": 54 }, { "kind": { "Assign": [ { - "local": 0, + "local": 2, "projection": [] }, { - "Cast": [ - "IntToInt", + "BinaryOp": [ + "Add", { "Move": { - "local": 6, + "local": 3, "projection": [] } }, - 16 + { + "Move": { + "local": 4, + "projection": [] + } + } ] } ] }, - "span": 24 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 25 + "span": 55 }, { "kind": { - "StorageDead": 5 - }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 + "Assign": [ + { + "local": 1, + "projection": [] + }, + { + "BinaryOp": [ + "Eq", + { + "Move": { + "local": 2, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 11, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 102, + 102, + 150, + 64 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 25 + }, + "span": 56, + "user_ty": null + } + } + ] + } + ] }, - "span": 27 + "span": 50 } ], "terminator": { - "kind": "Return", - "span": 20 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 28, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 3, - "ty": 11 - }, - { - "mutability": "Mut", - "span": 16, - "ty": 17 - }, - { - "mutability": "Mut", - "span": 15, - "ty": 1 - }, - { - "mutability": "Mut", - "span": 17, - "ty": 7 - }, - { - "mutability": "Mut", - "span": 22, - "ty": 18 - }, - { - "mutability": "Mut", - "span": 23, - "ty": 9 - } - ], - "span": 3, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": null, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 1, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 2 + ] + ], + "otherwise": 1 } - ] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 1, - "span": 29 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } + } + }, + "span": 50 } }, { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 2, - "span": 30 - }, - "value": { - "Place": { - "local": 5, - "projection": [] + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 8, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 12, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 12, + 64 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 58, + "user_ty": null + } + } + } + ] + }, + "span": 59 + }, + { + "kind": { + "Assign": [ + { + "local": 9, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 13, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 51, + 51, + 51, + 51, + 51, + 51, + 243, + 63 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 60, + "user_ty": null + } + } + } + ] + }, + "span": 61 + }, + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "BinaryOp": [ + "Add", + { + "Move": { + "local": 8, + "projection": [] + } + }, + { + "Move": { + "local": 9, + "projection": [] + } + } + ] + } + ] + }, + "span": 62 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "BinaryOp": [ + "Eq", + { + "Move": { + "local": 7, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 14, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 205, + 204, + 204, + 204, + 204, + 204, + 18, + 64 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 63, + "user_ty": null + } + } + ] + } + ] + }, + "span": 57 } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 6, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 4 + ] + ], + "otherwise": 3 + } + } + }, + "span": 57 } - } - ] - }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" - } - }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ + }, { "statements": [], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 1, - "projection": [] - } - }, { "Constant": { "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 + "id": 16, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 30, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 0 + ] + ] + } + } + }, + "ty": 28 }, "span": 32, "user_ty": null @@ -886,25 +996,32 @@ } ], "destination": { - "local": 0, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 3, + "id": 15, "kind": "ZeroSized", - "ty": 19 + "ty": 27 }, - "span": 31, + "span": 64, "user_ty": null } }, - "target": 1, + "target": null, "unwind": "Continue" } }, - "span": 33 + "span": 64 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 65 } }, { @@ -916,9 +1033,40 @@ { "Constant": { "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 + "id": 17, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 30, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 1 + ] + ] + } + } + }, + "ty": 28 }, "span": 32, "user_ty": null @@ -926,233 +1074,356 @@ } ], "destination": { - "local": 2, + "local": 10, "projection": [] }, "func": { "Constant": { "const_": { - "id": 5, + "id": 15, "kind": "ZeroSized", - "ty": 20 + "ty": 27 }, - "span": 34, + "span": 66, "user_ty": null } }, - "target": 2, - "unwind": "Unreachable" + "target": null, + "unwind": "Continue" } }, - "span": 35 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 36 + "span": 66 } } ], "locals": [ { "mutability": "Mut", - "span": 37, + "span": 67, "ty": 1 }, { - "mutability": "Not", - "span": 38, - "ty": 7 + "mutability": "Mut", + "span": 50, + "ty": 29 }, { - "mutability": "Not", - "span": 39, - "ty": 1 + "mutability": "Mut", + "span": 55, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 52, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 54, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 64, + "ty": 30 + }, + { + "mutability": "Mut", + "span": 57, + "ty": 29 + }, + { + "mutability": "Mut", + "span": 62, + "ty": 26 + }, + { + "mutability": "Mut", + "span": 59, + "ty": 26 + }, + { + "mutability": "Mut", + "span": 61, + "ty": 26 + }, + { + "mutability": "Mut", + "span": 66, + "ty": 30 } ], - "span": 42, + "span": 72, "spread_arg": null, "var_debug_info": [ { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "f", + "name": "a", "source_info": { - "scope": 0, - "span": 38 + "scope": 1, + "span": 68 + }, + "value": { + "Const": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 0, + 0, + 96, + 64 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 25 + }, + "span": 51, + "user_ty": null + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "b", + "source_info": { + "scope": 2, + "span": 69 }, "value": { - "Place": { - "local": 1, - "projection": [] + "Const": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 154, + 153, + 153, + 63 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 25 + }, + "span": 53, + "user_ty": null } } }, { "argument_index": null, "composite": null, - "name": "result", + "name": "c", "source_info": { - "scope": 1, - "span": 40 + "scope": 3, + "span": 70 }, "value": { - "Place": { - "local": 0, - "projection": [] + "Const": { + "const_": { + "id": 12, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 12, + 64 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 58, + "user_ty": null } } }, { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "dummy", + "name": "d", "source_info": { - "scope": 2, - "span": 41 + "scope": 4, + "span": 71 }, "value": { "Const": { "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 + "id": 13, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 51, + 51, + 51, + 51, + 51, + 51, + 243, + 63 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 }, - "span": 32, + "span": 60, "user_ty": null } } } ] }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" + "id": 6, + "name": "main" } }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "symbol_name": "float::main::hfcafba4483851527" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 4, "blocks": [ { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "StorageLive": 5 + }, + "span": 1 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 + }, + { + "kind": { + "Assign": [ { - "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } + "local": 8, + "projection": [] }, { - "Move": { - "local": 2, - "projection": [] - } - } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 21 - }, - "span": 43, - "user_ty": null + "Aggregate": [ + { + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] + }, + [ + { + "Copy": { + "local": 1, + "projection": [] + } + } + ] + ] } - }, - "target": 1, - "unwind": "Continue" - } + ] + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] + } + ] + } + ] + }, + "span": 2 }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 22 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [ { "kind": { "Assign": [ { - "local": 3, + "local": 6, "projection": [] }, { - "Ref": [ + "Cast": [ { - "kind": "ReErased" + "PointerCoercion": "Unsize" }, { - "Mut": { - "kind": "Default" + "Copy": { + "local": 7, + "projection": [] } }, - { - "local": 1, - "projection": [] - } + 5 ] } ] }, - "span": 43 + "span": 2 } ], "terminator": { @@ -1161,7 +1432,7 @@ "args": [ { "Move": { - "local": 3, + "local": 6, "projection": [] } }, @@ -1170,222 +1441,50 @@ "local": 2, "projection": [] } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] + } } ], "destination": { - "local": 0, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 7, + "id": 0, "kind": "ZeroSized", - "ty": 23 + "ty": 0 }, - "span": 43, + "span": 0, "user_ty": null } }, "target": 1, - "unwind": { - "Cleanup": 3 - } - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 2, - "unwind": "Continue" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Resume", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 12 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 24 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Move": { - "local": 1, - "projection": [] - } - }, - "target": 1, "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 7 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 44 + "span": 1 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 44, - "ty": 1 }, - { - "mutability": "Not", - "span": 44, - "ty": 22 - } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] - }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" - } - }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ { "statements": [ + { + "kind": { + "StorageDead": 6 + }, + "span": 5 + }, { "kind": { "Assign": [ @@ -1393,500 +1492,566 @@ "local": 0, "projection": [] }, - { - "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } + { + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 }, - "ty": 17 - }, - "span": 46, - "user_ty": null + { + "Field": [ + 0, + 6 + ] + } + ] } } } ] }, - "span": 46 + "span": 6 + }, + { + "kind": { + "StorageDead": 8 + }, + "span": 7 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 7 } ], "terminator": { "kind": "Return", - "span": 45 + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 47, - "ty": 17 + "span": 8, + "ty": 6 }, { "mutability": "Not", - "span": 48, - "ty": 1 + "span": 9, + "ty": 7 + }, + { + "mutability": "Not", + "span": 10, + "ty": 6 + }, + { + "mutability": "Not", + "span": 11, + "ty": 8 + }, + { + "mutability": "Not", + "span": 12, + "ty": 9 + }, + { + "mutability": "Mut", + "span": 1, + "ty": 10 + }, + { + "mutability": "Mut", + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 } ], - "span": 49, + "span": 13, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "self", + "name": "main", "source_info": { "scope": 0, - "span": 48 + "span": 9 }, "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "argc", + "source_info": { + "scope": 0, + "span": 10 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 3, + "composite": null, + "name": "argv", + "source_info": { + "scope": 0, + "span": 11 + }, + "value": { + "Place": { + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, + "projection": [] } } } ] }, - "id": 5, - "name": "<() as std::process::Termination>::report" + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "std::rt::lang_start::h4ac36573ae2e0d67" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 0, + "arg_count": 1, "blocks": [ { "statements": [ { "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 0, - 0, - 96, - 64 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 25 - }, - "span": 51, - "user_ty": null - } - } - } - ] + "StorageLive": 2 }, - "span": 52 + "span": 16 }, { "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 154, - 153, - 153, - 63 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 25 - }, - "span": 53, - "user_ty": null - } - } - } - ] + "StorageLive": 3 }, - "span": 54 + "span": 15 }, { "kind": { - "Assign": [ - { - "local": 2, - "projection": [] - }, - { - "BinaryOp": [ - "Add", - { - "Move": { - "local": 3, - "projection": [] - } - }, - { - "Move": { - "local": 4, - "projection": [] - } - } - ] - } - ] + "StorageLive": 4 }, - "span": 55 + "span": 17 }, { "kind": { "Assign": [ { - "local": 1, + "local": 4, "projection": [] }, { - "BinaryOp": [ - "Eq", - { - "Move": { - "local": 2, - "projection": [] - } - }, - { - "Constant": { - "const_": { - "id": 11, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 102, - 102, - 150, - 64 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 25 - }, - "span": 56, - "user_ty": null - } + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] } - ] + } } ] }, - "span": 50 + "span": 17 } ], "terminator": { "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 1, - "projection": [] + "Call": { + "args": [ + { + "Move": { + "local": 4, + "projection": [] + } } + ], + "destination": { + "local": 3, + "projection": [] }, - "targets": { - "branches": [ - [ - 0, - 2 - ] - ], - "otherwise": 1 - } + "func": { + "Constant": { + "const_": { + "id": 1, + "kind": "ZeroSized", + "ty": 13 + }, + "span": 14, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" } }, - "span": 50 + "span": 15 } }, { "statements": [ { "kind": { - "Assign": [ - { - "local": 8, - "projection": [] - }, + "StorageDead": 4 + }, + "span": 19 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ { - "Use": { - "Constant": { - "const_": { - "id": 12, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 12, - 64 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 58, - "user_ty": null - } + "Move": { + "local": 3, + "projection": [] } } - ] + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 2, + "kind": "ZeroSized", + "ty": 14 + }, + "span": 18, + "user_ty": null + } + }, + "target": 2, + "unwind": "Continue" + } + }, + "span": 16 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 3 }, - "span": 59 + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 }, { "kind": { "Assign": [ { - "local": 9, + "local": 5, "projection": [] }, { - "Use": { - "Constant": { - "const_": { - "id": 13, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 51, - 51, - 51, - 51, - 51, - 51, - 243, - 63 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 60, - "user_ty": null + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] } - } + ] } ] }, - "span": 61 + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 }, { "kind": { "Assign": [ { - "local": 7, + "local": 6, "projection": [] }, { - "BinaryOp": [ - "Add", - { - "Move": { - "local": 8, - "projection": [] - } - }, - { - "Move": { - "local": 9, - "projection": [] - } + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + }, + { + "Field": [ + 0, + 9 + ] + } + ] } - ] + } } ] }, - "span": 62 + "span": 23 }, { "kind": { "Assign": [ { - "local": 6, + "local": 0, "projection": [] }, { - "BinaryOp": [ - "Eq", + "Cast": [ + "IntToInt", { "Move": { - "local": 7, + "local": 6, "projection": [] } }, - { - "Constant": { - "const_": { - "id": 14, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 205, - 204, - 204, - 204, - 204, - 204, - 18, - 64 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 63, - "user_ty": null - } - } + 16 ] } ] }, - "span": 57 + "span": 24 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 } ], "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 6, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 0, - 4 - ] - ], - "otherwise": 3 + "kind": "Return", + "span": 20 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 28, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 3, + "ty": 11 + }, + { + "mutability": "Mut", + "span": 16, + "ty": 17 + }, + { + "mutability": "Mut", + "span": 15, + "ty": 1 + }, + { + "mutability": "Mut", + "span": 17, + "ty": 7 + }, + { + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 + } + ], + "span": 3, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": null, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] } - } - }, - "span": 57 + ] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 29 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } } }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } + } + ] + }, + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" + } + }, + "symbol_name": "std::rt::lang_start::{{closure}}::h0283b14eff59cc87" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ { "statements": [], "terminator": { "kind": { "Call": { "args": [ + { + "Move": { + "local": 1, + "projection": [] + } + }, { "Constant": { "const_": { - "id": 16, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 30, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 0 - ] - ] - } - } - }, - "ty": 28 + "id": 4, + "kind": "ZeroSized", + "ty": 1 }, "span": 32, "user_ty": null @@ -1894,32 +2059,25 @@ } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 15, + "id": 3, "kind": "ZeroSized", - "ty": 27 + "ty": 19 }, - "span": 64, + "span": 31, "user_ty": null } }, - "target": null, + "target": 1, "unwind": "Continue" } - }, - "span": 64 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 65 + }, + "span": 33 } }, { @@ -1931,40 +2089,9 @@ { "Constant": { "const_": { - "id": 17, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 30, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 1 - ] - ] - } - } - }, - "ty": 28 + "id": 4, + "kind": "ZeroSized", + "ty": 1 }, "span": 32, "user_ty": null @@ -1972,239 +2099,112 @@ } ], "destination": { - "local": 10, + "local": 2, "projection": [] }, "func": { "Constant": { "const_": { - "id": 15, + "id": 5, "kind": "ZeroSized", - "ty": 27 + "ty": 20 }, - "span": 66, + "span": 34, "user_ty": null } }, - "target": null, - "unwind": "Continue" + "target": 2, + "unwind": "Unreachable" } }, - "span": 66 + "span": 35 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 67, + "span": 37, "ty": 1 }, { - "mutability": "Mut", - "span": 50, - "ty": 29 - }, - { - "mutability": "Mut", - "span": 55, - "ty": 25 - }, - { - "mutability": "Mut", - "span": 52, - "ty": 25 - }, - { - "mutability": "Mut", - "span": 54, - "ty": 25 - }, - { - "mutability": "Mut", - "span": 64, - "ty": 30 - }, - { - "mutability": "Mut", - "span": 57, - "ty": 29 - }, - { - "mutability": "Mut", - "span": 62, - "ty": 26 - }, - { - "mutability": "Mut", - "span": 59, - "ty": 26 - }, - { - "mutability": "Mut", - "span": 61, - "ty": 26 + "mutability": "Not", + "span": 38, + "ty": 7 }, { - "mutability": "Mut", - "span": 66, - "ty": 30 + "mutability": "Not", + "span": 39, + "ty": 1 } ], - "span": 72, + "span": 42, "spread_arg": null, "var_debug_info": [ { - "argument_index": null, - "composite": null, - "name": "a", - "source_info": { - "scope": 1, - "span": 68 - }, - "value": { - "Const": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 0, - 0, - 96, - 64 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 25 - }, - "span": 51, - "user_ty": null - } - } - }, - { - "argument_index": null, + "argument_index": 1, "composite": null, - "name": "b", + "name": "f", "source_info": { - "scope": 2, - "span": 69 + "scope": 0, + "span": 38 }, "value": { - "Const": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 154, - 153, - 153, - 63 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 25 - }, - "span": 53, - "user_ty": null + "Place": { + "local": 1, + "projection": [] } } }, { "argument_index": null, "composite": null, - "name": "c", + "name": "result", "source_info": { - "scope": 3, - "span": 70 + "scope": 1, + "span": 40 }, "value": { - "Const": { - "const_": { - "id": 12, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 12, - 64 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 58, - "user_ty": null + "Place": { + "local": 0, + "projection": [] } } }, { - "argument_index": null, + "argument_index": 1, "composite": null, - "name": "d", + "name": "dummy", "source_info": { - "scope": 4, - "span": 71 + "scope": 2, + "span": 41 }, "value": { "Const": { "const_": { - "id": 13, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 51, - 51, - 51, - 51, - 51, - 51, - 243, - 63 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 + "id": 4, + "kind": "ZeroSized", + "ty": 1 }, - "span": 60, + "span": 32, "user_ty": null } } } ] }, - "id": 6, - "name": "main" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN5float4main17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h590c8af96d26a217" } ], "types": [ diff --git a/tests/integration/programs/modulo.smir.json.expected b/tests/integration/programs/modulo.smir.json.expected index 248370f..dd30648 100644 --- a/tests/integration/programs/modulo.smir.json.expected +++ b/tests/integration/programs/modulo.smir.json.expected @@ -97,75 +97,109 @@ "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 1, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, { "kind": { "Assign": [ { - "local": 8, + "local": 0, "projection": [] }, { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 + "Use": { + "Constant": { + "const_": { + "id": 8, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] + }, + "ty": 17 + }, + "span": 46, + "user_ty": null + } + } } ] }, - "span": 3 - }, + "span": 46 + } + ], + "terminator": { + "kind": "Return", + "span": 45 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 + }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::h3ecc4521b60b951d" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ { "kind": { "Assign": [ { - "local": 7, + "local": 3, "projection": [] }, { @@ -173,59 +207,26 @@ { "kind": "ReErased" }, - "Shared", - { - "local": 8, - "projection": [] - } - ] - } - ] - }, - "span": 2 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, { - "Copy": { - "local": 7, - "projection": [] + "Mut": { + "kind": "Default" } }, - 5 + { + "local": 1, + "projection": [] + } ] } ] }, - "span": 2 + "span": 43 } ], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, { "Move": { "local": 3, @@ -234,300 +235,219 @@ }, { "Move": { - "local": 4, + "local": 2, "projection": [] } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 7, "kind": "ZeroSized", - "ty": 0 + "ty": 23 }, - "span": 0, + "span": 43, "user_ty": null } }, "target": 1, + "unwind": { + "Cleanup": 3 + } + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, "unwind": "Continue" } }, - "span": 1 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 5 + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 - } - ], + "span": 43 + } + }, + { + "statements": [], "terminator": { - "kind": "Return", - "span": 4 + "kind": "Resume", + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 8, - "ty": 6 - }, - { - "mutability": "Not", - "span": 9, - "ty": 7 - }, - { - "mutability": "Not", - "span": 10, - "ty": 6 - }, - { - "mutability": "Not", - "span": 11, - "ty": 8 + "span": 43, + "ty": 16 }, { "mutability": "Not", - "span": 12, - "ty": 9 - }, - { - "mutability": "Mut", - "span": 1, - "ty": 10 - }, - { - "mutability": "Mut", - "span": 2, - "ty": 5 + "span": 43, + "ty": 12 }, { "mutability": "Not", - "span": 2, - "ty": 11 + "span": 43, + "ty": 1 }, { "mutability": "Not", - "span": 3, - "ty": 12 + "span": 43, + "ty": 24 } ], - "span": 13, - "spread_arg": null, - "var_debug_info": [ + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h53f7abae41de76ce" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { - "argument_index": 1, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, + "projection": [] + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 43 } }, { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 } - }, + } + ], + "locals": [ { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } + "mutability": "Mut", + "span": 43, + "ty": 1 }, { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } + "mutability": "Not", + "span": 43, + "ty": 7 }, { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } + "mutability": "Not", + "span": 43, + "ty": 1 } - ] + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 3, + "name": ">::call_once" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "core::ops::function::FnOnce::call_once::h7e3576d4173f4f99" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 2, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 16 - }, - { - "kind": { - "StorageLive": 3 - }, - "span": 15 - }, - { - "kind": { - "StorageLive": 4 - }, - "span": 17 - }, - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - } - ] - }, - "span": 17 - } - ], + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 4, - "projection": [] + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, + "projection": [] } } ], "destination": { - "local": 3, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 1, + "id": 6, "kind": "ZeroSized", - "ty": 13 + "ty": 21 }, - "span": 14, + "span": 43, "user_ty": null } }, @@ -535,333 +455,533 @@ "unwind": "Continue" } }, - "span": 15 + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 16 + }, + { + "mutability": "Not", + "span": 43, + "ty": 22 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hcc706b24a8fd3a60" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h167abccb21f04ecb" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 0, + "blocks": [ { "statements": [ { "kind": { - "StorageDead": 4 + "Assign": [ + { + "local": 2, + "projection": [] + }, + { + "BinaryOp": [ + "Eq", + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 10, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 52, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 11, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 51, + "user_ty": null + } + } + ] + } + ] }, - "span": 19 + "span": 51 } ], "terminator": { "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 3, - "projection": [] - } + "Assert": { + "cond": { + "Move": { + "local": 2, + "projection": [] } - ], - "destination": { - "local": 2, - "projection": [] }, - "func": { - "Constant": { - "const_": { - "id": 2, - "kind": "ZeroSized", - "ty": 14 - }, - "span": 18, - "user_ty": null + "expected": false, + "msg": { + "RemainderByZero": { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 42, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 50, + "user_ty": null + } } }, - "target": 2, + "target": 1, "unwind": "Continue" } }, - "span": 16 + "span": 51 } }, { "statements": [ - { - "kind": { - "StorageDead": 3 - }, - "span": 21 - }, - { - "kind": { - "StorageLive": 5 - }, - "span": 22 - }, { "kind": { "Assign": [ { - "local": 5, + "local": 3, "projection": [] }, { - "Ref": [ + "BinaryOp": [ + "Eq", { - "kind": "ReErased" + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 10, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 52, + "user_ty": null + } }, - "Shared", { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - } - ] + "Constant": { + "const_": { + "id": 12, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 255, + 255, + 255, + 255 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 51, + "user_ty": null + } } ] } ] }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 + "span": 51 }, { "kind": { "Assign": [ { - "local": 6, + "local": 4, "projection": [] }, { - "Use": { - "Copy": { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] + "BinaryOp": [ + "Eq", + { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 42, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 }, - { - "Field": [ - 0, - 9 - ] - } - ] + "span": 50, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 13, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 0, + 0, + 0, + 128 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 51, + "user_ty": null + } } - } + ] } ] }, - "span": 23 + "span": 51 }, { "kind": { "Assign": [ { - "local": 0, + "local": 5, "projection": [] }, { - "Cast": [ - "IntToInt", + "BinaryOp": [ + "BitAnd", { "Move": { - "local": 6, + "local": 3, "projection": [] } }, - 16 + { + "Move": { + "local": 4, + "projection": [] + } + } ] } ] }, - "span": 24 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 25 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 + "span": 51 } ], "terminator": { - "kind": "Return", - "span": 20 + "kind": { + "Assert": { + "cond": { + "Move": { + "local": 5, + "projection": [] + } + }, + "expected": false, + "msg": { + "Overflow": [ + "Rem", + { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 42, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 50, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 10, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 52, + "user_ty": null + } + } + ] + }, + "target": 2, + "unwind": "Continue" + } + }, + "span": 51 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 28, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 3, - "ty": 11 - }, - { - "mutability": "Mut", - "span": 16, - "ty": 17 - }, - { - "mutability": "Mut", - "span": 15, - "ty": 1 - }, - { - "mutability": "Mut", - "span": 17, - "ty": 7 - }, - { - "mutability": "Mut", - "span": 22, - "ty": 18 }, { - "mutability": "Mut", - "span": 23, - "ty": 9 - } - ], - "span": 3, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": null, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 1, - "span": 29 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 2, - "span": 30 - }, - "value": { - "Place": { - "local": 5, - "projection": [] - } - } - } - ] - }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" - } - }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "Assign": [ { - "Move": { - "local": 1, - "projection": [] - } + "local": 1, + "projection": [] }, { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 + "BinaryOp": [ + "Rem", + { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 42, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 50, + "user_ty": null + } }, - "span": 32, - "user_ty": null - } + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 10, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 52, + "user_ty": null + } + } + ] } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 3, - "kind": "ZeroSized", - "ty": 19 - }, - "span": 31, - "user_ty": null + ] + }, + "span": 51 + } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 1, + "projection": [] } }, - "target": 1, - "unwind": "Continue" + "targets": { + "branches": [ + [ + 2, + 3 + ] + ], + "otherwise": 4 + } } }, - "span": 33 + "span": 53 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 54 } }, { @@ -873,9 +993,40 @@ { "Constant": { "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 + "id": 15, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 30, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 0 + ] + ] + } + } + }, + "ty": 26 }, "span": 32, "user_ty": null @@ -883,233 +1034,191 @@ } ], "destination": { - "local": 2, + "local": 6, "projection": [] }, "func": { "Constant": { "const_": { - "id": 5, + "id": 14, "kind": "ZeroSized", - "ty": 20 + "ty": 25 }, - "span": 34, + "span": 55, "user_ty": null } }, - "target": 2, - "unwind": "Unreachable" + "target": null, + "unwind": "Continue" } }, - "span": 35 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 36 + "span": 55 } } ], "locals": [ { "mutability": "Mut", - "span": 37, + "span": 56, "ty": 1 }, { - "mutability": "Not", - "span": 38, - "ty": 7 + "mutability": "Mut", + "span": 51, + "ty": 16 }, { - "mutability": "Not", - "span": 39, - "ty": 1 - } - ], - "span": 42, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "f", - "source_info": { - "scope": 0, - "span": 38 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "result", - "source_info": { - "scope": 1, - "span": 40 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } + "mutability": "Mut", + "span": 51, + "ty": 27 }, { - "argument_index": 1, - "composite": null, - "name": "dummy", - "source_info": { - "scope": 2, - "span": 41 - }, - "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } - } - } - ] - }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" - } - }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 21 - }, - "span": 43, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 43 - } + "mutability": "Mut", + "span": 51, + "ty": 27 }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ { "mutability": "Mut", - "span": 43, - "ty": 16 + "span": 51, + "ty": 27 }, { - "mutability": "Not", - "span": 43, - "ty": 22 + "mutability": "Mut", + "span": 51, + "ty": 27 }, { - "mutability": "Not", - "span": 43, - "ty": 1 + "mutability": "Mut", + "span": 55, + "ty": 28 } ], - "span": 43, - "spread_arg": 2, + "span": 57, + "spread_arg": null, "var_debug_info": [] }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + "id": 6, + "name": "main" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" + "symbol_name": "modulo::main::ha5c5b72dafef00b4" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 4, "blocks": [ { "statements": [ + { + "kind": { + "StorageLive": 5 + }, + "span": 1 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 + }, { "kind": { "Assign": [ { - "local": 3, + "local": 8, "projection": [] }, { - "Ref": [ + "Aggregate": [ { - "kind": "ReErased" + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] }, - { - "Mut": { - "kind": "Default" + [ + { + "Copy": { + "local": 1, + "projection": [] + } } + ] + ] + } + ] + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" }, + "Shared", { - "local": 1, + "local": 8, "projection": [] } ] } ] }, - "span": 43 + "span": 2 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Cast": [ + { + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, + "projection": [] + } + }, + 5 + ] + } + ] + }, + "span": 2 } ], "terminator": { @@ -1118,7 +1227,7 @@ "args": [ { "Move": { - "local": 3, + "local": 6, "projection": [] } }, @@ -1127,212 +1236,230 @@ "local": 2, "projection": [] } - } - ], - "destination": { - "local": 0, - "projection": [] + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] + } + } + ], + "destination": { + "local": 5, + "projection": [] }, "func": { "Constant": { "const_": { - "id": 7, + "id": 0, "kind": "ZeroSized", - "ty": 23 + "ty": 0 }, - "span": 43, + "span": 0, "user_ty": null } }, "target": 1, - "unwind": { - "Cleanup": 3 - } - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 2, "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 + "span": 1 } }, { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } + "statements": [ + { + "kind": { + "StorageDead": 6 + }, + "span": 5 }, - "span": 43 - } - }, - { - "statements": [], + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 + }, + { + "Field": [ + 0, + 6 + ] + } + ] + } + } + } + ] + }, + "span": 6 + }, + { + "kind": { + "StorageDead": 8 + }, + "span": 7 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 7 + } + ], "terminator": { - "kind": "Resume", - "span": 43 + "kind": "Return", + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 43, - "ty": 16 + "span": 8, + "ty": 6 }, { "mutability": "Not", - "span": 43, - "ty": 12 + "span": 9, + "ty": 7 }, { "mutability": "Not", - "span": 43, - "ty": 1 + "span": 10, + "ty": 6 }, { "mutability": "Not", - "span": 43, - "ty": 24 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ + "span": 11, + "ty": 8 + }, { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Move": { - "local": 1, - "projection": [] - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 43 - } + "mutability": "Not", + "span": 12, + "ty": 9 }, { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ + "mutability": "Mut", + "span": 1, + "ty": 10 + }, { "mutability": "Mut", - "span": 43, - "ty": 1 + "span": 2, + "ty": 5 }, { "mutability": "Not", - "span": 43, - "ty": 7 + "span": 2, + "ty": 11 }, { "mutability": "Not", - "span": 43, - "ty": 1 + "span": 3, + "ty": 12 } ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ + "span": 13, + "spread_arg": null, + "var_debug_info": [ { - "statements": [], - "terminator": { - "kind": "Return", - "span": 44 + "argument_index": 1, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } } - } - ], - "locals": [ + }, { - "mutability": "Mut", - "span": 44, - "ty": 1 + "argument_index": 2, + "composite": null, + "name": "argc", + "source_info": { + "scope": 0, + "span": 10 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } }, { - "mutability": "Not", - "span": 44, - "ty": 22 + "argument_index": 3, + "composite": null, + "name": "argv", + "source_info": { + "scope": 0, + "span": 11 + }, + "value": { + "Place": { + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] + ] }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" + "symbol_name": "std::rt::lang_start::h551aa0b0ac8bb68d" }, { "details": null, @@ -1343,543 +1470,409 @@ "blocks": [ { "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, { "kind": { "Assign": [ { - "local": 0, + "local": 4, "projection": [] }, { "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 46, - "user_ty": null + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] } } } ] }, - "span": 46 + "span": 17 } ], "terminator": { - "kind": "Return", - "span": 45 + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 4, + "projection": [] + } + } + ], + "destination": { + "local": 3, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 1, + "kind": "ZeroSized", + "ty": 13 + }, + "span": 14, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 15 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 47, - "ty": 17 }, { - "mutability": "Not", - "span": 48, - "ty": 1 - } - ], - "span": 49, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 0, - "span": 48 - }, - "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 + "statements": [ + { + "kind": { + "StorageDead": 4 }, - "span": 32, - "user_ty": null + "span": 19 } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 3, + "projection": [] + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 2, + "kind": "ZeroSized", + "ty": 14 + }, + "span": 18, + "user_ty": null + } + }, + "target": 2, + "unwind": "Continue" + } + }, + "span": 16 } - } - ] - }, - "id": 5, - "name": "<() as std::process::Termination>::report" - } - }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 0, - "blocks": [ + }, { "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, { "kind": { "Assign": [ { - "local": 2, + "local": 5, "projection": [] }, { - "BinaryOp": [ - "Eq", + "Ref": [ { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 10, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 52, - "user_ty": null - } + "kind": "ReErased" }, + "Shared", { - "Constant": { - "const_": { - "id": 11, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 51, - "user_ty": null - } + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] } ] } ] }, - "span": 51 - } - ], - "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 2, - "projection": [] - } - }, - "expected": false, - "msg": { - "RemainderByZero": { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 42, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 50, - "user_ty": null - } - } - }, - "target": 1, - "unwind": "Continue" - } + "span": 22 }, - "span": 51 - } - }, - { - "statements": [ { "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "BinaryOp": [ - "Eq", - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 10, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 52, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 12, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 255, - 255, - 255, - 255 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 51, - "user_ty": null - } - } - ] - } - ] + "StorageLive": 6 }, - "span": 51 + "span": 23 }, { "kind": { "Assign": [ { - "local": 4, + "local": 6, "projection": [] }, { - "BinaryOp": [ - "Eq", - { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 42, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 50, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 13, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 0, - 0, - 0, - 128 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] }, - "span": 51, - "user_ty": null - } + { + "Field": [ + 0, + 9 + ] + } + ] } - ] + } } ] }, - "span": 51 + "span": 23 }, { "kind": { "Assign": [ { - "local": 5, + "local": 0, "projection": [] }, { - "BinaryOp": [ - "BitAnd", + "Cast": [ + "IntToInt", { "Move": { - "local": 3, + "local": 6, "projection": [] } }, - { - "Move": { - "local": 4, - "projection": [] - } - } + 16 ] } ] }, - "span": 51 + "span": 24 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 } ], "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 5, - "projection": [] - } - }, - "expected": false, - "msg": { - "Overflow": [ - "Rem", - { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 42, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 50, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 10, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 52, - "user_ty": null - } - } + "kind": "Return", + "span": 20 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 28, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 3, + "ty": 11 + }, + { + "mutability": "Mut", + "span": 16, + "ty": 17 + }, + { + "mutability": "Mut", + "span": 15, + "ty": 1 + }, + { + "mutability": "Mut", + "span": 17, + "ty": 7 + }, + { + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 + } + ], + "span": 3, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": null, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 ] - }, - "target": 2, - "unwind": "Continue" - } - }, - "span": 51 + } + ] + } } }, { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 1, - "projection": [] + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 29 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } + } + ] + }, + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" + } + }, + "symbol_name": "std::rt::lang_start::{{closure}}::hb929cba43cae5f75" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 1, + "projection": [] + } }, { - "BinaryOp": [ - "Rem", - { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 42, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 50, - "user_ty": null - } + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 10, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 52, - "user_ty": null - } - } - ] + "span": 32, + "user_ty": null + } } - ] - }, - "span": 51 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 1, - "projection": [] + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 3, + "kind": "ZeroSized", + "ty": 19 + }, + "span": 31, + "user_ty": null } }, - "targets": { - "branches": [ - [ - 2, - 3 - ] - ], - "otherwise": 4 - } + "target": 1, + "unwind": "Continue" } }, - "span": 53 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 54 + "span": 33 } }, { @@ -1891,40 +1884,9 @@ { "Constant": { "const_": { - "id": 15, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 30, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 0 - ] - ] - } - } - }, - "ty": 26 + "id": 4, + "kind": "ZeroSized", + "ty": 1 }, "span": 32, "user_ty": null @@ -1932,74 +1894,112 @@ } ], "destination": { - "local": 6, + "local": 2, "projection": [] }, "func": { "Constant": { "const_": { - "id": 14, + "id": 5, "kind": "ZeroSized", - "ty": 25 + "ty": 20 }, - "span": 55, + "span": 34, "user_ty": null } }, - "target": null, - "unwind": "Continue" + "target": 2, + "unwind": "Unreachable" } }, - "span": 55 + "span": 35 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 56, + "span": 37, "ty": 1 }, { - "mutability": "Mut", - "span": 51, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 51, - "ty": 27 + "mutability": "Not", + "span": 38, + "ty": 7 }, { - "mutability": "Mut", - "span": 51, - "ty": 27 - }, + "mutability": "Not", + "span": 39, + "ty": 1 + } + ], + "span": 42, + "spread_arg": null, + "var_debug_info": [ { - "mutability": "Mut", - "span": 51, - "ty": 27 + "argument_index": 1, + "composite": null, + "name": "f", + "source_info": { + "scope": 0, + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } }, { - "mutability": "Mut", - "span": 51, - "ty": 27 + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 40 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } }, { - "mutability": "Mut", - "span": 55, - "ty": 28 + "argument_index": 1, + "composite": null, + "name": "dummy", + "source_info": { + "scope": 2, + "span": 41 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } } - ], - "span": 57, - "spread_arg": null, - "var_debug_info": [] + ] }, - "id": 6, - "name": "main" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN6modulo4main17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h22419fa5b3007a08" } ], "types": [ diff --git a/tests/integration/programs/mutual_recursion.smir.json.expected b/tests/integration/programs/mutual_recursion.smir.json.expected index df20f73..2863b4d 100644 --- a/tests/integration/programs/mutual_recursion.smir.json.expected +++ b/tests/integration/programs/mutual_recursion.smir.json.expected @@ -106,288 +106,167 @@ "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 0, + "arg_count": 1, "blocks": [ { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "Assign": [ { - "Constant": { - "const_": { - "id": 14, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 10, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 73, - "user_ty": null - } - } - ], - "destination": { - "local": 1, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 13, - "kind": "ZeroSized", - "ty": 29 - }, - "span": 72, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 74 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Copy": { - "local": 1, + "local": 0, "projection": [] - } - }, - "targets": { - "branches": [ - [ - 0, - 3 - ] - ], - "otherwise": 2 - } - } - }, - "span": 75 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 76 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + }, { - "Constant": { - "const_": { - "id": 16, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 29, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 0 - ] - ] + "Use": { + "Constant": { + "const_": { + "id": 8, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } } - } + }, + "ty": 17 }, - "ty": 31 - }, - "span": 32, - "user_ty": null + "span": 46, + "user_ty": null + } } } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 15, - "kind": "ZeroSized", - "ty": 30 - }, - "span": 77, - "user_ty": null - } - }, - "target": null, - "unwind": "Continue" - } - }, - "span": 77 + ] + }, + "span": 46 + } + ], + "terminator": { + "kind": "Return", + "span": 45 } } ], "locals": [ { "mutability": "Mut", - "span": 78, - "ty": 1 + "span": 47, + "ty": 17 }, { "mutability": "Not", - "span": 79, - "ty": 25 - }, - { - "mutability": "Mut", - "span": 77, - "ty": 32 + "span": 48, + "ty": 1 } ], - "span": 80, + "span": 49, "spread_arg": null, "var_debug_info": [ { - "argument_index": null, + "argument_index": 1, "composite": null, - "name": "ans", + "name": "self", "source_info": { - "scope": 1, - "span": 79 + "scope": 0, + "span": 48 }, "value": { - "Place": { - "local": 1, - "projection": [] + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null } } } ] }, - "id": 8, - "name": "main" + "id": 5, + "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "_ZN16mutual_recursion4main17h" + "symbol_name": "<() as std::process::Termination>::report::hb087d49f0e511144" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 2, "blocks": [ { "statements": [], "terminator": { "kind": { - "SwitchInt": { - "discr": { - "Copy": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { "local": 1, "projection": [] } }, - "targets": { - "branches": [ - [ - 0, - 1 - ] - ], - "otherwise": 2 - } + "target": 1, + "unwind": "Continue" } }, - "span": 61 + "span": 43 } }, { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 12, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 25 - }, - "span": 63, - "user_ty": null - } - } - } - ] - }, - "span": 63 - } - ], + "statements": [], "terminator": { - "kind": { - "Goto": { - "target": 4 - } - }, - "span": 62 + "kind": "Return", + "span": 43 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 1 + }, + { + "mutability": "Not", + "span": 43, + "ty": 7 }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": ">::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h9af5c3a5be898749" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { "statements": [ { @@ -398,139 +277,36 @@ "projection": [] }, { - "CheckedBinaryOp": [ - "Sub", + "Ref": [ { - "Copy": { - "local": 1, - "projection": [] - } + "kind": "ReErased" }, { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 64, - "user_ty": null + "Mut": { + "kind": "Default" } - } - ] - } - ] - }, - "span": 65 - } - ], - "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 3, - "projection": [ + }, { - "Field": [ - 1, - 25 - ] - } - ] - } - }, - "expected": false, - "msg": { - "Overflow": [ - "Sub", - { - "Copy": { "local": 1, "projection": [] } - }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 64, - "user_ty": null - } - } - ] - }, - "target": 3, - "unwind": "Continue" - } - }, - "span": 65 - } - }, - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 2, - "projection": [] - }, - { - "Use": { - "Move": { - "local": 3, - "projection": [ - { - "Field": [ - 0, - 26 - ] - } - ] - } - } + ] } ] }, - "span": 65 + "span": 43 } ], "terminator": { "kind": { "Call": { "args": [ + { + "Move": { + "local": 3, + "projection": [] + } + }, { "Move": { "local": 2, @@ -545,76 +321,223 @@ "func": { "Constant": { "const_": { - "id": 13, + "id": 7, "kind": "ZeroSized", - "ty": 29 + "ty": 23 }, - "span": 66, + "span": 43, "user_ty": null } }, - "target": 4, + "target": 1, + "unwind": { + "Cleanup": 3 + } + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, "unwind": "Continue" } }, - "span": 67 + "span": 43 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 68 + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Resume", + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 69, - "ty": 25 + "span": 43, + "ty": 16 }, { "mutability": "Not", - "span": 70, - "ty": 26 + "span": 43, + "ty": 12 }, { - "mutability": "Mut", - "span": 65, - "ty": 26 + "mutability": "Not", + "span": 43, + "ty": 1 + }, + { + "mutability": "Not", + "span": 43, + "ty": 24 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::ha78265c06a8e885f" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + } + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 6, + "kind": "ZeroSized", + "ty": 21 + }, + "span": 43, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 43 + } }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ { "mutability": "Mut", - "span": 65, - "ty": 28 + "span": 43, + "ty": 16 + }, + { + "mutability": "Not", + "span": 43, + "ty": 22 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 } ], - "span": 71, - "spread_arg": null, - "var_debug_info": [ + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hd09e8fedb1c94470" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ { - "argument_index": 1, - "composite": null, - "name": "n", - "source_info": { - "scope": 0, - "span": 70 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 } } - ] + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 + }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] }, - "id": 7, - "name": "is_odd" + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "_ZN16mutual_recursion6is_odd17h" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h3cef9f41f602ad83" }, { "details": null, @@ -921,290 +844,299 @@ "name": "is_even" } }, - "symbol_name": "_ZN16mutual_recursion7is_even17h" + "symbol_name": "mutual_recursion::is_even::hfe5f12c9fea0552e" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 1, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 + "statements": [], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Copy": { + "local": 1, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 1 + ] + ], + "otherwise": 2 + } + } }, + "span": 61 + } + }, + { + "statements": [ { "kind": { - "StorageLive": 8 + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 12, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 25 + }, + "span": 63, + "user_ty": null + } + } + } + ] }, - "span": 3 + "span": 63 + } + ], + "terminator": { + "kind": { + "Goto": { + "target": 4 + } }, + "span": 62 + } + }, + { + "statements": [ { "kind": { "Assign": [ { - "local": 8, + "local": 3, "projection": [] }, { - "Aggregate": [ + "CheckedBinaryOp": [ + "Sub", { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 - } - ] - ] + "Copy": { + "local": 1, + "projection": [] + } }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 64, + "user_ty": null } - ] + } ] } ] }, - "span": 3 - }, - { - "kind": { - "Assign": [ - { - "local": 7, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", + "span": 65 + } + ], + "terminator": { + "kind": { + "Assert": { + "cond": { + "Move": { + "local": 3, + "projection": [ { - "local": 8, - "projection": [] + "Field": [ + 1, + 25 + ] } ] } - ] - }, - "span": 2 + }, + "expected": false, + "msg": { + "Overflow": [ + "Sub", + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 64, + "user_ty": null + } + } + ] + }, + "target": 3, + "unwind": "Continue" + } }, + "span": 65 + } + }, + { + "statements": [ { "kind": { "Assign": [ { - "local": 6, + "local": 2, "projection": [] }, { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, - { - "Copy": { - "local": 7, - "projection": [] - } - }, - 5 - ] + "Use": { + "Move": { + "local": 3, + "projection": [ + { + "Field": [ + 0, + 26 + ] + } + ] + } + } } ] }, - "span": 2 + "span": 65 } ], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, { "Move": { "local": 2, "projection": [] } - }, - { - "Move": { - "local": 3, - "projection": [] - } - }, - { - "Move": { - "local": 4, - "projection": [] - } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 13, "kind": "ZeroSized", - "ty": 0 + "ty": 29 }, - "span": 0, + "span": 66, "user_ty": null } }, - "target": 1, + "target": 4, "unwind": "Continue" } }, - "span": 1 + "span": 67 } }, { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 5 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 - } - ], + "statements": [], "terminator": { "kind": "Return", - "span": 4 + "span": 68 } } ], "locals": [ { "mutability": "Mut", - "span": 8, - "ty": 6 - }, - { - "mutability": "Not", - "span": 9, - "ty": 7 - }, - { - "mutability": "Not", - "span": 10, - "ty": 6 + "span": 69, + "ty": 25 }, { "mutability": "Not", - "span": 11, - "ty": 8 + "span": 70, + "ty": 26 }, { - "mutability": "Not", - "span": 12, - "ty": 9 + "mutability": "Mut", + "span": 65, + "ty": 26 }, { "mutability": "Mut", - "span": 1, - "ty": 10 - }, - { - "mutability": "Mut", - "span": 2, - "ty": 5 - }, - { - "mutability": "Not", - "span": 2, - "ty": 11 - }, - { - "mutability": "Not", - "span": 3, - "ty": 12 + "span": 65, + "ty": 28 } ], - "span": 13, + "span": 71, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "main", + "name": "n", "source_info": { "scope": 0, - "span": 9 + "span": 70 }, "value": { "Place": { @@ -1212,153 +1144,66 @@ "projection": [] } } - }, - { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - }, - { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } } ] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 7, + "name": "is_odd" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "mutual_recursion::is_odd::h0306caf7bd636f15" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 0, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 16 - }, - { - "kind": { - "StorageLive": 3 - }, - "span": 15 - }, - { - "kind": { - "StorageLive": 4 - }, - "span": 17 - }, - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - } - ] - }, - "span": 17 - } - ], + "statements": [], "terminator": { "kind": { "Call": { "args": [ { - "Move": { - "local": 4, - "projection": [] + "Constant": { + "const_": { + "id": 14, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 10, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 73, + "user_ty": null } } ], "destination": { - "local": 3, + "local": 1, "projection": [] }, "func": { "Constant": { "const_": { - "id": 1, + "id": 13, "kind": "ZeroSized", - "ty": 13 + "ty": 29 }, - "span": 14, + "span": 72, "user_ty": null } }, @@ -1366,26 +1211,87 @@ "unwind": "Continue" } }, - "span": 15 + "span": 74 } }, { - "statements": [ - { - "kind": { - "StorageDead": 4 - }, - "span": 19 - } - ], + "statements": [], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Copy": { + "local": 1, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 3 + ] + ], + "otherwise": 2 + } + } + }, + "span": 75 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 76 + } + }, + { + "statements": [], "terminator": { "kind": { "Call": { "args": [ { - "Move": { - "local": 3, - "projection": [] + "Constant": { + "const_": { + "id": 16, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 29, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 0 + ] + ] + } + } + }, + "ty": 31 + }, + "span": 32, + "user_ty": null } } ], @@ -1396,193 +1302,342 @@ "func": { "Constant": { "const_": { - "id": 2, + "id": 15, "kind": "ZeroSized", - "ty": 14 + "ty": 30 }, - "span": 18, + "span": 77, "user_ty": null } }, - "target": 2, + "target": null, "unwind": "Continue" } }, - "span": 16 + "span": 77 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 78, + "ty": 1 }, + { + "mutability": "Not", + "span": 79, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 77, + "ty": 32 + } + ], + "span": 80, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": null, + "composite": null, + "name": "ans", + "source_info": { + "scope": 1, + "span": 79 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + } + ] + }, + "id": 8, + "name": "main" + } + }, + "symbol_name": "mutual_recursion::main::h313f0c99534e377b" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 4, + "blocks": [ { "statements": [ { "kind": { - "StorageDead": 3 + "StorageLive": 5 }, - "span": 21 + "span": 1 }, { "kind": { - "StorageLive": 5 + "StorageLive": 6 }, - "span": 22 + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 }, { "kind": { "Assign": [ { - "local": 5, + "local": 8, "projection": [] }, { - "Ref": [ + "Aggregate": [ { - "kind": "ReErased" + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] }, - "Shared", - { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] + [ + { + "Copy": { + "local": 1, + "projection": [] } - ] - } + } + ] ] } ] }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 + "span": 3 }, { "kind": { "Assign": [ { - "local": 6, + "local": 7, "projection": [] }, { - "Use": { - "Copy": { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - }, - { - "Field": [ - 0, - 9 - ] - } - ] + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] } - } + ] } ] }, - "span": 23 + "span": 2 }, { "kind": { "Assign": [ { - "local": 0, + "local": 6, "projection": [] }, { "Cast": [ - "IntToInt", { - "Move": { - "local": 6, + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, "projection": [] } }, - 16 + 5 ] } ] }, - "span": 24 + "span": 2 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 6, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] + } + } + ], + "destination": { + "local": 5, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 0, + "kind": "ZeroSized", + "ty": 0 + }, + "span": 0, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } }, + "span": 1 + } + }, + { + "statements": [ { "kind": { "StorageDead": 6 }, - "span": 25 + "span": 5 }, { "kind": { - "StorageDead": 5 + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 + }, + { + "Field": [ + 0, + 6 + ] + } + ] + } + } + } + ] }, - "span": 26 + "span": 6 }, { "kind": { - "StorageDead": 2 + "StorageDead": 8 }, - "span": 27 - } - ], - "terminator": { - "kind": "Return", - "span": 20 + "span": 7 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 7 + } + ], + "terminator": { + "kind": "Return", + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 28, - "ty": 16 + "span": 8, + "ty": 6 }, { - "mutability": "Mut", - "span": 3, - "ty": 11 + "mutability": "Not", + "span": 9, + "ty": 7 }, { - "mutability": "Mut", - "span": 16, - "ty": 17 + "mutability": "Not", + "span": 10, + "ty": 6 }, { - "mutability": "Mut", - "span": 15, - "ty": 1 + "mutability": "Not", + "span": 11, + "ty": 8 }, { - "mutability": "Mut", - "span": 17, - "ty": 7 + "mutability": "Not", + "span": 12, + "ty": 9 }, { "mutability": "Mut", - "span": 22, - "ty": 18 + "span": 1, + "ty": 10 }, { "mutability": "Mut", - "span": 23, - "ty": 9 + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 } ], - "span": 3, + "span": 13, "spread_arg": null, "var_debug_info": [ { - "argument_index": null, + "argument_index": 1, "composite": null, "name": "main", "source_info": { @@ -1592,25 +1647,17 @@ "value": { "Place": { "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] + "projection": [] } } }, { - "argument_index": 1, + "argument_index": 2, "composite": null, - "name": "self", + "name": "argc", "source_info": { - "scope": 1, - "span": 29 + "scope": 0, + "span": 10 }, "value": { "Place": { @@ -1620,27 +1667,57 @@ } }, { - "argument_index": 1, + "argument_index": 3, "composite": null, - "name": "self", + "name": "argv", "source_info": { - "scope": 2, - "span": 30 + "scope": 0, + "span": 11 }, "value": { "Place": { - "local": 5, + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, "projection": [] } } } ] }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "symbol_name": "std::rt::lang_start::h82ae6e6ca1c57c00" }, { "details": null, @@ -1650,41 +1727,76 @@ "arg_count": 1, "blocks": [ { - "statements": [], + "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + } + ] + }, + "span": 17 + } + ], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, + "local": 4, "projection": [] } - }, - { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } } ], "destination": { - "local": 0, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 3, + "id": 1, "kind": "ZeroSized", - "ty": 19 + "ty": 13 }, - "span": 31, + "span": 14, "user_ty": null } }, @@ -1692,24 +1804,26 @@ "unwind": "Continue" } }, - "span": 33 + "span": 15 } }, { - "statements": [], + "statements": [ + { + "kind": { + "StorageDead": 4 + }, + "span": 19 + } + ], "terminator": { "kind": { "Call": { "args": [ { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 3, + "projection": [] } } ], @@ -1720,308 +1834,280 @@ "func": { "Constant": { "const_": { - "id": 5, + "id": 2, "kind": "ZeroSized", - "ty": 20 + "ty": 14 }, - "span": 34, + "span": 18, "user_ty": null } }, "target": 2, - "unwind": "Unreachable" + "unwind": "Continue" } }, - "span": 35 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 36 + "span": 16 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 37, - "ty": 1 }, { - "mutability": "Not", - "span": 38, - "ty": 7 - }, - { - "mutability": "Not", - "span": 39, - "ty": 1 - } - ], - "span": 42, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "f", - "source_info": { - "scope": 0, - "span": 38 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "result", - "source_info": { - "scope": 1, - "span": 40 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "dummy", - "source_info": { - "scope": 2, - "span": 41 - }, - "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 + "statements": [ + { + "kind": { + "StorageDead": 3 }, - "span": 32, - "user_ty": null - } - } - } - ] - }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" - } - }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, + { + "kind": { + "Assign": [ { - "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } + "local": 5, + "projection": [] }, { - "Move": { - "local": 2, - "projection": [] + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] + } + ] + } + ] + }, + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + }, + { + "Field": [ + 0, + 9 + ] + } + ] + } } } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 21 - }, - "span": 43, - "user_ty": null + ] + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] } - }, - "target": 1, - "unwind": "Continue" - } + ] + }, + "span": 24 }, - "span": 43 - } - }, - { - "statements": [], + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 + } + ], "terminator": { "kind": "Return", - "span": 43 + "span": 20 } } ], "locals": [ { "mutability": "Mut", - "span": 43, + "span": 28, "ty": 16 }, { - "mutability": "Not", - "span": 43, - "ty": 22 + "mutability": "Mut", + "span": 3, + "ty": 11 }, { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Move": { - "local": 1, - "projection": [] - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 43 - } + "mutability": "Mut", + "span": 16, + "ty": 17 }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ { "mutability": "Mut", - "span": 43, + "span": 15, "ty": 1 }, { - "mutability": "Not", - "span": 43, + "mutability": "Mut", + "span": 17, "ty": 7 }, { - "mutability": "Not", - "span": 43, - "ty": 1 + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 } ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ + "span": 3, + "spread_arg": null, + "var_debug_info": [ { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - { - "Mut": { - "kind": "Default" - } - }, - { - "local": 1, - "projection": [] - } - ] - } - ] - }, - "span": 43 + "argument_index": null, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] } - ], + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 29 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } + } + ] + }, + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" + } + }, + "symbol_name": "std::rt::lang_start::{{closure}}::hf951a2d0e8784ca7" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 3, + "local": 1, "projection": [] } }, { - "Move": { - "local": 2, - "projection": [] + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null } } ], @@ -2032,212 +2118,126 @@ "func": { "Constant": { "const_": { - "id": 7, + "id": 3, "kind": "ZeroSized", - "ty": 23 + "ty": 19 }, - "span": 43, + "span": 31, "user_ty": null } }, "target": 1, - "unwind": { - "Cleanup": 3 - } + "unwind": "Continue" } }, - "span": 43 + "span": 33 } }, { "statements": [], "terminator": { "kind": { - "Drop": { - "place": { - "local": 1, + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 2, "projection": [] }, + "func": { + "Constant": { + "const_": { + "id": 5, + "kind": "ZeroSized", + "ty": 20 + }, + "span": 34, + "user_ty": null + } + }, "target": 2, - "unwind": "Continue" + "unwind": "Unreachable" } }, - "span": 43 + "span": 35 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Resume", - "span": 43 + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 43, - "ty": 16 + "span": 37, + "ty": 1 }, { "mutability": "Not", - "span": 43, - "ty": 12 + "span": 38, + "ty": 7 }, { "mutability": "Not", - "span": 43, + "span": 39, "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 24 } ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ + "span": 42, + "spread_arg": null, + "var_debug_info": [ { - "statements": [], - "terminator": { - "kind": "Return", - "span": 44 + "argument_index": 1, + "composite": null, + "name": "f", + "source_info": { + "scope": 0, + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 44, - "ty": 1 }, { - "mutability": "Not", - "span": 44, - "ty": 22 - } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] - }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" - } - }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 46, - "user_ty": null - } - } - } - ] - }, - "span": 46 + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 40 + }, + "value": { + "Place": { + "local": 0, + "projection": [] } - ], - "terminator": { - "kind": "Return", - "span": 45 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 47, - "ty": 17 }, - { - "mutability": "Not", - "span": 48, - "ty": 1 - } - ], - "span": 49, - "spread_arg": null, - "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "self", + "name": "dummy", "source_info": { - "scope": 0, - "span": 48 + "scope": 2, + "span": 41 }, "value": { "Const": { @@ -2253,11 +2253,11 @@ } ] }, - "id": 5, - "name": "<() as std::process::Termination>::report" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h07ef4c1b0bc2cdbd" } ], "types": [ diff --git a/tests/integration/programs/option-construction.smir.json.expected b/tests/integration/programs/option-construction.smir.json.expected index e98e649..d0f148c 100644 --- a/tests/integration/programs/option-construction.smir.json.expected +++ b/tests/integration/programs/option-construction.smir.json.expected @@ -58,7 +58,7 @@ "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 0, + "arg_count": 1, "blocks": [ { "statements": [ @@ -66,280 +66,166 @@ "kind": { "Assign": [ { - "local": 1, - "projection": [] - }, - { - "Aggregate": [ - { - "Adt": [ - 8, - 1, - [ - { - "Type": 26 - } - ], - null, - null - ] - }, - [ - { - "Constant": { - "const_": { - "id": 11, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 42, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 62, - "user_ty": null - } - } - ] - ] - } - ] - }, - "span": 63 - }, - { - "kind": { - "Assign": [ - { - "local": 2, + "local": 0, "projection": [] }, { - "Aggregate": [ - { - "Adt": [ - 8, - 0, - [ - { - "Type": 26 + "Use": { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } } - ], - null, - null - ] - }, - [] - ] + }, + "ty": 17 + }, + "span": 56, + "user_ty": null + } + } } ] }, - "span": 64 + "span": 56 } ], + "terminator": { + "kind": "Return", + "span": 55 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 57, + "ty": 17 + }, + { + "mutability": "Not", + "span": 58, + "ty": 1 + } + ], + "span": 59, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 58 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 6, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::ha795d5993af4fda9" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [], "terminator": { "kind": { "Call": { - "args": [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ], + "args": [], "destination": { - "local": 3, + "local": 0, "projection": [] }, "func": { - "Constant": { - "const_": { - "id": 10, - "kind": "ZeroSized", - "ty": 29 - }, - "span": 60, - "user_ty": null + "Move": { + "local": 1, + "projection": [] } }, "target": 1, "unwind": "Continue" } }, - "span": 61 + "span": 43 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 65 + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 66, + "span": 43, "ty": 1 }, { "mutability": "Not", - "span": 67, - "ty": 27 - }, - { - "mutability": "Not", - "span": 68, - "ty": 27 + "span": 43, + "ty": 7 }, { "mutability": "Not", - "span": 69, - "ty": 26 + "span": 43, + "ty": 1 } ], - "span": 70, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": null, - "composite": null, - "name": "a", - "source_info": { - "scope": 1, - "span": 67 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "b", - "source_info": { - "scope": 2, - "span": 68 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "c", - "source_info": { - "scope": 3, - "span": 69 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - } - ] + "span": 43, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 7, - "name": "main" + "id": 3, + "name": ">::call_once" } }, - "symbol_name": "_ZN19option_construction4main17h" + "symbol_name": "core::ops::function::FnOnce::call_once::ha4f084d24449852a" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 2, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, - { - "kind": { - "Assign": [ - { - "local": 8, - "projection": [] - }, - { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 - } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] - } - ] - }, - "span": 3 - }, { "kind": { "Assign": [ { - "local": 7, + "local": 3, "projection": [] }, { @@ -347,59 +233,26 @@ { "kind": "ReErased" }, - "Shared", - { - "local": 8, - "projection": [] - } - ] - } - ] - }, - "span": 2 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, { - "Copy": { - "local": 7, - "projection": [] + "Mut": { + "kind": "Default" } }, - 5 + { + "local": 1, + "projection": [] + } ] } ] }, - "span": 2 + "span": 43 } ], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, { "Move": { "local": 3, @@ -408,221 +261,198 @@ }, { "Move": { - "local": 4, + "local": 2, "projection": [] } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 7, "kind": "ZeroSized", - "ty": 0 + "ty": 23 }, - "span": 0, + "span": 43, "user_ty": null } }, "target": 1, - "unwind": "Continue" + "unwind": { + "Cleanup": 3 + } } }, - "span": 1 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 5 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 - } - ], + "statements": [], "terminator": { - "kind": "Return", - "span": 4 + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, + "unwind": "Continue" + } + }, + "span": 43 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 8, - "ty": 6 }, { - "mutability": "Not", - "span": 9, - "ty": 7 - }, - { - "mutability": "Not", - "span": 10, - "ty": 6 + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } }, { - "mutability": "Not", - "span": 11, - "ty": 8 + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } + }, + "span": 43 + } }, { - "mutability": "Not", - "span": 12, - "ty": 9 - }, + "statements": [], + "terminator": { + "kind": "Resume", + "span": 43 + } + } + ], + "locals": [ { "mutability": "Mut", - "span": 1, - "ty": 10 + "span": 43, + "ty": 16 }, { - "mutability": "Mut", - "span": 2, - "ty": 5 + "mutability": "Not", + "span": 43, + "ty": 12 }, { "mutability": "Not", - "span": 2, - "ty": 11 + "span": 43, + "ty": 1 }, { "mutability": "Not", - "span": 3, - "ty": 12 + "span": 43, + "ty": 24 } ], - "span": 13, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::he839f8300ff4cb81" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + } + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 6, + "kind": "ZeroSized", + "ty": 21 + }, + "span": 43, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 43 } }, { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 16 }, { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } + "mutability": "Not", + "span": 43, + "ty": 22 }, { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } + "mutability": "Not", + "span": 43, + "ty": 1 } - ] + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h41ecae3d037041d3" }, { "details": null, @@ -633,63 +463,64 @@ "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 16 - }, - { - "kind": { - "StorageLive": 3 - }, - "span": 15 - }, - { - "kind": { - "StorageLive": 4 - }, - "span": 17 - }, { "kind": { "Assign": [ { - "local": 4, + "local": 2, "projection": [] }, { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } + "Discriminant": { + "local": 1, + "projection": [] } } ] }, - "span": 17 + "span": 46 } ], "terminator": { "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 4, - "projection": [] - } + "SwitchInt": { + "discr": { + "Move": { + "local": 2, + "projection": [] } - ], + }, + "targets": { + "branches": [ + [ + 0, + 2 + ], + [ + 1, + 3 + ] + ], + "otherwise": 1 + } + } + }, + "span": 45 + } + }, + { + "statements": [], + "terminator": { + "kind": "Unreachable", + "span": 46 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], "destination": { "local": 3, "projection": [] @@ -697,135 +528,42 @@ "func": { "Constant": { "const_": { - "id": 1, + "id": 8, "kind": "ZeroSized", - "ty": 13 + "ty": 25 }, - "span": 14, + "span": 47, "user_ty": null } }, - "target": 1, + "target": null, "unwind": "Continue" } }, - "span": 15 + "span": 48 } }, { "statements": [ { "kind": { - "StorageDead": 4 - }, - "span": 19 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ + "Assign": [ { - "Move": { - "local": 3, - "projection": [] - } - } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 2, - "kind": "ZeroSized", - "ty": 14 - }, - "span": 18, - "user_ty": null - } - }, - "target": 2, - "unwind": "Continue" - } - }, - "span": 16 - } - }, - { - "statements": [ - { - "kind": { - "StorageDead": 3 - }, - "span": 21 - }, - { - "kind": { - "StorageLive": 5 - }, - "span": 22 - }, - { - "kind": { - "Assign": [ - { - "local": 5, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - } - ] - } - ] - } - ] - }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 - }, - { - "kind": { - "Assign": [ - { - "local": 6, + "local": 0, "projection": [] }, { "Use": { - "Copy": { - "local": 2, + "Move": { + "local": 1, "projection": [ { - "Field": [ - 0, - 15 - ] + "Downcast": 1 }, { "Field": [ 0, - 9 + 26 ] } ] @@ -834,156 +572,77 @@ } ] }, - "span": 23 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Cast": [ - "IntToInt", - { - "Move": { - "local": 6, - "projection": [] - } - }, - 16 - ] - } - ] - }, - "span": 24 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 25 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 + "span": 50 } ], "terminator": { "kind": "Return", - "span": 20 + "span": 49 } } ], "locals": [ { "mutability": "Mut", - "span": 28, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 3, - "ty": 11 - }, - { - "mutability": "Mut", - "span": 16, - "ty": 17 - }, - { - "mutability": "Mut", - "span": 15, - "ty": 1 + "span": 51, + "ty": 26 }, { - "mutability": "Mut", - "span": 17, - "ty": 7 + "mutability": "Not", + "span": 52, + "ty": 27 }, { "mutability": "Mut", - "span": 22, - "ty": 18 + "span": 53, + "ty": 6 }, { "mutability": "Mut", - "span": 23, - "ty": 9 + "span": 48, + "ty": 28 } ], - "span": 3, + "span": 54, "spread_arg": null, "var_debug_info": [ - { - "argument_index": null, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - }, { "argument_index": 1, "composite": null, "name": "self", "source_info": { - "scope": 1, - "span": 29 + "scope": 0, + "span": 52 }, "value": { "Place": { - "local": 2, + "local": 1, "projection": [] } } }, { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "self", + "name": "val", "source_info": { - "scope": 2, - "span": 30 + "scope": 1, + "span": 50 }, "value": { "Place": { - "local": 5, + "local": 0, "projection": [] } } } ] }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" + "id": 5, + "name": "std::option::Option::::unwrap" } }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "symbol_name": "core::option::Option::unwrap::h38fc66650d49cffd" }, { "details": null, @@ -995,124 +654,200 @@ { "statements": [], "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 1, - "projection": [] - } - }, - { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } - } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 3, - "kind": "ZeroSized", - "ty": 19 - }, - "span": 31, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 33 + "kind": "Return", + "span": 44 } - }, - { - "statements": [], + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 + }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h832f1e7b37cc2be3" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 0, + "blocks": [ + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 1, + "projection": [] + }, + { + "Aggregate": [ + { + "Adt": [ + 8, + 1, + [ + { + "Type": 26 + } + ], + null, + null + ] + }, + [ + { + "Constant": { + "const_": { + "id": 11, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 42, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 62, + "user_ty": null + } + } + ] + ] + } + ] + }, + "span": 63 + }, + { + "kind": { + "Assign": [ + { + "local": 2, + "projection": [] + }, + { + "Aggregate": [ + { + "Adt": [ + 8, + 0, + [ + { + "Type": 26 + } + ], + null, + null + ] + }, + [] + ] + } + ] + }, + "span": 64 + } + ], "terminator": { "kind": { "Call": { "args": [ { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Copy": { + "local": 1, + "projection": [] } } ], "destination": { - "local": 2, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 5, + "id": 10, "kind": "ZeroSized", - "ty": 20 + "ty": 29 }, - "span": 34, + "span": 60, "user_ty": null } }, - "target": 2, - "unwind": "Unreachable" + "target": 1, + "unwind": "Continue" } }, - "span": 35 + "span": 61 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 36 + "span": 65 } } ], "locals": [ { "mutability": "Mut", - "span": 37, + "span": 66, "ty": 1 }, { "mutability": "Not", - "span": 38, - "ty": 7 + "span": 67, + "ty": 27 }, { "mutability": "Not", - "span": 39, - "ty": 1 + "span": 68, + "ty": 27 + }, + { + "mutability": "Not", + "span": 69, + "ty": 26 } ], - "span": 42, + "span": 70, "spread_arg": null, "var_debug_info": [ { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "f", + "name": "a", "source_info": { - "scope": 0, - "span": 38 + "scope": 1, + "span": 67 }, "value": { "Place": { @@ -1124,231 +859,157 @@ { "argument_index": null, "composite": null, - "name": "result", + "name": "b", "source_info": { - "scope": 1, - "span": 40 + "scope": 2, + "span": 68 }, "value": { "Place": { - "local": 0, + "local": 2, "projection": [] } } }, { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "dummy", + "name": "c", "source_info": { - "scope": 2, - "span": 41 + "scope": 3, + "span": 69 }, "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Place": { + "local": 3, + "projection": [] } } } ] }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" + "id": 7, + "name": "main" } }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "symbol_name": "option_construction::main::h6de1823d79c69627" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 4, "blocks": [ { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "StorageLive": 5 + }, + "span": 1 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 + }, + { + "kind": { + "Assign": [ { - "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } + "local": 8, + "projection": [] }, { - "Move": { - "local": 2, - "projection": [] - } - } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 21 - }, - "span": 43, - "user_ty": null + "Aggregate": [ + { + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] + }, + [ + { + "Copy": { + "local": 1, + "projection": [] + } + } + ] + ] } - }, - "target": 1, - "unwind": "Continue" - } + ] + }, + "span": 3 }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 22 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Move": { - "local": 1, + { + "kind": { + "Assign": [ + { + "local": 7, "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] + } + ] } - }, - "target": 1, - "unwind": "Continue" - } + ] + }, + "span": 2 }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 7 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [ { "kind": { "Assign": [ { - "local": 3, + "local": 6, "projection": [] }, { - "Ref": [ + "Cast": [ { - "kind": "ReErased" + "PointerCoercion": "Unsize" }, { - "Mut": { - "kind": "Default" + "Copy": { + "local": 7, + "projection": [] } }, - { - "local": 1, - "projection": [] - } + 5 ] } ] }, - "span": 43 + "span": 2 } ], "terminator": { @@ -1357,7 +1018,7 @@ "args": [ { "Move": { - "local": 3, + "local": 6, "projection": [] } }, @@ -1366,110 +1027,230 @@ "local": 2, "projection": [] } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] + } } ], "destination": { - "local": 0, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 7, + "id": 0, "kind": "ZeroSized", - "ty": 23 + "ty": 0 }, - "span": 43, + "span": 0, "user_ty": null } }, "target": 1, - "unwind": { - "Cleanup": 3 - } - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 2, "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 + "span": 1 } }, { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } + "statements": [ + { + "kind": { + "StorageDead": 6 + }, + "span": 5 }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Resume", - "span": 43 + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 + }, + { + "Field": [ + 0, + 6 + ] + } + ] + } + } + } + ] + }, + "span": 6 + }, + { + "kind": { + "StorageDead": 8 + }, + "span": 7 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 7 + } + ], + "terminator": { + "kind": "Return", + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 43, - "ty": 16 + "span": 8, + "ty": 6 }, { "mutability": "Not", - "span": 43, - "ty": 12 + "span": 9, + "ty": 7 }, { "mutability": "Not", - "span": 43, - "ty": 1 + "span": 10, + "ty": 6 }, { "mutability": "Not", - "span": 43, - "ty": 24 + "span": 11, + "ty": 8 + }, + { + "mutability": "Not", + "span": 12, + "ty": 9 + }, + { + "mutability": "Mut", + "span": 1, + "ty": 10 + }, + { + "mutability": "Mut", + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 } ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] + "span": 13, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "argc", + "source_info": { + "scope": 0, + "span": 10 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 3, + "composite": null, + "name": "argv", + "source_info": { + "scope": 0, + "span": 11 + }, + "value": { + "Place": { + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + } + ] }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" + "symbol_name": "std::rt::lang_start::h58b6137fadd7cc0f" }, { "details": null, @@ -1479,34 +1260,358 @@ "arg_count": 1, "blocks": [ { - "statements": [], + "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + } + ] + }, + "span": 17 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 4, + "projection": [] + } + } + ], + "destination": { + "local": 3, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 1, + "kind": "ZeroSized", + "ty": 13 + }, + "span": 14, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 15 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 4 + }, + "span": 19 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 3, + "projection": [] + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 2, + "kind": "ZeroSized", + "ty": 14 + }, + "span": 18, + "user_ty": null + } + }, + "target": 2, + "unwind": "Continue" + } + }, + "span": 16 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] + } + ] + } + ] + }, + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + }, + { + "Field": [ + 0, + 9 + ] + } + ] + } + } + } + ] + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] + } + ] + }, + "span": 24 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 + } + ], "terminator": { "kind": "Return", - "span": 44 + "span": 20 } } ], "locals": [ { "mutability": "Mut", - "span": 44, + "span": 28, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 3, + "ty": 11 + }, + { + "mutability": "Mut", + "span": 16, + "ty": 17 + }, + { + "mutability": "Mut", + "span": 15, "ty": 1 }, { - "mutability": "Not", - "span": 44, - "ty": 22 + "mutability": "Mut", + "span": 17, + "ty": 7 + }, + { + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 } ], - "span": 44, + "span": 3, "spread_arg": null, - "var_debug_info": [] + "var_debug_info": [ + { + "argument_index": null, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 29 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } + } + ] }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" + "symbol_name": "std::rt::lang_start::{{closure}}::hca62f3c0fe0902ad" }, { "details": null, @@ -1516,57 +1621,49 @@ "arg_count": 1, "blocks": [ { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 2, - "projection": [] - }, + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ { - "Discriminant": { + "Move": { "local": 1, "projection": [] } + }, + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } } - ] - }, - "span": 46 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 2, - "projection": [] + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 3, + "kind": "ZeroSized", + "ty": 19 + }, + "span": 31, + "user_ty": null } }, - "targets": { - "branches": [ - [ - 0, - 2 - ], - [ - 1, - 3 - ] - ], - "otherwise": 1 - } + "target": 1, + "unwind": "Continue" } }, - "span": 45 - } - }, - { - "statements": [], - "terminator": { - "kind": "Unreachable", - "span": 46 + "span": 33 } }, { @@ -1574,99 +1671,76 @@ "terminator": { "kind": { "Call": { - "args": [], + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], "destination": { - "local": 3, + "local": 2, "projection": [] }, "func": { "Constant": { "const_": { - "id": 8, + "id": 5, "kind": "ZeroSized", - "ty": 25 + "ty": 20 }, - "span": 47, + "span": 34, "user_ty": null } }, - "target": null, - "unwind": "Continue" + "target": 2, + "unwind": "Unreachable" } }, - "span": 48 + "span": 35 } }, { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Move": { - "local": 1, - "projection": [ - { - "Downcast": 1 - }, - { - "Field": [ - 0, - 26 - ] - } - ] - } - } - } - ] - }, - "span": 50 - } - ], + "statements": [], "terminator": { "kind": "Return", - "span": 49 + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 51, - "ty": 26 + "span": 37, + "ty": 1 }, { "mutability": "Not", - "span": 52, - "ty": 27 - }, - { - "mutability": "Mut", - "span": 53, - "ty": 6 + "span": 38, + "ty": 7 }, { - "mutability": "Mut", - "span": 48, - "ty": 28 + "mutability": "Not", + "span": 39, + "ty": 1 } ], - "span": 54, + "span": 42, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "self", + "name": "f", "source_info": { "scope": 0, - "span": 52 + "span": 38 }, "value": { "Place": { @@ -1678,10 +1752,10 @@ { "argument_index": null, "composite": null, - "name": "val", + "name": "result", "source_info": { "scope": 1, - "span": 50 + "span": 40 }, "value": { "Place": { @@ -1689,88 +1763,14 @@ "projection": [] } } - } - ] - }, - "id": 5, - "name": "std::option::Option::::unwrap" - } - }, - "symbol_name": "_ZN4core6option15Option$LT$T$GT$6unwrap17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 56, - "user_ty": null - } - } - } - ] - }, - "span": 56 - } - ], - "terminator": { - "kind": "Return", - "span": 55 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 57, - "ty": 17 }, - { - "mutability": "Not", - "span": 58, - "ty": 1 - } - ], - "span": 59, - "spread_arg": null, - "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "self", + "name": "dummy", "source_info": { - "scope": 0, - "span": 58 + "scope": 2, + "span": 41 }, "value": { "Const": { @@ -1786,11 +1786,11 @@ } ] }, - "id": 6, - "name": "<() as std::process::Termination>::report" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::ha0c968296550067c" } ], "types": [ diff --git a/tests/integration/programs/primitive-type-bounds.smir.json.expected b/tests/integration/programs/primitive-type-bounds.smir.json.expected index 075952e..a2ebd26 100644 --- a/tests/integration/programs/primitive-type-bounds.smir.json.expected +++ b/tests/integration/programs/primitive-type-bounds.smir.json.expected @@ -91,7 +91,7 @@ "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 0, + "arg_count": 1, "blocks": [ { "statements": [ @@ -99,196 +99,19 @@ "kind": { "Assign": [ { - "local": 2, - "projection": [] - }, - { - "CheckedBinaryOp": [ - "Add", - { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 254, - 255, - 255, - 255 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 50, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 51, - "user_ty": null - } - } - ] - } - ] - }, - "span": 52 - } - ], - "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 2, - "projection": [ - { - "Field": [ - 1, - 25 - ] - } - ] - } - }, - "expected": false, - "msg": { - "Overflow": [ - "Add", - { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 254, - 255, - 255, - 255 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 50, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 51, - "user_ty": null - } - } - ] - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 52 - } - }, - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 1, - "projection": [] - }, - { - "Use": { - "Move": { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 26 - ] - } - ] - } - } - } - ] - }, - "span": 52 - }, - { - "kind": { - "Assign": [ - { - "local": 4, + "local": 0, "projection": [] }, { "Use": { "Constant": { "const_": { - "id": 11, + "id": 8, "kind": { "Allocated": { - "align": 4, + "align": 1, "bytes": [ - 255, - 255, - 255, - 255 + 0 ], "mutability": "Mut", "provenance": { @@ -296,314 +119,81 @@ } } }, - "ty": 26 + "ty": 17 }, - "span": 54, + "span": 46, "user_ty": null } } } ] }, - "span": 55 - }, - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "BinaryOp": [ - "Eq", - { - "Move": { - "local": 4, - "projection": [] - } - }, - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - } - ] - }, - "span": 53 + "span": 46 } ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 3, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 0, - 3 - ] - ], - "otherwise": 2 - } - } - }, - "span": 53 - } - }, - { - "statements": [], "terminator": { "kind": "Return", - "span": 56 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Constant": { - "const_": { - "id": 13, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 24, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 0 - ] - ] - } - } - }, - "ty": 28 - }, - "span": 32, - "user_ty": null - } - } - ], - "destination": { - "local": 5, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 12, - "kind": "ZeroSized", - "ty": 27 - }, - "span": 57, - "user_ty": null - } - }, - "target": null, - "unwind": "Continue" - } - }, - "span": 57 + "span": 45 } } ], - "locals": [ - { - "mutability": "Mut", - "span": 58, - "ty": 1 - }, - { - "mutability": "Not", - "span": 59, - "ty": 26 - }, - { - "mutability": "Mut", - "span": 52, - "ty": 29 - }, - { - "mutability": "Mut", - "span": 53, - "ty": 25 - }, + "locals": [ { "mutability": "Mut", - "span": 55, - "ty": 26 + "span": 47, + "ty": 17 }, { - "mutability": "Mut", - "span": 57, - "ty": 30 + "mutability": "Not", + "span": 48, + "ty": 1 } ], - "span": 61, + "span": 49, "spread_arg": null, "var_debug_info": [ { - "argument_index": null, + "argument_index": 1, "composite": null, - "name": "a", + "name": "self", "source_info": { - "scope": 1, - "span": 60 + "scope": 0, + "span": 48 }, "value": { "Const": { "const_": { - "id": 11, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 255, - 255, - 255, - 255 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 + "id": 4, + "kind": "ZeroSized", + "ty": 1 }, - "span": 54, + "span": 32, "user_ty": null } } - }, - { - "argument_index": null, - "composite": null, - "name": "b", - "source_info": { - "scope": 2, - "span": 59 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } } ] }, - "id": 6, - "name": "main" + "id": 5, + "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "_ZN21primitive_type_bounds4main17h" + "symbol_name": "<() as std::process::Termination>::report::h69c88cbf34136087" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 2, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, - { - "kind": { - "Assign": [ - { - "local": 8, - "projection": [] - }, - { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 - } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] - } - ] - }, - "span": 3 - }, { "kind": { "Assign": [ { - "local": 7, + "local": 3, "projection": [] }, { @@ -611,59 +201,26 @@ { "kind": "ReErased" }, - "Shared", - { - "local": 8, - "projection": [] - } - ] - } - ] - }, - "span": 2 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, { - "Copy": { - "local": 7, - "projection": [] + "Mut": { + "kind": "Default" } }, - 5 + { + "local": 1, + "projection": [] + } ] } ] }, - "span": 2 + "span": 43 } ], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, { "Move": { "local": 3, @@ -672,300 +229,219 @@ }, { "Move": { - "local": 4, + "local": 2, "projection": [] } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 7, "kind": "ZeroSized", - "ty": 0 + "ty": 23 }, - "span": 0, + "span": 43, "user_ty": null } }, "target": 1, - "unwind": "Continue" + "unwind": { + "Cleanup": 3 + } } }, - "span": 1 - } - }, - { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 5 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 - } - ], - "terminator": { - "kind": "Return", - "span": 4 + "span": 43 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 8, - "ty": 6 - }, - { - "mutability": "Not", - "span": 9, - "ty": 7 }, { - "mutability": "Not", - "span": 10, - "ty": 6 + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, + "unwind": "Continue" + } + }, + "span": 43 + } }, { - "mutability": "Not", - "span": 11, - "ty": 8 + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } }, { - "mutability": "Not", - "span": 12, - "ty": 9 + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } + }, + "span": 43 + } }, + { + "statements": [], + "terminator": { + "kind": "Resume", + "span": 43 + } + } + ], + "locals": [ { "mutability": "Mut", - "span": 1, - "ty": 10 + "span": 43, + "ty": 16 }, { - "mutability": "Mut", - "span": 2, - "ty": 5 + "mutability": "Not", + "span": 43, + "ty": 12 }, { "mutability": "Not", - "span": 2, - "ty": 11 + "span": 43, + "ty": 1 }, { "mutability": "Not", - "span": 3, - "ty": 12 + "span": 43, + "ty": 24 } ], - "span": 13, - "spread_arg": null, - "var_debug_info": [ + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::hb81edc2264643229" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { - "argument_index": 1, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, + "projection": [] + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 43 } }, { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 } - }, + } + ], + "locals": [ { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } + "mutability": "Mut", + "span": 43, + "ty": 1 }, { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } + "mutability": "Not", + "span": 43, + "ty": 7 }, { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } + "mutability": "Not", + "span": 43, + "ty": 1 } - ] + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 3, + "name": ">::call_once" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "core::ops::function::FnOnce::call_once::hf5d1822a163fc9b7" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 2, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 16 - }, - { - "kind": { - "StorageLive": 3 - }, - "span": 15 - }, - { - "kind": { - "StorageLive": 4 - }, - "span": 17 - }, - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - } - ] - }, - "span": 17 - } - ], + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 4, + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, "projection": [] } } ], "destination": { - "local": 3, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 1, + "id": 6, "kind": "ZeroSized", - "ty": 13 + "ty": 21 }, - "span": 14, + "span": 43, "user_ty": null } }, @@ -973,325 +449,684 @@ "unwind": "Continue" } }, - "span": 15 + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 16 + }, + { + "mutability": "Not", + "span": 43, + "ty": 22 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hb48661e88cfe6c21" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::hd9b56215741f7d6a" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 0, + "blocks": [ { "statements": [ { "kind": { - "StorageDead": 4 + "Assign": [ + { + "local": 2, + "projection": [] + }, + { + "CheckedBinaryOp": [ + "Add", + { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 254, + 255, + 255, + 255 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 50, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 51, + "user_ty": null + } + } + ] + } + ] }, - "span": 19 + "span": 52 } ], "terminator": { "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 3, - "projection": [] - } + "Assert": { + "cond": { + "Move": { + "local": 2, + "projection": [ + { + "Field": [ + 1, + 25 + ] + } + ] } - ], - "destination": { - "local": 2, - "projection": [] }, - "func": { - "Constant": { - "const_": { - "id": 2, - "kind": "ZeroSized", - "ty": 14 + "expected": false, + "msg": { + "Overflow": [ + "Add", + { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 254, + 255, + 255, + 255 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 50, + "user_ty": null + } }, - "span": 18, - "user_ty": null - } + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 51, + "user_ty": null + } + } + ] }, - "target": 2, + "target": 1, "unwind": "Continue" } }, - "span": 16 + "span": 52 } }, { "statements": [ - { - "kind": { - "StorageDead": 3 - }, - "span": 21 - }, - { - "kind": { - "StorageLive": 5 - }, - "span": 22 - }, { "kind": { "Assign": [ { - "local": 5, + "local": 1, "projection": [] }, { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { + "Use": { + "Move": { "local": 2, "projection": [ { "Field": [ 0, - 15 + 26 ] } ] } - ] + } } ] }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 + "span": 52 }, { "kind": { "Assign": [ { - "local": 6, + "local": 4, "projection": [] }, { "Use": { - "Copy": { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] + "Constant": { + "const_": { + "id": 11, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 255, + 255, + 255, + 255 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } }, - { - "Field": [ - 0, - 9 - ] - } - ] + "ty": 26 + }, + "span": 54, + "user_ty": null } } } ] }, - "span": 23 + "span": 55 }, { "kind": { "Assign": [ { - "local": 0, + "local": 3, "projection": [] }, { - "Cast": [ - "IntToInt", + "BinaryOp": [ + "Eq", { "Move": { - "local": 6, + "local": 4, "projection": [] } }, - 16 + { + "Copy": { + "local": 1, + "projection": [] + } + } ] } ] }, - "span": 24 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 25 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 + "span": 53 } ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 3, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 3 + ] + ], + "otherwise": 2 + } + } + }, + "span": 53 + } + }, + { + "statements": [], "terminator": { "kind": "Return", - "span": 20 + "span": 56 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 13, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 24, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 0 + ] + ] + } + } + }, + "ty": 28 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 5, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 12, + "kind": "ZeroSized", + "ty": 27 + }, + "span": 57, + "user_ty": null + } + }, + "target": null, + "unwind": "Continue" + } + }, + "span": 57 } } ], "locals": [ { "mutability": "Mut", - "span": 28, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 3, - "ty": 11 + "span": 58, + "ty": 1 }, { - "mutability": "Mut", - "span": 16, - "ty": 17 + "mutability": "Not", + "span": 59, + "ty": 26 }, { "mutability": "Mut", - "span": 15, - "ty": 1 + "span": 52, + "ty": 29 }, { "mutability": "Mut", - "span": 17, - "ty": 7 + "span": 53, + "ty": 25 }, { "mutability": "Mut", - "span": 22, - "ty": 18 + "span": 55, + "ty": 26 }, { "mutability": "Mut", - "span": 23, - "ty": 9 + "span": 57, + "ty": 30 } ], - "span": 3, + "span": 61, "spread_arg": null, "var_debug_info": [ { "argument_index": null, "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", + "name": "a", "source_info": { "scope": 1, - "span": 29 + "span": 60 }, "value": { - "Place": { - "local": 2, - "projection": [] + "Const": { + "const_": { + "id": 11, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 255, + 255, + 255, + 255 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 54, + "user_ty": null } } }, { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "self", + "name": "b", "source_info": { "scope": 2, - "span": 30 + "span": 59 }, "value": { "Place": { - "local": 5, + "local": 1, "projection": [] } } } ] }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" + "id": 6, + "name": "main" } }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "symbol_name": "primitive_type_bounds::main::h8773a5e1da0a396d" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 4, "blocks": [ { - "statements": [], + "statements": [ + { + "kind": { + "StorageLive": 5 + }, + "span": 1 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 8, + "projection": [] + }, + { + "Aggregate": [ + { + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] + }, + [ + { + "Copy": { + "local": 1, + "projection": [] + } + } + ] + ] + } + ] + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] + } + ] + } + ] + }, + "span": 2 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Cast": [ + { + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, + "projection": [] + } + }, + 5 + ] + } + ] + }, + "span": 2 + } + ], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, + "local": 6, "projection": [] } }, { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 2, + "projection": [] + } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] } } ], "destination": { - "local": 0, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 3, + "id": 0, "kind": "ZeroSized", - "ty": 19 + "ty": 0 }, - "span": 31, + "span": 0, "user_ty": null } }, @@ -1299,84 +1134,122 @@ "unwind": "Continue" } }, - "span": 33 + "span": 1 } }, { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "StorageDead": 6 + }, + "span": 5 + }, + { + "kind": { + "Assign": [ { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "local": 0, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 + }, + { + "Field": [ + 0, + 6 + ] + } + ] + } } } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 5, - "kind": "ZeroSized", - "ty": 20 - }, - "span": 34, - "user_ty": null - } - }, - "target": 2, - "unwind": "Unreachable" - } + ] + }, + "span": 6 }, - "span": 35 - } - }, - { - "statements": [], + { + "kind": { + "StorageDead": 8 + }, + "span": 7 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 7 + } + ], "terminator": { "kind": "Return", - "span": 36 + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 37, - "ty": 1 + "span": 8, + "ty": 6 }, { "mutability": "Not", - "span": 38, + "span": 9, "ty": 7 }, { "mutability": "Not", - "span": 39, - "ty": 1 + "span": 10, + "ty": 6 + }, + { + "mutability": "Not", + "span": 11, + "ty": 8 + }, + { + "mutability": "Not", + "span": 12, + "ty": 9 + }, + { + "mutability": "Mut", + "span": 1, + "ty": 10 + }, + { + "mutability": "Mut", + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 } ], - "span": 42, + "span": 13, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "f", + "name": "main", "source_info": { "scope": 0, - "span": 38 + "span": 9 }, "value": { "Place": { @@ -1386,88 +1259,151 @@ } }, { - "argument_index": null, + "argument_index": 2, "composite": null, - "name": "result", + "name": "argc", "source_info": { - "scope": 1, - "span": 40 + "scope": 0, + "span": 10 }, "value": { "Place": { - "local": 0, + "local": 2, "projection": [] } } }, { - "argument_index": 1, + "argument_index": 3, "composite": null, - "name": "dummy", + "name": "argv", "source_info": { - "scope": 2, - "span": 41 + "scope": 0, + "span": 11 }, "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Place": { + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, + "projection": [] } } } ] }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "symbol_name": "std::rt::lang_start::hc3893bfd782986d1" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 1, "blocks": [ { - "statements": [], + "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + } + ] + }, + "span": 17 + } + ], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } - }, - { - "Move": { - "local": 2, + "local": 4, "projection": [] } } ], "destination": { - "local": 0, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 6, + "id": 1, "kind": "ZeroSized", - "ty": 21 + "ty": 13 }, - "span": 43, + "span": 14, "user_ty": null } }, @@ -1475,79 +1411,16 @@ "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 + "span": 15 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 22 }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - { - "Mut": { - "kind": "Default" - } - }, - { - "local": 1, - "projection": [] - } - ] - } - ] + { + "statements": [ + { + "kind": { + "StorageDead": 4 }, - "span": 43 + "span": 19 } ], "terminator": { @@ -1559,292 +1432,419 @@ "local": 3, "projection": [] } - }, - { - "Move": { - "local": 2, - "projection": [] - } } ], "destination": { - "local": 0, + "local": 2, "projection": [] }, "func": { "Constant": { "const_": { - "id": 7, + "id": 2, "kind": "ZeroSized", - "ty": 23 + "ty": 14 }, - "span": 43, + "span": 18, "user_ty": null } }, - "target": 1, - "unwind": { - "Cleanup": 3 - } - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, "target": 2, "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 + "span": 16 } }, { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } + "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 21 }, - "span": 43 - } - }, - { - "statements": [], + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] + } + ] + } + ] + }, + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + }, + { + "Field": [ + 0, + 9 + ] + } + ] + } + } + } + ] + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] + } + ] + }, + "span": 24 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 + } + ], "terminator": { - "kind": "Resume", - "span": 43 + "kind": "Return", + "span": 20 } } ], "locals": [ { "mutability": "Mut", - "span": 43, + "span": 28, "ty": 16 }, { - "mutability": "Not", - "span": 43, - "ty": 12 + "mutability": "Mut", + "span": 3, + "ty": 11 }, { - "mutability": "Not", - "span": 43, + "mutability": "Mut", + "span": 16, + "ty": 17 + }, + { + "mutability": "Mut", + "span": 15, "ty": 1 }, { - "mutability": "Not", - "span": 43, - "ty": 24 + "mutability": "Mut", + "span": 17, + "ty": 7 + }, + { + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 + } + ], + "span": 3, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": null, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 29 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] + ] }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" + "symbol_name": "std::rt::lang_start::{{closure}}::h02c505624a13239f" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 1, "blocks": [ { "statements": [], "terminator": { "kind": { "Call": { - "args": [], + "args": [ + { + "Move": { + "local": 1, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], "destination": { "local": 0, "projection": [] }, "func": { - "Move": { - "local": 1, - "projection": [] + "Constant": { + "const_": { + "id": 3, + "kind": "ZeroSized", + "ty": 19 + }, + "span": 31, + "user_ty": null } }, "target": 1, "unwind": "Continue" } }, - "span": 43 + "span": 33 } }, { "statements": [], "terminator": { - "kind": "Return", - "span": 43 + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 5, + "kind": "ZeroSized", + "ty": 20 + }, + "span": 34, + "user_ty": null + } + }, + "target": 2, + "unwind": "Unreachable" + } + }, + "span": 35 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 1 }, - { - "mutability": "Not", - "span": 43, - "ty": 7 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ { "statements": [], "terminator": { "kind": "Return", - "span": 44 + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 44, + "span": 37, "ty": 1 }, { "mutability": "Not", - "span": 44, - "ty": 22 - } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] - }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" - } - }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 46, - "user_ty": null - } - } - } - ] - }, - "span": 46 - } - ], - "terminator": { - "kind": "Return", - "span": 45 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 47, - "ty": 17 + "span": 38, + "ty": 7 }, { "mutability": "Not", - "span": 48, + "span": 39, "ty": 1 } ], - "span": 49, + "span": 42, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "self", + "name": "f", "source_info": { "scope": 0, - "span": 48 + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 40 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "dummy", + "source_info": { + "scope": 2, + "span": 41 }, "value": { "Const": { @@ -1860,11 +1860,11 @@ } ] }, - "id": 5, - "name": "<() as std::process::Termination>::report" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::hd9d485e2371a6f20" } ], "types": [ diff --git a/tests/integration/programs/recursion-simple-match.smir.json.expected b/tests/integration/programs/recursion-simple-match.smir.json.expected index 8d188b8..57c4547 100644 --- a/tests/integration/programs/recursion-simple-match.smir.json.expected +++ b/tests/integration/programs/recursion-simple-match.smir.json.expected @@ -101,141 +101,6 @@ "body": { "arg_count": 1, "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Copy": { - "local": 1, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 0, - 2 - ] - ], - "otherwise": 1 - } - } - }, - "span": 50 - } - }, - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "CheckedBinaryOp": [ - "Sub", - { - "Copy": { - "local": 1, - "projection": [] - } - }, - { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 51, - "user_ty": null - } - } - ] - } - ] - }, - "span": 52 - } - ], - "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 4, - "projection": [ - { - "Field": [ - 1, - 25 - ] - } - ] - } - }, - "expected": false, - "msg": { - "Overflow": [ - "Sub", - { - "Copy": { - "local": 1, - "projection": [] - } - }, - { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 51, - "user_ty": null - } - } - ] - }, - "target": 3, - "unwind": "Continue" - } - }, - "span": 52 - } - }, { "statements": [ { @@ -249,14 +114,11 @@ "Use": { "Constant": { "const_": { - "id": 10, + "id": 8, "kind": { "Allocated": { - "align": 4, + "align": 1, "bytes": [ - 0, - 0, - 0, 0 ], "mutability": "Mut", @@ -265,27 +127,74 @@ } } }, - "ty": 26 + "ty": 17 }, - "span": 53, + "span": 46, "user_ty": null } } } ] }, - "span": 53 + "span": 46 } ], "terminator": { - "kind": { - "Goto": { - "target": 6 - } - }, - "span": 53 + "kind": "Return", + "span": 45 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::h8ab32beb8c035b51" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { "statements": [ { @@ -296,23 +205,24 @@ "projection": [] }, { - "Use": { - "Move": { - "local": 4, - "projection": [ - { - "Field": [ - 0, - 26 - ] - } - ] + "Ref": [ + { + "kind": "ReErased" + }, + { + "Mut": { + "kind": "Default" + } + }, + { + "local": 1, + "projection": [] } - } + ] } ] }, - "span": 52 + "span": 43 } ], "terminator": { @@ -324,301 +234,399 @@ "local": 3, "projection": [] } + }, + { + "Move": { + "local": 2, + "projection": [] + } } ], "destination": { - "local": 2, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 11, + "id": 7, "kind": "ZeroSized", - "ty": 27 + "ty": 23 }, - "span": 54, + "span": 43, "user_ty": null } }, - "target": 4, - "unwind": "Continue" + "target": 1, + "unwind": { + "Cleanup": 3 + } } }, - "span": 55 + "span": 43 } }, { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 5, - "projection": [] - }, - { - "CheckedBinaryOp": [ - "Add", - { - "Copy": { - "local": 1, - "projection": [] - } - }, - { - "Copy": { - "local": 2, - "projection": [] - } - } - ] - } - ] - }, - "span": 56 - } - ], + "statements": [], "terminator": { "kind": { - "Assert": { - "cond": { - "Move": { - "local": 5, - "projection": [ - { - "Field": [ - 1, - 25 - ] - } - ] - } - }, - "expected": false, - "msg": { - "Overflow": [ - "Add", - { - "Copy": { - "local": 1, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - } - ] + "Drop": { + "place": { + "local": 1, + "projection": [] }, - "target": 5, + "target": 2, "unwind": "Continue" } }, - "span": 56 + "span": 43 } }, { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Move": { - "local": 5, - "projection": [ - { - "Field": [ - 0, - 26 - ] - } - ] - } - } - } - ] - }, - "span": 56 - } - ], + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + }, + { + "statements": [], "terminator": { "kind": { - "Goto": { - "target": 6 + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" } }, - "span": 57 + "span": 43 } }, { "statements": [], "terminator": { - "kind": "Return", - "span": 58 + "kind": "Resume", + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 59, - "ty": 26 + "span": 43, + "ty": 16 }, { "mutability": "Not", - "span": 60, - "ty": 26 - }, - { - "mutability": "Mut", - "span": 55, - "ty": 26 - }, - { - "mutability": "Mut", - "span": 52, - "ty": 26 + "span": 43, + "ty": 12 }, { - "mutability": "Mut", - "span": 52, - "ty": 28 + "mutability": "Not", + "span": 43, + "ty": 1 }, { - "mutability": "Mut", - "span": 56, - "ty": 28 + "mutability": "Not", + "span": 43, + "ty": 24 } ], - "span": 61, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "n", - "source_info": { - "scope": 0, - "span": 60 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - } - ] + "span": 43, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 6, - "name": "sum_to_n_rec" + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "_ZN22recursion_simple_match12sum_to_n_rec17h" + "symbol_name": "core::ops::function::FnOnce::call_once::h23a2754b9f29f2ed" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 0, + "arg_count": 2, "blocks": [ { "statements": [], "terminator": { "kind": { "Call": { - "args": [ - { - "Constant": { - "const_": { - "id": 12, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 10, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 63, - "user_ty": null - } - } - ], + "args": [], "destination": { - "local": 1, + "local": 0, "projection": [] }, "func": { - "Constant": { - "const_": { - "id": 11, - "kind": "ZeroSized", - "ty": 27 - }, - "span": 62, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 64 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Copy": { + "Move": { "local": 1, "projection": [] } }, - "targets": { - "branches": [ - [ - 55, - 2 - ] - ], - "otherwise": 3 - } + "target": 1, + "unwind": "Continue" } }, - "span": 65 + "span": 43 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 66 + "span": 43 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 1 }, { - "statements": [], + "mutability": "Not", + "span": 43, + "ty": 7 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": ">::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::hbd793cfecefa0530" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + } + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 6, + "kind": "ZeroSized", + "ty": 21 + }, + "span": 43, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 16 + }, + { + "mutability": "Not", + "span": 43, + "ty": 22 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::haa5c1b083d46d3ac" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 + }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::ha2ea3ca4abe65743" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 0, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 12, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 10, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 63, + "user_ty": null + } + } + ], + "destination": { + "local": 1, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 11, + "kind": "ZeroSized", + "ty": 27 + }, + "span": 62, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 64 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Copy": { + "local": 1, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 55, + 2 + ] + ], + "otherwise": 3 + } + } + }, + "span": 65 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 66 + } + }, + { + "statements": [], "terminator": { "kind": { "Call": { @@ -730,185 +738,336 @@ "name": "main" } }, - "symbol_name": "_ZN22recursion_simple_match4main17h" + "symbol_name": "recursion_simple_match::main::h71d32246ead50f34" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 1, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, - { + "statements": [], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Copy": { + "local": 1, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 2 + ] + ], + "otherwise": 1 + } + } + }, + "span": 50 + } + }, + { + "statements": [ + { "kind": { "Assign": [ { - "local": 8, + "local": 4, "projection": [] }, { - "Aggregate": [ + "CheckedBinaryOp": [ + "Sub", { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 - } - ] - ] + "Copy": { + "local": 1, + "projection": [] + } }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } + { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 51, + "user_ty": null } - ] + } ] } ] }, - "span": 3 + "span": 52 + } + ], + "terminator": { + "kind": { + "Assert": { + "cond": { + "Move": { + "local": 4, + "projection": [ + { + "Field": [ + 1, + 25 + ] + } + ] + } + }, + "expected": false, + "msg": { + "Overflow": [ + "Sub", + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 51, + "user_ty": null + } + } + ] + }, + "target": 3, + "unwind": "Continue" + } }, + "span": 52 + } + }, + { + "statements": [ { "kind": { "Assign": [ { - "local": 7, + "local": 0, "projection": [] }, { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 8, - "projection": [] + "Use": { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 53, + "user_ty": null } - ] + } } ] }, - "span": 2 + "span": 53 + } + ], + "terminator": { + "kind": { + "Goto": { + "target": 6 + } }, + "span": 53 + } + }, + { + "statements": [ { "kind": { "Assign": [ { - "local": 6, + "local": 3, "projection": [] }, { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, - { - "Copy": { - "local": 7, - "projection": [] - } - }, - 5 - ] + "Use": { + "Move": { + "local": 4, + "projection": [ + { + "Field": [ + 0, + 26 + ] + } + ] + } + } } ] }, - "span": 2 + "span": 52 } ], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, { "Move": { "local": 3, "projection": [] } - }, - { - "Move": { - "local": 4, - "projection": [] - } } ], "destination": { - "local": 5, + "local": 2, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 11, "kind": "ZeroSized", - "ty": 0 + "ty": 27 }, - "span": 0, + "span": 54, "user_ty": null } }, - "target": 1, + "target": 4, "unwind": "Continue" } }, - "span": 1 + "span": 55 } }, { "statements": [ { "kind": { - "StorageDead": 6 + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "CheckedBinaryOp": [ + "Add", + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Copy": { + "local": 2, + "projection": [] + } + } + ] + } + ] }, - "span": 5 + "span": 56 + } + ], + "terminator": { + "kind": { + "Assert": { + "cond": { + "Move": { + "local": 5, + "projection": [ + { + "Field": [ + 1, + 25 + ] + } + ] + } + }, + "expected": false, + "msg": { + "Overflow": [ + "Add", + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + } + ] + }, + "target": 5, + "unwind": "Continue" + } }, + "span": 56 + } + }, + { + "statements": [ { "kind": { "Assign": [ @@ -918,16 +1077,13 @@ }, { "Use": { - "Copy": { + "Move": { "local": 5, "projection": [ - { - "Downcast": 0 - }, { "Field": [ 0, - 6 + 26 ] } ] @@ -936,84 +1092,68 @@ } ] }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 + "span": 56 } ], + "terminator": { + "kind": { + "Goto": { + "target": 6 + } + }, + "span": 57 + } + }, + { + "statements": [], "terminator": { "kind": "Return", - "span": 4 + "span": 58 } } ], "locals": [ { "mutability": "Mut", - "span": 8, - "ty": 6 - }, - { - "mutability": "Not", - "span": 9, - "ty": 7 - }, - { - "mutability": "Not", - "span": 10, - "ty": 6 - }, - { - "mutability": "Not", - "span": 11, - "ty": 8 + "span": 59, + "ty": 26 }, { "mutability": "Not", - "span": 12, - "ty": 9 + "span": 60, + "ty": 26 }, { "mutability": "Mut", - "span": 1, - "ty": 10 + "span": 55, + "ty": 26 }, { "mutability": "Mut", - "span": 2, - "ty": 5 + "span": 52, + "ty": 26 }, { - "mutability": "Not", - "span": 2, - "ty": 11 + "mutability": "Mut", + "span": 52, + "ty": 28 }, { - "mutability": "Not", - "span": 3, - "ty": 12 + "mutability": "Mut", + "span": 56, + "ty": 28 } ], - "span": 13, + "span": 61, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "main", + "name": "n", "source_info": { "scope": 0, - "span": 9 + "span": 60 }, "value": { "Place": { @@ -1021,277 +1161,211 @@ "projection": [] } } - }, - { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - }, - { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } } ] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 6, + "name": "sum_to_n_rec" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "recursion_simple_match::sum_to_n_rec::h295ab07e17e15bfe" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 4, "blocks": [ { "statements": [ { "kind": { - "StorageLive": 2 + "StorageLive": 5 }, - "span": 16 + "span": 1 }, { "kind": { - "StorageLive": 3 + "StorageLive": 6 }, - "span": 15 + "span": 2 }, { "kind": { - "StorageLive": 4 + "StorageLive": 8 }, - "span": 17 + "span": 3 }, { "kind": { "Assign": [ { - "local": 4, + "local": 8, "projection": [] }, { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - } - ] - }, - "span": 17 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 4, - "projection": [] - } + "Aggregate": [ + { + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] + }, + [ + { + "Copy": { + "local": 1, + "projection": [] + } + } + ] + ] } - ], - "destination": { - "local": 3, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 1, - "kind": "ZeroSized", - "ty": 13 - }, - "span": 14, - "user_ty": null + ] + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] + } + ] } - }, - "target": 1, - "unwind": "Continue" - } + ] + }, + "span": 2 }, - "span": 15 - } - }, - { - "statements": [ { "kind": { - "StorageDead": 4 + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Cast": [ + { + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, + "projection": [] + } + }, + 5 + ] + } + ] }, - "span": 19 + "span": 2 } ], "terminator": { "kind": { "Call": { "args": [ + { + "Move": { + "local": 6, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + }, { "Move": { "local": 3, "projection": [] } + }, + { + "Move": { + "local": 4, + "projection": [] + } } ], "destination": { - "local": 2, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 2, + "id": 0, "kind": "ZeroSized", - "ty": 14 + "ty": 0 }, - "span": 18, + "span": 0, "user_ty": null } }, - "target": 2, + "target": 1, "unwind": "Continue" } }, - "span": 16 + "span": 1 } }, { "statements": [ { "kind": { - "StorageDead": 3 - }, - "span": 21 - }, - { - "kind": { - "StorageLive": 5 - }, - "span": 22 - }, - { - "kind": { - "Assign": [ - { - "local": 5, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - } - ] - } - ] - } - ] - }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 + "StorageDead": 6 }, - "span": 23 + "span": 5 }, { "kind": { "Assign": [ { - "local": 6, + "local": 0, "projection": [] }, { "Use": { "Copy": { - "local": 2, + "local": 5, "projection": [ { - "Field": [ - 0, - 15 - ] + "Downcast": 0 }, { "Field": [ 0, - 9 + 6 ] } ] @@ -1300,98 +1374,79 @@ } ] }, - "span": 23 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Cast": [ - "IntToInt", - { - "Move": { - "local": 6, - "projection": [] - } - }, - 16 - ] - } - ] - }, - "span": 24 + "span": 6 }, { "kind": { - "StorageDead": 6 + "StorageDead": 8 }, - "span": 25 + "span": 7 }, { "kind": { "StorageDead": 5 }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 + "span": 7 } ], "terminator": { "kind": "Return", - "span": 20 + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 28, - "ty": 16 + "span": 8, + "ty": 6 }, { - "mutability": "Mut", - "span": 3, - "ty": 11 + "mutability": "Not", + "span": 9, + "ty": 7 }, { - "mutability": "Mut", - "span": 16, - "ty": 17 + "mutability": "Not", + "span": 10, + "ty": 6 }, { - "mutability": "Mut", - "span": 15, - "ty": 1 + "mutability": "Not", + "span": 11, + "ty": 8 }, { - "mutability": "Mut", - "span": 17, - "ty": 7 + "mutability": "Not", + "span": 12, + "ty": 9 }, { "mutability": "Mut", - "span": 22, - "ty": 18 + "span": 1, + "ty": 10 }, { "mutability": "Mut", - "span": 23, - "ty": 9 + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 } ], - "span": 3, + "span": 13, "spread_arg": null, "var_debug_info": [ { - "argument_index": null, + "argument_index": 1, "composite": null, "name": "main", "source_info": { @@ -1401,25 +1456,17 @@ "value": { "Place": { "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] + "projection": [] } } }, { - "argument_index": 1, + "argument_index": 2, "composite": null, - "name": "self", + "name": "argc", "source_info": { - "scope": 1, - "span": 29 + "scope": 0, + "span": 10 }, "value": { "Place": { @@ -1429,27 +1476,57 @@ } }, { - "argument_index": 1, + "argument_index": 3, "composite": null, - "name": "self", + "name": "argv", "source_info": { - "scope": 2, - "span": 30 + "scope": 0, + "span": 11 }, "value": { "Place": { - "local": 5, + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, "projection": [] } } } ] }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "symbol_name": "std::rt::lang_start::hdcae6ddbef5aa5e9" }, { "details": null, @@ -1459,41 +1536,76 @@ "arg_count": 1, "blocks": [ { - "statements": [], + "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + } + ] + }, + "span": 17 + } + ], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, + "local": 4, "projection": [] } - }, - { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } } ], "destination": { - "local": 0, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 3, + "id": 1, "kind": "ZeroSized", - "ty": 19 + "ty": 13 }, - "span": 31, + "span": 14, "user_ty": null } }, @@ -1501,24 +1613,26 @@ "unwind": "Continue" } }, - "span": 33 + "span": 15 } }, { - "statements": [], + "statements": [ + { + "kind": { + "StorageDead": 4 + }, + "span": 19 + } + ], "terminator": { "kind": { "Call": { "args": [ { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 3, + "projection": [] } } ], @@ -1529,206 +1643,40 @@ "func": { "Constant": { "const_": { - "id": 5, + "id": 2, "kind": "ZeroSized", - "ty": 20 + "ty": 14 }, - "span": 34, + "span": 18, "user_ty": null } }, "target": 2, - "unwind": "Unreachable" + "unwind": "Continue" } }, - "span": 35 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 36 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 37, - "ty": 1 - }, - { - "mutability": "Not", - "span": 38, - "ty": 7 - }, - { - "mutability": "Not", - "span": 39, - "ty": 1 - } - ], - "span": 42, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "f", - "source_info": { - "scope": 0, - "span": 38 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "result", - "source_info": { - "scope": 1, - "span": 40 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } + "span": 16 } }, { - "argument_index": 1, - "composite": null, - "name": "dummy", - "source_info": { - "scope": 2, - "span": 41 - }, - "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 + "statements": [ + { + "kind": { + "StorageDead": 3 }, - "span": 32, - "user_ty": null - } - } - } - ] - }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" - } - }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 21 - }, - "span": 43, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 22 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [ { "kind": { "Assign": [ { - "local": 3, + "local": 5, "projection": [] }, { @@ -1736,317 +1684,369 @@ { "kind": "ReErased" }, + "Shared", { - "Mut": { - "kind": "Default" - } - }, - { - "local": 1, - "projection": [] + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] } ] } ] }, - "span": 43 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ { - "Move": { - "local": 3, - "projection": [] - } + "local": 6, + "projection": [] }, { - "Move": { - "local": 2, - "projection": [] + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + }, + { + "Field": [ + 0, + 9 + ] + } + ] + } } } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 7, - "kind": "ZeroSized", - "ty": 23 - }, - "span": 43, - "user_ty": null + ] + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] } - }, - "target": 1, - "unwind": { - "Cleanup": 3 - } - } + ] + }, + "span": 24 }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 2, - "unwind": "Continue" - } + { + "kind": { + "StorageDead": 6 + }, + "span": 25 }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } + { + "kind": { + "StorageDead": 5 + }, + "span": 26 }, - "span": 43 - } - }, - { - "statements": [], + { + "kind": { + "StorageDead": 2 + }, + "span": 27 + } + ], "terminator": { - "kind": "Resume", - "span": 43 + "kind": "Return", + "span": 20 } } ], "locals": [ { "mutability": "Mut", - "span": 43, + "span": 28, "ty": 16 }, { - "mutability": "Not", - "span": 43, - "ty": 12 + "mutability": "Mut", + "span": 3, + "ty": 11 }, { - "mutability": "Not", - "span": 43, + "mutability": "Mut", + "span": 16, + "ty": 17 + }, + { + "mutability": "Mut", + "span": 15, "ty": 1 }, { - "mutability": "Not", - "span": 43, - "ty": 24 + "mutability": "Mut", + "span": 17, + "ty": 7 + }, + { + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 + } + ], + "span": 3, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": null, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 29 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] + ] }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" + "symbol_name": "std::rt::lang_start::{{closure}}::h78d1f12c16f77a9c" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 1, "blocks": [ { "statements": [], "terminator": { "kind": { "Call": { - "args": [], + "args": [ + { + "Move": { + "local": 1, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], "destination": { "local": 0, "projection": [] }, "func": { - "Move": { - "local": 1, - "projection": [] + "Constant": { + "const_": { + "id": 3, + "kind": "ZeroSized", + "ty": 19 + }, + "span": 31, + "user_ty": null } }, "target": 1, "unwind": "Continue" } }, - "span": 43 + "span": 33 } }, { "statements": [], "terminator": { - "kind": "Return", - "span": 43 + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 5, + "kind": "ZeroSized", + "ty": 20 + }, + "span": 34, + "user_ty": null + } + }, + "target": 2, + "unwind": "Unreachable" + } + }, + "span": 35 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 1 }, - { - "mutability": "Not", - "span": 43, - "ty": 7 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ { "statements": [], "terminator": { "kind": "Return", - "span": 44 + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 44, + "span": 37, "ty": 1 }, { "mutability": "Not", - "span": 44, - "ty": 22 - } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] - }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" - } - }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 46, - "user_ty": null - } - } - } - ] - }, - "span": 46 - } - ], - "terminator": { - "kind": "Return", - "span": 45 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 47, - "ty": 17 + "span": 38, + "ty": 7 }, { "mutability": "Not", - "span": 48, + "span": 39, "ty": 1 } ], - "span": 49, + "span": 42, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "self", + "name": "f", "source_info": { "scope": 0, - "span": 48 + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 40 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "dummy", + "source_info": { + "scope": 2, + "span": 41 }, "value": { "Const": { @@ -2062,11 +2062,11 @@ } ] }, - "id": 5, - "name": "<() as std::process::Termination>::report" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h0824f590e386f9d0" } ], "types": [ diff --git a/tests/integration/programs/recursion-simple.smir.json.expected b/tests/integration/programs/recursion-simple.smir.json.expected index 1081e19..a685065 100644 --- a/tests/integration/programs/recursion-simple.smir.json.expected +++ b/tests/integration/programs/recursion-simple.smir.json.expected @@ -101,31 +101,6 @@ "body": { "arg_count": 1, "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Copy": { - "local": 1, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 0, - 1 - ] - ], - "otherwise": 2 - } - } - }, - "span": 50 - } - }, { "statements": [ { @@ -139,14 +114,11 @@ "Use": { "Constant": { "const_": { - "id": 9, + "id": 8, "kind": { "Allocated": { - "align": 4, + "align": 1, "bytes": [ - 0, - 0, - 0, 0 ], "mutability": "Mut", @@ -155,381 +127,295 @@ } } }, - "ty": 25 + "ty": 17 }, - "span": 52, + "span": 46, "user_ty": null } } } ] }, - "span": 52 + "span": 46 } ], + "terminator": { + "kind": "Return", + "span": 45 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 + }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::h3c61de52d3aaf346" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [], "terminator": { "kind": { - "Goto": { - "target": 6 + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, + "projection": [] + } + }, + "target": 1, + "unwind": "Continue" } }, - "span": 51 + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 1 + }, + { + "mutability": "Not", + "span": 43, + "ty": 7 }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": ">::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h280ca10d4cdc089b" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { "statements": [ { "kind": { "Assign": [ { - "local": 4, + "local": 3, "projection": [] }, { - "CheckedBinaryOp": [ - "Sub", + "Ref": [ { - "Copy": { - "local": 1, - "projection": [] - } + "kind": "ReErased" }, { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 25 - }, - "span": 53, - "user_ty": null + "Mut": { + "kind": "Default" } + }, + { + "local": 1, + "projection": [] } ] } ] }, - "span": 54 + "span": 43 } ], "terminator": { "kind": { - "Assert": { - "cond": { - "Move": { - "local": 4, - "projection": [ - { - "Field": [ - 1, - 26 - ] - } - ] + "Call": { + "args": [ + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } } + ], + "destination": { + "local": 0, + "projection": [] }, - "expected": false, - "msg": { - "Overflow": [ - "Sub", - { - "Copy": { - "local": 1, - "projection": [] - } + "func": { + "Constant": { + "const_": { + "id": 7, + "kind": "ZeroSized", + "ty": 23 }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 25 - }, - "span": 53, - "user_ty": null - } - } - ] + "span": 43, + "user_ty": null + } }, - "target": 3, - "unwind": "Continue" + "target": 1, + "unwind": { + "Cleanup": 3 + } } }, - "span": 54 + "span": 43 } }, { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Use": { - "Move": { - "local": 4, - "projection": [ - { - "Field": [ - 0, - 25 - ] - } - ] - } - } - } - ] - }, - "span": 54 - } - ], + "statements": [], "terminator": { "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 3, - "projection": [] - } - } - ], - "destination": { - "local": 2, + "Drop": { + "place": { + "local": 1, "projection": [] }, - "func": { - "Constant": { - "const_": { - "id": 11, - "kind": "ZeroSized", - "ty": 27 - }, - "span": 55, - "user_ty": null - } - }, - "target": 4, + "target": 2, "unwind": "Continue" } }, - "span": 56 + "span": 43 } }, { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 5, - "projection": [] - }, - { - "CheckedBinaryOp": [ - "Add", - { - "Copy": { - "local": 1, - "projection": [] - } - }, - { - "Copy": { - "local": 2, - "projection": [] - } - } - ] - } - ] - }, - "span": 57 - } - ], + "statements": [], "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 5, - "projection": [ - { - "Field": [ - 1, - 26 - ] - } - ] - } - }, - "expected": false, - "msg": { - "Overflow": [ - "Add", - { - "Copy": { - "local": 1, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - } - ] - }, - "target": 5, - "unwind": "Continue" - } - }, - "span": 57 + "kind": "Return", + "span": 43 } }, { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Move": { - "local": 5, - "projection": [ - { - "Field": [ - 0, - 25 - ] - } - ] - } - } - } - ] - }, - "span": 57 - } - ], + "statements": [], "terminator": { "kind": { - "Goto": { - "target": 6 + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" } }, - "span": 51 + "span": 43 } }, { "statements": [], "terminator": { - "kind": "Return", - "span": 58 + "kind": "Resume", + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 59, - "ty": 25 + "span": 43, + "ty": 16 }, { "mutability": "Not", - "span": 60, - "ty": 25 - }, - { - "mutability": "Mut", - "span": 56, - "ty": 25 - }, - { - "mutability": "Mut", - "span": 54, - "ty": 25 + "span": 43, + "ty": 12 }, { - "mutability": "Mut", - "span": 54, - "ty": 28 + "mutability": "Not", + "span": 43, + "ty": 1 }, { - "mutability": "Mut", - "span": 57, - "ty": 28 + "mutability": "Not", + "span": 43, + "ty": 24 } ], - "span": 61, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "n", - "source_info": { - "scope": 0, - "span": 60 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - } - ] + "span": 43, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 6, - "name": "sum_to_n_rec" + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "_ZN16recursion_simple12sum_to_n_rec17h" + "symbol_name": "core::ops::function::FnOnce::call_once::h99733990595be573" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 0, + "arg_count": 2, "blocks": [ { "statements": [], @@ -538,12 +424,134 @@ "Call": { "args": [ { - "Constant": { - "const_": { - "id": 12, - "kind": { - "Allocated": { - "align": 4, + "Move": { + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + } + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 6, + "kind": "ZeroSized", + "ty": 21 + }, + "span": 43, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 16 + }, + { + "mutability": "Not", + "span": 43, + "ty": 22 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h93f3b1c71a34fe2f" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 + }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::hba5d3cf0898289b8" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 0, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 12, + "kind": { + "Allocated": { + "align": 4, "bytes": [ 10, 0, @@ -730,185 +738,336 @@ "name": "main" } }, - "symbol_name": "_ZN16recursion_simple4main17h" + "symbol_name": "recursion_simple::main::h08d6a0945650288a" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 1, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 + "statements": [], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Copy": { + "local": 1, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 1 + ] + ], + "otherwise": 2 + } + } }, + "span": 50 + } + }, + { + "statements": [ { "kind": { "Assign": [ { - "local": 8, + "local": 0, "projection": [] }, { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 + "Use": { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] + }, + "ty": 25 + }, + "span": 52, + "user_ty": null + } + } } ] }, - "span": 3 + "span": 52 + } + ], + "terminator": { + "kind": { + "Goto": { + "target": 6 + } }, + "span": 51 + } + }, + { + "statements": [ { "kind": { "Assign": [ { - "local": 7, + "local": 4, "projection": [] }, { - "Ref": [ + "CheckedBinaryOp": [ + "Sub", { - "kind": "ReErased" + "Copy": { + "local": 1, + "projection": [] + } }, - "Shared", { - "local": 8, - "projection": [] - } - ] - } - ] + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 25 + }, + "span": 53, + "user_ty": null + } + } + ] + } + ] }, - "span": 2 + "span": 54 + } + ], + "terminator": { + "kind": { + "Assert": { + "cond": { + "Move": { + "local": 4, + "projection": [ + { + "Field": [ + 1, + 26 + ] + } + ] + } + }, + "expected": false, + "msg": { + "Overflow": [ + "Sub", + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 25 + }, + "span": 53, + "user_ty": null + } + } + ] + }, + "target": 3, + "unwind": "Continue" + } }, + "span": 54 + } + }, + { + "statements": [ { "kind": { "Assign": [ { - "local": 6, + "local": 3, "projection": [] }, { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, - { - "Copy": { - "local": 7, - "projection": [] - } - }, - 5 - ] + "Use": { + "Move": { + "local": 4, + "projection": [ + { + "Field": [ + 0, + 25 + ] + } + ] + } + } } ] }, - "span": 2 + "span": 54 } ], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, { "Move": { "local": 3, "projection": [] } - }, - { - "Move": { - "local": 4, - "projection": [] - } } ], "destination": { - "local": 5, + "local": 2, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 11, "kind": "ZeroSized", - "ty": 0 + "ty": 27 }, - "span": 0, + "span": 55, "user_ty": null } }, - "target": 1, + "target": 4, "unwind": "Continue" } }, - "span": 1 + "span": 56 } }, { "statements": [ { "kind": { - "StorageDead": 6 + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "CheckedBinaryOp": [ + "Add", + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Copy": { + "local": 2, + "projection": [] + } + } + ] + } + ] }, - "span": 5 + "span": 57 + } + ], + "terminator": { + "kind": { + "Assert": { + "cond": { + "Move": { + "local": 5, + "projection": [ + { + "Field": [ + 1, + 26 + ] + } + ] + } + }, + "expected": false, + "msg": { + "Overflow": [ + "Add", + { + "Copy": { + "local": 1, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + } + ] + }, + "target": 5, + "unwind": "Continue" + } }, + "span": 57 + } + }, + { + "statements": [ { "kind": { "Assign": [ @@ -918,16 +1077,13 @@ }, { "Use": { - "Copy": { + "Move": { "local": 5, "projection": [ - { - "Downcast": 0 - }, { "Field": [ 0, - 6 + 25 ] } ] @@ -936,84 +1092,68 @@ } ] }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 + "span": 57 } ], + "terminator": { + "kind": { + "Goto": { + "target": 6 + } + }, + "span": 51 + } + }, + { + "statements": [], "terminator": { "kind": "Return", - "span": 4 + "span": 58 } } ], "locals": [ { "mutability": "Mut", - "span": 8, - "ty": 6 - }, - { - "mutability": "Not", - "span": 9, - "ty": 7 - }, - { - "mutability": "Not", - "span": 10, - "ty": 6 - }, - { - "mutability": "Not", - "span": 11, - "ty": 8 + "span": 59, + "ty": 25 }, { "mutability": "Not", - "span": 12, - "ty": 9 + "span": 60, + "ty": 25 }, { "mutability": "Mut", - "span": 1, - "ty": 10 + "span": 56, + "ty": 25 }, { "mutability": "Mut", - "span": 2, - "ty": 5 + "span": 54, + "ty": 25 }, { - "mutability": "Not", - "span": 2, - "ty": 11 + "mutability": "Mut", + "span": 54, + "ty": 28 }, { - "mutability": "Not", - "span": 3, - "ty": 12 + "mutability": "Mut", + "span": 57, + "ty": 28 } ], - "span": 13, + "span": 61, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "main", + "name": "n", "source_info": { "scope": 0, - "span": 9 + "span": 60 }, "value": { "Place": { @@ -1021,134 +1161,155 @@ "projection": [] } } - }, - { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - }, - { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } } ] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 6, + "name": "sum_to_n_rec" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "recursion_simple::sum_to_n_rec::he6087e74219aae9a" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 4, "blocks": [ { "statements": [ { "kind": { - "StorageLive": 2 + "StorageLive": 5 }, - "span": 16 + "span": 1 }, { "kind": { - "StorageLive": 3 + "StorageLive": 6 }, - "span": 15 + "span": 2 }, { "kind": { - "StorageLive": 4 + "StorageLive": 8 }, - "span": 17 + "span": 3 }, { "kind": { "Assign": [ { - "local": 4, + "local": 8, "projection": [] }, { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } + "Aggregate": [ + { + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] ] + }, + [ + { + "Copy": { + "local": 1, + "projection": [] + } + } + ] + ] + } + ] + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] } - } + ] } ] }, - "span": 17 + "span": 2 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Cast": [ + { + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, + "projection": [] + } + }, + 5 + ] + } + ] + }, + "span": 2 } ], "terminator": { "kind": { "Call": { "args": [ + { + "Move": { + "local": 6, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, { "Move": { "local": 4, @@ -1157,17 +1318,17 @@ } ], "destination": { - "local": 3, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 1, + "id": 0, "kind": "ZeroSized", - "ty": 13 + "ty": 0 }, - "span": 14, + "span": 0, "user_ty": null } }, @@ -1175,123 +1336,36 @@ "unwind": "Continue" } }, - "span": 15 + "span": 1 } }, { "statements": [ { "kind": { - "StorageDead": 4 + "StorageDead": 6 }, - "span": 19 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 3, - "projection": [] - } - } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 2, - "kind": "ZeroSized", - "ty": 14 - }, - "span": 18, - "user_ty": null - } - }, - "target": 2, - "unwind": "Continue" - } - }, - "span": 16 - } - }, - { - "statements": [ - { - "kind": { - "StorageDead": 3 - }, - "span": 21 - }, - { - "kind": { - "StorageLive": 5 - }, - "span": 22 - }, - { - "kind": { - "Assign": [ - { - "local": 5, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - } - ] - } - ] - } - ] - }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 + "span": 5 }, { "kind": { "Assign": [ { - "local": 6, + "local": 0, "projection": [] }, { "Use": { "Copy": { - "local": 2, + "local": 5, "projection": [ { - "Field": [ - 0, - 15 - ] + "Downcast": 0 }, { "Field": [ 0, - 9 + 6 ] } ] @@ -1300,98 +1374,79 @@ } ] }, - "span": 23 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Cast": [ - "IntToInt", - { - "Move": { - "local": 6, - "projection": [] - } - }, - 16 - ] - } - ] - }, - "span": 24 + "span": 6 }, { "kind": { - "StorageDead": 6 + "StorageDead": 8 }, - "span": 25 + "span": 7 }, { "kind": { "StorageDead": 5 }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 + "span": 7 } ], "terminator": { "kind": "Return", - "span": 20 + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 28, - "ty": 16 + "span": 8, + "ty": 6 }, { - "mutability": "Mut", - "span": 3, - "ty": 11 + "mutability": "Not", + "span": 9, + "ty": 7 }, { - "mutability": "Mut", - "span": 16, - "ty": 17 + "mutability": "Not", + "span": 10, + "ty": 6 }, { - "mutability": "Mut", - "span": 15, - "ty": 1 + "mutability": "Not", + "span": 11, + "ty": 8 }, { - "mutability": "Mut", - "span": 17, - "ty": 7 + "mutability": "Not", + "span": 12, + "ty": 9 }, { "mutability": "Mut", - "span": 22, - "ty": 18 + "span": 1, + "ty": 10 }, { "mutability": "Mut", - "span": 23, - "ty": 9 + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 } ], - "span": 3, + "span": 13, "spread_arg": null, "var_debug_info": [ { - "argument_index": null, + "argument_index": 1, "composite": null, "name": "main", "source_info": { @@ -1401,25 +1456,17 @@ "value": { "Place": { "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] + "projection": [] } } }, { - "argument_index": 1, + "argument_index": 2, "composite": null, - "name": "self", + "name": "argc", "source_info": { - "scope": 1, - "span": 29 + "scope": 0, + "span": 10 }, "value": { "Place": { @@ -1429,27 +1476,57 @@ } }, { - "argument_index": 1, + "argument_index": 3, "composite": null, - "name": "self", + "name": "argv", "source_info": { - "scope": 2, - "span": 30 + "scope": 0, + "span": 11 }, "value": { "Place": { - "local": 5, + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, "projection": [] } } } ] }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "symbol_name": "std::rt::lang_start::h6813f563cc4218d2" }, { "details": null, @@ -1459,41 +1536,76 @@ "arg_count": 1, "blocks": [ { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 1, - "projection": [] - } - }, - { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + } + ] + }, + "span": 17 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 4, + "projection": [] } } ], "destination": { - "local": 0, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 3, + "id": 1, "kind": "ZeroSized", - "ty": 19 + "ty": 13 }, - "span": 31, + "span": 14, "user_ty": null } }, @@ -1501,24 +1613,26 @@ "unwind": "Continue" } }, - "span": 33 + "span": 15 } }, { - "statements": [], + "statements": [ + { + "kind": { + "StorageDead": 4 + }, + "span": 19 + } + ], "terminator": { "kind": { "Call": { "args": [ { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 3, + "projection": [] } } ], @@ -1529,75 +1643,225 @@ "func": { "Constant": { "const_": { - "id": 5, + "id": 2, "kind": "ZeroSized", - "ty": 20 + "ty": 14 }, - "span": 34, + "span": 18, "user_ty": null } }, "target": 2, - "unwind": "Unreachable" + "unwind": "Continue" } }, - "span": 35 + "span": 16 } }, { - "statements": [], + "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] + } + ] + } + ] + }, + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + }, + { + "Field": [ + 0, + 9 + ] + } + ] + } + } + } + ] + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] + } + ] + }, + "span": 24 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 + } + ], "terminator": { "kind": "Return", - "span": 36 + "span": 20 } } ], "locals": [ { "mutability": "Mut", - "span": 37, + "span": 28, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 3, + "ty": 11 + }, + { + "mutability": "Mut", + "span": 16, + "ty": 17 + }, + { + "mutability": "Mut", + "span": 15, "ty": 1 }, { - "mutability": "Not", - "span": 38, + "mutability": "Mut", + "span": 17, "ty": 7 }, { - "mutability": "Not", - "span": 39, - "ty": 1 + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 } ], - "span": 42, + "span": 3, "spread_arg": null, "var_debug_info": [ { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "f", + "name": "main", "source_info": { "scope": 0, - "span": 38 + "span": 9 }, "value": { "Place": { "local": 1, - "projection": [] + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] } } }, { - "argument_index": null, + "argument_index": 1, "composite": null, - "name": "result", + "name": "self", "source_info": { "scope": 1, - "span": 40 + "span": 29 }, "value": { "Place": { - "local": 0, + "local": 2, "projection": [] } } @@ -1605,232 +1869,54 @@ { "argument_index": 1, "composite": null, - "name": "dummy", + "name": "self", "source_info": { "scope": 2, - "span": 41 + "span": 30 }, "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Place": { + "local": 5, + "projection": [] } } - } - ] - }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" - } - }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 21 - }, - "span": 43, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 22 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Move": { - "local": 1, - "projection": [] - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 7 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - { - "Mut": { - "kind": "Default" - } - }, - { - "local": 1, - "projection": [] - } - ] - } - ] - }, - "span": 43 - } - ], + } + ] + }, + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" + } + }, + "symbol_name": "std::rt::lang_start::{{closure}}::hd1e5b255d7ed4911" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 3, + "local": 1, "projection": [] } }, { - "Move": { - "local": 2, - "projection": [] + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null } } ], @@ -1841,212 +1927,126 @@ "func": { "Constant": { "const_": { - "id": 7, + "id": 3, "kind": "ZeroSized", - "ty": 23 + "ty": 19 }, - "span": 43, + "span": 31, "user_ty": null } }, "target": 1, - "unwind": { - "Cleanup": 3 - } + "unwind": "Continue" } }, - "span": 43 + "span": 33 } }, { "statements": [], "terminator": { "kind": { - "Drop": { - "place": { - "local": 1, + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 2, "projection": [] }, + "func": { + "Constant": { + "const_": { + "id": 5, + "kind": "ZeroSized", + "ty": 20 + }, + "span": 34, + "user_ty": null + } + }, "target": 2, - "unwind": "Continue" + "unwind": "Unreachable" } }, - "span": 43 + "span": 35 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Resume", - "span": 43 + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 43, - "ty": 16 + "span": 37, + "ty": 1 }, { "mutability": "Not", - "span": 43, - "ty": 12 + "span": 38, + "ty": 7 }, { "mutability": "Not", - "span": 43, + "span": 39, "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 24 } ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ + "span": 42, + "spread_arg": null, + "var_debug_info": [ { - "statements": [], - "terminator": { - "kind": "Return", - "span": 44 + "argument_index": 1, + "composite": null, + "name": "f", + "source_info": { + "scope": 0, + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 44, - "ty": 1 }, { - "mutability": "Not", - "span": 44, - "ty": 22 - } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] - }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" - } - }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 46, - "user_ty": null - } - } - } - ] - }, - "span": 46 + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 40 + }, + "value": { + "Place": { + "local": 0, + "projection": [] } - ], - "terminator": { - "kind": "Return", - "span": 45 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 47, - "ty": 17 }, - { - "mutability": "Not", - "span": 48, - "ty": 1 - } - ], - "span": 49, - "spread_arg": null, - "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "self", + "name": "dummy", "source_info": { - "scope": 0, - "span": 48 + "scope": 2, + "span": 41 }, "value": { "Const": { @@ -2062,11 +2062,11 @@ } ] }, - "id": 5, - "name": "<() as std::process::Termination>::report" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::he013b6cd6132de39" } ], "types": [ diff --git a/tests/integration/programs/ref-deref.smir.json.expected b/tests/integration/programs/ref-deref.smir.json.expected index 66fc7a6..cf79c8f 100644 --- a/tests/integration/programs/ref-deref.smir.json.expected +++ b/tests/integration/programs/ref-deref.smir.json.expected @@ -92,75 +92,109 @@ "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 1, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, { "kind": { "Assign": [ { - "local": 8, + "local": 0, "projection": [] }, { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 + "Use": { + "Constant": { + "const_": { + "id": 8, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] + }, + "ty": 17 + }, + "span": 46, + "user_ty": null + } + } } ] }, - "span": 3 - }, + "span": 46 + } + ], + "terminator": { + "kind": "Return", + "span": 45 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 + }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::h1db1994450c995b9" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ { "kind": { "Assign": [ { - "local": 7, + "local": 3, "projection": [] }, { @@ -168,59 +202,26 @@ { "kind": "ReErased" }, - "Shared", - { - "local": 8, - "projection": [] - } - ] - } - ] - }, - "span": 2 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, { - "Copy": { - "local": 7, - "projection": [] + "Mut": { + "kind": "Default" } }, - 5 + { + "local": 1, + "projection": [] + } ] } ] }, - "span": 2 + "span": 43 } ], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, { "Move": { "local": 3, @@ -229,371 +230,353 @@ }, { "Move": { - "local": 4, + "local": 2, "projection": [] } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 7, "kind": "ZeroSized", - "ty": 0 + "ty": 23 }, - "span": 0, + "span": 43, "user_ty": null } }, "target": 1, + "unwind": { + "Cleanup": 3 + } + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, "unwind": "Continue" } }, - "span": 1 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 5 + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 - } - ], + "span": 43 + } + }, + { + "statements": [], "terminator": { - "kind": "Return", - "span": 4 + "kind": "Resume", + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 8, - "ty": 6 - }, - { - "mutability": "Not", - "span": 9, - "ty": 7 - }, - { - "mutability": "Not", - "span": 10, - "ty": 6 - }, - { - "mutability": "Not", - "span": 11, - "ty": 8 + "span": 43, + "ty": 16 }, { "mutability": "Not", - "span": 12, - "ty": 9 - }, - { - "mutability": "Mut", - "span": 1, - "ty": 10 - }, - { - "mutability": "Mut", - "span": 2, - "ty": 5 + "span": 43, + "ty": 12 }, { "mutability": "Not", - "span": 2, - "ty": 11 + "span": 43, + "ty": 1 }, { "mutability": "Not", - "span": 3, - "ty": 12 + "span": 43, + "ty": 24 } ], - "span": 13, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - }, - { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } - } - ] + "span": 43, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "core::ops::function::FnOnce::call_once::hab130e2b51023149" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 2, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 16 - }, - { - "kind": { - "StorageLive": 3 - }, - "span": 15 - }, - { - "kind": { - "StorageLive": 4 - }, - "span": 17 - }, - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - } - ] - }, - "span": 17 - } - ], + "statements": [], "terminator": { "kind": { "Call": { - "args": [ - { - "Move": { - "local": 4, - "projection": [] - } - } - ], + "args": [], "destination": { - "local": 3, + "local": 0, "projection": [] }, "func": { - "Constant": { - "const_": { - "id": 1, - "kind": "ZeroSized", - "ty": 13 - }, - "span": 14, - "user_ty": null + "Move": { + "local": 1, + "projection": [] } }, "target": 1, "unwind": "Continue" } }, - "span": 15 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 4 - }, - "span": 19 - } - ], + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 1 + }, + { + "mutability": "Not", + "span": 43, + "ty": 7 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": ">::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::he591638444c40604" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 3, + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, "projection": [] } } ], "destination": { - "local": 2, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 2, + "id": 6, "kind": "ZeroSized", - "ty": 14 + "ty": 21 }, - "span": 18, + "span": 43, "user_ty": null } }, - "target": 2, + "target": 1, "unwind": "Continue" } }, - "span": 16 + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 16 + }, + { + "mutability": "Not", + "span": 43, + "ty": 22 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hade879db44b9b15f" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h1259421e13197a17" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 0, + "blocks": [ { "statements": [ { "kind": { - "StorageDead": 3 - }, - "span": 21 - }, - { - "kind": { - "StorageLive": 5 + "Assign": [ + { + "local": 1, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 42, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 51, + "user_ty": null + } + } + } + ] }, - "span": 22 + "span": 51 }, { "kind": { "Assign": [ { - "local": 5, + "local": 2, "projection": [] }, { @@ -603,33 +586,20 @@ }, "Shared", { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - } - ] + "local": 1, + "projection": [] } ] } ] }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 + "span": 52 }, { "kind": { "Assign": [ { - "local": 6, + "local": 3, "projection": [] }, { @@ -637,144 +607,170 @@ "Copy": { "local": 2, "projection": [ - { - "Field": [ - 0, - 15 - ] - }, - { - "Field": [ - 0, - 9 - ] - } + "Deref" ] } } } ] }, - "span": 23 - }, - { - "kind": { - "Assign": [ - { - "local": 0, + "span": 53 + } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Copy": { + "local": 3, "projection": [] - }, + } + }, + "targets": { + "branches": [ + [ + 42, + 1 + ] + ], + "otherwise": 2 + } + } + }, + "span": 50 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 54 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ { - "Cast": [ - "IntToInt", - { - "Move": { - "local": 6, - "projection": [] - } + "Constant": { + "const_": { + "id": 11, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 25, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 0 + ] + ] + } + } + }, + "ty": 26 }, - 16 - ] + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 4, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 10, + "kind": "ZeroSized", + "ty": 25 + }, + "span": 55, + "user_ty": null } - ] - }, - "span": 24 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 25 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 26 + }, + "target": null, + "unwind": "Continue" + } }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 - } - ], - "terminator": { - "kind": "Return", - "span": 20 + "span": 55 } } ], "locals": [ { "mutability": "Mut", - "span": 28, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 3, - "ty": 11 - }, - { - "mutability": "Mut", - "span": 16, - "ty": 17 + "span": 56, + "ty": 1 }, { - "mutability": "Mut", - "span": 15, - "ty": 1 + "mutability": "Not", + "span": 57, + "ty": 16 }, { - "mutability": "Mut", - "span": 17, - "ty": 7 + "mutability": "Not", + "span": 58, + "ty": 27 }, { - "mutability": "Mut", - "span": 22, - "ty": 18 + "mutability": "Not", + "span": 59, + "ty": 16 }, { "mutability": "Mut", - "span": 23, - "ty": 9 + "span": 55, + "ty": 28 } ], - "span": 3, + "span": 60, "spread_arg": null, "var_debug_info": [ { "argument_index": null, "composite": null, - "name": "main", + "name": "a", "source_info": { - "scope": 0, - "span": 9 + "scope": 1, + "span": 57 }, "value": { "Place": { "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] + "projection": [] } } }, { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "self", + "name": "b", "source_info": { - "scope": 1, - "span": 29 + "scope": 2, + "span": 58 }, "value": { "Place": { @@ -784,71 +780,187 @@ } }, { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "self", + "name": "c", "source_info": { - "scope": 2, - "span": 30 + "scope": 3, + "span": 59 }, "value": { "Place": { - "local": 5, + "local": 3, "projection": [] } } } ] }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" + "id": 6, + "name": "main" } }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "symbol_name": "ref_deref::main::hafa2aaed1169ba33" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 4, "blocks": [ { - "statements": [], + "statements": [ + { + "kind": { + "StorageLive": 5 + }, + "span": 1 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 8, + "projection": [] + }, + { + "Aggregate": [ + { + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] + }, + [ + { + "Copy": { + "local": 1, + "projection": [] + } + } + ] + ] + } + ] + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] + } + ] + } + ] + }, + "span": 2 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Cast": [ + { + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, + "projection": [] + } + }, + 5 + ] + } + ] + }, + "span": 2 + } + ], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, + "local": 6, "projection": [] } }, { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 2, + "projection": [] + } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] } } ], "destination": { - "local": 0, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 3, + "id": 0, "kind": "ZeroSized", - "ty": 19 + "ty": 0 }, - "span": 31, + "span": 0, "user_ty": null } }, @@ -856,84 +968,122 @@ "unwind": "Continue" } }, - "span": 33 + "span": 1 } }, { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "StorageDead": 6 + }, + "span": 5 + }, + { + "kind": { + "Assign": [ { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "local": 0, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 + }, + { + "Field": [ + 0, + 6 + ] + } + ] + } } } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 5, - "kind": "ZeroSized", - "ty": 20 - }, - "span": 34, - "user_ty": null - } - }, - "target": 2, - "unwind": "Unreachable" - } + ] + }, + "span": 6 }, - "span": 35 - } - }, - { - "statements": [], + { + "kind": { + "StorageDead": 8 + }, + "span": 7 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 7 + } + ], "terminator": { "kind": "Return", - "span": 36 + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 37, - "ty": 1 + "span": 8, + "ty": 6 }, { "mutability": "Not", - "span": 38, + "span": 9, "ty": 7 }, { "mutability": "Not", - "span": 39, - "ty": 1 + "span": 10, + "ty": 6 + }, + { + "mutability": "Not", + "span": 11, + "ty": 8 + }, + { + "mutability": "Not", + "span": 12, + "ty": 9 + }, + { + "mutability": "Mut", + "span": 1, + "ty": 10 + }, + { + "mutability": "Mut", + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 } ], - "span": 42, + "span": 13, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "f", + "name": "main", "source_info": { "scope": 0, - "span": 38 + "span": 9 }, "value": { "Place": { @@ -943,168 +1093,126 @@ } }, { - "argument_index": null, + "argument_index": 2, "composite": null, - "name": "result", + "name": "argc", "source_info": { - "scope": 1, - "span": 40 + "scope": 0, + "span": 10 }, "value": { "Place": { - "local": 0, + "local": 2, "projection": [] } } }, { - "argument_index": 1, + "argument_index": 3, "composite": null, - "name": "dummy", + "name": "argv", "source_info": { - "scope": 2, - "span": 41 + "scope": 0, + "span": 11 }, "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Place": { + "local": 3, + "projection": [] } } - } - ] - }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" - } - }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 21 - }, - "span": 43, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 43 - } }, { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 22 }, { - "mutability": "Not", - "span": 43, - "ty": 1 + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] + ] }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" + "symbol_name": "std::rt::lang_start::h062ecccc8fb0aca0" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 1, "blocks": [ { "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, { "kind": { "Assign": [ { - "local": 3, + "local": 4, "projection": [] }, { - "Ref": [ - { - "kind": "ReErased" - }, - { - "Mut": { - "kind": "Default" - } - }, - { + "Use": { + "Copy": { "local": 1, - "projection": [] + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] } - ] + } } ] }, - "span": 43 + "span": 17 } ], "terminator": { @@ -1113,436 +1221,357 @@ "args": [ { "Move": { - "local": 3, - "projection": [] - } - }, - { - "Move": { - "local": 2, + "local": 4, "projection": [] } } ], "destination": { - "local": 0, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 7, + "id": 1, "kind": "ZeroSized", - "ty": 23 + "ty": 13 }, - "span": 43, + "span": 14, "user_ty": null } }, "target": 1, - "unwind": { - "Cleanup": 3 - } - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 2, "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Resume", - "span": 43 + "span": 15 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 12 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 }, { - "mutability": "Not", - "span": 43, - "ty": 24 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], + "statements": [ + { + "kind": { + "StorageDead": 4 + }, + "span": 19 + } + ], "terminator": { "kind": { "Call": { - "args": [], + "args": [ + { + "Move": { + "local": 3, + "projection": [] + } + } + ], "destination": { - "local": 0, + "local": 2, "projection": [] }, "func": { - "Move": { - "local": 1, - "projection": [] - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 7 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 44 + "Constant": { + "const_": { + "id": 2, + "kind": "ZeroSized", + "ty": 14 + }, + "span": 18, + "user_ty": null + } + }, + "target": 2, + "unwind": "Continue" + } + }, + "span": 16 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 44, - "ty": 1 }, - { - "mutability": "Not", - "span": 44, - "ty": 22 - } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] - }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" - } - }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ { "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, { "kind": { "Assign": [ { - "local": 0, + "local": 5, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] + } + ] + } + ] + }, + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 6, "projection": [] }, { "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] }, - "ty": 17 - }, - "span": 46, - "user_ty": null + { + "Field": [ + 0, + 9 + ] + } + ] } } } ] }, - "span": 46 + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] + } + ] + }, + "span": 24 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 } ], "terminator": { "kind": "Return", - "span": 45 + "span": 20 } } ], "locals": [ { "mutability": "Mut", - "span": 47, + "span": 28, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 3, + "ty": 11 + }, + { + "mutability": "Mut", + "span": 16, "ty": 17 }, { - "mutability": "Not", - "span": 48, + "mutability": "Mut", + "span": 15, "ty": 1 + }, + { + "mutability": "Mut", + "span": 17, + "ty": 7 + }, + { + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 } ], - "span": 49, + "span": 3, "spread_arg": null, "var_debug_info": [ + { + "argument_index": null, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + }, { "argument_index": 1, "composite": null, "name": "self", "source_info": { - "scope": 0, - "span": 48 + "scope": 1, + "span": 29 }, "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, + "projection": [] } } } ] }, - "id": 5, - "name": "<() as std::process::Termination>::report" + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "std::rt::lang_start::{{closure}}::hb3e9d887ea373cd2" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 0, + "arg_count": 1, "blocks": [ { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 1, - "projection": [] - }, + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ { - "Use": { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 42, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 51, - "user_ty": null - } + "Move": { + "local": 1, + "projection": [] } - } - ] - }, - "span": 51 - }, - { - "kind": { - "Assign": [ - { - "local": 2, - "projection": [] }, { - "Ref": [ - { - "kind": "ReErased" + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 }, - "Shared", - { - "local": 1, - "projection": [] - } - ] - } - ] - }, - "span": 52 - }, - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 2, - "projection": [ - "Deref" - ] - } + "span": 32, + "user_ty": null } } - ] - }, - "span": 53 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Copy": { - "local": 3, - "projection": [] + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 3, + "kind": "ZeroSized", + "ty": 19 + }, + "span": 31, + "user_ty": null } }, - "targets": { - "branches": [ - [ - 42, - 1 - ] - ], - "otherwise": 2 - } + "target": 1, + "unwind": "Continue" } }, - "span": 50 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 54 + "span": 33 } }, { @@ -1554,40 +1583,9 @@ { "Constant": { "const_": { - "id": 11, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 25, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 0 - ] - ] - } - } - }, - "ty": 26 + "id": 4, + "kind": "ZeroSized", + "ty": 1 }, "span": 32, "user_ty": null @@ -1595,65 +1593,62 @@ } ], "destination": { - "local": 4, + "local": 2, "projection": [] }, "func": { "Constant": { "const_": { - "id": 10, + "id": 5, "kind": "ZeroSized", - "ty": 25 + "ty": 20 }, - "span": 55, + "span": 34, "user_ty": null } }, - "target": null, - "unwind": "Continue" + "target": 2, + "unwind": "Unreachable" } }, - "span": 55 + "span": 35 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 56, + "span": 37, "ty": 1 }, { "mutability": "Not", - "span": 57, - "ty": 16 - }, - { - "mutability": "Not", - "span": 58, - "ty": 27 + "span": 38, + "ty": 7 }, { "mutability": "Not", - "span": 59, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 55, - "ty": 28 + "span": 39, + "ty": 1 } ], - "span": 60, + "span": 42, "spread_arg": null, "var_debug_info": [ { - "argument_index": null, + "argument_index": 1, "composite": null, - "name": "a", + "name": "f", "source_info": { - "scope": 1, - "span": 57 + "scope": 0, + "span": 38 }, "value": { "Place": { @@ -1665,40 +1660,45 @@ { "argument_index": null, "composite": null, - "name": "b", + "name": "result", "source_info": { - "scope": 2, - "span": 58 + "scope": 1, + "span": 40 }, "value": { "Place": { - "local": 2, + "local": 0, "projection": [] } } }, { - "argument_index": null, + "argument_index": 1, "composite": null, - "name": "c", + "name": "dummy", "source_info": { - "scope": 3, - "span": 59 + "scope": 2, + "span": 41 }, "value": { - "Place": { - "local": 3, - "projection": [] + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null } } } ] }, - "id": 6, - "name": "main" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN9ref_deref4main17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::hcdd8860f33743a7e" } ], "types": [ diff --git a/tests/integration/programs/shl_min.smir.json.expected b/tests/integration/programs/shl_min.smir.json.expected index a555bed..f046588 100644 --- a/tests/integration/programs/shl_min.smir.json.expected +++ b/tests/integration/programs/shl_min.smir.json.expected @@ -360,75 +360,109 @@ "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 1, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, { "kind": { "Assign": [ { - "local": 8, + "local": 0, "projection": [] }, { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 + "Use": { + "Constant": { + "const_": { + "id": 8, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] + }, + "ty": 17 + }, + "span": 46, + "user_ty": null + } + } } ] }, - "span": 3 - }, + "span": 46 + } + ], + "terminator": { + "kind": "Return", + "span": 45 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 + }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::h2ab48ba267c31787" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ { "kind": { "Assign": [ { - "local": 7, + "local": 3, "projection": [] }, { @@ -436,59 +470,26 @@ { "kind": "ReErased" }, - "Shared", - { - "local": 8, - "projection": [] - } - ] - } - ] - }, - "span": 2 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, { - "Copy": { - "local": 7, - "projection": [] + "Mut": { + "kind": "Default" } }, - 5 + { + "local": 1, + "projection": [] + } ] } ] }, - "span": 2 + "span": 43 } ], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, { "Move": { "local": 3, @@ -497,300 +498,219 @@ }, { "Move": { - "local": 4, + "local": 2, "projection": [] } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 7, "kind": "ZeroSized", - "ty": 0 + "ty": 23 }, - "span": 0, + "span": 43, "user_ty": null } }, "target": 1, + "unwind": { + "Cleanup": 3 + } + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, "unwind": "Continue" } }, - "span": 1 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 5 + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 - } - ], + "span": 43 + } + }, + { + "statements": [], "terminator": { - "kind": "Return", - "span": 4 + "kind": "Resume", + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 8, - "ty": 6 - }, - { - "mutability": "Not", - "span": 9, - "ty": 7 - }, - { - "mutability": "Not", - "span": 10, - "ty": 6 - }, - { - "mutability": "Not", - "span": 11, - "ty": 8 + "span": 43, + "ty": 16 }, { "mutability": "Not", - "span": 12, - "ty": 9 - }, - { - "mutability": "Mut", - "span": 1, - "ty": 10 - }, - { - "mutability": "Mut", - "span": 2, - "ty": 5 + "span": 43, + "ty": 12 }, { "mutability": "Not", - "span": 2, - "ty": 11 + "span": 43, + "ty": 1 }, { "mutability": "Not", - "span": 3, - "ty": 12 + "span": 43, + "ty": 24 } ], - "span": 13, - "spread_arg": null, - "var_debug_info": [ + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h2b541786d9b77274" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { - "argument_index": 1, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, + "projection": [] + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 43 } }, { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 } - }, + } + ], + "locals": [ { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } + "mutability": "Mut", + "span": 43, + "ty": 1 }, { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } + "mutability": "Not", + "span": 43, + "ty": 7 }, { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } + "mutability": "Not", + "span": 43, + "ty": 1 } - ] + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 3, + "name": ">::call_once" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "core::ops::function::FnOnce::call_once::he1db7d89f7ff1441" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 2, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 16 - }, - { - "kind": { - "StorageLive": 3 - }, - "span": 15 - }, - { - "kind": { - "StorageLive": 4 - }, - "span": 17 - }, - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - } - ] - }, - "span": 17 - } - ], + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 4, - "projection": [] + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, + "projection": [] } } ], "destination": { - "local": 3, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 1, + "id": 6, "kind": "ZeroSized", - "ty": 13 + "ty": 21 }, - "span": 14, + "span": 43, "user_ty": null } }, @@ -798,468 +718,825 @@ "unwind": "Continue" } }, - "span": 15 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 4 - }, - "span": 19 - } - ], + "statements": [], "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 3, - "projection": [] - } - } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 2, - "kind": "ZeroSized", - "ty": 14 - }, - "span": 18, - "user_ty": null - } - }, - "target": 2, - "unwind": "Continue" - } - }, - "span": 16 + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 16 + }, + { + "mutability": "Not", + "span": 43, + "ty": 22 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h0745542dd23d7aca" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::hab605144174073af" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 0, + "blocks": [ { "statements": [ - { - "kind": { - "StorageDead": 3 - }, - "span": 21 - }, - { - "kind": { - "StorageLive": 5 - }, - "span": 22 - }, { "kind": { "Assign": [ { - "local": 5, + "local": 2, "projection": [] }, { - "Ref": [ + "Cast": [ + "IntToInt", { - "kind": "ReErased" + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 51, + "user_ty": null + } }, - "Shared", - { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - } - ] - } + 25 ] } ] }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - }, - { - "Field": [ - 0, - 9 - ] - } - ] - } - } - } - ] - }, - "span": 23 + "span": 52 }, { "kind": { "Assign": [ { - "local": 0, + "local": 3, "projection": [] }, { - "Cast": [ - "IntToInt", + "BinaryOp": [ + "Lt", { "Move": { - "local": 6, + "local": 2, "projection": [] } }, - 16 + { + "Constant": { + "const_": { + "id": 11, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 8, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 25 + }, + "span": 52, + "user_ty": null + } + } ] } ] }, - "span": 24 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 25 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 + "span": 52 } ], - "terminator": { - "kind": "Return", - "span": 20 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 28, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 3, - "ty": 11 - }, - { - "mutability": "Mut", - "span": 16, - "ty": 17 - }, - { - "mutability": "Mut", - "span": 15, - "ty": 1 - }, - { - "mutability": "Mut", - "span": 17, - "ty": 7 - }, - { - "mutability": "Mut", - "span": 22, - "ty": 18 - }, - { - "mutability": "Mut", - "span": 23, - "ty": 9 - } - ], - "span": 3, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": null, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 1, - "span": 29 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 2, - "span": 30 - }, - "value": { - "Place": { - "local": 5, - "projection": [] - } - } - } - ] - }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" - } - }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [], "terminator": { "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 1, - "projection": [] - } - }, - { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } + "Assert": { + "cond": { + "Move": { + "local": 3, + "projection": [] } - ], - "destination": { - "local": 0, - "projection": [] }, - "func": { - "Constant": { - "const_": { - "id": 3, - "kind": "ZeroSized", - "ty": 19 + "expected": true, + "msg": { + "Overflow": [ + "Shl", + { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 128 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 2 + }, + "span": 50, + "user_ty": null + } }, - "span": 31, - "user_ty": null - } + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 51, + "user_ty": null + } + } + ] }, "target": 1, "unwind": "Continue" } }, - "span": 33 + "span": 52 } }, { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "Assign": [ { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } - } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 5, - "kind": "ZeroSized", - "ty": 20 - }, - "span": 34, - "user_ty": null + "local": 1, + "projection": [] + }, + { + "BinaryOp": [ + "Shl", + { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 128 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 2 + }, + "span": 50, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 51, + "user_ty": null + } + } + ] + } + ] + }, + "span": 52 + } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 1, + "projection": [] } }, - "target": 2, - "unwind": "Unreachable" + "targets": { + "branches": [ + [ + 0, + 2 + ] + ], + "otherwise": 3 + } } }, - "span": 35 + "span": 53 } }, { - "statements": [], + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 55, + "user_ty": null + } + }, + 25 + ] + } + ] + }, + "span": 56 + }, + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "BinaryOp": [ + "Lt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 13, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 16, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 25 + }, + "span": 56, + "user_ty": null + } + } + ] + } + ] + }, + "span": 56 + } + ], "terminator": { - "kind": "Return", - "span": 36 + "kind": { + "Assert": { + "cond": { + "Move": { + "local": 7, + "projection": [] + } + }, + "expected": true, + "msg": { + "Overflow": [ + "Shl", + { + "Constant": { + "const_": { + "id": 12, + "kind": { + "Allocated": { + "align": 2, + "bytes": [ + 0, + 128 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 54, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 55, + "user_ty": null + } + } + ] + }, + "target": 4, + "unwind": "Continue" + } + }, + "span": 56 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 37, - "ty": 1 }, { - "mutability": "Not", - "span": 38, - "ty": 7 - }, - { - "mutability": "Not", - "span": 39, - "ty": 1 - } - ], - "span": 42, - "spread_arg": null, - "var_debug_info": [ + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 15, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 35, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 0 + ] + ] + } + } + }, + "ty": 28 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 4, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 14, + "kind": "ZeroSized", + "ty": 27 + }, + "span": 57, + "user_ty": null + } + }, + "target": null, + "unwind": "Continue" + } + }, + "span": 57 + } + }, { - "argument_index": 1, - "composite": null, - "name": "f", - "source_info": { - "scope": 0, - "span": 38 - }, - "value": { - "Place": { - "local": 1, - "projection": [] + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "BinaryOp": [ + "Shl", + { + "Constant": { + "const_": { + "id": 12, + "kind": { + "Allocated": { + "align": 2, + "bytes": [ + 0, + 128 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 26 + }, + "span": 54, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 55, + "user_ty": null + } + } + ] + } + ] + }, + "span": 56 } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 5, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 5 + ] + ], + "otherwise": 6 + } + } + }, + "span": 58 } }, { - "argument_index": null, - "composite": null, - "name": "result", - "source_info": { - "scope": 1, - "span": 40 - }, - "value": { - "Place": { - "local": 0, - "projection": [] + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 10, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 60, + "user_ty": null + } + }, + 25 + ] + } + ] + }, + "span": 61 + }, + { + "kind": { + "Assign": [ + { + "local": 11, + "projection": [] + }, + { + "BinaryOp": [ + "Lt", + { + "Move": { + "local": 10, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 17, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 32, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 25 + }, + "span": 61, + "user_ty": null + } + } + ] + } + ] + }, + "span": 61 } + ], + "terminator": { + "kind": { + "Assert": { + "cond": { + "Move": { + "local": 11, + "projection": [] + } + }, + "expected": true, + "msg": { + "Overflow": [ + "Shl", + { + "Constant": { + "const_": { + "id": 16, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 0, + 0, + 0, + 128 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 59, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 60, + "user_ty": null + } + } + ] + }, + "target": 7, + "unwind": "Continue" + } + }, + "span": 61 } }, - { - "argument_index": 1, - "composite": null, - "name": "dummy", - "source_info": { - "scope": 2, - "span": 41 - }, - "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } - } - } - ] - }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" - } - }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ { "statements": [], "terminator": { @@ -1267,444 +1544,504 @@ "Call": { "args": [ { - "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } - }, - { - "Move": { - "local": 2, - "projection": [] + "Constant": { + "const_": { + "id": 18, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 38, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 1 + ] + ] + } + } + }, + "ty": 28 + }, + "span": 32, + "user_ty": null } } ], "destination": { - "local": 0, + "local": 8, "projection": [] }, "func": { "Constant": { "const_": { - "id": 6, + "id": 14, "kind": "ZeroSized", - "ty": 21 + "ty": 27 }, - "span": 43, + "span": 62, "user_ty": null } }, - "target": 1, + "target": null, "unwind": "Continue" } }, - "span": 43 + "span": 62 } }, { - "statements": [], + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 9, + "projection": [] + }, + { + "BinaryOp": [ + "Shl", + { + "Constant": { + "const_": { + "id": 16, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 0, + 0, + 0, + 128 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 59, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 60, + "user_ty": null + } + } + ] + } + ] + }, + "span": 61 + } + ], "terminator": { - "kind": "Return", - "span": 43 + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 9, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 8 + ] + ], + "otherwise": 9 + } + } + }, + "span": 63 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 22 }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ { "statements": [ { "kind": { "Assign": [ { - "local": 3, + "local": 14, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 65, + "user_ty": null + } + }, + 25 + ] + } + ] + }, + "span": 66 + }, + { + "kind": { + "Assign": [ + { + "local": 15, "projection": [] }, { - "Ref": [ - { - "kind": "ReErased" - }, + "BinaryOp": [ + "Lt", { - "Mut": { - "kind": "Default" + "Move": { + "local": 14, + "projection": [] } }, { - "local": 1, - "projection": [] + "Constant": { + "const_": { + "id": 20, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 64, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 25 + }, + "span": 66, + "user_ty": null + } } ] } ] }, - "span": 43 + "span": 66 } ], "terminator": { "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 3, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } + "Assert": { + "cond": { + "Move": { + "local": 15, + "projection": [] } - ], - "destination": { - "local": 0, - "projection": [] }, - "func": { - "Constant": { - "const_": { - "id": 7, - "kind": "ZeroSized", - "ty": 23 + "expected": true, + "msg": { + "Overflow": [ + "Shl", + { + "Constant": { + "const_": { + "id": 19, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 128 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 29 + }, + "span": 64, + "user_ty": null + } }, - "span": 43, - "user_ty": null - } - }, - "target": 1, - "unwind": { - "Cleanup": 3 - } - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 65, + "user_ty": null + } + } + ] }, - "target": 2, + "target": 10, "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Resume", - "span": 43 + "span": 66 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 12 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 }, - { - "mutability": "Not", - "span": 43, - "ty": 24 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ { "statements": [], "terminator": { "kind": { "Call": { - "args": [], + "args": [ + { + "Constant": { + "const_": { + "id": 21, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 43, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 2 + ] + ] + } + } + }, + "ty": 28 + }, + "span": 32, + "user_ty": null + } + } + ], "destination": { - "local": 0, + "local": 12, "projection": [] }, "func": { - "Move": { - "local": 1, - "projection": [] + "Constant": { + "const_": { + "id": 14, + "kind": "ZeroSized", + "ty": 27 + }, + "span": 67, + "user_ty": null } }, - "target": 1, + "target": null, "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 7 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 44 + "span": 67 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 44, - "ty": 1 }, - { - "mutability": "Not", - "span": 44, - "ty": 22 - } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] - }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" - } - }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ { "statements": [ { "kind": { "Assign": [ { - "local": 0, + "local": 13, "projection": [] }, { - "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] + "BinaryOp": [ + "Shl", + { + "Constant": { + "const_": { + "id": 19, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 128 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } } - } + }, + "ty": 29 }, - "ty": 17 - }, - "span": 46, - "user_ty": null + "span": 64, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 65, + "user_ty": null + } } - } + ] } ] }, - "span": 46 + "span": 66 } ], "terminator": { - "kind": "Return", - "span": 45 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 47, - "ty": 17 - }, - { - "mutability": "Not", - "span": 48, - "ty": 1 - } - ], - "span": 49, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 0, - "span": 48 - }, - "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } - } - } - ] - }, - "id": 5, - "name": "<() as std::process::Termination>::report" - } - }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 0, - "blocks": [ + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 13, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 11 + ] + ], + "otherwise": 12 + } + } + }, + "span": 68 + } + }, { "statements": [ { "kind": { "Assign": [ { - "local": 2, + "local": 18, "projection": [] }, { @@ -1731,7 +2068,7 @@ }, "ty": 16 }, - "span": 51, + "span": 70, "user_ty": null } }, @@ -1740,13 +2077,13 @@ } ] }, - "span": 52 + "span": 71 }, { "kind": { "Assign": [ { - "local": 3, + "local": 19, "projection": [] }, { @@ -1754,19 +2091,19 @@ "Lt", { "Move": { - "local": 2, + "local": 18, "projection": [] } }, { "Constant": { "const_": { - "id": 11, + "id": 23, "kind": { "Allocated": { "align": 4, "bytes": [ - 8, + 128, 0, 0, 0 @@ -1779,7 +2116,7 @@ }, "ty": 25 }, - "span": 52, + "span": 71, "user_ty": null } } @@ -1787,7 +2124,7 @@ } ] }, - "span": 52 + "span": 71 } ], "terminator": { @@ -1795,7 +2132,7 @@ "Assert": { "cond": { "Move": { - "local": 3, + "local": 19, "projection": [] } }, @@ -1806,11 +2143,26 @@ { "Constant": { "const_": { - "id": 9, + "id": 22, "kind": { "Allocated": { - "align": 1, + "align": 16, "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, 128 ], "mutability": "Mut", @@ -1819,9 +2171,9 @@ } } }, - "ty": 2 + "ty": 30 }, - "span": 50, + "span": 69, "user_ty": null } }, @@ -1846,106 +2198,88 @@ }, "ty": 16 }, - "span": 51, + "span": 70, "user_ty": null } } ] }, - "target": 1, + "target": 13, "unwind": "Continue" } }, - "span": 52 + "span": 71 } }, { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 1, - "projection": [] - }, + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ { - "BinaryOp": [ - "Shl", - { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 128 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 2 - }, - "span": 50, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, + "Constant": { + "const_": { + "id": 24, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 52, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 51, - "user_ty": null - } - } - ] + 3 + ] + ] + } + } + }, + "ty": 28 + }, + "span": 32, + "user_ty": null + } } - ] - }, - "span": 52 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 1, - "projection": [] + ], + "destination": { + "local": 16, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 14, + "kind": "ZeroSized", + "ty": 27 + }, + "span": 72, + "user_ty": null } }, - "targets": { - "branches": [ - [ - 0, - 2 - ] - ], - "otherwise": 3 - } + "target": null, + "unwind": "Continue" } }, - "span": 53 + "span": 72 } }, { @@ -1954,69 +2288,58 @@ "kind": { "Assign": [ { - "local": 6, + "local": 17, "projection": [] }, { - "Cast": [ - "IntToInt", + "BinaryOp": [ + "Shl", { "Constant": { "const_": { - "id": 10, + "id": 22, "kind": { "Allocated": { - "align": 4, + "align": 16, "bytes": [ - 1, 0, 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 55, - "user_ty": null - } - }, - 25 - ] - } - ] - }, - "span": 56 - }, - { - "kind": { - "Assign": [ - { - "local": 7, - "projection": [] - }, - { - "BinaryOp": [ - "Lt", - { - "Move": { - "local": 6, - "projection": [] + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 128 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 30 + }, + "span": 69, + "user_ty": null } }, { "Constant": { "const_": { - "id": 13, + "id": 10, "kind": { "Allocated": { "align": 4, "bytes": [ - 16, + 1, 0, 0, 0 @@ -2027,9 +2350,9 @@ } } }, - "ty": 25 + "ty": 16 }, - "span": 56, + "span": 70, "user_ty": null } } @@ -2037,1258 +2360,998 @@ } ] }, - "span": 56 + "span": 71 } ], "terminator": { "kind": { - "Assert": { - "cond": { + "SwitchInt": { + "discr": { "Move": { - "local": 7, + "local": 17, "projection": [] } }, - "expected": true, - "msg": { - "Overflow": [ - "Shl", - { - "Constant": { - "const_": { - "id": 12, - "kind": { - "Allocated": { - "align": 2, - "bytes": [ - 0, - 128 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 26 - }, - "span": 54, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } + "targets": { + "branches": [ + [ + 0, + 14 + ] + ], + "otherwise": 15 + } + } + }, + "span": 73 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 74 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 25, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 73, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 4 + ] + ] } - }, - "ty": 16 + } }, - "span": 55, - "user_ty": null - } + "ty": 28 + }, + "span": 32, + "user_ty": null } - ] + } + ], + "destination": { + "local": 20, + "projection": [] }, - "target": 4, + "func": { + "Constant": { + "const_": { + "id": 14, + "kind": "ZeroSized", + "ty": 27 + }, + "span": 75, + "user_ty": null + } + }, + "target": null, "unwind": "Continue" } }, - "span": 56 + "span": 75 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 76, + "ty": 1 + }, + { + "mutability": "Mut", + "span": 52, + "ty": 2 + }, + { + "mutability": "Mut", + "span": 52, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 52, + "ty": 31 + }, + { + "mutability": "Mut", + "span": 57, + "ty": 32 + }, + { + "mutability": "Mut", + "span": 56, + "ty": 26 + }, + { + "mutability": "Mut", + "span": 56, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 56, + "ty": 31 + }, + { + "mutability": "Mut", + "span": 62, + "ty": 32 + }, + { + "mutability": "Mut", + "span": 61, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 61, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 61, + "ty": 31 + }, + { + "mutability": "Mut", + "span": 67, + "ty": 32 + }, + { + "mutability": "Mut", + "span": 66, + "ty": 29 + }, + { + "mutability": "Mut", + "span": 66, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 66, + "ty": 31 + }, + { + "mutability": "Mut", + "span": 72, + "ty": 32 + }, + { + "mutability": "Mut", + "span": 71, + "ty": 30 }, { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Constant": { - "const_": { - "id": 15, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 35, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 0 - ] - ] - } - } - }, - "ty": 28 - }, - "span": 32, - "user_ty": null - } - } - ], - "destination": { - "local": 4, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 14, - "kind": "ZeroSized", - "ty": 27 - }, - "span": 57, - "user_ty": null - } - }, - "target": null, - "unwind": "Continue" - } - }, - "span": 57 - } + "mutability": "Mut", + "span": 71, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 71, + "ty": 31 }, + { + "mutability": "Mut", + "span": 75, + "ty": 32 + } + ], + "span": 77, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 6, + "name": "main" + } + }, + "symbol_name": "shl_min::main::hd5eabd20dc15e68a" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 4, + "blocks": [ { "statements": [ + { + "kind": { + "StorageLive": 5 + }, + "span": 1 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 + }, { "kind": { "Assign": [ { - "local": 5, + "local": 8, "projection": [] }, { - "BinaryOp": [ - "Shl", + "Aggregate": [ { - "Constant": { - "const_": { - "id": 12, - "kind": { - "Allocated": { - "align": 2, - "bytes": [ - 0, - 128 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } + "Closure": [ + 1, + [ + { + "Type": 1 }, - "ty": 26 - }, - "span": 54, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } + { + "Type": 2 }, - "ty": 16 - }, - "span": 55, - "user_ty": null + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] + }, + [ + { + "Copy": { + "local": 1, + "projection": [] + } } - } + ] ] } ] }, - "span": 56 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 5, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 0, - 5 - ] - ], - "otherwise": 6 - } - } + "span": 3 }, - "span": 58 - } - }, - { - "statements": [ { "kind": { "Assign": [ { - "local": 10, + "local": 7, "projection": [] }, { - "Cast": [ - "IntToInt", + "Ref": [ { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 60, - "user_ty": null - } + "kind": "ReErased" }, - 25 + "Shared", + { + "local": 8, + "projection": [] + } ] } ] }, - "span": 61 + "span": 2 }, { "kind": { "Assign": [ { - "local": 11, + "local": 6, "projection": [] }, { - "BinaryOp": [ - "Lt", + "Cast": [ { - "Move": { - "local": 10, - "projection": [] - } + "PointerCoercion": "Unsize" }, { - "Constant": { - "const_": { - "id": 17, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 32, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 25 - }, - "span": 61, - "user_ty": null + "Copy": { + "local": 7, + "projection": [] } - } + }, + 5 ] } ] }, - "span": 61 + "span": 2 } ], - "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 11, - "projection": [] - } - }, - "expected": true, - "msg": { - "Overflow": [ - "Shl", - { - "Constant": { - "const_": { - "id": 16, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 0, - 0, - 0, - 128 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 59, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 60, - "user_ty": null - } - } - ] - }, - "target": 7, - "unwind": "Continue" - } - }, - "span": 61 - } - }, - { - "statements": [], "terminator": { "kind": { "Call": { "args": [ { - "Constant": { - "const_": { - "id": 18, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 38, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 1 - ] - ] - } - } - }, - "ty": 28 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 6, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] } } ], "destination": { - "local": 8, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 14, + "id": 0, "kind": "ZeroSized", - "ty": 27 + "ty": 0 }, - "span": 62, + "span": 0, "user_ty": null } }, - "target": null, + "target": 1, "unwind": "Continue" } }, - "span": 62 + "span": 1 } }, { "statements": [ + { + "kind": { + "StorageDead": 6 + }, + "span": 5 + }, { "kind": { "Assign": [ { - "local": 9, + "local": 0, "projection": [] }, { - "BinaryOp": [ - "Shl", - { - "Constant": { - "const_": { - "id": 16, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 0, - 0, - 0, - 128 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 59, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 }, - "span": 60, - "user_ty": null - } + { + "Field": [ + 0, + 6 + ] + } + ] } - ] + } } ] }, - "span": 61 + "span": 6 + }, + { + "kind": { + "StorageDead": 8 + }, + "span": 7 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 7 } ], "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 9, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 0, - 8 - ] - ], - "otherwise": 9 - } - } - }, - "span": 63 + "kind": "Return", + "span": 4 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 8, + "ty": 6 + }, + { + "mutability": "Not", + "span": 9, + "ty": 7 + }, + { + "mutability": "Not", + "span": 10, + "ty": 6 + }, + { + "mutability": "Not", + "span": 11, + "ty": 8 + }, + { + "mutability": "Not", + "span": 12, + "ty": 9 + }, + { + "mutability": "Mut", + "span": 1, + "ty": 10 + }, + { + "mutability": "Mut", + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 + } + ], + "span": 13, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "argc", + "source_info": { + "scope": 0, + "span": 10 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 3, + "composite": null, + "name": "argv", + "source_info": { + "scope": 0, + "span": 11 + }, + "value": { + "Place": { + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } } }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + } + ] + }, + "id": 0, + "name": "std::rt::lang_start::<()>" + } + }, + "symbol_name": "std::rt::lang_start::habd382077faec271" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ { "statements": [ { "kind": { - "Assign": [ - { - "local": 14, - "projection": [] - }, - { - "Cast": [ - "IntToInt", - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 65, - "user_ty": null - } - }, - 25 - ] - } - ] + "StorageLive": 2 }, - "span": 66 + "span": 16 }, { "kind": { - "Assign": [ - { - "local": 15, - "projection": [] - }, - { - "BinaryOp": [ - "Lt", - { - "Move": { - "local": 14, - "projection": [] - } - }, - { - "Constant": { - "const_": { - "id": 20, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 64, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 25 - }, - "span": 66, - "user_ty": null - } + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] } - ] + } } ] }, - "span": 66 + "span": 17 } ], - "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 15, - "projection": [] - } - }, - "expected": true, - "msg": { - "Overflow": [ - "Shl", - { - "Constant": { - "const_": { - "id": 19, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 128 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 29 - }, - "span": 64, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 65, - "user_ty": null - } - } - ] - }, - "target": 10, - "unwind": "Continue" - } - }, - "span": 66 - } - }, - { - "statements": [], "terminator": { "kind": { "Call": { "args": [ { - "Constant": { - "const_": { - "id": 21, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 43, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 2 - ] - ] - } - } - }, - "ty": 28 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 4, + "projection": [] } } ], "destination": { - "local": 12, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 14, + "id": 1, "kind": "ZeroSized", - "ty": 27 + "ty": 13 }, - "span": 67, + "span": 14, "user_ty": null } }, - "target": null, + "target": 1, "unwind": "Continue" } }, - "span": 67 + "span": 15 } }, { "statements": [ { "kind": { - "Assign": [ - { - "local": 13, - "projection": [] - }, - { - "BinaryOp": [ - "Shl", - { - "Constant": { - "const_": { - "id": 19, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 128 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 29 - }, - "span": 64, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 65, - "user_ty": null - } - } - ] - } - ] + "StorageDead": 4 }, - "span": 66 + "span": 19 } ], "terminator": { "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 13, - "projection": [] + "Call": { + "args": [ + { + "Move": { + "local": 3, + "projection": [] + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 2, + "kind": "ZeroSized", + "ty": 14 + }, + "span": 18, + "user_ty": null } }, - "targets": { - "branches": [ - [ - 0, - 11 - ] - ], - "otherwise": 12 - } + "target": 2, + "unwind": "Continue" } }, - "span": 68 + "span": 16 } }, { "statements": [ { "kind": { - "Assign": [ - { - "local": 18, - "projection": [] - }, - { - "Cast": [ - "IntToInt", - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 70, - "user_ty": null - } - }, - 25 - ] - } - ] + "StorageDead": 3 }, - "span": 71 + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 }, { "kind": { "Assign": [ { - "local": 19, + "local": 5, "projection": [] }, { - "BinaryOp": [ - "Lt", + "Ref": [ { - "Move": { - "local": 18, - "projection": [] - } + "kind": "ReErased" }, + "Shared", { - "Constant": { - "const_": { - "id": 23, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 128, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 25 - }, - "span": 71, - "user_ty": null - } + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] } ] } ] }, - "span": 71 - } - ], - "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 19, - "projection": [] - } - }, - "expected": true, - "msg": { - "Overflow": [ - "Shl", - { - "Constant": { - "const_": { - "id": 22, - "kind": { - "Allocated": { - "align": 16, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 128 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 30 - }, - "span": 69, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 70, - "user_ty": null - } - } - ] - }, - "target": 13, - "unwind": "Continue" - } + "span": 22 }, - "span": 71 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ { - "Constant": { - "const_": { - "id": 24, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 52, - 0, - 0, - 0, - 0, + "local": 6, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ 0, + 15 + ] + }, + { + "Field": [ 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 3 - ] - ] - } + 9 + ] } - }, - "ty": 28 - }, - "span": 32, - "user_ty": null + ] + } } } - ], - "destination": { - "local": 16, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 14, - "kind": "ZeroSized", - "ty": 27 - }, - "span": 72, - "user_ty": null - } - }, - "target": null, - "unwind": "Continue" - } + ] + }, + "span": 23 }, - "span": 72 - } - }, - { - "statements": [ { "kind": { "Assign": [ { - "local": 17, + "local": 0, "projection": [] }, { - "BinaryOp": [ - "Shl", + "Cast": [ + "IntToInt", { - "Constant": { - "const_": { - "id": 22, - "kind": { - "Allocated": { - "align": 16, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 128 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 30 - }, - "span": 69, - "user_ty": null + "Move": { + "local": 6, + "projection": [] } }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 70, - "user_ty": null - } - } + 16 ] } ] }, - "span": 71 + "span": 24 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 } ], + "terminator": { + "kind": "Return", + "span": 20 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 28, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 3, + "ty": 11 + }, + { + "mutability": "Mut", + "span": 16, + "ty": 17 + }, + { + "mutability": "Mut", + "span": 15, + "ty": 1 + }, + { + "mutability": "Mut", + "span": 17, + "ty": 7 + }, + { + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 + } + ], + "span": 3, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": null, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 29 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } + } + ] + }, + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" + } + }, + "symbol_name": "std::rt::lang_start::{{closure}}::h7005d4929f44beb7" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], "terminator": { "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 17, - "projection": [] + "Call": { + "args": [ + { + "Move": { + "local": 1, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } } + ], + "destination": { + "local": 0, + "projection": [] }, - "targets": { - "branches": [ - [ - 0, - 14 - ] - ], - "otherwise": 15 - } + "func": { + "Constant": { + "const_": { + "id": 3, + "kind": "ZeroSized", + "ty": 19 + }, + "span": 31, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" } }, - "span": 73 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 74 + "span": 33 } }, { @@ -3300,40 +3363,9 @@ { "Constant": { "const_": { - "id": 25, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 73, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 4 - ] - ] - } - } - }, - "ty": 28 + "id": 4, + "kind": "ZeroSized", + "ty": 1 }, "span": 32, "user_ty": null @@ -3341,144 +3373,112 @@ } ], "destination": { - "local": 20, + "local": 2, "projection": [] }, "func": { "Constant": { "const_": { - "id": 14, + "id": 5, "kind": "ZeroSized", - "ty": 27 + "ty": 20 }, - "span": 75, + "span": 34, "user_ty": null } }, - "target": null, - "unwind": "Continue" + "target": 2, + "unwind": "Unreachable" } }, - "span": 75 + "span": 35 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 76, + "span": 37, "ty": 1 }, { - "mutability": "Mut", - "span": 52, - "ty": 2 - }, - { - "mutability": "Mut", - "span": 52, - "ty": 25 - }, - { - "mutability": "Mut", - "span": 52, - "ty": 31 - }, - { - "mutability": "Mut", - "span": 57, - "ty": 32 - }, - { - "mutability": "Mut", - "span": 56, - "ty": 26 - }, - { - "mutability": "Mut", - "span": 56, - "ty": 25 - }, - { - "mutability": "Mut", - "span": 56, - "ty": 31 - }, - { - "mutability": "Mut", - "span": 62, - "ty": 32 - }, - { - "mutability": "Mut", - "span": 61, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 61, - "ty": 25 - }, - { - "mutability": "Mut", - "span": 61, - "ty": 31 - }, - { - "mutability": "Mut", - "span": 67, - "ty": 32 - }, - { - "mutability": "Mut", - "span": 66, - "ty": 29 - }, - { - "mutability": "Mut", - "span": 66, - "ty": 25 - }, - { - "mutability": "Mut", - "span": 66, - "ty": 31 - }, - { - "mutability": "Mut", - "span": 72, - "ty": 32 + "mutability": "Not", + "span": 38, + "ty": 7 }, { - "mutability": "Mut", - "span": 71, - "ty": 30 - }, + "mutability": "Not", + "span": 39, + "ty": 1 + } + ], + "span": 42, + "spread_arg": null, + "var_debug_info": [ { - "mutability": "Mut", - "span": 71, - "ty": 25 + "argument_index": 1, + "composite": null, + "name": "f", + "source_info": { + "scope": 0, + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } }, { - "mutability": "Mut", - "span": 71, - "ty": 31 + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 40 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } }, { - "mutability": "Mut", - "span": 75, - "ty": 32 + "argument_index": 1, + "composite": null, + "name": "dummy", + "source_info": { + "scope": 2, + "span": 41 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } } - ], - "span": 77, - "spread_arg": null, - "var_debug_info": [] + ] }, - "id": 6, - "name": "main" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN7shl_min4main17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h82de7d5eb33a8e01" } ], "types": [ diff --git a/tests/integration/programs/slice.smir.json.expected b/tests/integration/programs/slice.smir.json.expected index c5fbfe6..c0e8ed5 100644 --- a/tests/integration/programs/slice.smir.json.expected +++ b/tests/integration/programs/slice.smir.json.expected @@ -157,6 +157,256 @@ ] ], "items": [ + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 19, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 28 + }, + "span": 149, + "user_ty": null + } + } + } + ] + }, + "span": 149 + } + ], + "terminator": { + "kind": "Return", + "span": 148 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 150, + "ty": 28 + }, + { + "mutability": "Not", + "span": 151, + "ty": 12 + } + ], + "span": 152, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 151 + }, + "value": { + "Const": { + "const_": { + "id": 6, + "kind": "ZeroSized", + "ty": 12 + }, + "span": 74, + "user_ty": null + } + } + } + ] + }, + "id": 12, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::h33c0f3458c5436db" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ + { + "kind": { + "StorageLive": 3 + }, + "span": 155 + }, + { + "kind": { + "Assign": [ + { + "local": 3, + "projection": [] + }, + { + "Cast": [ + "Transmute", + { + "Copy": { + "local": 2, + "projection": [] + } + }, + 40 + ] + } + ] + }, + "span": 155 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 1, + "projection": [] + } + }, + { + "Move": { + "local": 3, + "projection": [] + } + } + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 20, + "kind": "ZeroSized", + "ty": 47 + }, + "span": 153, + "user_ty": null + } + }, + "target": 1, + "unwind": "Unreachable" + } + }, + "span": 154 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 157 + } + ], + "terminator": { + "kind": "Return", + "span": 156 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 158, + "ty": 9 + }, + { + "mutability": "Not", + "span": 159, + "ty": 40 + }, + { + "mutability": "Not", + "span": 160, + "ty": 40 + }, + { + "mutability": "Mut", + "span": 155, + "ty": 40 + } + ], + "span": 161, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "a", + "source_info": { + "scope": 0, + "span": 159 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "b", + "source_info": { + "scope": 0, + "span": 160 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + } + ] + }, + "id": 13, + "name": ">::spec_eq" + } + }, + "symbol_name": ">::spec_eq::h05cf8c7ebc067cc0" + }, { "details": null, "mono_item_kind": { @@ -1048,105 +1298,22 @@ "name": " as std::slice::SliceIndex<[i32]>>::index" } }, - "symbol_name": "_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17h" + "symbol_name": " as core::slice::index::SliceIndex<[T]>>::index::hc9dd095fa490333d" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 2, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 43 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 44 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 45 - }, - { - "kind": { - "Assign": [ - { - "local": 8, - "projection": [] - }, - { - "Aggregate": [ - { - "Closure": [ - 3, - [ - { - "Type": 12 - }, - { - "Type": 13 - }, - { - "Type": 14 - }, - { - "Type": 15 - } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] - } - ] - }, - "span": 45 - }, - { - "kind": { - "Assign": [ - { - "local": 7, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 8, - "projection": [] - } - ] - } - ] - }, - "span": 44 - }, { "kind": { "Assign": [ { - "local": 6, + "local": 3, "projection": [] }, { @@ -1156,34 +1323,22 @@ }, { "Copy": { - "local": 7, + "local": 1, "projection": [] } }, - 16 + 5 ] } ] }, - "span": 44 + "span": 89 } ], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, { "Move": { "local": 3, @@ -1192,23 +1347,23 @@ }, { "Move": { - "local": 4, + "local": 2, "projection": [] } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 2, + "id": 10, "kind": "ZeroSized", - "ty": 11 + "ty": 36 }, - "span": 42, + "span": 87, "user_ty": null } }, @@ -1216,122 +1371,49 @@ "unwind": "Continue" } }, - "span": 43 + "span": 88 } }, { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 47 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 17 - ] - } - ] - } - } - } - ] - }, - "span": 48 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 49 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 49 - } - ], + "statements": [], "terminator": { "kind": "Return", - "span": 46 + "span": 90 } } ], "locals": [ { "mutability": "Mut", - "span": 50, - "ty": 17 - }, - { - "mutability": "Not", - "span": 51, - "ty": 18 - }, - { - "mutability": "Not", - "span": 52, - "ty": 17 - }, - { - "mutability": "Not", - "span": 53, - "ty": 19 + "span": 91, + "ty": 5 }, { "mutability": "Not", - "span": 54, - "ty": 20 - }, - { - "mutability": "Mut", - "span": 43, - "ty": 21 - }, - { - "mutability": "Mut", - "span": 44, - "ty": 16 + "span": 92, + "ty": 37 }, { "mutability": "Not", - "span": 44, - "ty": 22 + "span": 93, + "ty": 6 }, { "mutability": "Not", - "span": 45, - "ty": 23 + "span": 89, + "ty": 5 } ], - "span": 55, + "span": 94, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "main", + "name": "self", "source_info": { "scope": 0, - "span": 51 + "span": 92 }, "value": { "Place": { @@ -1343,10 +1425,10 @@ { "argument_index": 2, "composite": null, - "name": "argc", + "name": "index", "source_info": { "scope": 0, - "span": 52 + "span": 93 }, "value": { "Place": { @@ -1354,92 +1436,29 @@ "projection": [] } } - }, - { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 53 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - }, - { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 54 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 48 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } - } - ] - }, - "id": 2, - "name": "std::rt::lang_start::<()>" - } - }, - "symbol_name": "_ZN3std2rt10lang_start17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ + } + ] + }, + "id": 7, + "name": "std::array::> for [i32; 4]>::index" + } + }, + "symbol_name": "core::array:: for [T; N]>::index::h8e4cb569a34f524b" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 58 - }, - { - "kind": { - "StorageLive": 3 - }, - "span": 57 - }, - { - "kind": { - "StorageLive": 4 - }, - "span": 59 - }, { "kind": { "Assign": [ { - "local": 4, + "local": 3, "projection": [] }, { @@ -1447,20 +1466,14 @@ "Copy": { "local": 1, "projection": [ - "Deref", - { - "Field": [ - 0, - 18 - ] - } + "Deref" ] } } } ] }, - "span": 59 + "span": 135 } ], "terminator": { @@ -1469,23 +1482,29 @@ "args": [ { "Move": { - "local": 4, + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 2, "projection": [] } } ], "destination": { - "local": 3, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 3, + "id": 17, "kind": "ZeroSized", - "ty": 24 + "ty": 44 }, - "span": 56, + "span": 134, "user_ty": null } }, @@ -1493,100 +1512,146 @@ "unwind": "Continue" } }, - "span": 57 + "span": 134 } }, { - "statements": [ - { - "kind": { - "StorageDead": 4 - }, - "span": 61 - } - ], + "statements": [], "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 3, - "projection": [] - } - } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 25 - }, - "span": 60, - "user_ty": null - } - }, - "target": 2, - "unwind": "Continue" - } - }, - "span": 58 + "kind": "Return", + "span": 136 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 137, + "ty": 9 + }, + { + "mutability": "Not", + "span": 138, + "ty": 45 + }, + { + "mutability": "Not", + "span": 139, + "ty": 40 + }, + { + "mutability": "Mut", + "span": 138, + "ty": 5 + } + ], + "span": 140, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 138 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } } }, + { + "argument_index": 2, + "composite": null, + "name": "other", + "source_info": { + "scope": 0, + "span": 139 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + } + ] + }, + "id": 10, + "name": "std::array::equality:: for &[i32]>::eq" + } + }, + "symbol_name": "core::array::equality:: for &[T]>::eq::h74f8bdfab07113be" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { "statements": [ { "kind": { - "StorageDead": 3 + "StorageLive": 3 }, - "span": 63 + "span": 96 }, { "kind": { "StorageLive": 5 }, - "span": 64 + "span": 97 + }, + { + "kind": { + "StorageLive": 9 + }, + "span": 98 + }, + { + "kind": { + "StorageLive": 10 + }, + "span": 98 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 95 + }, + { + "kind": { + "StorageLive": 7 + }, + "span": 99 }, { "kind": { "Assign": [ { - "local": 5, + "local": 7, "projection": [] }, { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", + "UnaryOp": [ + "PtrMetadata", { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 26 - ] - } - ] + "Copy": { + "local": 1, + "projection": [] + } } ] } ] }, - "span": 64 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 65 + "span": 99 }, { "kind": { @@ -1596,207 +1661,361 @@ "projection": [] }, { - "Use": { - "Copy": { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 26 - ] + "BinaryOp": [ + "Eq", + { + "Move": { + "local": 7, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 11, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 0 }, - { - "Field": [ - 0, - 20 - ] - } + "span": 100, + "user_ty": null + } + } + ] + } + ] + }, + "span": 95 + } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 6, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 3 + ] + ], + "otherwise": 2 + } + } + }, + "span": 95 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 102 + } + ], + "terminator": { + "kind": "Return", + "span": 101 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 7 + }, + "span": 100 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 105 + }, + { + "kind": { + "Assign": [ + { + "local": 10, + "projection": [] + }, + { + "AddressOf": [ + "Not", + { + "local": 1, + "projection": [ + "Deref" ] } - } + ] } ] }, - "span": 65 + "span": 106 }, { "kind": { "Assign": [ { - "local": 0, + "local": 8, "projection": [] }, { "Cast": [ - "IntToInt", + "PtrToPtr", { - "Move": { - "local": 6, + "Copy": { + "local": 10, "projection": [] } }, - 27 + 39 ] } ] }, - "span": 66 + "span": 107 + }, + { + "kind": { + "Assign": [ + { + "local": 9, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [ + "Deref" + ] + } + ] + } + ] + }, + "span": 108 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "Aggregate": [ + { + "Adt": [ + 1, + 1, + [ + { + "Type": 40 + } + ], + null, + null + ] + }, + [ + { + "Copy": { + "local": 9, + "projection": [] + } + } + ] + ] + } + ] + }, + "span": 109 + }, + { + "kind": { + "StorageDead": 8 + }, + "span": 110 }, { "kind": { "StorageDead": 6 }, - "span": 67 + "span": 111 }, { "kind": { - "StorageDead": 5 + "StorageDead": 10 }, - "span": 68 + "span": 98 }, { "kind": { - "StorageDead": 2 + "StorageDead": 9 }, - "span": 69 - } - ], - "terminator": { - "kind": "Return", - "span": 62 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 70, - "ty": 27 - }, - { - "mutability": "Mut", - "span": 45, - "ty": 22 - }, - { - "mutability": "Mut", - "span": 58, - "ty": 28 - }, - { - "mutability": "Mut", - "span": 57, - "ty": 12 - }, - { - "mutability": "Mut", - "span": 59, - "ty": 18 - }, - { - "mutability": "Mut", - "span": 64, - "ty": 29 - }, - { - "mutability": "Mut", - "span": 65, - "ty": 20 - } - ], - "span": 45, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": null, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 51 - }, - "value": { - "Place": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 18 - ] - } - ] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 1, - "span": 71 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 2, - "span": 72 - }, - "value": { - "Place": { - "local": 5, - "projection": [] + "span": 98 + }, + { + "kind": { + "StorageLive": 11 + }, + "span": 112 + }, + { + "kind": { + "Assign": [ + { + "local": 11, + "projection": [] + }, + { + "Use": { + "Move": { + "local": 5, + "projection": [ + { + "Downcast": 1 + }, + { + "Field": [ + 0, + 40 + ] + } + ] + } + } + } + ] + }, + "span": 113 + }, + { + "kind": { + "Assign": [ + { + "local": 3, + "projection": [] + }, + { + "Aggregate": [ + { + "Adt": [ + 9, + 0, + [ + { + "Type": 40 + }, + { + "Type": 41 + } + ], + null, + null + ] + }, + [ + { + "Copy": { + "local": 11, + "projection": [] + } + } + ] + ] + } + ] + }, + "span": 114 + }, + { + "kind": { + "StorageDead": 11 + }, + "span": 112 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 115 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 3, + "projection": [ + { + "Downcast": 0 + }, + { + "Field": [ + 0, + 40 + ] + } + ] + } + } + } + ] + }, + "span": 116 } - } - } - ] - }, - "id": 3, - "name": "std::rt::lang_start::<()>::{closure#0}" - } - }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [], + ], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, + "local": 4, "projection": [] } }, { - "Constant": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 12 - }, - "span": 74, - "user_ty": null + "Move": { + "local": 2, + "projection": [] } } ], @@ -1807,11 +2026,11 @@ "func": { "Constant": { "const_": { - "id": 5, + "id": 12, "kind": "ZeroSized", - "ty": 30 + "ty": 38 }, - "span": 73, + "span": 103, "user_ty": null } }, @@ -1819,84 +2038,255 @@ "unwind": "Continue" } }, - "span": 75 + "span": 104 } }, { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Constant": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 12 - }, - "span": 74, - "user_ty": null - } - } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 7, - "kind": "ZeroSized", - "ty": 31 - }, - "span": 76, - "user_ty": null - } - }, - "target": 2, - "unwind": "Unreachable" - } + "statements": [ + { + "kind": { + "StorageDead": 7 + }, + "span": 100 }, - "span": 77 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 78 + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 13, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 42 + }, + "span": 74, + "user_ty": null + } + } + } + ] + }, + "span": 118 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 111 + }, + { + "kind": { + "StorageDead": 10 + }, + "span": 98 + }, + { + "kind": { + "StorageDead": 9 + }, + "span": 98 + }, + { + "kind": { + "StorageLive": 11 + }, + "span": 112 + }, + { + "kind": { + "Assign": [ + { + "local": 3, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 14, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 43 + }, + "span": 74, + "user_ty": null + } + } + } + ] + }, + "span": 119 + }, + { + "kind": { + "StorageDead": 11 + }, + "span": 112 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 115 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 15, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 9 + }, + "span": 117, + "user_ty": null + } + } + } + ] + }, + "span": 117 + } + ], + "terminator": { + "kind": { + "Goto": { + "target": 1 + } + }, + "span": 117 } } ], "locals": [ { "mutability": "Mut", - "span": 79, - "ty": 12 + "span": 120, + "ty": 9 }, { "mutability": "Not", - "span": 80, - "ty": 18 + "span": 121, + "ty": 5 }, { "mutability": "Not", - "span": 81, - "ty": 12 + "span": 122, + "ty": 40 + }, + { + "mutability": "Not", + "span": 96, + "ty": 43 + }, + { + "mutability": "Not", + "span": 116, + "ty": 40 + }, + { + "mutability": "Mut", + "span": 97, + "ty": 42 + }, + { + "mutability": "Mut", + "span": 95, + "ty": 9 + }, + { + "mutability": "Mut", + "span": 99, + "ty": 0 + }, + { + "mutability": "Not", + "span": 105, + "ty": 39 + }, + { + "mutability": "Not", + "span": 123, + "ty": 40 + }, + { + "mutability": "Mut", + "span": 124, + "ty": 10 + }, + { + "mutability": "Not", + "span": 113, + "ty": 40 } ], - "span": 84, + "span": 133, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "f", + "name": "self", "source_info": { "scope": 0, - "span": 80 + "span": 121 }, "value": { "Place": { @@ -1905,133 +2295,228 @@ } } }, + { + "argument_index": 2, + "composite": null, + "name": "other", + "source_info": { + "scope": 0, + "span": 122 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, { "argument_index": null, "composite": null, - "name": "result", + "name": "b", "source_info": { "scope": 1, - "span": 82 + "span": 96 }, "value": { "Place": { - "local": 0, + "local": 3, "projection": [] } } }, { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "dummy", + "name": "b", "source_info": { "scope": 2, - "span": 83 + "span": 116 }, "value": { - "Const": { - "const_": { - "id": 6, + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 3, + "span": 125 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "slice", + "source_info": { + "scope": 4, + "span": 126 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 5, + "span": 127 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "ptr", + "source_info": { + "scope": 6, + "span": 105 + }, + "value": { + "Place": { + "local": 8, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "me", + "source_info": { + "scope": 7, + "span": 123 + }, + "value": { + "Place": { + "local": 8, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 8, + "span": 128 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 9, + "span": 129 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "err", + "source_info": { + "scope": 9, + "span": 130 + }, + "value": { + "Const": { + "const_": { + "id": 16, "kind": "ZeroSized", - "ty": 12 + "ty": 41 }, "span": 74, "user_ty": null } } - } - ] - }, - "id": 4, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" - } - }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 8, - "kind": "ZeroSized", - "ty": 32 - }, - "span": 85, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 85 - } }, { - "statements": [], - "terminator": { - "kind": "Return", - "span": 85 + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 10, + "span": 113 + }, + "value": { + "Place": { + "local": 11, + "projection": [] + } } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 85, - "ty": 27 }, { - "mutability": "Not", - "span": 85, - "ty": 33 + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 11, + "span": 131 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } }, { - "mutability": "Not", - "span": 85, - "ty": 12 + "argument_index": 2, + "composite": null, + "name": "other", + "source_info": { + "scope": 11, + "span": 132 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } } - ], - "span": 85, - "spread_arg": 2, - "var_debug_info": [] + ] }, - "id": 5, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + "id": 8, + "name": "std::array::equality:: for [i32]>::eq" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" + "symbol_name": "core::array::equality:: for [T]>::eq::h1eb20d1304d91fda" }, { "details": null, @@ -2188,7 +2673,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" + "symbol_name": "core::ops::function::FnOnce::call_once::h05003d9805ddae31" }, { "details": null, @@ -2253,26 +2738,111 @@ "name": ">::call_once" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" + "symbol_name": "core::ops::function::FnOnce::call_once::h19ff14906b46b81d" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 2, "blocks": [ { "statements": [], "terminator": { - "kind": "Return", - "span": 86 - } - } - ], - "locals": [ - { - "mutability": "Mut", + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + } + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 8, + "kind": "ZeroSized", + "ty": 32 + }, + "span": 85, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 85 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 85 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 85, + "ty": 27 + }, + { + "mutability": "Not", + "span": 85, + "ty": 33 + }, + { + "mutability": "Not", + "span": 85, + "ty": 12 + } + ], + "span": 85, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 5, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::he296d6dd3728c972" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 86 + } + } + ], + "locals": [ + { + "mutability": "Mut", "span": 86, "ty": 12 }, @@ -2290,7 +2860,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::hf29be8cdda0a7294" }, { "details": null, @@ -2300,46 +2870,20 @@ "arg_count": 2, "blocks": [ { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, - { - "Copy": { - "local": 1, - "projection": [] - } - }, - 5 - ] - } - ] - }, - "span": 89 - } - ], + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 3, + "local": 2, "projection": [] } }, { "Move": { - "local": 2, + "local": 1, "projection": [] } } @@ -2351,11 +2895,11 @@ "func": { "Constant": { "const_": { - "id": 10, + "id": 18, "kind": "ZeroSized", - "ty": 36 + "ty": 46 }, - "span": 87, + "span": 141, "user_ty": null } }, @@ -2363,40 +2907,35 @@ "unwind": "Continue" } }, - "span": 88 + "span": 142 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 90 + "span": 143 } } ], "locals": [ { "mutability": "Mut", - "span": 91, + "span": 144, "ty": 5 }, { "mutability": "Not", - "span": 92, - "ty": 37 + "span": 145, + "ty": 5 }, { "mutability": "Not", - "span": 93, + "span": 146, "ty": 6 - }, - { - "mutability": "Not", - "span": 89, - "ty": 5 } ], - "span": 94, + "span": 147, "spread_arg": null, "var_debug_info": [ { @@ -2405,7 +2944,7 @@ "name": "self", "source_info": { "scope": 0, - "span": 92 + "span": 145 }, "value": { "Place": { @@ -2420,7 +2959,7 @@ "name": "index", "source_info": { "scope": 0, - "span": 93 + "span": 146 }, "value": { "Place": { @@ -2431,232 +2970,146 @@ } ] }, - "id": 7, - "name": "std::array::> for [i32; 4]>::index" + "id": 11, + "name": "core::slice::index::> for [i32]>::index" } }, - "symbol_name": "_ZN4core5array85_$LT$impl$u20$core..ops..index..Index$LT$I$GT$$u20$for$u20$$u5b$T$u3b$$u20$N$u5d$$GT$5index17h" + "symbol_name": "core::slice::index:: for [T]>::index::h3e9fdcc8bc4b3d0e" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 0, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 3 - }, - "span": 96 - }, - { - "kind": { - "StorageLive": 5 - }, - "span": 97 - }, - { - "kind": { - "StorageLive": 9 - }, - "span": 98 - }, - { - "kind": { - "StorageLive": 10 - }, - "span": 98 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 95 - }, - { - "kind": { - "StorageLive": 7 - }, - "span": 99 - }, - { - "kind": { - "Assign": [ - { - "local": 7, - "projection": [] - }, - { - "UnaryOp": [ - "PtrMetadata", - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - } - ] - }, - "span": 99 - }, { "kind": { "Assign": [ { - "local": 6, + "local": 1, "projection": [] }, { - "BinaryOp": [ - "Eq", + "Aggregate": [ { - "Move": { - "local": 7, - "projection": [] - } + "Array": 27 }, - { - "Constant": { - "const_": { - "id": 11, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 2, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 0 - }, - "span": 100, - "user_ty": null - } - } - ] - } - ] - }, - "span": 95 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 6, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 0, - 3 - ] - ], - "otherwise": 2 - } - } - }, - "span": 95 - } - }, - { - "statements": [ - { - "kind": { - "StorageDead": 3 - }, - "span": 102 - } - ], - "terminator": { - "kind": "Return", - "span": 101 - } - }, - { - "statements": [ - { - "kind": { - "StorageDead": 7 - }, - "span": 100 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 105 - }, - { - "kind": { - "Assign": [ - { - "local": 10, - "projection": [] - }, - { - "AddressOf": [ - "Not", - { - "local": 1, - "projection": [ - "Deref" - ] - } - ] - } - ] - }, - "span": 106 - }, - { - "kind": { - "Assign": [ - { - "local": 8, - "projection": [] - }, - { - "Cast": [ - "PtrToPtr", - { - "Copy": { - "local": 10, - "projection": [] + [ + { + "Constant": { + "const_": { + "id": 22, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 1, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 27 + }, + "span": 163, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 23, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 2, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 27 + }, + "span": 164, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 24, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 3, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 27 + }, + "span": 165, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 25, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 4, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 27 + }, + "span": 166, + "user_ty": null + } } - }, - 39 + ] ] } ] }, - "span": 107 + "span": 167 }, { "kind": { "Assign": [ { - "local": 9, + "local": 4, "projection": [] }, { @@ -2666,16 +3119,14 @@ }, "Shared", { - "local": 8, - "projection": [ - "Deref" - ] + "local": 1, + "projection": [] } ] } ] }, - "span": 108 + "span": 168 }, { "kind": { @@ -2688,11 +3139,11 @@ "Aggregate": [ { "Adt": [ - 1, - 1, + 15, + 0, [ { - "Type": 40 + "Type": 0 } ], null, @@ -2701,107 +3152,61 @@ }, [ { - "Copy": { - "local": 9, - "projection": [] + "Constant": { + "const_": { + "id": 26, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 0 + }, + "span": 169, + "user_ty": null } - } - ] - ] - } - ] - }, - "span": 109 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 110 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 111 - }, - { - "kind": { - "StorageDead": 10 - }, - "span": 98 - }, - { - "kind": { - "StorageDead": 9 - }, - "span": 98 - }, - { - "kind": { - "StorageLive": 11 - }, - "span": 112 - }, - { - "kind": { - "Assign": [ - { - "local": 11, - "projection": [] - }, - { - "Use": { - "Move": { - "local": 5, - "projection": [ - { - "Downcast": 1 - }, - { - "Field": [ - 0, - 40 - ] - } - ] - } - } - } - ] - }, - "span": 113 - }, - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Aggregate": [ - { - "Adt": [ - 9, - 0, - [ - { - "Type": 40 - }, - { - "Type": 41 - } - ], - null, - null - ] - }, - [ + }, { - "Copy": { - "local": 11, - "projection": [] + "Constant": { + "const_": { + "id": 27, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 3, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 0 + }, + "span": 170, + "user_ty": null } } ] @@ -2809,48 +3214,7 @@ } ] }, - "span": 114 - }, - { - "kind": { - "StorageDead": 11 - }, - "span": 112 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 115 - }, - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 3, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 40 - ] - } - ] - } - } - } - ] - }, - "span": 116 + "span": 171 } ], "terminator": { @@ -2865,23 +3229,23 @@ }, { "Move": { - "local": 2, + "local": 5, "projection": [] } } ], "destination": { - "local": 0, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 12, + "id": 21, "kind": "ZeroSized", - "ty": 38 + "ty": 48 }, - "span": 103, + "span": 162, "user_ty": null } }, @@ -2889,95 +3253,65 @@ "unwind": "Continue" } }, - "span": 104 + "span": 162 } }, { "statements": [ - { - "kind": { - "StorageDead": 7 - }, - "span": 100 - }, { "kind": { "Assign": [ { - "local": 5, + "local": 2, "projection": [] }, { "Use": { - "Constant": { - "const_": { - "id": 13, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 42 - }, - "span": 74, - "user_ty": null + "Copy": { + "local": 3, + "projection": [] } } } ] }, - "span": 118 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 111 - }, - { - "kind": { - "StorageDead": 10 - }, - "span": 98 - }, - { - "kind": { - "StorageDead": 9 - }, - "span": 98 + "span": 173 }, { "kind": { - "StorageLive": 11 + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [] + } + ] + } + ] }, - "span": 112 + "span": 174 }, { "kind": { "Assign": [ { - "local": 3, + "local": 8, "projection": [] }, { "Use": { "Constant": { "const_": { - "id": 14, + "id": 29, "kind": { "Allocated": { "align": 8, @@ -2993,151 +3327,232 @@ ], "mutability": "Mut", "provenance": { - "ptrs": [] + "ptrs": [ + [ + 0, + 0 + ] + ] } } }, - "ty": 43 + "ty": 40 }, - "span": 74, + "span": 175, "user_ty": null } } } ] }, - "span": 119 - }, - { - "kind": { - "StorageDead": 11 - }, - "span": 112 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 115 - }, - { - "kind": { - "Assign": [ + "span": 175 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ { - "local": 0, - "projection": [] + "Move": { + "local": 7, + "projection": [] + } }, { - "Use": { - "Constant": { - "const_": { - "id": 15, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 9 - }, - "span": 117, - "user_ty": null - } + "Move": { + "local": 8, + "projection": [] } } - ] - }, - "span": 117 - } - ], + ], + "destination": { + "local": 6, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 28, + "kind": "ZeroSized", + "ty": 49 + }, + "span": 172, + "user_ty": null + } + }, + "target": 2, + "unwind": "Continue" + } + }, + "span": 172 + } + }, + { + "statements": [], "terminator": { "kind": { - "Goto": { - "target": 1 + "SwitchInt": { + "discr": { + "Move": { + "local": 6, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 4 + ] + ], + "otherwise": 3 + } } }, - "span": 117 + "span": 172 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 176 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 31, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 29, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 1 + ] + ] + } + } + }, + "ty": 51 + }, + "span": 74, + "user_ty": null + } + } + ], + "destination": { + "local": 9, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 30, + "kind": "ZeroSized", + "ty": 50 + }, + "span": 177, + "user_ty": null + } + }, + "target": null, + "unwind": "Continue" + } + }, + "span": 177 } } ], "locals": [ { "mutability": "Mut", - "span": 120, - "ty": 9 + "span": 178, + "ty": 12 }, { "mutability": "Not", - "span": 121, - "ty": 5 + "span": 179, + "ty": 52 }, { "mutability": "Not", - "span": 122, - "ty": 40 + "span": 180, + "ty": 5 }, { "mutability": "Not", - "span": 96, - "ty": 43 + "span": 162, + "ty": 5 }, { - "mutability": "Not", - "span": 116, - "ty": 40 + "mutability": "Mut", + "span": 168, + "ty": 37 }, { "mutability": "Mut", - "span": 97, - "ty": 42 + "span": 171, + "ty": 6 }, { "mutability": "Mut", - "span": 95, + "span": 172, "ty": 9 }, { "mutability": "Mut", - "span": 99, - "ty": 0 - }, - { - "mutability": "Not", - "span": 105, - "ty": 39 + "span": 174, + "ty": 45 }, { - "mutability": "Not", - "span": 123, + "mutability": "Mut", + "span": 175, "ty": 40 }, { "mutability": "Mut", - "span": 124, - "ty": 10 - }, - { - "mutability": "Not", - "span": 113, - "ty": 40 + "span": 177, + "ty": 7 } ], - "span": 133, + "span": 181, "spread_arg": null, "var_debug_info": [ { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "self", + "name": "a", "source_info": { - "scope": 0, - "span": 121 + "scope": 1, + "span": 179 }, "value": { "Place": { @@ -3147,12 +3562,12 @@ } }, { - "argument_index": 2, + "argument_index": null, "composite": null, - "name": "other", + "name": "b", "source_info": { - "scope": 0, - "span": 122 + "scope": 2, + "span": 180 }, "value": { "Place": { @@ -3160,684 +3575,75 @@ "projection": [] } } - }, - { - "argument_index": null, - "composite": null, - "name": "b", - "source_info": { - "scope": 1, - "span": 96 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "b", - "source_info": { - "scope": 2, - "span": 116 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 3, - "span": 125 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "slice", - "source_info": { - "scope": 4, - "span": 126 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 5, - "span": 127 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "ptr", - "source_info": { - "scope": 6, - "span": 105 - }, - "value": { - "Place": { - "local": 8, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "me", - "source_info": { - "scope": 7, - "span": 123 - }, - "value": { - "Place": { - "local": 8, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 8, - "span": 128 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 9, - "span": 129 - }, - "value": { - "Place": { - "local": 5, - "projection": [] - } - } - }, - { - "argument_index": 2, - "composite": null, - "name": "err", - "source_info": { - "scope": 9, - "span": 130 - }, - "value": { - "Const": { - "const_": { - "id": 16, - "kind": "ZeroSized", - "ty": 41 - }, - "span": 74, - "user_ty": null - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 10, - "span": 113 - }, - "value": { - "Place": { - "local": 11, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 11, - "span": 131 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } - }, - { - "argument_index": 2, - "composite": null, - "name": "other", - "source_info": { - "scope": 11, - "span": 132 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - } - ] - }, - "id": 8, - "name": "std::array::equality:: for [i32]>::eq" - } - }, - "symbol_name": "_ZN4core5array8equality92_$LT$impl$u20$core..cmp..PartialEq$LT$$u5b$U$u3b$$u20$N$u5d$$GT$$u20$for$u20$$u5b$T$u5d$$GT$2eq17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref" - ] - } - } - } - ] - }, - "span": 135 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 3, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 17, - "kind": "ZeroSized", - "ty": 44 - }, - "span": 134, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 134 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 136 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 137, - "ty": 9 - }, - { - "mutability": "Not", - "span": 138, - "ty": 45 - }, - { - "mutability": "Not", - "span": 139, - "ty": 40 - }, - { - "mutability": "Mut", - "span": 138, - "ty": 5 - } - ], - "span": 140, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 0, - "span": 138 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 2, - "composite": null, - "name": "other", - "source_info": { - "scope": 0, - "span": 139 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - } - ] - }, - "id": 10, - "name": "std::array::equality:: for &[i32]>::eq" - } - }, - "symbol_name": "_ZN4core5array8equality96_$LT$impl$u20$core..cmp..PartialEq$LT$$u5b$U$u3b$$u20$N$u5d$$GT$$u20$for$u20$$RF$$u5b$T$u5d$$GT$2eq17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 2, - "projection": [] - } - }, - { - "Move": { - "local": 1, - "projection": [] - } - } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 18, - "kind": "ZeroSized", - "ty": 46 - }, - "span": 141, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 142 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 143 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 144, - "ty": 5 - }, - { - "mutability": "Not", - "span": 145, - "ty": 5 - }, - { - "mutability": "Not", - "span": 146, - "ty": 6 - } - ], - "span": 147, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 0, - "span": 145 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 2, - "composite": null, - "name": "index", - "source_info": { - "scope": 0, - "span": 146 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - } - ] - }, - "id": 11, - "name": "core::slice::index::> for [i32]>::index" - } - }, - "symbol_name": "_ZN4core5slice5index74_$LT$impl$u20$core..ops..index..Index$LT$I$GT$$u20$for$u20$$u5b$T$u5d$$GT$5index17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 19, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 28 - }, - "span": 149, - "user_ty": null - } - } - } - ] - }, - "span": 149 - } - ], - "terminator": { - "kind": "Return", - "span": 148 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 150, - "ty": 28 - }, - { - "mutability": "Not", - "span": 151, - "ty": 12 - } - ], - "span": 152, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 0, - "span": 151 - }, - "value": { - "Const": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 12 - }, - "span": 74, - "user_ty": null - } - } } ] - }, - "id": 12, - "name": "<() as std::process::Termination>::report" + }, + "id": 14, + "name": "main" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "slice::main::h59a7158e62ef4fe0" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 0, + "arg_count": 4, "blocks": [ { "statements": [ + { + "kind": { + "StorageLive": 5 + }, + "span": 43 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 44 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 45 + }, { "kind": { "Assign": [ { - "local": 1, + "local": 8, "projection": [] }, { "Aggregate": [ { - "Array": 27 - }, - [ - { - "Constant": { - "const_": { - "id": 22, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 1, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 27 + "Closure": [ + 3, + [ + { + "Type": 12 }, - "span": 163, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 23, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 2, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 27 + { + "Type": 13 }, - "span": 164, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 24, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 3, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 27 + { + "Type": 14 }, - "span": 165, - "user_ty": null - } - }, + { + "Type": 15 + } + ] + ] + }, + [ { - "Constant": { - "const_": { - "id": 25, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 4, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 27 - }, - "span": 166, - "user_ty": null + "Copy": { + "local": 1, + "projection": [] } } ] @@ -3845,13 +3651,13 @@ } ] }, - "span": 167 + "span": 45 }, { "kind": { "Assign": [ { - "local": 4, + "local": 7, "projection": [] }, { @@ -3861,102 +3667,39 @@ }, "Shared", { - "local": 1, + "local": 8, "projection": [] } ] } ] }, - "span": 168 + "span": 44 }, { "kind": { "Assign": [ { - "local": 5, + "local": 6, "projection": [] }, { - "Aggregate": [ + "Cast": [ { - "Adt": [ - 15, - 0, - [ - { - "Type": 0 - } - ], - null, - null - ] + "PointerCoercion": "Unsize" }, - [ - { - "Constant": { - "const_": { - "id": 26, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 0 - }, - "span": 169, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 27, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 3, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 0 - }, - "span": 170, - "user_ty": null - } + { + "Copy": { + "local": 7, + "projection": [] } - ] + }, + 16 ] } ] }, - "span": 171 + "span": 44 } ], "terminator": { @@ -3965,29 +3708,41 @@ "args": [ { "Move": { - "local": 4, + "local": 6, "projection": [] } }, { "Move": { - "local": 5, + "local": 2, + "projection": [] + } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, "projection": [] } } ], "destination": { - "local": 3, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 21, + "id": 2, "kind": "ZeroSized", - "ty": 48 + "ty": 11 }, - "span": 162, + "span": 42, "user_ty": null } }, @@ -3995,99 +3750,251 @@ "unwind": "Continue" } }, - "span": 162 + "span": 43 } }, { "statements": [ + { + "kind": { + "StorageDead": 6 + }, + "span": 47 + }, { "kind": { "Assign": [ { - "local": 2, + "local": 0, "projection": [] }, { "Use": { "Copy": { - "local": 3, - "projection": [] + "local": 5, + "projection": [ + { + "Downcast": 0 + }, + { + "Field": [ + 0, + 17 + ] + } + ] } } } ] }, - "span": 173 + "span": 48 }, { "kind": { - "Assign": [ - { - "local": 7, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 2, - "projection": [] - } - ] - } - ] + "StorageDead": 8 }, - "span": 174 + "span": 49 }, { "kind": { - "Assign": [ - { - "local": 8, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 29, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 0 - ] - ] - } - } - }, - "ty": 40 - }, - "span": 175, - "user_ty": null + "StorageDead": 5 + }, + "span": 49 + } + ], + "terminator": { + "kind": "Return", + "span": 46 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 50, + "ty": 17 + }, + { + "mutability": "Not", + "span": 51, + "ty": 18 + }, + { + "mutability": "Not", + "span": 52, + "ty": 17 + }, + { + "mutability": "Not", + "span": 53, + "ty": 19 + }, + { + "mutability": "Not", + "span": 54, + "ty": 20 + }, + { + "mutability": "Mut", + "span": 43, + "ty": 21 + }, + { + "mutability": "Mut", + "span": 44, + "ty": 16 + }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + }, + { + "mutability": "Not", + "span": 45, + "ty": 23 + } + ], + "span": 55, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 51 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "argc", + "source_info": { + "scope": 0, + "span": 52 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 3, + "composite": null, + "name": "argv", + "source_info": { + "scope": 0, + "span": 53 + }, + "value": { + "Place": { + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 54 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 48 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + } + ] + }, + "id": 2, + "name": "std::rt::lang_start::<()>" + } + }, + "symbol_name": "std::rt::lang_start::hdeca08713139f399" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 58 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 57 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 59 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 18 + ] + } + ] } } } ] }, - "span": 175 + "span": 59 } ], "terminator": { @@ -4096,275 +4003,315 @@ "args": [ { "Move": { - "local": 7, - "projection": [] - } - }, - { - "Move": { - "local": 8, + "local": 4, "projection": [] } } ], "destination": { - "local": 6, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 28, + "id": 3, "kind": "ZeroSized", - "ty": 49 + "ty": 24 }, - "span": 172, + "span": 56, "user_ty": null } }, - "target": 2, + "target": 1, "unwind": "Continue" } }, - "span": 172 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 6, - "projection": [] - } - }, - "targets": { - "branches": [ - [ - 0, - 4 - ] - ], - "otherwise": 3 - } - } - }, - "span": 172 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 176 + "span": 57 } }, { - "statements": [], + "statements": [ + { + "kind": { + "StorageDead": 4 + }, + "span": 61 + } + ], "terminator": { "kind": { "Call": { "args": [ { - "Constant": { - "const_": { - "id": 31, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 29, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 1 - ] - ] - } - } - }, - "ty": 51 - }, - "span": 74, - "user_ty": null + "Move": { + "local": 3, + "projection": [] } } ], "destination": { - "local": 9, + "local": 2, "projection": [] }, "func": { "Constant": { "const_": { - "id": 30, + "id": 4, "kind": "ZeroSized", - "ty": 50 + "ty": 25 }, - "span": 177, + "span": 60, "user_ty": null } }, - "target": null, + "target": 2, "unwind": "Continue" } }, - "span": 177 + "span": 58 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 63 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 64 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 26 + ] + } + ] + } + ] + } + ] + }, + "span": 64 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 65 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 26 + ] + }, + { + "Field": [ + 0, + 20 + ] + } + ] + } + } + } + ] + }, + "span": 65 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 27 + ] + } + ] + }, + "span": 66 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 67 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 68 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 69 + } + ], + "terminator": { + "kind": "Return", + "span": 62 } } ], "locals": [ { "mutability": "Mut", - "span": 178, - "ty": 12 - }, - { - "mutability": "Not", - "span": 179, - "ty": 52 - }, - { - "mutability": "Not", - "span": 180, - "ty": 5 - }, - { - "mutability": "Not", - "span": 162, - "ty": 5 + "span": 70, + "ty": 27 }, { "mutability": "Mut", - "span": 168, - "ty": 37 + "span": 45, + "ty": 22 }, { "mutability": "Mut", - "span": 171, - "ty": 6 + "span": 58, + "ty": 28 }, { "mutability": "Mut", - "span": 172, - "ty": 9 + "span": 57, + "ty": 12 }, { "mutability": "Mut", - "span": 174, - "ty": 45 + "span": 59, + "ty": 18 }, { "mutability": "Mut", - "span": 175, - "ty": 40 + "span": 64, + "ty": 29 }, { "mutability": "Mut", - "span": 177, - "ty": 7 + "span": 65, + "ty": 20 } ], - "span": 181, + "span": 45, "spread_arg": null, "var_debug_info": [ { "argument_index": null, "composite": null, - "name": "a", + "name": "main", "source_info": { - "scope": 1, - "span": 179 + "scope": 0, + "span": 51 }, "value": { "Place": { "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 18 + ] + } + ] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 71 + }, + "value": { + "Place": { + "local": 2, "projection": [] } } }, { - "argument_index": null, + "argument_index": 1, "composite": null, - "name": "b", + "name": "self", "source_info": { "scope": 2, - "span": 180 + "span": 72 }, "value": { "Place": { - "local": 2, + "local": 5, "projection": [] } } } ] }, - "id": 14, - "name": "main" + "id": 3, + "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "_ZN5slice4main17h" + "symbol_name": "std::rt::lang_start::{{closure}}::hae08aa071878c147" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 1, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 3 - }, - "span": 155 - }, - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Cast": [ - "Transmute", - { - "Copy": { - "local": 2, - "projection": [] - } - }, - 40 - ] - } - ] - }, - "span": 155 - } - ], + "statements": [], "terminator": { "kind": { "Call": { @@ -4376,9 +4323,14 @@ } }, { - "Move": { - "local": 3, - "projection": [] + "Constant": { + "const_": { + "id": 6, + "kind": "ZeroSized", + "ty": 12 + }, + "span": 74, + "user_ty": null } } ], @@ -4389,68 +4341,96 @@ "func": { "Constant": { "const_": { - "id": 20, + "id": 5, "kind": "ZeroSized", - "ty": 47 + "ty": 30 }, - "span": 153, + "span": 73, "user_ty": null } }, "target": 1, + "unwind": "Continue" + } + }, + "span": 75 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 6, + "kind": "ZeroSized", + "ty": 12 + }, + "span": 74, + "user_ty": null + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 7, + "kind": "ZeroSized", + "ty": 31 + }, + "span": 76, + "user_ty": null + } + }, + "target": 2, "unwind": "Unreachable" } }, - "span": 154 + "span": 77 } }, { - "statements": [ - { - "kind": { - "StorageDead": 3 - }, - "span": 157 - } - ], + "statements": [], "terminator": { "kind": "Return", - "span": 156 + "span": 78 } } ], "locals": [ { "mutability": "Mut", - "span": 158, - "ty": 9 + "span": 79, + "ty": 12 }, { "mutability": "Not", - "span": 159, - "ty": 40 + "span": 80, + "ty": 18 }, { "mutability": "Not", - "span": 160, - "ty": 40 - }, - { - "mutability": "Mut", - "span": 155, - "ty": 40 + "span": 81, + "ty": 12 } ], - "span": 161, + "span": 84, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "a", + "name": "f", "source_info": { "scope": 0, - "span": 159 + "span": 80 }, "value": { "Place": { @@ -4460,27 +4440,47 @@ } }, { - "argument_index": 2, + "argument_index": null, "composite": null, - "name": "b", + "name": "result", "source_info": { - "scope": 0, - "span": 160 + "scope": 1, + "span": 82 }, "value": { "Place": { - "local": 2, + "local": 0, "projection": [] } } + }, + { + "argument_index": 1, + "composite": null, + "name": "dummy", + "source_info": { + "scope": 2, + "span": 83 + }, + "value": { + "Const": { + "const_": { + "id": 6, + "kind": "ZeroSized", + "ty": 12 + }, + "span": 74, + "user_ty": null + } + } } ] }, - "id": 13, - "name": ">::spec_eq" + "id": 4, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN69_$LT$T$u20$as$u20$core..array..equality..SpecArrayEq$LT$U$C$_$GT$$GT$7spec_eq17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h59c8bf3bd83534f6" } ], "types": [ diff --git a/tests/integration/programs/strange-ref-deref.smir.json.expected b/tests/integration/programs/strange-ref-deref.smir.json.expected index 56a480e..9e218c8 100644 --- a/tests/integration/programs/strange-ref-deref.smir.json.expected +++ b/tests/integration/programs/strange-ref-deref.smir.json.expected @@ -93,7 +93,7 @@ "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 0, + "arg_count": 1, "blocks": [ { "statements": [ @@ -101,21 +101,18 @@ "kind": { "Assign": [ { - "local": 1, + "local": 0, "projection": [] }, { "Use": { "Constant": { "const_": { - "id": 9, + "id": 8, "kind": { "Allocated": { - "align": 4, + "align": 1, "bytes": [ - 42, - 0, - 0, 0 ], "mutability": "Mut", @@ -124,40 +121,141 @@ } } }, - "ty": 16 + "ty": 17 }, - "span": 51, + "span": 46, "user_ty": null } } } ] }, - "span": 51 - }, - { - "kind": { - "Assign": [ - { - "local": 2, + "span": 46 + } + ], + "terminator": { + "kind": "Return", + "span": 45 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 + }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::hfb524dfebcdc543d" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 1, - "projection": [] - } - ] } - ] - }, - "span": 52 + }, + "target": 1, + "unwind": "Continue" + } }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 1 + }, + { + "mutability": "Not", + "span": 43, + "ty": 7 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": ">::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h3bb9aeeec65c1bd8" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ { "kind": { "Assign": [ @@ -170,107 +268,149 @@ { "kind": "ReErased" }, - "Shared", { - "local": 2, + "Mut": { + "kind": "Default" + } + }, + { + "local": 1, "projection": [] } ] } ] }, - "span": 53 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, + "span": 43 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ { - "CopyForDeref": { + "Move": { "local": 3, - "projection": [ - "Deref" - ] - } - } - ] - }, - "span": 53 - }, - { - "kind": { - "Assign": [ - { - "local": 2, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 6, - "projection": [] - } + "projection": [] } - } - ] - }, - "span": 54 - }, - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] }, { - "Use": { - "Copy": { - "local": 2, - "projection": [ - "Deref" - ] - } + "Move": { + "local": 2, + "projection": [] } } - ] - }, - "span": 55 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 4, - "projection": [] + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 7, + "kind": "ZeroSized", + "ty": 23 + }, + "span": 43, + "user_ty": null } }, - "targets": { - "branches": [ - [ - 42, - 1 - ] - ], - "otherwise": 2 + "target": 1, + "unwind": { + "Cleanup": 3 } } }, - "span": 50 + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, + "unwind": "Continue" + } + }, + "span": 43 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 56 + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Resume", + "span": 43 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 16 + }, + { + "mutability": "Not", + "span": 43, + "ty": 12 }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + }, + { + "mutability": "Not", + "span": 43, + "ty": 24 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h3c3d8fbc4259f4e9" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { "statements": [], "terminator": { @@ -278,178 +418,143 @@ "Call": { "args": [ { - "Constant": { - "const_": { - "id": 11, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 26, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 0 - ] - ] - } - } - }, - "ty": 26 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, + "projection": [] } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 10, + "id": 6, "kind": "ZeroSized", - "ty": 25 + "ty": 21 }, - "span": 57, + "span": 43, "user_ty": null } }, - "target": null, + "target": 1, "unwind": "Continue" } }, - "span": 57 + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 58, - "ty": 1 - }, - { - "mutability": "Not", - "span": 59, + "span": 43, "ty": 16 }, - { - "mutability": "Mut", - "span": 60, - "ty": 27 - }, { "mutability": "Not", - "span": 53, - "ty": 28 - }, - { - "mutability": "Mut", - "span": 55, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 57, - "ty": 29 + "span": 43, + "ty": 22 }, { - "mutability": "Mut", - "span": 53, - "ty": 27 + "mutability": "Not", + "span": 43, + "ty": 1 } ], - "span": 61, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": null, - "composite": null, - "name": "a", - "source_info": { - "scope": 1, - "span": 59 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "b", - "source_info": { - "scope": 2, - "span": 60 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - } - ] + "span": 43, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 6, - "name": "main" + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "_ZN17strange_ref_deref4main17h" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hc802067d8a5ee7c8" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 1, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, - { - "kind": { + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 + }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::he5740e6e2ff2dc90" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 4, + "blocks": [ + { + "statements": [ + { + "kind": { + "StorageLive": 5 + }, + "span": 1 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 + }, + { + "kind": { "Assign": [ { "local": 8, @@ -777,7 +882,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "std::rt::lang_start::hb1e93a038b3c83aa" }, { "details": null, @@ -1138,7 +1243,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "symbol_name": "std::rt::lang_start::{{closure}}::h7d386711b55735fd" }, { "details": null, @@ -1317,172 +1422,60 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h7a74d30cfdff2a0b" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 0, "blocks": [ { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "Assign": [ { - "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } + "local": 1, + "projection": [] }, { - "Move": { - "local": 2, - "projection": [] + "Use": { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 42, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 51, + "user_ty": null + } } } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 21 - }, - "span": 43, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 22 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Move": { - "local": 1, - "projection": [] - } - }, - "target": 1, - "unwind": "Continue" - } + ] + }, + "span": 51 }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 7 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [ { "kind": { "Assign": [ { - "local": 3, + "local": 2, "projection": [] }, { @@ -1490,11 +1483,7 @@ { "kind": "ReErased" }, - { - "Mut": { - "kind": "Default" - } - }, + "Shared", { "local": 1, "projection": [] @@ -1503,259 +1492,270 @@ } ] }, - "span": 43 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ + "span": 52 + }, + { + "kind": { + "Assign": [ { - "Move": { + "local": 3, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [] + } + ] + } + ] + }, + "span": 53 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "CopyForDeref": { "local": 3, - "projection": [] + "projection": [ + "Deref" + ] } + } + ] + }, + "span": 53 + }, + { + "kind": { + "Assign": [ + { + "local": 2, + "projection": [] }, { - "Move": { - "local": 2, - "projection": [] + "Use": { + "Copy": { + "local": 6, + "projection": [] + } } } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 7, - "kind": "ZeroSized", - "ty": 23 - }, - "span": 43, - "user_ty": null - } - }, - "target": 1, - "unwind": { - "Cleanup": 3 - } - } + ] + }, + "span": 54 }, - "span": 43 - } - }, - { - "statements": [], + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 2, + "projection": [ + "Deref" + ] + } + } + } + ] + }, + "span": 55 + } + ], "terminator": { "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] + "SwitchInt": { + "discr": { + "Move": { + "local": 4, + "projection": [] + } }, - "target": 2, - "unwind": "Continue" + "targets": { + "branches": [ + [ + 42, + 1 + ] + ], + "otherwise": 2 + } } }, - "span": 43 + "span": 50 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 43 + "span": 56 } }, { "statements": [], "terminator": { "kind": { - "Drop": { - "place": { - "local": 1, + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 11, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 26, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 0 + ] + ] + } + } + }, + "ty": 26 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 5, "projection": [] }, - "target": 4, - "unwind": "Terminate" + "func": { + "Constant": { + "const_": { + "id": 10, + "kind": "ZeroSized", + "ty": 25 + }, + "span": 57, + "user_ty": null + } + }, + "target": null, + "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Resume", - "span": 43 + "span": 57 } } ], "locals": [ { "mutability": "Mut", - "span": 43, - "ty": 16 + "span": 58, + "ty": 1 }, { "mutability": "Not", - "span": 43, - "ty": 12 + "span": 59, + "ty": 16 }, { - "mutability": "Not", - "span": 43, - "ty": 1 + "mutability": "Mut", + "span": 60, + "ty": 27 }, { "mutability": "Not", - "span": 43, - "ty": 24 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ + "span": 53, + "ty": 28 + }, { - "statements": [], - "terminator": { - "kind": "Return", - "span": 44 - } - } - ], - "locals": [ + "mutability": "Mut", + "span": 55, + "ty": 16 + }, { "mutability": "Mut", - "span": 44, - "ty": 1 + "span": 57, + "ty": 29 }, { - "mutability": "Not", - "span": 44, - "ty": 22 + "mutability": "Mut", + "span": 53, + "ty": 27 } ], - "span": 44, + "span": 61, "spread_arg": null, - "var_debug_info": [] - }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" - } - }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ + "var_debug_info": [ { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 46, - "user_ty": null - } - } - } - ] - }, - "span": 46 + "argument_index": null, + "composite": null, + "name": "a", + "source_info": { + "scope": 1, + "span": 59 + }, + "value": { + "Place": { + "local": 1, + "projection": [] } - ], - "terminator": { - "kind": "Return", - "span": 45 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 47, - "ty": 17 }, { - "mutability": "Not", - "span": 48, - "ty": 1 - } - ], - "span": 49, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "self", + "name": "b", "source_info": { - "scope": 0, - "span": 48 + "scope": 2, + "span": 60 }, "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Place": { + "local": 2, + "projection": [] } } } ] }, - "id": 5, - "name": "<() as std::process::Termination>::report" + "id": 6, + "name": "main" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "strange_ref_deref::main::h01a29f59bf4e2506" } ], "types": [ diff --git a/tests/integration/programs/struct.smir.json.expected b/tests/integration/programs/struct.smir.json.expected index 906f263..903027d 100644 --- a/tests/integration/programs/struct.smir.json.expected +++ b/tests/integration/programs/struct.smir.json.expected @@ -99,75 +99,109 @@ "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 1, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, { "kind": { "Assign": [ { - "local": 8, + "local": 0, "projection": [] }, { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 + "Use": { + "Constant": { + "const_": { + "id": 8, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] + }, + "ty": 17 + }, + "span": 46, + "user_ty": null + } + } } ] }, - "span": 3 - }, + "span": 46 + } + ], + "terminator": { + "kind": "Return", + "span": 45 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 + }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::h65cee66fbe3f117d" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ { "kind": { "Assign": [ { - "local": 7, + "local": 3, "projection": [] }, { @@ -175,59 +209,26 @@ { "kind": "ReErased" }, - "Shared", - { - "local": 8, - "projection": [] - } - ] - } - ] - }, - "span": 2 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Cast": [ - { - "PointerCoercion": "Unsize" - }, { - "Copy": { - "local": 7, - "projection": [] + "Mut": { + "kind": "Default" } }, - 5 + { + "local": 1, + "projection": [] + } ] } ] }, - "span": 2 + "span": 43 } ], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, { "Move": { "local": 3, @@ -236,300 +237,219 @@ }, { "Move": { - "local": 4, + "local": 2, "projection": [] } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 7, "kind": "ZeroSized", - "ty": 0 + "ty": 23 }, - "span": 0, + "span": 43, "user_ty": null } }, "target": 1, + "unwind": { + "Cleanup": 3 + } + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, "unwind": "Continue" } }, - "span": 1 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 5 + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 - } - ], + "span": 43 + } + }, + { + "statements": [], "terminator": { - "kind": "Return", - "span": 4 + "kind": "Resume", + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 8, - "ty": 6 - }, - { - "mutability": "Not", - "span": 9, - "ty": 7 - }, - { - "mutability": "Not", - "span": 10, - "ty": 6 - }, - { - "mutability": "Not", - "span": 11, - "ty": 8 + "span": 43, + "ty": 16 }, { "mutability": "Not", - "span": 12, - "ty": 9 - }, - { - "mutability": "Mut", - "span": 1, - "ty": 10 - }, - { - "mutability": "Mut", - "span": 2, - "ty": 5 + "span": 43, + "ty": 12 }, { "mutability": "Not", - "span": 2, - "ty": 11 + "span": 43, + "ty": 1 }, { "mutability": "Not", - "span": 3, - "ty": 12 + "span": 43, + "ty": 24 } ], - "span": 13, - "spread_arg": null, - "var_debug_info": [ + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h1299442242f51124" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { - "argument_index": 1, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, + "projection": [] + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 43 } }, { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 } - }, + } + ], + "locals": [ { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } + "mutability": "Mut", + "span": 43, + "ty": 1 }, { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } + "mutability": "Not", + "span": 43, + "ty": 7 }, { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } + "mutability": "Not", + "span": 43, + "ty": 1 } - ] + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 3, + "name": ">::call_once" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "core::ops::function::FnOnce::call_once::hb6e11e16b5b54b6a" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 2, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 16 - }, - { - "kind": { - "StorageLive": 3 - }, - "span": 15 - }, - { - "kind": { - "StorageLive": 4 - }, - "span": 17 - }, - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - } - ] - }, - "span": 17 - } - ], + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 4, - "projection": [] + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, + "projection": [] } } ], "destination": { - "local": 3, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 1, + "id": 6, "kind": "ZeroSized", - "ty": 13 + "ty": 21 }, - "span": 14, + "span": 43, "user_ty": null } }, @@ -537,223 +457,358 @@ "unwind": "Continue" } }, - "span": 15 + "span": 43 } }, { - "statements": [ - { - "kind": { - "StorageDead": 4 - }, - "span": 19 - } - ], + "statements": [], "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 3, - "projection": [] - } - } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 2, - "kind": "ZeroSized", - "ty": 14 - }, - "span": 18, - "user_ty": null - } - }, - "target": 2, - "unwind": "Continue" - } - }, - "span": 16 + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 16 + }, + { + "mutability": "Not", + "span": 43, + "ty": 22 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h46e8b502c756aaea" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h37f9d68acbcfee8b" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 4, + "blocks": [ { "statements": [ { "kind": { - "StorageDead": 3 + "StorageLive": 5 }, - "span": 21 + "span": 1 }, { "kind": { - "StorageLive": 5 + "StorageLive": 6 }, - "span": 22 + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 }, { "kind": { "Assign": [ { - "local": 5, + "local": 8, "projection": [] }, { - "Ref": [ + "Aggregate": [ { - "kind": "ReErased" + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] }, - "Shared", - { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] + [ + { + "Copy": { + "local": 1, + "projection": [] } - ] - } + } + ] ] } ] }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 + "span": 3 }, { "kind": { "Assign": [ { - "local": 6, + "local": 7, "projection": [] }, { - "Use": { - "Copy": { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - }, - { - "Field": [ - 0, - 9 - ] - } - ] + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] } - } + ] } ] }, - "span": 23 + "span": 2 }, { "kind": { "Assign": [ { - "local": 0, + "local": 6, "projection": [] }, { "Cast": [ - "IntToInt", { - "Move": { - "local": 6, + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, "projection": [] } }, - 16 + 5 ] } ] }, - "span": 24 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 25 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 + "span": 2 } ], "terminator": { - "kind": "Return", - "span": 20 - } - } + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 6, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] + } + } + ], + "destination": { + "local": 5, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 0, + "kind": "ZeroSized", + "ty": 0 + }, + "span": 0, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 1 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 6 + }, + "span": 5 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 + }, + { + "Field": [ + 0, + 6 + ] + } + ] + } + } + } + ] + }, + "span": 6 + }, + { + "kind": { + "StorageDead": 8 + }, + "span": 7 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 7 + } + ], + "terminator": { + "kind": "Return", + "span": 4 + } + } ], "locals": [ { "mutability": "Mut", - "span": 28, - "ty": 16 + "span": 8, + "ty": 6 }, { - "mutability": "Mut", - "span": 3, - "ty": 11 + "mutability": "Not", + "span": 9, + "ty": 7 }, { - "mutability": "Mut", - "span": 16, - "ty": 17 + "mutability": "Not", + "span": 10, + "ty": 6 }, { - "mutability": "Mut", - "span": 15, - "ty": 1 + "mutability": "Not", + "span": 11, + "ty": 8 }, { - "mutability": "Mut", - "span": 17, - "ty": 7 + "mutability": "Not", + "span": 12, + "ty": 9 }, { "mutability": "Mut", - "span": 22, - "ty": 18 + "span": 1, + "ty": 10 }, { "mutability": "Mut", - "span": 23, - "ty": 9 + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 } ], - "span": 3, + "span": 13, "spread_arg": null, "var_debug_info": [ { - "argument_index": null, + "argument_index": 1, "composite": null, "name": "main", "source_info": { @@ -763,25 +818,17 @@ "value": { "Place": { "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] + "projection": [] } } }, { - "argument_index": 1, + "argument_index": 2, "composite": null, - "name": "self", + "name": "argc", "source_info": { - "scope": 1, - "span": 29 + "scope": 0, + "span": 10 }, "value": { "Place": { @@ -791,27 +838,57 @@ } }, { - "argument_index": 1, + "argument_index": 3, "composite": null, - "name": "self", + "name": "argv", "source_info": { - "scope": 2, - "span": 30 + "scope": 0, + "span": 11 }, "value": { "Place": { - "local": 5, + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, "projection": [] } } } ] }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "symbol_name": "std::rt::lang_start::h0ce5dd8f054fe391" }, { "details": null, @@ -821,276 +898,147 @@ "arg_count": 1, "blocks": [ { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, + { + "kind": { + "Assign": [ { - "Move": { - "local": 1, - "projection": [] - } + "local": 4, + "projection": [] }, { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } } } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 3, - "kind": "ZeroSized", - "ty": 19 - }, - "span": 31, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 33 - } - }, - { - "statements": [], + ] + }, + "span": 17 + } + ], "terminator": { "kind": { "Call": { "args": [ { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 4, + "projection": [] } } ], "destination": { - "local": 2, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 5, + "id": 1, "kind": "ZeroSized", - "ty": 20 + "ty": 13 }, - "span": 34, + "span": 14, "user_ty": null } }, - "target": 2, - "unwind": "Unreachable" + "target": 1, + "unwind": "Continue" } }, - "span": 35 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 36 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 37, - "ty": 1 - }, - { - "mutability": "Not", - "span": 38, - "ty": 7 - }, - { - "mutability": "Not", - "span": 39, - "ty": 1 - } - ], - "span": 42, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "f", - "source_info": { - "scope": 0, - "span": 38 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "result", - "source_info": { - "scope": 1, - "span": 40 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } + "span": 15 } }, { - "argument_index": 1, - "composite": null, - "name": "dummy", - "source_info": { - "scope": 2, - "span": 41 - }, - "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 + "statements": [ + { + "kind": { + "StorageDead": 4 }, - "span": 32, - "user_ty": null + "span": 19 } - } - } - ] - }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" - } - }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], + ], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } - }, - { - "Move": { - "local": 2, + "local": 3, "projection": [] } } ], "destination": { - "local": 0, + "local": 2, "projection": [] }, "func": { "Constant": { "const_": { - "id": 6, + "id": 2, "kind": "ZeroSized", - "ty": 21 + "ty": 14 }, - "span": 43, + "span": 18, "user_ty": null } }, - "target": 1, + "target": 2, "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 + "span": 16 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 }, - { - "mutability": "Not", - "span": 43, - "ty": 22 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ { "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, { "kind": { "Assign": [ { - "local": 3, + "local": 5, "projection": [] }, { @@ -1098,317 +1046,369 @@ { "kind": "ReErased" }, + "Shared", { - "Mut": { - "kind": "Default" - } - }, - { - "local": 1, - "projection": [] + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] } ] } ] }, - "span": 43 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ { - "Move": { - "local": 3, - "projection": [] - } + "local": 6, + "projection": [] }, { - "Move": { - "local": 2, - "projection": [] + "Use": { + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + }, + { + "Field": [ + 0, + 9 + ] + } + ] + } } } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 7, - "kind": "ZeroSized", - "ty": 23 - }, - "span": 43, - "user_ty": null + ] + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] } - }, - "target": 1, - "unwind": { - "Cleanup": 3 - } - } + ] + }, + "span": 24 }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 2, - "unwind": "Continue" - } + { + "kind": { + "StorageDead": 6 + }, + "span": 25 }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } + { + "kind": { + "StorageDead": 5 + }, + "span": 26 }, - "span": 43 - } - }, - { - "statements": [], + { + "kind": { + "StorageDead": 2 + }, + "span": 27 + } + ], "terminator": { - "kind": "Resume", - "span": 43 + "kind": "Return", + "span": 20 } } ], "locals": [ { "mutability": "Mut", - "span": 43, + "span": 28, "ty": 16 }, { - "mutability": "Not", - "span": 43, - "ty": 12 + "mutability": "Mut", + "span": 3, + "ty": 11 }, { - "mutability": "Not", - "span": 43, + "mutability": "Mut", + "span": 16, + "ty": 17 + }, + { + "mutability": "Mut", + "span": 15, "ty": 1 }, { - "mutability": "Not", - "span": 43, - "ty": 24 + "mutability": "Mut", + "span": 17, + "ty": 7 + }, + { + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 + } + ], + "span": 3, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": null, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 29 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] + ] }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" + "symbol_name": "std::rt::lang_start::{{closure}}::h34dcd22aa93c028c" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 1, "blocks": [ { "statements": [], "terminator": { "kind": { "Call": { - "args": [], + "args": [ + { + "Move": { + "local": 1, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], "destination": { "local": 0, "projection": [] }, "func": { - "Move": { - "local": 1, - "projection": [] + "Constant": { + "const_": { + "id": 3, + "kind": "ZeroSized", + "ty": 19 + }, + "span": 31, + "user_ty": null } }, "target": 1, "unwind": "Continue" } }, - "span": 43 + "span": 33 } }, { "statements": [], "terminator": { - "kind": "Return", - "span": 43 + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 5, + "kind": "ZeroSized", + "ty": 20 + }, + "span": 34, + "user_ty": null + } + }, + "target": 2, + "unwind": "Unreachable" + } + }, + "span": 35 } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 1 }, - { - "mutability": "Not", - "span": 43, - "ty": 7 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ { "statements": [], "terminator": { "kind": "Return", - "span": 44 + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 44, + "span": 37, "ty": 1 }, { "mutability": "Not", - "span": 44, - "ty": 22 - } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] - }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" - } - }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 46, - "user_ty": null - } - } - } - ] - }, - "span": 46 - } - ], - "terminator": { - "kind": "Return", - "span": 45 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 47, - "ty": 17 + "span": 38, + "ty": 7 }, { "mutability": "Not", - "span": 48, + "span": 39, "ty": 1 } ], - "span": 49, + "span": 42, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "self", + "name": "f", "source_info": { "scope": 0, - "span": 48 + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 40 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "dummy", + "source_info": { + "scope": 2, + "span": 41 }, "value": { "Const": { @@ -1424,11 +1424,11 @@ } ] }, - "id": 5, - "name": "<() as std::process::Termination>::report" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h9f30cdd738da3e6a" }, { "details": null, @@ -1900,7 +1900,7 @@ "name": "main" } }, - "symbol_name": "_ZN6struct4main17h" + "symbol_name": "struct::main::hc047982b70ef864e" } ], "types": [ diff --git a/tests/integration/programs/sum-to-n.smir.json.expected b/tests/integration/programs/sum-to-n.smir.json.expected index 7a5e47c..99cd5bd 100644 --- a/tests/integration/programs/sum-to-n.smir.json.expected +++ b/tests/integration/programs/sum-to-n.smir.json.expected @@ -101,135 +101,201 @@ "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 1, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, { "kind": { "Assign": [ { - "local": 8, + "local": 0, "projection": [] }, { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 + "Use": { + "Constant": { + "const_": { + "id": 8, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } } - ] - ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] + }, + "ty": 17 + }, + "span": 46, + "user_ty": null + } + } } ] }, - "span": 3 - }, - { - "kind": { - "Assign": [ - { - "local": 7, + "span": 46 + } + ], + "terminator": { + "kind": "Return", + "span": 45 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 + }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::h171c763059a29eb1" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 8, - "projection": [] - } - ] } - ] - }, - "span": 2 + }, + "target": 1, + "unwind": "Continue" + } }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 1 + }, + { + "mutability": "Not", + "span": 43, + "ty": 7 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": ">::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h3ffab4b9d12585e8" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ { "kind": { "Assign": [ { - "local": 6, + "local": 3, "projection": [] }, { - "Cast": [ + "Ref": [ { - "PointerCoercion": "Unsize" + "kind": "ReErased" }, { - "Copy": { - "local": 7, - "projection": [] + "Mut": { + "kind": "Default" } }, - 5 + { + "local": 1, + "projection": [] + } ] } ] }, - "span": 2 + "span": 43 } ], "terminator": { "kind": { "Call": { "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, { "Move": { "local": 3, @@ -238,807 +304,69 @@ }, { "Move": { - "local": 4, + "local": 2, "projection": [] } } ], "destination": { - "local": 5, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 0, + "id": 7, "kind": "ZeroSized", - "ty": 0 + "ty": 23 }, - "span": 0, + "span": 43, "user_ty": null } }, "target": 1, - "unwind": "Continue" - } - }, - "span": 1 - } - }, - { - "statements": [ - { - "kind": { - "StorageDead": 6 - }, - "span": 5 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 7 - } - ], - "terminator": { - "kind": "Return", - "span": 4 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 8, - "ty": 6 - }, - { - "mutability": "Not", - "span": 9, - "ty": 7 - }, - { - "mutability": "Not", - "span": 10, - "ty": 6 - }, - { - "mutability": "Not", - "span": 11, - "ty": 8 - }, - { - "mutability": "Not", - "span": 12, - "ty": 9 - }, - { - "mutability": "Mut", - "span": 1, - "ty": 10 - }, - { - "mutability": "Mut", - "span": 2, - "ty": 5 - }, - { - "mutability": "Not", - "span": 2, - "ty": 11 - }, - { - "mutability": "Not", - "span": 3, - "ty": 12 - } - ], - "span": 13, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 2, - "composite": null, - "name": "argc", - "source_info": { - "scope": 0, - "span": 10 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - }, - { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } - } - ] - }, - "id": 0, - "name": "std::rt::lang_start::<()>" - } - }, - "symbol_name": "_ZN3std2rt10lang_start17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 16 - }, - { - "kind": { - "StorageLive": 3 - }, - "span": 15 - }, - { - "kind": { - "StorageLive": 4 - }, - "span": 17 - }, - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - } - ] - }, - "span": 17 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 4, - "projection": [] - } - } - ], - "destination": { - "local": 3, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 1, - "kind": "ZeroSized", - "ty": 13 - }, - "span": 14, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 15 - } - }, - { - "statements": [ - { - "kind": { - "StorageDead": 4 - }, - "span": 19 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 3, - "projection": [] - } - } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 2, - "kind": "ZeroSized", - "ty": 14 - }, - "span": 18, - "user_ty": null - } - }, - "target": 2, - "unwind": "Continue" - } - }, - "span": 16 - } - }, - { - "statements": [ - { - "kind": { - "StorageDead": 3 - }, - "span": 21 - }, - { - "kind": { - "StorageLive": 5 - }, - "span": 22 - }, - { - "kind": { - "Assign": [ - { - "local": 5, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - } - ] - } - ] - } - ] - }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - }, - { - "Field": [ - 0, - 9 - ] - } - ] - } - } - } - ] - }, - "span": 23 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Cast": [ - "IntToInt", - { - "Move": { - "local": 6, - "projection": [] - } - }, - 16 - ] - } - ] - }, - "span": 24 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 25 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 - } - ], - "terminator": { - "kind": "Return", - "span": 20 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 28, - "ty": 16 - }, - { - "mutability": "Mut", - "span": 3, - "ty": 11 - }, - { - "mutability": "Mut", - "span": 16, - "ty": 17 - }, - { - "mutability": "Mut", - "span": 15, - "ty": 1 - }, - { - "mutability": "Mut", - "span": 17, - "ty": 7 - }, - { - "mutability": "Mut", - "span": 22, - "ty": 18 - }, - { - "mutability": "Mut", - "span": 23, - "ty": 9 - } - ], - "span": 3, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": null, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 1, - "span": 29 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - }, - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 2, - "span": 30 - }, - "value": { - "Place": { - "local": 5, - "projection": [] - } - } - } - ] - }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" - } - }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 1, - "projection": [] - } - }, - { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } - } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 3, - "kind": "ZeroSized", - "ty": 19 - }, - "span": 31, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" + "unwind": { + "Cleanup": 3 + } } }, - "span": 33 + "span": 43 } }, { "statements": [], "terminator": { "kind": { - "Call": { - "args": [ - { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } - } - ], - "destination": { - "local": 2, + "Drop": { + "place": { + "local": 1, "projection": [] }, - "func": { - "Constant": { - "const_": { - "id": 5, - "kind": "ZeroSized", - "ty": 20 - }, - "span": 34, - "user_ty": null - } - }, "target": 2, - "unwind": "Unreachable" + "unwind": "Continue" } }, - "span": 35 + "span": 43 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 36 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 37, - "ty": 1 - }, - { - "mutability": "Not", - "span": 38, - "ty": 7 - }, - { - "mutability": "Not", - "span": 39, - "ty": 1 - } - ], - "span": 42, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "f", - "source_info": { - "scope": 0, - "span": 38 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "result", - "source_info": { - "scope": 1, - "span": 40 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } + "span": 43 } }, - { - "argument_index": 1, - "composite": null, - "name": "dummy", - "source_info": { - "scope": 2, - "span": 41 - }, - "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } - } - } - ] - }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" - } - }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ { "statements": [], "terminator": { "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - } - ], - "destination": { - "local": 0, + "Drop": { + "place": { + "local": 1, "projection": [] }, - "func": { - "Constant": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 21 - }, - "span": 43, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" + "target": 4, + "unwind": "Terminate" } }, "span": 43 @@ -1047,7 +375,7 @@ { "statements": [], "terminator": { - "kind": "Return", + "kind": "Resume", "span": 43 } } @@ -1059,79 +387,19 @@ "ty": 16 }, { - "mutability": "Not", - "span": 43, - "ty": 22 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Move": { - "local": 1, - "projection": [] - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", + "mutability": "Not", "span": 43, - "ty": 1 + "ty": 12 }, { "mutability": "Not", "span": 43, - "ty": 7 + "ty": 1 }, { "mutability": "Not", "span": 43, - "ty": 1 + "ty": 24 } ], "span": 43, @@ -1139,10 +407,10 @@ "var_debug_info": [] }, "id": 3, - "name": ">::call_once" + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" + "symbol_name": "core::ops::function::FnOnce::call_once::hf0366b307858997e" }, { "details": null, @@ -1152,43 +420,17 @@ "arg_count": 2, "blocks": [ { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - { - "Mut": { - "kind": "Default" - } - }, - { - "local": 1, - "projection": [] - } - ] - } - ] - }, - "span": 43 - } - ], + "statements": [], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 3, - "projection": [] + "local": 1, + "projection": [ + "Deref" + ] } }, { @@ -1205,33 +447,15 @@ "func": { "Constant": { "const_": { - "id": 7, + "id": 6, "kind": "ZeroSized", - "ty": 23 + "ty": 21 }, "span": 43, "user_ty": null } }, "target": 1, - "unwind": { - "Cleanup": 3 - } - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 2, "unwind": "Continue" } }, @@ -1244,29 +468,6 @@ "kind": "Return", "span": 43 } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Resume", - "span": 43 - } } ], "locals": [ @@ -1278,17 +479,12 @@ { "mutability": "Not", "span": 43, - "ty": 12 + "ty": 22 }, { "mutability": "Not", "span": 43, "ty": 1 - }, - { - "mutability": "Not", - "span": 43, - "ty": 24 } ], "span": 43, @@ -1299,7 +495,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h7bf74c286739fe5e" }, { "details": null, @@ -1336,17 +532,185 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h3cfc3b9f723a22c5" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 4, "blocks": [ { "statements": [ + { + "kind": { + "StorageLive": 5 + }, + "span": 1 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 8, + "projection": [] + }, + { + "Aggregate": [ + { + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] + }, + [ + { + "Copy": { + "local": 1, + "projection": [] + } + } + ] + ] + } + ] + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 8, + "projection": [] + } + ] + } + ] + }, + "span": 2 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Cast": [ + { + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, + "projection": [] + } + }, + 5 + ] + } + ] + }, + "span": 2 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 6, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] + } + } + ], + "destination": { + "local": 5, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 0, + "kind": "ZeroSized", + "ty": 0 + }, + "span": 0, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 1 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 6 + }, + "span": 5 + }, { "kind": { "Assign": [ @@ -1356,132 +720,273 @@ }, { "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 }, - "ty": 17 - }, - "span": 46, - "user_ty": null + { + "Field": [ + 0, + 6 + ] + } + ] } } } ] }, - "span": 46 + "span": 6 + }, + { + "kind": { + "StorageDead": 8 + }, + "span": 7 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 7 } ], "terminator": { "kind": "Return", - "span": 45 + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 47, - "ty": 17 + "span": 8, + "ty": 6 }, { "mutability": "Not", - "span": 48, - "ty": 1 + "span": 9, + "ty": 7 + }, + { + "mutability": "Not", + "span": 10, + "ty": 6 + }, + { + "mutability": "Not", + "span": 11, + "ty": 8 + }, + { + "mutability": "Not", + "span": 12, + "ty": 9 + }, + { + "mutability": "Mut", + "span": 1, + "ty": 10 + }, + { + "mutability": "Mut", + "span": 2, + "ty": 5 + }, + { + "mutability": "Not", + "span": 2, + "ty": 11 + }, + { + "mutability": "Not", + "span": 3, + "ty": 12 } ], - "span": 49, + "span": 13, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "self", + "name": "main", "source_info": { "scope": 0, - "span": 48 + "span": 9 }, "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "argc", + "source_info": { + "scope": 0, + "span": 10 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 3, + "composite": null, + "name": "argv", + "source_info": { + "scope": 0, + "span": 11 + }, + "value": { + "Place": { + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, + "projection": [] } } } ] }, - "id": 5, - "name": "<() as std::process::Termination>::report" + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "std::rt::lang_start::h07d8408a7ad22f1e" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 0, + "arg_count": 1, "blocks": [ { "statements": [ + { + "kind": { + "StorageLive": 2 + }, + "span": 16 + }, + { + "kind": { + "StorageLive": 3 + }, + "span": 15 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 17 + }, { "kind": { "Assign": [ { - "local": 3, + "local": 4, "projection": [] }, { "Use": { - "Constant": { - "const_": { - "id": 12, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 10, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 25 - }, - "span": 71, - "user_ty": null + "Copy": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] } } } - ] + ] + }, + "span": 17 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 4, + "projection": [] + } + } + ], + "destination": { + "local": 3, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 1, + "kind": "ZeroSized", + "ty": 13 + }, + "span": 14, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 15 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 4 }, - "span": 72 + "span": 19 } ], "terminator": { @@ -1502,115 +1007,303 @@ "func": { "Constant": { "const_": { - "id": 11, + "id": 2, "kind": "ZeroSized", - "ty": 28 + "ty": 14 }, - "span": 69, + "span": 18, "user_ty": null } }, - "target": 1, + "target": 2, "unwind": "Continue" } }, - "span": 70 + "span": 16 } }, { "statements": [ + { + "kind": { + "StorageDead": 3 + }, + "span": 21 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 22 + }, { "kind": { "Assign": [ { - "local": 4, + "local": 5, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] + } + ] + } + ] + } + ] + }, + "span": 22 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 23 + }, + { + "kind": { + "Assign": [ + { + "local": 6, "projection": [] }, { "Use": { - "Constant": { - "const_": { - "id": 13, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 55, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } + "Copy": { + "local": 2, + "projection": [ + { + "Field": [ + 0, + 15 + ] }, - "ty": 25 - }, - "span": 74, - "user_ty": null + { + "Field": [ + 0, + 9 + ] + } + ] } } } ] }, - "span": 75 + "span": 23 }, { "kind": { "Assign": [ { - "local": 1, - "projection": [] + "local": 0, + "projection": [] + }, + { + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] + } + ] + }, + "span": 24 + }, + { + "kind": { + "StorageDead": 6 + }, + "span": 25 + }, + { + "kind": { + "StorageDead": 5 + }, + "span": 26 + }, + { + "kind": { + "StorageDead": 2 + }, + "span": 27 + } + ], + "terminator": { + "kind": "Return", + "span": 20 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 28, + "ty": 16 + }, + { + "mutability": "Mut", + "span": 3, + "ty": 11 + }, + { + "mutability": "Mut", + "span": 16, + "ty": 17 + }, + { + "mutability": "Mut", + "span": 15, + "ty": 1 + }, + { + "mutability": "Mut", + "span": 17, + "ty": 7 + }, + { + "mutability": "Mut", + "span": 22, + "ty": 18 + }, + { + "mutability": "Mut", + "span": 23, + "ty": 9 + } + ], + "span": 3, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": null, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 1, + "span": 29 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } + } + ] + }, + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" + } + }, + "symbol_name": "std::rt::lang_start::{{closure}}::h2d9aa2ab28720e2f" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 1, + "projection": [] + } }, { - "BinaryOp": [ - "Eq", - { - "Move": { - "local": 2, - "projection": [] - } + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 }, - { - "Move": { - "local": 4, - "projection": [] - } - } - ] + "span": 32, + "user_ty": null + } } - ] - }, - "span": 76 - } - ], - "terminator": { - "kind": { - "SwitchInt": { - "discr": { - "Copy": { - "local": 1, - "projection": [] + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 3, + "kind": "ZeroSized", + "ty": 19 + }, + "span": 31, + "user_ty": null } }, - "targets": { - "branches": [ - [ - 0, - 2 - ] - ], - "otherwise": 3 - } + "target": 1, + "unwind": "Continue" } }, - "span": 73 + "span": 33 } }, { @@ -1622,40 +1315,9 @@ { "Constant": { "const_": { - "id": 15, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 24, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 0 - ] - ] - } - } - }, - "ty": 30 + "id": 4, + "kind": "ZeroSized", + "ty": 1 }, "span": 32, "user_ty": null @@ -1663,168 +1325,112 @@ } ], "destination": { - "local": 5, + "local": 2, "projection": [] }, "func": { "Constant": { "const_": { - "id": 14, + "id": 5, "kind": "ZeroSized", - "ty": 29 + "ty": 20 }, - "span": 77, + "span": 34, "user_ty": null } }, - "target": null, - "unwind": "Continue" + "target": 2, + "unwind": "Unreachable" } }, - "span": 77 + "span": 35 } }, { "statements": [], "terminator": { "kind": "Return", - "span": 78 + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 79, + "span": 37, "ty": 1 }, { "mutability": "Not", - "span": 80, - "ty": 26 - }, - { - "mutability": "Mut", - "span": 70, - "ty": 25 - }, - { - "mutability": "Mut", - "span": 72, - "ty": 25 - }, - { - "mutability": "Mut", - "span": 75, - "ty": 25 + "span": 38, + "ty": 7 }, { - "mutability": "Mut", - "span": 77, - "ty": 31 + "mutability": "Not", + "span": 39, + "ty": 1 } ], - "span": 83, + "span": 42, "spread_arg": null, "var_debug_info": [ { - "argument_index": null, - "composite": null, - "name": "n", - "source_info": { - "scope": 1, - "span": 81 - }, - "value": { - "Const": { - "const_": { - "id": 12, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 10, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 25 - }, - "span": 71, - "user_ty": null - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "golden", - "source_info": { - "scope": 2, - "span": 82 - }, - "value": { - "Const": { - "const_": { - "id": 13, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 55, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 25 - }, - "span": 74, - "user_ty": null + "argument_index": 1, + "composite": null, + "name": "f", + "source_info": { + "scope": 0, + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] } } }, { "argument_index": null, "composite": null, - "name": "sucess", + "name": "result", "source_info": { - "scope": 3, - "span": 80 + "scope": 1, + "span": 40 }, "value": { "Place": { - "local": 1, + "local": 0, "projection": [] } } + }, + { + "argument_index": 1, + "composite": null, + "name": "dummy", + "source_info": { + "scope": 2, + "span": 41 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } } ] }, - "id": 7, - "name": "test_sum_to_n" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN8sum_to_n13test_sum_to_n17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::heb5e756d786a8242" }, { "details": null, @@ -1889,7 +1495,7 @@ "name": "main" } }, - "symbol_name": "_ZN8sum_to_n4main17h" + "symbol_name": "sum_to_n::main::hc4893a5b9e8ee034" }, { "details": null, @@ -1990,33 +1596,246 @@ } ] }, - "span": 54 + "span": 54 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "BinaryOp": [ + "Gt", + { + "Move": { + "local": 5, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 25 + }, + "span": 55, + "user_ty": null + } + } + ] + } + ] + }, + "span": 53 + } + ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Move": { + "local": 4, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 5 + ] + ], + "otherwise": 2 + } + } + }, + "span": 53 + } + }, + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 3, + "projection": [] + } + } + } + ] + }, + "span": 57 + }, + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "CheckedBinaryOp": [ + "Add", + { + "Copy": { + "local": 2, + "projection": [] + } + }, + { + "Copy": { + "local": 6, + "projection": [] + } + } + ] + } + ] + }, + "span": 56 + } + ], + "terminator": { + "kind": { + "Assert": { + "cond": { + "Move": { + "local": 7, + "projection": [ + { + "Field": [ + 1, + 26 + ] + } + ] + } + }, + "expected": false, + "msg": { + "Overflow": [ + "Add", + { + "Copy": { + "local": 2, + "projection": [] + } + }, + { + "Move": { + "local": 6, + "projection": [] + } + } + ] + }, + "target": 3, + "unwind": "Continue" + } + }, + "span": 56 + } + }, + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 2, + "projection": [] + }, + { + "Use": { + "Move": { + "local": 7, + "projection": [ + { + "Field": [ + 0, + 25 + ] + } + ] + } + } + } + ] + }, + "span": 56 + }, + { + "kind": { + "Assign": [ + { + "local": 8, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 3, + "projection": [] + } + } + } + ] + }, + "span": 60 }, { "kind": { "Assign": [ { - "local": 4, + "local": 9, "projection": [] }, { - "BinaryOp": [ - "Gt", + "CheckedBinaryOp": [ + "Sub", { - "Move": { - "local": 5, + "Copy": { + "local": 8, "projection": [] } }, { "Constant": { "const_": { - "id": 9, + "id": 10, "kind": { "Allocated": { "align": 8, "bytes": [ - 0, + 1, 0, 0, 0, @@ -2033,7 +1852,7 @@ }, "ty": 25 }, - "span": 55, + "span": 58, "user_ty": null } } @@ -2041,30 +1860,71 @@ } ] }, - "span": 53 + "span": 59 } ], "terminator": { "kind": { - "SwitchInt": { - "discr": { + "Assert": { + "cond": { "Move": { - "local": 4, - "projection": [] + "local": 9, + "projection": [ + { + "Field": [ + 1, + 26 + ] + } + ] } }, - "targets": { - "branches": [ - [ - 0, - 5 - ] - ], - "otherwise": 2 - } + "expected": false, + "msg": { + "Overflow": [ + "Sub", + { + "Move": { + "local": 8, + "projection": [] + } + }, + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 25 + }, + "span": 58, + "user_ty": null + } + } + ] + }, + "target": 4, + "unwind": "Continue" } }, - "span": 53 + "span": 59 } }, { @@ -2073,89 +1933,257 @@ "kind": { "Assign": [ { - "local": 6, + "local": 3, + "projection": [] + }, + { + "Use": { + "Move": { + "local": 9, + "projection": [ + { + "Field": [ + 0, + 25 + ] + } + ] + } + } + } + ] + }, + "span": 61 + } + ], + "terminator": { + "kind": { + "Goto": { + "target": 1 + } + }, + "span": 50 + } + }, + { + "statements": [ + { + "kind": { + "Assign": [ + { + "local": 0, "projection": [] }, { "Use": { "Copy": { - "local": 3, + "local": 2, "projection": [] } } } ] }, - "span": 57 - }, + "span": 63 + } + ], + "terminator": { + "kind": "Return", + "span": 62 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 64, + "ty": 25 + }, + { + "mutability": "Not", + "span": 65, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 66, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 67, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 53, + "ty": 26 + }, + { + "mutability": "Mut", + "span": 54, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 57, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 56, + "ty": 27 + }, + { + "mutability": "Mut", + "span": 60, + "ty": 25 + }, + { + "mutability": "Mut", + "span": 59, + "ty": 27 + } + ], + "span": 68, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "n", + "source_info": { + "scope": 0, + "span": 65 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "sum", + "source_info": { + "scope": 1, + "span": 66 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "counter", + "source_info": { + "scope": 2, + "span": 67 + }, + "value": { + "Place": { + "local": 3, + "projection": [] + } + } + } + ] + }, + "id": 6, + "name": "sum_to_n" + } + }, + "symbol_name": "sum_to_n::sum_to_n::ha8037c8f5b9f1867" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 0, + "blocks": [ + { + "statements": [ { "kind": { "Assign": [ { - "local": 7, + "local": 3, "projection": [] }, { - "CheckedBinaryOp": [ - "Add", - { - "Copy": { - "local": 2, - "projection": [] - } - }, - { - "Copy": { - "local": 6, - "projection": [] - } + "Use": { + "Constant": { + "const_": { + "id": 12, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 10, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 25 + }, + "span": 71, + "user_ty": null } - ] + } } ] }, - "span": 56 + "span": 72 } ], "terminator": { "kind": { - "Assert": { - "cond": { - "Move": { - "local": 7, - "projection": [ - { - "Field": [ - 1, - 26 - ] - } - ] + "Call": { + "args": [ + { + "Move": { + "local": 3, + "projection": [] + } } + ], + "destination": { + "local": 2, + "projection": [] }, - "expected": false, - "msg": { - "Overflow": [ - "Add", - { - "Copy": { - "local": 2, - "projection": [] - } + "func": { + "Constant": { + "const_": { + "id": 11, + "kind": "ZeroSized", + "ty": 28 }, - { - "Move": { - "local": 6, - "projection": [] - } - } - ] + "span": 69, + "user_ty": null + } }, - "target": 3, + "target": 1, "unwind": "Continue" } }, - "span": 56 + "span": 70 } }, { @@ -2164,134 +2192,19 @@ "kind": { "Assign": [ { - "local": 2, - "projection": [] - }, - { - "Use": { - "Move": { - "local": 7, - "projection": [ - { - "Field": [ - 0, - 25 - ] - } - ] - } - } - } - ] - }, - "span": 56 - }, - { - "kind": { - "Assign": [ - { - "local": 8, + "local": 4, "projection": [] }, { "Use": { - "Copy": { - "local": 3, - "projection": [] - } - } - } - ] - }, - "span": 60 - }, - { - "kind": { - "Assign": [ - { - "local": 9, - "projection": [] - }, - { - "CheckedBinaryOp": [ - "Sub", - { - "Copy": { - "local": 8, - "projection": [] - } - }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 25 - }, - "span": 58, - "user_ty": null - } - } - ] - } - ] - }, - "span": 59 - } - ], - "terminator": { - "kind": { - "Assert": { - "cond": { - "Move": { - "local": 9, - "projection": [ - { - "Field": [ - 1, - 26 - ] - } - ] - } - }, - "expected": false, - "msg": { - "Overflow": [ - "Sub", - { - "Move": { - "local": 8, - "projection": [] - } - }, - { "Constant": { "const_": { - "id": 10, + "id": 13, "kind": { "Allocated": { "align": 8, "bytes": [ - 1, + 55, 0, 0, 0, @@ -2308,192 +2221,279 @@ }, "ty": 25 }, - "span": 58, - "user_ty": null - } - } - ] - }, - "target": 4, - "unwind": "Continue" - } - }, - "span": 59 - } - }, - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 3, - "projection": [] - }, - { - "Use": { - "Move": { - "local": 9, - "projection": [ - { - "Field": [ - 0, - 25 - ] - } - ] + "span": 74, + "user_ty": null } } } ] }, - "span": 61 - } - ], - "terminator": { - "kind": { - "Goto": { - "target": 1 - } + "span": 75 }, - "span": 50 - } - }, - { - "statements": [ { "kind": { "Assign": [ { - "local": 0, + "local": 1, "projection": [] }, { - "Use": { - "Copy": { - "local": 2, - "projection": [] + "BinaryOp": [ + "Eq", + { + "Move": { + "local": 2, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] + } } - } + ] } ] }, - "span": 63 + "span": 76 } ], + "terminator": { + "kind": { + "SwitchInt": { + "discr": { + "Copy": { + "local": 1, + "projection": [] + } + }, + "targets": { + "branches": [ + [ + 0, + 2 + ] + ], + "otherwise": 3 + } + } + }, + "span": 73 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 15, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 24, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 0 + ] + ] + } + } + }, + "ty": 30 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 5, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 14, + "kind": "ZeroSized", + "ty": 29 + }, + "span": 77, + "user_ty": null + } + }, + "target": null, + "unwind": "Continue" + } + }, + "span": 77 + } + }, + { + "statements": [], "terminator": { "kind": "Return", - "span": 62 + "span": 78 } } ], "locals": [ { "mutability": "Mut", - "span": 64, - "ty": 25 + "span": 79, + "ty": 1 }, { "mutability": "Not", - "span": 65, - "ty": 25 - }, - { - "mutability": "Mut", - "span": 66, - "ty": 25 - }, - { - "mutability": "Mut", - "span": 67, - "ty": 25 - }, - { - "mutability": "Mut", - "span": 53, + "span": 80, "ty": 26 }, { "mutability": "Mut", - "span": 54, + "span": 70, "ty": 25 }, { "mutability": "Mut", - "span": 57, + "span": 72, "ty": 25 }, { "mutability": "Mut", - "span": 56, - "ty": 27 - }, - { - "mutability": "Mut", - "span": 60, + "span": 75, "ty": 25 }, { "mutability": "Mut", - "span": 59, - "ty": 27 + "span": 77, + "ty": 31 } ], - "span": 68, + "span": 83, "spread_arg": null, "var_debug_info": [ { - "argument_index": 1, + "argument_index": null, "composite": null, "name": "n", "source_info": { - "scope": 0, - "span": 65 + "scope": 1, + "span": 81 }, "value": { - "Place": { - "local": 1, - "projection": [] + "Const": { + "const_": { + "id": 12, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 10, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 25 + }, + "span": 71, + "user_ty": null } } }, { "argument_index": null, "composite": null, - "name": "sum", + "name": "golden", "source_info": { - "scope": 1, - "span": 66 + "scope": 2, + "span": 82 }, "value": { - "Place": { - "local": 2, - "projection": [] + "Const": { + "const_": { + "id": 13, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 55, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 25 + }, + "span": 74, + "user_ty": null } } }, { "argument_index": null, "composite": null, - "name": "counter", + "name": "sucess", "source_info": { - "scope": 2, - "span": 67 + "scope": 3, + "span": 80 }, "value": { "Place": { - "local": 3, + "local": 1, "projection": [] } } } ] }, - "id": 6, - "name": "sum_to_n" + "id": 7, + "name": "test_sum_to_n" } }, - "symbol_name": "_ZN8sum_to_n8sum_to_n17h" + "symbol_name": "sum_to_n::test_sum_to_n::h9fac6d1224b2f624" } ], "types": [ diff --git a/tests/integration/programs/tuple-eq.smir.json.expected b/tests/integration/programs/tuple-eq.smir.json.expected index 5d7b604..29f3a6d 100644 --- a/tests/integration/programs/tuple-eq.smir.json.expected +++ b/tests/integration/programs/tuple-eq.smir.json.expected @@ -131,283 +131,242 @@ "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 1, "blocks": [ { "statements": [ { "kind": { - "StorageLive": 5 + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 17 + }, + "span": 64, + "user_ty": null + } + } + } + ] }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 + "span": 64 + } + ], + "terminator": { + "kind": "Return", + "span": 63 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 65, + "ty": 17 + }, + { + "mutability": "Not", + "span": 66, + "ty": 1 + } + ], + "span": 67, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 66 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 }, - "span": 2 - }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 7, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::he8867f1f131c4430" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ { "kind": { - "StorageLive": 8 + "StorageLive": 3 }, - "span": 3 + "span": 44 }, { "kind": { "Assign": [ { - "local": 8, + "local": 3, "projection": [] }, { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 - } - ] + "Use": { + "Copy": { + "local": 1, + "projection": [ + "Deref" ] - }, - [ - { - "Copy": { - "local": 1, - "projection": [] - } - } - ] - ] + } + } } ] }, - "span": 3 + "span": 44 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 45 }, { "kind": { "Assign": [ { - "local": 7, + "local": 4, "projection": [] }, { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 8, - "projection": [] + "Use": { + "Copy": { + "local": 2, + "projection": [ + "Deref" + ] } - ] + } } ] }, - "span": 2 + "span": 45 }, { "kind": { "Assign": [ { - "local": 6, + "local": 0, "projection": [] }, { - "Cast": [ + "BinaryOp": [ + "Eq", { - "PointerCoercion": "Unsize" + "Move": { + "local": 3, + "projection": [] + } }, { - "Copy": { - "local": 7, + "Move": { + "local": 4, "projection": [] } - }, - 5 + } ] } ] }, - "span": 2 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - }, - { - "Move": { - "local": 3, - "projection": [] - } - }, - { - "Move": { - "local": 4, - "projection": [] - } - } - ], - "destination": { - "local": 5, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 0, - "kind": "ZeroSized", - "ty": 0 - }, - "span": 0, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } + "span": 46 }, - "span": 1 - } - }, - { - "statements": [ { "kind": { - "StorageDead": 6 + "StorageDead": 4 }, - "span": 5 + "span": 47 }, { "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 5, - "projection": [ - { - "Downcast": 0 - }, - { - "Field": [ - 0, - 6 - ] - } - ] - } - } - } - ] - }, - "span": 6 - }, - { - "kind": { - "StorageDead": 8 - }, - "span": 7 - }, - { - "kind": { - "StorageDead": 5 + "StorageDead": 3 }, - "span": 7 + "span": 47 } ], "terminator": { "kind": "Return", - "span": 4 + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 8, - "ty": 6 - }, - { - "mutability": "Not", - "span": 9, - "ty": 7 - }, - { - "mutability": "Not", - "span": 10, - "ty": 6 + "span": 48, + "ty": 21 }, { "mutability": "Not", - "span": 11, - "ty": 8 + "span": 49, + "ty": 22 }, { "mutability": "Not", - "span": 12, - "ty": 9 + "span": 50, + "ty": 22 }, { "mutability": "Mut", - "span": 1, - "ty": 10 + "span": 44, + "ty": 16 }, { "mutability": "Mut", - "span": 2, - "ty": 5 - }, - { - "mutability": "Not", - "span": 2, - "ty": 11 - }, - { - "mutability": "Not", - "span": 3, - "ty": 12 + "span": 45, + "ty": 16 } ], - "span": 13, + "span": 51, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "main", + "name": "self", "source_info": { "scope": 0, - "span": 9 + "span": 49 }, "value": { "Place": { @@ -419,10 +378,10 @@ { "argument_index": 2, "composite": null, - "name": "argc", + "name": "other", "source_info": { "scope": 0, - "span": 10 + "span": 50 }, "value": { "Place": { @@ -430,113 +389,50 @@ "projection": [] } } - }, - { - "argument_index": 3, - "composite": null, - "name": "argv", - "source_info": { - "scope": 0, - "span": 11 - }, - "value": { - "Place": { - "local": 3, - "projection": [] - } - } - }, - { - "argument_index": 4, - "composite": null, - "name": "sigpipe", - "source_info": { - "scope": 0, - "span": 12 - }, - "value": { - "Place": { - "local": 4, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "v", - "source_info": { - "scope": 1, - "span": 6 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } - } } ] }, - "id": 0, - "name": "std::rt::lang_start::<()>" + "id": 3, + "name": "std::cmp::impls::::eq" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "core::cmp::impls::::eq::h34cd29185895066e" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 1, + "arg_count": 2, "blocks": [ { "statements": [ - { - "kind": { - "StorageLive": 2 - }, - "span": 16 - }, - { - "kind": { - "StorageLive": 3 - }, - "span": 15 - }, - { - "kind": { - "StorageLive": 4 - }, - "span": 17 - }, { "kind": { "Assign": [ { - "local": 4, + "local": 3, "projection": [] }, { - "Use": { - "Copy": { + "Ref": [ + { + "kind": "ReErased" + }, + { + "Mut": { + "kind": "Default" + } + }, + { "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] + "projection": [] } - } + ] } ] }, - "span": 17 + "span": 52 } ], "terminator": { @@ -545,305 +441,269 @@ "args": [ { "Move": { - "local": 4, + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 2, "projection": [] } } ], "destination": { - "local": 3, + "local": 0, "projection": [] }, "func": { "Constant": { "const_": { - "id": 1, + "id": 7, "kind": "ZeroSized", - "ty": 13 + "ty": 25 }, - "span": 14, + "span": 52, "user_ty": null } }, "target": 1, - "unwind": "Continue" + "unwind": { + "Cleanup": 3 + } } }, - "span": 15 + "span": 52 } }, { - "statements": [ - { - "kind": { - "StorageDead": 4 - }, - "span": 19 - } - ], + "statements": [], "terminator": { "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 3, - "projection": [] - } - } - ], - "destination": { - "local": 2, + "Drop": { + "place": { + "local": 1, "projection": [] }, - "func": { - "Constant": { - "const_": { - "id": 2, - "kind": "ZeroSized", - "ty": 14 - }, - "span": 18, - "user_ty": null - } - }, "target": 2, "unwind": "Continue" } }, - "span": 16 + "span": 52 } }, { - "statements": [ - { - "kind": { - "StorageDead": 3 - }, - "span": 21 - }, - { - "kind": { - "StorageLive": 5 - }, - "span": 22 - }, - { - "kind": { - "Assign": [ - { - "local": 5, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - } - ] - } - ] - } - ] - }, - "span": 22 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 23 - }, - { - "kind": { - "Assign": [ - { - "local": 6, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 2, - "projection": [ - { - "Field": [ - 0, - 15 - ] - }, - { - "Field": [ - 0, - 9 - ] - } - ] - } - } - } - ] - }, - "span": 23 - }, - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Cast": [ - "IntToInt", - { - "Move": { - "local": 6, - "projection": [] - } - }, - 16 - ] - } - ] - }, - "span": 24 - }, - { - "kind": { - "StorageDead": 6 - }, - "span": 25 - }, - { - "kind": { - "StorageDead": 5 - }, - "span": 26 - }, - { - "kind": { - "StorageDead": 2 - }, - "span": 27 - } - ], + "statements": [], "terminator": { "kind": "Return", - "span": 20 + "span": 52 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 4, + "unwind": "Terminate" + } + }, + "span": 52 + } + }, + { + "statements": [], + "terminator": { + "kind": "Resume", + "span": 52 } } ], "locals": [ { "mutability": "Mut", - "span": 28, + "span": 52, "ty": 16 }, { - "mutability": "Mut", - "span": 3, - "ty": 11 + "mutability": "Not", + "span": 52, + "ty": 12 }, { - "mutability": "Mut", - "span": 16, - "ty": 17 + "mutability": "Not", + "span": 52, + "ty": 1 }, { - "mutability": "Mut", - "span": 15, - "ty": 1 + "mutability": "Not", + "span": 52, + "ty": 26 + } + ], + "span": 52, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 4, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h09820138d2bbfeed" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, + "projection": [] + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 52 + } }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 52 + } + } + ], + "locals": [ { "mutability": "Mut", - "span": 17, - "ty": 7 + "span": 52, + "ty": 1 }, { - "mutability": "Mut", - "span": 22, - "ty": 18 + "mutability": "Not", + "span": 52, + "ty": 7 }, { - "mutability": "Mut", - "span": 23, - "ty": 9 + "mutability": "Not", + "span": 52, + "ty": 1 } ], - "span": 3, - "spread_arg": null, - "var_debug_info": [ + "span": 52, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 4, + "name": ">::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::he5542e787ad844c6" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { - "argument_index": null, - "composite": null, - "name": "main", - "source_info": { - "scope": 0, - "span": 9 - }, - "value": { - "Place": { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 7 - ] - } - ] - } + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 1, + "projection": [ + "Deref" + ] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } + } + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 6, + "kind": "ZeroSized", + "ty": 23 + }, + "span": 52, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 52 } }, { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 1, - "span": 29 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } + "statements": [], + "terminator": { + "kind": "Return", + "span": 52 } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 52, + "ty": 16 }, { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 2, - "span": 30 - }, - "value": { - "Place": { - "local": 5, - "projection": [] - } - } + "mutability": "Not", + "span": 52, + "ty": 24 + }, + { + "mutability": "Not", + "span": 52, + "ty": 1 } - ] + ], + "span": 52, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 1, - "name": "std::rt::lang_start::<()>::{closure#0}" + "id": 4, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hd9b4d9f3c98e8010" }, { "details": null, @@ -854,40 +714,153 @@ "blocks": [ { "statements": [], + "terminator": { + "kind": "Return", + "span": 53 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 53, + "ty": 1 + }, + { + "mutability": "Not", + "span": 53, + "ty": 24 + } + ], + "span": 53, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 5, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::hca452a0428215b86" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ + { + "kind": { + "StorageLive": 3 + }, + "span": 54 + }, + { + "kind": { + "StorageLive": 4 + }, + "span": 55 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 0, + 16 + ] + } + ] + } + ] + } + ] + }, + "span": 55 + }, + { + "kind": { + "StorageLive": 5 + }, + "span": 56 + }, + { + "kind": { + "Assign": [ + { + "local": 5, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + "Deref", + { + "Field": [ + 0, + 16 + ] + } + ] + } + ] + } + ] + }, + "span": 56 + } + ], "terminator": { "kind": { "Call": { "args": [ { "Move": { - "local": 1, + "local": 4, "projection": [] } }, { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Move": { + "local": 5, + "projection": [] } } ], "destination": { - "local": 0, + "local": 3, "projection": [] }, "func": { "Constant": { "const_": { - "id": 3, + "id": 8, "kind": "ZeroSized", - "ty": 19 + "ty": 27 }, - "span": 31, + "span": 54, "user_ty": null } }, @@ -895,433 +868,459 @@ "unwind": "Continue" } }, - "span": 33 + "span": 54 } }, { "statements": [], "terminator": { "kind": { - "Call": { - "args": [ - { - "Constant": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } - } - ], - "destination": { - "local": 2, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 5, - "kind": "ZeroSized", - "ty": 20 - }, - "span": 34, - "user_ty": null + "SwitchInt": { + "discr": { + "Move": { + "local": 3, + "projection": [] } }, - "target": 2, - "unwind": "Unreachable" + "targets": { + "branches": [ + [ + 0, + 3 + ] + ], + "otherwise": 2 + } } }, - "span": 35 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 36 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 37, - "ty": 1 - }, - { - "mutability": "Not", - "span": 38, - "ty": 7 - }, - { - "mutability": "Not", - "span": 39, - "ty": 1 - } - ], - "span": 42, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "f", - "source_info": { - "scope": 0, - "span": 38 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": null, - "composite": null, - "name": "result", - "source_info": { - "scope": 1, - "span": 40 - }, - "value": { - "Place": { - "local": 0, - "projection": [] - } + "span": 54 } }, - { - "argument_index": 1, - "composite": null, - "name": "dummy", - "source_info": { - "scope": 2, - "span": 41 - }, - "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null - } - } - } - ] - }, - "id": 2, - "name": "std::sys::backtrace::__rust_begin_short_backtrace::" - } - }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ { "statements": [ { "kind": { - "StorageLive": 3 + "StorageDead": 5 }, - "span": 44 + "span": 57 + }, + { + "kind": { + "StorageDead": 4 + }, + "span": 57 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 55 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 1, + "projection": [ + "Deref", + { + "Field": [ + 1, + 16 + ] + } + ] + } + ] + } + ] + }, + "span": 55 + }, + { + "kind": { + "StorageLive": 7 + }, + "span": 56 }, { "kind": { "Assign": [ { - "local": 3, - "projection": [] + "local": 7, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" + }, + "Shared", + { + "local": 2, + "projection": [ + "Deref", + { + "Field": [ + 1, + 16 + ] + } + ] + } + ] + } + ] + }, + "span": 56 + } + ], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Move": { + "local": 6, + "projection": [] + } }, { - "Use": { - "Copy": { - "local": 1, - "projection": [ - "Deref" - ] - } + "Move": { + "local": 7, + "projection": [] } } - ] + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 8, + "kind": "ZeroSized", + "ty": 27 + }, + "span": 54, + "user_ty": null + } + }, + "target": 4, + "unwind": "Continue" + } + }, + "span": 54 + } + }, + { + "statements": [ + { + "kind": { + "StorageDead": 5 }, - "span": 44 + "span": 57 }, { "kind": { - "StorageLive": 4 + "StorageDead": 4 }, - "span": 45 + "span": 57 }, { "kind": { "Assign": [ { - "local": 4, + "local": 0, "projection": [] }, { "Use": { - "Copy": { - "local": 2, - "projection": [ - "Deref" - ] + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 21 + }, + "span": 54, + "user_ty": null } } } ] }, - "span": 45 + "span": 54 + } + ], + "terminator": { + "kind": { + "Goto": { + "target": 5 + } }, + "span": 54 + } + }, + { + "statements": [ { "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "BinaryOp": [ - "Eq", - { - "Move": { - "local": 3, - "projection": [] - } - }, - { - "Move": { - "local": 4, - "projection": [] - } - } - ] - } - ] + "StorageDead": 7 }, - "span": 46 + "span": 57 }, { "kind": { - "StorageDead": 4 + "StorageDead": 6 }, - "span": 47 + "span": 57 + } + ], + "terminator": { + "kind": { + "Goto": { + "target": 5 + } }, + "span": 54 + } + }, + { + "statements": [ { "kind": { "StorageDead": 3 }, - "span": 47 + "span": 57 } ], "terminator": { "kind": "Return", - "span": 43 + "span": 58 } } ], "locals": [ { "mutability": "Mut", - "span": 48, + "span": 59, "ty": 21 }, { "mutability": "Not", - "span": 49, - "ty": 22 + "span": 60, + "ty": 28 }, { "mutability": "Not", - "span": 50, - "ty": 22 + "span": 61, + "ty": 28 }, { "mutability": "Mut", - "span": 44, - "ty": 16 + "span": 54, + "ty": 21 }, { "mutability": "Mut", - "span": 45, - "ty": 16 - } - ], - "span": 51, - "spread_arg": null, - "var_debug_info": [ - { - "argument_index": 1, - "composite": null, - "name": "self", - "source_info": { - "scope": 0, - "span": 49 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } - }, - { - "argument_index": 2, - "composite": null, - "name": "other", - "source_info": { - "scope": 0, - "span": 50 - }, - "value": { - "Place": { - "local": 2, - "projection": [] - } - } - } - ] - }, - "id": 3, - "name": "std::cmp::impls::::eq" - } - }, - "symbol_name": "_ZN4core3cmp5impls54_$LT$impl$u20$core..cmp..PartialEq$u20$for$u20$i32$GT$2eq17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 1, - "projection": [ - "Deref" - ] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 23 - }, - "span": 52, - "user_ty": null - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 52 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 52 - } - } - ], - "locals": [ + "span": 55, + "ty": 22 + }, { "mutability": "Mut", - "span": 52, - "ty": 16 + "span": 56, + "ty": 22 }, { - "mutability": "Not", - "span": 52, - "ty": 24 + "mutability": "Mut", + "span": 55, + "ty": 22 }, { - "mutability": "Not", - "span": 52, - "ty": 1 + "mutability": "Mut", + "span": 56, + "ty": 22 } ], - "span": 52, - "spread_arg": 2, - "var_debug_info": [] + "span": 62, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 60 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": 2, + "composite": null, + "name": "other", + "source_info": { + "scope": 0, + "span": 61 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } + } + ] }, - "id": 4, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + "id": 6, + "name": "core::tuple::::eq" } }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" + "symbol_name": "core::tuple::::eq::h3d2f56ba179cb218" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 4, "blocks": [ { "statements": [ + { + "kind": { + "StorageLive": 5 + }, + "span": 1 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 + }, { "kind": { "Assign": [ { - "local": 3, + "local": 8, "projection": [] }, { - "Ref": [ + "Aggregate": [ { - "kind": "ReErased" + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } + ] + ] }, - { - "Mut": { - "kind": "Default" + [ + { + "Copy": { + "local": 1, + "projection": [] + } } + ] + ] + } + ] + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 7, + "projection": [] + }, + { + "Ref": [ + { + "kind": "ReErased" }, + "Shared", { - "local": 1, + "local": 8, "projection": [] } ] } ] }, - "span": 52 + "span": 2 + }, + { + "kind": { + "Assign": [ + { + "local": 6, + "projection": [] + }, + { + "Cast": [ + { + "PointerCoercion": "Unsize" + }, + { + "Copy": { + "local": 7, + "projection": [] + } + }, + 5 + ] + } + ] + }, + "span": 2 } ], "terminator": { @@ -1330,7 +1329,7 @@ "args": [ { "Move": { - "local": 3, + "local": 6, "projection": [] } }, @@ -1339,301 +1338,284 @@ "local": 2, "projection": [] } + }, + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 4, + "projection": [] + } } ], "destination": { - "local": 0, + "local": 5, "projection": [] }, "func": { "Constant": { "const_": { - "id": 7, + "id": 0, "kind": "ZeroSized", - "ty": 25 + "ty": 0 }, - "span": 52, + "span": 0, "user_ty": null } }, "target": 1, - "unwind": { - "Cleanup": 3 - } - } - }, - "span": 52 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 2, "unwind": "Continue" } }, - "span": 52 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 52 + "span": 1 } }, { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } + "statements": [ + { + "kind": { + "StorageDead": 6 + }, + "span": 5 + }, + { + "kind": { + "Assign": [ + { + "local": 0, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 5, + "projection": [ + { + "Downcast": 0 + }, + { + "Field": [ + 0, + 6 + ] + } + ] + } + } + } + ] + }, + "span": 6 + }, + { + "kind": { + "StorageDead": 8 + }, + "span": 7 }, - "span": 52 - } - }, - { - "statements": [], + { + "kind": { + "StorageDead": 5 + }, + "span": 7 + } + ], "terminator": { - "kind": "Resume", - "span": 52 + "kind": "Return", + "span": 4 } } ], "locals": [ { "mutability": "Mut", - "span": 52, - "ty": 16 + "span": 8, + "ty": 6 }, { "mutability": "Not", - "span": 52, - "ty": 12 + "span": 9, + "ty": 7 }, { "mutability": "Not", - "span": 52, - "ty": 1 + "span": 10, + "ty": 6 }, { "mutability": "Not", - "span": 52, - "ty": 26 - } - ], - "span": 52, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 4, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ + "span": 11, + "ty": 8 + }, { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Move": { - "local": 1, - "projection": [] - } - }, - "target": 1, - "unwind": "Continue" - } - }, - "span": 52 - } + "mutability": "Not", + "span": 12, + "ty": 9 }, { - "statements": [], - "terminator": { - "kind": "Return", - "span": 52 - } - } - ], - "locals": [ + "mutability": "Mut", + "span": 1, + "ty": 10 + }, { "mutability": "Mut", - "span": 52, - "ty": 1 + "span": 2, + "ty": 5 }, { "mutability": "Not", - "span": 52, - "ty": 7 + "span": 2, + "ty": 11 }, { "mutability": "Not", - "span": 52, - "ty": 1 + "span": 3, + "ty": 12 } ], - "span": 52, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 4, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ + "span": 13, + "spread_arg": null, + "var_debug_info": [ { - "statements": [], - "terminator": { - "kind": "Return", - "span": 53 + "argument_index": 1, + "composite": null, + "name": "main", + "source_info": { + "scope": 0, + "span": 9 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } } - } - ], - "locals": [ + }, { - "mutability": "Mut", - "span": 53, - "ty": 1 + "argument_index": 2, + "composite": null, + "name": "argc", + "source_info": { + "scope": 0, + "span": 10 + }, + "value": { + "Place": { + "local": 2, + "projection": [] + } + } }, { - "mutability": "Not", - "span": 53, - "ty": 24 + "argument_index": 3, + "composite": null, + "name": "argv", + "source_info": { + "scope": 0, + "span": 11 + }, + "value": { + "Place": { + "local": 3, + "projection": [] + } + } + }, + { + "argument_index": 4, + "composite": null, + "name": "sigpipe", + "source_info": { + "scope": 0, + "span": 12 + }, + "value": { + "Place": { + "local": 4, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "v", + "source_info": { + "scope": 1, + "span": 6 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } } - ], - "span": 53, - "spread_arg": null, - "var_debug_info": [] + ] }, - "id": 5, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + "id": 0, + "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" + "symbol_name": "std::rt::lang_start::h30ae614e91b78454" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 1, "blocks": [ { "statements": [ { "kind": { - "StorageLive": 3 - }, - "span": 54 - }, - { - "kind": { - "StorageLive": 4 + "StorageLive": 2 }, - "span": 55 + "span": 16 }, { "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 1, - "projection": [ - "Deref", - { - "Field": [ - 0, - 16 - ] - } - ] - } - ] - } - ] + "StorageLive": 3 }, - "span": 55 + "span": 15 }, { "kind": { - "StorageLive": 5 + "StorageLive": 4 }, - "span": 56 + "span": 17 }, { "kind": { "Assign": [ { - "local": 5, + "local": 4, "projection": [] }, { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { - "local": 2, + "Use": { + "Copy": { + "local": 1, "projection": [ "Deref", { "Field": [ 0, - 16 + 7 ] } ] } - ] + } } ] }, - "span": 56 + "span": 17 } ], "terminator": { @@ -1645,12 +1627,6 @@ "local": 4, "projection": [] } - }, - { - "Move": { - "local": 5, - "projection": [] - } } ], "destination": { @@ -1660,11 +1636,11 @@ "func": { "Constant": { "const_": { - "id": 8, + "id": 1, "kind": "ZeroSized", - "ty": 27 + "ty": 13 }, - "span": 54, + "span": 14, "user_ty": null } }, @@ -1672,59 +1648,70 @@ "unwind": "Continue" } }, - "span": 54 + "span": 15 } }, { - "statements": [], + "statements": [ + { + "kind": { + "StorageDead": 4 + }, + "span": 19 + } + ], "terminator": { "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 3, - "projection": [] + "Call": { + "args": [ + { + "Move": { + "local": 3, + "projection": [] + } } + ], + "destination": { + "local": 2, + "projection": [] }, - "targets": { - "branches": [ - [ - 0, - 3 - ] - ], - "otherwise": 2 - } + "func": { + "Constant": { + "const_": { + "id": 2, + "kind": "ZeroSized", + "ty": 14 + }, + "span": 18, + "user_ty": null + } + }, + "target": 2, + "unwind": "Continue" } }, - "span": 54 + "span": 16 } }, { "statements": [ { "kind": { - "StorageDead": 5 - }, - "span": 57 - }, - { - "kind": { - "StorageDead": 4 + "StorageDead": 3 }, - "span": 57 + "span": 21 }, { "kind": { - "StorageLive": 6 + "StorageLive": 5 }, - "span": 55 + "span": 22 }, { "kind": { "Assign": [ { - "local": 6, + "local": 5, "projection": [] }, { @@ -1734,13 +1721,12 @@ }, "Shared", { - "local": 1, + "local": 2, "projection": [ - "Deref", { "Field": [ - 1, - 16 + 0, + 15 ] } ] @@ -1749,98 +1735,45 @@ } ] }, - "span": 55 + "span": 22 }, { "kind": { - "StorageLive": 7 + "StorageLive": 6 }, - "span": 56 + "span": 23 }, { "kind": { "Assign": [ { - "local": 7, + "local": 6, "projection": [] }, { - "Ref": [ - { - "kind": "ReErased" - }, - "Shared", - { + "Use": { + "Copy": { "local": 2, "projection": [ - "Deref", { "Field": [ - 1, - 16 + 0, + 15 + ] + }, + { + "Field": [ + 0, + 9 ] } ] } - ] - } - ] - }, - "span": 56 - } - ], - "terminator": { - "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 6, - "projection": [] - } - }, - { - "Move": { - "local": 7, - "projection": [] } } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 8, - "kind": "ZeroSized", - "ty": 27 - }, - "span": 54, - "user_ty": null - } - }, - "target": 4, - "unwind": "Continue" - } - }, - "span": 54 - } - }, - { - "statements": [ - { - "kind": { - "StorageDead": 5 - }, - "span": 57 - }, - { - "kind": { - "StorageDead": 4 + ] }, - "span": 57 + "span": 23 }, { "kind": { @@ -1850,149 +1783,116 @@ "projection": [] }, { - "Use": { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 21 - }, - "span": 54, - "user_ty": null - } - } + "Cast": [ + "IntToInt", + { + "Move": { + "local": 6, + "projection": [] + } + }, + 16 + ] } ] }, - "span": 54 - } - ], - "terminator": { - "kind": { - "Goto": { - "target": 5 - } + "span": 24 }, - "span": 54 - } - }, - { - "statements": [ { "kind": { - "StorageDead": 7 + "StorageDead": 6 }, - "span": 57 + "span": 25 }, { "kind": { - "StorageDead": 6 - }, - "span": 57 - } - ], - "terminator": { - "kind": { - "Goto": { - "target": 5 - } - }, - "span": 54 - } - }, - { - "statements": [ + "StorageDead": 5 + }, + "span": 26 + }, { "kind": { - "StorageDead": 3 + "StorageDead": 2 }, - "span": 57 + "span": 27 } ], "terminator": { "kind": "Return", - "span": 58 + "span": 20 } } ], "locals": [ { "mutability": "Mut", - "span": 59, - "ty": 21 - }, - { - "mutability": "Not", - "span": 60, - "ty": 28 + "span": 28, + "ty": 16 }, { - "mutability": "Not", - "span": 61, - "ty": 28 + "mutability": "Mut", + "span": 3, + "ty": 11 }, { "mutability": "Mut", - "span": 54, - "ty": 21 + "span": 16, + "ty": 17 }, { "mutability": "Mut", - "span": 55, - "ty": 22 + "span": 15, + "ty": 1 }, { "mutability": "Mut", - "span": 56, - "ty": 22 + "span": 17, + "ty": 7 }, { "mutability": "Mut", - "span": 55, - "ty": 22 + "span": 22, + "ty": 18 }, { "mutability": "Mut", - "span": 56, - "ty": 22 + "span": 23, + "ty": 9 } ], - "span": 62, + "span": 3, "spread_arg": null, "var_debug_info": [ { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "self", + "name": "main", "source_info": { "scope": 0, - "span": 60 + "span": 9 }, "value": { "Place": { "local": 1, - "projection": [] + "projection": [ + "Deref", + { + "Field": [ + 0, + 7 + ] + } + ] } } }, { - "argument_index": 2, + "argument_index": 1, "composite": null, - "name": "other", + "name": "self", "source_info": { - "scope": 0, - "span": 61 + "scope": 1, + "span": 29 }, "value": { "Place": { @@ -2000,14 +1900,29 @@ "projection": [] } } + }, + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 2, + "span": 30 + }, + "value": { + "Place": { + "local": 5, + "projection": [] + } + } } ] }, - "id": 6, - "name": "core::tuple::::eq" + "id": 1, + "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "_ZN4core5tuple64_$LT$impl$u20$core..cmp..PartialEq$u20$for$u20$$LP$U$C$T$RP$$GT$2eq17h" + "symbol_name": "std::rt::lang_start::{{closure}}::h2b716381c39d3627" }, { "details": null, @@ -2017,71 +1932,156 @@ "arg_count": 1, "blocks": [ { - "statements": [ - { - "kind": { - "Assign": [ + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ { - "local": 0, - "projection": [] + "Move": { + "local": 1, + "projection": [] + } }, { - "Use": { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 64, - "user_ty": null - } + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null } } - ] - }, - "span": 64 - } - ], + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 3, + "kind": "ZeroSized", + "ty": 19 + }, + "span": 31, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 33 + } + }, + { + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ + { + "Constant": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 + }, + "span": 32, + "user_ty": null + } + } + ], + "destination": { + "local": 2, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 5, + "kind": "ZeroSized", + "ty": 20 + }, + "span": 34, + "user_ty": null + } + }, + "target": 2, + "unwind": "Unreachable" + } + }, + "span": 35 + } + }, + { + "statements": [], "terminator": { "kind": "Return", - "span": 63 + "span": 36 } } ], "locals": [ { "mutability": "Mut", - "span": 65, - "ty": 17 + "span": 37, + "ty": 1 }, { "mutability": "Not", - "span": 66, + "span": 38, + "ty": 7 + }, + { + "mutability": "Not", + "span": 39, "ty": 1 } ], - "span": 67, + "span": 42, "spread_arg": null, "var_debug_info": [ { "argument_index": 1, "composite": null, - "name": "self", + "name": "f", "source_info": { "scope": 0, - "span": 66 + "span": 38 + }, + "value": { + "Place": { + "local": 1, + "projection": [] + } + } + }, + { + "argument_index": null, + "composite": null, + "name": "result", + "source_info": { + "scope": 1, + "span": 40 + }, + "value": { + "Place": { + "local": 0, + "projection": [] + } + } + }, + { + "argument_index": 1, + "composite": null, + "name": "dummy", + "source_info": { + "scope": 2, + "span": 41 }, "value": { "Const": { @@ -2097,11 +2097,11 @@ } ] }, - "id": 7, - "name": "<() as std::process::Termination>::report" + "id": 2, + "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h4b826fa30c0cc815" }, { "details": null, @@ -2450,7 +2450,7 @@ "name": "main" } }, - "symbol_name": "_ZN8tuple_eq4main17h" + "symbol_name": "tuple_eq::main::hd433be45974bc83a" } ], "types": [ diff --git a/tests/integration/programs/tuples-simple.smir.json.expected b/tests/integration/programs/tuples-simple.smir.json.expected index 19d8066..c7a50ce 100644 --- a/tests/integration/programs/tuples-simple.smir.json.expected +++ b/tests/integration/programs/tuples-simple.smir.json.expected @@ -99,7 +99,7 @@ "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 0, + "arg_count": 1, "blocks": [ { "statements": [ @@ -107,363 +107,483 @@ "kind": { "Assign": [ { - "local": 1, - "projection": [] - }, - { - "Aggregate": [ - "Tuple", - [ - { - "Constant": { - "const_": { - "id": 9, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 42, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 51, - "user_ty": null - } - }, - { - "Constant": { - "const_": { - "id": 10, - "kind": { - "Allocated": { - "align": 4, - "bytes": [ - 99, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 16 - }, - "span": 52, - "user_ty": null - } - } - ] - ] - } - ] - }, - "span": 53 - }, - { - "kind": { - "Assign": [ - { - "local": 3, + "local": 0, "projection": [] }, { "Use": { - "Copy": { - "local": 1, - "projection": [ - { - "Field": [ - 0, - 16 - ] - } - ] + "Constant": { + "const_": { + "id": 8, + "kind": { + "Allocated": { + "align": 1, + "bytes": [ + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 17 + }, + "span": 46, + "user_ty": null } } } ] }, - "span": 54 - }, - { - "kind": { - "Assign": [ - { - "local": 4, - "projection": [] - }, - { - "Use": { - "Copy": { - "local": 1, - "projection": [ - { - "Field": [ - 1, - 16 - ] - } - ] - } - } - } - ] + "span": 46 + } + ], + "terminator": { + "kind": "Return", + "span": 45 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 47, + "ty": 17 + }, + { + "mutability": "Not", + "span": 48, + "ty": 1 + } + ], + "span": 49, + "spread_arg": null, + "var_debug_info": [ + { + "argument_index": 1, + "composite": null, + "name": "self", + "source_info": { + "scope": 0, + "span": 48 + }, + "value": { + "Const": { + "const_": { + "id": 4, + "kind": "ZeroSized", + "ty": 1 }, - "span": 55 - }, + "span": 32, + "user_ty": null + } + } + } + ] + }, + "id": 5, + "name": "<() as std::process::Termination>::report" + } + }, + "symbol_name": "<() as std::process::Termination>::report::hb569fe8df036e704" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ + { + "statements": [ { "kind": { "Assign": [ { - "local": 2, + "local": 3, "projection": [] }, { - "BinaryOp": [ - "Ne", + "Ref": [ { - "Move": { - "local": 3, - "projection": [] - } + "kind": "ReErased" }, { - "Move": { - "local": 4, - "projection": [] + "Mut": { + "kind": "Default" } + }, + { + "local": 1, + "projection": [] } ] } ] }, - "span": 50 + "span": 43 } ], "terminator": { "kind": { - "SwitchInt": { - "discr": { - "Move": { - "local": 2, - "projection": [] + "Call": { + "args": [ + { + "Move": { + "local": 3, + "projection": [] + } + }, + { + "Move": { + "local": 2, + "projection": [] + } } + ], + "destination": { + "local": 0, + "projection": [] }, - "targets": { - "branches": [ - [ - 0, - 2 - ] - ], - "otherwise": 1 + "func": { + "Constant": { + "const_": { + "id": 7, + "kind": "ZeroSized", + "ty": 23 + }, + "span": 43, + "user_ty": null + } + }, + "target": 1, + "unwind": { + "Cleanup": 3 } } }, - "span": 50 + "span": 43 } }, { "statements": [], "terminator": { - "kind": "Return", - "span": 56 + "kind": { + "Drop": { + "place": { + "local": 1, + "projection": [] + }, + "target": 2, + "unwind": "Continue" + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 } }, { "statements": [], "terminator": { "kind": { - "Call": { - "args": [ - { - "Constant": { - "const_": { - "id": 12, - "kind": { - "Allocated": { - "align": 8, - "bytes": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 32, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [ - [ - 0, - 0 - ] - ] - } - } - }, - "ty": 26 - }, - "span": 32, - "user_ty": null - } - } - ], - "destination": { - "local": 5, + "Drop": { + "place": { + "local": 1, "projection": [] }, - "func": { - "Constant": { - "const_": { - "id": 11, - "kind": "ZeroSized", - "ty": 25 - }, - "span": 57, - "user_ty": null - } - }, - "target": null, - "unwind": "Continue" + "target": 4, + "unwind": "Terminate" } }, - "span": 57 + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Resume", + "span": 43 } } ], "locals": [ { "mutability": "Mut", - "span": 58, - "ty": 1 + "span": 43, + "ty": 16 }, { "mutability": "Not", - "span": 59, - "ty": 27 + "span": 43, + "ty": 12 }, { - "mutability": "Mut", - "span": 50, - "ty": 28 + "mutability": "Not", + "span": 43, + "ty": 1 }, { - "mutability": "Mut", - "span": 54, - "ty": 16 - }, + "mutability": "Not", + "span": 43, + "ty": 24 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once::h4f87faa79cacdbbc" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 2, + "blocks": [ { - "mutability": "Mut", - "span": 55, - "ty": 16 + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Move": { + "local": 1, + "projection": [] + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 43 + } }, { - "mutability": "Mut", - "span": 57, - "ty": 29 + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } } ], - "span": 60, - "spread_arg": null, - "var_debug_info": [ + "locals": [ { - "argument_index": null, - "composite": null, - "name": "tup", - "source_info": { - "scope": 1, - "span": 59 - }, - "value": { - "Place": { - "local": 1, - "projection": [] - } - } + "mutability": "Mut", + "span": 43, + "ty": 1 + }, + { + "mutability": "Not", + "span": 43, + "ty": 7 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 } - ] + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] }, - "id": 6, - "name": "main" + "id": 3, + "name": ">::call_once" } }, - "symbol_name": "_ZN13tuples_simple4main17h" + "symbol_name": "core::ops::function::FnOnce::call_once::hadeb45e483eac926" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 4, + "arg_count": 2, "blocks": [ { - "statements": [ - { - "kind": { - "StorageLive": 5 - }, - "span": 1 - }, - { - "kind": { - "StorageLive": 6 - }, - "span": 2 - }, - { - "kind": { - "StorageLive": 8 - }, - "span": 3 - }, - { - "kind": { - "Assign": [ + "statements": [], + "terminator": { + "kind": { + "Call": { + "args": [ { - "local": 8, - "projection": [] + "Move": { + "local": 1, + "projection": [ + "Deref" + ] + } }, { - "Aggregate": [ - { - "Closure": [ - 1, - [ - { - "Type": 1 - }, - { - "Type": 2 - }, - { - "Type": 3 - }, - { - "Type": 4 - } + "Move": { + "local": 2, + "projection": [] + } + } + ], + "destination": { + "local": 0, + "projection": [] + }, + "func": { + "Constant": { + "const_": { + "id": 6, + "kind": "ZeroSized", + "ty": 21 + }, + "span": 43, + "user_ty": null + } + }, + "target": 1, + "unwind": "Continue" + } + }, + "span": 43 + } + }, + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 43 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 43, + "ty": 16 + }, + { + "mutability": "Not", + "span": 43, + "ty": 22 + }, + { + "mutability": "Not", + "span": 43, + "ty": 1 + } + ], + "span": 43, + "spread_arg": 2, + "var_debug_info": [] + }, + "id": 3, + "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" + } + }, + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h1598661c484ad8de" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 1, + "blocks": [ + { + "statements": [], + "terminator": { + "kind": "Return", + "span": 44 + } + } + ], + "locals": [ + { + "mutability": "Mut", + "span": 44, + "ty": 1 + }, + { + "mutability": "Not", + "span": 44, + "ty": 22 + } + ], + "span": 44, + "spread_arg": null, + "var_debug_info": [] + }, + "id": 4, + "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" + } + }, + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h6fadba2c3637c8a1" + }, + { + "details": null, + "mono_item_kind": { + "MonoItemFn": { + "body": { + "arg_count": 4, + "blocks": [ + { + "statements": [ + { + "kind": { + "StorageLive": 5 + }, + "span": 1 + }, + { + "kind": { + "StorageLive": 6 + }, + "span": 2 + }, + { + "kind": { + "StorageLive": 8 + }, + "span": 3 + }, + { + "kind": { + "Assign": [ + { + "local": 8, + "projection": [] + }, + { + "Aggregate": [ + { + "Closure": [ + 1, + [ + { + "Type": 1 + }, + { + "Type": 2 + }, + { + "Type": 3 + }, + { + "Type": 4 + } ] ] }, @@ -768,7 +888,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "_ZN3std2rt10lang_start17h" + "symbol_name": "std::rt::lang_start::h784b49cfe47d3b32" }, { "details": null, @@ -1129,7 +1249,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "symbol_name": "std::rt::lang_start::{{closure}}::he02f40c4625759dd" }, { "details": null, @@ -1308,445 +1428,325 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::hd8300ef90d40d1c4" }, { "details": null, "mono_item_kind": { "MonoItemFn": { "body": { - "arg_count": 2, + "arg_count": 0, "blocks": [ { - "statements": [], - "terminator": { - "kind": { - "Call": { - "args": [ + "statements": [ + { + "kind": { + "Assign": [ { - "Move": { - "local": 1, - "projection": [ - "Deref" + "local": 1, + "projection": [] + }, + { + "Aggregate": [ + "Tuple", + [ + { + "Constant": { + "const_": { + "id": 9, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 42, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 51, + "user_ty": null + } + }, + { + "Constant": { + "const_": { + "id": 10, + "kind": { + "Allocated": { + "align": 4, + "bytes": [ + 99, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + }, + "ty": 16 + }, + "span": 52, + "user_ty": null + } + } ] - } + ] + } + ] + }, + "span": 53 + }, + { + "kind": { + "Assign": [ + { + "local": 3, + "projection": [] }, { - "Move": { - "local": 2, - "projection": [] + "Use": { + "Copy": { + "local": 1, + "projection": [ + { + "Field": [ + 0, + 16 + ] + } + ] + } } } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 6, - "kind": "ZeroSized", - "ty": 21 - }, - "span": 43, - "user_ty": null + ] + }, + "span": 54 + }, + { + "kind": { + "Assign": [ + { + "local": 4, + "projection": [] + }, + { + "Use": { + "Copy": { + "local": 1, + "projection": [ + { + "Field": [ + 1, + 16 + ] + } + ] + } + } } - }, - "target": 1, - "unwind": "Continue" - } + ] + }, + "span": 55 }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 22 - }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ - { - "statements": [ { "kind": { "Assign": [ { - "local": 3, + "local": 2, "projection": [] }, { - "Ref": [ - { - "kind": "ReErased" - }, + "BinaryOp": [ + "Ne", { - "Mut": { - "kind": "Default" + "Move": { + "local": 3, + "projection": [] } }, { - "local": 1, - "projection": [] + "Move": { + "local": 4, + "projection": [] + } } ] } ] }, - "span": 43 + "span": 50 } ], "terminator": { "kind": { - "Call": { - "args": [ - { - "Move": { - "local": 3, - "projection": [] - } - }, - { - "Move": { - "local": 2, - "projection": [] - } - } - ], - "destination": { - "local": 0, - "projection": [] - }, - "func": { - "Constant": { - "const_": { - "id": 7, - "kind": "ZeroSized", - "ty": 23 - }, - "span": 43, - "user_ty": null + "SwitchInt": { + "discr": { + "Move": { + "local": 2, + "projection": [] } }, - "target": 1, - "unwind": { - "Cleanup": 3 - } - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 2, - "unwind": "Continue" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": { - "Drop": { - "place": { - "local": 1, - "projection": [] - }, - "target": 4, - "unwind": "Terminate" - } - }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Resume", - "span": 43 - } - } - ], - "locals": [ - { - "mutability": "Mut", - "span": 43, - "ty": 16 - }, - { - "mutability": "Not", - "span": 43, - "ty": 12 + "targets": { + "branches": [ + [ + 0, + 2 + ] + ], + "otherwise": 1 + } + } + }, + "span": 50 + } }, { - "mutability": "Not", - "span": 43, - "ty": 1 + "statements": [], + "terminator": { + "kind": "Return", + "span": 56 + } }, - { - "mutability": "Not", - "span": 43, - "ty": 24 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 2, - "blocks": [ { "statements": [], "terminator": { "kind": { "Call": { - "args": [], + "args": [ + { + "Constant": { + "const_": { + "id": 12, + "kind": { + "Allocated": { + "align": 8, + "bytes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 32, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [ + [ + 0, + 0 + ] + ] + } + } + }, + "ty": 26 + }, + "span": 32, + "user_ty": null + } + } + ], "destination": { - "local": 0, + "local": 5, "projection": [] }, "func": { - "Move": { - "local": 1, - "projection": [] + "Constant": { + "const_": { + "id": 11, + "kind": "ZeroSized", + "ty": 25 + }, + "span": 57, + "user_ty": null } }, - "target": 1, + "target": null, "unwind": "Continue" } }, - "span": 43 - } - }, - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 43 + "span": 57 } } ], "locals": [ { "mutability": "Mut", - "span": 43, + "span": 58, "ty": 1 }, { "mutability": "Not", - "span": 43, - "ty": 7 + "span": 59, + "ty": 27 }, - { - "mutability": "Not", - "span": 43, - "ty": 1 - } - ], - "span": 43, - "spread_arg": 2, - "var_debug_info": [] - }, - "id": 3, - "name": ">::call_once" - } - }, - "symbol_name": "_ZN4core3ops8function6FnOnce9call_once17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [], - "terminator": { - "kind": "Return", - "span": 44 - } - } - ], - "locals": [ { "mutability": "Mut", - "span": 44, - "ty": 1 + "span": 50, + "ty": 28 }, { - "mutability": "Not", - "span": 44, - "ty": 22 - } - ], - "span": 44, - "spread_arg": null, - "var_debug_info": [] - }, - "id": 4, - "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" - } - }, - "symbol_name": "_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h" - }, - { - "details": null, - "mono_item_kind": { - "MonoItemFn": { - "body": { - "arg_count": 1, - "blocks": [ - { - "statements": [ - { - "kind": { - "Assign": [ - { - "local": 0, - "projection": [] - }, - { - "Use": { - "Constant": { - "const_": { - "id": 8, - "kind": { - "Allocated": { - "align": 1, - "bytes": [ - 0 - ], - "mutability": "Mut", - "provenance": { - "ptrs": [] - } - } - }, - "ty": 17 - }, - "span": 46, - "user_ty": null - } - } - } - ] - }, - "span": 46 - } - ], - "terminator": { - "kind": "Return", - "span": 45 - } - } - ], - "locals": [ + "mutability": "Mut", + "span": 54, + "ty": 16 + }, { "mutability": "Mut", - "span": 47, - "ty": 17 + "span": 55, + "ty": 16 }, { - "mutability": "Not", - "span": 48, - "ty": 1 + "mutability": "Mut", + "span": 57, + "ty": 29 } ], - "span": 49, + "span": 60, "spread_arg": null, "var_debug_info": [ { - "argument_index": 1, + "argument_index": null, "composite": null, - "name": "self", + "name": "tup", "source_info": { - "scope": 0, - "span": 48 + "scope": 1, + "span": 59 }, "value": { - "Const": { - "const_": { - "id": 4, - "kind": "ZeroSized", - "ty": 1 - }, - "span": 32, - "user_ty": null + "Place": { + "local": 1, + "projection": [] } } } ] }, - "id": 5, - "name": "<() as std::process::Termination>::report" + "id": 6, + "name": "main" } }, - "symbol_name": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "symbol_name": "tuples_simple::main::hdfb8f9bcaa21bb65" } ], "types": [ From bbc554f0f87b463f9f8739285bbfd60cb60af3c7 Mon Sep 17 00:00:00 2001 From: Everett Hildenbrandt Date: Fri, 23 May 2025 22:09:35 +0000 Subject: [PATCH 11/12] src/printer: demangle function names too --- src/printer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/printer.rs b/src/printer.rs index cbe308f..73ae19a 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -413,7 +413,7 @@ fn fn_inst_sym<'tcx>( } else if let Some(_intrinsic_name) = inst.intrinsic_name() { IntrinsicSym(try_demangle(&inst.mangled_name()).unwrap().to_string()) } else { - NormalSym(inst.mangled_name()) + NormalSym(try_demangle(&inst.mangled_name()).unwrap().to_string()) }; Some((ty, internal_inst.def, sym_type)) } else { From 9f5631235e5558030f909f6fec1a925f50ca2291 Mon Sep 17 00:00:00 2001 From: Everett Hildenbrandt Date: Fri, 23 May 2025 22:09:43 +0000 Subject: [PATCH 12/12] tests/integration: update expected output --- .../programs/assert_eq.smir.json.expected | 50 ++--- .../programs/binop.smir.json.expected | 36 ++-- .../programs/char-trivial.smir.json.expected | 32 +-- .../checked_arithmetic.smir.json.expected | 190 +++++++++--------- .../programs/closure-args.smir.json.expected | 36 ++-- .../closure-no-args.smir.json.expected | 36 ++-- .../const-arithm-simple.smir.json.expected | 36 ++-- .../programs/div.smir.json.expected | 32 +-- .../double-ref-deref.smir.json.expected | 32 +-- .../programs/enum.smir.json.expected | 30 +-- .../programs/fibonacci.smir.json.expected | 36 ++-- .../programs/float.smir.json.expected | 32 +-- .../programs/modulo.smir.json.expected | 32 +-- .../mutual_recursion.smir.json.expected | 40 ++-- .../option-construction.smir.json.expected | 36 ++-- .../primitive-type-bounds.smir.json.expected | 32 +-- .../recursion-simple-match.smir.json.expected | 36 ++-- .../recursion-simple.smir.json.expected | 36 ++-- .../programs/ref-deref.smir.json.expected | 32 +-- .../programs/shl_min.smir.json.expected | 32 +-- .../programs/slice.smir.json.expected | 60 +++--- .../strange-ref-deref.smir.json.expected | 32 +-- .../programs/struct.smir.json.expected | 32 +-- .../programs/sum-to-n.smir.json.expected | 40 ++-- .../programs/tuple-eq.smir.json.expected | 40 ++-- .../programs/tuples-simple.smir.json.expected | 32 +-- 26 files changed, 545 insertions(+), 545 deletions(-) diff --git a/tests/integration/programs/assert_eq.smir.json.expected b/tests/integration/programs/assert_eq.smir.json.expected index c51aa30..60568ad 100644 --- a/tests/integration/programs/assert_eq.smir.json.expected +++ b/tests/integration/programs/assert_eq.smir.json.expected @@ -3,22 +3,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -28,42 +28,42 @@ ], [ { - "NormalSym": "_ZN4core3fmt3num50_$LT$impl$u20$core..fmt..Debug$u20$for$u20$i32$GT$3fmt17h" + "NormalSym": "core::fmt::num::::fmt::" } ], [ { - "NormalSym": "_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i32$GT$3fmt17h" + "NormalSym": "core::fmt::num::::fmt::" } ], [ { - "NormalSym": "_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..UpperHex$u20$for$u20$i32$GT$3fmt17h" + "NormalSym": "core::fmt::num::::fmt::" } ], [ { - "NormalSym": "_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$i32$GT$3fmt17h" + "NormalSym": "core::fmt::num::imp::::fmt::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN4core9panicking19assert_failed_inner17h" + "NormalSym": "core::panicking::assert_failed_inner::" } ], [ { - "NormalSym": "_ZN4core9panicking13assert_failed17h" + "NormalSym": "core::panicking::assert_failed::" } ], [ @@ -212,7 +212,7 @@ "name": "<&i32 as std::fmt::Debug>::fmt" } }, - "symbol_name": "<&T as core::fmt::Debug>::fmt::hd2d7ac44d6bb35d3" + "symbol_name": "<&T as core::fmt::Debug>::fmt::" }, { "details": null, @@ -306,7 +306,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::h7d4db6223e0d9d0b" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -1028,7 +1028,7 @@ "name": "main" } }, - "symbol_name": "assert_eq::main::h8a389146e7c5df5f" + "symbol_name": "assert_eq::main::" }, { "details": null, @@ -1548,7 +1548,7 @@ "name": "core::fmt::num::::fmt" } }, - "symbol_name": "core::fmt::num::::fmt::heee3c70c53a1fbd7" + "symbol_name": "core::fmt::num::::fmt::" }, { "details": null, @@ -1705,7 +1705,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h1054626952e55724" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -1770,7 +1770,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::he92c129a11d345cf" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -1855,7 +1855,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hc275a054a290317d" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -2143,7 +2143,7 @@ "name": "core::panicking::assert_failed::" } }, - "symbol_name": "core::panicking::assert_failed::h7f58e98e35e6ded9" + "symbol_name": "core::panicking::assert_failed::" }, { "details": null, @@ -2180,7 +2180,7 @@ "name": "std::ptr::drop_in_place::<&i32>" } }, - "symbol_name": "core::ptr::drop_in_place<&i32>::h6bae2758e369a544" + "symbol_name": "core::ptr::drop_in_place<&i32>::" }, { "details": null, @@ -2217,7 +2217,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::hd85af45124e99a76" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -2575,7 +2575,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::h80c141f0d9d6e81d" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -2936,7 +2936,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::hdbc73f1d13420fe6" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -3115,7 +3115,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h00ff7e7333413e27" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/binop.smir.json.expected b/tests/integration/programs/binop.smir.json.expected index 9c58542..1c12f3c 100644 --- a/tests/integration/programs/binop.smir.json.expected +++ b/tests/integration/programs/binop.smir.json.expected @@ -1107,22 +1107,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -1132,22 +1132,22 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ { - "NormalSym": "_ZN5binop10test_binop17h" + "NormalSym": "binop::test_binop::" } ], [ @@ -1249,7 +1249,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::hd6646cac15cc2d57" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -1483,7 +1483,7 @@ "name": "main" } }, - "symbol_name": "binop::main::h7dc164dcac1665b8" + "symbol_name": "binop::main::" }, { "details": null, @@ -8466,7 +8466,7 @@ "name": "test_binop" } }, - "symbol_name": "binop::test_binop::h9a8f345ced0a25a7" + "symbol_name": "binop::test_binop::" }, { "details": null, @@ -8623,7 +8623,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h6ce06013cf5bfa21" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -8688,7 +8688,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h91974ef3cf0211bd" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -8773,7 +8773,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hdf9201ffa3990219" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -8810,7 +8810,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h527f3a94a57a2646" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -9168,7 +9168,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::hf780de05a7c8e5bf" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -9529,7 +9529,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::h868c92f8b10a0adf" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -9708,7 +9708,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::hd8346b624166a9e2" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/char-trivial.smir.json.expected b/tests/integration/programs/char-trivial.smir.json.expected index 6d0fb42..db66d77 100644 --- a/tests/integration/programs/char-trivial.smir.json.expected +++ b/tests/integration/programs/char-trivial.smir.json.expected @@ -43,22 +43,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -68,17 +68,17 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -180,7 +180,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::h248d6d971143272d" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -392,7 +392,7 @@ "name": "main" } }, - "symbol_name": "char_trivial::main::h8ae0afee3cb776ae" + "symbol_name": "char_trivial::main::" }, { "details": null, @@ -457,7 +457,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h6f2db1d97052cdd0" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -614,7 +614,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h818acb7c04214d2e" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -699,7 +699,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h351d27d2c74ca6a0" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -736,7 +736,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h7f6809e87e5bdf40" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -1094,7 +1094,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::h6cc119f686fc5602" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -1455,7 +1455,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::h9537d1266973544f" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -1634,7 +1634,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h74ad275823b6d3ca" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/checked_arithmetic.smir.json.expected b/tests/integration/programs/checked_arithmetic.smir.json.expected index c915589..f814d23 100644 --- a/tests/integration/programs/checked_arithmetic.smir.json.expected +++ b/tests/integration/programs/checked_arithmetic.smir.json.expected @@ -1,5 +1,72 @@ { "allocs": [ + [ + { + "Memory": { + "align": 1, + "bytes": [ + 97, + 115, + 115, + 101, + 114, + 116, + 105, + 111, + 110, + 32, + 102, + 97, + 105, + 108, + 101, + 100, + 58, + 32, + 114, + 101, + 115, + 117, + 108, + 116, + 32, + 97, + 115, + 32, + 105, + 54, + 52, + 32, + 61, + 61, + 32, + 97, + 32, + 97, + 115, + 32, + 105, + 54, + 52, + 32, + 43, + 32, + 98, + 32, + 97, + 115, + 32, + 105, + 54, + 52 + ], + "mutability": "Not", + "provenance": { + "ptrs": [] + } + } + } + ], [ { "Memory": { @@ -79,94 +146,27 @@ } } } - ], - [ - { - "Memory": { - "align": 1, - "bytes": [ - 97, - 115, - 115, - 101, - 114, - 116, - 105, - 111, - 110, - 32, - 102, - 97, - 105, - 108, - 101, - 100, - 58, - 32, - 114, - 101, - 115, - 117, - 108, - 116, - 32, - 97, - 115, - 32, - 105, - 54, - 52, - 32, - 61, - 61, - 32, - 97, - 32, - 97, - 115, - 32, - 105, - 54, - 52, - 32, - 43, - 32, - 98, - 32, - 97, - 115, - 32, - 105, - 54, - 52 - ], - "mutability": "Not", - "provenance": { - "ptrs": [] - } - } - } ] ], "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -181,47 +181,47 @@ ], [ { - "NormalSym": "_ZN4core3num21_$LT$impl$u20$i32$GT$13unchecked_add18precondition_check17h" + "NormalSym": "core::num::::unchecked_add::precondition_check::" } ], [ { - "NormalSym": "_ZN4core9panicking14panic_nounwind17h" + "NormalSym": "core::panicking::panic_nounwind::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN18checked_arithmetic15checked_add_i3217h" + "NormalSym": "checked_arithmetic::checked_add_i32::" } ], [ { - "NormalSym": "_ZN4core3num21_$LT$impl$u20$i32$GT$11checked_add17h" + "NormalSym": "core::num::::checked_add::" } ], [ { - "NormalSym": "_ZN4core6option15Option$LT$T$GT$7is_some17h" + "NormalSym": "core::option::Option::is_some::" } ], [ { - "NormalSym": "_ZN4core3num21_$LT$impl$u20$i32$GT$13unchecked_add17h" + "NormalSym": "core::num::::unchecked_add::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -323,7 +323,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::h13465de462ec78d6" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -924,7 +924,7 @@ "name": "checked_add_i32" } }, - "symbol_name": "checked_arithmetic::checked_add_i32::h654ae0fb73c8084e" + "symbol_name": "checked_arithmetic::checked_add_i32::" }, { "details": null, @@ -1040,7 +1040,7 @@ "name": "main" } }, - "symbol_name": "checked_arithmetic::main::h916fc99227d4b902" + "symbol_name": "checked_arithmetic::main::" }, { "details": null, @@ -1072,7 +1072,7 @@ "name": "std::intrinsics::cold_path" } }, - "symbol_name": "core::intrinsics::cold_path::ha65a9598ce5f50b2" + "symbol_name": "core::intrinsics::cold_path::" }, { "details": null, @@ -1518,7 +1518,7 @@ "name": "core::num::::checked_add" } }, - "symbol_name": "core::num::::checked_add::h29858f34f436425d" + "symbol_name": "core::num::::checked_add::" }, { "details": null, @@ -1726,7 +1726,7 @@ "name": "core::num::::unchecked_add" } }, - "symbol_name": "core::num::::unchecked_add::h8a262b3a5be3f6e8" + "symbol_name": "core::num::::unchecked_add::" }, { "details": null, @@ -2080,7 +2080,7 @@ "name": "core::num::::unchecked_add::precondition_check" } }, - "symbol_name": "core::num::::unchecked_add::precondition_check::ha7005eb2e592fd41" + "symbol_name": "core::num::::unchecked_add::precondition_check::" }, { "details": null, @@ -2237,7 +2237,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::he521a4b7c95d8a37" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -2302,7 +2302,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::hea697340843a0c99" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -2387,7 +2387,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hfd45ce6305bbcc85" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -2595,7 +2595,7 @@ "name": "std::option::Option::::is_some" } }, - "symbol_name": "core::option::Option::is_some::h2c87b9367138524d" + "symbol_name": "core::option::Option::is_some::" }, { "details": null, @@ -2632,7 +2632,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h5b58bc3117200b3a" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -2990,7 +2990,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::he93191565b350026" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -3351,7 +3351,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::h1d9733ed32ea155d" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -3530,7 +3530,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::hcc79370e4f5a26a5" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/closure-args.smir.json.expected b/tests/integration/programs/closure-args.smir.json.expected index 6b81dea..701ebf6 100644 --- a/tests/integration/programs/closure-args.smir.json.expected +++ b/tests/integration/programs/closure-args.smir.json.expected @@ -52,22 +52,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -77,22 +77,22 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN12closure_args4main28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "closure_args::main::{{closure}}::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -194,7 +194,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::h371ab09429d1950e" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -501,7 +501,7 @@ "name": "main" } }, - "symbol_name": "closure_args::main::h1fc4146de98d22f6" + "symbol_name": "closure_args::main::" }, { "details": null, @@ -683,7 +683,7 @@ "name": "main::{closure#0}" } }, - "symbol_name": "closure_args::main::{{closure}}::h1c6a9b8f477b14a8" + "symbol_name": "closure_args::main::{{closure}}::" }, { "details": null, @@ -840,7 +840,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h6c3ca0aaab63cf48" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -905,7 +905,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::hcaf9623b4a8cad5c" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -990,7 +990,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h5aa6a622dea0c8c7" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -1027,7 +1027,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::hb26ff286dfd63c67" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -1385,7 +1385,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::hbbf83a02f1458567" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -1746,7 +1746,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::hb385a02feb05c4e9" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -1925,7 +1925,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::hf8a8faab4f42c2ab" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/closure-no-args.smir.json.expected b/tests/integration/programs/closure-no-args.smir.json.expected index af5024e..f97395c 100644 --- a/tests/integration/programs/closure-no-args.smir.json.expected +++ b/tests/integration/programs/closure-no-args.smir.json.expected @@ -46,22 +46,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -71,22 +71,22 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN15closure_no_args4main28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "closure_no_args::main::{{closure}}::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -188,7 +188,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::h61e6d5839a127881" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -427,7 +427,7 @@ "name": "main" } }, - "symbol_name": "closure_no_args::main::h40a3d87758fcab99" + "symbol_name": "closure_no_args::main::" }, { "details": null, @@ -503,7 +503,7 @@ "name": "main::{closure#0}" } }, - "symbol_name": "closure_no_args::main::{{closure}}::h639e282b1db87e78" + "symbol_name": "closure_no_args::main::{{closure}}::" }, { "details": null, @@ -660,7 +660,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h4789014b7ab97533" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -725,7 +725,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h8cc5009eee7caadb" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -810,7 +810,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h87acc9e24679a685" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -847,7 +847,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::hb4c2e343837f21a7" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -1205,7 +1205,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::h06386e0d5dd9bb9f" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -1566,7 +1566,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::h6f7dfdf9b356f278" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -1745,7 +1745,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h070d140d5cdaa56e" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/const-arithm-simple.smir.json.expected b/tests/integration/programs/const-arithm-simple.smir.json.expected index f34fa84..227939d 100644 --- a/tests/integration/programs/const-arithm-simple.smir.json.expected +++ b/tests/integration/programs/const-arithm-simple.smir.json.expected @@ -36,22 +36,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -61,22 +61,22 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN19const_arithm_simple4test17h" + "NormalSym": "const_arithm_simple::test::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -178,7 +178,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::h083c88785663c143" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -544,7 +544,7 @@ "name": "main" } }, - "symbol_name": "const_arithm_simple::main::h08de8e55ad719e81" + "symbol_name": "const_arithm_simple::main::" }, { "details": null, @@ -646,7 +646,7 @@ "name": "test" } }, - "symbol_name": "const_arithm_simple::test::hd8d9211e783fc31b" + "symbol_name": "const_arithm_simple::test::" }, { "details": null, @@ -711,7 +711,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::ha8c8daee0971cff6" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -868,7 +868,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::hffbeef369d0221d1" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -953,7 +953,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h5deecba3a8731f38" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -990,7 +990,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h321ca032a25ec1c2" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -1348,7 +1348,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::h1f0fee22f554814b" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -1709,7 +1709,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::h88bb633d4b3818f8" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -1888,7 +1888,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::hd29a5f9896722427" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/div.smir.json.expected b/tests/integration/programs/div.smir.json.expected index 74b55a6..0c03e87 100644 --- a/tests/integration/programs/div.smir.json.expected +++ b/tests/integration/programs/div.smir.json.expected @@ -49,22 +49,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -74,17 +74,17 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -186,7 +186,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::hffbdb66f6c1d9211" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -343,7 +343,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h7d8ca50f4bcee240" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -408,7 +408,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h91a3d65f2d111ab4" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -493,7 +493,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hebc2f0665a24f4af" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -530,7 +530,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::ha94291a6e18f1b4d" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -1103,7 +1103,7 @@ "name": "main" } }, - "symbol_name": "div::main::h23e287fa42b34ef6" + "symbol_name": "div::main::" }, { "details": null, @@ -1461,7 +1461,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::hbd108b6d97f9b06a" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -1822,7 +1822,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::hb3cdf57509f37c7b" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -2001,7 +2001,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h5249a92c895d39c3" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/double-ref-deref.smir.json.expected b/tests/integration/programs/double-ref-deref.smir.json.expected index f9e1313..0d9ab7a 100644 --- a/tests/integration/programs/double-ref-deref.smir.json.expected +++ b/tests/integration/programs/double-ref-deref.smir.json.expected @@ -44,22 +44,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -69,17 +69,17 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -181,7 +181,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::h71dbfd421f052d36" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -246,7 +246,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h20e447a0f0a879b1" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -403,7 +403,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h3b6dcfc9104bd68b" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -488,7 +488,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::he4b509a5aa7fe926" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -525,7 +525,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h68baa37de5021c80" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -854,7 +854,7 @@ "name": "main" } }, - "symbol_name": "double_ref_deref::main::hea5f0cb84b044abc" + "symbol_name": "double_ref_deref::main::" }, { "details": null, @@ -1212,7 +1212,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::hae09cd2855e0e1e5" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -1573,7 +1573,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::h2b63106f11ec1841" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -1752,7 +1752,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h0a7e1d374729816d" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/enum.smir.json.expected b/tests/integration/programs/enum.smir.json.expected index 41eb114..368f8e8 100644 --- a/tests/integration/programs/enum.smir.json.expected +++ b/tests/integration/programs/enum.smir.json.expected @@ -3,22 +3,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -28,12 +28,12 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ @@ -135,7 +135,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::ha9d971e2d2747189" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -292,7 +292,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h6a981edc9897eac7" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -357,7 +357,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::hfaffbd6f83919b14" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -442,7 +442,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h435d5fb91f4c9d83" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -479,7 +479,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h45c21786305dd377" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -558,7 +558,7 @@ "name": "main" } }, - "symbol_name": "enum::main::ha50c10f11a117309" + "symbol_name": "enum::main::" }, { "details": null, @@ -916,7 +916,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::h88f5d079fbb5d449" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -1277,7 +1277,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::h821f64d86117c6aa" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -1456,7 +1456,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h6d6ca95b552c258b" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/fibonacci.smir.json.expected b/tests/integration/programs/fibonacci.smir.json.expected index 049a93c..4ce906f 100644 --- a/tests/integration/programs/fibonacci.smir.json.expected +++ b/tests/integration/programs/fibonacci.smir.json.expected @@ -43,22 +43,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -68,22 +68,22 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN9fibonacci9fibonacci17h" + "NormalSym": "fibonacci::fibonacci::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -185,7 +185,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::h37f278b9f12a46b1" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -342,7 +342,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h45c3b3c26335d738" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -407,7 +407,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h7f03fb3ec7475c2e" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -492,7 +492,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hd1d6c8c7028d0e29" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -529,7 +529,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::hff2ea6338b6cd636" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -1200,7 +1200,7 @@ "name": "fibonacci" } }, - "symbol_name": "fibonacci::fibonacci::h0f21316c520fb28a" + "symbol_name": "fibonacci::fibonacci::" }, { "details": null, @@ -1408,7 +1408,7 @@ "name": "main" } }, - "symbol_name": "fibonacci::main::had681b5951da2694" + "symbol_name": "fibonacci::main::" }, { "details": null, @@ -1766,7 +1766,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::h82e920d882b90fe9" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -2127,7 +2127,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::hf43aa668c9718a25" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -2306,7 +2306,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::hda9056ae1880857e" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/float.smir.json.expected b/tests/integration/programs/float.smir.json.expected index 8d62fba..b28c85b 100644 --- a/tests/integration/programs/float.smir.json.expected +++ b/tests/integration/programs/float.smir.json.expected @@ -90,22 +90,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -115,17 +115,17 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -227,7 +227,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::h5b7c1648725573f1" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -384,7 +384,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h2739793cd611786c" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -449,7 +449,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::hfef7d456f3c6afa0" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -534,7 +534,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h2137f1231538a0d9" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -571,7 +571,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h794fad15324f211a" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -1306,7 +1306,7 @@ "name": "main" } }, - "symbol_name": "float::main::hfcafba4483851527" + "symbol_name": "float::main::" }, { "details": null, @@ -1664,7 +1664,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::h4ac36573ae2e0d67" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -2025,7 +2025,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::h0283b14eff59cc87" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -2204,7 +2204,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h590c8af96d26a217" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/modulo.smir.json.expected b/tests/integration/programs/modulo.smir.json.expected index dd30648..2d1d9ba 100644 --- a/tests/integration/programs/modulo.smir.json.expected +++ b/tests/integration/programs/modulo.smir.json.expected @@ -47,22 +47,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -72,17 +72,17 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -184,7 +184,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::h3ecc4521b60b951d" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -341,7 +341,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h53f7abae41de76ce" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -406,7 +406,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h7e3576d4173f4f99" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -491,7 +491,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hcc706b24a8fd3a60" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -528,7 +528,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h167abccb21f04ecb" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -1101,7 +1101,7 @@ "name": "main" } }, - "symbol_name": "modulo::main::ha5c5b72dafef00b4" + "symbol_name": "modulo::main::" }, { "details": null, @@ -1459,7 +1459,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::h551aa0b0ac8bb68d" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -1820,7 +1820,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::hb929cba43cae5f75" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -1999,7 +1999,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h22419fa5b3007a08" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/mutual_recursion.smir.json.expected b/tests/integration/programs/mutual_recursion.smir.json.expected index 2863b4d..e622420 100644 --- a/tests/integration/programs/mutual_recursion.smir.json.expected +++ b/tests/integration/programs/mutual_recursion.smir.json.expected @@ -46,22 +46,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -71,27 +71,27 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN16mutual_recursion6is_odd17h" + "NormalSym": "mutual_recursion::is_odd::" } ], [ { - "NormalSym": "_ZN16mutual_recursion7is_even17h" + "NormalSym": "mutual_recursion::is_even::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -193,7 +193,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::hb087d49f0e511144" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -258,7 +258,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h9af5c3a5be898749" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -415,7 +415,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::ha78265c06a8e885f" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -500,7 +500,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hd09e8fedb1c94470" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -537,7 +537,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h3cef9f41f602ad83" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -844,7 +844,7 @@ "name": "is_even" } }, - "symbol_name": "mutual_recursion::is_even::hfe5f12c9fea0552e" + "symbol_name": "mutual_recursion::is_even::" }, { "details": null, @@ -1151,7 +1151,7 @@ "name": "is_odd" } }, - "symbol_name": "mutual_recursion::is_odd::h0306caf7bd636f15" + "symbol_name": "mutual_recursion::is_odd::" }, { "details": null, @@ -1359,7 +1359,7 @@ "name": "main" } }, - "symbol_name": "mutual_recursion::main::h313f0c99534e377b" + "symbol_name": "mutual_recursion::main::" }, { "details": null, @@ -1717,7 +1717,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::h82ae6e6ca1c57c00" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -2078,7 +2078,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::hf951a2d0e8784ca7" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -2257,7 +2257,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h07ef4c1b0bc2cdbd" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/option-construction.smir.json.expected b/tests/integration/programs/option-construction.smir.json.expected index d0f148c..9d77ace 100644 --- a/tests/integration/programs/option-construction.smir.json.expected +++ b/tests/integration/programs/option-construction.smir.json.expected @@ -3,22 +3,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -28,22 +28,22 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN4core6option13unwrap_failed17h" + "NormalSym": "core::option::unwrap_failed::" } ], [ { - "NormalSym": "_ZN4core6option15Option$LT$T$GT$6unwrap17h" + "NormalSym": "core::option::Option::unwrap::" } ], [ @@ -145,7 +145,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::ha795d5993af4fda9" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -210,7 +210,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::ha4f084d24449852a" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -367,7 +367,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::he839f8300ff4cb81" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -452,7 +452,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h41ecae3d037041d3" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -642,7 +642,7 @@ "name": "std::option::Option::::unwrap" } }, - "symbol_name": "core::option::Option::unwrap::h38fc66650d49cffd" + "symbol_name": "core::option::Option::unwrap::" }, { "details": null, @@ -679,7 +679,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h832f1e7b37cc2be3" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -892,7 +892,7 @@ "name": "main" } }, - "symbol_name": "option_construction::main::h6de1823d79c69627" + "symbol_name": "option_construction::main::" }, { "details": null, @@ -1250,7 +1250,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::h58b6137fadd7cc0f" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -1611,7 +1611,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::hca62f3c0fe0902ad" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -1790,7 +1790,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::ha0c968296550067c" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/primitive-type-bounds.smir.json.expected b/tests/integration/programs/primitive-type-bounds.smir.json.expected index a2ebd26..a5f7090 100644 --- a/tests/integration/programs/primitive-type-bounds.smir.json.expected +++ b/tests/integration/programs/primitive-type-bounds.smir.json.expected @@ -41,22 +41,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -66,17 +66,17 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -178,7 +178,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::h69c88cbf34136087" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -335,7 +335,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::hb81edc2264643229" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -400,7 +400,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::hf5d1822a163fc9b7" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -485,7 +485,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hb48661e88cfe6c21" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -522,7 +522,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::hd9b56215741f7d6a" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -966,7 +966,7 @@ "name": "main" } }, - "symbol_name": "primitive_type_bounds::main::h8773a5e1da0a396d" + "symbol_name": "primitive_type_bounds::main::" }, { "details": null, @@ -1324,7 +1324,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::hc3893bfd782986d1" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -1685,7 +1685,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::h02c505624a13239f" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -1864,7 +1864,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::hd9d485e2371a6f20" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/recursion-simple-match.smir.json.expected b/tests/integration/programs/recursion-simple-match.smir.json.expected index 57c4547..96ad8e7 100644 --- a/tests/integration/programs/recursion-simple-match.smir.json.expected +++ b/tests/integration/programs/recursion-simple-match.smir.json.expected @@ -44,22 +44,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -69,22 +69,22 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN22recursion_simple_match12sum_to_n_rec17h" + "NormalSym": "recursion_simple_match::sum_to_n_rec::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -186,7 +186,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::h8ab32beb8c035b51" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -343,7 +343,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h23a2754b9f29f2ed" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -408,7 +408,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::hbd793cfecefa0530" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -493,7 +493,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::haa5c1b083d46d3ac" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -530,7 +530,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::ha2ea3ca4abe65743" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -738,7 +738,7 @@ "name": "main" } }, - "symbol_name": "recursion_simple_match::main::h71d32246ead50f34" + "symbol_name": "recursion_simple_match::main::" }, { "details": null, @@ -1168,7 +1168,7 @@ "name": "sum_to_n_rec" } }, - "symbol_name": "recursion_simple_match::sum_to_n_rec::h295ab07e17e15bfe" + "symbol_name": "recursion_simple_match::sum_to_n_rec::" }, { "details": null, @@ -1526,7 +1526,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::hdcae6ddbef5aa5e9" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -1887,7 +1887,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::h78d1f12c16f77a9c" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -2066,7 +2066,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h0824f590e386f9d0" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/recursion-simple.smir.json.expected b/tests/integration/programs/recursion-simple.smir.json.expected index a685065..fb9e4e5 100644 --- a/tests/integration/programs/recursion-simple.smir.json.expected +++ b/tests/integration/programs/recursion-simple.smir.json.expected @@ -44,22 +44,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -69,22 +69,22 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN16recursion_simple12sum_to_n_rec17h" + "NormalSym": "recursion_simple::sum_to_n_rec::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -186,7 +186,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::h3c61de52d3aaf346" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -251,7 +251,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h280ca10d4cdc089b" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -408,7 +408,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h99733990595be573" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -493,7 +493,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h93f3b1c71a34fe2f" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -530,7 +530,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::hba5d3cf0898289b8" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -738,7 +738,7 @@ "name": "main" } }, - "symbol_name": "recursion_simple::main::h08d6a0945650288a" + "symbol_name": "recursion_simple::main::" }, { "details": null, @@ -1168,7 +1168,7 @@ "name": "sum_to_n_rec" } }, - "symbol_name": "recursion_simple::sum_to_n_rec::he6087e74219aae9a" + "symbol_name": "recursion_simple::sum_to_n_rec::" }, { "details": null, @@ -1526,7 +1526,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::h6813f563cc4218d2" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -1887,7 +1887,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::hd1e5b255d7ed4911" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -2066,7 +2066,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::he013b6cd6132de39" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/ref-deref.smir.json.expected b/tests/integration/programs/ref-deref.smir.json.expected index cf79c8f..05d8efa 100644 --- a/tests/integration/programs/ref-deref.smir.json.expected +++ b/tests/integration/programs/ref-deref.smir.json.expected @@ -42,22 +42,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -67,17 +67,17 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -179,7 +179,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::h1db1994450c995b9" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -336,7 +336,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::hab130e2b51023149" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -401,7 +401,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::he591638444c40604" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -486,7 +486,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hade879db44b9b15f" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -523,7 +523,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h1259421e13197a17" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -800,7 +800,7 @@ "name": "main" } }, - "symbol_name": "ref_deref::main::hafa2aaed1169ba33" + "symbol_name": "ref_deref::main::" }, { "details": null, @@ -1158,7 +1158,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::h062ecccc8fb0aca0" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -1519,7 +1519,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::hb3e9d887ea373cd2" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -1698,7 +1698,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::hcdd8860f33743a7e" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/shl_min.smir.json.expected b/tests/integration/programs/shl_min.smir.json.expected index f046588..9668f09 100644 --- a/tests/integration/programs/shl_min.smir.json.expected +++ b/tests/integration/programs/shl_min.smir.json.expected @@ -310,22 +310,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -335,17 +335,17 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -447,7 +447,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::h2ab48ba267c31787" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -604,7 +604,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h2b541786d9b77274" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -669,7 +669,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::he1db7d89f7ff1441" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -754,7 +754,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h0745542dd23d7aca" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -791,7 +791,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::hab605144174073af" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -2580,7 +2580,7 @@ "name": "main" } }, - "symbol_name": "shl_min::main::hd5eabd20dc15e68a" + "symbol_name": "shl_min::main::" }, { "details": null, @@ -2938,7 +2938,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::habd382077faec271" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -3299,7 +3299,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::h7005d4929f44beb7" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -3478,7 +3478,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h82de7d5eb33a8e01" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/slice.smir.json.expected b/tests/integration/programs/slice.smir.json.expected index c0e8ed5..39bf28b 100644 --- a/tests/integration/programs/slice.smir.json.expected +++ b/tests/integration/programs/slice.smir.json.expected @@ -67,32 +67,32 @@ "functions": [ [ { - "NormalSym": "_ZN4core5slice5index24slice_end_index_len_fail17h" + "NormalSym": "core::slice::index::slice_end_index_len_fail::" } ], [ { - "NormalSym": "_ZN4core5slice5index22slice_index_order_fail17h" + "NormalSym": "core::slice::index::slice_index_order_fail::" } ], [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -102,32 +102,32 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN4core5slice5index74_$LT$impl$u20$core..ops..index..Index$LT$I$GT$$u20$for$u20$$u5b$T$u5d$$GT$5index17h" + "NormalSym": "core::slice::index:: for [T]>::index::" } ], [ { - "NormalSym": "_ZN69_$LT$T$u20$as$u20$core..array..equality..SpecArrayEq$LT$U$C$_$GT$$GT$7spec_eq17h" + "NormalSym": ">::spec_eq::" } ], [ { - "NormalSym": "_ZN4core5array8equality92_$LT$impl$u20$core..cmp..PartialEq$LT$$u5b$U$u3b$$u20$N$u5d$$GT$$u20$for$u20$$u5b$T$u5d$$GT$2eq17h" + "NormalSym": "core::array::equality:: for [T]>::eq::" } ], [ { - "NormalSym": "_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17h" + "NormalSym": " as core::slice::index::SliceIndex<[T]>>::index::" } ], [ @@ -137,17 +137,17 @@ ], [ { - "NormalSym": "_ZN4core5array85_$LT$impl$u20$core..ops..index..Index$LT$I$GT$$u20$for$u20$$u5b$T$u3b$$u20$N$u5d$$GT$5index17h" + "NormalSym": "core::array:: for [T; N]>::index::" } ], [ { - "NormalSym": "_ZN4core5array8equality96_$LT$impl$u20$core..cmp..PartialEq$LT$$u5b$U$u3b$$u20$N$u5d$$GT$$u20$for$u20$$RF$$u5b$T$u5d$$GT$2eq17h" + "NormalSym": "core::array::equality:: for &[T]>::eq::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -249,7 +249,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::h33c0f3458c5436db" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -405,7 +405,7 @@ "name": ">::spec_eq" } }, - "symbol_name": ">::spec_eq::h05cf8c7ebc067cc0" + "symbol_name": ">::spec_eq::" }, { "details": null, @@ -1298,7 +1298,7 @@ "name": " as std::slice::SliceIndex<[i32]>>::index" } }, - "symbol_name": " as core::slice::index::SliceIndex<[T]>>::index::hc9dd095fa490333d" + "symbol_name": " as core::slice::index::SliceIndex<[T]>>::index::" }, { "details": null, @@ -1443,7 +1443,7 @@ "name": "std::array::> for [i32; 4]>::index" } }, - "symbol_name": "core::array:: for [T; N]>::index::h8e4cb569a34f524b" + "symbol_name": "core::array:: for [T; N]>::index::" }, { "details": null, @@ -1584,7 +1584,7 @@ "name": "std::array::equality:: for &[i32]>::eq" } }, - "symbol_name": "core::array::equality:: for &[T]>::eq::h74f8bdfab07113be" + "symbol_name": "core::array::equality:: for &[T]>::eq::" }, { "details": null, @@ -2516,7 +2516,7 @@ "name": "std::array::equality:: for [i32]>::eq" } }, - "symbol_name": "core::array::equality:: for [T]>::eq::h1eb20d1304d91fda" + "symbol_name": "core::array::equality:: for [T]>::eq::" }, { "details": null, @@ -2673,7 +2673,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h05003d9805ddae31" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -2738,7 +2738,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h19ff14906b46b81d" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -2823,7 +2823,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::he296d6dd3728c972" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -2860,7 +2860,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::hf29be8cdda0a7294" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -2974,7 +2974,7 @@ "name": "core::slice::index::> for [i32]>::index" } }, - "symbol_name": "core::slice::index:: for [T]>::index::h3e9fdcc8bc4b3d0e" + "symbol_name": "core::slice::index:: for [T]>::index::" }, { "details": null, @@ -3582,7 +3582,7 @@ "name": "main" } }, - "symbol_name": "slice::main::h59a7158e62ef4fe0" + "symbol_name": "slice::main::" }, { "details": null, @@ -3940,7 +3940,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::hdeca08713139f399" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -4301,7 +4301,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::hae08aa071878c147" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -4480,7 +4480,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h59c8bf3bd83534f6" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], "types": [ diff --git a/tests/integration/programs/strange-ref-deref.smir.json.expected b/tests/integration/programs/strange-ref-deref.smir.json.expected index 9e218c8..8699afd 100644 --- a/tests/integration/programs/strange-ref-deref.smir.json.expected +++ b/tests/integration/programs/strange-ref-deref.smir.json.expected @@ -43,22 +43,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -68,17 +68,17 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -180,7 +180,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::hfb524dfebcdc543d" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -245,7 +245,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h3bb9aeeec65c1bd8" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -402,7 +402,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h3c3d8fbc4259f4e9" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -487,7 +487,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hc802067d8a5ee7c8" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -524,7 +524,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::he5740e6e2ff2dc90" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -882,7 +882,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::hb1e93a038b3c83aa" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -1243,7 +1243,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::h7d386711b55735fd" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -1422,7 +1422,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h7a74d30cfdff2a0b" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" }, { "details": null, @@ -1755,7 +1755,7 @@ "name": "main" } }, - "symbol_name": "strange_ref_deref::main::h01a29f59bf4e2506" + "symbol_name": "strange_ref_deref::main::" } ], "types": [ diff --git a/tests/integration/programs/struct.smir.json.expected b/tests/integration/programs/struct.smir.json.expected index 903027d..2a879fd 100644 --- a/tests/integration/programs/struct.smir.json.expected +++ b/tests/integration/programs/struct.smir.json.expected @@ -49,22 +49,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -74,17 +74,17 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -186,7 +186,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::h65cee66fbe3f117d" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -343,7 +343,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h1299442242f51124" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -408,7 +408,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::hb6e11e16b5b54b6a" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -493,7 +493,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h46e8b502c756aaea" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -530,7 +530,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h37f9d68acbcfee8b" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -888,7 +888,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::h0ce5dd8f054fe391" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -1249,7 +1249,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::h34dcd22aa93c028c" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -1428,7 +1428,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h9f30cdd738da3e6a" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" }, { "details": null, @@ -1900,7 +1900,7 @@ "name": "main" } }, - "symbol_name": "struct::main::hc047982b70ef864e" + "symbol_name": "struct::main::" } ], "types": [ diff --git a/tests/integration/programs/sum-to-n.smir.json.expected b/tests/integration/programs/sum-to-n.smir.json.expected index 99cd5bd..5dbd73c 100644 --- a/tests/integration/programs/sum-to-n.smir.json.expected +++ b/tests/integration/programs/sum-to-n.smir.json.expected @@ -41,22 +41,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -66,27 +66,27 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN8sum_to_n8sum_to_n17h" + "NormalSym": "sum_to_n::sum_to_n::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ { - "NormalSym": "_ZN8sum_to_n13test_sum_to_n17h" + "NormalSym": "sum_to_n::test_sum_to_n::" } ], [ @@ -188,7 +188,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::h171c763059a29eb1" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -253,7 +253,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h3ffab4b9d12585e8" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -410,7 +410,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::hf0366b307858997e" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -495,7 +495,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h7bf74c286739fe5e" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -532,7 +532,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h3cfc3b9f723a22c5" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -890,7 +890,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::h07d8408a7ad22f1e" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -1251,7 +1251,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::h2d9aa2ab28720e2f" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -1430,7 +1430,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::heb5e756d786a8242" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" }, { "details": null, @@ -1495,7 +1495,7 @@ "name": "main" } }, - "symbol_name": "sum_to_n::main::hc4893a5b9e8ee034" + "symbol_name": "sum_to_n::main::" }, { "details": null, @@ -2099,7 +2099,7 @@ "name": "sum_to_n" } }, - "symbol_name": "sum_to_n::sum_to_n::ha8037c8f5b9f1867" + "symbol_name": "sum_to_n::sum_to_n::" }, { "details": null, @@ -2493,7 +2493,7 @@ "name": "test_sum_to_n" } }, - "symbol_name": "sum_to_n::test_sum_to_n::h9fac6d1224b2f624" + "symbol_name": "sum_to_n::test_sum_to_n::" } ], "types": [ diff --git a/tests/integration/programs/tuple-eq.smir.json.expected b/tests/integration/programs/tuple-eq.smir.json.expected index 29f3a6d..482e38f 100644 --- a/tests/integration/programs/tuple-eq.smir.json.expected +++ b/tests/integration/programs/tuple-eq.smir.json.expected @@ -71,22 +71,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -96,27 +96,27 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN4core3cmp5impls54_$LT$impl$u20$core..cmp..PartialEq$u20$for$u20$i32$GT$2eq17h" + "NormalSym": "core::cmp::impls::::eq::" } ], [ { - "NormalSym": "_ZN4core5tuple64_$LT$impl$u20$core..cmp..PartialEq$u20$for$u20$$LP$U$C$T$RP$$GT$2eq17h" + "NormalSym": "core::tuple::::eq::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -218,7 +218,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::he8867f1f131c4430" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -396,7 +396,7 @@ "name": "std::cmp::impls::::eq" } }, - "symbol_name": "core::cmp::impls::::eq::h34cd29185895066e" + "symbol_name": "core::cmp::impls::::eq::" }, { "details": null, @@ -553,7 +553,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h09820138d2bbfeed" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -618,7 +618,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::he5542e787ad844c6" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -703,7 +703,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::hd9b4d9f3c98e8010" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -740,7 +740,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::hca452a0428215b86" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -1203,7 +1203,7 @@ "name": "core::tuple::::eq" } }, - "symbol_name": "core::tuple::::eq::h3d2f56ba179cb218" + "symbol_name": "core::tuple::::eq::" }, { "details": null, @@ -1561,7 +1561,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::h30ae614e91b78454" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -1922,7 +1922,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::h2b716381c39d3627" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -2101,7 +2101,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::h4b826fa30c0cc815" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" }, { "details": null, @@ -2450,7 +2450,7 @@ "name": "main" } }, - "symbol_name": "tuple_eq::main::hd433be45974bc83a" + "symbol_name": "tuple_eq::main::" } ], "types": [ diff --git a/tests/integration/programs/tuples-simple.smir.json.expected b/tests/integration/programs/tuples-simple.smir.json.expected index c7a50ce..7006466 100644 --- a/tests/integration/programs/tuples-simple.smir.json.expected +++ b/tests/integration/programs/tuples-simple.smir.json.expected @@ -49,22 +49,22 @@ "functions": [ [ { - "NormalSym": "_ZN3std2rt19lang_start_internal17h" + "NormalSym": "std::rt::lang_start_internal::" } ], [ { - "NormalSym": "_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h" + "NormalSym": "std::sys::backtrace::__rust_begin_short_backtrace::" } ], [ { - "NormalSym": "_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h" + "NormalSym": "<() as std::process::Termination>::report::" } ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ @@ -74,17 +74,17 @@ ], [ { - "NormalSym": "_ZN4core3ops8function6FnOnce9call_once17h" + "NormalSym": "core::ops::function::FnOnce::call_once::" } ], [ { - "NormalSym": "_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h" + "NormalSym": "std::rt::lang_start::{{closure}}::" } ], [ { - "NormalSym": "_ZN4core9panicking5panic17h" + "NormalSym": "core::panicking::panic::" } ], [ @@ -186,7 +186,7 @@ "name": "<() as std::process::Termination>::report" } }, - "symbol_name": "<() as std::process::Termination>::report::hb569fe8df036e704" + "symbol_name": "<() as std::process::Termination>::report::" }, { "details": null, @@ -343,7 +343,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::h4f87faa79cacdbbc" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -408,7 +408,7 @@ "name": ">::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once::hadeb45e483eac926" + "symbol_name": "core::ops::function::FnOnce::call_once::" }, { "details": null, @@ -493,7 +493,7 @@ "name": "<{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>::call_once" } }, - "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::h1598661c484ad8de" + "symbol_name": "core::ops::function::FnOnce::call_once{{vtable.shim}}::" }, { "details": null, @@ -530,7 +530,7 @@ "name": "std::ptr::drop_in_place::<{closure@std::rt::lang_start<()>::{closure#0}}>" } }, - "symbol_name": "core::ptr::drop_in_place::{{closure}}>::h6fadba2c3637c8a1" + "symbol_name": "core::ptr::drop_in_place::{{closure}}>::" }, { "details": null, @@ -888,7 +888,7 @@ "name": "std::rt::lang_start::<()>" } }, - "symbol_name": "std::rt::lang_start::h784b49cfe47d3b32" + "symbol_name": "std::rt::lang_start::" }, { "details": null, @@ -1249,7 +1249,7 @@ "name": "std::rt::lang_start::<()>::{closure#0}" } }, - "symbol_name": "std::rt::lang_start::{{closure}}::he02f40c4625759dd" + "symbol_name": "std::rt::lang_start::{{closure}}::" }, { "details": null, @@ -1428,7 +1428,7 @@ "name": "std::sys::backtrace::__rust_begin_short_backtrace::" } }, - "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::hd8300ef90d40d1c4" + "symbol_name": "std::sys::backtrace::__rust_begin_short_backtrace::" }, { "details": null, @@ -1746,7 +1746,7 @@ "name": "main" } }, - "symbol_name": "tuples_simple::main::hdfb8f9bcaa21bb65" + "symbol_name": "tuples_simple::main::" } ], "types": [