diff --git a/third_party/move/move-compiler-v2/tests/checking-lang-v1/anonymous_field_fail.exp b/third_party/move/move-compiler-v2/tests/checking-lang-v1/anonymous_field_fail.exp new file mode 100644 index 00000000000000..c35ca46a4d926c --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/checking-lang-v1/anonymous_field_fail.exp @@ -0,0 +1,34 @@ + +Diagnostics: +error: unsupported language construct + ┌─ tests/checking-lang-v1/anonymous_field_fail.move:2:13 + │ +2 │ struct S(u8); + │ ^ Move 2 language construct is not enabled: positional fields + +error: unsupported language construct + ┌─ tests/checking-lang-v1/anonymous_field_fail.move:4:5 + │ +4 │ enum E { + │ ^^^^ Move 2 language construct is not enabled: enum types + +error: unsupported language construct + ┌─ tests/checking-lang-v1/anonymous_field_fail.move:5:10 + │ +5 │ V(S) + │ ^ Move 2 language construct is not enabled: positional fields + +error: unsupported language construct + ┌─ tests/checking-lang-v1/anonymous_field_fail.move:9:11 + │ +9 │ x.1; + │ ^ Move 2 language construct is not enabled: positional field + +error: unexpected token + ┌─ tests/checking-lang-v1/anonymous_field_fail.move:10:14 + │ +10 │ let S(_x) = x; + │ ^ + │ │ + │ Unexpected '(' + │ Expected '{' diff --git a/third_party/move/move-compiler-v2/tests/checking-lang-v1/anonymous_field_fail.move b/third_party/move/move-compiler-v2/tests/checking-lang-v1/anonymous_field_fail.move new file mode 100644 index 00000000000000..bdaf4ed087c2cd --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/checking-lang-v1/anonymous_field_fail.move @@ -0,0 +1,15 @@ +module 0x42::test { + struct S(u8); + + enum E { + V(S) + } + + fun foo(x: S, y: E) { + x.1; + let S(_x) = x; + match (y) { + E::V(_y) => {} + } + } +} diff --git a/third_party/move/move-compiler-v2/tests/checking-lang-v1/dotdot_not_supported.exp b/third_party/move/move-compiler-v2/tests/checking-lang-v1/dotdot_not_supported.exp new file mode 100644 index 00000000000000..3441edb3639e9e --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/checking-lang-v1/dotdot_not_supported.exp @@ -0,0 +1,7 @@ + +Diagnostics: +error: unsupported language construct + ┌─ tests/checking-lang-v1/dotdot_not_supported.move:8:11 + │ +8 │ let S { .. } = x; + │ ^^ Move 2 language construct is not enabled: `..` patterns diff --git a/third_party/move/move-compiler-v2/tests/checking-lang-v1/dotdot_not_supported.move b/third_party/move/move-compiler-v2/tests/checking-lang-v1/dotdot_not_supported.move new file mode 100644 index 00000000000000..e28747e65d6e6e --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/checking-lang-v1/dotdot_not_supported.move @@ -0,0 +1,10 @@ +module 0x42::test { + struct S { + x: bool, + y: u8 + } + + fun test_0(x: S) { + let S { .. } = x; + } +} diff --git a/third_party/move/move-compiler-v2/tests/checking-lang-v1/public_packge_visibility.exp b/third_party/move/move-compiler-v2/tests/checking-lang-v1/public_packge_visibility.exp new file mode 100644 index 00000000000000..82360a7634b562 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/checking-lang-v1/public_packge_visibility.exp @@ -0,0 +1,13 @@ + +Diagnostics: +error: unsupported language construct + ┌─ tests/checking-lang-v1/public_packge_visibility.move:2:5 + │ +2 │ public(package) fun foo() {} + │ ^^^^^^^^^^^^^^^ Move 2 language construct is not enabled: public(package) visibility + +error: unsupported language construct + ┌─ tests/checking-lang-v1/public_packge_visibility.move:6:5 + │ +6 │ public(package) fun main() {} + │ ^^^^^^^^^^^^^^^ Move 2 language construct is not enabled: public(package) visibility diff --git a/third_party/move/move-compiler-v2/tests/checking-lang-v1/public_packge_visibility.move b/third_party/move/move-compiler-v2/tests/checking-lang-v1/public_packge_visibility.move new file mode 100644 index 00000000000000..234bf5c71c6c99 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/checking-lang-v1/public_packge_visibility.move @@ -0,0 +1,7 @@ +module 0x42::M { + public(package) fun foo() {} +} + +script { + public(package) fun main() {} +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/address_directives.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/address_directives.exp new file mode 100644 index 00000000000000..90b32906711cc7 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/address_directives.exp @@ -0,0 +1,2 @@ + +============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/address_directives.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/address_directives.move new file mode 100644 index 00000000000000..f853c119c01fc3 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/address_directives.move @@ -0,0 +1,54 @@ +module 0x1::M { + +} + +address 0x2 { + +module M { + struct X {} + + public fun x(): X { + X { } + } + +} + +} + +address 0x3{} +address 0x4{} +address 0x2{} +address 0x4{ + +module M { + use 0x2::M; + + struct X {} + + public fun x(): X { + X {} + } + + public fun both(): (X, M::X) { + (X { }, M::x()) + } + +} + +} + +address 0x2 { + +module M2 { + use 0x2::M as M1; + use 0x4::M as M3; + + struct X {} + + public fun x(): (M1::X, X, M3::X) { + (M1::x(), X {}, M3::x()) + } + +} + +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/address_directives_empty.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/address_directives_empty.exp new file mode 100644 index 00000000000000..90b32906711cc7 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/address_directives_empty.exp @@ -0,0 +1,2 @@ + +============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/address_directives_empty.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/address_directives_empty.move new file mode 100644 index 00000000000000..440dbabf6c71be --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/address_directives_empty.move @@ -0,0 +1,4 @@ +address 0x3 {} +address 0x4 {} +address 0x2 {} +address 0x4 {} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/almost_invalid_local_name.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/almost_invalid_local_name.exp new file mode 100644 index 00000000000000..90b32906711cc7 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/almost_invalid_local_name.exp @@ -0,0 +1,2 @@ + +============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/almost_invalid_local_name.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/almost_invalid_local_name.move new file mode 100644 index 00000000000000..b3b3210d447d2c --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/almost_invalid_local_name.move @@ -0,0 +1,21 @@ +module 0x8675309::M { + struct F has drop { No: u64 } + + fun t(_No: u64) { + } + + fun t2() { + let _No = 100; + } + + fun t3() { + let _No; + _No = 100; + } + + fun t4() { + let _No = 100; + F { No: _No }; + } + +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/entry_main.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/entry_main.exp new file mode 100644 index 00000000000000..90b32906711cc7 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/entry_main.exp @@ -0,0 +1,2 @@ + +============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/entry_main.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/entry_main.move new file mode 100644 index 00000000000000..77174396e95f44 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/entry_main.move @@ -0,0 +1,4 @@ +script { +entry fun main() { +} +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/multiple_alias.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/multiple_alias.exp new file mode 100644 index 00000000000000..90b32906711cc7 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/multiple_alias.exp @@ -0,0 +1,2 @@ + +============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/multiple_alias.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/multiple_alias.move new file mode 100644 index 00000000000000..2b7ddd1422f34d --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/multiple_alias.move @@ -0,0 +1,26 @@ +address 0x2 { + +module M { + use 0x2::X; + use 0x2::X as X2; + + struct F { + f: 0x2::X::S, + g: X::S, + h: X2::S, + } + + fun foo(_x: 0x2::X::S, _y: X::S, _z: X2::S): (0x2::X::S, X::S, X2::S) { + let a : 0x2::X::S = 0x2::X::foo(); + let b : X::S = X::foo(); + let c : X2::S = X2::foo(); + (a, b, c) + } +} + +module X { + struct S has drop {} + public fun foo(): S { S{} } +} + +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/number_literal_long.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/number_literal_long.exp new file mode 100644 index 00000000000000..90b32906711cc7 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/number_literal_long.exp @@ -0,0 +1,2 @@ + +============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/number_literal_long.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/number_literal_long.move new file mode 100644 index 00000000000000..87c9d16a6297da --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/number_literal_long.move @@ -0,0 +1,8 @@ +module 0x8675309::M { + fun foo() { + 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; + 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; + (340282366920938463463374607431768211454: u128); + (0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF: u128); + } +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/pack_all_field_cases.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/pack_all_field_cases.exp new file mode 100644 index 00000000000000..90b32906711cc7 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/pack_all_field_cases.exp @@ -0,0 +1,2 @@ + +============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/pack_all_field_cases.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/pack_all_field_cases.move new file mode 100644 index 00000000000000..fec2428fed1ea4 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/pack_all_field_cases.move @@ -0,0 +1,14 @@ +module 0x8675309::M { + struct T has drop {} + struct S has drop { f: u64, g: u64 } + fun foo() { + let f = 0; + let g = 1; + T {}; + T { }; + S { f, g }; + S { f: 0, g: 0}; + S { g: 0, f }; + S { g, f: 0 }; + } +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/restricted_names_valid.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/restricted_names_valid.exp new file mode 100644 index 00000000000000..90b32906711cc7 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/restricted_names_valid.exp @@ -0,0 +1,2 @@ + +============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/restricted_names_valid.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/restricted_names_valid.move new file mode 100644 index 00000000000000..441aafb1cf6bb2 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/restricted_names_valid.move @@ -0,0 +1,72 @@ +address 0x2 { +module N { + public fun t(): u64 { 0 } +} + +module M { + use 0x2::N::{ + Self as address, + Self as signer, + Self as u8, + Self as u64, + Self as u128, + // vector now keyworded in expressions, so this would be unusable + // Self as vector, + Self as move_to, + Self as move_from, + Self as borrow_global, + Self as borrow_global_mut, + Self as exists, + Self as freeze, + Self as assert, + }; + + fun t(): u64 { + + let address = 0; + let signer = 0; + let u8 = 0; + let u64 = 0; + let u128 = 0; + // vector now keyworded in expressions, so this would be unusable + // let vector = 0; + let move_to = 0; + let move_from = 0; + let borrow_global = 0; + let borrow_global_mut = 0; + let exists = 0; + let freeze = 0; + let assert = 0; + + address::t() + + signer::t() + + u8::t() + + u64::t() + + u128::t() + + // vector now keyworded in expressions, so this would fail in parsing + // vector::t() + + move_to::t() + + move_from::t() + + borrow_global::t() + + borrow_global_mut::t() + + exists::t() + + freeze::t() + + assert::t(); + + address + + signer + + u8 + + u64 + + u128 + + // vector now keyworded in expressions, so this would fail in parsing + // vector + + move_to + + move_from + + borrow_global + + borrow_global_mut + + exists + + freeze + + assert + } +} +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/spec_block_uses.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/spec_block_uses.exp new file mode 100644 index 00000000000000..e9ce332b090f07 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/spec_block_uses.exp @@ -0,0 +1,19 @@ + +Diagnostics: +error: cannot use `u256` with an operator which expects a value of type `address` + ┌─ tests/more-v1/expansion/spec_block_uses.move:12:32 + │ +12 │ ensures exists>(0x1) == exists(0x1); + │ ^^^ + +error: cannot use `u256` with an operator which expects a value of type `address` + ┌─ tests/more-v1/expansion/spec_block_uses.move:12:50 + │ +12 │ ensures exists>(0x1) == exists(0x1); + │ ^^^ + +error: `ensures` not allowed in module context + ┌─ tests/more-v1/expansion/spec_block_uses.move:12:9 + │ +12 │ ensures exists>(0x1) == exists(0x1); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/spec_block_uses.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/spec_block_uses.move new file mode 100644 index 00000000000000..e7ebc0a6b31e61 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/spec_block_uses.move @@ -0,0 +1,20 @@ +address 0x2 { +module M { + struct S {} + struct R { f: T } + + fun t1(): (R, S) { + abort 0 + } + + spec module { + use 0x2::M::{S as R, R as S}; + ensures exists>(0x1) == exists(0x1); + } + + fun t2(): (R, S) { + abort 0 + } + +} +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/spec_block_uses_shadows_defines.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/spec_block_uses_shadows_defines.exp new file mode 100644 index 00000000000000..45e1e9794cb538 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/spec_block_uses_shadows_defines.exp @@ -0,0 +1,19 @@ + +Diagnostics: +error: cannot use `u256` with an operator which expects a value of type `address` + ┌─ tests/more-v1/expansion/spec_block_uses_shadows_defines.move:16:32 + │ +16 │ ensures exists>(0x1) == exists(0x1); + │ ^^^ + +error: cannot use `u256` with an operator which expects a value of type `address` + ┌─ tests/more-v1/expansion/spec_block_uses_shadows_defines.move:16:50 + │ +16 │ ensures exists>(0x1) == exists(0x1); + │ ^^^ + +error: `ensures` not allowed in module context + ┌─ tests/more-v1/expansion/spec_block_uses_shadows_defines.move:16:9 + │ +16 │ ensures exists>(0x1) == exists(0x1); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/spec_block_uses_shadows_defines.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/spec_block_uses_shadows_defines.move new file mode 100644 index 00000000000000..26179025eb52ca --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/spec_block_uses_shadows_defines.move @@ -0,0 +1,24 @@ +address 0x2 { +module M { + struct R1 {} + struct R2 { f: T } + + fun t1(): (R2, R1) { + abort 0 + } + + spec module { + use 0x2::M::{R1 as R, R2 as S}; + // TODO syntax change to move spec heleprs outside of blocks + fun S(): bool { false } + fun R(): bool { false } + + ensures exists>(0x1) == exists(0x1); + } + + fun t2(): (R2, R1) { + abort 0 + } + +} +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/standalone_mname_with_type_args.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/standalone_mname_with_type_args.exp index 39cf34c30040e4..d8b9cb0d290bc2 100644 --- a/third_party/move/move-compiler-v2/tests/more-v1/expansion/standalone_mname_with_type_args.exp +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/standalone_mname_with_type_args.exp @@ -1,7 +1,7 @@ Diagnostics: -error: syntax item restricted to spec contexts +error: undeclared `M` ┌─ tests/more-v1/expansion/standalone_mname_with_type_args.move:3:21 │ 3 │ let _ = 0 + M; - │ ^^^^^^ Expected name to be followed by a brace-enclosed list of field expressions or a parenthesized list of arguments for a function call + │ ^ diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/standalone_name_with_type_args.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/standalone_name_with_type_args.exp index ef660bd7a70458..6b542362b8c839 100644 --- a/third_party/move/move-compiler-v2/tests/more-v1/expansion/standalone_name_with_type_args.exp +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/standalone_name_with_type_args.exp @@ -1,7 +1,7 @@ Diagnostics: -error: syntax item restricted to spec contexts +error: undeclared `n` ┌─ tests/more-v1/expansion/standalone_name_with_type_args.move:3:17 │ 3 │ let _ = n; - │ ^^^^^^ Expected name to be followed by a brace-enclosed list of field expressions or a parenthesized list of arguments for a function call + │ ^ diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/top_level_not_named_main.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/top_level_not_named_main.exp new file mode 100644 index 00000000000000..90b32906711cc7 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/top_level_not_named_main.exp @@ -0,0 +1,2 @@ + +============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/top_level_not_named_main.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/top_level_not_named_main.move new file mode 100644 index 00000000000000..fc7d4932fb9b16 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/top_level_not_named_main.move @@ -0,0 +1,4 @@ +script { +fun foo() { +} +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_function.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_function.exp new file mode 100644 index 00000000000000..90b32906711cc7 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_function.exp @@ -0,0 +1,2 @@ + +============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_function.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_function.move new file mode 100644 index 00000000000000..0c705c6aca1974 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_function.move @@ -0,0 +1,29 @@ +address 0x2 { +module X { + public fun u(): u64 { + 0 + } + public fun a(): address { + @0x0 + } + public fun bar() {} +} + +module M { + use 0x2::X::{u, u as U, u as get_u, a, a as A, a as get_a}; + fun t() { + (u(): u64); + (U(): u64); + (get_u(): u64); + (a(): address); + (A(): address); + (get_a(): address); + } + + use 0x2::X::bar as baz; + fun bar() { + baz() + } +} + +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_function_overlap_with_module.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_function_overlap_with_module.exp new file mode 100644 index 00000000000000..90b32906711cc7 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_function_overlap_with_module.exp @@ -0,0 +1,2 @@ + +============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_function_overlap_with_module.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_function_overlap_with_module.move new file mode 100644 index 00000000000000..56c85bf2926c33 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_function_overlap_with_module.move @@ -0,0 +1,13 @@ +address 0x2 { +module X { + public fun u() {} +} + +module M { + use 0x2::X::{Self, u as X}; + fun foo() { + X(); + X::u() + } +} +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_inner_scope.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_inner_scope.exp new file mode 100644 index 00000000000000..90b32906711cc7 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_inner_scope.exp @@ -0,0 +1,2 @@ + +============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_inner_scope.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_inner_scope.move new file mode 100644 index 00000000000000..db3f09095d1765 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_inner_scope.move @@ -0,0 +1,27 @@ +address 0x2 { +module M { + struct S1 has drop { b: bool } + struct S2 has drop { u: u64 } + fun check(): bool { + false + } + fun num(): u64 { + 0 + } + + fun t() { + use 0x2::M::{check as num, num as check, S1 as S2, S2 as S1}; + num() && false; + check() + 1; + S1 { u: 0 }; + S2 { b: false }; + { + use 0x2::M::{check, num, S1, S2}; + check() && false; + num() + 1; + S2 { u: 0 }; + S1 { b: false }; + } + } +} +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_inner_scope_shadows.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_inner_scope_shadows.exp new file mode 100644 index 00000000000000..03a309fd9897fd --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_inner_scope_shadows.exp @@ -0,0 +1,12 @@ + +Diagnostics: +note: unused schema M::Foo + ┌─ tests/more-v1/expansion/use_inner_scope_shadows.move:12:5 + │ +12 │ ╭ spec schema Foo { +13 │ │ ensures true; +14 │ │ } + │ ╰─────^ + + +============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_inner_scope_shadows.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_inner_scope_shadows.move new file mode 100644 index 00000000000000..d7b8cfae198215 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_inner_scope_shadows.move @@ -0,0 +1,42 @@ +address 0x2 { +module M { + struct S1 has drop { b: bool } + struct S2 has drop { u: u64 } + struct S3 has drop { a: address } + fun check(): bool { + false + } + fun num(u: u64): u64 { + u + 1 + } + spec schema Foo { + ensures true; + } + + fun t(): S3 { + use 0x2::M::{check as num, num as t, S1 as S2, S2 as Foo, S3 as T}; + num() && true; + t(0) + 1; + S2 { b: false }; + Foo { u: 0 }; + T { a: @0x0 } + } + + fun t2(x: T) { + { + use 0x2::M::{check as num, num as t, S1 as S2, S2 as Foo, S3 as T}; + num() && true; + t(0) + 1; + S2 { b: false }; + Foo { u: 0 }; + T { a: @0x0 } + }; + check() && true; + num(0) + 1; + t2(x); + S1 { b: false }; + S2 { u: 0 }; + S3 { a: @0x0 }; + } +} +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_nested_self.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_nested_self.exp new file mode 100644 index 00000000000000..90b32906711cc7 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_nested_self.exp @@ -0,0 +1,2 @@ + +============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_nested_self.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_nested_self.move new file mode 100644 index 00000000000000..21cdb9ac61c689 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_nested_self.move @@ -0,0 +1,15 @@ +address 0x2 { +module X { + struct S {} + public fun foo() {} +} + +module M { + use 0x2::X::Self; + + struct S { f: X::S } + fun foo() { + X::foo() + } +} +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_nested_self_as.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_nested_self_as.exp new file mode 100644 index 00000000000000..90b32906711cc7 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_nested_self_as.exp @@ -0,0 +1,2 @@ + +============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_nested_self_as.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_nested_self_as.move new file mode 100644 index 00000000000000..95a5be8518114b --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_nested_self_as.move @@ -0,0 +1,16 @@ +address 0x2 { + module X { + struct S {} + public fun foo() {} + } + + module M { + use 0x2::X::{Self as B, foo, S}; + + struct X { f: B::S, f2: S } + fun bar() { + B::foo(); + foo() + } + } + } diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_spec_function.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_spec_function.exp new file mode 100644 index 00000000000000..90b32906711cc7 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_spec_function.exp @@ -0,0 +1,2 @@ + +============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_spec_function.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_spec_function.move new file mode 100644 index 00000000000000..170f9cdf2e0f1e --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_spec_function.move @@ -0,0 +1,20 @@ +address 0x2 { +module X { + spec module { + fun foo(): bool { true } + fun bar(): bool { true } + } +} + +module M { + use 0x2::X::{foo, bar as baz}; + fun t() { + } + + spec t { + ensures foo(); + ensures baz(); + } +} + +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_spec_schema.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_spec_schema.exp new file mode 100644 index 00000000000000..ee36d9089644a0 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_spec_schema.exp @@ -0,0 +1,29 @@ + +Diagnostics: +note: unused schema X::Foo + ┌─ tests/more-v1/expansion/use_spec_schema.move:3:5 + │ +3 │ ╭ spec schema Foo { +4 │ │ ensures true; +5 │ │ } + │ ╰─────^ + +note: unused schema X::Bar + ┌─ tests/more-v1/expansion/use_spec_schema.move:7:5 + │ +7 │ ╭ spec schema Bar { +8 │ │ ensures true; +9 │ │ } + │ ╰─────^ + +error: the `apply` schema weaving operator can only be used inside a `spec module` block + ┌─ tests/more-v1/expansion/use_spec_schema.move:19:9 + │ +19 │ apply Foo to t; + │ ^^^^^^^^^^^^^^^^^^ + +error: the `apply` schema weaving operator can only be used inside a `spec module` block + ┌─ tests/more-v1/expansion/use_spec_schema.move:20:9 + │ +20 │ apply Baz to t; + │ ^^^^^^^^^^^^^^^^^^ diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_spec_schema.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_spec_schema.move new file mode 100644 index 00000000000000..6e697daf890e6e --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_spec_schema.move @@ -0,0 +1,24 @@ +address 0x2 { +module X { + spec schema Foo { + ensures true; + } + + spec schema Bar { + ensures true; + } +} + +module M { + use 0x2::X::{Foo, Bar as Baz}; + struct S {} + fun t() { + } + + spec t { + apply Foo to t; + apply Baz to t; + } +} + +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_struct.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_struct.exp new file mode 100644 index 00000000000000..90b32906711cc7 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_struct.exp @@ -0,0 +1,2 @@ + +============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_struct.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_struct.move new file mode 100644 index 00000000000000..19a13670db16d8 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_struct.move @@ -0,0 +1,21 @@ +address 0x2 { +module X { + struct U {} + struct R {} +} + +module M { + use 0x2::X::{U, U as U2}; + + fun f(u: U, r: R) { + g(u, r) + } + + fun g(u: U2, r: R2) { + f(u, r) + } + + use 0x2::X::{R, R as R2}; +} + +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_struct_overlap_with_module.exp b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_struct_overlap_with_module.exp new file mode 100644 index 00000000000000..ea5bd62d87125d --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_struct_overlap_with_module.exp @@ -0,0 +1,13 @@ + +Diagnostics: +warning: unused alias + ┌─ tests/more-v1/expansion/use_struct_overlap_with_module.move:7:14 + │ +7 │ use 0x2::X::{Self, S as X}; + │ ^ Unused 'use' of alias 'X'. Consider removing it + +error: variants not allowed in this context + ┌─ tests/more-v1/expansion/use_struct_overlap_with_module.move:8:27 + │ +8 │ struct A { f1: X, f2: X::S } + │ ^^^^ diff --git a/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_struct_overlap_with_module.move b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_struct_overlap_with_module.move new file mode 100644 index 00000000000000..b5bf9a383661b7 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/more-v1/expansion/use_struct_overlap_with_module.move @@ -0,0 +1,10 @@ +address 0x2 { +module X { + struct S {} +} + +module M { + use 0x2::X::{Self, S as X}; + struct A { f1: X, f2: X::S } +} +} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/flavors/async/derive_errors.exp b/third_party/move/move-compiler-v2/tests/more-v1/flavors/async/derive_errors.exp deleted file mode 100644 index 065afdfb68f44b..00000000000000 --- a/third_party/move/move-compiler-v2/tests/more-v1/flavors/async/derive_errors.exp +++ /dev/null @@ -1,93 +0,0 @@ - -Diagnostics: -warning: unknown attribute - ┌─ tests/more-v1/flavors/async/derive_errors.move:1:3 - │ -1 │ #[actor] - │ ^^^^^ Attribute name 'actor' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. - -warning: unknown attribute - ┌─ tests/more-v1/flavors/async/derive_errors.move:5:3 - │ -5 │ #[actor] - │ ^^^^^ Attribute name 'actor' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. - -warning: unknown attribute - ┌─ tests/more-v1/flavors/async/derive_errors.move:7:7 - │ -7 │ #[state] struct A {} - │ ^^^^^ Attribute name 'state' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. - -warning: unknown attribute - ┌─ tests/more-v1/flavors/async/derive_errors.move:8:7 - │ -8 │ #[state] struct B {} - │ ^^^^^ Attribute name 'state' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. - -warning: unknown attribute - ┌─ tests/more-v1/flavors/async/derive_errors.move:11:3 - │ -11 │ #[actor] - │ ^^^^^ Attribute name 'actor' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. - -warning: unknown attribute - ┌─ tests/more-v1/flavors/async/derive_errors.move:13:7 - │ -13 │ #[state] struct A {} - │ ^^^^^ Attribute name 'state' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. - -warning: unknown attribute - ┌─ tests/more-v1/flavors/async/derive_errors.move:16:7 - │ -16 │ #[message] fun f1() {} - │ ^^^^^^^ Attribute name 'message' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. - -warning: unknown attribute - ┌─ tests/more-v1/flavors/async/derive_errors.move:17:7 - │ -17 │ #[message] fun f2(_x: &B) {} - │ ^^^^^^^ Attribute name 'message' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. - -warning: unknown attribute - ┌─ tests/more-v1/flavors/async/derive_errors.move:18:7 - │ -18 │ #[message] fun f3(_x: A) {} - │ ^^^^^^^ Attribute name 'message' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. - -warning: unknown attribute - ┌─ tests/more-v1/flavors/async/derive_errors.move:19:7 - │ -19 │ #[message] fun f4(_x: &u64) {} - │ ^^^^^^^ Attribute name 'message' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. - -warning: unknown attribute - ┌─ tests/more-v1/flavors/async/derive_errors.move:20:7 - │ -20 │ #[message] fun f5(_x: &A) {} - │ ^^^^^^^ Attribute name 'message' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. - -warning: unknown attribute - ┌─ tests/more-v1/flavors/async/derive_errors.move:21:7 - │ -21 │ #[message] fun f6(_x: &mut A) {} - │ ^^^^^^^ Attribute name 'message' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. - -warning: unknown attribute - ┌─ tests/more-v1/flavors/async/derive_errors.move:22:7 - │ -22 │ #[message] fun f7(_x: &A, _a1: u64, _a2: u64, _a3: u64, _a4: u64, _a5: u64, _a6: u64, - │ ^^^^^^^ Attribute name 'message' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. - -warning: unknown attribute - ┌─ tests/more-v1/flavors/async/derive_errors.move:24:7 - │ -24 │ #[message] fun f8(_x: &mut Self::A) {} - │ ^^^^^^^ Attribute name 'message' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. - - -Diagnostics: -error: local `_x` of type `WrongHandlerParam::A` does not have the `drop` ability - ┌─ tests/more-v1/flavors/async/derive_errors.move:18:30 - │ -18 │ #[message] fun f3(_x: A) {} - │ ^^ implicitly dropped here since it is no longer used diff --git a/third_party/move/move-compiler-v2/tests/more-v1/flavors/async/derive_errors.move b/third_party/move/move-compiler-v2/tests/more-v1/flavors/async/derive_errors.move deleted file mode 100644 index 26fe9c85f50bc7..00000000000000 --- a/third_party/move/move-compiler-v2/tests/more-v1/flavors/async/derive_errors.move +++ /dev/null @@ -1,45 +0,0 @@ -#[actor] -module 0x3::NoState { -} - -#[actor] -module 0x3::DuplicateState { - #[state] struct A {} - #[state] struct B {} -} - -#[actor] -module 0x3::WrongHandlerParam { - #[state] struct A {} - struct B {} - - #[message] fun f1() {} - #[message] fun f2(_x: &B) {} - #[message] fun f3(_x: A) {} - #[message] fun f4(_x: &u64) {} - #[message] fun f5(_x: &A) {} - #[message] fun f6(_x: &mut A) {} - #[message] fun f7(_x: &A, _a1: u64, _a2: u64, _a3: u64, _a4: u64, _a5: u64, _a6: u64, - _a7: u64, _a8: u64, _a9: u64) {} - #[message] fun f8(_x: &mut Self::A) {} -} - -// Simulate Async runtime module -module Async::Runtime { - public native fun send__0(actor: address, message_hash: u64); - public native fun send__1(actor: address, message_hash: u64, arg1: vector); - public native fun send__2(actor: address, message_hash: u64, arg1: vector, arg2: vector); - public native fun send__3(actor: address, message_hash: u64, arg1: vector, arg2: vector, arg3: vector); - public native fun send__4(actor: address, message_hash: u64, - arg1: vector, arg2: vector, arg3: vector, arg4: vector); - public native fun send__5(actor: address, message_hash: u64, - arg1: vector, arg2: vector, arg3: vector, arg4: vector, arg5: vector); - public native fun send__6(actor: address, message_hash: u64, - arg1: vector, arg2: vector, arg3: vector, arg4: vector, arg5: vector, arg6: vector); - public native fun send__7(actor: address, message_hash: u64, - arg1: vector, arg2: vector, arg3: vector, arg4: vector, arg5: vector, arg6: vector, - arg7: vector); - public native fun send__8(actor: address, message_hash: u64, - arg1: vector, arg2: vector, arg3: vector, arg4: vector, arg5: vector, arg6: vector, - arg7: vector, arg8: vector); -} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/flavors/evm/derive.exp b/third_party/move/move-compiler-v2/tests/more-v1/flavors/evm/derive.exp deleted file mode 100644 index 0afad37836a825..00000000000000 --- a/third_party/move/move-compiler-v2/tests/more-v1/flavors/evm/derive.exp +++ /dev/null @@ -1,31 +0,0 @@ - -Diagnostics: -warning: unknown attribute - ┌─ tests/more-v1/flavors/evm/derive.move:1:3 - │ -1 │ #[contract] - │ ^^^^^^^^ Attribute name 'contract' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. - -warning: unknown attribute - ┌─ tests/more-v1/flavors/evm/derive.move:4:7 - │ -4 │ #[callable] - │ ^^^^^^^^ Attribute name 'callable' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. - -error: no function named `M::call_add` found - ┌─ tests/more-v1/flavors/evm/derive.move:8:9 - │ -8 │ 0x1::M::call_add(@1, x) + call_add(@2, x) - │ ^^^^^^^^^^^^^^^^^^^^^^^ - -error: no function named `call_add` found - ┌─ tests/more-v1/flavors/evm/derive.move:8:35 - │ -8 │ 0x1::M::call_add(@1, x) + call_add(@2, x) - │ ^^^^^^^^^^^^^^^ - -warning: unknown attribute - ┌─ tests/more-v1/flavors/evm/derive.move:11:7 - │ -11 │ #[callable] - │ ^^^^^^^^ Attribute name 'callable' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. diff --git a/third_party/move/move-compiler-v2/tests/more-v1/flavors/evm/derive.move b/third_party/move/move-compiler-v2/tests/more-v1/flavors/evm/derive.move deleted file mode 100644 index 64e5d502b16787..00000000000000 --- a/third_party/move/move-compiler-v2/tests/more-v1/flavors/evm/derive.move +++ /dev/null @@ -1,15 +0,0 @@ -#[contract] -module 0x1::M { - - #[callable] - fun add(x: u64): u64 { x + 1 } - - fun expect_can_call(x: u64): u64 { - 0x1::M::call_add(@1, x) + call_add(@2, x) - } - - #[callable] - fun expect_duplicate(x: u64): u64 { x + 1 } - - fun call_expect_duplicate(_c: address) { } -} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_branch_both_invalid.exp b/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_branch_both_invalid.exp index 9c936fd87e3188..59718b6b99cfdb 100644 --- a/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_branch_both_invalid.exp +++ b/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_branch_both_invalid.exp @@ -4,10 +4,10 @@ error: cannot copy local `x` which is still mutably borrowed ┌─ tests/more-v1/liveness/dead_refs_branch_both_invalid.move:10:9 │ 4 │ let x_ref = &mut x; - │ ------ previous mutable local borrow + │ ------ local `x` previously mutably borrowed here · 10 │ _ = x; - │ ^ copied here + │ ^ copy attempted here 11 │ _ = move x; 12 │ *x_ref = 0; │ ---------- conflicting reference `x_ref` used here @@ -16,10 +16,10 @@ error: cannot move local `x` which is still borrowed ┌─ tests/more-v1/liveness/dead_refs_branch_both_invalid.move:11:13 │ 4 │ let x_ref = &mut x; - │ ------ previous mutable local borrow + │ ------ local `x` previously mutably borrowed here · 11 │ _ = move x; - │ ^^^^^^ moved here + │ ^^^^^^ move attempted here 12 │ *x_ref = 0; │ ---------- conflicting reference `x_ref` used here @@ -27,10 +27,10 @@ error: cannot copy local `x` which is still mutably borrowed ┌─ tests/more-v1/liveness/dead_refs_branch_both_invalid.move:23:9 │ 17 │ let x_ref = &mut x; - │ ------ previous mutable local borrow + │ ------ local `x` previously mutably borrowed here · 23 │ _ = x; - │ ^ copied here + │ ^ copy attempted here 24 │ _ = move x; 25 │ _ = *x_ref; │ ------ conflicting reference `x_ref` used here @@ -39,9 +39,9 @@ error: cannot move local `x` which is still borrowed ┌─ tests/more-v1/liveness/dead_refs_branch_both_invalid.move:24:13 │ 17 │ let x_ref = &mut x; - │ ------ previous mutable local borrow + │ ------ local `x` previously mutably borrowed here · 24 │ _ = move x; - │ ^^^^^^ moved here + │ ^^^^^^ move attempted here 25 │ _ = *x_ref; │ ------ conflicting reference `x_ref` used here diff --git a/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_branch_invalid.exp b/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_branch_invalid.exp index 43c0b8c3b06d2e..0e5d4fef001ca7 100644 --- a/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_branch_invalid.exp +++ b/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_branch_invalid.exp @@ -4,10 +4,10 @@ error: cannot copy local `x` which is still mutably borrowed ┌─ tests/more-v1/liveness/dead_refs_branch_invalid.move:8:9 │ 4 │ let x_ref = &mut x; - │ ------ previous mutable local borrow + │ ------ local `x` previously mutably borrowed here · 8 │ _ = x; - │ ^ copied here + │ ^ copy attempted here 9 │ _ = move x; 10 │ *x_ref = 0; │ ---------- conflicting reference `x_ref` used here @@ -16,10 +16,10 @@ error: cannot move local `x` which is still borrowed ┌─ tests/more-v1/liveness/dead_refs_branch_invalid.move:9:13 │ 4 │ let x_ref = &mut x; - │ ------ previous mutable local borrow + │ ------ local `x` previously mutably borrowed here · 9 │ _ = move x; - │ ^^^^^^ moved here + │ ^^^^^^ move attempted here 10 │ *x_ref = 0; │ ---------- conflicting reference `x_ref` used here @@ -27,10 +27,10 @@ error: cannot copy local `x` which is still mutably borrowed ┌─ tests/more-v1/liveness/dead_refs_branch_invalid.move:20:9 │ 15 │ let x_ref = &mut x; - │ ------ previous mutable local borrow + │ ------ local `x` previously mutably borrowed here · 20 │ _ = x; - │ ^ copied here + │ ^ copy attempted here 21 │ _ = move x; 22 │ _ = *x_ref; │ ------ conflicting reference `x_ref` used here @@ -39,9 +39,9 @@ error: cannot move local `x` which is still borrowed ┌─ tests/more-v1/liveness/dead_refs_branch_invalid.move:21:13 │ 15 │ let x_ref = &mut x; - │ ------ previous mutable local borrow + │ ------ local `x` previously mutably borrowed here · 21 │ _ = move x; - │ ^^^^^^ moved here + │ ^^^^^^ move attempted here 22 │ _ = *x_ref; │ ------ conflicting reference `x_ref` used here diff --git a/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_loop_invalid.exp b/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_loop_invalid.exp index 4873d4aee63294..7f00a7aa3c5315 100644 --- a/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_loop_invalid.exp +++ b/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_loop_invalid.exp @@ -4,10 +4,10 @@ error: cannot copy local `x` which is still mutably borrowed ┌─ tests/more-v1/liveness/dead_refs_loop_invalid.move:6:13 │ 4 │ let x_ref = &mut x; - │ ------ previous mutable local borrow + │ ------ local `x` previously mutably borrowed here 5 │ while (cond) { 6 │ _ = x; - │ ^ copied here + │ ^ copy attempted here 7 │ _ = x_ref; │ - conflicting reference `x_ref` used here @@ -15,20 +15,20 @@ error: cannot copy local `x` which is still mutably borrowed ┌─ tests/more-v1/liveness/dead_refs_loop_invalid.move:16:12 │ 13 │ let x_ref = &mut x; - │ ------ previous mutable local borrow + │ ------ local `x` previously mutably borrowed here 14 │ loop { 15 │ _ = x_ref; │ - conflicting reference `x_ref` used here 16 │ _ = x; - │ ^ copied here + │ ^ copy attempted here error: cannot copy local `x` which is still mutably borrowed ┌─ tests/more-v1/liveness/dead_refs_loop_invalid.move:25:13 │ 22 │ let x_ref = &mut x; - │ ------ previous mutable local borrow + │ ------ local `x` previously mutably borrowed here 23 │ loop { 24 │ if (cond) break else { _ = x_ref; }; │ - conflicting reference `x_ref` used here 25 │ _ = x; - │ ^ copied here + │ ^ copy attempted here diff --git a/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_nested_invalid.exp b/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_nested_invalid.exp index a65a2c22ccb438..59800ddbffb18a 100644 --- a/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_nested_invalid.exp +++ b/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_nested_invalid.exp @@ -4,33 +4,33 @@ error: cannot copy local `x` which is still mutably borrowed ┌─ tests/more-v1/liveness/dead_refs_nested_invalid.move:9:13 │ 4 │ let x_ref = &mut x; - │ ------ previous mutable local borrow + │ ------ local `x` previously mutably borrowed here · 7 │ _ = x_ref │ - conflicting reference `x_ref` used here 8 │ }; 9 │ _ = x; - │ ^ copied here + │ ^ copy attempted here error: cannot copy local `x` which is still mutably borrowed ┌─ tests/more-v1/liveness/dead_refs_nested_invalid.move:19:16 │ 15 │ let x_ref = &mut x; - │ ------ previous mutable local borrow + │ ------ local `x` previously mutably borrowed here 16 │ loop { 17 │ _ = x_ref; │ - conflicting reference `x_ref` used here 18 │ loop { 19 │ _ = x; - │ ^ copied here + │ ^ copy attempted here error: cannot copy local `x` which is still mutably borrowed ┌─ tests/more-v1/liveness/dead_refs_nested_invalid.move:29:67 │ 27 │ let x_ref = &mut x; - │ ------ previous mutable local borrow + │ ------ local `x` previously mutably borrowed here 28 │ loop { 29 │ if (cond) { _ = x_ref; break } else { while (!cond) { _ = x } } - │ - ^ copied here + │ - ^ copy attempted here │ │ │ conflicting reference `x_ref` used here diff --git a/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_simple_invalid.exp b/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_simple_invalid.exp index 431fd7f818972e..1015623e8f40dc 100644 --- a/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_simple_invalid.exp +++ b/third_party/move/move-compiler-v2/tests/more-v1/liveness/dead_refs_simple_invalid.exp @@ -4,9 +4,9 @@ error: cannot copy local `x` which is still mutably borrowed ┌─ tests/more-v1/liveness/dead_refs_simple_invalid.move:5:9 │ 4 │ let x_ref = &mut x; - │ ------ previous mutable local borrow + │ ------ local `x` previously mutably borrowed here 5 │ _ = x; - │ ^ copied here + │ ^ copy attempted here 6 │ _ = move x; 7 │ *x_ref = 0; │ ---------- conflicting reference `x_ref` used here @@ -15,10 +15,10 @@ error: cannot move local `x` which is still borrowed ┌─ tests/more-v1/liveness/dead_refs_simple_invalid.move:6:13 │ 4 │ let x_ref = &mut x; - │ ------ previous mutable local borrow + │ ------ local `x` previously mutably borrowed here 5 │ _ = x; 6 │ _ = move x; - │ ^^^^^^ moved here + │ ^^^^^^ move attempted here 7 │ *x_ref = 0; │ ---------- conflicting reference `x_ref` used here @@ -26,9 +26,9 @@ error: cannot copy local `x` which is still mutably borrowed ┌─ tests/more-v1/liveness/dead_refs_simple_invalid.move:13:9 │ 12 │ let x_ref = &mut x; - │ ------ previous mutable local borrow + │ ------ local `x` previously mutably borrowed here 13 │ _ = x; - │ ^ copied here + │ ^ copy attempted here 14 │ _ = move x; 15 │ _ = *x_ref; │ ------ conflicting reference `x_ref` used here @@ -37,9 +37,9 @@ error: cannot move local `x` which is still borrowed ┌─ tests/more-v1/liveness/dead_refs_simple_invalid.move:14:13 │ 12 │ let x_ref = &mut x; - │ ------ previous mutable local borrow + │ ------ local `x` previously mutably borrowed here 13 │ _ = x; 14 │ _ = move x; - │ ^^^^^^ moved here + │ ^^^^^^ move attempted here 15 │ _ = *x_ref; │ ------ conflicting reference `x_ref` used here diff --git a/third_party/move/move-compiler-v2/tests/more-v1/parser/acquires_list_generic.exp b/third_party/move/move-compiler-v2/tests/more-v1/parser/acquires_list_generic.exp deleted file mode 100644 index 66808ee4b46037..00000000000000 --- a/third_party/move/move-compiler-v2/tests/more-v1/parser/acquires_list_generic.exp +++ /dev/null @@ -1,7 +0,0 @@ - -Diagnostics: -error: unnecessary acquires annotation - ┌─ tests/more-v1/parser/acquires_list_generic.move:6:24 - │ -6 │ fun foo() acquires B> { - │ ^^^^^^^^^^^ diff --git a/third_party/move/move-compiler-v2/tests/more-v1/parser/acquires_list_generic.move b/third_party/move/move-compiler-v2/tests/more-v1/parser/acquires_list_generic.move deleted file mode 100644 index 85f08b367fea5c..00000000000000 --- a/third_party/move/move-compiler-v2/tests/more-v1/parser/acquires_list_generic.move +++ /dev/null @@ -1,9 +0,0 @@ -module 0x42::M { - struct CupC {} - struct R {} - struct B {} - - fun foo() acquires B> { - abort 0 - } -} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/parser/function_visibility_empty.exp b/third_party/move/move-compiler-v2/tests/more-v1/parser/function_visibility_empty.exp index dfb3136c652a19..aa914f18aabe4a 100644 --- a/third_party/move/move-compiler-v2/tests/more-v1/parser/function_visibility_empty.exp +++ b/third_party/move/move-compiler-v2/tests/more-v1/parser/function_visibility_empty.exp @@ -4,4 +4,4 @@ error: unexpected token ┌─ tests/more-v1/parser/function_visibility_empty.move:2:5 │ 2 │ public() fun f() {} - │ ^^^^^^^^ Invalid visibility modifier. Consider removing it or using 'public' or 'public(friend)' + │ ^^^^^^^^ Invalid visibility modifier. Consider removing it or using 'public', 'public(friend)', or 'public(package)' diff --git a/third_party/move/move-compiler-v2/tests/more-v1/parser/function_visibility_invalid.exp b/third_party/move/move-compiler-v2/tests/more-v1/parser/function_visibility_invalid.exp index 49c7f26ff0aee9..bd0ae0651717e9 100644 --- a/third_party/move/move-compiler-v2/tests/more-v1/parser/function_visibility_invalid.exp +++ b/third_party/move/move-compiler-v2/tests/more-v1/parser/function_visibility_invalid.exp @@ -4,4 +4,4 @@ error: unexpected token ┌─ tests/more-v1/parser/function_visibility_invalid.move:2:5 │ 2 │ public(invalid_modifier) fun f() {} - │ ^^^^^^^^^^^^^^^^^^^^^^^^ Invalid visibility modifier. Consider removing it or using 'public' or 'public(friend)' + │ ^^^^^^^^^^^^^^^^^^^^^^^^ Invalid visibility modifier. Consider removing it or using 'public', 'public(friend)', or 'public(package)' diff --git a/third_party/move/move-compiler-v2/tests/more-v1/parser/spec_parsing_index_fail.exp b/third_party/move/move-compiler-v2/tests/more-v1/parser/spec_parsing_index_fail.exp index 5f5f2ed570a130..c19a88eaeeacc9 100644 --- a/third_party/move/move-compiler-v2/tests/more-v1/parser/spec_parsing_index_fail.exp +++ b/third_party/move/move-compiler-v2/tests/more-v1/parser/spec_parsing_index_fail.exp @@ -1,7 +1,7 @@ Diagnostics: -error: syntax item restricted to spec contexts +error: expected `vector<_>` but found a value of type `u64` ┌─ tests/more-v1/parser/spec_parsing_index_fail.move:3:15 │ 3 │ let _ = x[1]; - │ ^^^^ `_[_]` index operator only allowed in specifications + │ ^ diff --git a/third_party/move/move-compiler-v2/tests/more-v1/parser/struct_without_fields.exp b/third_party/move/move-compiler-v2/tests/more-v1/parser/struct_without_fields.exp index 6d416b0868ed28..e9c836d29e0b7b 100644 --- a/third_party/move/move-compiler-v2/tests/more-v1/parser/struct_without_fields.exp +++ b/third_party/move/move-compiler-v2/tests/more-v1/parser/struct_without_fields.exp @@ -1,10 +1,7 @@ Diagnostics: -error: unexpected token - ┌─ tests/more-v1/parser/struct_without_fields.move:3:13 +error: invalid 'module' declaration + ┌─ tests/more-v1/parser/struct_without_fields.move:1:8 │ -3 │ struct S; - │ ^ - │ │ - │ Unexpected ';' - │ Expected '{' +1 │ module M { + │ ^ Invalid module declaration. The module does not have a specified address. Either declare it inside of an 'address
{' block or declare it with an address 'module
::M'' diff --git a/third_party/move/move-compiler-v2/tests/more-v1/parser/testonly.exp b/third_party/move/move-compiler-v2/tests/more-v1/parser/testonly.exp index a28b717bfc427b..cb4d92559c5c80 100644 --- a/third_party/move/move-compiler-v2/tests/more-v1/parser/testonly.exp +++ b/third_party/move/move-compiler-v2/tests/more-v1/parser/testonly.exp @@ -4,13 +4,13 @@ warning: unknown attribute ┌─ tests/more-v1/parser/testonly.move:5:7 │ 5 │ #[testonly] - │ ^^^^^^^^ Attribute name 'testonly' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. + │ ^^^^^^^^ Attribute name 'testonly' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "lint::skip", "native_interface", "test", "test_only", "verify_only"}'. warning: unknown attribute ┌─ tests/more-v1/parser/testonly.move:15:7 │ 15 │ #[view] - │ ^^^^ Attribute name 'view' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. + │ ^^^^ Attribute name 'view' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "lint::skip", "native_interface", "test", "test_only", "verify_only"}'. ============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/eq_bad.move b/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/eq_bad.move deleted file mode 100644 index 0ce38d3e727f75..00000000000000 --- a/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/eq_bad.move +++ /dev/null @@ -1,42 +0,0 @@ -module 0x8675309::Tester { - fun eqtest1() { - let x: u64; - let r: &mut u64; - - x = 0; - r = &mut x; - _ = copy r == copy r; - } - - fun eqtest2() { - let x: u64; - let r: &mut u64; - - x = 0; - r = &mut x; - _ = copy r == move r; - } - - fun neqtest1() { - let x: u64; - let r: &mut u64; - - x = 0; - r = &mut x; - _ = copy r != copy r; - } - - fun neqtest2() { - let x: u64; - let r: &mut u64; - - x = 0; - r = &mut x; - _ = copy r != move r; - } -} - -// check: READREF_EXISTS_MUTABLE_BORROW_ERROR -// check: READREF_EXISTS_MUTABLE_BORROW_ERROR -// check: READREF_EXISTS_MUTABLE_BORROW_ERROR -// check: READREF_EXISTS_MUTABLE_BORROW_ERROR diff --git a/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/eq_ok.move b/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/eq_ok.move deleted file mode 100644 index 5ee78d10b90b0d..00000000000000 --- a/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/eq_ok.move +++ /dev/null @@ -1,37 +0,0 @@ -module 0x8675309::Tester { - fun eqtest1() { - let x: u64; - let r: &mut u64; - - x = 0; - r = &mut x; - _ = freeze(copy r) == freeze(copy r); - } - - fun eqtest2() { - let x: u64; - let r: &mut u64; - - x = 0; - r = &mut x; - _ = freeze(copy r) == freeze(move r); - } - - fun neqtest1() { - let x: u64; - let r: &mut u64; - - x = 0; - r = &mut x; - _ = freeze(copy r) != freeze(copy r); - } - - fun neqtest2() { - let x: u64; - let r: &mut u64; - - x = 0; - r = &mut x; - _ = freeze(copy r) != freeze(move r); - } -} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/factor_valid_2.move b/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/factor_valid_2.move deleted file mode 100644 index 16192f63035574..00000000000000 --- a/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/factor_valid_2.move +++ /dev/null @@ -1,45 +0,0 @@ -module 0x8675309::M { - struct S { g: u64 } - - fun t1(root: &mut S, cond: bool) { - let x1 = 0; - let eps = if (cond) bar(root) else &x1; - let g = &root.g; - eps; - g; - eps; - } - - fun t2() { - let x1 = 0; - let x2 = 1; - let eps = foo(&x1, &x2); - baz(&x1, eps); - } - - fun t3() { - let x1 = 0; - let x2 = 1; - let eps = foo(&x1, &x2); - baz(freeze(&mut x1), eps); - } - - fun foo(a: &u64, b: &u64): &u64 { - let ret; - if (*a > *b) { - ret = move a; - move b; - } else { - ret = move b; - move a; - }; - ret - } - - fun bar(a: &mut S): &u64 { - &a.g - } - - fun baz(_a: &u64, _b: &u64) { - } -} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/imm_borrow_global_lossy_acquire_invalid.exp b/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/imm_borrow_global_lossy_acquire_invalid.exp index 72fcb63cee9c8e..88853308cc0ead 100644 --- a/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/imm_borrow_global_lossy_acquire_invalid.exp +++ b/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/imm_borrow_global_lossy_acquire_invalid.exp @@ -4,7 +4,7 @@ error: function acquires global `Tester::Pair` which is currently borrowed ┌─ tests/more-v1/translated_ir_tests/move/borrow_tests/imm_borrow_global_lossy_acquire_invalid.move:32:9 │ 29 │ let p1 = borrow_global(addr1); - │ -------------------------- previous global borrow + │ -------------------------- struct `Tester::Pair` previously borrowed here · 32 │ eq_helper(p1, addr2) │ ^^^^^^^^^^^^^^^^^^^^ function called here diff --git a/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/imm_borrow_loc_valid.move b/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/imm_borrow_loc_valid.move deleted file mode 100644 index d6ff5c07d9585c..00000000000000 --- a/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/imm_borrow_loc_valid.move +++ /dev/null @@ -1,38 +0,0 @@ -module 0x8675309::Tester { - use std::signer; - - struct Data has key { v1: u64, v2: u64 } - struct Box has key { f: u64 } - - // the resource struct is here to just give a feeling why the computation might not be reorderable - fun bump_and_pick(account: &signer, b1: &mut Box, b2: &mut Box): &u64 acquires Data { - let sender = signer::address_of(account); - let data = borrow_global_mut(sender); - b1.f = data.v1; - b2.f = data.v2; - if (b1.f > b2.f) &b1.f else &b2.f - } - - fun larger_field(account: &signer, drop: address, result: &mut u64) acquires Box, Data { - let sender = signer::address_of(account); - let b1 = move_from(sender); - let b2 = move_from(drop); - - assert!(b1.f == 0, 42); - assert!(b2.f == 0, 42); - - let returned_ref = bump_and_pick(account, &mut b1, &mut b2); - - // imagine some more interesting check than these asserts - assert!(b1.f != 0, 42); - assert!(b2.f != 0, 42); - assert!( - (returned_ref == &(&mut b1).f) != (returned_ref == &(&mut b2).f), - 42 - ); - - *result = *returned_ref; - move_to(account, b1); - Box { f: _ } = b2; - } -} diff --git a/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/mutable_borrow_local_twice_invalid.move b/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/mutable_borrow_local_twice_invalid.move deleted file mode 100644 index 6bd703e0e6d57e..00000000000000 --- a/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/mutable_borrow_local_twice_invalid.move +++ /dev/null @@ -1,11 +0,0 @@ -module 0x8675309::M { - fun t1() { - let a = 0; - let r1 = &mut a; - let r2 = &mut a; - *r2 = 2; - *r1 = 1; - } -} - -// check: WRITEREF_EXISTS_BORROW_ERROR diff --git a/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/writeref_borrow_invalid.move b/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/writeref_borrow_invalid.move deleted file mode 100644 index 39bd22c346e474..00000000000000 --- a/third_party/move/move-compiler-v2/tests/more-v1/translated_ir_tests/move/borrow_tests/writeref_borrow_invalid.move +++ /dev/null @@ -1,13 +0,0 @@ -module 0x8675309::M { - struct G has copy, drop { v: u64 } - struct S has copy, drop { g: G } - - fun t1(root: &mut S) { - let v_mut = &mut root.g.v; - let g_mut = &mut root.g; - - // INVALID - *g_mut = G { v: 0 }; - v_mut; - } -} diff --git a/third_party/move/move-compiler-v2/tests/unused-assignment/v1-locals/dont_warn_unused_self.exp b/third_party/move/move-compiler-v2/tests/unused-assignment/v1-locals/dont_warn_unused_self.exp new file mode 100644 index 00000000000000..d3c874d2060ee5 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/unused-assignment/v1-locals/dont_warn_unused_self.exp @@ -0,0 +1,7 @@ + +Diagnostics: +warning: Unused parameter `y`. Consider removing or prefixing with an underscore: `_y` + ┌─ tests/unused-assignment/v1-locals/dont_warn_unused_self.move:5:27 + │ +5 │ fun receiver(self: S, y: u64) { + │ ^ diff --git a/third_party/move/move-compiler-v2/tests/unused-assignment/v1-locals/dont_warn_unused_self.move b/third_party/move/move-compiler-v2/tests/unused-assignment/v1-locals/dont_warn_unused_self.move new file mode 100644 index 00000000000000..8c63ab010d99ef --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/unused-assignment/v1-locals/dont_warn_unused_self.move @@ -0,0 +1,11 @@ +module 0x42::m { + + struct S has drop { x: u64 } + + fun receiver(self: S, y: u64) { + } + + spec receiver(self: S, y: u64) { + requires true; + } +} diff --git a/third_party/move/move-compiler-v2/tests/v1.matched b/third_party/move/move-compiler-v2/tests/v1.matched index 788e200bbc6eb8..027e3c660055d3 100644 --- a/third_party/move/move-compiler-v2/tests/v1.matched +++ b/third_party/move/move-compiler-v2/tests/v1.matched @@ -177,6 +177,17 @@ move-compiler/tests/move_check/control_flow/for_loop_lparen_following.exp move move-compiler/tests/move_check/control_flow/for_type_mismatch.exp move-compiler-v2/tests/checking/control_flow/for_type_mismatch.exp move-compiler/tests/move_check/control_flow/infinite_loop_with_dead_exits.exp move-compiler-v2/tests/more-v1/control_flow/infinite_loop_with_dead_exits.exp move-compiler/tests/move_check/control_flow/loop_after_loop.exp move-compiler-v2/tests/checking/control_flow/loop_after_loop.exp +move-compiler/tests/move_check/dependencies/friend_cycle_2.exp move-compiler-v2/tests/more-v1/dependencies/friend_cycle_2.exp +move-compiler/tests/move_check/dependencies/friend_cycle_3.exp move-compiler-v2/tests/more-v1/dependencies/friend_cycle_3.exp +move-compiler/tests/move_check/dependencies/intersecting_friend_cycles.exp move-compiler-v2/tests/more-v1/dependencies/intersecting_friend_cycles.exp +move-compiler/tests/move_check/dependencies/intersecting_use_cycles.exp move-compiler-v2/tests/more-v1/dependencies/intersecting_use_cycles.exp +move-compiler/tests/move_check/dependencies/multiple_friend_cycles.exp move-compiler-v2/tests/more-v1/dependencies/multiple_friend_cycles.exp +move-compiler/tests/move_check/dependencies/multiple_use_cycles.exp move-compiler-v2/tests/more-v1/dependencies/multiple_use_cycles.exp +move-compiler/tests/move_check/dependencies/use_cycle_2.exp move-compiler-v2/tests/more-v1/dependencies/use_cycle_2.exp +move-compiler/tests/move_check/dependencies/use_cycle_3.exp move-compiler-v2/tests/more-v1/dependencies/use_cycle_3.exp +move-compiler/tests/move_check/dependencies/use_friend_direct.exp move-compiler-v2/tests/more-v1/dependencies/use_friend_direct.exp +move-compiler/tests/move_check/dependencies/use_friend_transitive_by_friend.exp move-compiler-v2/tests/more-v1/dependencies/use_friend_transitive_by_friend.exp +move-compiler/tests/move_check/dependencies/use_friend_transitive_by_use.exp move-compiler-v2/tests/more-v1/dependencies/use_friend_transitive_by_use.exp move-compiler/tests/move_check/deprecated/assert_function.exp move-compiler-v2/tests/deprecated/assert_function.exp move-compiler/tests/move_check/deprecated/deprecated_constant_duplicated_struct.exp move-compiler-v2/tests/deprecated/deprecated_constant_duplicated_struct.exp move-compiler/tests/move_check/deprecated/deprecated_constant_duplicated_struct2.exp move-compiler-v2/tests/deprecated/deprecated_constant_duplicated_struct2.exp @@ -192,6 +203,109 @@ move-compiler/tests/move_check/deprecated/deprecated_placement_module_members.ex move-compiler/tests/move_check/deprecated/public_script.exp move-compiler-v2/tests/deprecated/public_script.exp move-compiler/tests/move_check/examples/multi_pool_money_market_token.exp move-compiler-v2/tests/checking/typing/v1-examples/multi_pool_money_market_token.exp move-compiler/tests/move_check/examples/simple_money_market_token.exp move-compiler-v2/tests/checking/typing/v1-examples/simple_money_market_token.exp +move-compiler/tests/move_check/expansion/access_specifier_not_supported.exp move-compiler-v2/tests/more-v1/expansion/access_specifier_not_supported.exp +move-compiler/tests/move_check/expansion/address_directives.exp move-compiler-v2/tests/more-v1/expansion/address_directives.exp +move-compiler/tests/move_check/expansion/address_directives_empty.exp move-compiler-v2/tests/more-v1/expansion/address_directives_empty.exp +move-compiler/tests/move_check/expansion/almost_invalid_local_name.exp move-compiler-v2/tests/more-v1/expansion/almost_invalid_local_name.exp +move-compiler/tests/move_check/expansion/assign_non_simple_name.exp move-compiler-v2/tests/more-v1/expansion/assign_non_simple_name.exp +move-compiler/tests/move_check/expansion/constant_duplicate_struct.exp move-compiler-v2/tests/more-v1/expansion/constant_duplicate_struct.exp +move-compiler/tests/move_check/expansion/constant_invalid_alias_names.exp move-compiler-v2/tests/more-v1/expansion/constant_invalid_alias_names.exp +move-compiler/tests/move_check/expansion/constant_invalid_names.exp move-compiler-v2/tests/more-v1/expansion/constant_invalid_names.exp +move-compiler/tests/move_check/expansion/duplicate_abilities.exp move-compiler-v2/tests/more-v1/expansion/duplicate_abilities.exp +move-compiler/tests/move_check/expansion/duplicate_alias.exp move-compiler-v2/tests/more-v1/expansion/duplicate_alias.exp +move-compiler/tests/move_check/expansion/duplicate_field.exp move-compiler-v2/tests/more-v1/expansion/duplicate_field.exp +move-compiler/tests/move_check/expansion/duplicate_field_assign.exp move-compiler-v2/tests/more-v1/expansion/duplicate_field_assign.exp +move-compiler/tests/move_check/expansion/duplicate_field_pack.exp move-compiler-v2/tests/more-v1/expansion/duplicate_field_pack.exp +move-compiler/tests/move_check/expansion/duplicate_field_unpack.exp move-compiler-v2/tests/more-v1/expansion/duplicate_field_unpack.exp +move-compiler/tests/move_check/expansion/duplicate_function_in_module.exp move-compiler-v2/tests/more-v1/expansion/duplicate_function_in_module.exp +move-compiler/tests/move_check/expansion/duplicate_module.exp move-compiler-v2/tests/more-v1/expansion/duplicate_module.exp +move-compiler/tests/move_check/expansion/duplicate_module_after_mapping.exp move-compiler-v2/tests/more-v1/expansion/duplicate_module_after_mapping.exp +move-compiler/tests/move_check/expansion/duplicate_struct.exp move-compiler-v2/tests/more-v1/expansion/duplicate_struct.exp +move-compiler/tests/move_check/expansion/entry_main.exp move-compiler-v2/tests/more-v1/expansion/entry_main.exp +move-compiler/tests/move_check/expansion/friend_decl_aliased_duplicates.exp move-compiler-v2/tests/more-v1/expansion/friend_decl_aliased_duplicates.exp +move-compiler/tests/move_check/expansion/friend_decl_aliased_function.exp move-compiler-v2/tests/more-v1/expansion/friend_decl_aliased_function.exp +move-compiler/tests/move_check/expansion/friend_decl_aliased_struct.exp move-compiler-v2/tests/more-v1/expansion/friend_decl_aliased_struct.exp +move-compiler/tests/move_check/expansion/friend_decl_imported_duplicates.exp move-compiler-v2/tests/more-v1/expansion/friend_decl_imported_duplicates.exp +move-compiler/tests/move_check/expansion/friend_decl_inner_scope_alias.exp move-compiler-v2/tests/more-v1/expansion/friend_decl_inner_scope_alias.exp +move-compiler/tests/move_check/expansion/friend_decl_nonexistent_alias.exp move-compiler-v2/tests/more-v1/expansion/friend_decl_nonexistent_alias.exp +move-compiler/tests/move_check/expansion/friend_decl_qualified_duplicates.exp move-compiler-v2/tests/more-v1/expansion/friend_decl_qualified_duplicates.exp +move-compiler/tests/move_check/expansion/function_invalid_names.exp move-compiler-v2/tests/more-v1/expansion/function_invalid_names.exp +move-compiler/tests/move_check/expansion/hexstring_bad_value.exp move-compiler-v2/tests/more-v1/expansion/hexstring_bad_value.exp +move-compiler/tests/move_check/expansion/invalid_local_name.exp move-compiler-v2/tests/more-v1/expansion/invalid_local_name.exp +move-compiler/tests/move_check/expansion/invalid_spec_schema_name.exp move-compiler-v2/tests/more-v1/expansion/invalid_spec_schema_name.exp +move-compiler/tests/move_check/expansion/invalid_struct_name.exp move-compiler-v2/tests/more-v1/expansion/invalid_struct_name.exp +move-compiler/tests/move_check/expansion/invalid_unpack_assign_lhs_not_name.exp move-compiler-v2/tests/more-v1/expansion/invalid_unpack_assign_lhs_not_name.exp +move-compiler/tests/move_check/expansion/invalid_unpack_assign_lhs_other_value.exp move-compiler-v2/tests/more-v1/expansion/invalid_unpack_assign_lhs_other_value.exp +move-compiler/tests/move_check/expansion/invalid_unpack_assign_mdot_no_struct.exp move-compiler-v2/tests/more-v1/expansion/invalid_unpack_assign_mdot_no_struct.exp +move-compiler/tests/move_check/expansion/mdot_with_non_address_exp.exp move-compiler-v2/tests/more-v1/expansion/mdot_with_non_address_exp.exp +move-compiler/tests/move_check/expansion/module_alias_as_type.exp move-compiler-v2/tests/more-v1/expansion/module_alias_as_type.exp +move-compiler/tests/move_check/expansion/module_invalid_names.exp move-compiler-v2/tests/more-v1/expansion/module_invalid_names.exp +move-compiler/tests/move_check/expansion/multiple_alias.exp move-compiler-v2/tests/more-v1/expansion/multiple_alias.exp +move-compiler/tests/move_check/expansion/no_address.exp move-compiler-v2/tests/more-v1/expansion/no_address.exp +move-compiler/tests/move_check/expansion/number_literal_long.exp move-compiler-v2/tests/more-v1/expansion/number_literal_long.exp +move-compiler/tests/move_check/expansion/number_literal_too_long.exp move-compiler-v2/tests/more-v1/expansion/number_literal_too_long.exp +move-compiler/tests/move_check/expansion/number_literal_too_long_u128.exp move-compiler-v2/tests/more-v1/expansion/number_literal_too_long_u128.exp +move-compiler/tests/move_check/expansion/number_literal_too_long_u64.exp move-compiler-v2/tests/more-v1/expansion/number_literal_too_long_u64.exp +move-compiler/tests/move_check/expansion/number_literal_too_long_u8.exp move-compiler-v2/tests/more-v1/expansion/number_literal_too_long_u8.exp +move-compiler/tests/move_check/expansion/pack_all_field_cases.exp move-compiler-v2/tests/more-v1/expansion/pack_all_field_cases.exp +move-compiler/tests/move_check/expansion/pack_no_fields_block_expr.exp move-compiler-v2/tests/more-v1/expansion/pack_no_fields_block_expr.exp +move-compiler/tests/move_check/expansion/pack_no_fields_single_block_expr.exp move-compiler-v2/tests/more-v1/expansion/pack_no_fields_single_block_expr.exp +move-compiler/tests/move_check/expansion/pack_no_fields_single_block_other_expr.exp move-compiler-v2/tests/more-v1/expansion/pack_no_fields_single_block_other_expr.exp +move-compiler/tests/move_check/expansion/public_friend_main.exp move-compiler-v2/tests/more-v1/expansion/public_friend_main.exp +move-compiler/tests/move_check/expansion/public_main.exp move-compiler-v2/tests/more-v1/expansion/public_main.exp +move-compiler/tests/move_check/expansion/restricted_address_names.exp move-compiler-v2/tests/more-v1/expansion/restricted_address_names.exp +move-compiler/tests/move_check/expansion/restricted_alias_names.exp move-compiler-v2/tests/more-v1/expansion/restricted_alias_names.exp +move-compiler/tests/move_check/expansion/restricted_constant_names.exp move-compiler-v2/tests/more-v1/expansion/restricted_constant_names.exp +move-compiler/tests/move_check/expansion/restricted_function_names.exp move-compiler-v2/tests/more-v1/expansion/restricted_function_names.exp +move-compiler/tests/move_check/expansion/restricted_module_alias_names.exp move-compiler-v2/tests/more-v1/expansion/restricted_module_alias_names.exp +move-compiler/tests/move_check/expansion/restricted_module_names.exp move-compiler-v2/tests/more-v1/expansion/restricted_module_names.exp +move-compiler/tests/move_check/expansion/restricted_names_valid.exp move-compiler-v2/tests/more-v1/expansion/restricted_names_valid.exp +move-compiler/tests/move_check/expansion/restricted_struct_names.exp move-compiler-v2/tests/more-v1/expansion/restricted_struct_names.exp +move-compiler/tests/move_check/expansion/spec_block_in_spec_context.exp move-compiler-v2/tests/more-v1/expansion/spec_block_in_spec_context.exp +move-compiler/tests/move_check/expansion/spec_block_uses.exp move-compiler-v2/tests/more-v1/expansion/spec_block_uses.exp +move-compiler/tests/move_check/expansion/spec_block_uses_shadows_defines.exp move-compiler-v2/tests/more-v1/expansion/spec_block_uses_shadows_defines.exp +move-compiler/tests/move_check/expansion/spec_function_member_conflicts.exp move-compiler-v2/tests/more-v1/expansion/spec_function_member_conflicts.exp +move-compiler/tests/move_check/expansion/spec_schema_member_conflicts.exp move-compiler-v2/tests/more-v1/expansion/spec_schema_member_conflicts.exp +move-compiler/tests/move_check/expansion/standalone_fields.exp move-compiler-v2/tests/more-v1/expansion/standalone_fields.exp +move-compiler/tests/move_check/expansion/standalone_mname_with_type_args.exp move-compiler-v2/tests/more-v1/expansion/standalone_mname_with_type_args.exp +move-compiler/tests/move_check/expansion/standalone_name_with_type_args.exp move-compiler-v2/tests/more-v1/expansion/standalone_name_with_type_args.exp +move-compiler/tests/move_check/expansion/top_level_not_named_main.exp move-compiler-v2/tests/more-v1/expansion/top_level_not_named_main.exp +move-compiler/tests/move_check/expansion/type_arguments_on_field_access.exp move-compiler-v2/tests/more-v1/expansion/type_arguments_on_field_access.exp +move-compiler/tests/move_check/expansion/unbound_module_alias_in_type.exp move-compiler-v2/tests/more-v1/expansion/unbound_module_alias_in_type.exp +move-compiler/tests/move_check/expansion/unbound_named_address.exp move-compiler-v2/tests/more-v1/expansion/unbound_named_address.exp +move-compiler/tests/move_check/expansion/unpack_all_field_cases.exp move-compiler-v2/tests/more-v1/expansion/unpack_all_field_cases.exp +move-compiler/tests/move_check/expansion/unpack_assign_block_expr.exp move-compiler-v2/tests/more-v1/expansion/unpack_assign_block_expr.exp +move-compiler/tests/move_check/expansion/unpack_assign_block_single_expr.exp move-compiler-v2/tests/more-v1/expansion/unpack_assign_block_single_expr.exp +move-compiler/tests/move_check/expansion/unpack_assign_other_expr.exp move-compiler-v2/tests/more-v1/expansion/unpack_assign_other_expr.exp +move-compiler/tests/move_check/expansion/use_function.exp move-compiler-v2/tests/more-v1/expansion/use_function.exp +move-compiler/tests/move_check/expansion/use_function_overlap_with_module.exp move-compiler-v2/tests/more-v1/expansion/use_function_overlap_with_module.exp +move-compiler/tests/move_check/expansion/use_function_same_name_as_function.exp move-compiler-v2/tests/more-v1/expansion/use_function_same_name_as_function.exp +move-compiler/tests/move_check/expansion/use_function_same_name_as_struct.exp move-compiler-v2/tests/more-v1/expansion/use_function_same_name_as_struct.exp +move-compiler/tests/move_check/expansion/use_function_tparam_shadows.exp move-compiler-v2/tests/more-v1/expansion/use_function_tparam_shadows.exp +move-compiler/tests/move_check/expansion/use_function_unbound.exp move-compiler-v2/tests/more-v1/expansion/use_function_unbound.exp +move-compiler/tests/move_check/expansion/use_inner_scope.exp move-compiler-v2/tests/more-v1/expansion/use_inner_scope.exp +move-compiler/tests/move_check/expansion/use_inner_scope_duplicates.exp move-compiler-v2/tests/more-v1/expansion/use_inner_scope_duplicates.exp +move-compiler/tests/move_check/expansion/use_inner_scope_invalid.exp move-compiler-v2/tests/more-v1/expansion/use_inner_scope_invalid.exp +move-compiler/tests/move_check/expansion/use_inner_scope_shadows.exp move-compiler-v2/tests/more-v1/expansion/use_inner_scope_shadows.exp +move-compiler/tests/move_check/expansion/use_inner_scope_unbound.exp move-compiler-v2/tests/more-v1/expansion/use_inner_scope_unbound.exp +move-compiler/tests/move_check/expansion/use_inner_scope_unused.exp move-compiler-v2/tests/more-v1/expansion/use_inner_scope_unused.exp +move-compiler/tests/move_check/expansion/use_nested_self.exp move-compiler-v2/tests/more-v1/expansion/use_nested_self.exp +move-compiler/tests/move_check/expansion/use_nested_self_as.exp move-compiler-v2/tests/more-v1/expansion/use_nested_self_as.exp +move-compiler/tests/move_check/expansion/use_nested_self_as_invalid.exp move-compiler-v2/tests/more-v1/expansion/use_nested_self_as_invalid.exp +move-compiler/tests/move_check/expansion/use_nested_self_duplicate.exp move-compiler-v2/tests/more-v1/expansion/use_nested_self_duplicate.exp +move-compiler/tests/move_check/expansion/use_spec_function.exp move-compiler-v2/tests/more-v1/expansion/use_spec_function.exp +move-compiler/tests/move_check/expansion/use_spec_function_as_normal_function.exp move-compiler-v2/tests/more-v1/expansion/use_spec_function_as_normal_function.exp +move-compiler/tests/move_check/expansion/use_spec_schema.exp move-compiler-v2/tests/more-v1/expansion/use_spec_schema.exp +move-compiler/tests/move_check/expansion/use_spec_schema_as_struct.exp move-compiler-v2/tests/more-v1/expansion/use_spec_schema_as_struct.exp +move-compiler/tests/move_check/expansion/use_spec_schema_invalid_as.exp move-compiler-v2/tests/more-v1/expansion/use_spec_schema_invalid_as.exp +move-compiler/tests/move_check/expansion/use_struct.exp move-compiler-v2/tests/more-v1/expansion/use_struct.exp +move-compiler/tests/move_check/expansion/use_struct_invalid_name.exp move-compiler-v2/tests/more-v1/expansion/use_struct_invalid_name.exp +move-compiler/tests/move_check/expansion/use_struct_overlap_with_module.exp move-compiler-v2/tests/more-v1/expansion/use_struct_overlap_with_module.exp +move-compiler/tests/move_check/expansion/use_struct_same_name_as_function.exp move-compiler-v2/tests/more-v1/expansion/use_struct_same_name_as_function.exp +move-compiler/tests/move_check/expansion/use_struct_same_name_as_struct.exp move-compiler-v2/tests/more-v1/expansion/use_struct_same_name_as_struct.exp +move-compiler/tests/move_check/expansion/use_struct_tparam_shadows.exp move-compiler-v2/tests/more-v1/expansion/use_struct_tparam_shadows.exp +move-compiler/tests/move_check/expansion/use_struct_unbound.exp move-compiler-v2/tests/more-v1/expansion/use_struct_unbound.exp +move-compiler/tests/move_check/expansion/weird_apply_assign.exp move-compiler-v2/tests/more-v1/expansion/weird_apply_assign.exp move-compiler/tests/move_check/folding/empty_vectors.exp move-compiler-v2/tests/folding/empty_vectors.exp move-compiler/tests/move_check/folding/empty_vectors2.exp move-compiler-v2/tests/folding/empty_vectors2.exp move-compiler/tests/move_check/folding/non_constant_empty_vec.exp move-compiler-v2/tests/folding/non_constant_empty_vec.exp @@ -266,6 +380,7 @@ move-compiler/tests/move_check/liveness/trailing_semi_loops.exp move-compiler- move-compiler/tests/move_check/liveness/unused_assignment.exp move-compiler-v2/tests/unused-assignment/v1-liveness/unused_assignment.exp move-compiler/tests/move_check/locals/assign_partial_resource.exp move-compiler-v2/tests/unused-assignment/v1-locals/assign_partial_resource.exp move-compiler/tests/move_check/locals/assign_resource.exp move-compiler-v2/tests/unused-assignment/v1-locals/assign_resource.exp +move-compiler/tests/move_check/locals/dont_warn_unused_self.exp move-compiler-v2/tests/unused-assignment/v1-locals/dont_warn_unused_self.exp move-compiler/tests/move_check/locals/drop_conditional.exp move-compiler-v2/tests/ability-check/v1-locals/drop_conditional.exp move-compiler/tests/move_check/locals/eliminate_temps.exp move-compiler-v2/tests/reference-safety/v1-locals/eliminate_temps.exp move-compiler/tests/move_check/locals/reassign_parameter.exp move-compiler-v2/tests/ability-check/v1-locals/reassign_parameter.exp @@ -315,15 +430,16 @@ move-compiler/tests/move_check/naming/unresolved_type_with_args.exp move-compi move-compiler/tests/move_check/naming/vector_literal_type_arity.exp move-compiler-v2/tests/checking/typing/v1-naming/vector_literal_type_arity.exp move-compiler/tests/move_check/translated_ir_tests/move/operators/boolean_not_non_boolean.exp move-compiler-v2/tests/checking/typing/v1-operators/boolean_not_non_boolean.exp move-compiler/tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.exp move-compiler-v2/tests/checking/typing/v1-operators/casting_operators_types_mismatch.exp -move-compiler/tests/move_check/parser/acquires_list_generic.exp move-compiler-v2/tests/checking-lang-v1/acquires_list_generic.exp move-compiler/tests/move_check/parser/ability_constraint_trailing_plus.exp move-compiler-v2/tests/more-v1/parser/ability_constraint_trailing_plus.exp move-compiler/tests/move_check/parser/ability_modifier_trailing_comma.exp move-compiler-v2/tests/more-v1/parser/ability_modifier_trailing_comma.exp +move-compiler/tests/move_check/parser/acquires_list_generic.exp move-compiler-v2/tests/checking-lang-v1/acquires_list_generic.exp move-compiler/tests/move_check/parser/address_misspelled.exp move-compiler-v2/tests/more-v1/parser/address_misspelled.exp move-compiler/tests/move_check/parser/address_not_hex.exp move-compiler-v2/tests/more-v1/parser/address_not_hex.exp move-compiler/tests/move_check/parser/address_too_long.exp move-compiler-v2/tests/more-v1/parser/address_too_long.exp move-compiler/tests/move_check/parser/address_too_long_decimal.exp move-compiler-v2/tests/more-v1/parser/address_too_long_decimal.exp move-compiler/tests/move_check/parser/address_too_long_decimal_exp.exp move-compiler-v2/tests/more-v1/parser/address_too_long_decimal_exp.exp move-compiler/tests/move_check/parser/address_too_long_exp.exp move-compiler-v2/tests/more-v1/parser/address_too_long_exp.exp +move-compiler/tests/move_check/parser/anonymous_field_fail.exp move-compiler-v2/tests/checking-lang-v1/anonymous_field_fail.exp move-compiler/tests/move_check/parser/aptos_stdlib_attributes.exp move-compiler-v2/tests/checking/attributes/aptos_stdlib_attributes.exp move-compiler/tests/move_check/parser/aptos_stdlib_attributes2.exp move-compiler-v2/tests/checking/attributes/aptos_stdlib_attributes2.exp move-compiler/tests/move_check/parser/attribute_no_closing_bracket.exp move-compiler-v2/tests/checking/attributes/attribute_no_closing_bracket.exp @@ -354,6 +470,7 @@ move-compiler/tests/move_check/parser/control_exp_associativity_typing_invalid.e move-compiler/tests/move_check/parser/control_exp_associativity_unreachable_code.exp move-compiler-v2/tests/more-v1/parser/control_exp_associativity_unreachable_code.exp move-compiler/tests/move_check/parser/decimal_address.exp move-compiler-v2/tests/more-v1/parser/decimal_address.exp move-compiler/tests/move_check/parser/doc_comments_placement.exp move-compiler-v2/tests/more-v1/parser/doc_comments_placement.exp +move-compiler/tests/move_check/parser/dotdot_not_supported.exp move-compiler-v2/tests/checking-lang-v1/dotdot_not_supported.exp move-compiler/tests/move_check/parser/duplicate_attributes.exp move-compiler-v2/tests/checking/attributes/duplicate_attributes.exp move-compiler/tests/move_check/parser/duplicate_entry_modifier.exp move-compiler-v2/tests/more-v1/parser/duplicate_entry_modifier.exp move-compiler/tests/move_check/parser/empty_file.exp move-compiler-v2/tests/more-v1/parser/empty_file.exp @@ -450,6 +567,7 @@ move-compiler/tests/move_check/parser/num_literal_underscore_trailing.exp move move-compiler/tests/move_check/parser/phantom_param_invalid_keyword.exp move-compiler-v2/tests/more-v1/parser/phantom_param_invalid_keyword.exp move-compiler/tests/move_check/parser/phantom_param_missing_type_var.exp move-compiler-v2/tests/more-v1/parser/phantom_param_missing_type_var.exp move-compiler/tests/move_check/parser/preserve_address_syntax.exp move-compiler-v2/tests/more-v1/parser/preserve_address_syntax.exp +move-compiler/tests/move_check/parser/public_packge_visibility.exp move-compiler-v2/tests/checking-lang-v1/public_packge_visibility.exp move-compiler/tests/move_check/parser/return_in_binop.exp move-compiler-v2/tests/more-v1/parser/return_in_binop.exp move-compiler/tests/move_check/parser/spec_parsing_emits_fail.exp move-compiler-v2/tests/more-v1/parser/spec_parsing_emits_fail.exp move-compiler/tests/move_check/parser/spec_parsing_fun_type_fail.exp move-compiler-v2/tests/more-v1/parser/spec_parsing_fun_type_fail.exp diff --git a/third_party/move/move-compiler-v2/tests/v1.unmatched b/third_party/move/move-compiler-v2/tests/v1.unmatched index bd946199131635..e69de29bb2d1d6 100644 --- a/third_party/move/move-compiler-v2/tests/v1.unmatched +++ b/third_party/move/move-compiler-v2/tests/v1.unmatched @@ -1,263 +0,0 @@ -move-compiler/tests/move_check/borrow_tests/{ - borrow_global_acquires_duplicate_annotation.move, - imm_borrow_global_lossy_acquire_invalid.move, -} -move-compiler/tests/move_check/commands/{ - abort_negative_stack_size.move, - branch_assigns_then_moves.move, - break_unreachable.move, - consume_stack.move, - dead_return.move, - dead_return_local.move, - else_moves_if_doesnt.move, - if_moves_else_doesnt.move, - if_moves_no_else.move, - invalid_fallthrough2.move, - invalid_fallthrough3.move, - join_failure.move, - while_move_local.move, - while_move_local_2.move, -} -move-compiler/tests/move_check/control_flow/{ - for_loop_comment_following.move, - for_loop_lparen_following.move, - infinite_loop_with_dead_exits.move, -} -move-compiler/tests/move_check/deprecated/{ - assert_function.move, - deprecated_placement_basecase.move, -} -move-compiler/tests/move_check/liveness/{ - copy_after_move.move, - dead_refs_branch.move, - dead_refs_branch_both.move, - dead_refs_branch_both_invalid.move, - dead_refs_branch_invalid.move, - dead_refs_loop.move, - dead_refs_loop_invalid.move, - dead_refs_nested.move, - dead_refs_nested_invalid.move, - dead_refs_simple.move, - dead_refs_simple_invalid.move, - explicit_last_copy.move, - loop_weirdness.move, - move_in_infinite_loop_branched.move, - trailing_semi.move, - trailing_semi_loops.move, -} -move-compiler/tests/move_check/locals/{ - dont_warn_unused_self.move, - use_after_move_if.move, - use_after_move_if_else.move, - use_after_move_loop.move, - use_after_move_simple.move, - use_after_move_while.move, -} -move-compiler/tests/move_check/parser/{ - ability_constraint_trailing_plus.move, - ability_modifier_trailing_comma.move, - address_misspelled.move, - address_not_hex.move, - address_too_long.move, - address_too_long_decimal.move, - address_too_long_decimal_exp.move, - address_too_long_exp.move, - anonymous_field_fail.move, - break_with_value.move, - byte_string_invalid_escaped_sequence.move, - byte_string_invalid_hex.move, - byte_string_success.move, - byte_string_token_eof1.move, - byte_string_token_eof2.move, - byte_string_token_eof3.move, - comments_nested_unbalanced.move, - comments_ok.move, - comments_unbalanced.move, - constant_native.move, - constant_public.move, - constant_values.move, - constants_blocks.move, - constants_simple.move, - constants_standalone_let.move, - control_exp_as_term.move, - control_exp_associativity.move, - control_exp_associativity_else_after_if_block.move, - control_exp_associativity_field_access.move, - control_exp_associativity_typing_invalid.move, - control_exp_associativity_unreachable_code.move, - decimal_address.move, - doc_comments_placement.move, - dotdot_not_supported.move, - duplicate_entry_modifier.move, - empty_file.move, - entry_const.move, - entry_function.move, - entry_struct.move, - expr_abort_braces.move, - expr_abort_missing_value.move, - expr_if_braces.move, - expr_if_missing_parens.move, - expr_loop_braces.move, - expr_return_braces.move, - expr_return_missing_value.move, - expr_unary_negation.move, - expr_unary_ops.move, - expr_while_braces.move, - expr_while_missing_parens.move, - extra_text_after_main.move, - friend_decl_address_only.move, - friend_decl_inside_function.move, - friend_decl_missing_semicolon.move, - friend_decl_more_than_one_module.move, - friend_decl_qualified_function.move, - friend_decl_qualified_struct.move, - friend_decl_valid.move, - function_acquires_bad_name.move, - function_acquires_missing_comma.move, - function_acquires_trailing_comma.move, - function_incomplete.move, - function_native_with_body.move, - function_params_commas.move, - function_params_missing.move, - function_public_native.move, - function_return_trailing_comma.move, - function_return_type.move, - function_return_type_missing.move, - function_type_empty.move, - function_type_extra_comma.move, - function_type_missing_angle.move, - function_type_nested.move, - function_type_trailing_comma.move, - function_visibility_empty.move, - function_visibility_friend.move, - function_visibility_invalid.move, - function_visibility_multiple.move, - function_visibility_script.move, - function_without_body.move, - global_access.move, - global_access_pack.move, - global_access_value.move, - hexstring.move, - hexstring_missing_quote.move, - hexstring_token_eof1.move, - hexstring_token_eof2.move, - invalid_call_lhs_complex_expression.move, - invalid_call_lhs_parens_around_name.move, - invalid_call_lhs_return.move, - invalid_call_lhs_value.move, - invalid_character.move, - invalid_character_comment.move, - invalid_character_non_ascii.move, - invalid_named_address_assignment.move, - invalid_named_address_declaration.move, - invalid_pack_mname_non_addr.move, - invalid_unpack_assign_lhs_mdot_no_addr.move, - invalid_unpack_assign_rhs_not_fields.move, - lambda_no_param.move, - less_than_space.move, - let_binding.move, - let_binding_bad_name.move, - let_binding_missing_fields.move, - let_binding_missing_paren.move, - let_binding_missing_semicolon.move, - let_binding_missing_type.move, - let_binding_trailing_comma.move, - missing_angle_brace_close.move, - module_missing_lbrace.move, - module_missing_rbrace.move, - module_struct_after_func.move, - module_use_after_func.move, - module_use_after_struct.move, - named_address.move, - named_address_value.move, - native_main.move, - newline_crlf.move, - not_doc_comment.move, - num_hex_literal_underscore_leading.move, - num_hex_literal_underscore_leading_no_type_suffix.move, - num_hex_literal_underscore_trailing.move, - num_literal_underscore.move, - num_literal_underscore_leading.move, - num_literal_underscore_leading_no_type_suffix.move, - num_literal_underscore_trailing.move, - phantom_param_invalid_keyword.move, - phantom_param_missing_type_var.move, - preserve_address_syntax.move, - public_packge_visibility.move, - return_in_binop.move, - spec_parsing_emits_fail.move, - spec_parsing_fun_type_fail.move, - spec_parsing_generic_condition_fail.move, - spec_parsing_implies_fail.move, - spec_parsing_index_fail.move, - spec_parsing_inside_fun.move, - spec_parsing_ok.move, - spec_parsing_old_fun_fail.move, - spec_parsing_quantifier_fail.move, - spec_parsing_range_fail.move, - struct_field_missing_type.move, - struct_missing_lbrace.move, - struct_native_missing_semicolon.move, - struct_native_with_fields.move, - struct_public.move, - struct_trailing_comma.move, - struct_type_empty.move, - struct_type_extra_comma.move, - struct_type_missing_angle.move, - struct_type_misspelled_copy_constraint.move, - struct_type_misspelled_key_constraint.move, - struct_type_trailing_comma.move, - struct_without_fields.move, - testonly.move, - unexpected_token_after_ability_function_constraint.move, - unexpected_token_after_ability_modifier.move, - unknown_ability_name_function_constraint.move, - unknown_ability_name_modifier.move, - use_inner_scope.move, - use_inner_scope_invalid.move, - use_inner_scope_invalid_inner.move, - use_module_member.move, - use_module_member_invalid_comma.move, - use_module_member_invalid_missing_close_brace.move, - use_module_member_invalid_missing_semicolon.move, - use_with_address.move, - use_with_main.move, - use_with_module.move, - vector_literal_unclosed_args.move, - vector_literal_unclosed_type_args.move, - vector_space_after_less.move, -} -move-compiler/tests/move_check/signer/{ - double_signer.move, - keyword.move, - misplaced_signer_arg.move, - move_to_mutable_signer.move, - move_to_sender.move, - move_to_valid.move, - st_loc.move, - st_loc_partial.move, - transitive.move, - triple_signer.move, - unused.move, - unused_partial.move, - write_ref.move, -} -move-compiler/tests/move_check/simplifier/{ - moved_var_not_simplified3.move, -} -move-compiler/tests/move_check/to_bytecode/{ - unassigned_address.move, -} -move-compiler/tests/move_check/typing/{ - abort_any_type.move, - borrow_divergent.move, - constraints_not_satisfied_lvalues_bind_type.move, - constraints_not_satisfied_type_annotation.move, - constraints_not_satisfied_type_arguments_internal_pack.move, - declare_pop_resource.move, - non_phantom_in_phantom_pos.move, - unused_non_phantom_param.move, -} -move-compiler/tests/move_check/v2-not-supported/{ - no_receiver_calls.move, -} diff --git a/third_party/move/move-compiler-v2/tools/testdiff/src/main.rs b/third_party/move/move-compiler-v2/tools/testdiff/src/main.rs index 717ddf26e62c53..bc201602b28c41 100644 --- a/third_party/move/move-compiler-v2/tools/testdiff/src/main.rs +++ b/third_party/move/move-compiler-v2/tools/testdiff/src/main.rs @@ -57,10 +57,8 @@ const V2_E2E_ROOT: &str = "move-compiler-v2/transactional-tests/tests"; /// Ignored directories in the move_check tree. static IGNORED_UNIT_PATHS: Lazy> = Lazy::new(|| { let mut set = BTreeSet::new(); - set.insert("expansion".to_string()); set.insert("evm".to_string()); set.insert("async".to_string()); - set.insert("dependencies".to_string()); set });