From 35d8327265da410c4936d3e0c6327d5cd0549c8f Mon Sep 17 00:00:00 2001 From: Zekun Wang Date: Thu, 6 Jun 2024 14:05:32 -0400 Subject: [PATCH] update tests --- .../ability-transform/destroy_after_call.exp | 2 +- .../bytecode-generator/freeze_mut_ref.exp | 12 +- .../tests/bytecode-generator/wildcard7.exp | 2 +- .../tests/copy-propagation/call_1.exp | 2 +- .../tests/copy-propagation/immut_refs_2.exp | 2 +- .../tests/copy-propagation/seq_kills_1.exp | 2 +- .../tests/copy-propagation/seq_kills_2.exp | 2 +- .../copy-propagation/straight_line_kills.exp | 2 +- .../tests/file-format-generator/const.exp | 22 +- .../tests/file-format-generator/const.opt.exp | 22 +- .../tests/reference-safety/write_ref_dest.exp | 2 +- .../write_ref_dest.no-opt.exp | 2 +- .../bind_with_type_annot.exp | 6 +- .../use_before_assign.exp | 2 +- .../use_before_assign_while.exp | 2 +- .../tests/simplifier/random.exp | 2 +- .../conditional_loop_unreachable.exp | 4 +- .../unused-assignment/unused_assignment.exp | 341 +++++++++++++----- .../unused-assignment/unused_assignment.move | 52 ++- .../tests/variable-coalescing/call_1.exp | 2 +- .../tests/variable-coalescing/call_1.opt.exp | 2 +- .../variable-coalescing/cant_coalesce_1.exp | 2 +- .../cant_coalesce_1.opt.exp | 2 +- .../cant_copy_propagate.exp | 4 +- .../cant_copy_propagate.opt.exp | 4 +- .../cyclic_assignment_without_use.exp | 2 +- .../cyclic_assignment_without_use.opt.exp | 2 +- .../variable-coalescing/dead_assignment_3.exp | 2 +- .../dead_assignment_3.opt.exp | 2 +- .../variable-coalescing/dead_assignment_4.exp | 6 +- .../dead_assignment_4.opt.exp | 4 +- .../variable-coalescing/immut_refs_2.exp | 2 +- .../variable-coalescing/immut_refs_2.opt.exp | 2 +- .../variable-coalescing/intermingled_1.exp | 2 +- .../intermingled_1.opt.exp | 2 +- .../variable-coalescing/intermingled_3.exp | 2 +- .../intermingled_3.opt.exp | 2 +- .../variable-coalescing/multi_assigns.exp | 2 +- .../variable-coalescing/multi_assigns.opt.exp | 2 +- .../non_overlapping_vars1.exp | 4 +- .../non_overlapping_vars1.opt.exp | 4 +- .../non_overlapping_vars_diff_type.exp | 4 +- .../non_overlapping_vars_diff_type.opt.exp | 4 +- .../variable-coalescing/reassigned_var.exp | 2 +- .../reassigned_var.opt.exp | 2 +- .../variable-coalescing/self_assigns.exp | 2 +- .../variable-coalescing/self_assigns.opt.exp | 2 +- .../tests/variable-coalescing/seq_kills_1.exp | 2 +- .../variable-coalescing/seq_kills_1.opt.exp | 2 +- .../tests/variable-coalescing/seq_kills_2.exp | 2 +- .../variable-coalescing/seq_kills_2.opt.exp | 2 +- .../straight_line_kills.exp | 2 +- .../straight_line_kills.opt.exp | 2 +- .../tests/variable-coalescing/unused_add.exp | 2 +- 54 files changed, 372 insertions(+), 199 deletions(-) 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 20d836b2d2596a..1a8be7b364eb72 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 @@ -56,7 +56,7 @@ fun m::g() { Diagnostics: -warning: Unused assignment to r. Consider removing or prefixing with an underscore: `_r` +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); 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 cfb3f2f89629fa..faedb014876239 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 @@ -295,37 +295,37 @@ 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` +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` +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` +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` +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` +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` +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; 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 52ecc2e51d1041..6167d7138de5f6 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 @@ -43,7 +43,7 @@ public fun m::test(): u8 { Diagnostics: -warning: Unused assignment to q. Consider removing or prefixing with an underscore: `_q` +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); 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 94b096bdb1f9ce..4f541ca8bee892 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 @@ -35,7 +35,7 @@ fun m::test($t0: u64): u64 { Diagnostics: -warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` +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; diff --git a/third_party/move/move-compiler-v2/tests/copy-propagation/immut_refs_2.exp b/third_party/move/move-compiler-v2/tests/copy-propagation/immut_refs_2.exp index 1baa2e00b0273d..e8f24c1e067dfd 100644 --- a/third_party/move/move-compiler-v2/tests/copy-propagation/immut_refs_2.exp +++ b/third_party/move/move-compiler-v2/tests/copy-propagation/immut_refs_2.exp @@ -25,7 +25,7 @@ fun m::test($t0: u64): u64 { Diagnostics: -warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` +warning: Unused assignment to `a`. Consider removing or prefixing with an underscore: `_a` ┌─ tests/copy-propagation/immut_refs_2.move:4:17 │ 4 │ let a = &p; 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 0a8c2152af74dc..5cafa1aff09733 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 @@ -20,7 +20,7 @@ fun m::test($t0: u64): bool { Diagnostics: -warning: Unused assignment to b. Consider removing or prefixing with an underscore: `_b` +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 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 e7fe96349524a2..c4103b25565105 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 @@ -20,7 +20,7 @@ fun m::test($t0: u64): bool { Diagnostics: -warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` +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 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 06c4d6fa894541..5b0207d4fbdacc 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 @@ -18,7 +18,7 @@ fun m::copy_kill($t0: u64): u64 { Diagnostics: -warning: Unused assignment to p. Consider removing or prefixing with an underscore: `_p` +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; diff --git a/third_party/move/move-compiler-v2/tests/file-format-generator/const.exp b/third_party/move/move-compiler-v2/tests/file-format-generator/const.exp index 6f504e41414c61..e3c70827b11a7b 100644 --- a/third_party/move/move-compiler-v2/tests/file-format-generator/const.exp +++ b/third_party/move/move-compiler-v2/tests/file-format-generator/const.exp @@ -68,67 +68,67 @@ warning: Unused local variable `s`. Consider removing or prefixing with an under Diagnostics: -warning: Unused assignment to const_true. Consider removing or prefixing with an underscore: `_const_true` +warning: Unused assignment to `const_true`. Consider removing or prefixing with an underscore: `_const_true` ┌─ tests/file-format-generator/const.move:3:26 │ 3 │ let const_true = u(true); │ ^^^^^^^ -warning: Unused assignment to const_false. Consider removing or prefixing with an underscore: `_const_false` +warning: Unused assignment to `const_false`. Consider removing or prefixing with an underscore: `_const_false` ┌─ tests/file-format-generator/const.move:4:27 │ 4 │ let const_false = u(false); │ ^^^^^^^^ -warning: Unused assignment to hex_u8. Consider removing or prefixing with an underscore: `_hex_u8` +warning: Unused assignment to `hex_u8`. Consider removing or prefixing with an underscore: `_hex_u8` ┌─ tests/file-format-generator/const.move:5:26 │ 5 │ let hex_u8: u8 = u(0x1); │ ^^^^^^ -warning: Unused assignment to hex_u16. Consider removing or prefixing with an underscore: `_hex_u16` +warning: Unused assignment to `hex_u16`. Consider removing or prefixing with an underscore: `_hex_u16` ┌─ tests/file-format-generator/const.move:6:28 │ 6 │ let hex_u16: u16 = u(0x1BAE); │ ^^^^^^^^^ -warning: Unused assignment to hex_u32. Consider removing or prefixing with an underscore: `_hex_u32` +warning: Unused assignment to `hex_u32`. Consider removing or prefixing with an underscore: `_hex_u32` ┌─ tests/file-format-generator/const.move:7:28 │ 7 │ let hex_u32: u32 = u(0xDEAD80); │ ^^^^^^^^^^^ -warning: Unused assignment to hex_u64. Consider removing or prefixing with an underscore: `_hex_u64` +warning: Unused assignment to `hex_u64`. Consider removing or prefixing with an underscore: `_hex_u64` ┌─ tests/file-format-generator/const.move:8:28 │ 8 │ let hex_u64: u64 = u(0xCAFE); │ ^^^^^^^^^ -warning: Unused assignment to hex_u128. Consider removing or prefixing with an underscore: `_hex_u128` +warning: Unused assignment to `hex_u128`. Consider removing or prefixing with an underscore: `_hex_u128` ┌─ tests/file-format-generator/const.move:9:30 │ 9 │ let hex_u128: u128 = u(0xDEADBEEF); │ ^^^^^^^^^^^^^ -warning: Unused assignment to hex_u256. Consider removing or prefixing with an underscore: `_hex_u256` +warning: Unused assignment to `hex_u256`. Consider removing or prefixing with an underscore: `_hex_u256` ┌─ tests/file-format-generator/const.move:10:30 │ 10 │ let hex_u256: u256 = u(0x1123_456A_BCDE_F); │ ^^^^^^^^^^^^^^^^^^^^^ -warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` +warning: Unused assignment to `a`. Consider removing or prefixing with an underscore: `_a` ┌─ tests/file-format-generator/const.move:11:17 │ 11 │ let a = u(@0x42); │ ^^^^^^^^ -warning: Unused assignment to vec. Consider removing or prefixing with an underscore: `_vec` +warning: Unused assignment to `vec`. Consider removing or prefixing with an underscore: `_vec` ┌─ tests/file-format-generator/const.move:12:19 │ 12 │ let vec = u(vector[1, 2, 3]); │ ^^^^^^^^^^^^^^^^^^ -warning: Unused assignment to s. Consider removing or prefixing with an underscore: `_s` +warning: Unused assignment to `s`. Consider removing or prefixing with an underscore: `_s` ┌─ tests/file-format-generator/const.move:13:17 │ 13 │ let s = u(b"Hello!\n"); diff --git a/third_party/move/move-compiler-v2/tests/file-format-generator/const.opt.exp b/third_party/move/move-compiler-v2/tests/file-format-generator/const.opt.exp index f02d2fb289e26a..8c6bd9d68e95d9 100644 --- a/third_party/move/move-compiler-v2/tests/file-format-generator/const.opt.exp +++ b/third_party/move/move-compiler-v2/tests/file-format-generator/const.opt.exp @@ -68,67 +68,67 @@ warning: Unused local variable `s`. Consider removing or prefixing with an under Diagnostics: -warning: Unused assignment to const_true. Consider removing or prefixing with an underscore: `_const_true` +warning: Unused assignment to `const_true`. Consider removing or prefixing with an underscore: `_const_true` ┌─ tests/file-format-generator/const.move:3:26 │ 3 │ let const_true = u(true); │ ^^^^^^^ -warning: Unused assignment to const_false. Consider removing or prefixing with an underscore: `_const_false` +warning: Unused assignment to `const_false`. Consider removing or prefixing with an underscore: `_const_false` ┌─ tests/file-format-generator/const.move:4:27 │ 4 │ let const_false = u(false); │ ^^^^^^^^ -warning: Unused assignment to hex_u8. Consider removing or prefixing with an underscore: `_hex_u8` +warning: Unused assignment to `hex_u8`. Consider removing or prefixing with an underscore: `_hex_u8` ┌─ tests/file-format-generator/const.move:5:26 │ 5 │ let hex_u8: u8 = u(0x1); │ ^^^^^^ -warning: Unused assignment to hex_u16. Consider removing or prefixing with an underscore: `_hex_u16` +warning: Unused assignment to `hex_u16`. Consider removing or prefixing with an underscore: `_hex_u16` ┌─ tests/file-format-generator/const.move:6:28 │ 6 │ let hex_u16: u16 = u(0x1BAE); │ ^^^^^^^^^ -warning: Unused assignment to hex_u32. Consider removing or prefixing with an underscore: `_hex_u32` +warning: Unused assignment to `hex_u32`. Consider removing or prefixing with an underscore: `_hex_u32` ┌─ tests/file-format-generator/const.move:7:28 │ 7 │ let hex_u32: u32 = u(0xDEAD80); │ ^^^^^^^^^^^ -warning: Unused assignment to hex_u64. Consider removing or prefixing with an underscore: `_hex_u64` +warning: Unused assignment to `hex_u64`. Consider removing or prefixing with an underscore: `_hex_u64` ┌─ tests/file-format-generator/const.move:8:28 │ 8 │ let hex_u64: u64 = u(0xCAFE); │ ^^^^^^^^^ -warning: Unused assignment to hex_u128. Consider removing or prefixing with an underscore: `_hex_u128` +warning: Unused assignment to `hex_u128`. Consider removing or prefixing with an underscore: `_hex_u128` ┌─ tests/file-format-generator/const.move:9:30 │ 9 │ let hex_u128: u128 = u(0xDEADBEEF); │ ^^^^^^^^^^^^^ -warning: Unused assignment to hex_u256. Consider removing or prefixing with an underscore: `_hex_u256` +warning: Unused assignment to `hex_u256`. Consider removing or prefixing with an underscore: `_hex_u256` ┌─ tests/file-format-generator/const.move:10:30 │ 10 │ let hex_u256: u256 = u(0x1123_456A_BCDE_F); │ ^^^^^^^^^^^^^^^^^^^^^ -warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` +warning: Unused assignment to `a`. Consider removing or prefixing with an underscore: `_a` ┌─ tests/file-format-generator/const.move:11:17 │ 11 │ let a = u(@0x42); │ ^^^^^^^^ -warning: Unused assignment to vec. Consider removing or prefixing with an underscore: `_vec` +warning: Unused assignment to `vec`. Consider removing or prefixing with an underscore: `_vec` ┌─ tests/file-format-generator/const.move:12:19 │ 12 │ let vec = u(vector[1, 2, 3]); │ ^^^^^^^^^^^^^^^^^^ -warning: Unused assignment to s. Consider removing or prefixing with an underscore: `_s` +warning: Unused assignment to `s`. Consider removing or prefixing with an underscore: `_s` ┌─ tests/file-format-generator/const.move:13:17 │ 13 │ let s = u(b"Hello!\n"); 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 fe1cfaa36d8e69..ea5c005f76f31a 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,6 +1,6 @@ Diagnostics: -warning: Unused assignment to y. Consider removing or prefixing with an underscore: `_y` +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); 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 fe1cfaa36d8e69..ea5c005f76f31a 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,6 +1,6 @@ Diagnostics: -warning: Unused assignment to y. Consider removing or prefixing with an underscore: `_y` +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); 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 51b09aa35ed732..03e91f0ab999d4 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 @@ -39,19 +39,19 @@ module 0x8675309::M { Diagnostics: -warning: Unused assignment to f. Consider removing or prefixing with an underscore: `_f` +warning: Unused assignment to `f`. Consider removing or prefixing with an underscore: `_f` ┌─ tests/simplifier-elimination/bind_with_type_annot.move:7:20 │ 7 │ let (x, b, R{f}): (u64, bool, R) = (0, false, R { f: 0 }); x; b; f; │ ^^^^ -warning: Unused assignment to b. Consider removing or prefixing with an underscore: `_b` +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` +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; 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 b9a8559d1141cd..f10a3cdb4ab968 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 @@ -29,7 +29,7 @@ error: use of unassigned local `x` Diagnostics: -warning: Unused assignment to y. Consider removing or prefixing with an underscore: `_y` +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 257f8e5a68f598..3f769d77944f3b 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 @@ -106,7 +106,7 @@ error: use of unassigned local `x` Diagnostics: -warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` +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 } 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 3fb15975714b42..0e9d3d0e91e5bc 100644 --- a/third_party/move/move-compiler-v2/tests/simplifier/random.exp +++ b/third_party/move/move-compiler-v2/tests/simplifier/random.exp @@ -145,7 +145,7 @@ module 0x8675::M { Diagnostics: -warning: Unused assignment to q. Consider removing or prefixing with an underscore: `_q` +warning: Unused assignment to `q`. Consider removing or prefixing with an underscore: `_q` ┌─ tests/simplifier/random.move:48:17 │ 48 │ let q = v; 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 90f944ba87f6fd..6dc6b6253bb775 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 @@ -39,13 +39,13 @@ fun m::test($t0: bool, $t1: bool) { Diagnostics: -warning: Unused assignment to i. Consider removing or prefixing with an underscore: `_i` +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` +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; diff --git a/third_party/move/move-compiler-v2/tests/unused-assignment/unused_assignment.exp b/third_party/move/move-compiler-v2/tests/unused-assignment/unused_assignment.exp index a2ca498db63be7..3b0a98fff75216 100644 --- a/third_party/move/move-compiler-v2/tests/unused-assignment/unused_assignment.exp +++ b/third_party/move/move-compiler-v2/tests/unused-assignment/unused_assignment.exp @@ -1,152 +1,299 @@ Diagnostics: -warning: Unused parameter `a`. Consider removing or prefixing with an underscore: `_a` - ┌─ tests/unused-assignment/unused_assignment.move:2:13 +warning: Unused local variable `x`. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/unused-assignment/unused_assignment.move:3:13 │ -2 │ fun foo(a: u8, _b: u8) { +3 │ let x = 0; │ ^ -warning: Unused local variable `y`. Consider removing or prefixing with an underscore: `_y` - ┌─ tests/unused-assignment/unused_assignment.move:5:13 - │ -5 │ let y = 0; - │ ^ - -warning: Unused local variable `w`. Consider removing or prefixing with an underscore: `_w` - ┌─ tests/unused-assignment/unused_assignment.move:7:13 - │ -7 │ let w = bar(false); - │ ^ +warning: Unused local variable `x`. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/unused-assignment/unused_assignment.move:13:17 + │ +13 │ let x = 0; + │ ^ ============ initial bytecode ================ [variant baseline] -fun test::bar($t0: bool): u8 { - var $t1: u8 +fun M::t0() { + 0: return () +} + + +[variant baseline] +fun M::t1() { + var $t0: u64 + var $t1: u64 + 0: $t0 := 0 + 1: $t1 := 0 + 2: $t0 := infer($t1) + 3: return () +} + + +[variant baseline] +fun M::t2($t0: bool) { + 0: if ($t0) goto 1 else goto 3 + 1: label L0 + 2: goto 4 + 3: label L1 + 4: label L2 + 5: return () +} + + +[variant baseline] +fun M::t3($t0: bool) { + var $t1: u64 var $t2: u64 var $t3: u64 - var $t4: u64 - var $t5: u64 - var $t6: u64 - 0: $t2 := 0 - 1: if ($t0) goto 2 else goto 7 - 2: label L0 - 3: $t4 := 1 - 4: $t3 := +($t2, $t4) - 5: $t2 := infer($t3) - 6: goto 11 + 0: $t1 := 0 + 1: $t2 := infer($t1) + 2: if ($t0) goto 3 else goto 7 + 3: label L0 + 4: $t3 := 0 + 5: $t1 := infer($t3) + 6: goto 8 7: label L1 - 8: $t6 := 2 - 9: $t5 := +($t2, $t6) - 10: $t2 := infer($t5) - 11: label L2 - 12: $t1 := 42 - 13: return $t1 + 8: label L2 + 9: return () +} + + +[variant baseline] +fun M::t4($t0: bool) { + var $t1: u64 + var $t2: u64 + var $t3: u64 + 0: $t1 := 0 + 1: if ($t0) goto 2 else goto 6 + 2: label L0 + 3: $t2 := 1 + 4: $t1 := infer($t2) + 5: goto 9 + 6: label L1 + 7: $t3 := 2 + 8: $t1 := infer($t3) + 9: label L2 + 10: return () } [variant baseline] -fun test::foo($t0: u8, $t1: u8) { +fun M::t5($t0: bool) { + var $t1: u64 var $t2: u64 var $t3: u64 var $t4: u64 - var $t5: u8 - var $t6: bool - 0: $t2 := 0 - 1: $t4 := 1 - 2: $t3 := +($t2, $t4) - 3: $t2 := infer($t3) - 4: $t6 := false - 5: $t5 := test::bar($t6) - 6: return () + 0: label L0 + 1: if ($t0) goto 2 else goto 14 + 2: label L2 + 3: $t2 := 0 + 4: $t1 := infer($t2) + 5: if ($t0) goto 6 else goto 9 + 6: label L5 + 7: $t3 := infer($t1) + 8: goto 10 + 9: label L6 + 10: label L7 + 11: $t4 := 1 + 12: $t1 := infer($t4) + 13: goto 16 + 14: label L3 + 15: goto 18 + 16: label L4 + 17: goto 0 + 18: label L1 + 19: return () } ============ after LiveVarAnalysisProcessor: ================ [variant baseline] -fun test::bar($t0: bool): u8 { - var $t1: u8 +fun M::t0() { + # live vars: + 0: return () +} + + +[variant baseline] +fun M::t1() { + var $t0: u64 + var $t1: u64 + # live vars: + 0: $t0 := 0 + # live vars: + 1: $t1 := 0 + # live vars: $t1 + 2: $t0 := infer($t1) + # live vars: + 3: return () +} + + +[variant baseline] +fun M::t2($t0: bool) { + # live vars: $t0 + 0: if ($t0) goto 1 else goto 3 + # live vars: + 1: label L0 + # live vars: + 2: goto 4 + # live vars: + 3: label L1 + # live vars: + 4: label L2 + # live vars: + 5: return () +} + + +[variant baseline] +fun M::t3($t0: bool) { + var $t1: u64 var $t2: u64 var $t3: u64 - var $t4: u64 - var $t5: u64 - var $t6: u64 # live vars: $t0 - 0: $t2 := 0 - # live vars: $t0, $t2 - 1: if ($t0) goto 2 else goto 7 - # live vars: $t2 - 2: label L0 - # live vars: $t2 - 3: $t4 := 1 - # live vars: $t2, $t4 - 4: $t3 := +($t2, $t4) + 0: $t1 := 0 + # live vars: $t0, $t1 + 1: $t2 := infer($t1) + # live vars: $t0 + 2: if ($t0) goto 3 else goto 7 + # live vars: + 3: label L0 + # live vars: + 4: $t3 := 0 # live vars: $t3 - 5: $t2 := infer($t3) + 5: $t1 := infer($t3) + # live vars: + 6: goto 8 # live vars: - 6: goto 11 - # live vars: $t2 7: label L1 + # live vars: + 8: label L2 + # live vars: + 9: return () +} + + +[variant baseline] +fun M::t4($t0: bool) { + var $t1: u64 + var $t2: u64 + var $t3: u64 + # live vars: $t0 + 0: $t1 := 0 + # live vars: $t0 + 1: if ($t0) goto 2 else goto 6 + # live vars: + 2: label L0 + # live vars: + 3: $t2 := 1 # live vars: $t2 - 8: $t6 := 2 - # live vars: $t2, $t6 - 9: $t5 := +($t2, $t6) - # live vars: $t5 - 10: $t2 := infer($t5) + 4: $t1 := infer($t2) # live vars: - 11: label L2 + 5: goto 9 # live vars: - 12: $t1 := 42 - # live vars: $t1 - 13: return $t1 + 6: label L1 + # live vars: + 7: $t3 := 2 + # live vars: $t3 + 8: $t1 := infer($t3) + # live vars: + 9: label L2 + # live vars: + 10: return () } [variant baseline] -fun test::foo($t0: u8, $t1: u8) { +fun M::t5($t0: bool) { + var $t1: u64 var $t2: u64 var $t3: u64 var $t4: u64 - var $t5: u8 - var $t6: bool + # live vars: $t0 + 0: label L0 + # live vars: $t0 + 1: if ($t0) goto 2 else goto 14 + # live vars: $t0 + 2: label L2 + # live vars: $t0 + 3: $t2 := 0 + # live vars: $t0, $t2 + 4: $t1 := infer($t2) # live vars: $t0, $t1 - 0: $t2 := 0 - # live vars: $t2 - 1: $t4 := 1 - # live vars: $t2, $t4 - 2: $t3 := +($t2, $t4) - # live vars: $t3 - 3: $t2 := infer($t3) + 5: if ($t0) goto 6 else goto 9 + # live vars: $t0, $t1 + 6: label L5 + # live vars: $t0, $t1 + 7: $t3 := infer($t1) + # live vars: $t0 + 8: goto 10 + # live vars: $t0, $t1 + 9: label L6 + # live vars: $t0 + 10: label L7 + # live vars: $t0 + 11: $t4 := 1 + # live vars: $t0, $t4 + 12: $t1 := infer($t4) + # live vars: $t0 + 13: goto 16 + # live vars: $t0 + 14: label L3 # live vars: - 4: $t6 := false - # live vars: $t6 - 5: $t5 := test::bar($t6) + 15: goto 18 + # live vars: $t0 + 16: label L4 + # live vars: $t0 + 17: goto 0 + # live vars: + 18: label L1 # live vars: - 6: return () + 19: return () } Diagnostics: warning: Unused assignment to `x`. Consider removing or prefixing with an underscore: `_x` - ┌─ tests/unused-assignment/unused_assignment.move:4:9 + ┌─ tests/unused-assignment/unused_assignment.move:7:17 │ -4 │ x = x + 1; - │ ^^^^^^^^^ +7 │ let x = 0; + │ ^ -warning: Unused assignment to `w`. Consider removing or prefixing with an underscore: `_w` - ┌─ tests/unused-assignment/unused_assignment.move:7:17 +warning: Unused assignment to `x`. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/unused-assignment/unused_assignment.move:8:9 │ -7 │ let w = bar(false); - │ ^^^^^^^^^^ +8 │ x = 0; + │ ^^^^^ -warning: Unused assignment to `y`. Consider removing or prefixing with an underscore: `_y` - ┌─ tests/unused-assignment/unused_assignment.move:13:13 +warning: Unused assignment to `x`. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/unused-assignment/unused_assignment.move:21:13 │ -13 │ y = y + 1; - │ ^^^^^^^^^ +21 │ x = 0; + │ ^^^^^ -warning: Unused assignment to `y`. Consider removing or prefixing with an underscore: `_y` - ┌─ tests/unused-assignment/unused_assignment.move:15:13 +warning: Unused assignment to `x`. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/unused-assignment/unused_assignment.move:26:17 + │ +26 │ let x = 0; + │ ^ + +warning: Unused assignment to `x`. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/unused-assignment/unused_assignment.move:28:13 + │ +28 │ x = 1; + │ ^^^^^ + +warning: Unused assignment to `x`. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/unused-assignment/unused_assignment.move:30:13 + │ +30 │ x = 2; + │ ^^^^^ + +warning: Unused assignment to `x`. Consider removing or prefixing with an underscore: `_x` + ┌─ tests/unused-assignment/unused_assignment.move:41:13 │ -15 │ y = y + 2; - │ ^^^^^^^^^ +41 │ x = 1; + │ ^^^^^ diff --git a/third_party/move/move-compiler-v2/tests/unused-assignment/unused_assignment.move b/third_party/move/move-compiler-v2/tests/unused-assignment/unused_assignment.move index a44b7c0a9914e4..6b0516e51f7f75 100644 --- a/third_party/move/move-compiler-v2/tests/unused-assignment/unused_assignment.move +++ b/third_party/move/move-compiler-v2/tests/unused-assignment/unused_assignment.move @@ -1,19 +1,45 @@ -module 0x42::test { - fun foo(a: u8, _b: u8) { +module 0x8675309::M { + fun t0() { let x = 0; - x = x + 1; - let y = 0; - let _z = 42; - let w = bar(false); } - fun bar(x: bool): u8 { - let y = 0; - if (x) { - y = y + 1; + fun t1() { + let x = 0; + x = 0; + } + + fun t2(cond: bool) { + if (cond) { + let x = 0; + } + } + + fun t3(cond: bool) { + let x = 0; + x; + if (cond) { + x = 0; + } + } + + fun t4(cond: bool) { + let x = 0; + if (cond) { + x = 1; } else { - y = y + 2; - }; - 42 + x = 2; + } } + + fun t5(cond: bool) { + let x; + while (cond) { + x = 0; + if (cond) { + x; + }; + x = 1; + } + } + } 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 8c6a6af8b1aaa5..3f4ff64c3e1c91 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 @@ -35,7 +35,7 @@ fun m::test($t0: u64): u64 { Diagnostics: -warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` +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; 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 8c6a6af8b1aaa5..3f4ff64c3e1c91 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 @@ -35,7 +35,7 @@ fun m::test($t0: u64): u64 { Diagnostics: -warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` +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; diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/cant_coalesce_1.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/cant_coalesce_1.exp index a5e99bbd3e7834..c3193e31baca1e 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/cant_coalesce_1.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/cant_coalesce_1.exp @@ -21,7 +21,7 @@ public fun m::test($t0: u64): u64 { Diagnostics: -warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` +warning: Unused assignment to `x`. Consider removing or prefixing with an underscore: `_x` ┌─ tests/variable-coalescing/cant_coalesce_1.move:3:17 │ 3 │ let x = a + a; diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/cant_coalesce_1.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/cant_coalesce_1.opt.exp index 3a6c9015850875..fbea2c056a83b2 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/cant_coalesce_1.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/cant_coalesce_1.opt.exp @@ -19,7 +19,7 @@ public fun m::test($t0: u64): u64 { Diagnostics: -warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` +warning: Unused assignment to `x`. Consider removing or prefixing with an underscore: `_x` ┌─ tests/variable-coalescing/cant_coalesce_1.move:3:17 │ 3 │ let x = a + a; 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 4b0d42e60dde33..bbe349810a53c6 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 @@ -33,13 +33,13 @@ fun m::test($t0: u64, $t1: bool) { Diagnostics: -warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` +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` +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; 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 4b0d42e60dde33..bbe349810a53c6 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 @@ -33,13 +33,13 @@ fun m::test($t0: u64, $t1: bool) { Diagnostics: -warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` +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` +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; 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 61cab7e1a35942..e6a15a35a4e75f 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 @@ -14,7 +14,7 @@ public fun m::test($t0: u64) { Diagnostics: -warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` +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; 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 61cab7e1a35942..e6a15a35a4e75f 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 @@ -14,7 +14,7 @@ public fun m::test($t0: u64) { Diagnostics: -warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` +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; 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 a7a488752275b5..d59457e546efe2 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 @@ -22,7 +22,7 @@ public fun m::test($t0: bool): u32 { Diagnostics: -warning: Unused assignment to y. Consider removing or prefixing with an underscore: `_y` +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; 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 78fe916a30c793..6aca9b7b844993 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 @@ -20,7 +20,7 @@ public fun m::test($t0: bool): u32 { Diagnostics: -warning: Unused assignment to y. Consider removing or prefixing with an underscore: `_y` +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; 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 412603b8179550..970a6b84ab0940 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 @@ -69,19 +69,19 @@ public fun m::test4($t0: u64): u64 { Diagnostics: -warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` +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` +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` +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; 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 0222b7b9f8e9db..c4b4326890f8a8 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 @@ -63,13 +63,13 @@ public fun m::test4($t0: u64): u64 { Diagnostics: -warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` +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` +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; diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/immut_refs_2.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/immut_refs_2.exp index c989052234e1a5..c54a49ba6d3c96 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/immut_refs_2.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/immut_refs_2.exp @@ -25,7 +25,7 @@ fun m::test($t0: u64): u64 { Diagnostics: -warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` +warning: Unused assignment to `a`. Consider removing or prefixing with an underscore: `_a` ┌─ tests/variable-coalescing/immut_refs_2.move:4:17 │ 4 │ let a = &p; diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/immut_refs_2.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/immut_refs_2.opt.exp index c989052234e1a5..c54a49ba6d3c96 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/immut_refs_2.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/immut_refs_2.opt.exp @@ -25,7 +25,7 @@ fun m::test($t0: u64): u64 { Diagnostics: -warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` +warning: Unused assignment to `a`. Consider removing or prefixing with an underscore: `_a` ┌─ tests/variable-coalescing/immut_refs_2.move:4:17 │ 4 │ let a = &p; 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 c6306637c13e6f..feff68c3be1804 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 @@ -18,7 +18,7 @@ fun m::test(): u64 { Diagnostics: -warning: Unused assignment to t. Consider removing or prefixing with an underscore: `_t` +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; 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 0da5fe2264ad2b..1669a1b36c2a98 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 @@ -16,7 +16,7 @@ fun m::test(): u64 { Diagnostics: -warning: Unused assignment to t. Consider removing or prefixing with an underscore: `_t` +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; 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 777aaaf3b6c421..a8a2312b817afe 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 @@ -20,7 +20,7 @@ fun m::test(): u64 { Diagnostics: -warning: Unused assignment to t. Consider removing or prefixing with an underscore: `_t` +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; 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 422b8bb6b5b2ea..4a5daedbda24ad 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 @@ -16,7 +16,7 @@ fun m::test(): u64 { Diagnostics: -warning: Unused assignment to t. Consider removing or prefixing with an underscore: `_t` +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; 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 c1cc7a4b6ac492..23af347b746130 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 @@ -14,7 +14,7 @@ fun m::test(): u64 { Diagnostics: -warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` +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; 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 c1cc7a4b6ac492..23af347b746130 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 @@ -14,7 +14,7 @@ fun m::test(): u64 { Diagnostics: -warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` +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; 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 d43250bd173d11..e15966fe205633 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 @@ -21,13 +21,13 @@ fun m::test() { Diagnostics: -warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` +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` +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; 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 d43250bd173d11..e15966fe205633 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 @@ -21,13 +21,13 @@ fun m::test() { Diagnostics: -warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` +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` +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; 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 9f824872b31b9a..ad657705a8322d 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 @@ -21,13 +21,13 @@ fun m::test() { Diagnostics: -warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` +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` +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; 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 9f824872b31b9a..ad657705a8322d 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 @@ -21,13 +21,13 @@ fun m::test() { Diagnostics: -warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` +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` +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; 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 9d63663210e102..a7a192cb486796 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 @@ -16,7 +16,7 @@ fun m::test(): u64 { Diagnostics: -warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` +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; 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 14b6c39de5a2b2..0bff15a1e37e64 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 @@ -16,7 +16,7 @@ fun m::test(): u64 { Diagnostics: -warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` +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; 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 caa8ce9392fd3b..f58fb946a815cf 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 @@ -77,7 +77,7 @@ public fun m::test4($t0: u64): u64 { Diagnostics: -warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` +warning: Unused assignment to `x`. Consider removing or prefixing with an underscore: `_x` ┌─ tests/variable-coalescing/self_assigns.move:3:9 │ 3 │ x = x; 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 caa8ce9392fd3b..f58fb946a815cf 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 @@ -77,7 +77,7 @@ public fun m::test4($t0: u64): u64 { Diagnostics: -warning: Unused assignment to x. Consider removing or prefixing with an underscore: `_x` +warning: Unused assignment to `x`. Consider removing or prefixing with an underscore: `_x` ┌─ tests/variable-coalescing/self_assigns.move:3:9 │ 3 │ x = x; 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 90272cacfb7791..82b01b37c032f4 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 @@ -20,7 +20,7 @@ fun m::test($t0: u64): bool { Diagnostics: -warning: Unused assignment to b. Consider removing or prefixing with an underscore: `_b` +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 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 90272cacfb7791..82b01b37c032f4 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 @@ -20,7 +20,7 @@ fun m::test($t0: u64): bool { Diagnostics: -warning: Unused assignment to b. Consider removing or prefixing with an underscore: `_b` +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 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 074d2b0da68bca..19a70afe528ad5 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 @@ -20,7 +20,7 @@ fun m::test($t0: u64): bool { Diagnostics: -warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` +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 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 074d2b0da68bca..19a70afe528ad5 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 @@ -20,7 +20,7 @@ fun m::test($t0: u64): bool { Diagnostics: -warning: Unused assignment to a. Consider removing or prefixing with an underscore: `_a` +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 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 1cba528fd9f38f..84ea8b1abbcb62 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 @@ -18,7 +18,7 @@ fun m::copy_kill($t0: u64): u64 { Diagnostics: -warning: Unused assignment to p. Consider removing or prefixing with an underscore: `_p` +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; 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 1cba528fd9f38f..84ea8b1abbcb62 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 @@ -18,7 +18,7 @@ fun m::copy_kill($t0: u64): u64 { Diagnostics: -warning: Unused assignment to p. Consider removing or prefixing with an underscore: `_p` +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; diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/unused_add.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/unused_add.exp index 8398f39040542f..850ba7d9bb591a 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/unused_add.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/unused_add.exp @@ -21,7 +21,7 @@ public fun m::test() { Diagnostics: -warning: Unused assignment to z. Consider removing or prefixing with an underscore: `_z` +warning: Unused assignment to `z`. Consider removing or prefixing with an underscore: `_z` ┌─ tests/variable-coalescing/unused_add.move:5:17 │ 5 │ let z = x + y;