diff --git a/third_party/move/move-compiler-v2/tests/ability-transform/borrowed_from_one_path.exp b/third_party/move/move-compiler-v2/tests/ability-transform/borrowed_from_one_path.exp index bf7ce3ca16be6d..ae4da36466455f 100644 --- a/third_party/move/move-compiler-v2/tests/ability-transform/borrowed_from_one_path.exp +++ b/third_party/move/move-compiler-v2/tests/ability-transform/borrowed_from_one_path.exp @@ -71,6 +71,50 @@ fun m::f($t0: u8, $t1: &vector): u64 { 14: return $t2 } +============ after LiveVarAnalysisProcessor: ================ + +[variant baseline] +fun m::f($t0: u8, $t1: &vector): u64 { + var $t2: u64 + var $t3: &vector + var $t4: bool + var $t5: u8 + var $t6: &m::R + var $t7: address + var $t8: &u64 + var $t9: u64 + # live vars: $t0, $t1 + 0: $t5 := 0 + # live vars: $t0, $t1, $t5 + 1: $t4 := ==($t0, $t5) + # live vars: $t1, $t4 + 2: if ($t4) goto 3 else goto 8 + # live vars: $t1 + 3: label L0 + # live vars: + 4: $t7 := 0x1 + # live vars: $t7 + 5: $t6 := borrow_global($t7) + # live vars: $t6 + 6: $t3 := borrow_field.data($t6) + # live vars: $t3 + 7: goto 10 + # live vars: $t1 + 8: label L1 + # live vars: $t1 + 9: $t3 := infer($t1) + # live vars: $t3 + 10: label L2 + # live vars: $t3 + 11: $t9 := 0 + # live vars: $t3, $t9 + 12: $t8 := vector::borrow($t3, $t9) + # live vars: $t8 + 13: $t2 := read_ref($t8) + # live vars: $t2 + 14: return $t2 +} + ============ after ReferenceSafetyProcessor: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/ability-transform/by_reference.exp b/third_party/move/move-compiler-v2/tests/ability-transform/by_reference.exp index 365b42d7f3f620..bff0906be42e10 100644 --- a/third_party/move/move-compiler-v2/tests/ability-transform/by_reference.exp +++ b/third_party/move/move-compiler-v2/tests/ability-transform/by_reference.exp @@ -333,6 +333,216 @@ fun _0::check() { 84: return () } +============ after LiveVarAnalysisProcessor: ================ + +[variant baseline] +fun _0::check() { + var $t0: bool + var $t1: u64 + var $t2: bool + var $t3: u64 + var $t4: bool + var $t5: u64 + var $t6: &u64 + var $t7: u64 + var $t8: u64 + var $t9: u64 + var $t10: bool + var $t11: vector + var $t12: &vector + var $t13: vector + var $t14: vector + var $t15: u64 + var $t16: &mut u64 + var $t17: u64 + var $t18: u64 + var $t19: &mut vector + var $t20: vector + var $t21: vector + var $t22: bool + var $t23: u64 + var $t24: u64 + var $t25: u64 + var $t26: bool + var $t27: vector + var $t28: vector + var $t29: u64 + var $t30: bool + var $t31: u64 + var $t32: bool + var $t33: u64 + # live vars: + 0: $t0 := true + # live vars: $t0 + 1: if ($t0) goto 2 else goto 4 + # live vars: + 2: label L0 + # live vars: + 3: goto 7 + # live vars: + 4: label L1 + # live vars: + 5: $t1 := 42 + # live vars: $t1 + 6: abort($t1) + # live vars: + 7: label L2 + # live vars: + 8: $t2 := true + # live vars: $t2 + 9: if ($t2) goto 10 else goto 12 + # live vars: + 10: label L3 + # live vars: + 11: goto 15 + # live vars: + 12: label L4 + # live vars: + 13: $t3 := 42 + # live vars: $t3 + 14: abort($t3) + # live vars: + 15: label L5 + # live vars: + 16: $t7 := 0 + # live vars: $t7 + 17: $t6 := borrow_local($t7) + # live vars: $t6 + 18: $t5 := read_ref($t6) + # live vars: $t5 + 19: $t8 := 0 + # live vars: $t5, $t8 + 20: $t4 := ==($t5, $t8) + # live vars: $t4 + 21: if ($t4) goto 22 else goto 24 + # live vars: + 22: label L6 + # live vars: + 23: goto 27 + # live vars: + 24: label L7 + # live vars: + 25: $t9 := 42 + # live vars: $t9 + 26: abort($t9) + # live vars: + 27: label L8 + # live vars: + 28: $t13 := [104, 101, 108, 108, 111] + # live vars: $t13 + 29: $t12 := borrow_local($t13) + # live vars: $t12 + 30: $t11 := read_ref($t12) + # live vars: $t11 + 31: $t14 := [104, 101, 108, 108, 111] + # live vars: $t11, $t14 + 32: $t10 := ==($t11, $t14) + # live vars: $t10 + 33: if ($t10) goto 34 else goto 36 + # live vars: + 34: label L9 + # live vars: + 35: goto 39 + # live vars: + 36: label L10 + # live vars: + 37: $t15 := 42 + # live vars: $t15 + 38: abort($t15) + # live vars: + 39: label L11 + # live vars: + 40: $t17 := 0 + # live vars: $t17 + 41: $t16 := borrow_local($t17) + # live vars: $t16 + 42: $t18 := 1 + # live vars: $t16, $t18 + 43: write_ref($t16, $t18) + # live vars: $t16 + 44: $t20 := [104, 101, 108, 108, 111] + # live vars: $t16, $t20 + 45: $t19 := borrow_local($t20) + # live vars: $t16, $t19 + 46: $t21 := [98, 121, 101] + # live vars: $t16, $t19, $t21 + 47: write_ref($t19, $t21) + # live vars: $t16, $t19 + 48: $t23 := read_ref($t16) + # live vars: $t19, $t23 + 49: $t24 := 1 + # live vars: $t19, $t23, $t24 + 50: $t22 := ==($t23, $t24) + # live vars: $t19, $t22 + 51: if ($t22) goto 52 else goto 54 + # live vars: $t19 + 52: label L12 + # live vars: $t19 + 53: goto 57 + # live vars: $t19 + 54: label L13 + # live vars: + 55: $t25 := 42 + # live vars: $t25 + 56: abort($t25) + # live vars: $t19 + 57: label L14 + # live vars: $t19 + 58: $t27 := read_ref($t19) + # live vars: $t27 + 59: $t28 := [98, 121, 101] + # live vars: $t27, $t28 + 60: $t26 := ==($t27, $t28) + # live vars: $t26 + 61: if ($t26) goto 62 else goto 64 + # live vars: + 62: label L15 + # live vars: + 63: goto 67 + # live vars: + 64: label L16 + # live vars: + 65: $t29 := 42 + # live vars: $t29 + 66: abort($t29) + # live vars: + 67: label L17 + # live vars: + 68: $t30 := true + # live vars: $t30 + 69: if ($t30) goto 70 else goto 72 + # live vars: + 70: label L18 + # live vars: + 71: goto 75 + # live vars: + 72: label L19 + # live vars: + 73: $t31 := 42 + # live vars: $t31 + 74: abort($t31) + # live vars: + 75: label L20 + # live vars: + 76: $t32 := true + # live vars: $t32 + 77: if ($t32) goto 78 else goto 80 + # live vars: + 78: label L21 + # live vars: + 79: goto 83 + # live vars: + 80: label L22 + # live vars: + 81: $t33 := 42 + # live vars: $t33 + 82: abort($t33) + # live vars: + 83: label L23 + # live vars: + 84: return () +} + ============ after ReferenceSafetyProcessor: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/ability-transform/copy_ability_tuple.exp b/third_party/move/move-compiler-v2/tests/ability-transform/copy_ability_tuple.exp index 63346bfd6f41b1..739afae97ab0fd 100644 --- a/third_party/move/move-compiler-v2/tests/ability-transform/copy_ability_tuple.exp +++ b/third_party/move/move-compiler-v2/tests/ability-transform/copy_ability_tuple.exp @@ -38,6 +38,40 @@ public fun M::f($t0: M::R): (M::R, u64) { } +[variant baseline] +public fun M::g($t0: &signer) { + var $t1: M::R + var $t2: u64 + var $t3: u64 + # live vars: $t0 + 0: $t2 := 1 + # live vars: $t0, $t2 + 1: $t1 := pack M::R($t2) + # live vars: $t0, $t1 + 2: $t3 := 3 + # live vars: $t0, $t1 + 3: ($t1, $t3) := M::f($t1) + # live vars: $t0, $t1 + 4: move_to($t0, $t1) + # live vars: + 5: return () +} + +============ after LiveVarAnalysisProcessor: ================ + +[variant baseline] +public fun M::f($t0: M::R): (M::R, u64) { + var $t1: M::R + var $t2: u64 + # live vars: $t0 + 0: $t1 := infer($t0) + # live vars: $t1 + 1: $t2 := 0 + # live vars: $t1, $t2 + 2: return ($t1, $t2) +} + + [variant baseline] public fun M::g($t0: &signer) { var $t1: M::R diff --git a/third_party/move/move-compiler-v2/tests/ability-transform/dead_but_borrowed.exp b/third_party/move/move-compiler-v2/tests/ability-transform/dead_but_borrowed.exp index 66cf31cd5bc5cb..2f9cb7596ce671 100644 --- a/third_party/move/move-compiler-v2/tests/ability-transform/dead_but_borrowed.exp +++ b/third_party/move/move-compiler-v2/tests/ability-transform/dead_but_borrowed.exp @@ -28,6 +28,23 @@ fun explicate_drop::test0(): u8 { 3: return $t0 } +============ after LiveVarAnalysisProcessor: ================ + +[variant baseline] +fun explicate_drop::test0(): u8 { + var $t0: u8 + var $t1: &u8 + var $t2: u8 + # live vars: + 0: $t2 := 42 + # live vars: $t2 + 1: $t1 := borrow_local($t2) + # live vars: $t1 + 2: $t0 := read_ref($t1) + # live vars: $t0 + 3: return $t0 +} + ============ after ReferenceSafetyProcessor: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/ability-transform/destroy_after_call.exp b/third_party/move/move-compiler-v2/tests/ability-transform/destroy_after_call.exp index e0c1d85b4cadef..20d836b2d2596a 100644 --- a/third_party/move/move-compiler-v2/tests/ability-transform/destroy_after_call.exp +++ b/third_party/move/move-compiler-v2/tests/ability-transform/destroy_after_call.exp @@ -34,6 +34,46 @@ fun m::f($t0: &mut u64): &mut u64 { } +[variant baseline] +fun m::g() { + var $t0: u64 + var $t1: &mut u64 + var $t2: &mut u64 + var $t3: &u64 + # live vars: + 0: $t0 := 22 + # live vars: $t0 + 1: $t1 := borrow_local($t0) + # live vars: $t0, $t1 + 2: $t2 := m::f($t1) + # live vars: $t0, $t2 + 3: $t1 := infer($t2) + # live vars: $t0 + 4: $t3 := borrow_local($t0) + # live vars: + 5: return () +} + + +Diagnostics: +warning: Unused assignment to r. Consider removing or prefixing with an underscore: `_r` + ┌─ tests/ability-transform/destroy_after_call.move:8:9 + │ +8 │ r = f(r); + │ ^^^^^^^^ + +============ after LiveVarAnalysisProcessor: ================ + +[variant baseline] +fun m::f($t0: &mut u64): &mut u64 { + var $t1: &mut u64 + # live vars: $t0 + 0: $t1 := infer($t0) + # live vars: $t1 + 1: return $t1 +} + + [variant baseline] fun m::g() { var $t0: u64 diff --git a/third_party/move/move-compiler-v2/tests/ability-transform/drop_after_loop.exp b/third_party/move/move-compiler-v2/tests/ability-transform/drop_after_loop.exp index 257b1bae0d6cd1..77edac67936f6b 100644 --- a/third_party/move/move-compiler-v2/tests/ability-transform/drop_after_loop.exp +++ b/third_party/move/move-compiler-v2/tests/ability-transform/drop_after_loop.exp @@ -104,6 +104,72 @@ fun m::drop_after_loop() { 25: return () } +============ after LiveVarAnalysisProcessor: ================ + +[variant baseline] +fun m::drop_after_loop() { + var $t0: u64 + var $t1: &mut u64 + var $t2: bool + var $t3: u64 + var $t4: bool + var $t5: bool + var $t6: u64 + var $t7: u64 + # live vars: + 0: $t0 := 1 + # live vars: $t0 + 1: $t1 := borrow_local($t0) + # live vars: $t0, $t1 + 2: $t2 := true + # live vars: $t0, $t1, $t2 + 3: label L0 + # live vars: $t0, $t1, $t2 + 4: if ($t2) goto 5 else goto 11 + # live vars: $t0, $t1 + 5: label L2 + # live vars: $t0, $t1 + 6: $t3 := 2 + # live vars: $t0, $t1, $t3 + 7: write_ref($t1, $t3) + # live vars: $t0, $t1 + 8: $t4 := false + # live vars: $t0, $t1, $t4 + 9: $t2 := infer($t4) + # live vars: $t0, $t1, $t2 + 10: goto 13 + # live vars: $t0, $t1 + 11: label L3 + # live vars: $t0 + 12: goto 15 + # live vars: $t0, $t1, $t2 + 13: label L4 + # live vars: $t0, $t1, $t2 + 14: goto 3 + # live vars: $t0 + 15: label L1 + # live vars: $t0 + 16: $t6 := 2 + # live vars: $t0, $t6 + 17: $t5 := ==($t0, $t6) + # live vars: $t5 + 18: if ($t5) goto 19 else goto 21 + # live vars: + 19: label L5 + # live vars: + 20: goto 24 + # live vars: + 21: label L6 + # live vars: + 22: $t7 := 0 + # live vars: $t7 + 23: abort($t7) + # live vars: + 24: label L7 + # live vars: + 25: return () +} + ============ after ReferenceSafetyProcessor: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/ability-transform/drop_at_branch.exp b/third_party/move/move-compiler-v2/tests/ability-transform/drop_at_branch.exp index 7b5153dffd6dd0..baaa593bf4a384 100644 --- a/third_party/move/move-compiler-v2/tests/ability-transform/drop_at_branch.exp +++ b/third_party/move/move-compiler-v2/tests/ability-transform/drop_at_branch.exp @@ -36,6 +36,29 @@ fun explicate_drop::drop_at_branch($t0: bool): u8 { 7: return $t1 } +============ after LiveVarAnalysisProcessor: ================ + +[variant baseline] +fun explicate_drop::drop_at_branch($t0: bool): u8 { + var $t1: u8 + # live vars: $t0 + 0: if ($t0) goto 1 else goto 4 + # live vars: + 1: label L0 + # live vars: + 2: $t1 := 1 + # live vars: $t1 + 3: goto 6 + # live vars: + 4: label L1 + # live vars: + 5: $t1 := 0 + # live vars: $t1 + 6: label L2 + # live vars: $t1 + 7: return $t1 +} + ============ after ReferenceSafetyProcessor: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/ability-transform/foreach_mut_expanded.exp b/third_party/move/move-compiler-v2/tests/ability-transform/foreach_mut_expanded.exp index f696ee52a0ffbf..57cddffaf1f901 100644 --- a/third_party/move/move-compiler-v2/tests/ability-transform/foreach_mut_expanded.exp +++ b/third_party/move/move-compiler-v2/tests/ability-transform/foreach_mut_expanded.exp @@ -129,6 +129,87 @@ fun m::test_for_each_mut() { 30: return () } +============ after LiveVarAnalysisProcessor: ================ + +[variant baseline] +fun m::test_for_each_mut() { + var $t0: vector + var $t1: u64 + var $t2: u64 + var $t3: &vector + var $t4: &mut vector + var $t5: bool + var $t6: &mut u64 + var $t7: u64 + var $t8: u64 + var $t9: u64 + var $t10: bool + var $t11: vector + var $t12: u64 + # live vars: + 0: $t0 := ["1", "2", "3"] + # live vars: $t0 + 1: $t1 := 0 + # live vars: $t0, $t1 + 2: $t3 := borrow_local($t0) + # live vars: $t0, $t1, $t3 + 3: $t2 := vector::length($t3) + # live vars: $t0, $t1, $t2 + 4: $t4 := borrow_local($t0) + # live vars: $t0, $t1, $t2, $t4 + 5: label L0 + # live vars: $t0, $t1, $t2, $t4 + 6: $t5 := <($t1, $t2) + # live vars: $t0, $t1, $t2, $t4, $t5 + 7: if ($t5) goto 8 else goto 16 + # live vars: $t0, $t1, $t2, $t4 + 8: label L2 + # live vars: $t0, $t1, $t2, $t4 + 9: $t6 := vector::borrow_mut($t4, $t1) + # live vars: $t0, $t1, $t2, $t4, $t6 + 10: $t7 := 2 + # live vars: $t0, $t1, $t2, $t4, $t6, $t7 + 11: write_ref($t6, $t7) + # live vars: $t0, $t1, $t2, $t4 + 12: $t9 := 1 + # live vars: $t0, $t1, $t2, $t4, $t9 + 13: $t8 := +($t1, $t9) + # live vars: $t0, $t2, $t4, $t8 + 14: $t1 := infer($t8) + # live vars: $t0, $t1, $t2, $t4 + 15: goto 18 + # live vars: $t0, $t1, $t2, $t4 + 16: label L3 + # live vars: $t0 + 17: goto 20 + # live vars: $t0, $t1, $t2, $t4 + 18: label L4 + # live vars: $t0, $t1, $t2, $t4 + 19: goto 5 + # live vars: $t0 + 20: label L1 + # live vars: $t0 + 21: $t11 := ["2", "3", "4"] + # live vars: $t0, $t11 + 22: $t10 := ==($t0, $t11) + # live vars: $t10 + 23: if ($t10) goto 24 else goto 26 + # live vars: + 24: label L5 + # live vars: + 25: goto 29 + # live vars: + 26: label L6 + # live vars: + 27: $t12 := 0 + # live vars: $t12 + 28: abort($t12) + # live vars: + 29: label L7 + # live vars: + 30: return () +} + ============ after ReferenceSafetyProcessor: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/ability-transform/mutate_return.exp b/third_party/move/move-compiler-v2/tests/ability-transform/mutate_return.exp index e83571eda35db5..f7f2e990167a20 100644 --- a/third_party/move/move-compiler-v2/tests/ability-transform/mutate_return.exp +++ b/third_party/move/move-compiler-v2/tests/ability-transform/mutate_return.exp @@ -38,6 +38,32 @@ public fun m::singleton<#0>($t0: #0): vector<#0> { } +[variant baseline] +fun m::g<#0>($t0: &mut vector<#0>) { + # live vars: $t0 + 0: return () +} + +============ after LiveVarAnalysisProcessor: ================ + +[variant baseline] +public fun m::singleton<#0>($t0: #0): vector<#0> { + var $t1: vector<#0> + var $t2: vector<#0> + var $t3: &mut vector<#0> + # live vars: $t0 + 0: $t2 := vector($t0) + # live vars: $t2 + 1: $t3 := borrow_local($t2) + # live vars: $t2, $t3 + 2: m::g<#0>($t3) + # live vars: $t2 + 3: $t1 := infer($t2) + # live vars: $t1 + 4: return $t1 +} + + [variant baseline] fun m::g<#0>($t0: &mut vector<#0>) { # live vars: $t0 diff --git a/third_party/move/move-compiler-v2/tests/ability-transform/mutate_vector.exp b/third_party/move/move-compiler-v2/tests/ability-transform/mutate_vector.exp index dcfea63e6ee362..c9b8e8c2e45745 100644 --- a/third_party/move/move-compiler-v2/tests/ability-transform/mutate_vector.exp +++ b/third_party/move/move-compiler-v2/tests/ability-transform/mutate_vector.exp @@ -57,6 +57,47 @@ public fun m::new_scalar_from_u8($t0: u8): m::Scalar { } +[variant baseline] +public fun m::scalar_zero(): m::Scalar { + var $t0: m::Scalar + var $t1: vector + # live vars: + 0: $t1 := [0] + # live vars: $t1 + 1: $t0 := pack m::Scalar($t1) + # live vars: $t0 + 2: return $t0 +} + +============ after LiveVarAnalysisProcessor: ================ + +[variant baseline] +public fun m::new_scalar_from_u8($t0: u8): m::Scalar { + var $t1: m::Scalar + var $t2: m::Scalar + var $t3: &mut u8 + var $t4: &mut vector + var $t5: &mut m::Scalar + var $t6: u64 + # live vars: $t0 + 0: $t2 := m::scalar_zero() + # live vars: $t0, $t2 + 1: $t5 := borrow_local($t2) + # live vars: $t0, $t2, $t5 + 2: $t4 := borrow_field.data($t5) + # live vars: $t0, $t2, $t4 + 3: $t6 := 0 + # live vars: $t0, $t2, $t4, $t6 + 4: $t3 := vector::borrow_mut($t4, $t6) + # live vars: $t0, $t2, $t3 + 5: write_ref($t3, $t0) + # live vars: $t2 + 6: $t1 := infer($t2) + # live vars: $t1 + 7: return $t1 +} + + [variant baseline] public fun m::scalar_zero(): m::Scalar { var $t0: m::Scalar diff --git a/third_party/move/move-compiler-v2/tests/bytecode-generator/freeze_mut_ref.exp b/third_party/move/move-compiler-v2/tests/bytecode-generator/freeze_mut_ref.exp index ab3905586b4a9f..cfb3f2f89629fa 100644 --- a/third_party/move/move-compiler-v2/tests/bytecode-generator/freeze_mut_ref.exp +++ b/third_party/move/move-compiler-v2/tests/bytecode-generator/freeze_mut_ref.exp @@ -294,6 +294,44 @@ fun freeze_mut_ref::t8($t0: bool, $t1: &mut freeze_mut_ref::S, $t2: &freeze_mut_ } +Diagnostics: +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/bytecode-generator/freeze_mut_ref.move:58:9 + │ +58 │ (x, y) = (&mut 0, &mut 0); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: Unused assignment to y. Consider removing or prefixing with an underscore: `_y` + ┌─ tests/bytecode-generator/freeze_mut_ref.move:58:9 + │ +58 │ (x, y) = (&mut 0, &mut 0); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/bytecode-generator/freeze_mut_ref.move:66:24 + │ +66 │ let g = &mut ({x = x + 1; s}).f; + │ ^^^^^^^^^ + +warning: Unused assignment to z. Consider removing or prefixing with an underscore: `_z` + ┌─ tests/bytecode-generator/freeze_mut_ref.move:69:20 + │ +69 │ *({*f = 0; z = y; g}) = 2; + │ ^^^^^ + +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/bytecode-generator/freeze_mut_ref.move:74:19 + │ +74 │ if (cond) x = copy s else x = other; + │ ^^^^^^^^^^ + +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/bytecode-generator/freeze_mut_ref.move:74:35 + │ +74 │ if (cond) x = copy s else x = other; + │ ^^^^^^^^^ + + Diagnostics: error: mutable reference in local `s` requires exclusive access but is borrowed ┌─ tests/bytecode-generator/freeze_mut_ref.move:66:35 diff --git a/third_party/move/move-compiler-v2/tests/bytecode-generator/wildcard7.exp b/third_party/move/move-compiler-v2/tests/bytecode-generator/wildcard7.exp index 1e6874b74166b3..52ecc2e51d1041 100644 --- a/third_party/move/move-compiler-v2/tests/bytecode-generator/wildcard7.exp +++ b/third_party/move/move-compiler-v2/tests/bytecode-generator/wildcard7.exp @@ -42,6 +42,14 @@ public fun m::test(): u8 { } +Diagnostics: +warning: Unused assignment to q. Consider removing or prefixing with an underscore: `_q` + ┌─ tests/bytecode-generator/wildcard7.move:6:13 + │ +6 │ let (_, q) = (x, z); + │ ^^^^^^ + + Diagnostics: error: cannot move local `x` since it is still in use ┌─ tests/bytecode-generator/wildcard7.move:5:17 diff --git a/third_party/move/move-compiler-v2/tests/copy-propagation/call_1.exp b/third_party/move/move-compiler-v2/tests/copy-propagation/call_1.exp index 1d261d0a9ea43e..94b096bdb1f9ce 100644 --- a/third_party/move/move-compiler-v2/tests/copy-propagation/call_1.exp +++ b/third_party/move/move-compiler-v2/tests/copy-propagation/call_1.exp @@ -33,6 +33,14 @@ fun m::test($t0: u64): u64 { 6: return $t1 } + +Diagnostics: +warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` + ┌─ tests/copy-propagation/call_1.move:7:17 + │ +7 │ let a = p; + │ ^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/copy-propagation/seq_kills_1.exp b/third_party/move/move-compiler-v2/tests/copy-propagation/seq_kills_1.exp index 55bc0e2c25d3d0..0a8c2152af74dc 100644 --- a/third_party/move/move-compiler-v2/tests/copy-propagation/seq_kills_1.exp +++ b/third_party/move/move-compiler-v2/tests/copy-propagation/seq_kills_1.exp @@ -18,6 +18,14 @@ fun m::test($t0: u64): bool { 7: return $t1 } + +Diagnostics: +warning: Unused assignment to b. Consider removing or prefixing with an underscore: `_b` + ┌─ tests/copy-propagation/seq_kills_1.move:7:9 + │ +7 │ b = p + 1; // kill b := a, which removes the whole copy chain + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/copy-propagation/seq_kills_2.exp b/third_party/move/move-compiler-v2/tests/copy-propagation/seq_kills_2.exp index 3680de01d0e30d..e7fe96349524a2 100644 --- a/third_party/move/move-compiler-v2/tests/copy-propagation/seq_kills_2.exp +++ b/third_party/move/move-compiler-v2/tests/copy-propagation/seq_kills_2.exp @@ -18,6 +18,14 @@ fun m::test($t0: u64): bool { 7: return $t1 } + +Diagnostics: +warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` + ┌─ tests/copy-propagation/seq_kills_2.move:7:9 + │ +7 │ a = p + 1; // kill b := a + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/copy-propagation/straight_line_kills.exp b/third_party/move/move-compiler-v2/tests/copy-propagation/straight_line_kills.exp index aeb8910c1d774f..06c4d6fa894541 100644 --- a/third_party/move/move-compiler-v2/tests/copy-propagation/straight_line_kills.exp +++ b/third_party/move/move-compiler-v2/tests/copy-propagation/straight_line_kills.exp @@ -16,6 +16,14 @@ fun m::copy_kill($t0: u64): u64 { 6: return $t1 } + +Diagnostics: +warning: Unused assignment to p. Consider removing or prefixing with an underscore: `_p` + ┌─ tests/copy-propagation/straight_line_kills.move:5:9 + │ +5 │ p = p + 1; + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/reference-safety/write_ref_dest.exp b/third_party/move/move-compiler-v2/tests/reference-safety/write_ref_dest.exp index 90b32906711cc7..fe1cfaa36d8e69 100644 --- a/third_party/move/move-compiler-v2/tests/reference-safety/write_ref_dest.exp +++ b/third_party/move/move-compiler-v2/tests/reference-safety/write_ref_dest.exp @@ -1,2 +1,10 @@ +Diagnostics: +warning: Unused assignment to y. Consider removing or prefixing with an underscore: `_y` + ┌─ tests/reference-safety/write_ref_dest.move:16:9 + │ +16 │ (y, _) = (*&y, 1); + │ ^^^^^^^^^^^^^^^^^ + + ============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/reference-safety/write_ref_dest.no-opt.exp b/third_party/move/move-compiler-v2/tests/reference-safety/write_ref_dest.no-opt.exp index 90b32906711cc7..fe1cfaa36d8e69 100644 --- a/third_party/move/move-compiler-v2/tests/reference-safety/write_ref_dest.no-opt.exp +++ b/third_party/move/move-compiler-v2/tests/reference-safety/write_ref_dest.no-opt.exp @@ -1,2 +1,10 @@ +Diagnostics: +warning: Unused assignment to y. Consider removing or prefixing with an underscore: `_y` + ┌─ tests/reference-safety/write_ref_dest.move:16:9 + │ +16 │ (y, _) = (*&y, 1); + │ ^^^^^^^^^^^^^^^^^ + + ============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/simplifier-elimination/bind_with_type_annot.exp b/third_party/move/move-compiler-v2/tests/simplifier-elimination/bind_with_type_annot.exp index bd47ab1047bbe1..3aae1dd3118547 100644 --- a/third_party/move/move-compiler-v2/tests/simplifier-elimination/bind_with_type_annot.exp +++ b/third_party/move/move-compiler-v2/tests/simplifier-elimination/bind_with_type_annot.exp @@ -38,4 +38,18 @@ module 0x8675309::M { } // end 0x8675309::M +Diagnostics: +warning: Unused assignment to b. Consider removing or prefixing with an underscore: `_b` + ┌─ tests/simplifier-elimination/bind_with_type_annot.move:7:13 + │ +7 │ let (x, b, R{f}): (u64, bool, R) = (0, false, R { f: 0 }); x; b; f; + │ ^^^^^^^^^^^^ + +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/simplifier-elimination/bind_with_type_annot.move:7:13 + │ +7 │ let (x, b, R{f}): (u64, bool, R) = (0, false, R { f: 0 }); x; b; f; + │ ^^^^^^^^^^^^ + + ============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/simplifier-elimination/use_before_assign.exp b/third_party/move/move-compiler-v2/tests/simplifier-elimination/use_before_assign.exp index ac63e9d86f699f..b9a8559d1141cd 100644 --- a/third_party/move/move-compiler-v2/tests/simplifier-elimination/use_before_assign.exp +++ b/third_party/move/move-compiler-v2/tests/simplifier-elimination/use_before_assign.exp @@ -26,3 +26,11 @@ error: use of unassigned local `x` │ 4 │ let y = x; │ ^ + + +Diagnostics: +warning: Unused assignment to y. Consider removing or prefixing with an underscore: `_y` + ┌─ tests/simplifier-elimination/use_before_assign.move:4:13 + │ +4 │ let y = x; + │ ^ diff --git a/third_party/move/move-compiler-v2/tests/simplifier-elimination/use_before_assign_while.exp b/third_party/move/move-compiler-v2/tests/simplifier-elimination/use_before_assign_while.exp index 223526a98870c4..257f8e5a68f598 100644 --- a/third_party/move/move-compiler-v2/tests/simplifier-elimination/use_before_assign_while.exp +++ b/third_party/move/move-compiler-v2/tests/simplifier-elimination/use_before_assign_while.exp @@ -105,6 +105,14 @@ error: use of unassigned local `x` │ ^^ +Diagnostics: +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/simplifier-elimination/use_before_assign_while.move:19:60 + │ +19 │ while (cond) { let y = &x; _ = move y; if (cond) { x = 0 }; break } + │ ^^^^^ + + Diagnostics: error: cannot move local `x` since it is still in use ┌─ tests/simplifier-elimination/use_before_assign_while.move:9:32 diff --git a/third_party/move/move-compiler-v2/tests/simplifier/random.exp b/third_party/move/move-compiler-v2/tests/simplifier/random.exp index c476659b15e236..3fb15975714b42 100644 --- a/third_party/move/move-compiler-v2/tests/simplifier/random.exp +++ b/third_party/move/move-compiler-v2/tests/simplifier/random.exp @@ -144,6 +144,14 @@ module 0x8675::M { } // end 0x8675::M +Diagnostics: +warning: Unused assignment to q. Consider removing or prefixing with an underscore: `_q` + ┌─ tests/simplifier/random.move:48:17 + │ +48 │ let q = v; + │ ^ + + Diagnostics: error: cannot mutably borrow since immutable references exist ┌─ tests/simplifier/random.move:56:17 diff --git a/third_party/move/move-compiler-v2/tests/unreachable-code-remover/conditional_loop_unreachable.exp b/third_party/move/move-compiler-v2/tests/unreachable-code-remover/conditional_loop_unreachable.exp index 189a01e97ca647..90f944ba87f6fd 100644 --- a/third_party/move/move-compiler-v2/tests/unreachable-code-remover/conditional_loop_unreachable.exp +++ b/third_party/move/move-compiler-v2/tests/unreachable-code-remover/conditional_loop_unreachable.exp @@ -37,6 +37,20 @@ fun m::test($t0: bool, $t1: bool) { 26: return () } + +Diagnostics: +warning: Unused assignment to i. Consider removing or prefixing with an underscore: `_i` + ┌─ tests/unreachable-code-remover/conditional_loop_unreachable.move:7:17 + │ +7 │ i = i + 1; + │ ^^^^^^^^^ + +warning: Unused assignment to i. Consider removing or prefixing with an underscore: `_i` + ┌─ tests/unreachable-code-remover/conditional_loop_unreachable.move:12:13 + │ +12 │ i = i + 1; + │ ^^^^^^^^^ + ============ after UnreachableCodeProcessor: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/call_1.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/call_1.exp index 8cb6654d0e5633..8c6a6af8b1aaa5 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/call_1.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/call_1.exp @@ -33,6 +33,14 @@ fun m::test($t0: u64): u64 { 6: return $t1 } + +Diagnostics: +warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` + ┌─ tests/variable-coalescing/call_1.move:7:17 + │ +7 │ let a = p; + │ ^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/call_1.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/call_1.opt.exp index 8cb6654d0e5633..8c6a6af8b1aaa5 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/call_1.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/call_1.opt.exp @@ -33,6 +33,14 @@ fun m::test($t0: u64): u64 { 6: return $t1 } + +Diagnostics: +warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` + ┌─ tests/variable-coalescing/call_1.move:7:17 + │ +7 │ let a = p; + │ ^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/cant_copy_propagate.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/cant_copy_propagate.exp index 714466fd830f4b..4b0d42e60dde33 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/cant_copy_propagate.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/cant_copy_propagate.exp @@ -31,6 +31,20 @@ fun m::test($t0: u64, $t1: bool) { 13: return () } + +Diagnostics: +warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` + ┌─ tests/variable-coalescing/cant_copy_propagate.move:11:13 + │ +11 │ a = 99; + │ ^^^^^^ + +warning: Unused assignment to c. Consider removing or prefixing with an underscore: `_c` + ┌─ tests/variable-coalescing/cant_copy_propagate.move:13:13 + │ +13 │ c = c + 1; + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/cant_copy_propagate.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/cant_copy_propagate.opt.exp index 714466fd830f4b..4b0d42e60dde33 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/cant_copy_propagate.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/cant_copy_propagate.opt.exp @@ -31,6 +31,20 @@ fun m::test($t0: u64, $t1: bool) { 13: return () } + +Diagnostics: +warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` + ┌─ tests/variable-coalescing/cant_copy_propagate.move:11:13 + │ +11 │ a = 99; + │ ^^^^^^ + +warning: Unused assignment to c. Consider removing or prefixing with an underscore: `_c` + ┌─ tests/variable-coalescing/cant_copy_propagate.move:13:13 + │ +13 │ c = c + 1; + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_assignment_without_use.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_assignment_without_use.exp index 1be5d8b6fc8ed1..61cab7e1a35942 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_assignment_without_use.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_assignment_without_use.exp @@ -12,6 +12,14 @@ public fun m::test($t0: u64) { 4: return () } + +Diagnostics: +warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` + ┌─ tests/variable-coalescing/cyclic_assignment_without_use.move:6:9 + │ +6 │ a = c; + │ ^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_assignment_without_use.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_assignment_without_use.opt.exp index 1be5d8b6fc8ed1..61cab7e1a35942 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_assignment_without_use.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_assignment_without_use.opt.exp @@ -12,6 +12,14 @@ public fun m::test($t0: u64) { 4: return () } + +Diagnostics: +warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` + ┌─ tests/variable-coalescing/cyclic_assignment_without_use.move:6:9 + │ +6 │ a = c; + │ ^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/dead_assignment_3.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/dead_assignment_3.exp index 2ab2fd8b365f92..a7a488752275b5 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/dead_assignment_3.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/dead_assignment_3.exp @@ -20,6 +20,14 @@ public fun m::test($t0: bool): u32 { 12: return $t1 } + +Diagnostics: +warning: Unused assignment to y. Consider removing or prefixing with an underscore: `_y` + ┌─ tests/variable-coalescing/dead_assignment_3.move:10:13 + │ +10 │ y = y; + │ ^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/dead_assignment_3.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/dead_assignment_3.opt.exp index 10501d30e99430..78fe916a30c793 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/dead_assignment_3.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/dead_assignment_3.opt.exp @@ -18,6 +18,14 @@ public fun m::test($t0: bool): u32 { 11: return $t1 } + +Diagnostics: +warning: Unused assignment to y. Consider removing or prefixing with an underscore: `_y` + ┌─ tests/variable-coalescing/dead_assignment_3.move:10:13 + │ +10 │ y = y; + │ ^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/dead_assignment_4.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/dead_assignment_4.exp index 4dac3143233377..412603b8179550 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/dead_assignment_4.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/dead_assignment_4.exp @@ -67,6 +67,26 @@ public fun m::test4($t0: u64): u64 { 2: return $t1 } + +Diagnostics: +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/variable-coalescing/dead_assignment_4.move:3:17 + │ +3 │ let x = 1; + │ ^ + +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/variable-coalescing/dead_assignment_4.move:9:17 + │ +9 │ let x = y; + │ ^ + +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/variable-coalescing/dead_assignment_4.move:14:17 + │ +14 │ let x = y; + │ ^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/dead_assignment_4.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/dead_assignment_4.opt.exp index 6a523fee558e21..0222b7b9f8e9db 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/dead_assignment_4.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/dead_assignment_4.opt.exp @@ -61,6 +61,20 @@ public fun m::test4($t0: u64): u64 { 1: return $t1 } + +Diagnostics: +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/variable-coalescing/dead_assignment_4.move:9:17 + │ +9 │ let x = y; + │ ^ + +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/variable-coalescing/dead_assignment_4.move:14:17 + │ +14 │ let x = y; + │ ^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_1.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_1.exp index 8ad92bf6813751..c6306637c13e6f 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_1.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_1.exp @@ -16,6 +16,14 @@ fun m::test(): u64 { 6: return $t0 } + +Diagnostics: +warning: Unused assignment to t. Consider removing or prefixing with an underscore: `_t` + ┌─ tests/variable-coalescing/intermingled_1.move:5:9 + │ +5 │ t = t + u; + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_1.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_1.opt.exp index c8d8e9c9ea66be..0da5fe2264ad2b 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_1.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_1.opt.exp @@ -14,6 +14,14 @@ fun m::test(): u64 { 5: return $t0 } + +Diagnostics: +warning: Unused assignment to t. Consider removing or prefixing with an underscore: `_t` + ┌─ tests/variable-coalescing/intermingled_1.move:5:9 + │ +5 │ t = t + u; + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_3.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_3.exp index 5d50b3f39fdac3..777aaaf3b6c421 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_3.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_3.exp @@ -18,6 +18,14 @@ fun m::test(): u64 { 7: return $t0 } + +Diagnostics: +warning: Unused assignment to t. Consider removing or prefixing with an underscore: `_t` + ┌─ tests/variable-coalescing/intermingled_3.move:5:9 + │ +5 │ t = t + 1; + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_3.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_3.opt.exp index dd35312daf6a4e..422b8bb6b5b2ea 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_3.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_3.opt.exp @@ -14,6 +14,14 @@ fun m::test(): u64 { 5: return $t0 } + +Diagnostics: +warning: Unused assignment to t. Consider removing or prefixing with an underscore: `_t` + ┌─ tests/variable-coalescing/intermingled_3.move:5:9 + │ +5 │ t = t + 1; + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/multi_assigns.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/multi_assigns.exp index 487f77be960ef3..c1cc7a4b6ac492 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/multi_assigns.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/multi_assigns.exp @@ -12,6 +12,14 @@ fun m::test(): u64 { 4: return $t0 } + +Diagnostics: +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/variable-coalescing/multi_assigns.move:3:17 + │ +3 │ let x = 1; + │ ^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/multi_assigns.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/multi_assigns.opt.exp index 487f77be960ef3..c1cc7a4b6ac492 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/multi_assigns.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/multi_assigns.opt.exp @@ -12,6 +12,14 @@ fun m::test(): u64 { 4: return $t0 } + +Diagnostics: +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/variable-coalescing/multi_assigns.move:3:17 + │ +3 │ let x = 1; + │ ^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/non_overlapping_vars1.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/non_overlapping_vars1.exp index 754941c7088808..d43250bd173d11 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/non_overlapping_vars1.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/non_overlapping_vars1.exp @@ -19,6 +19,20 @@ fun m::test() { 8: return () } + +Diagnostics: +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/variable-coalescing/non_overlapping_vars1.move:4:9 + │ +4 │ x = x + 1; + │ ^^^^^^^^^ + +warning: Unused assignment to y. Consider removing or prefixing with an underscore: `_y` + ┌─ tests/variable-coalescing/non_overlapping_vars1.move:6:9 + │ +6 │ y = y + 1; + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/non_overlapping_vars1.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/non_overlapping_vars1.opt.exp index 754941c7088808..d43250bd173d11 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/non_overlapping_vars1.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/non_overlapping_vars1.opt.exp @@ -19,6 +19,20 @@ fun m::test() { 8: return () } + +Diagnostics: +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/variable-coalescing/non_overlapping_vars1.move:4:9 + │ +4 │ x = x + 1; + │ ^^^^^^^^^ + +warning: Unused assignment to y. Consider removing or prefixing with an underscore: `_y` + ┌─ tests/variable-coalescing/non_overlapping_vars1.move:6:9 + │ +6 │ y = y + 1; + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/non_overlapping_vars_diff_type.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/non_overlapping_vars_diff_type.exp index b7f839ff0a1948..9f824872b31b9a 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/non_overlapping_vars_diff_type.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/non_overlapping_vars_diff_type.exp @@ -19,6 +19,20 @@ fun m::test() { 8: return () } + +Diagnostics: +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/variable-coalescing/non_overlapping_vars_diff_type.move:4:9 + │ +4 │ x = x + 1; + │ ^^^^^^^^^ + +warning: Unused assignment to y. Consider removing or prefixing with an underscore: `_y` + ┌─ tests/variable-coalescing/non_overlapping_vars_diff_type.move:6:9 + │ +6 │ y = y + 1; + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/non_overlapping_vars_diff_type.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/non_overlapping_vars_diff_type.opt.exp index b7f839ff0a1948..9f824872b31b9a 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/non_overlapping_vars_diff_type.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/non_overlapping_vars_diff_type.opt.exp @@ -19,6 +19,20 @@ fun m::test() { 8: return () } + +Diagnostics: +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/variable-coalescing/non_overlapping_vars_diff_type.move:4:9 + │ +4 │ x = x + 1; + │ ^^^^^^^^^ + +warning: Unused assignment to y. Consider removing or prefixing with an underscore: `_y` + ┌─ tests/variable-coalescing/non_overlapping_vars_diff_type.move:6:9 + │ +6 │ y = y + 1; + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/reassigned_var.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/reassigned_var.exp index 5a165b49ca4cad..9d63663210e102 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/reassigned_var.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/reassigned_var.exp @@ -14,6 +14,14 @@ fun m::test(): u64 { 5: return $t0 } + +Diagnostics: +warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` + ┌─ tests/variable-coalescing/reassigned_var.move:3:17 + │ +3 │ let a = 1; + │ ^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/reassigned_var.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/reassigned_var.opt.exp index 23428eb311af1e..14b6c39de5a2b2 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/reassigned_var.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/reassigned_var.opt.exp @@ -14,6 +14,14 @@ fun m::test(): u64 { 5: return $t0 } + +Diagnostics: +warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` + ┌─ tests/variable-coalescing/reassigned_var.move:3:17 + │ +3 │ let a = 1; + │ ^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/self_assigns.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/self_assigns.exp index 22650ed85bc01e..caa8ce9392fd3b 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/self_assigns.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/self_assigns.exp @@ -75,6 +75,14 @@ public fun m::test4($t0: u64): u64 { 17: return $t1 } + +Diagnostics: +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/variable-coalescing/self_assigns.move:3:9 + │ +3 │ x = x; + │ ^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/self_assigns.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/self_assigns.opt.exp index 22650ed85bc01e..caa8ce9392fd3b 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/self_assigns.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/self_assigns.opt.exp @@ -75,6 +75,14 @@ public fun m::test4($t0: u64): u64 { 17: return $t1 } + +Diagnostics: +warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/variable-coalescing/self_assigns.move:3:9 + │ +3 │ x = x; + │ ^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_1.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_1.exp index dc7553994cc1a4..90272cacfb7791 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_1.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_1.exp @@ -18,6 +18,14 @@ fun m::test($t0: u64): bool { 7: return $t1 } + +Diagnostics: +warning: Unused assignment to b. Consider removing or prefixing with an underscore: `_b` + ┌─ tests/variable-coalescing/seq_kills_1.move:7:9 + │ +7 │ b = p + 1; // kill b := a, which removes the whole copy chain + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_1.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_1.opt.exp index dc7553994cc1a4..90272cacfb7791 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_1.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_1.opt.exp @@ -18,6 +18,14 @@ fun m::test($t0: u64): bool { 7: return $t1 } + +Diagnostics: +warning: Unused assignment to b. Consider removing or prefixing with an underscore: `_b` + ┌─ tests/variable-coalescing/seq_kills_1.move:7:9 + │ +7 │ b = p + 1; // kill b := a, which removes the whole copy chain + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_2.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_2.exp index 3cbb873f10bd00..074d2b0da68bca 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_2.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_2.exp @@ -18,6 +18,14 @@ fun m::test($t0: u64): bool { 7: return $t1 } + +Diagnostics: +warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` + ┌─ tests/variable-coalescing/seq_kills_2.move:7:9 + │ +7 │ a = p + 1; // kill b := a + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_2.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_2.opt.exp index 3cbb873f10bd00..074d2b0da68bca 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_2.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_2.opt.exp @@ -18,6 +18,14 @@ fun m::test($t0: u64): bool { 7: return $t1 } + +Diagnostics: +warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` + ┌─ tests/variable-coalescing/seq_kills_2.move:7:9 + │ +7 │ a = p + 1; // kill b := a + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/straight_line_kills.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/straight_line_kills.exp index 244a78cdaba552..1cba528fd9f38f 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/straight_line_kills.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/straight_line_kills.exp @@ -16,6 +16,14 @@ fun m::copy_kill($t0: u64): u64 { 6: return $t1 } + +Diagnostics: +warning: Unused assignment to p. Consider removing or prefixing with an underscore: `_p` + ┌─ tests/variable-coalescing/straight_line_kills.move:5:9 + │ +5 │ p = p + 1; + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline] diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/straight_line_kills.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/straight_line_kills.opt.exp index 244a78cdaba552..1cba528fd9f38f 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/straight_line_kills.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/straight_line_kills.opt.exp @@ -16,6 +16,14 @@ fun m::copy_kill($t0: u64): u64 { 6: return $t1 } + +Diagnostics: +warning: Unused assignment to p. Consider removing or prefixing with an underscore: `_p` + ┌─ tests/variable-coalescing/straight_line_kills.move:5:9 + │ +5 │ p = p + 1; + │ ^^^^^^^^^ + ============ after DeadStoreElimination: ================ [variant baseline]