diff --git a/Cargo.lock b/Cargo.lock index e5d00e35adce9..dc50d60ec0552 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7734,6 +7734,7 @@ dependencies = [ "codespan-reporting", "dunce", "hex", + "insta", "lsp-types", "move-binary-format", "move-borrow-graph", diff --git a/external-crates/move/Cargo.lock b/external-crates/move/Cargo.lock index 9ce38f4ee41c5..cb4ca97d92068 100644 --- a/external-crates/move/Cargo.lock +++ b/external-crates/move/Cargo.lock @@ -1870,6 +1870,7 @@ dependencies = [ "datatest-stable", "dunce", "hex", + "insta", "lsp-types", "move-binary-format", "move-borrow-graph", diff --git a/external-crates/move/crates/move-command-line-common/src/testing.rs b/external-crates/move/crates/move-command-line-common/src/testing.rs index 620dd78c2260c..5dd535d5989bb 100644 --- a/external-crates/move/crates/move-command-line-common/src/testing.rs +++ b/external-crates/move/crates/move-command-line-common/src/testing.rs @@ -148,7 +148,7 @@ macro_rules! insta_assert { settings.set_input_file(&i); settings.set_snapshot_path(i.parent().unwrap()); if let Some(info) = info { - settings.set_info(info); + settings.set_info(&info); } if let Some(suffix) = suffix { settings.set_snapshot_suffix(suffix); diff --git a/external-crates/move/crates/move-compiler/Cargo.toml b/external-crates/move/crates/move-compiler/Cargo.toml index b5c70b962a5ba..694856ac4470b 100644 --- a/external-crates/move/crates/move-compiler/Cargo.toml +++ b/external-crates/move/crates/move-compiler/Cargo.toml @@ -24,7 +24,7 @@ serde_json.workspace = true similar.workspace = true stacker.workspace = true vfs.workspace = true - +insta.workspace = true bcs.workspace = true diff --git a/external-crates/move/crates/move-compiler/tests/linter/correct_constant_naming.snap b/external-crates/move/crates/move-compiler/tests/linter/correct_constant_naming.snap new file mode 100644 index 0000000000000..d940536258f3b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/correct_constant_naming.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/correct_constant_naming.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/correct_redundant_ref_deref.snap b/external-crates/move/crates/move-compiler/tests/linter/correct_redundant_ref_deref.snap new file mode 100644 index 0000000000000..a8803dd5ea3c6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/correct_redundant_ref_deref.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/correct_redundant_ref_deref.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/false_negative_combinable_comparisons.snap b/external-crates/move/crates/move-compiler/tests/linter/false_negative_combinable_comparisons.snap new file mode 100644 index 0000000000000..78110a64ce6b6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/false_negative_combinable_comparisons.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/false_negative_combinable_comparisons.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/false_negative_equal_operands.snap b/external-crates/move/crates/move-compiler/tests/linter/false_negative_equal_operands.snap new file mode 100644 index 0000000000000..e02fe300ba630 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/false_negative_equal_operands.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/false_negative_equal_operands.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/false_negative_loop_without_exit.snap b/external-crates/move/crates/move-compiler/tests/linter/false_negative_loop_without_exit.snap new file mode 100644 index 0000000000000..49888c2b6af1f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/false_negative_loop_without_exit.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/false_negative_loop_without_exit.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/false_negative_meaningless_math_operation.snap b/external-crates/move/crates/move-compiler/tests/linter/false_negative_meaningless_math_operation.snap new file mode 100644 index 0000000000000..0c9ba396e9399 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/false_negative_meaningless_math_operation.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/false_negative_meaningless_math_operation.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/false_negative_self_assigment.snap b/external-crates/move/crates/move-compiler/tests/linter/false_negative_self_assigment.snap new file mode 100644 index 0000000000000..1100f60d666f2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/false_negative_self_assigment.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/false_negative_self_assigment.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/false_negative_unnecessary_conditional.snap b/external-crates/move/crates/move-compiler/tests/linter/false_negative_unnecessary_conditional.snap new file mode 100644 index 0000000000000..090b878c213df --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/false_negative_unnecessary_conditional.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/false_negative_unnecessary_conditional.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/false_negative_unnecessary_while_loop.snap b/external-crates/move/crates/move-compiler/tests/linter/false_negative_unnecessary_while_loop.snap new file mode 100644 index 0000000000000..5ed89aa0ed032 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/false_negative_unnecessary_while_loop.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/false_negative_unnecessary_while_loop.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/incorrect_constant_naming.exp b/external-crates/move/crates/move-compiler/tests/linter/incorrect_constant_naming.exp deleted file mode 100644 index 944dd5bdad57f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/incorrect_constant_naming.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[Lint W04001]: constant should follow naming convention - ┌─ tests/linter/incorrect_constant_naming.move:3:5 - │ -3 │ const Another_BadName: u64 = 42; // Should trigger a warning - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 'Another_BadName' should be ALL_CAPS. Or for error constants, use PascalCase - │ - = This warning can be suppressed with '#[allow(lint(constant_naming))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04001]: constant should follow naming convention - ┌─ tests/linter/incorrect_constant_naming.move:4:5 - │ -4 │ const JSON_Max_Size: u64 = 1048576; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 'JSON_Max_Size' should be ALL_CAPS. Or for error constants, use PascalCase - │ - = This warning can be suppressed with '#[allow(lint(constant_naming))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/incorrect_constant_naming.snap b/external-crates/move/crates/move-compiler/tests/linter/incorrect_constant_naming.snap new file mode 100644 index 0000000000000..9a6d24148a2b9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/incorrect_constant_naming.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/incorrect_constant_naming.move +--- +warning[Lint W04001]: constant should follow naming convention + ┌─ tests/linter/incorrect_constant_naming.move:3:5 + │ +3 │ const Another_BadName: u64 = 42; // Should trigger a warning + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 'Another_BadName' should be ALL_CAPS. Or for error constants, use PascalCase + │ + = This warning can be suppressed with '#[allow(lint(constant_naming))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04001]: constant should follow naming convention + ┌─ tests/linter/incorrect_constant_naming.move:4:5 + │ +4 │ const JSON_Max_Size: u64 = 1048576; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 'JSON_Max_Size' should be ALL_CAPS. Or for error constants, use PascalCase + │ + = This warning can be suppressed with '#[allow(lint(constant_naming))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/linter/incorrect_redundant_ref_deref.exp b/external-crates/move/crates/move-compiler/tests/linter/incorrect_redundant_ref_deref.exp deleted file mode 100644 index 553be5f47cb10..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/incorrect_redundant_ref_deref.exp +++ /dev/null @@ -1,172 +0,0 @@ -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/incorrect_redundant_ref_deref.move:10:21 - │ -10 │ let _ref = &*(&resource); // Redundant borrow-dereference - │ ^^^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/incorrect_redundant_ref_deref.move:15:25 - │ -15 │ let _ref = &mut *(&mut resource); // Redundant mutable borrow-dereference - │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/incorrect_redundant_ref_deref.move:20:22 - │ -20 │ let _value = *(&resource.value); // Redundant dereference of field borrow - │ ^^^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/incorrect_redundant_ref_deref.move:57:21 - │ -57 │ let _ref = &*(&*(&resource)); // Triple nested borrow-dereference, might be missed - │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/incorrect_redundant_ref_deref.move:57:24 - │ -57 │ let _ref = &*(&*(&resource)); // Triple nested borrow-dereference, might be missed - │ ^^^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04010]: cannot infer type - ┌─ tests/linter/incorrect_redundant_ref_deref.move:68:13 - │ -68 │ let _value = *((&resource).value); // Complex expression, might be missed - │ ^^^^^^ Could not infer this type. Try adding an annotation - -error[E04007]: incompatible types - ┌─ tests/linter/incorrect_redundant_ref_deref.move:68:22 - │ - 3 │ value: u64, - │ --- Given: 'u64' - · -68 │ let _value = *((&resource).value); // Complex expression, might be missed - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid dereference. - │ Expected: '&_' - -error[E04010]: cannot infer type - ┌─ tests/linter/incorrect_redundant_ref_deref.move:68:22 - │ -68 │ let _value = *((&resource).value); // Complex expression, might be missed - │ ^^^^^^^^^^^^^^^^^^^^ Could not infer this type. Try adding an annotation - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/incorrect_redundant_ref_deref.move:75:21 - │ -75 │ let _ref = &*&resource.value; // Redundant borrow-dereference on field - │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/incorrect_redundant_ref_deref.move:80:21 - │ -80 │ let _ref = &*&(&resource).value; // Nested redundant borrow-dereference on field - │ ^^^^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/incorrect_redundant_ref_deref.move:86:21 - │ -86 │ let _ref = &*&0; // Redundant borrow-dereference on literal - │ ^^^ Redundant borrow-dereference detected. Remove this borrow-deref and use the expression directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/incorrect_redundant_ref_deref.move:94:21 - │ -94 │ let _ref = &*&get_resource(); // Redundant borrow-dereference on function call result - │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Remove this borrow-deref and use the expression directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/incorrect_redundant_ref_deref.move:107:21 - │ -107 │ let _ref = &*&(&*&resource.value); // Multiple redundant borrows on field - │ ^^^^^^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04004]: expected a single non-reference type - ┌─ tests/linter/incorrect_redundant_ref_deref.move:107:22 - │ -107 │ let _ref = &*&(&*&resource.value); // Multiple redundant borrows on field - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&u64' - │ Invalid borrow - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/incorrect_redundant_ref_deref.move:107:25 - │ -107 │ let _ref = &*&(&*&resource.value); // Multiple redundant borrows on field - │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/linter/incorrect_redundant_ref_deref.move:111:13 - │ -111 │ let mut resource = MyResource { value: 10 }; - │ ^^^ Unused local variable 'mut'. Consider removing or prefixing with an underscore: '_mut' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01002]: unexpected token - ┌─ tests/linter/incorrect_redundant_ref_deref.move:111:17 - │ -111 │ let mut resource = MyResource { value: 10 }; - │ ^^^^^^^^ - │ │ - │ Unexpected 'resource' - │ Expected ';' - -error[E04010]: cannot infer type - ┌─ tests/linter/incorrect_redundant_ref_deref.move:112:21 - │ -112 │ let _ref = &*&mut *&resource; // Mixed mutable and immutable redundant borrows - │ ^^^^^^^^^^^^^^^^ Could not infer this type. Try adding an annotation - -error[E04010]: cannot infer type - ┌─ tests/linter/incorrect_redundant_ref_deref.move:112:27 - │ -112 │ let _ref = &*&mut *&resource; // Mixed mutable and immutable redundant borrows - │ ^^^^^^^^^^ Could not infer this type. Try adding an annotation - -error[E03009]: unbound variable - ┌─ tests/linter/incorrect_redundant_ref_deref.move:112:29 - │ -112 │ let _ref = &*&mut *&resource; // Mixed mutable and immutable redundant borrows - │ ^^^^^^^^ Unbound variable 'resource' - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/incorrect_redundant_ref_deref.move:117:25 - │ -117 │ let _value = *&(*&resource.value + 1); // Redundant borrows in complex expression - │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/incorrect_redundant_ref_deref.move:124:21 - │ -124 │ let _ref = &*(&resource.value); // Complex nested borrow on field, might be missed - │ ^^^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/incorrect_redundant_ref_deref.snap b/external-crates/move/crates/move-compiler/tests/linter/incorrect_redundant_ref_deref.snap new file mode 100644 index 0000000000000..b49321762f353 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/incorrect_redundant_ref_deref.snap @@ -0,0 +1,179 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/incorrect_redundant_ref_deref.move +--- +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/incorrect_redundant_ref_deref.move:10:21 + │ +10 │ let _ref = &*(&resource); // Redundant borrow-dereference + │ ^^^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/incorrect_redundant_ref_deref.move:15:25 + │ +15 │ let _ref = &mut *(&mut resource); // Redundant mutable borrow-dereference + │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/incorrect_redundant_ref_deref.move:20:22 + │ +20 │ let _value = *(&resource.value); // Redundant dereference of field borrow + │ ^^^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/incorrect_redundant_ref_deref.move:57:21 + │ +57 │ let _ref = &*(&*(&resource)); // Triple nested borrow-dereference, might be missed + │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/incorrect_redundant_ref_deref.move:57:24 + │ +57 │ let _ref = &*(&*(&resource)); // Triple nested borrow-dereference, might be missed + │ ^^^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04010]: cannot infer type + ┌─ tests/linter/incorrect_redundant_ref_deref.move:68:13 + │ +68 │ let _value = *((&resource).value); // Complex expression, might be missed + │ ^^^^^^ Could not infer this type. Try adding an annotation + +error[E04007]: incompatible types + ┌─ tests/linter/incorrect_redundant_ref_deref.move:68:22 + │ + 3 │ value: u64, + │ --- Given: 'u64' + · +68 │ let _value = *((&resource).value); // Complex expression, might be missed + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid dereference. + │ Expected: '&_' + +error[E04010]: cannot infer type + ┌─ tests/linter/incorrect_redundant_ref_deref.move:68:22 + │ +68 │ let _value = *((&resource).value); // Complex expression, might be missed + │ ^^^^^^^^^^^^^^^^^^^^ Could not infer this type. Try adding an annotation + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/incorrect_redundant_ref_deref.move:75:21 + │ +75 │ let _ref = &*&resource.value; // Redundant borrow-dereference on field + │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/incorrect_redundant_ref_deref.move:80:21 + │ +80 │ let _ref = &*&(&resource).value; // Nested redundant borrow-dereference on field + │ ^^^^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/incorrect_redundant_ref_deref.move:86:21 + │ +86 │ let _ref = &*&0; // Redundant borrow-dereference on literal + │ ^^^ Redundant borrow-dereference detected. Remove this borrow-deref and use the expression directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/incorrect_redundant_ref_deref.move:94:21 + │ +94 │ let _ref = &*&get_resource(); // Redundant borrow-dereference on function call result + │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Remove this borrow-deref and use the expression directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/incorrect_redundant_ref_deref.move:107:21 + │ +107 │ let _ref = &*&(&*&resource.value); // Multiple redundant borrows on field + │ ^^^^^^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04004]: expected a single non-reference type + ┌─ tests/linter/incorrect_redundant_ref_deref.move:107:22 + │ +107 │ let _ref = &*&(&*&resource.value); // Multiple redundant borrows on field + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&u64' + │ Invalid borrow + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/incorrect_redundant_ref_deref.move:107:25 + │ +107 │ let _ref = &*&(&*&resource.value); // Multiple redundant borrows on field + │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/linter/incorrect_redundant_ref_deref.move:111:13 + │ +111 │ let mut resource = MyResource { value: 10 }; + │ ^^^ Unused local variable 'mut'. Consider removing or prefixing with an underscore: '_mut' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01002]: unexpected token + ┌─ tests/linter/incorrect_redundant_ref_deref.move:111:17 + │ +111 │ let mut resource = MyResource { value: 10 }; + │ ^^^^^^^^ + │ │ + │ Unexpected 'resource' + │ Expected ';' + +error[E04010]: cannot infer type + ┌─ tests/linter/incorrect_redundant_ref_deref.move:112:21 + │ +112 │ let _ref = &*&mut *&resource; // Mixed mutable and immutable redundant borrows + │ ^^^^^^^^^^^^^^^^ Could not infer this type. Try adding an annotation + +error[E04010]: cannot infer type + ┌─ tests/linter/incorrect_redundant_ref_deref.move:112:27 + │ +112 │ let _ref = &*&mut *&resource; // Mixed mutable and immutable redundant borrows + │ ^^^^^^^^^^ Could not infer this type. Try adding an annotation + +error[E03009]: unbound variable + ┌─ tests/linter/incorrect_redundant_ref_deref.move:112:29 + │ +112 │ let _ref = &*&mut *&resource; // Mixed mutable and immutable redundant borrows + │ ^^^^^^^^ Unbound variable 'resource' + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/incorrect_redundant_ref_deref.move:117:25 + │ +117 │ let _value = *&(*&resource.value + 1); // Redundant borrows in complex expression + │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/incorrect_redundant_ref_deref.move:124:21 + │ +124 │ let _ref = &*(&resource.value); // Complex nested borrow on field, might be missed + │ ^^^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/linter/move_2024/allowed_unneeded_return.snap b/external-crates/move/crates/move-compiler/tests/linter/move_2024/allowed_unneeded_return.snap new file mode 100644 index 0000000000000..f69463f385171 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/move_2024/allowed_unneeded_return.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: true +input_file: crates/move-compiler/tests/linter/move_2024/allowed_unneeded_return.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/move_2024/false_negative_equal_operands.snap b/external-crates/move/crates/move-compiler/tests/linter/move_2024/false_negative_equal_operands.snap new file mode 100644 index 0000000000000..89fda4f44396b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/move_2024/false_negative_equal_operands.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: true +input_file: crates/move-compiler/tests/linter/move_2024/false_negative_equal_operands.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_complex.exp b/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_complex.exp deleted file mode 100644 index d82ebd52f6441..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_complex.exp +++ /dev/null @@ -1,72 +0,0 @@ -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_complex.move:10:17 - │ -10 │ let _ref = &*&0; // Redundant borrow-dereference on literal - │ ^^^ Redundant borrow-dereference detected. Remove this borrow-deref and use the expression directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_complex.move:18:17 - │ -18 │ let _ref = &*&get_resource(); // Redundant borrow-dereference on function call result - │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Remove this borrow-deref and use the expression directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_complex.move:27:17 - │ -27 │ let _ref = &*(&*&resource.a); // Multiple redundant borrows on field - │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_complex.move:27:20 - │ -27 │ let _ref = &*(&*&resource.a); // Multiple redundant borrows on field - │ ^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_complex.move:32:18 - │ -32 │ let _ref = &(copy resource.a); // Multiple redundant borrows on field - │ ^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_complex.move:37:17 - │ -37 │ let _ref = &*&mut *&resource; // Mixed mutable and immutable redundant borrows - │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_complex.move:37:23 - │ -37 │ let _ref = &*&mut *&resource; // Mixed mutable and immutable redundant borrows - │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_complex.move:47:17 - │ -47 │ let _a = *&(*&resource.a + 1); // Redundant borrows in complex expression - │ ^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_complex.move:52:15 - │ -52 │ let _a = (copy resource.a) + 1; // Redundant borrows in complex expression - │ ^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_complex.snap b/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_complex.snap new file mode 100644 index 0000000000000..b9e8280d8aaeb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_complex.snap @@ -0,0 +1,79 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: true +input_file: crates/move-compiler/tests/linter/move_2024/ref_deref_complex.move +--- +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_complex.move:10:17 + │ +10 │ let _ref = &*&0; // Redundant borrow-dereference on literal + │ ^^^ Redundant borrow-dereference detected. Remove this borrow-deref and use the expression directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_complex.move:18:17 + │ +18 │ let _ref = &*&get_resource(); // Redundant borrow-dereference on function call result + │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Remove this borrow-deref and use the expression directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_complex.move:27:17 + │ +27 │ let _ref = &*(&*&resource.a); // Multiple redundant borrows on field + │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_complex.move:27:20 + │ +27 │ let _ref = &*(&*&resource.a); // Multiple redundant borrows on field + │ ^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_complex.move:32:18 + │ +32 │ let _ref = &(copy resource.a); // Multiple redundant borrows on field + │ ^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_complex.move:37:17 + │ +37 │ let _ref = &*&mut *&resource; // Mixed mutable and immutable redundant borrows + │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_complex.move:37:23 + │ +37 │ let _ref = &*&mut *&resource; // Mixed mutable and immutable redundant borrows + │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_complex.move:47:17 + │ +47 │ let _a = *&(*&resource.a + 1); // Redundant borrows in complex expression + │ ^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_complex.move:52:15 + │ +52 │ let _a = (copy resource.a) + 1; // Redundant borrows in complex expression + │ ^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_conditional.exp b/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_conditional.exp deleted file mode 100644 index 1be49356b88ea..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_conditional.exp +++ /dev/null @@ -1,113 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/linter/move_2024/ref_deref_conditional.move:3:1 - │ -3 │ struct MyResource has copy, drop { - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_conditional.move:10:17 - │ -10 │ let _ref = &*&resource; // Should be flagged - │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_conditional.move:16:21 - │ -16 │ let _ref = &mut *&resource; // Should be flagged - │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_conditional.move:22:17 - │ -22 │ let _ref = &*&resource.value; // Should be flagged - │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04024]: invalid usage of immutable variable - ┌─ tests/linter/move_2024/ref_deref_conditional.move:30:5 - │ -28 │ let resource = MyResource { value: 10 }; - │ -------- To use the variable mutably, it must be declared 'mut', e.g. 'mut resource' -29 │ let ref1 = &resource; -30 │ resource.value = 20; // Modifying the resource - │ ^^^^^^^^^^^^^^ Invalid mutable borrow of immutable variable 'resource' - -error[E07002]: mutable ownership violated - ┌─ tests/linter/move_2024/ref_deref_conditional.move:30:5 - │ -29 │ let ref1 = &resource; - │ --------- It is still being borrowed by this reference -30 │ resource.value = 20; // Modifying the resource - │ ^^^^^^^^^^^^^^ Invalid mutable borrow at field 'value'. - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_conditional.move:37:17 - │ -37 │ let _ref = &*(&*&resource); // Should be flagged - │ ^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_conditional.move:37:20 - │ -37 │ let _ref = &*(&*&resource); // Should be flagged - │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_conditional.move:50:17 - │ -50 │ let _copy = *&resource; // Should be flagged, making a copy - │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_conditional.move:59:17 - │ -59 │ let _ref = &*&get_resource(); // Should be flagged - │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Remove this borrow-deref and use the expression directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_conditional.move:64:17 - │ -64 │ let _ref = &*&0; // Should be flagged - │ ^^^ Redundant borrow-dereference detected. Remove this borrow-deref and use the expression directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_conditional.move:72:21 - │ -72 │ let _ref = &*&resource; // Should be flagged regardless - │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_conditional.move:83:17 - │ -83 │ let _ref = &*&E; // Should be flagged - │ ^^^ Redundant borrow-dereference detected. Remove this borrow-deref and use the expression directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_conditional.move:88:17 - │ -88 │ let _ref = &*&vector[1,2,3]; // Should be flagged - │ ^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Remove this borrow-deref and use the expression directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_conditional.snap b/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_conditional.snap new file mode 100644 index 0000000000000..198799d241b15 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_conditional.snap @@ -0,0 +1,120 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: true +input_file: crates/move-compiler/tests/linter/move_2024/ref_deref_conditional.move +--- +error[E01003]: invalid modifier + ┌─ tests/linter/move_2024/ref_deref_conditional.move:3:1 + │ +3 │ struct MyResource has copy, drop { + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_conditional.move:10:17 + │ +10 │ let _ref = &*&resource; // Should be flagged + │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_conditional.move:16:21 + │ +16 │ let _ref = &mut *&resource; // Should be flagged + │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_conditional.move:22:17 + │ +22 │ let _ref = &*&resource.value; // Should be flagged + │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04024]: invalid usage of immutable variable + ┌─ tests/linter/move_2024/ref_deref_conditional.move:30:5 + │ +28 │ let resource = MyResource { value: 10 }; + │ -------- To use the variable mutably, it must be declared 'mut', e.g. 'mut resource' +29 │ let ref1 = &resource; +30 │ resource.value = 20; // Modifying the resource + │ ^^^^^^^^^^^^^^ Invalid mutable borrow of immutable variable 'resource' + +error[E07002]: mutable ownership violated + ┌─ tests/linter/move_2024/ref_deref_conditional.move:30:5 + │ +29 │ let ref1 = &resource; + │ --------- It is still being borrowed by this reference +30 │ resource.value = 20; // Modifying the resource + │ ^^^^^^^^^^^^^^ Invalid mutable borrow at field 'value'. + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_conditional.move:37:17 + │ +37 │ let _ref = &*(&*&resource); // Should be flagged + │ ^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_conditional.move:37:20 + │ +37 │ let _ref = &*(&*&resource); // Should be flagged + │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_conditional.move:50:17 + │ +50 │ let _copy = *&resource; // Should be flagged, making a copy + │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_conditional.move:59:17 + │ +59 │ let _ref = &*&get_resource(); // Should be flagged + │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Remove this borrow-deref and use the expression directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_conditional.move:64:17 + │ +64 │ let _ref = &*&0; // Should be flagged + │ ^^^ Redundant borrow-dereference detected. Remove this borrow-deref and use the expression directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_conditional.move:72:21 + │ +72 │ let _ref = &*&resource; // Should be flagged regardless + │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_conditional.move:83:17 + │ +83 │ let _ref = &*&E; // Should be flagged + │ ^^^ Redundant borrow-dereference detected. Remove this borrow-deref and use the expression directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_conditional.move:88:17 + │ +88 │ let _ref = &*&vector[1,2,3]; // Should be flagged + │ ^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Remove this borrow-deref and use the expression directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_conditional_valid.snap b/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_conditional_valid.snap new file mode 100644 index 0000000000000..da79b4bcd4365 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_conditional_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: true +input_file: crates/move-compiler/tests/linter/move_2024/ref_deref_conditional_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_fields.exp b/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_fields.exp deleted file mode 100644 index a2eb4c408d1fb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_fields.exp +++ /dev/null @@ -1,80 +0,0 @@ -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_fields.move:26:21 - │ -26 │ let _value: T = *&((&s).value); // Complex field expression - │ ^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_fields.move:36:17 - │ -36 │ let _ref = &*(&*(&resource)); // Triple nested borrow-dereference, might be missed - │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_fields.move:36:20 - │ -36 │ let _ref = &*(&*(&resource)); // Triple nested borrow-dereference, might be missed - │ ^^^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_fields.move:44:21 - │ -44 │ let _value: T = *&(copy s.value); // Complex field expression - │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_fields.move:44:24 - │ -44 │ let _value: T = *&(copy s.value); // Complex field expression - │ ^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_fields.move:49:22 - │ -49 │ let _value: T = copy s.value; // Complex field expression -- bad copy - │ ^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_fields.move:53:22 - │ -53 │ let _value: T = copy s.value; // Complex field expression -- bad copy - │ ^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_fields.move:58:17 - │ -58 │ let _ref = &*(&resource.value); // Complex nested borrow on field - │ ^^^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_fields.move:65:17 - │ -65 │ let _ref = &*&resource.value; // Direct, redundant borrow-dereference on field - │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/move_2024/ref_deref_fields.move:70:17 - │ -70 │ let _ref = &*&(&resource).value; // Nested redundant borrow-dereference on field - │ ^^^^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_fields.snap b/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_fields.snap new file mode 100644 index 0000000000000..db96b788e0b7a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_fields.snap @@ -0,0 +1,87 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: true +input_file: crates/move-compiler/tests/linter/move_2024/ref_deref_fields.move +--- +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_fields.move:26:21 + │ +26 │ let _value: T = *&((&s).value); // Complex field expression + │ ^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_fields.move:36:17 + │ +36 │ let _ref = &*(&*(&resource)); // Triple nested borrow-dereference, might be missed + │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_fields.move:36:20 + │ +36 │ let _ref = &*(&*(&resource)); // Triple nested borrow-dereference, might be missed + │ ^^^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_fields.move:44:21 + │ +44 │ let _value: T = *&(copy s.value); // Complex field expression + │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_fields.move:44:24 + │ +44 │ let _value: T = *&(copy s.value); // Complex field expression + │ ^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_fields.move:49:22 + │ +49 │ let _value: T = copy s.value; // Complex field expression -- bad copy + │ ^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_fields.move:53:22 + │ +53 │ let _value: T = copy s.value; // Complex field expression -- bad copy + │ ^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_fields.move:58:17 + │ +58 │ let _ref = &*(&resource.value); // Complex nested borrow on field + │ ^^^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_fields.move:65:17 + │ +65 │ let _ref = &*&resource.value; // Direct, redundant borrow-dereference on field + │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/move_2024/ref_deref_fields.move:70:17 + │ +70 │ let _ref = &*&(&resource).value; // Nested redundant borrow-dereference on field + │ ^^^^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_fields_valid.snap b/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_fields_valid.snap new file mode 100644 index 0000000000000..ab3a9c9f37bff --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/move_2024/ref_deref_fields_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: true +input_file: crates/move-compiler/tests/linter/move_2024/ref_deref_fields_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/move_2024/unneeded_return.exp b/external-crates/move/crates/move-compiler/tests/linter/move_2024/unneeded_return.exp deleted file mode 100644 index db1ca33d2845c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/move_2024/unneeded_return.exp +++ /dev/null @@ -1,137 +0,0 @@ -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return.move:3:17 - │ -3 │ fun t0(): u64 { return 5 } - │ ^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return.move:5:17 - │ -5 │ fun t1(): u64 { return t0() } - │ ^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return.move:9:15 - │ -9 │ fun t2(): S { return S { } } - │ ^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return.move:13:15 - │ -13 │ fun t3(): E { return E::V } - │ ^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return.move:15:25 - │ -15 │ fun t4(): vector { return vector[1,2,3] } - │ ^^^^^^^^^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return.move:17:12 - │ -17 │ fun t5() { return () } - │ ^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return.move:19:28 - │ -19 │ fun t6(): u64 { let x = 0; return move x - │ ^^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return.move:24:5 - │ -24 │ return copy x - │ ^^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return.move:29:17 - │ -29 │ fun t8(): u64 { return VALUE } - │ ^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return.move:33:5 - │ -33 │ return &x - │ ^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E07004]: invalid return of locally borrowed state - ┌─ tests/linter/move_2024/unneeded_return.move:33:5 - │ -33 │ return &x - │ ^^^^^^^^^ - │ │ │ - │ │ It is still being borrowed by this reference - │ Invalid return. Local variable 'x' is still being borrowed. - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return.move:36:18 - │ -36 │ fun t10(): u64 { return 5 + 2 } - │ ^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return.move:38:19 - │ -38 │ fun t11(): bool { return !true } - │ ^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return.move:40:25 - │ -40 │ fun t12(x: &u64): u64 { return *x } - │ ^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return.move:42:25 - │ -42 │ fun t13(x: u64): u128 { return x as u128 } - │ ^^^^^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return.move:44:18 - │ -44 │ fun t14(): u64 { return (0: u64) } - │ ^^^^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return.move:46:18 - │ -46 │ fun t15(): u64 { return loop { break 5 } } - │ ^^^^^^^^^^^^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/move_2024/unneeded_return.snap b/external-crates/move/crates/move-compiler/tests/linter/move_2024/unneeded_return.snap new file mode 100644 index 0000000000000..cb4bc23fd440c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/move_2024/unneeded_return.snap @@ -0,0 +1,144 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: true +input_file: crates/move-compiler/tests/linter/move_2024/unneeded_return.move +--- +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return.move:3:17 + │ +3 │ fun t0(): u64 { return 5 } + │ ^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return.move:5:17 + │ +5 │ fun t1(): u64 { return t0() } + │ ^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return.move:9:15 + │ +9 │ fun t2(): S { return S { } } + │ ^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return.move:13:15 + │ +13 │ fun t3(): E { return E::V } + │ ^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return.move:15:25 + │ +15 │ fun t4(): vector { return vector[1,2,3] } + │ ^^^^^^^^^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return.move:17:12 + │ +17 │ fun t5() { return () } + │ ^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return.move:19:28 + │ +19 │ fun t6(): u64 { let x = 0; return move x + │ ^^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return.move:24:5 + │ +24 │ return copy x + │ ^^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return.move:29:17 + │ +29 │ fun t8(): u64 { return VALUE } + │ ^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return.move:33:5 + │ +33 │ return &x + │ ^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E07004]: invalid return of locally borrowed state + ┌─ tests/linter/move_2024/unneeded_return.move:33:5 + │ +33 │ return &x + │ ^^^^^^^^^ + │ │ │ + │ │ It is still being borrowed by this reference + │ Invalid return. Local variable 'x' is still being borrowed. + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return.move:36:18 + │ +36 │ fun t10(): u64 { return 5 + 2 } + │ ^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return.move:38:19 + │ +38 │ fun t11(): bool { return !true } + │ ^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return.move:40:25 + │ +40 │ fun t12(x: &u64): u64 { return *x } + │ ^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return.move:42:25 + │ +42 │ fun t13(x: u64): u128 { return x as u128 } + │ ^^^^^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return.move:44:18 + │ +44 │ fun t14(): u64 { return (0: u64) } + │ ^^^^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return.move:46:18 + │ +46 │ fun t15(): u64 { return loop { break 5 } } + │ ^^^^^^^^^^^^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/linter/move_2024/unneeded_return_branch.exp b/external-crates/move/crates/move-compiler/tests/linter/move_2024/unneeded_return_branch.exp deleted file mode 100644 index c6b514b6023e4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/move_2024/unneeded_return_branch.exp +++ /dev/null @@ -1,113 +0,0 @@ -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return_branch.move:5:17 - │ -5 │ if (cond) { return 5 } else { abort ZERO } - │ ^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return_branch.move:9:17 - │ -9 │ if (cond) { return 5 } else { return 0 } - │ ^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return_branch.move:9:35 - │ -9 │ if (cond) { return 5 } else { return 0 } - │ ^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return_branch.move:13:5 - │ -13 │ return if (cond) { 5 } else { 0 } - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return_branch.move:17:5 - │ -17 │ return if (cond) { return 5 } else { 0 } - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return_branch.move:21:5 - │ -21 │ return if (cond) { 5 } else { return 0 } - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return_branch.move:30:5 - │ -30 │ ╭ return match (e) { -31 │ │ E::V0 => 0, -32 │ │ E::V1 => 1, -33 │ │ } - │ ╰─────^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return_branch.move:38:18 - │ -38 │ E::V0 => return 0, - │ ^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return_branch.move:45:18 - │ -45 │ E::V0 => return 0, - │ ^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return_branch.move:46:18 - │ -46 │ E::V1 => return 1, - │ ^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return_branch.move:52:18 - │ -52 │ E::V0 => return 0, - │ ^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return_branch.move:58:5 - │ -58 │ ╭ return match (e) { -59 │ │ E::V0 => 0, -60 │ │ E::V1 => abort ZERO, -61 │ │ } - │ ╰─────^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04004]: unneeded return - ┌─ tests/linter/move_2024/unneeded_return_branch.move:65:5 - │ -65 │ ╭ return match (e) { -66 │ │ E::V0 => if (true) { return 0 } else { 1 }, -67 │ │ E::V1 => 2, -68 │ │ } - │ ╰─────^ Remove unnecessary 'return', the expression is already in a 'return' position - │ - = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/move_2024/unneeded_return_branch.snap b/external-crates/move/crates/move-compiler/tests/linter/move_2024/unneeded_return_branch.snap new file mode 100644 index 0000000000000..79df665299520 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/move_2024/unneeded_return_branch.snap @@ -0,0 +1,120 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: true +input_file: crates/move-compiler/tests/linter/move_2024/unneeded_return_branch.move +--- +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return_branch.move:5:17 + │ +5 │ if (cond) { return 5 } else { abort ZERO } + │ ^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return_branch.move:9:17 + │ +9 │ if (cond) { return 5 } else { return 0 } + │ ^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return_branch.move:9:35 + │ +9 │ if (cond) { return 5 } else { return 0 } + │ ^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return_branch.move:13:5 + │ +13 │ return if (cond) { 5 } else { 0 } + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return_branch.move:17:5 + │ +17 │ return if (cond) { return 5 } else { 0 } + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return_branch.move:21:5 + │ +21 │ return if (cond) { 5 } else { return 0 } + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return_branch.move:30:5 + │ +30 │ ╭ return match (e) { +31 │ │ E::V0 => 0, +32 │ │ E::V1 => 1, +33 │ │ } + │ ╰─────^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return_branch.move:38:18 + │ +38 │ E::V0 => return 0, + │ ^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return_branch.move:45:18 + │ +45 │ E::V0 => return 0, + │ ^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return_branch.move:46:18 + │ +46 │ E::V1 => return 1, + │ ^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return_branch.move:52:18 + │ +52 │ E::V0 => return 0, + │ ^^^^^^^^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return_branch.move:58:5 + │ +58 │ ╭ return match (e) { +59 │ │ E::V0 => 0, +60 │ │ E::V1 => abort ZERO, +61 │ │ } + │ ╰─────^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04004]: unneeded return + ┌─ tests/linter/move_2024/unneeded_return_branch.move:65:5 + │ +65 │ ╭ return match (e) { +66 │ │ E::V0 => if (true) { return 0 } else { 1 }, +67 │ │ E::V1 => 2, +68 │ │ } + │ ╰─────^ Remove unnecessary 'return', the expression is already in a 'return' position + │ + = This warning can be suppressed with '#[allow(lint(unneeded_return))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/linter/move_2024/unneeded_return_okay.exp b/external-crates/move/crates/move-compiler/tests/linter/move_2024/unneeded_return_okay.exp deleted file mode 100644 index 3d707bdbde0f2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/move_2024/unneeded_return_okay.exp +++ /dev/null @@ -1,54 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/linter/move_2024/unneeded_return_okay.move:14:9 - │ -14 │ let y = &mut x; - │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04007]: incompatible types - ┌─ tests/linter/move_2024/unneeded_return_okay.move:15:14 - │ -13 │ let mut x = 0; - │ ----- Given: integer -14 │ let y = &mut x; -15 │ return (*x = 1) - │ ^ - │ │ - │ Invalid mutation. Expected a mutable reference - │ Expected: '&mut _' - -error[E04007]: incompatible types - ┌─ tests/linter/move_2024/unneeded_return_okay.move:19:12 - │ -19 │ fun t3() { 'a: { return { return 'a 0 } } } - │ -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Invalid return expression - │ │ Given: integer - │ Expected: '()' - -error[E04014]: invalid loop control - ┌─ tests/linter/move_2024/unneeded_return_okay.move:23:19 - │ -23 │ fun t4() { return continue } - │ ^^^^^^^^ Invalid usage of 'continue'. 'continue' can only be used inside a loop body or lambda - -error[E04014]: invalid loop control - ┌─ tests/linter/move_2024/unneeded_return_okay.move:25:19 - │ -25 │ fun t5() { return break } - │ ^^^^^ Invalid usage of 'break'. 'break' can only be used inside a loop body or lambda - -error[E04014]: invalid loop control - ┌─ tests/linter/move_2024/unneeded_return_okay.move:27:20 - │ -27 │ fun t6() { return (break + 5) } - │ ^^^^^ Invalid usage of 'break'. 'break' can only be used inside a loop body or lambda - -error[E03005]: unbound unscoped name - ┌─ tests/linter/move_2024/unneeded_return_okay.move:29:19 - │ -29 │ fun t7() { return unnamed_fun() } - │ ^^^^^^^^^^^ Unbound function 'unnamed_fun' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/linter/move_2024/unneeded_return_okay.snap b/external-crates/move/crates/move-compiler/tests/linter/move_2024/unneeded_return_okay.snap new file mode 100644 index 0000000000000..8ca083edd28b0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/move_2024/unneeded_return_okay.snap @@ -0,0 +1,61 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: true +input_file: crates/move-compiler/tests/linter/move_2024/unneeded_return_okay.move +--- +warning[W09002]: unused variable + ┌─ tests/linter/move_2024/unneeded_return_okay.move:14:9 + │ +14 │ let y = &mut x; + │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04007]: incompatible types + ┌─ tests/linter/move_2024/unneeded_return_okay.move:15:14 + │ +13 │ let mut x = 0; + │ ----- Given: integer +14 │ let y = &mut x; +15 │ return (*x = 1) + │ ^ + │ │ + │ Invalid mutation. Expected a mutable reference + │ Expected: '&mut _' + +error[E04007]: incompatible types + ┌─ tests/linter/move_2024/unneeded_return_okay.move:19:12 + │ +19 │ fun t3() { 'a: { return { return 'a 0 } } } + │ -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Invalid return expression + │ │ Given: integer + │ Expected: '()' + +error[E04014]: invalid loop control + ┌─ tests/linter/move_2024/unneeded_return_okay.move:23:19 + │ +23 │ fun t4() { return continue } + │ ^^^^^^^^ Invalid usage of 'continue'. 'continue' can only be used inside a loop body or lambda + +error[E04014]: invalid loop control + ┌─ tests/linter/move_2024/unneeded_return_okay.move:25:19 + │ +25 │ fun t5() { return break } + │ ^^^^^ Invalid usage of 'break'. 'break' can only be used inside a loop body or lambda + +error[E04014]: invalid loop control + ┌─ tests/linter/move_2024/unneeded_return_okay.move:27:20 + │ +27 │ fun t6() { return (break + 5) } + │ ^^^^^ Invalid usage of 'break'. 'break' can only be used inside a loop body or lambda + +error[E03005]: unbound unscoped name + ┌─ tests/linter/move_2024/unneeded_return_okay.move:29:19 + │ +29 │ fun t7() { return unnamed_fun() } + │ ^^^^^^^^^^^ Unbound function 'unnamed_fun' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/linter/redundant_ref_deref.exp b/external-crates/move/crates/move-compiler/tests/linter/redundant_ref_deref.exp deleted file mode 100644 index 63f19d5427feb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/redundant_ref_deref.exp +++ /dev/null @@ -1,24 +0,0 @@ -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/redundant_ref_deref.move:8:21 - │ -8 │ let _ref = &*(&resource); // Redundant borrow-dereference - │ ^^^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/redundant_ref_deref.move:13:25 - │ -13 │ let _ref = &mut *(&mut resource); - │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/redundant_ref_deref.move:18:22 - │ -18 │ let _value = *(&resource.value); - │ ^^^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/redundant_ref_deref.snap b/external-crates/move/crates/move-compiler/tests/linter/redundant_ref_deref.snap new file mode 100644 index 0000000000000..059821442b678 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/redundant_ref_deref.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/redundant_ref_deref.move +--- +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/redundant_ref_deref.move:8:21 + │ +8 │ let _ref = &*(&resource); // Redundant borrow-dereference + │ ^^^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/redundant_ref_deref.move:13:25 + │ +13 │ let _ref = &mut *(&mut resource); + │ ^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/redundant_ref_deref.move:18:22 + │ +18 │ let _value = *(&resource.value); + │ ^^^^^^^^^^^^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/linter/ref_deref_negative.snap b/external-crates/move/crates/move-compiler/tests/linter/ref_deref_negative.snap new file mode 100644 index 0000000000000..9f2db206482d8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/ref_deref_negative.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/ref_deref_negative.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/ref_deref_path.exp b/external-crates/move/crates/move-compiler/tests/linter/ref_deref_path.exp deleted file mode 100644 index 070a9b2001d61..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/ref_deref_path.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/ref_deref_path.move:5:19 - │ -5 │ let _x = &*&*&s.x.x; - │ ^^^^^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/ref_deref_path.move:5:21 - │ -5 │ let _x = &*&*&s.x.x; - │ ^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/ref_deref_path.snap b/external-crates/move/crates/move-compiler/tests/linter/ref_deref_path.snap new file mode 100644 index 0000000000000..13d3d464d5877 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/ref_deref_path.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/ref_deref_path.move +--- +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/ref_deref_path.move:5:19 + │ +5 │ let _x = &*&*&s.x.x; + │ ^^^^^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/ref_deref_path.move:5:21 + │ +5 │ let _x = &*&*&s.x.x; + │ ^^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/linter/ref_deref_triple.exp b/external-crates/move/crates/move-compiler/tests/linter/ref_deref_triple.exp deleted file mode 100644 index 29908b2782170..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/ref_deref_triple.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/ref_deref_triple.move:5:19 - │ -5 │ let _x = &*&*&s; - │ ^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/ref_deref_triple.move:5:21 - │ -5 │ let _x = &*&*&s; - │ ^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/ref_deref_triple.snap b/external-crates/move/crates/move-compiler/tests/linter/ref_deref_triple.snap new file mode 100644 index 0000000000000..fbbb8b1e3293c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/ref_deref_triple.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/ref_deref_triple.move +--- +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/ref_deref_triple.move:5:19 + │ +5 │ let _x = &*&*&s; + │ ^^^^^ Redundant borrow-dereference detected. Use the inner expression directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/ref_deref_triple.move:5:21 + │ +5 │ let _x = &*&*&s; + │ ^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/linter/suppress_abort_constant.snap b/external-crates/move/crates/move-compiler/tests/linter/suppress_abort_constant.snap new file mode 100644 index 0000000000000..640f8c18d590d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/suppress_abort_constant.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/suppress_abort_constant.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/suppress_combinable_comparisons.snap b/external-crates/move/crates/move-compiler/tests/linter/suppress_combinable_comparisons.snap new file mode 100644 index 0000000000000..460f340e24848 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/suppress_combinable_comparisons.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/suppress_combinable_comparisons.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/suppress_equal_operands.snap b/external-crates/move/crates/move-compiler/tests/linter/suppress_equal_operands.snap new file mode 100644 index 0000000000000..1e1c59e71a8df --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/suppress_equal_operands.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/suppress_equal_operands.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/suppress_loop_without_exit.snap b/external-crates/move/crates/move-compiler/tests/linter/suppress_loop_without_exit.snap new file mode 100644 index 0000000000000..61609b9577b71 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/suppress_loop_without_exit.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/suppress_loop_without_exit.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/suppress_meaningless_math_operation.snap b/external-crates/move/crates/move-compiler/tests/linter/suppress_meaningless_math_operation.snap new file mode 100644 index 0000000000000..8573af47eba40 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/suppress_meaningless_math_operation.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/suppress_meaningless_math_operation.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/suppress_self_assignment.snap b/external-crates/move/crates/move-compiler/tests/linter/suppress_self_assignment.snap new file mode 100644 index 0000000000000..37150ccf2d4a6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/suppress_self_assignment.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/suppress_self_assignment.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/suppress_unnecessary_conditional.snap b/external-crates/move/crates/move-compiler/tests/linter/suppress_unnecessary_conditional.snap new file mode 100644 index 0000000000000..55473b902d041 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/suppress_unnecessary_conditional.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/suppress_unnecessary_conditional.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/suppress_unnecessary_unit.snap b/external-crates/move/crates/move-compiler/tests/linter/suppress_unnecessary_unit.snap new file mode 100644 index 0000000000000..3ea38e03d829e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/suppress_unnecessary_unit.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/suppress_unnecessary_unit.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/suppress_unnecessary_while_loop.snap b/external-crates/move/crates/move-compiler/tests/linter/suppress_unnecessary_while_loop.snap new file mode 100644 index 0000000000000..88e0046cb9efc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/suppress_unnecessary_while_loop.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/suppress_unnecessary_while_loop.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/suppressed_case_redundant_ref_deref.snap b/external-crates/move/crates/move-compiler/tests/linter/suppressed_case_redundant_ref_deref.snap new file mode 100644 index 0000000000000..69441ad6e23df --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/suppressed_case_redundant_ref_deref.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/suppressed_case_redundant_ref_deref.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/suppressed_lints.snap b/external-crates/move/crates/move-compiler/tests/linter/suppressed_lints.snap new file mode 100644 index 0000000000000..c64e131469a08 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/suppressed_lints.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/suppressed_lints.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_negative_abort_constant.snap b/external-crates/move/crates/move-compiler/tests/linter/true_negative_abort_constant.snap new file mode 100644 index 0000000000000..33279882e4735 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/true_negative_abort_constant.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/true_negative_abort_constant.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_negative_loop_without_exit.snap b/external-crates/move/crates/move-compiler/tests/linter/true_negative_loop_without_exit.snap new file mode 100644 index 0000000000000..39b96191c2c88 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/true_negative_loop_without_exit.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/true_negative_loop_without_exit.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_negative_meaningless_math_operation.snap b/external-crates/move/crates/move-compiler/tests/linter/true_negative_meaningless_math_operation.snap new file mode 100644 index 0000000000000..86c5e8747770e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/true_negative_meaningless_math_operation.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/true_negative_meaningless_math_operation.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_negative_self_assignment.snap b/external-crates/move/crates/move-compiler/tests/linter/true_negative_self_assignment.snap new file mode 100644 index 0000000000000..1e2d84ee36429 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/true_negative_self_assignment.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/true_negative_self_assignment.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_negative_unnecessary_conditional.snap b/external-crates/move/crates/move-compiler/tests/linter/true_negative_unnecessary_conditional.snap new file mode 100644 index 0000000000000..6c64cd400b73f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/true_negative_unnecessary_conditional.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/true_negative_unnecessary_conditional.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_negative_unnecessary_unit.snap b/external-crates/move/crates/move-compiler/tests/linter/true_negative_unnecessary_unit.snap new file mode 100644 index 0000000000000..28a7eb2fc4b28 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/true_negative_unnecessary_unit.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/true_negative_unnecessary_unit.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_negative_unnecessary_while_loop.snap b/external-crates/move/crates/move-compiler/tests/linter/true_negative_unnecessary_while_loop.snap new file mode 100644 index 0000000000000..c6b4318d660c7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/true_negative_unnecessary_while_loop.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/true_negative_unnecessary_while_loop.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_positive_abort_constant.exp b/external-crates/move/crates/move-compiler/tests/linter/true_positive_abort_constant.exp deleted file mode 100644 index ea630d5687e55..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/true_positive_abort_constant.exp +++ /dev/null @@ -1,126 +0,0 @@ -warning[Lint W04005]: 'abort' or 'assert' without named constant - ┌─ tests/linter/true_positive_abort_constant.move:6:15 - │ -6 │ abort 100 // Should trigger: using a numeric literal - │ ^^^ Prefer using a named constant. - │ - = Consider using an error constant with the '#[error]' to allow for a more descriptive error. - = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04005]: 'abort' or 'assert' without named constant - ┌─ tests/linter/true_positive_abort_constant.move:10:15 - │ -10 │ abort 1 + 2 // Should trigger - │ ^^^^^ Prefer using a named constant. - │ - = Consider using an error constant with the '#[error]' to allow for a more descriptive error. - = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04005]: 'abort' or 'assert' without named constant - ┌─ tests/linter/true_positive_abort_constant.move:15:15 - │ -15 │ abort 0 // Should trigger - │ ^ Prefer using a named constant. - │ - = Consider using an error constant with the '#[error]' to allow for a more descriptive error. - = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04005]: 'abort' or 'assert' without named constant - ┌─ tests/linter/true_positive_abort_constant.move:19:15 - │ -19 │ abort 0x1F // Should trigger - │ ^^^^ Prefer using a named constant. - │ - = Consider using an error constant with the '#[error]' to allow for a more descriptive error. - = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04005]: 'abort' or 'assert' without named constant - ┌─ tests/linter/true_positive_abort_constant.move:23:15 - │ -23 │ abort 1 + ERROR_NOT_OWNER // Should trigger - │ ^^^^^^^^^^^^^^^^^^^ Prefer using a named constant. - │ - = Consider using an error constant with the '#[error]' to allow for a more descriptive error. - = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04005]: 'abort' or 'assert' without named constant - ┌─ tests/linter/true_positive_abort_constant.move:27:15 - │ -27 │ abort ERROR_NOT_OWNER + ERROR_NOT_OWNER // Should trigger - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using a named constant. - │ - = Consider using an error constant with the '#[error]' to allow for a more descriptive error. - = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04005]: 'abort' or 'assert' without named constant - ┌─ tests/linter/true_positive_abort_constant.move:32:15 - │ -32 │ abort x - │ ^ Prefer using a named constant. - │ - = Consider using an error constant with the '#[error]' to allow for a more descriptive error. - = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04005]: 'abort' or 'assert' without named constant - ┌─ tests/linter/true_positive_abort_constant.move:36:15 - │ -36 │ abort error_code // trigger, since it's a dynamic value, not a constant - │ ^^^^^^^^^^ Prefer using a named constant. - │ - = Consider using an error constant with the '#[error]' to allow for a more descriptive error. - = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04005]: 'abort' or 'assert' without named constant - ┌─ tests/linter/true_positive_abort_constant.move:40:24 - │ -40 │ assert!(false, 2); // Should trigger: using a numeric literal - │ ^ Prefer using a named constant. - │ - = Consider using an error constant with the '#[error]' to allow for a more descriptive error. - = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04005]: 'abort' or 'assert' without named constant - ┌─ tests/linter/true_positive_abort_constant.move:44:24 - │ -44 │ assert!(false, 1 + 1); // Should trigger - │ ^^^^^ Prefer using a named constant. - │ - = Consider using an error constant with the '#[error]' to allow for a more descriptive error. - = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04005]: 'abort' or 'assert' without named constant - ┌─ tests/linter/true_positive_abort_constant.move:48:24 - │ -48 │ assert!(false, 0xC0FFEE); // Should trigger - │ ^^^^^^^^ Prefer using a named constant. - │ - = Consider using an error constant with the '#[error]' to allow for a more descriptive error. - = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04005]: 'abort' or 'assert' without named constant - ┌─ tests/linter/true_positive_abort_constant.move:52:24 - │ -52 │ assert!(false, 1 + ERROR_NOT_OWNER); // Should trigger - │ ^^^^^^^^^^^^^^^^^^^ Prefer using a named constant. - │ - = Consider using an error constant with the '#[error]' to allow for a more descriptive error. - = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04005]: 'abort' or 'assert' without named constant - ┌─ tests/linter/true_positive_abort_constant.move:56:24 - │ -56 │ assert!(false, ERROR_NOT_OWNER + ERROR_NOT_OWNER) // Should trigger - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using a named constant. - │ - = Consider using an error constant with the '#[error]' to allow for a more descriptive error. - = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04005]: 'abort' or 'assert' without named constant - ┌─ tests/linter/true_positive_abort_constant.move:61:24 - │ -61 │ assert!(false, x); // Should trigger - │ ^ Prefer using a named constant. - │ - = Consider using an error constant with the '#[error]' to allow for a more descriptive error. - = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_positive_abort_constant.snap b/external-crates/move/crates/move-compiler/tests/linter/true_positive_abort_constant.snap new file mode 100644 index 0000000000000..6502e4c132823 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/true_positive_abort_constant.snap @@ -0,0 +1,133 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/true_positive_abort_constant.move +--- +warning[Lint W04005]: 'abort' or 'assert' without named constant + ┌─ tests/linter/true_positive_abort_constant.move:6:15 + │ +6 │ abort 100 // Should trigger: using a numeric literal + │ ^^^ Prefer using a named constant. + │ + = Consider using an error constant with the '#[error]' to allow for a more descriptive error. + = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04005]: 'abort' or 'assert' without named constant + ┌─ tests/linter/true_positive_abort_constant.move:10:15 + │ +10 │ abort 1 + 2 // Should trigger + │ ^^^^^ Prefer using a named constant. + │ + = Consider using an error constant with the '#[error]' to allow for a more descriptive error. + = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04005]: 'abort' or 'assert' without named constant + ┌─ tests/linter/true_positive_abort_constant.move:15:15 + │ +15 │ abort 0 // Should trigger + │ ^ Prefer using a named constant. + │ + = Consider using an error constant with the '#[error]' to allow for a more descriptive error. + = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04005]: 'abort' or 'assert' without named constant + ┌─ tests/linter/true_positive_abort_constant.move:19:15 + │ +19 │ abort 0x1F // Should trigger + │ ^^^^ Prefer using a named constant. + │ + = Consider using an error constant with the '#[error]' to allow for a more descriptive error. + = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04005]: 'abort' or 'assert' without named constant + ┌─ tests/linter/true_positive_abort_constant.move:23:15 + │ +23 │ abort 1 + ERROR_NOT_OWNER // Should trigger + │ ^^^^^^^^^^^^^^^^^^^ Prefer using a named constant. + │ + = Consider using an error constant with the '#[error]' to allow for a more descriptive error. + = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04005]: 'abort' or 'assert' without named constant + ┌─ tests/linter/true_positive_abort_constant.move:27:15 + │ +27 │ abort ERROR_NOT_OWNER + ERROR_NOT_OWNER // Should trigger + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using a named constant. + │ + = Consider using an error constant with the '#[error]' to allow for a more descriptive error. + = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04005]: 'abort' or 'assert' without named constant + ┌─ tests/linter/true_positive_abort_constant.move:32:15 + │ +32 │ abort x + │ ^ Prefer using a named constant. + │ + = Consider using an error constant with the '#[error]' to allow for a more descriptive error. + = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04005]: 'abort' or 'assert' without named constant + ┌─ tests/linter/true_positive_abort_constant.move:36:15 + │ +36 │ abort error_code // trigger, since it's a dynamic value, not a constant + │ ^^^^^^^^^^ Prefer using a named constant. + │ + = Consider using an error constant with the '#[error]' to allow for a more descriptive error. + = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04005]: 'abort' or 'assert' without named constant + ┌─ tests/linter/true_positive_abort_constant.move:40:24 + │ +40 │ assert!(false, 2); // Should trigger: using a numeric literal + │ ^ Prefer using a named constant. + │ + = Consider using an error constant with the '#[error]' to allow for a more descriptive error. + = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04005]: 'abort' or 'assert' without named constant + ┌─ tests/linter/true_positive_abort_constant.move:44:24 + │ +44 │ assert!(false, 1 + 1); // Should trigger + │ ^^^^^ Prefer using a named constant. + │ + = Consider using an error constant with the '#[error]' to allow for a more descriptive error. + = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04005]: 'abort' or 'assert' without named constant + ┌─ tests/linter/true_positive_abort_constant.move:48:24 + │ +48 │ assert!(false, 0xC0FFEE); // Should trigger + │ ^^^^^^^^ Prefer using a named constant. + │ + = Consider using an error constant with the '#[error]' to allow for a more descriptive error. + = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04005]: 'abort' or 'assert' without named constant + ┌─ tests/linter/true_positive_abort_constant.move:52:24 + │ +52 │ assert!(false, 1 + ERROR_NOT_OWNER); // Should trigger + │ ^^^^^^^^^^^^^^^^^^^ Prefer using a named constant. + │ + = Consider using an error constant with the '#[error]' to allow for a more descriptive error. + = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04005]: 'abort' or 'assert' without named constant + ┌─ tests/linter/true_positive_abort_constant.move:56:24 + │ +56 │ assert!(false, ERROR_NOT_OWNER + ERROR_NOT_OWNER) // Should trigger + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using a named constant. + │ + = Consider using an error constant with the '#[error]' to allow for a more descriptive error. + = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04005]: 'abort' or 'assert' without named constant + ┌─ tests/linter/true_positive_abort_constant.move:61:24 + │ +61 │ assert!(false, x); // Should trigger + │ ^ Prefer using a named constant. + │ + = Consider using an error constant with the '#[error]' to allow for a more descriptive error. + = This warning can be suppressed with '#[allow(lint(abort_without_constant))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_positive_combinable_comparisons.exp b/external-crates/move/crates/move-compiler/tests/linter/true_positive_combinable_comparisons.exp deleted file mode 100644 index 45d20929184be..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/true_positive_combinable_comparisons.exp +++ /dev/null @@ -1,1136 +0,0 @@ -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:4:9 - │ -4 │ x == y && x != y; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:5:9 - │ -5 │ x == y && x > y; - │ ^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:6:9 - │ -6 │ x == y && x < y; - │ ^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:7:9 - │ -7 │ x == y && x >= y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:8:9 - │ -8 │ x == y && x <= y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:9:9 - │ -9 │ x != y && x > y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:10:9 - │ -10 │ x != y && x < y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:11:9 - │ -11 │ x != y && x >= y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:12:9 - │ -12 │ x != y && x <= y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:13:9 - │ -13 │ x > y && x < y; - │ ^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:14:9 - │ -14 │ x > y && x >= y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:15:9 - │ -15 │ x > y && x <= y; - │ ^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:16:9 - │ -16 │ x < y && x >= y; - │ ^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:17:9 - │ -17 │ x < y && x <= y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:18:9 - │ -18 │ x >= y && x <= y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:19:9 - │ -19 │ x == y || x != y; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:20:9 - │ -20 │ x == y || x > y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:21:9 - │ -21 │ x == y || x < y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:22:9 - │ -22 │ x == y || x >= y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:23:9 - │ -23 │ x == y || x <= y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:24:9 - │ -24 │ x != y || x > y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:25:9 - │ -25 │ x != y || x < y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:26:9 - │ -26 │ x != y || x >= y; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:27:9 - │ -27 │ x != y || x <= y; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:28:9 - │ -28 │ x > y || x < y; - │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:29:9 - │ -29 │ x > y || x >= y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:30:9 - │ -30 │ x > y || x <= y; - │ ^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:31:9 - │ -31 │ x < y || x >= y; - │ ^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:32:9 - │ -32 │ x < y || x <= y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:33:9 - │ -33 │ x >= y || x <= y; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:34:9 - │ -34 │ x != y && x == y; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:35:9 - │ -35 │ x > y && x == y; - │ ^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:36:9 - │ -36 │ x < y && x == y; - │ ^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:37:9 - │ -37 │ x >= y && x == y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:38:9 - │ -38 │ x <= y && x == y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:39:9 - │ -39 │ x > y && x != y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:40:9 - │ -40 │ x < y && x != y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:41:9 - │ -41 │ x >= y && x != y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:42:9 - │ -42 │ x <= y && x != y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:43:9 - │ -43 │ x < y && x > y; - │ ^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:44:9 - │ -44 │ x >= y && x > y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:45:9 - │ -45 │ x <= y && x > y; - │ ^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:46:9 - │ -46 │ x >= y && x < y; - │ ^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:47:9 - │ -47 │ x <= y && x < y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:48:9 - │ -48 │ x <= y && x >= y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:49:9 - │ -49 │ x != y || x == y; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:50:9 - │ -50 │ x > y || x == y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:51:9 - │ -51 │ x < y || x == y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:52:9 - │ -52 │ x >= y || x == y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:53:9 - │ -53 │ x <= y || x == y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:54:9 - │ -54 │ x > y || x != y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:55:9 - │ -55 │ x < y || x != y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:56:9 - │ -56 │ x >= y || x != y; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:57:9 - │ -57 │ x <= y || x != y; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:58:9 - │ -58 │ x < y || x > y; - │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:59:9 - │ -59 │ x >= y || x > y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:60:9 - │ -60 │ x <= y || x > y; - │ ^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:61:9 - │ -61 │ x >= y || x < y; - │ ^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:62:9 - │ -62 │ x <= y || x < y; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:63:9 - │ -63 │ x <= y || x >= y; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:67:9 - │ -67 │ x == y && y != x; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:68:9 - │ -68 │ x == y && y > x; - │ ^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:69:9 - │ -69 │ x == y && y < x; - │ ^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:70:9 - │ -70 │ x == y && y >= x; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:71:9 - │ -71 │ x == y && y <= x; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:72:9 - │ -72 │ x != y && y > x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:73:9 - │ -73 │ x != y && y < x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:74:9 - │ -74 │ x != y && y >= x; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:75:9 - │ -75 │ x != y && y <= x; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:76:9 - │ -76 │ x > y && y > x; - │ ^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:77:9 - │ -77 │ x > y && y >= x; - │ ^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:78:9 - │ -78 │ x > y && y <= x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:79:9 - │ -79 │ x < y && y >= x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:80:9 - │ -80 │ x < y && y <= x; - │ ^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:81:9 - │ -81 │ x >= y && y >= x; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:82:9 - │ -82 │ x == y || y != x; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:83:9 - │ -83 │ x == y || y > x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:84:9 - │ -84 │ x == y || y < x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:85:9 - │ -85 │ x == y || y >= x; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:86:9 - │ -86 │ x == y || y <= x; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:87:9 - │ -87 │ x != y || y > x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:88:9 - │ -88 │ x != y || y < x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:89:9 - │ -89 │ x != y || y >= x; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:90:9 - │ -90 │ x != y || y <= x; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:91:9 - │ -91 │ x > y || y > x; - │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:92:9 - │ -92 │ x > y || y >= x; - │ ^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:93:9 - │ -93 │ x > y || y <= x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:94:9 - │ -94 │ x < y || y >= x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:95:9 - │ -95 │ x < y || y <= x; - │ ^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:96:9 - │ -96 │ x >= y || y >= x; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:97:9 - │ -97 │ x != y && y == x; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:98:9 - │ -98 │ x > y && y == x; - │ ^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:99:9 - │ -99 │ x < y && y == x; - │ ^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:100:9 - │ -100 │ x >= y && y == x; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:101:9 - │ -101 │ x <= y && y == x; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:102:9 - │ -102 │ x > y && y != x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:103:9 - │ -103 │ x < y && y != x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:104:9 - │ -104 │ x >= y && y != x; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:105:9 - │ -105 │ x <= y && y != x; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:106:9 - │ -106 │ x < y && y < x; - │ ^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:107:9 - │ -107 │ x >= y && y > x; - │ ^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:108:9 - │ -108 │ x <= y && y > x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:109:9 - │ -109 │ x >= y && y < x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:110:9 - │ -110 │ x <= y && y < x; - │ ^^^^^^^^^^^^^^^ This comparison is always 'false' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:111:9 - │ -111 │ x <= y && y <= x; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:112:9 - │ -112 │ x != y || y == x; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:113:9 - │ -113 │ x > y || y == x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:114:9 - │ -114 │ x < y || y == x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:115:9 - │ -115 │ x >= y || y == x; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:116:9 - │ -116 │ x <= y || y == x; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:117:9 - │ -117 │ x > y || y != x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:118:9 - │ -118 │ x < y || y != x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:119:9 - │ -119 │ x >= y || y != x; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:120:9 - │ -120 │ x <= y || y != x; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:121:9 - │ -121 │ x < y || y < x; - │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:122:9 - │ -122 │ x >= y || y > x; - │ ^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:123:9 - │ -123 │ x <= y || y > x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:124:9 - │ -124 │ x >= y || y < x; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:125:9 - │ -125 │ x <= y || y < x; - │ ^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:126:9 - │ -126 │ x <= y || y <= x; - │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:130:9 - │ -130 │ x == y && x == y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:131:9 - │ -131 │ x != y && x != y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:132:9 - │ -132 │ x > y && x > y; - │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:133:9 - │ -133 │ x < y && x < y; - │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:134:9 - │ -134 │ x >= y && x >= y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:135:9 - │ -135 │ x <= y && x <= y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:136:9 - │ -136 │ x == y || x == y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:137:9 - │ -137 │ x != y || x != y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:138:9 - │ -138 │ x > y || x > y; - │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:139:9 - │ -139 │ x < y || x < y; - │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:140:9 - │ -140 │ x >= y || x >= y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:141:9 - │ -141 │ x <= y || x <= y; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:142:9 - │ -142 │ x == y && y == x; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:143:9 - │ -143 │ x != y && y != x; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:144:9 - │ -144 │ x > y && y < x; - │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:145:9 - │ -145 │ x < y && y > x; - │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:146:9 - │ -146 │ x >= y && y <= x; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:147:9 - │ -147 │ x <= y && y >= x; - │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:150:26 - │ -150 │ const Values: bool = 5 > 3 || 5 == 3; - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:153:9 - │ -153 │ 5 != 3 && 5 > 3 - │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:158:9 - │ -158 │ {&x} == &y || (x as u64) > (*&y:u64); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01012]: comparison operations condition can be simplified - ┌─ tests/linter/true_positive_combinable_comparisons.move:159:9 - │ -159 │ © x == &y || x < move y; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' - │ - = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_positive_combinable_comparisons.snap b/external-crates/move/crates/move-compiler/tests/linter/true_positive_combinable_comparisons.snap new file mode 100644 index 0000000000000..0e68c75c4fed2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/true_positive_combinable_comparisons.snap @@ -0,0 +1,1143 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/true_positive_combinable_comparisons.move +--- +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:4:9 + │ +4 │ x == y && x != y; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:5:9 + │ +5 │ x == y && x > y; + │ ^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:6:9 + │ +6 │ x == y && x < y; + │ ^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:7:9 + │ +7 │ x == y && x >= y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:8:9 + │ +8 │ x == y && x <= y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:9:9 + │ +9 │ x != y && x > y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:10:9 + │ +10 │ x != y && x < y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:11:9 + │ +11 │ x != y && x >= y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:12:9 + │ +12 │ x != y && x <= y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:13:9 + │ +13 │ x > y && x < y; + │ ^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:14:9 + │ +14 │ x > y && x >= y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:15:9 + │ +15 │ x > y && x <= y; + │ ^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:16:9 + │ +16 │ x < y && x >= y; + │ ^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:17:9 + │ +17 │ x < y && x <= y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:18:9 + │ +18 │ x >= y && x <= y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:19:9 + │ +19 │ x == y || x != y; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:20:9 + │ +20 │ x == y || x > y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:21:9 + │ +21 │ x == y || x < y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:22:9 + │ +22 │ x == y || x >= y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:23:9 + │ +23 │ x == y || x <= y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:24:9 + │ +24 │ x != y || x > y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:25:9 + │ +25 │ x != y || x < y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:26:9 + │ +26 │ x != y || x >= y; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:27:9 + │ +27 │ x != y || x <= y; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:28:9 + │ +28 │ x > y || x < y; + │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:29:9 + │ +29 │ x > y || x >= y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:30:9 + │ +30 │ x > y || x <= y; + │ ^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:31:9 + │ +31 │ x < y || x >= y; + │ ^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:32:9 + │ +32 │ x < y || x <= y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:33:9 + │ +33 │ x >= y || x <= y; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:34:9 + │ +34 │ x != y && x == y; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:35:9 + │ +35 │ x > y && x == y; + │ ^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:36:9 + │ +36 │ x < y && x == y; + │ ^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:37:9 + │ +37 │ x >= y && x == y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:38:9 + │ +38 │ x <= y && x == y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:39:9 + │ +39 │ x > y && x != y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:40:9 + │ +40 │ x < y && x != y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:41:9 + │ +41 │ x >= y && x != y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:42:9 + │ +42 │ x <= y && x != y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:43:9 + │ +43 │ x < y && x > y; + │ ^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:44:9 + │ +44 │ x >= y && x > y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:45:9 + │ +45 │ x <= y && x > y; + │ ^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:46:9 + │ +46 │ x >= y && x < y; + │ ^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:47:9 + │ +47 │ x <= y && x < y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:48:9 + │ +48 │ x <= y && x >= y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:49:9 + │ +49 │ x != y || x == y; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:50:9 + │ +50 │ x > y || x == y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:51:9 + │ +51 │ x < y || x == y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:52:9 + │ +52 │ x >= y || x == y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:53:9 + │ +53 │ x <= y || x == y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:54:9 + │ +54 │ x > y || x != y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:55:9 + │ +55 │ x < y || x != y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:56:9 + │ +56 │ x >= y || x != y; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:57:9 + │ +57 │ x <= y || x != y; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:58:9 + │ +58 │ x < y || x > y; + │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:59:9 + │ +59 │ x >= y || x > y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:60:9 + │ +60 │ x <= y || x > y; + │ ^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:61:9 + │ +61 │ x >= y || x < y; + │ ^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:62:9 + │ +62 │ x <= y || x < y; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:63:9 + │ +63 │ x <= y || x >= y; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:67:9 + │ +67 │ x == y && y != x; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:68:9 + │ +68 │ x == y && y > x; + │ ^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:69:9 + │ +69 │ x == y && y < x; + │ ^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:70:9 + │ +70 │ x == y && y >= x; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:71:9 + │ +71 │ x == y && y <= x; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:72:9 + │ +72 │ x != y && y > x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:73:9 + │ +73 │ x != y && y < x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:74:9 + │ +74 │ x != y && y >= x; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:75:9 + │ +75 │ x != y && y <= x; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:76:9 + │ +76 │ x > y && y > x; + │ ^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:77:9 + │ +77 │ x > y && y >= x; + │ ^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:78:9 + │ +78 │ x > y && y <= x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:79:9 + │ +79 │ x < y && y >= x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:80:9 + │ +80 │ x < y && y <= x; + │ ^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:81:9 + │ +81 │ x >= y && y >= x; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:82:9 + │ +82 │ x == y || y != x; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:83:9 + │ +83 │ x == y || y > x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:84:9 + │ +84 │ x == y || y < x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:85:9 + │ +85 │ x == y || y >= x; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:86:9 + │ +86 │ x == y || y <= x; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:87:9 + │ +87 │ x != y || y > x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:88:9 + │ +88 │ x != y || y < x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:89:9 + │ +89 │ x != y || y >= x; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:90:9 + │ +90 │ x != y || y <= x; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:91:9 + │ +91 │ x > y || y > x; + │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:92:9 + │ +92 │ x > y || y >= x; + │ ^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:93:9 + │ +93 │ x > y || y <= x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:94:9 + │ +94 │ x < y || y >= x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:95:9 + │ +95 │ x < y || y <= x; + │ ^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:96:9 + │ +96 │ x >= y || y >= x; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:97:9 + │ +97 │ x != y && y == x; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:98:9 + │ +98 │ x > y && y == x; + │ ^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:99:9 + │ +99 │ x < y && y == x; + │ ^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:100:9 + │ +100 │ x >= y && y == x; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:101:9 + │ +101 │ x <= y && y == x; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:102:9 + │ +102 │ x > y && y != x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:103:9 + │ +103 │ x < y && y != x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:104:9 + │ +104 │ x >= y && y != x; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:105:9 + │ +105 │ x <= y && y != x; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:106:9 + │ +106 │ x < y && y < x; + │ ^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:107:9 + │ +107 │ x >= y && y > x; + │ ^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:108:9 + │ +108 │ x <= y && y > x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:109:9 + │ +109 │ x >= y && y < x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:110:9 + │ +110 │ x <= y && y < x; + │ ^^^^^^^^^^^^^^^ This comparison is always 'false' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:111:9 + │ +111 │ x <= y && y <= x; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:112:9 + │ +112 │ x != y || y == x; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:113:9 + │ +113 │ x > y || y == x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:114:9 + │ +114 │ x < y || y == x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:115:9 + │ +115 │ x >= y || y == x; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:116:9 + │ +116 │ x <= y || y == x; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:117:9 + │ +117 │ x > y || y != x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:118:9 + │ +118 │ x < y || y != x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:119:9 + │ +119 │ x >= y || y != x; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:120:9 + │ +120 │ x <= y || y != x; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:121:9 + │ +121 │ x < y || y < x; + │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:122:9 + │ +122 │ x >= y || y > x; + │ ^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:123:9 + │ +123 │ x <= y || y > x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:124:9 + │ +124 │ x >= y || y < x; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:125:9 + │ +125 │ x <= y || y < x; + │ ^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:126:9 + │ +126 │ x <= y || y <= x; + │ ^^^^^^^^^^^^^^^^ This comparison is always 'true' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:130:9 + │ +130 │ x == y && x == y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:131:9 + │ +131 │ x != y && x != y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:132:9 + │ +132 │ x > y && x > y; + │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:133:9 + │ +133 │ x < y && x < y; + │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:134:9 + │ +134 │ x >= y && x >= y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:135:9 + │ +135 │ x <= y && x <= y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:136:9 + │ +136 │ x == y || x == y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:137:9 + │ +137 │ x != y || x != y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:138:9 + │ +138 │ x > y || x > y; + │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:139:9 + │ +139 │ x < y || x < y; + │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:140:9 + │ +140 │ x >= y || x >= y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:141:9 + │ +141 │ x <= y || x <= y; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:142:9 + │ +142 │ x == y && y == x; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '==' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:143:9 + │ +143 │ x != y && y != x; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '!=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:144:9 + │ +144 │ x > y && y < x; + │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:145:9 + │ +145 │ x < y && y > x; + │ ^^^^^^^^^^^^^^ This comparison simplifies to the operation '<' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:146:9 + │ +146 │ x >= y && y <= x; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:147:9 + │ +147 │ x <= y && y >= x; + │ ^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:150:26 + │ +150 │ const Values: bool = 5 > 3 || 5 == 3; + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:153:9 + │ +153 │ 5 != 3 && 5 > 3 + │ ^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:158:9 + │ +158 │ {&x} == &y || (x as u64) > (*&y:u64); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '>=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01012]: comparison operations condition can be simplified + ┌─ tests/linter/true_positive_combinable_comparisons.move:159:9 + │ +159 │ © x == &y || x < move y; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ This comparison simplifies to the operation '<=' + │ + = This warning can be suppressed with '#[allow(lint(combinable_comparisons))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_positive_equal_operands.exp b/external-crates/move/crates/move-compiler/tests/linter/true_positive_equal_operands.exp deleted file mode 100644 index 0041277dae8bb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/true_positive_equal_operands.exp +++ /dev/null @@ -1,144 +0,0 @@ -warning[Lint W02011]: redundant, always-equal operands for binary operation - ┌─ tests/linter/true_positive_equal_operands.move:6:9 - │ -6 │ x % copy x; - │ ^^^^^^^^^^ - │ │ │ - │ │ Will always evaluate to the same value as this expression - │ Always equal operands detected in binary operation, which will evaluate to '0' - │ This expression - │ - = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02011]: redundant, always-equal operands for binary operation - ┌─ tests/linter/true_positive_equal_operands.move:7:9 - │ -7 │ copy x ^ x; - │ ^^^^^^^^^^ - │ │ │ - │ │ Will always evaluate to the same value as this expression - │ Always equal operands detected in binary operation, which will evaluate to '0' - │ This expression - │ - = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02011]: redundant, always-equal operands for binary operation - ┌─ tests/linter/true_positive_equal_operands.move:8:9 - │ -8 │ x / x; - │ ^^^^^ - │ │ │ - │ │ Will always evaluate to the same value as this expression - │ Always equal operands detected in binary operation, which will evaluate to '1' - │ This expression - │ - = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02011]: redundant, always-equal operands for binary operation - ┌─ tests/linter/true_positive_equal_operands.move:10:9 - │ -10 │ x | x; - │ ^^^^^ - │ │ │ - │ │ Will always evaluate to the same value as this expression - │ Always equal operands detected in binary operation, which will evaluate to the same value - │ This expression - │ - = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02011]: redundant, always-equal operands for binary operation - ┌─ tests/linter/true_positive_equal_operands.move:11:9 - │ -11 │ x & x; - │ ^^^^^ - │ │ │ - │ │ Will always evaluate to the same value as this expression - │ Always equal operands detected in binary operation, which will evaluate to the same value - │ This expression - │ - = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02011]: redundant, always-equal operands for binary operation - ┌─ tests/linter/true_positive_equal_operands.move:13:9 - │ -13 │ x != x; - │ ^^^^^^ - │ │ │ - │ │ Will always evaluate to the same value as this expression - │ Always equal operands detected in binary operation, which will evaluate to 'false' - │ This expression - │ - = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02011]: redundant, always-equal operands for binary operation - ┌─ tests/linter/true_positive_equal_operands.move:14:9 - │ -14 │ x < x; - │ ^^^^^ - │ │ │ - │ │ Will always evaluate to the same value as this expression - │ Always equal operands detected in binary operation, which will evaluate to 'false' - │ This expression - │ - = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02011]: redundant, always-equal operands for binary operation - ┌─ tests/linter/true_positive_equal_operands.move:15:9 - │ -15 │ x > x; - │ ^^^^^ - │ │ │ - │ │ Will always evaluate to the same value as this expression - │ Always equal operands detected in binary operation, which will evaluate to 'false' - │ This expression - │ - = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02011]: redundant, always-equal operands for binary operation - ┌─ tests/linter/true_positive_equal_operands.move:17:9 - │ -17 │ x == x; - │ ^^^^^^ - │ │ │ - │ │ Will always evaluate to the same value as this expression - │ Always equal operands detected in binary operation, which will evaluate to 'true' - │ This expression - │ - = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02011]: redundant, always-equal operands for binary operation - ┌─ tests/linter/true_positive_equal_operands.move:18:9 - │ -18 │ x <= x; - │ ^^^^^^ - │ │ │ - │ │ Will always evaluate to the same value as this expression - │ Always equal operands detected in binary operation, which will evaluate to 'true' - │ This expression - │ - = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02011]: redundant, always-equal operands for binary operation - ┌─ tests/linter/true_positive_equal_operands.move:19:9 - │ -19 │ copy x >= move x; - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Will always evaluate to the same value as this expression - │ Always equal operands detected in binary operation, which will evaluate to 'true' - │ This expression - │ - = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02011]: redundant, always-equal operands for binary operation - ┌─ tests/linter/true_positive_equal_operands.move:22:9 - │ -22 │ x == x; - │ ^^^^^^ - │ │ │ - │ │ Will always evaluate to the same value as this expression - │ Always equal operands detected in binary operation, which will evaluate to 'true' - │ This expression - │ - = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_positive_equal_operands.snap b/external-crates/move/crates/move-compiler/tests/linter/true_positive_equal_operands.snap new file mode 100644 index 0000000000000..7016e594dca7a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/true_positive_equal_operands.snap @@ -0,0 +1,151 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/true_positive_equal_operands.move +--- +warning[Lint W02011]: redundant, always-equal operands for binary operation + ┌─ tests/linter/true_positive_equal_operands.move:6:9 + │ +6 │ x % copy x; + │ ^^^^^^^^^^ + │ │ │ + │ │ Will always evaluate to the same value as this expression + │ Always equal operands detected in binary operation, which will evaluate to '0' + │ This expression + │ + = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02011]: redundant, always-equal operands for binary operation + ┌─ tests/linter/true_positive_equal_operands.move:7:9 + │ +7 │ copy x ^ x; + │ ^^^^^^^^^^ + │ │ │ + │ │ Will always evaluate to the same value as this expression + │ Always equal operands detected in binary operation, which will evaluate to '0' + │ This expression + │ + = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02011]: redundant, always-equal operands for binary operation + ┌─ tests/linter/true_positive_equal_operands.move:8:9 + │ +8 │ x / x; + │ ^^^^^ + │ │ │ + │ │ Will always evaluate to the same value as this expression + │ Always equal operands detected in binary operation, which will evaluate to '1' + │ This expression + │ + = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02011]: redundant, always-equal operands for binary operation + ┌─ tests/linter/true_positive_equal_operands.move:10:9 + │ +10 │ x | x; + │ ^^^^^ + │ │ │ + │ │ Will always evaluate to the same value as this expression + │ Always equal operands detected in binary operation, which will evaluate to the same value + │ This expression + │ + = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02011]: redundant, always-equal operands for binary operation + ┌─ tests/linter/true_positive_equal_operands.move:11:9 + │ +11 │ x & x; + │ ^^^^^ + │ │ │ + │ │ Will always evaluate to the same value as this expression + │ Always equal operands detected in binary operation, which will evaluate to the same value + │ This expression + │ + = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02011]: redundant, always-equal operands for binary operation + ┌─ tests/linter/true_positive_equal_operands.move:13:9 + │ +13 │ x != x; + │ ^^^^^^ + │ │ │ + │ │ Will always evaluate to the same value as this expression + │ Always equal operands detected in binary operation, which will evaluate to 'false' + │ This expression + │ + = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02011]: redundant, always-equal operands for binary operation + ┌─ tests/linter/true_positive_equal_operands.move:14:9 + │ +14 │ x < x; + │ ^^^^^ + │ │ │ + │ │ Will always evaluate to the same value as this expression + │ Always equal operands detected in binary operation, which will evaluate to 'false' + │ This expression + │ + = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02011]: redundant, always-equal operands for binary operation + ┌─ tests/linter/true_positive_equal_operands.move:15:9 + │ +15 │ x > x; + │ ^^^^^ + │ │ │ + │ │ Will always evaluate to the same value as this expression + │ Always equal operands detected in binary operation, which will evaluate to 'false' + │ This expression + │ + = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02011]: redundant, always-equal operands for binary operation + ┌─ tests/linter/true_positive_equal_operands.move:17:9 + │ +17 │ x == x; + │ ^^^^^^ + │ │ │ + │ │ Will always evaluate to the same value as this expression + │ Always equal operands detected in binary operation, which will evaluate to 'true' + │ This expression + │ + = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02011]: redundant, always-equal operands for binary operation + ┌─ tests/linter/true_positive_equal_operands.move:18:9 + │ +18 │ x <= x; + │ ^^^^^^ + │ │ │ + │ │ Will always evaluate to the same value as this expression + │ Always equal operands detected in binary operation, which will evaluate to 'true' + │ This expression + │ + = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02011]: redundant, always-equal operands for binary operation + ┌─ tests/linter/true_positive_equal_operands.move:19:9 + │ +19 │ copy x >= move x; + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Will always evaluate to the same value as this expression + │ Always equal operands detected in binary operation, which will evaluate to 'true' + │ This expression + │ + = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02011]: redundant, always-equal operands for binary operation + ┌─ tests/linter/true_positive_equal_operands.move:22:9 + │ +22 │ x == x; + │ ^^^^^^ + │ │ │ + │ │ Will always evaluate to the same value as this expression + │ Always equal operands detected in binary operation, which will evaluate to 'true' + │ This expression + │ + = This warning can be suppressed with '#[allow(lint(always_equal_operands))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_positive_loop_without_exit.exp b/external-crates/move/crates/move-compiler/tests/linter/true_positive_loop_without_exit.exp deleted file mode 100644 index ed14df04816b0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/true_positive_loop_without_exit.exp +++ /dev/null @@ -1,27 +0,0 @@ -warning[Lint W02006]: 'loop' without 'break' or 'return' - ┌─ tests/linter/true_positive_loop_without_exit.move:5:9 - │ -5 │ loop {} - │ ^^^^^^^ 'loop' without 'break' or 'return'. This code will until it errors, e.g. reaching an 'abort' or running out of gas - │ - = This warning can be suppressed with '#[allow(lint(loop_without_exit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02006]: 'loop' without 'break' or 'return' - ┌─ tests/linter/true_positive_loop_without_exit.move:10:9 - │ -10 │ loop { abort ZERO } - │ ^^^^^^^^^^^^^^^^^^^ 'loop' without 'break' or 'return'. This code will until it errors, e.g. reaching an 'abort' or running out of gas - │ - = This warning can be suppressed with '#[allow(lint(loop_without_exit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02006]: 'loop' without 'break' or 'return' - ┌─ tests/linter/true_positive_loop_without_exit.move:14:9 - │ -14 │ ╭ loop { -15 │ │ t2(); -16 │ │ t2(); -17 │ │ } - │ ╰─────────^ 'loop' without 'break' or 'return'. This code will until it errors, e.g. reaching an 'abort' or running out of gas - │ - = This warning can be suppressed with '#[allow(lint(loop_without_exit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_positive_loop_without_exit.snap b/external-crates/move/crates/move-compiler/tests/linter/true_positive_loop_without_exit.snap new file mode 100644 index 0000000000000..b36ce847bc79a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/true_positive_loop_without_exit.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/true_positive_loop_without_exit.move +--- +warning[Lint W02006]: 'loop' without 'break' or 'return' + ┌─ tests/linter/true_positive_loop_without_exit.move:5:9 + │ +5 │ loop {} + │ ^^^^^^^ 'loop' without 'break' or 'return'. This code will until it errors, e.g. reaching an 'abort' or running out of gas + │ + = This warning can be suppressed with '#[allow(lint(loop_without_exit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02006]: 'loop' without 'break' or 'return' + ┌─ tests/linter/true_positive_loop_without_exit.move:10:9 + │ +10 │ loop { abort ZERO } + │ ^^^^^^^^^^^^^^^^^^^ 'loop' without 'break' or 'return'. This code will until it errors, e.g. reaching an 'abort' or running out of gas + │ + = This warning can be suppressed with '#[allow(lint(loop_without_exit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02006]: 'loop' without 'break' or 'return' + ┌─ tests/linter/true_positive_loop_without_exit.move:14:9 + │ +14 │ ╭ loop { +15 │ │ t2(); +16 │ │ t2(); +17 │ │ } + │ ╰─────────^ 'loop' without 'break' or 'return'. This code will until it errors, e.g. reaching an 'abort' or running out of gas + │ + = This warning can be suppressed with '#[allow(lint(loop_without_exit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_positive_meaningless_math_operation.exp b/external-crates/move/crates/move-compiler/tests/linter/true_positive_meaningless_math_operation.exp deleted file mode 100644 index 2f96dcd1e65ad..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/true_positive_meaningless_math_operation.exp +++ /dev/null @@ -1,340 +0,0 @@ -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:3:9 - │ -3 │ x * 1; - │ ^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation has no effect and can be removed - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:4:9 - │ -4 │ 1 * x; - │ ^^^^^ - │ │ - │ This operation has no effect and can be removed - │ Because of this operand - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:5:9 - │ -5 │ x / 1; - │ ^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation has no effect and can be removed - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:6:9 - │ -6 │ x + 0; - │ ^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation has no effect and can be removed - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:7:9 - │ -7 │ 0 + x; - │ ^^^^^ - │ │ - │ This operation has no effect and can be removed - │ Because of this operand - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:8:9 - │ -8 │ x - 0; - │ ^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation has no effect and can be removed - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:9:9 - │ -9 │ x << 0; - │ ^^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation has no effect and can be removed - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:10:9 - │ -10 │ x << 0; - │ ^^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation has no effect and can be removed - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:14:9 - │ -14 │ x * 0; - │ ^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation is always zero and can be replaced with '0' - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:15:9 - │ -15 │ 0 * x; - │ ^^^^^ - │ │ - │ This operation is always zero and can be replaced with '0' - │ Because of this operand - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:16:9 - │ -16 │ 0 / x; - │ ^^^^^ - │ │ - │ This operation is always zero and can be replaced with '0' - │ Because of this operand - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:17:9 - │ -17 │ 0 % x; - │ ^^^^^ - │ │ - │ This operation is always zero and can be replaced with '0' - │ Because of this operand - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:18:9 - │ -18 │ x % 1; - │ ^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation is always zero and can be replaced with '0' - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:22:9 - │ -22 │ 1 % x; - │ ^^^^^ - │ │ - │ This operation is always one and can be replaced with '1' - │ Because of this operand - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:27:9 - │ -26 │ let y = 1; - │ - Because of this operand -27 │ x * y; - │ ^^^^^ This operation has no effect and can be removed - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:28:9 - │ -28 │ x - (1 - 1); - │ ^^^^^^^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation has no effect and can be removed - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:32:9 - │ -32 │ x * 1; - │ ^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation has no effect and can be removed - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:33:9 - │ -33 │ x * 0; - │ ^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation is always zero and can be replaced with '0' - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:34:9 - │ -34 │ 1 % x; - │ ^^^^^ - │ │ - │ This operation is always one and can be replaced with '1' - │ Because of this operand - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:38:9 - │ -38 │ x * 1; - │ ^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation has no effect and can be removed - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:39:9 - │ -39 │ x * 0; - │ ^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation is always zero and can be replaced with '0' - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:40:9 - │ -40 │ 1 % x; - │ ^^^^^ - │ │ - │ This operation is always one and can be replaced with '1' - │ Because of this operand - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:44:9 - │ -44 │ x * 1; - │ ^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation has no effect and can be removed - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:45:9 - │ -45 │ x * 0; - │ ^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation is always zero and can be replaced with '0' - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:46:9 - │ -46 │ 1 % x; - │ ^^^^^ - │ │ - │ This operation is always one and can be replaced with '1' - │ Because of this operand - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:50:9 - │ -50 │ x * 1; - │ ^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation has no effect and can be removed - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:51:9 - │ -51 │ x * 0; - │ ^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation is always zero and can be replaced with '0' - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:52:9 - │ -52 │ 1 % x; - │ ^^^^^ - │ │ - │ This operation is always one and can be replaced with '1' - │ Because of this operand - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:56:9 - │ -56 │ x * 1; - │ ^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation has no effect and can be removed - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:57:9 - │ -57 │ x * 0; - │ ^^^^^ - │ │ │ - │ │ Because of this operand - │ This operation is always zero and can be replaced with '0' - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01003]: math operator can be simplified - ┌─ tests/linter/true_positive_meaningless_math_operation.move:58:9 - │ -58 │ 1 % x; - │ ^^^^^ - │ │ - │ This operation is always one and can be replaced with '1' - │ Because of this operand - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_positive_meaningless_math_operation.snap b/external-crates/move/crates/move-compiler/tests/linter/true_positive_meaningless_math_operation.snap new file mode 100644 index 0000000000000..936a267ccf7b7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/true_positive_meaningless_math_operation.snap @@ -0,0 +1,347 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/true_positive_meaningless_math_operation.move +--- +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:3:9 + │ +3 │ x * 1; + │ ^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation has no effect and can be removed + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:4:9 + │ +4 │ 1 * x; + │ ^^^^^ + │ │ + │ This operation has no effect and can be removed + │ Because of this operand + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:5:9 + │ +5 │ x / 1; + │ ^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation has no effect and can be removed + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:6:9 + │ +6 │ x + 0; + │ ^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation has no effect and can be removed + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:7:9 + │ +7 │ 0 + x; + │ ^^^^^ + │ │ + │ This operation has no effect and can be removed + │ Because of this operand + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:8:9 + │ +8 │ x - 0; + │ ^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation has no effect and can be removed + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:9:9 + │ +9 │ x << 0; + │ ^^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation has no effect and can be removed + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:10:9 + │ +10 │ x << 0; + │ ^^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation has no effect and can be removed + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:14:9 + │ +14 │ x * 0; + │ ^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation is always zero and can be replaced with '0' + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:15:9 + │ +15 │ 0 * x; + │ ^^^^^ + │ │ + │ This operation is always zero and can be replaced with '0' + │ Because of this operand + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:16:9 + │ +16 │ 0 / x; + │ ^^^^^ + │ │ + │ This operation is always zero and can be replaced with '0' + │ Because of this operand + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:17:9 + │ +17 │ 0 % x; + │ ^^^^^ + │ │ + │ This operation is always zero and can be replaced with '0' + │ Because of this operand + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:18:9 + │ +18 │ x % 1; + │ ^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation is always zero and can be replaced with '0' + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:22:9 + │ +22 │ 1 % x; + │ ^^^^^ + │ │ + │ This operation is always one and can be replaced with '1' + │ Because of this operand + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:27:9 + │ +26 │ let y = 1; + │ - Because of this operand +27 │ x * y; + │ ^^^^^ This operation has no effect and can be removed + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:28:9 + │ +28 │ x - (1 - 1); + │ ^^^^^^^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation has no effect and can be removed + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:32:9 + │ +32 │ x * 1; + │ ^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation has no effect and can be removed + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:33:9 + │ +33 │ x * 0; + │ ^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation is always zero and can be replaced with '0' + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:34:9 + │ +34 │ 1 % x; + │ ^^^^^ + │ │ + │ This operation is always one and can be replaced with '1' + │ Because of this operand + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:38:9 + │ +38 │ x * 1; + │ ^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation has no effect and can be removed + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:39:9 + │ +39 │ x * 0; + │ ^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation is always zero and can be replaced with '0' + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:40:9 + │ +40 │ 1 % x; + │ ^^^^^ + │ │ + │ This operation is always one and can be replaced with '1' + │ Because of this operand + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:44:9 + │ +44 │ x * 1; + │ ^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation has no effect and can be removed + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:45:9 + │ +45 │ x * 0; + │ ^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation is always zero and can be replaced with '0' + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:46:9 + │ +46 │ 1 % x; + │ ^^^^^ + │ │ + │ This operation is always one and can be replaced with '1' + │ Because of this operand + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:50:9 + │ +50 │ x * 1; + │ ^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation has no effect and can be removed + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:51:9 + │ +51 │ x * 0; + │ ^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation is always zero and can be replaced with '0' + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:52:9 + │ +52 │ 1 % x; + │ ^^^^^ + │ │ + │ This operation is always one and can be replaced with '1' + │ Because of this operand + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:56:9 + │ +56 │ x * 1; + │ ^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation has no effect and can be removed + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:57:9 + │ +57 │ x * 0; + │ ^^^^^ + │ │ │ + │ │ Because of this operand + │ This operation is always zero and can be replaced with '0' + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01003]: math operator can be simplified + ┌─ tests/linter/true_positive_meaningless_math_operation.move:58:9 + │ +58 │ 1 % x; + │ ^^^^^ + │ │ + │ This operation is always one and can be replaced with '1' + │ Because of this operand + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_math))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_positive_self_assignment.exp b/external-crates/move/crates/move-compiler/tests/linter/true_positive_self_assignment.exp deleted file mode 100644 index 5b9cc76f34d27..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/true_positive_self_assignment.exp +++ /dev/null @@ -1,318 +0,0 @@ -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:5:9 - │ -5 │ p = p; // warn - │ ^ - Is the same as this location - │ │ - │ Unnecessary self-assignment. The assignment is redundant and will not change the value - │ This location - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:10:9 - │ -10 │ x = x; // warn - │ ^ - Is the same as this location - │ │ - │ Unnecessary self-assignment. The assignment is redundant and will not change the value - │ This location - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:13:9 - │ -13 │ x = move x; // warn - │ ^ ------ Is the same as this location - │ │ - │ Unnecessary self-assignment. The assignment is redundant and will not change the value - │ This location - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:15:9 - │ -15 │ x = copy x; // warn - │ ^ ------ Is the same as this location - │ │ - │ Unnecessary self-assignment. The assignment is redundant and will not change the value - │ This location - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:18:10 - │ -18 │ (p, other, x) = (p, 0, x); // warn x2 - │ ^ - Is the same as this location - │ │ - │ Unnecessary self-assignment. The assignment is redundant and will not change the value - │ This location - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:18:20 - │ -18 │ (p, other, x) = (p, 0, x); // warn x2 - │ ^ - Is the same as this location - │ │ - │ Unnecessary self-assignment. The assignment is redundant and will not change the value - │ This location - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:27:9 - │ -27 │ *&mut m.f1 = m.f1; - │ ^^^^^^^^^^^^^^^^^ - │ ││ │ - │ ││ Is the same as this location - │ │This location - │ Unnecessary self-mutation. The mutation is redundant and will not change the value - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:28:9 - │ -28 │ m.f1 = *&mut m.f1; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Is the same as this location - │ Unnecessary self-mutation. The mutation is redundant and will not change the value - │ This location - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/true_positive_self_assignment.move:28:17 - │ -28 │ m.f1 = *&mut m.f1; - │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:29:9 - │ -29 │ m.f1 = *&m.f1; - │ ^^^^^^^^^^^^^^ - │ │ │ - │ │ Is the same as this location - │ Unnecessary self-mutation. The mutation is redundant and will not change the value - │ This location - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/true_positive_self_assignment.move:29:17 - │ -29 │ m.f1 = *&m.f1; - │ ^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:30:9 - │ -30 │ *&mut m.f1 = *&m.f1; - │ ^^^^^^^^^^^^^^^^^^^^ - │ ││ │ - │ ││ Is the same as this location - │ │This location - │ Unnecessary self-mutation. The mutation is redundant and will not change the value - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/true_positive_self_assignment.move:30:23 - │ -30 │ *&mut m.f1 = *&m.f1; - │ ^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:31:9 - │ -31 │ *&mut m.f1 = *&mut m.f1; - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ ││ │ - │ ││ Is the same as this location - │ │This location - │ Unnecessary self-mutation. The mutation is redundant and will not change the value - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/true_positive_self_assignment.move:31:23 - │ -31 │ *&mut m.f1 = *&mut m.f1; - │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:33:9 - │ -33 │ *&mut s.f1 = s.f1; - │ ^^^^^^^^^^^^^^^^^ - │ ││ │ - │ ││ Is the same as this location - │ │This location - │ Unnecessary self-mutation. The mutation is redundant and will not change the value - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:34:9 - │ -34 │ s.f1 = *&mut s.f1; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Is the same as this location - │ Unnecessary self-mutation. The mutation is redundant and will not change the value - │ This location - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/true_positive_self_assignment.move:34:17 - │ -34 │ s.f1 = *&mut s.f1; - │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:35:9 - │ -35 │ s.f1 = *&s.f1; - │ ^^^^^^^^^^^^^^ - │ │ │ - │ │ Is the same as this location - │ Unnecessary self-mutation. The mutation is redundant and will not change the value - │ This location - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/true_positive_self_assignment.move:35:17 - │ -35 │ s.f1 = *&s.f1; - │ ^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:36:9 - │ -36 │ *&mut s.f1 = *&s.f1; - │ ^^^^^^^^^^^^^^^^^^^^ - │ ││ │ - │ ││ Is the same as this location - │ │This location - │ Unnecessary self-mutation. The mutation is redundant and will not change the value - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/true_positive_self_assignment.move:36:23 - │ -36 │ *&mut s.f1 = *&s.f1; - │ ^^^^^^ Redundant borrow-dereference detected. Use the field access directly. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:37:9 - │ -37 │ *&mut s.f1 = *&mut s.f1; - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ ││ │ - │ ││ Is the same as this location - │ │This location - │ Unnecessary self-mutation. The mutation is redundant and will not change the value - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/true_positive_self_assignment.move:37:23 - │ -37 │ *&mut s.f1 = *&mut s.f1; - │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:43:9 - │ -43 │ p.s1.f1 = p.s1.f1; - │ ^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Is the same as this location - │ Unnecessary self-mutation. The mutation is redundant and will not change the value - │ This location - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:47:9 - │ -47 │ *r = *r; - │ ^^^^^^^ - │ ││ │ - │ ││ Is the same as this location - │ │This location - │ Unnecessary self-mutation. The mutation is redundant and will not change the value - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:49:9 - │ -49 │ *copy r = *r; - │ ^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Is the same as this location - │ │ This location - │ Unnecessary self-mutation. The mutation is redundant and will not change the value - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:50:9 - │ -50 │ *move r = *copy r; - │ ^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Is the same as this location - │ │ This location - │ Unnecessary self-mutation. The mutation is redundant and will not change the value - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W02008]: assignment preserves the same value - ┌─ tests/linter/true_positive_self_assignment.move:53:9 - │ -53 │ *&mut x = *&mut x; - │ ^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Is the same as this location - │ │ This location - │ Unnecessary self-mutation. The mutation is redundant and will not change the value - │ - = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01009]: redundant reference/dereference - ┌─ tests/linter/true_positive_self_assignment.move:53:19 - │ -53 │ *&mut x = *&mut x; - │ ^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. - │ - = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_positive_self_assignment.snap b/external-crates/move/crates/move-compiler/tests/linter/true_positive_self_assignment.snap new file mode 100644 index 0000000000000..1c71e5956b02c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/true_positive_self_assignment.snap @@ -0,0 +1,325 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/true_positive_self_assignment.move +--- +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:5:9 + │ +5 │ p = p; // warn + │ ^ - Is the same as this location + │ │ + │ Unnecessary self-assignment. The assignment is redundant and will not change the value + │ This location + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:10:9 + │ +10 │ x = x; // warn + │ ^ - Is the same as this location + │ │ + │ Unnecessary self-assignment. The assignment is redundant and will not change the value + │ This location + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:13:9 + │ +13 │ x = move x; // warn + │ ^ ------ Is the same as this location + │ │ + │ Unnecessary self-assignment. The assignment is redundant and will not change the value + │ This location + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:15:9 + │ +15 │ x = copy x; // warn + │ ^ ------ Is the same as this location + │ │ + │ Unnecessary self-assignment. The assignment is redundant and will not change the value + │ This location + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:18:10 + │ +18 │ (p, other, x) = (p, 0, x); // warn x2 + │ ^ - Is the same as this location + │ │ + │ Unnecessary self-assignment. The assignment is redundant and will not change the value + │ This location + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:18:20 + │ +18 │ (p, other, x) = (p, 0, x); // warn x2 + │ ^ - Is the same as this location + │ │ + │ Unnecessary self-assignment. The assignment is redundant and will not change the value + │ This location + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:27:9 + │ +27 │ *&mut m.f1 = m.f1; + │ ^^^^^^^^^^^^^^^^^ + │ ││ │ + │ ││ Is the same as this location + │ │This location + │ Unnecessary self-mutation. The mutation is redundant and will not change the value + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:28:9 + │ +28 │ m.f1 = *&mut m.f1; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Is the same as this location + │ Unnecessary self-mutation. The mutation is redundant and will not change the value + │ This location + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/true_positive_self_assignment.move:28:17 + │ +28 │ m.f1 = *&mut m.f1; + │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:29:9 + │ +29 │ m.f1 = *&m.f1; + │ ^^^^^^^^^^^^^^ + │ │ │ + │ │ Is the same as this location + │ Unnecessary self-mutation. The mutation is redundant and will not change the value + │ This location + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/true_positive_self_assignment.move:29:17 + │ +29 │ m.f1 = *&m.f1; + │ ^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:30:9 + │ +30 │ *&mut m.f1 = *&m.f1; + │ ^^^^^^^^^^^^^^^^^^^^ + │ ││ │ + │ ││ Is the same as this location + │ │This location + │ Unnecessary self-mutation. The mutation is redundant and will not change the value + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/true_positive_self_assignment.move:30:23 + │ +30 │ *&mut m.f1 = *&m.f1; + │ ^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:31:9 + │ +31 │ *&mut m.f1 = *&mut m.f1; + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ ││ │ + │ ││ Is the same as this location + │ │This location + │ Unnecessary self-mutation. The mutation is redundant and will not change the value + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/true_positive_self_assignment.move:31:23 + │ +31 │ *&mut m.f1 = *&mut m.f1; + │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:33:9 + │ +33 │ *&mut s.f1 = s.f1; + │ ^^^^^^^^^^^^^^^^^ + │ ││ │ + │ ││ Is the same as this location + │ │This location + │ Unnecessary self-mutation. The mutation is redundant and will not change the value + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:34:9 + │ +34 │ s.f1 = *&mut s.f1; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Is the same as this location + │ Unnecessary self-mutation. The mutation is redundant and will not change the value + │ This location + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/true_positive_self_assignment.move:34:17 + │ +34 │ s.f1 = *&mut s.f1; + │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:35:9 + │ +35 │ s.f1 = *&s.f1; + │ ^^^^^^^^^^^^^^ + │ │ │ + │ │ Is the same as this location + │ Unnecessary self-mutation. The mutation is redundant and will not change the value + │ This location + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/true_positive_self_assignment.move:35:17 + │ +35 │ s.f1 = *&s.f1; + │ ^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:36:9 + │ +36 │ *&mut s.f1 = *&s.f1; + │ ^^^^^^^^^^^^^^^^^^^^ + │ ││ │ + │ ││ Is the same as this location + │ │This location + │ Unnecessary self-mutation. The mutation is redundant and will not change the value + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/true_positive_self_assignment.move:36:23 + │ +36 │ *&mut s.f1 = *&s.f1; + │ ^^^^^^ Redundant borrow-dereference detected. Use the field access directly. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:37:9 + │ +37 │ *&mut s.f1 = *&mut s.f1; + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ ││ │ + │ ││ Is the same as this location + │ │This location + │ Unnecessary self-mutation. The mutation is redundant and will not change the value + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/true_positive_self_assignment.move:37:23 + │ +37 │ *&mut s.f1 = *&mut s.f1; + │ ^^^^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:43:9 + │ +43 │ p.s1.f1 = p.s1.f1; + │ ^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Is the same as this location + │ Unnecessary self-mutation. The mutation is redundant and will not change the value + │ This location + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:47:9 + │ +47 │ *r = *r; + │ ^^^^^^^ + │ ││ │ + │ ││ Is the same as this location + │ │This location + │ Unnecessary self-mutation. The mutation is redundant and will not change the value + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:49:9 + │ +49 │ *copy r = *r; + │ ^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Is the same as this location + │ │ This location + │ Unnecessary self-mutation. The mutation is redundant and will not change the value + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:50:9 + │ +50 │ *move r = *copy r; + │ ^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Is the same as this location + │ │ This location + │ Unnecessary self-mutation. The mutation is redundant and will not change the value + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W02008]: assignment preserves the same value + ┌─ tests/linter/true_positive_self_assignment.move:53:9 + │ +53 │ *&mut x = *&mut x; + │ ^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Is the same as this location + │ │ This location + │ Unnecessary self-mutation. The mutation is redundant and will not change the value + │ + = This warning can be suppressed with '#[allow(lint(self_assignment))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01009]: redundant reference/dereference + ┌─ tests/linter/true_positive_self_assignment.move:53:19 + │ +53 │ *&mut x = *&mut x; + │ ^^^^^^^ Redundant borrow-dereference detected. Replace this borrow-deref with 'copy'. + │ + = This warning can be suppressed with '#[allow(lint(redundant_ref_deref))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_positive_unnecessary_conitional.exp b/external-crates/move/crates/move-compiler/tests/linter/true_positive_unnecessary_conitional.exp deleted file mode 100644 index 747a6aa889c13..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/true_positive_unnecessary_conitional.exp +++ /dev/null @@ -1,52 +0,0 @@ -warning[Lint W01007]: 'if' expression can be removed - ┌─ tests/linter/true_positive_unnecessary_conitional.move:4:9 - │ -4 │ if (!condition) true else false; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Detected an unnecessary conditional expression 'if (cond)'. Consider using the condition directly, i.e. 'cond' - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_conditional))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01007]: 'if' expression can be removed - ┌─ tests/linter/true_positive_unnecessary_conitional.move:5:9 - │ -5 │ if (condition) { { false } } else { (true: bool) }; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Detected an unnecessary conditional expression 'if (cond)'. Consider using the condition directly, i.e. '!cond' - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_conditional))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01007]: 'if' expression can be removed - ┌─ tests/linter/true_positive_unnecessary_conitional.move:9:9 - │ -9 │ if (true) true else true; - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ is the same as this value - │ │ This value - │ Detected a redundant conditional expression 'if (..) v else v', where each branch results in the same value 'v'. Consider using the value directly - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_conditional))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01007]: 'if' expression can be removed - ┌─ tests/linter/true_positive_unnecessary_conitional.move:10:9 - │ -10 │ if (foo()) 0 else 0; - │ ^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ is the same as this value - │ │ This value - │ Detected a redundant conditional expression 'if (..) v else v', where each branch results in the same value 'v'. Consider using the value directly - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_conditional))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W01007]: 'if' expression can be removed - ┌─ tests/linter/true_positive_unnecessary_conitional.move:11:9 - │ -11 │ if (!foo()) b"" else x""; - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ is the same as this value - │ │ This value - │ Detected a redundant conditional expression 'if (..) v else v', where each branch results in the same value 'v'. Consider using the value directly - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_conditional))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_positive_unnecessary_conitional.snap b/external-crates/move/crates/move-compiler/tests/linter/true_positive_unnecessary_conitional.snap new file mode 100644 index 0000000000000..ca424819e4814 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/true_positive_unnecessary_conitional.snap @@ -0,0 +1,59 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/true_positive_unnecessary_conitional.move +--- +warning[Lint W01007]: 'if' expression can be removed + ┌─ tests/linter/true_positive_unnecessary_conitional.move:4:9 + │ +4 │ if (!condition) true else false; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Detected an unnecessary conditional expression 'if (cond)'. Consider using the condition directly, i.e. 'cond' + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_conditional))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01007]: 'if' expression can be removed + ┌─ tests/linter/true_positive_unnecessary_conitional.move:5:9 + │ +5 │ if (condition) { { false } } else { (true: bool) }; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Detected an unnecessary conditional expression 'if (cond)'. Consider using the condition directly, i.e. '!cond' + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_conditional))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01007]: 'if' expression can be removed + ┌─ tests/linter/true_positive_unnecessary_conitional.move:9:9 + │ +9 │ if (true) true else true; + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ is the same as this value + │ │ This value + │ Detected a redundant conditional expression 'if (..) v else v', where each branch results in the same value 'v'. Consider using the value directly + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_conditional))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01007]: 'if' expression can be removed + ┌─ tests/linter/true_positive_unnecessary_conitional.move:10:9 + │ +10 │ if (foo()) 0 else 0; + │ ^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ is the same as this value + │ │ This value + │ Detected a redundant conditional expression 'if (..) v else v', where each branch results in the same value 'v'. Consider using the value directly + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_conditional))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W01007]: 'if' expression can be removed + ┌─ tests/linter/true_positive_unnecessary_conitional.move:11:9 + │ +11 │ if (!foo()) b"" else x""; + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ is the same as this value + │ │ This value + │ Detected a redundant conditional expression 'if (..) v else v', where each branch results in the same value 'v'. Consider using the value directly + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_conditional))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_positive_unnecessary_unit.exp b/external-crates/move/crates/move-compiler/tests/linter/true_positive_unnecessary_unit.exp deleted file mode 100644 index 3b81304356f04..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/true_positive_unnecessary_unit.exp +++ /dev/null @@ -1,151 +0,0 @@ -warning[Lint W04010]: unit `()` expression can be removed or simplified - ┌─ tests/linter/true_positive_unnecessary_unit.move:6:16 - │ -6 │ if (b) () else { x = 1 }; - │ - ^^ Unnecessary unit '()' - │ │ - │ Consider negating the 'if' condition and simplifying - │ - = For example 'if (cond) () else e' can be simplified to 'if (!cond) e' - = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04010]: unit `()` expression can be removed or simplified - ┌─ tests/linter/true_positive_unnecessary_unit.move:8:16 - │ -8 │ if (b) {} else { x = 1 }; - │ - ^^ Unnecessary unit '()' - │ │ - │ Consider negating the 'if' condition and simplifying - │ - = For example 'if (cond) () else e' can be simplified to 'if (!cond) e' - = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04010]: unit `()` expression can be removed or simplified - ┌─ tests/linter/true_positive_unnecessary_unit.move:10:16 - │ -10 │ if (b) { () } else { x = 1 }; - │ - ^^^^^^ Unnecessary unit '()' - │ │ - │ Consider negating the 'if' condition and simplifying - │ - = For example 'if (cond) () else e' can be simplified to 'if (!cond) e' - = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04010]: unit `()` expression can be removed or simplified - ┌─ tests/linter/true_positive_unnecessary_unit.move:12:16 - │ -12 │ if (b) { - │ - Consider negating the 'if' condition and simplifying - │ ╭────────────────^ -13 │ │ // new line and comment does not suppress it -14 │ │ } else { x = 1 }; - │ ╰─────────^ Unnecessary unit '()' - │ - = For example 'if (cond) () else e' can be simplified to 'if (!cond) e' - = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04010]: unit `()` expression can be removed or simplified - ┌─ tests/linter/true_positive_unnecessary_unit.move:21:31 - │ -21 │ if (b) { x = 1 } else (); - │ ----------------------^^ - │ │ │ - │ │ Unnecessary 'else ()'. - │ An 'if' without an 'else' has an implicit 'else ()'. Consider removing the 'else' branch - │ - = For example 'if (cond) e else ()' can be simplified to 'if (cond) e' - = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04010]: unit `()` expression can be removed or simplified - ┌─ tests/linter/true_positive_unnecessary_unit.move:23:31 - │ -23 │ if (b) { x = 1 } else {}; - │ ----------------------^^ - │ │ │ - │ │ Unnecessary 'else ()'. - │ An 'if' without an 'else' has an implicit 'else ()'. Consider removing the 'else' branch - │ - = For example 'if (cond) e else ()' can be simplified to 'if (cond) e' - = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04010]: unit `()` expression can be removed or simplified - ┌─ tests/linter/true_positive_unnecessary_unit.move:25:31 - │ -25 │ if (b) { x = 1 } else { () }; - │ ----------------------^^^^^^ - │ │ │ - │ │ Unnecessary 'else ()'. - │ An 'if' without an 'else' has an implicit 'else ()'. Consider removing the 'else' branch - │ - = For example 'if (cond) e else ()' can be simplified to 'if (cond) e' - = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04010]: unit `()` expression can be removed or simplified - ┌─ tests/linter/true_positive_unnecessary_unit.move:27:31 - │ -27 │ ╭ if (b) { x = 1 } else { - │ ╭─────────────────────────────────^ -28 │ │ │ // new line and comment does not suppress it -29 │ │ │ }; - │ ╰─│─────────^ Unnecessary 'else ()'. - │ ╰─────────' An 'if' without an 'else' has an implicit 'else ()'. Consider removing the 'else' branch - │ - = For example 'if (cond) e else ()' can be simplified to 'if (cond) e' - = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04010]: unit `()` expression can be removed or simplified - ┌─ tests/linter/true_positive_unnecessary_unit.move:34:9 - │ -34 │ (); - │ ^^ Unnecessary unit in sequence '();'. Consider removing - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04010]: unit `()` expression can be removed or simplified - ┌─ tests/linter/true_positive_unnecessary_unit.move:37:18 - │ -37 │ if (b) { (); () } else { x = 1 }; // doesn't trigger if/else case - │ ^^ Unnecessary unit in sequence '();'. Consider removing - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04010]: unit `()` expression can be removed or simplified - ┌─ tests/linter/true_positive_unnecessary_unit.move:39:33 - │ -39 │ if (b) { x = 1 } else { (); (); () }; // doesn't trigger if/else case - │ ^^ Unnecessary unit in sequence '();'. Consider removing - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04010]: unit `()` expression can be removed or simplified - ┌─ tests/linter/true_positive_unnecessary_unit.move:39:37 - │ -39 │ if (b) { x = 1 } else { (); (); () }; // doesn't trigger if/else case - │ ^^ Unnecessary unit in sequence '();'. Consider removing - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04010]: unit `()` expression can be removed or simplified - ┌─ tests/linter/true_positive_unnecessary_unit.move:41:9 - │ -41 │ {}; - │ ^^ Unnecessary unit in sequence '();'. Consider removing - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04010]: unit `()` expression can be removed or simplified - ┌─ tests/linter/true_positive_unnecessary_unit.move:42:9 - │ -42 │ { () }; // inner isn't an error but the outer is - │ ^^^^^^ Unnecessary unit in sequence '();'. Consider removing - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04010]: unit `()` expression can be removed or simplified - ┌─ tests/linter/true_positive_unnecessary_unit.move:43:11 - │ -43 │ { (); }; // inner is an error but outer isn't - │ ^^ Unnecessary unit in sequence '();'. Consider removing - │ - = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_positive_unnecessary_unit.snap b/external-crates/move/crates/move-compiler/tests/linter/true_positive_unnecessary_unit.snap new file mode 100644 index 0000000000000..4b7eca01e5ac8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/true_positive_unnecessary_unit.snap @@ -0,0 +1,158 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/true_positive_unnecessary_unit.move +--- +warning[Lint W04010]: unit `()` expression can be removed or simplified + ┌─ tests/linter/true_positive_unnecessary_unit.move:6:16 + │ +6 │ if (b) () else { x = 1 }; + │ - ^^ Unnecessary unit '()' + │ │ + │ Consider negating the 'if' condition and simplifying + │ + = For example 'if (cond) () else e' can be simplified to 'if (!cond) e' + = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04010]: unit `()` expression can be removed or simplified + ┌─ tests/linter/true_positive_unnecessary_unit.move:8:16 + │ +8 │ if (b) {} else { x = 1 }; + │ - ^^ Unnecessary unit '()' + │ │ + │ Consider negating the 'if' condition and simplifying + │ + = For example 'if (cond) () else e' can be simplified to 'if (!cond) e' + = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04010]: unit `()` expression can be removed or simplified + ┌─ tests/linter/true_positive_unnecessary_unit.move:10:16 + │ +10 │ if (b) { () } else { x = 1 }; + │ - ^^^^^^ Unnecessary unit '()' + │ │ + │ Consider negating the 'if' condition and simplifying + │ + = For example 'if (cond) () else e' can be simplified to 'if (!cond) e' + = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04010]: unit `()` expression can be removed or simplified + ┌─ tests/linter/true_positive_unnecessary_unit.move:12:16 + │ +12 │ if (b) { + │ - Consider negating the 'if' condition and simplifying + │ ╭────────────────^ +13 │ │ // new line and comment does not suppress it +14 │ │ } else { x = 1 }; + │ ╰─────────^ Unnecessary unit '()' + │ + = For example 'if (cond) () else e' can be simplified to 'if (!cond) e' + = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04010]: unit `()` expression can be removed or simplified + ┌─ tests/linter/true_positive_unnecessary_unit.move:21:31 + │ +21 │ if (b) { x = 1 } else (); + │ ----------------------^^ + │ │ │ + │ │ Unnecessary 'else ()'. + │ An 'if' without an 'else' has an implicit 'else ()'. Consider removing the 'else' branch + │ + = For example 'if (cond) e else ()' can be simplified to 'if (cond) e' + = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04010]: unit `()` expression can be removed or simplified + ┌─ tests/linter/true_positive_unnecessary_unit.move:23:31 + │ +23 │ if (b) { x = 1 } else {}; + │ ----------------------^^ + │ │ │ + │ │ Unnecessary 'else ()'. + │ An 'if' without an 'else' has an implicit 'else ()'. Consider removing the 'else' branch + │ + = For example 'if (cond) e else ()' can be simplified to 'if (cond) e' + = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04010]: unit `()` expression can be removed or simplified + ┌─ tests/linter/true_positive_unnecessary_unit.move:25:31 + │ +25 │ if (b) { x = 1 } else { () }; + │ ----------------------^^^^^^ + │ │ │ + │ │ Unnecessary 'else ()'. + │ An 'if' without an 'else' has an implicit 'else ()'. Consider removing the 'else' branch + │ + = For example 'if (cond) e else ()' can be simplified to 'if (cond) e' + = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04010]: unit `()` expression can be removed or simplified + ┌─ tests/linter/true_positive_unnecessary_unit.move:27:31 + │ +27 │ ╭ if (b) { x = 1 } else { + │ ╭─────────────────────────────────^ +28 │ │ │ // new line and comment does not suppress it +29 │ │ │ }; + │ ╰─│─────────^ Unnecessary 'else ()'. + │ ╰─────────' An 'if' without an 'else' has an implicit 'else ()'. Consider removing the 'else' branch + │ + = For example 'if (cond) e else ()' can be simplified to 'if (cond) e' + = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04010]: unit `()` expression can be removed or simplified + ┌─ tests/linter/true_positive_unnecessary_unit.move:34:9 + │ +34 │ (); + │ ^^ Unnecessary unit in sequence '();'. Consider removing + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04010]: unit `()` expression can be removed or simplified + ┌─ tests/linter/true_positive_unnecessary_unit.move:37:18 + │ +37 │ if (b) { (); () } else { x = 1 }; // doesn't trigger if/else case + │ ^^ Unnecessary unit in sequence '();'. Consider removing + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04010]: unit `()` expression can be removed or simplified + ┌─ tests/linter/true_positive_unnecessary_unit.move:39:33 + │ +39 │ if (b) { x = 1 } else { (); (); () }; // doesn't trigger if/else case + │ ^^ Unnecessary unit in sequence '();'. Consider removing + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04010]: unit `()` expression can be removed or simplified + ┌─ tests/linter/true_positive_unnecessary_unit.move:39:37 + │ +39 │ if (b) { x = 1 } else { (); (); () }; // doesn't trigger if/else case + │ ^^ Unnecessary unit in sequence '();'. Consider removing + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04010]: unit `()` expression can be removed or simplified + ┌─ tests/linter/true_positive_unnecessary_unit.move:41:9 + │ +41 │ {}; + │ ^^ Unnecessary unit in sequence '();'. Consider removing + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04010]: unit `()` expression can be removed or simplified + ┌─ tests/linter/true_positive_unnecessary_unit.move:42:9 + │ +42 │ { () }; // inner isn't an error but the outer is + │ ^^^^^^ Unnecessary unit in sequence '();'. Consider removing + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04010]: unit `()` expression can be removed or simplified + ┌─ tests/linter/true_positive_unnecessary_unit.move:43:11 + │ +43 │ { (); }; // inner is an error but outer isn't + │ ^^ Unnecessary unit in sequence '();'. Consider removing + │ + = This warning can be suppressed with '#[allow(lint(unnecessary_unit))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_positive_unnecessary_while_loop.exp b/external-crates/move/crates/move-compiler/tests/linter/true_positive_unnecessary_while_loop.exp deleted file mode 100644 index d1ccfb5973007..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/linter/true_positive_unnecessary_while_loop.exp +++ /dev/null @@ -1,18 +0,0 @@ -warning[Lint W04002]: unnecessary 'while (true)', replace with 'loop' - ┌─ tests/linter/true_positive_unnecessary_while_loop.move:3:9 - │ -3 │ while (true) {}; - │ ^^^^^^^^^^^^^^^ 'while (true)' can be always replaced with 'loop' - │ - = A 'loop' is more useful in these cases. Unlike 'while', 'loop' can have a 'break' with a value, e.g. 'let x = loop { break 42 };' - = This warning can be suppressed with '#[allow(lint(while_true))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W04002]: unnecessary 'while (true)', replace with 'loop' - ┌─ tests/linter/true_positive_unnecessary_while_loop.move:4:9 - │ -4 │ while (true) { break } - │ ^^^^^^^^^^^^^^^^^^^^^^ 'while (true)' can be always replaced with 'loop' - │ - = A 'loop' is more useful in these cases. Unlike 'while', 'loop' can have a 'break' with a value, e.g. 'let x = loop { break 42 };' - = This warning can be suppressed with '#[allow(lint(while_true))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/linter/true_positive_unnecessary_while_loop.snap b/external-crates/move/crates/move-compiler/tests/linter/true_positive_unnecessary_while_loop.snap new file mode 100644 index 0000000000000..dd02166a58e40 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/linter/true_positive_unnecessary_while_loop.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: true +input_file: crates/move-compiler/tests/linter/true_positive_unnecessary_while_loop.move +--- +warning[Lint W04002]: unnecessary 'while (true)', replace with 'loop' + ┌─ tests/linter/true_positive_unnecessary_while_loop.move:3:9 + │ +3 │ while (true) {}; + │ ^^^^^^^^^^^^^^^ 'while (true)' can be always replaced with 'loop' + │ + = A 'loop' is more useful in these cases. Unlike 'while', 'loop' can have a 'break' with a value, e.g. 'let x = loop { break 42 };' + = This warning can be suppressed with '#[allow(lint(while_true))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W04002]: unnecessary 'while (true)', replace with 'loop' + ┌─ tests/linter/true_positive_unnecessary_while_loop.move:4:9 + │ +4 │ while (true) { break } + │ ^^^^^^^^^^^^^^^^^^^^^^ 'while (true)' can be always replaced with 'loop' + │ + = A 'loop' is more useful in these cases. Unlike 'while', 'loop' can have a 'break' with a value, e.g. 'let x = loop { break 42 };' + = This warning can be suppressed with '#[allow(lint(while_true))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_combo.snap b/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_combo.snap new file mode 100644 index 0000000000000..903d7f6c88147 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_combo.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/borrows/freeze_combo.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_combo_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_combo_invalid.exp deleted file mode 100644 index 86597b4b8105d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_combo_invalid.exp +++ /dev/null @@ -1,26 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_2024/borrows/freeze_combo_invalid.move:13:9 - │ -12 │ if (cond) f = &mut s.f else f = &mut other.f; - │ -------- Field 'f' is still being mutably borrowed by this reference -13 │ freeze(s); - │ ^^^^^^^^^ Invalid freeze. - -error[E07002]: mutable ownership violated - ┌─ tests/move_2024/borrows/freeze_combo_invalid.move:20:9 - │ -19 │ if (cond) f = &mut s.f else f = &mut s.g; - │ -------- -------- Field 'g' is still being mutably borrowed by this reference - │ │ - │ Field 'f' is still being mutably borrowed by this reference -20 │ freeze(s); - │ ^^^^^^^^^ Invalid freeze. - -error[E07002]: mutable ownership violated - ┌─ tests/move_2024/borrows/freeze_combo_invalid.move:27:9 - │ -26 │ if (cond) x = s else x = other; - │ - It is still being mutably borrowed by this reference -27 │ freeze(s); - │ ^^^^^^^^^ Invalid freeze. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_combo_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_combo_invalid.snap new file mode 100644 index 0000000000000..b5e61e9f267e0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_combo_invalid.snap @@ -0,0 +1,33 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/borrows/freeze_combo_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_2024/borrows/freeze_combo_invalid.move:13:9 + │ +12 │ if (cond) f = &mut s.f else f = &mut other.f; + │ -------- Field 'f' is still being mutably borrowed by this reference +13 │ freeze(s); + │ ^^^^^^^^^ Invalid freeze. + +error[E07002]: mutable ownership violated + ┌─ tests/move_2024/borrows/freeze_combo_invalid.move:20:9 + │ +19 │ if (cond) f = &mut s.f else f = &mut s.g; + │ -------- -------- Field 'g' is still being mutably borrowed by this reference + │ │ + │ Field 'f' is still being mutably borrowed by this reference +20 │ freeze(s); + │ ^^^^^^^^^ Invalid freeze. + +error[E07002]: mutable ownership violated + ┌─ tests/move_2024/borrows/freeze_combo_invalid.move:27:9 + │ +26 │ if (cond) x = s else x = other; + │ - It is still being mutably borrowed by this reference +27 │ freeze(s); + │ ^^^^^^^^^ Invalid freeze. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_field.snap b/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_field.snap new file mode 100644 index 0000000000000..2bed846745b11 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_field.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/borrows/freeze_field.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_field_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_field_invalid.exp deleted file mode 100644 index b8732bad7a0b8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_field_invalid.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_2024/borrows/freeze_field_invalid.move:12:9 - │ -11 │ let f = &mut s.f; - │ -------- Field 'f' is still being mutably borrowed by this reference -12 │ freeze(s); - │ ^^^^^^^^^ Invalid freeze. - -error[E07002]: mutable ownership violated - ┌─ tests/move_2024/borrows/freeze_field_invalid.move:19:9 - │ -18 │ let g = &mut s.f; - │ -------- Field 'f' is still being mutably borrowed by this reference -19 │ freeze(s); - │ ^^^^^^^^^ Invalid freeze. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_field_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_field_invalid.snap new file mode 100644 index 0000000000000..5885ebd66c644 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_field_invalid.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/borrows/freeze_field_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_2024/borrows/freeze_field_invalid.move:12:9 + │ +11 │ let f = &mut s.f; + │ -------- Field 'f' is still being mutably borrowed by this reference +12 │ freeze(s); + │ ^^^^^^^^^ Invalid freeze. + +error[E07002]: mutable ownership violated + ┌─ tests/move_2024/borrows/freeze_field_invalid.move:19:9 + │ +18 │ let g = &mut s.f; + │ -------- Field 'f' is still being mutably borrowed by this reference +19 │ freeze(s); + │ ^^^^^^^^^ Invalid freeze. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_full.snap b/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_full.snap new file mode 100644 index 0000000000000..34ea9fcfbc353 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_full.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/borrows/freeze_full.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_full_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_full_invalid.snap new file mode 100644 index 0000000000000..ba3904c8eba6b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/borrows/freeze_full_invalid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/borrows/freeze_full_invalid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/cfg_conditional.snap b/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/cfg_conditional.snap new file mode 100644 index 0000000000000..7a0256fafa39f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/cfg_conditional.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/cfgir/cfg_conditional.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/cfg_panic_0.snap b/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/cfg_panic_0.snap new file mode 100644 index 0000000000000..31289dd7fb6bc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/cfg_panic_0.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/cfgir/cfg_panic_0.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/cfg_panic_1.snap b/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/cfg_panic_1.snap new file mode 100644 index 0000000000000..63c094bb74231 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/cfg_panic_1.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/cfgir/cfg_panic_1.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/expand_test.snap b/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/expand_test.snap new file mode 100644 index 0000000000000..701a8778d4be8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/expand_test.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/cfgir/expand_test.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/loops.snap b/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/loops.snap new file mode 100644 index 0000000000000..0dba628e83bc7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/loops.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/cfgir/loops.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/named_blocks.snap b/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/named_blocks.snap new file mode 100644 index 0000000000000..a78c11a96419f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/named_blocks.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/cfgir/named_blocks.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/named_loop_no_value.snap b/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/named_loop_no_value.snap new file mode 100644 index 0000000000000..2919d22422bd8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/cfgir/named_loop_no_value.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/cfgir/named_loop_no_value.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/alias_overlap_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/alias_overlap_invalid.exp deleted file mode 100644 index dd2f24a232205..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/alias_overlap_invalid.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/expansion/alias_overlap_invalid.move:9:15 - │ -8 │ use a::S; - │ - Alias previously defined here -9 │ use a::S::S; // ERROR - │ ^ Duplicate module member or alias 'S'. Top level names in a namespace must be unique - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/expansion/alias_overlap_invalid.move:14:19 - │ -13 │ use a::S; - │ - Alias previously defined here -14 │ public struct S() has copy, drop; // ERROR - │ ^ Duplicate module member or alias 'S'. Top level names in a namespace must be unique - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/alias_overlap_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/alias_overlap_invalid.snap new file mode 100644 index 0000000000000..2a39f05fac5bf --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/alias_overlap_invalid.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/alias_overlap_invalid.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/expansion/alias_overlap_invalid.move:9:15 + │ +8 │ use a::S; + │ - Alias previously defined here +9 │ use a::S::S; // ERROR + │ ^ Duplicate module member or alias 'S'. Top level names in a namespace must be unique + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/expansion/alias_overlap_invalid.move:14:19 + │ +13 │ use a::S; + │ - Alias previously defined here +14 │ public struct S() has copy, drop; // ERROR + │ ^ Duplicate module member or alias 'S'. Top level names in a namespace must be unique diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/alias_overlap_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/alias_overlap_valid.snap new file mode 100644 index 0000000000000..38d635d98ca08 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/alias_overlap_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/alias_overlap_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/always_module_member_without_chain.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/always_module_member_without_chain.snap new file mode 100644 index 0000000000000..73270e22b9b31 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/always_module_member_without_chain.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/always_module_member_without_chain.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/ambiguous_attribute_value_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/ambiguous_attribute_value_invalid.exp deleted file mode 100644 index 8b85b7a867aef..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/ambiguous_attribute_value_invalid.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E10008]: ambiguous attribute value - ┌─ tests/move_2024/expansion/ambiguous_attribute_value_invalid.move:7:18 - │ -7 │ #[ext(attr = foo)] - │ ^^^ Ambiguous attribute value. It can resolve to both a module member and a module - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/ambiguous_attribute_value_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/ambiguous_attribute_value_invalid.snap new file mode 100644 index 0000000000000..ce081ca65e722 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/ambiguous_attribute_value_invalid.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/ambiguous_attribute_value_invalid.move +--- +error[E10008]: ambiguous attribute value + ┌─ tests/move_2024/expansion/ambiguous_attribute_value_invalid.move:7:18 + │ +7 │ #[ext(attr = foo)] + │ ^^^ Ambiguous attribute value. It can resolve to both a module member and a module diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/ambiguous_attribute_value_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/ambiguous_attribute_value_valid.snap new file mode 100644 index 0000000000000..073a499e203eb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/ambiguous_attribute_value_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/ambiguous_attribute_value_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/assign_non_simple_name.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/assign_non_simple_name.exp deleted file mode 100644 index c415543466ef5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/assign_non_simple_name.exp +++ /dev/null @@ -1,126 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/expansion/assign_non_simple_name.move:2:5 - │ -2 │ struct S {} - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/expansion/assign_non_simple_name.move:6:23 - │ -5 │ use 0x42::X; - │ - Alias previously defined here -6 │ use 0x42::X::S as X; - │ ^ Duplicate module member or alias 'X'. Top level names in a namespace must be unique - -error[E01003]: invalid modifier - ┌─ tests/move_2024/expansion/assign_non_simple_name.move:8:5 - │ -8 │ struct R {} - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E01003]: invalid modifier - ┌─ tests/move_2024/expansion/assign_non_simple_name.move:9:5 - │ -9 │ struct S { f: T } - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E01009]: invalid assignment - ┌─ tests/move_2024/expansion/assign_non_simple_name.move:15:9 - │ -15 │ X::S = (); - │ ^^^^ Unexpected assignment of variant - │ - = If you are trying to unpack an enum variant, use 'match' - -error[E01009]: invalid assignment - ┌─ tests/move_2024/expansion/assign_non_simple_name.move:16:9 - │ -16 │ Self::S = (); - │ ^^^^^^^^^^^^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'Self::S {}' - -error[E01009]: invalid assignment - ┌─ tests/move_2024/expansion/assign_non_simple_name.move:17:9 - │ -17 │ Self::R = (); - │ ^^^^^^^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'Self::R {}' - -error[E01009]: invalid assignment - ┌─ tests/move_2024/expansion/assign_non_simple_name.move:21:9 - │ -21 │ 0x42::X::S = (); - │ ^^^^^^^^^^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'0x42::X::S {}' - -error[E01009]: invalid assignment - ┌─ tests/move_2024/expansion/assign_non_simple_name.move:22:9 - │ -22 │ 0x42::M::S = (); - │ ^^^^^^^^^^^^^^^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'0x42::M::S {}' - -error[E01009]: invalid assignment - ┌─ tests/move_2024/expansion/assign_non_simple_name.move:23:9 - │ -23 │ 0x42::M::R = (); - │ ^^^^^^^^^^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'0x42::M::R {}' - -error[E01009]: invalid assignment - ┌─ tests/move_2024/expansion/assign_non_simple_name.move:27:9 - │ -27 │ x = (); - │ ^^^^^^ Unexpected assignment of instantiated type without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'x {}' - -error[E01009]: invalid assignment - ┌─ tests/move_2024/expansion/assign_non_simple_name.move:28:9 - │ -28 │ S = (); - │ ^^^^^^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'S {}' - -error[E01009]: invalid assignment - ┌─ tests/move_2024/expansion/assign_non_simple_name.move:32:9 - │ -32 │ X = (); - │ ^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'X {}' - -error[E01009]: invalid assignment - ┌─ tests/move_2024/expansion/assign_non_simple_name.move:33:9 - │ -33 │ S = (); - │ ^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'S {}' - -error[E01009]: invalid assignment - ┌─ tests/move_2024/expansion/assign_non_simple_name.move:34:9 - │ -34 │ R = (); - │ ^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'R {}' - -error[E03009]: unbound variable - ┌─ tests/move_2024/expansion/assign_non_simple_name.move:38:9 - │ -38 │ Y = 0; - │ ^ Invalid assignment. Unbound variable 'Y' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/assign_non_simple_name.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/assign_non_simple_name.snap new file mode 100644 index 0000000000000..cb0700026ef25 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/assign_non_simple_name.snap @@ -0,0 +1,133 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/assign_non_simple_name.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/expansion/assign_non_simple_name.move:2:5 + │ +2 │ struct S {} + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/expansion/assign_non_simple_name.move:6:23 + │ +5 │ use 0x42::X; + │ - Alias previously defined here +6 │ use 0x42::X::S as X; + │ ^ Duplicate module member or alias 'X'. Top level names in a namespace must be unique + +error[E01003]: invalid modifier + ┌─ tests/move_2024/expansion/assign_non_simple_name.move:8:5 + │ +8 │ struct R {} + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E01003]: invalid modifier + ┌─ tests/move_2024/expansion/assign_non_simple_name.move:9:5 + │ +9 │ struct S { f: T } + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E01009]: invalid assignment + ┌─ tests/move_2024/expansion/assign_non_simple_name.move:15:9 + │ +15 │ X::S = (); + │ ^^^^ Unexpected assignment of variant + │ + = If you are trying to unpack an enum variant, use 'match' + +error[E01009]: invalid assignment + ┌─ tests/move_2024/expansion/assign_non_simple_name.move:16:9 + │ +16 │ Self::S = (); + │ ^^^^^^^^^^^^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'Self::S {}' + +error[E01009]: invalid assignment + ┌─ tests/move_2024/expansion/assign_non_simple_name.move:17:9 + │ +17 │ Self::R = (); + │ ^^^^^^^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'Self::R {}' + +error[E01009]: invalid assignment + ┌─ tests/move_2024/expansion/assign_non_simple_name.move:21:9 + │ +21 │ 0x42::X::S = (); + │ ^^^^^^^^^^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'0x42::X::S {}' + +error[E01009]: invalid assignment + ┌─ tests/move_2024/expansion/assign_non_simple_name.move:22:9 + │ +22 │ 0x42::M::S = (); + │ ^^^^^^^^^^^^^^^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'0x42::M::S {}' + +error[E01009]: invalid assignment + ┌─ tests/move_2024/expansion/assign_non_simple_name.move:23:9 + │ +23 │ 0x42::M::R = (); + │ ^^^^^^^^^^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'0x42::M::R {}' + +error[E01009]: invalid assignment + ┌─ tests/move_2024/expansion/assign_non_simple_name.move:27:9 + │ +27 │ x = (); + │ ^^^^^^ Unexpected assignment of instantiated type without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'x {}' + +error[E01009]: invalid assignment + ┌─ tests/move_2024/expansion/assign_non_simple_name.move:28:9 + │ +28 │ S = (); + │ ^^^^^^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'S {}' + +error[E01009]: invalid assignment + ┌─ tests/move_2024/expansion/assign_non_simple_name.move:32:9 + │ +32 │ X = (); + │ ^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'X {}' + +error[E01009]: invalid assignment + ┌─ tests/move_2024/expansion/assign_non_simple_name.move:33:9 + │ +33 │ S = (); + │ ^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'S {}' + +error[E01009]: invalid assignment + ┌─ tests/move_2024/expansion/assign_non_simple_name.move:34:9 + │ +34 │ R = (); + │ ^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'R {}' + +error[E03009]: unbound variable + ┌─ tests/move_2024/expansion/assign_non_simple_name.move:38:9 + │ +38 │ Y = 0; + │ ^ Invalid assignment. Unbound variable 'Y' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/constants_dont_shadow_leading_access.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/constants_dont_shadow_leading_access.snap new file mode 100644 index 0000000000000..7e22b7e3f3da0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/constants_dont_shadow_leading_access.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/constants_dont_shadow_leading_access.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/constants_dont_shadow_leading_access_struct.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/constants_dont_shadow_leading_access_struct.exp deleted file mode 100644 index 5227ec5d0a431..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/constants_dont_shadow_leading_access_struct.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/constants_dont_shadow_leading_access_struct.move:15:13 - │ - 3 │ public struct S() has copy, drop; - │ - But 'S' is an struct - · -15 │ S::foo(); // resolves to struct - │ ^ Invalid construction. Expected an enum - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/constants_dont_shadow_leading_access_struct.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/constants_dont_shadow_leading_access_struct.snap new file mode 100644 index 0000000000000..4fa356457cc50 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/constants_dont_shadow_leading_access_struct.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/constants_dont_shadow_leading_access_struct.move +--- +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/expansion/constants_dont_shadow_leading_access_struct.move:15:13 + │ + 3 │ public struct S() has copy, drop; + │ - But 'S' is an struct + · +15 │ S::foo(); // resolves to struct + │ ^ Invalid construction. Expected an enum diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/entry_macro.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/entry_macro.exp deleted file mode 100644 index f63ac58a6fa9f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/entry_macro.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E02007]: invalid 'fun' declaration - ┌─ tests/move_2024/expansion/entry_macro.move:3:5 - │ -3 │ entry macro fun foo() {} - │ ^^^^^ ----- Function declared as 'macro' here - │ │ - │ Invalid function declaration. It is meaningless for 'macro' functions to be 'entry' since they are fully-expanded inline during compilation - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/entry_macro.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/entry_macro.snap new file mode 100644 index 0000000000000..4bb71a51ccfe0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/entry_macro.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/entry_macro.move +--- +error[E02007]: invalid 'fun' declaration + ┌─ tests/move_2024/expansion/entry_macro.move:3:5 + │ +3 │ entry macro fun foo() {} + │ ^^^^^ ----- Function declared as 'macro' here + │ │ + │ Invalid function declaration. It is meaningless for 'macro' functions to be 'entry' since they are fully-expanded inline during compilation diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/expansion/deprecate_friend.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/expansion/deprecate_friend.exp deleted file mode 100644 index 71ef54c044b6f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/expansion/deprecate_friend.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/expansion/expansion/deprecate_friend.move:2:5 - │ -2 │ friend a::n; - │ ^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/expansion/expansion/deprecate_friend.move:3:5 - │ -3 │ friend a::x; - │ ^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' - -error[E03002]: unbound module - ┌─ tests/move_2024/expansion/expansion/deprecate_friend.move:3:12 - │ -3 │ friend a::x; - │ ^^^^ Unbound module 'a::x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/expansion/deprecate_friend.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/expansion/deprecate_friend.snap new file mode 100644 index 0000000000000..6f9f4bae85db1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/expansion/deprecate_friend.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/expansion/deprecate_friend.move +--- +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/expansion/expansion/deprecate_friend.move:2:5 + │ +2 │ friend a::n; + │ ^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/expansion/expansion/deprecate_friend.move:3:5 + │ +3 │ friend a::x; + │ ^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' + +error[E03002]: unbound module + ┌─ tests/move_2024/expansion/expansion/deprecate_friend.move:3:12 + │ +3 │ friend a::x; + │ ^^^^ Unbound module 'a::x' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/expansion/deprecate_public_friend.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/expansion/deprecate_public_friend.exp deleted file mode 100644 index 9b825cb3cb68b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/expansion/deprecate_public_friend.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/expansion/expansion/deprecate_public_friend.move:2:5 - │ -2 │ public(friend) fun foo() {} - │ ^^^^^^^^^^^^^^ 'public(friend)' is deprecated. Replace with 'public(package)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/expansion/deprecate_public_friend.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/expansion/deprecate_public_friend.snap new file mode 100644 index 0000000000000..56dfff34746a2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/expansion/deprecate_public_friend.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/expansion/deprecate_public_friend.move +--- +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/expansion/expansion/deprecate_public_friend.move:2:5 + │ +2 │ public(friend) fun foo() {} + │ ^^^^^^^^^^^^^^ 'public(friend)' is deprecated. Replace with 'public(package)' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/friend_decl_aliased_function.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/friend_decl_aliased_function.exp deleted file mode 100644 index 5c9bee3974b0a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/friend_decl_aliased_function.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/friend_decl_aliased_function.move:10:12 - │ -10 │ friend a; - │ ^ Unexpected address. An address identifier is not a valid module - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/friend_decl_aliased_function.move:11:12 - │ -11 │ friend foo; - │ ^^^ Expected an address or module in this position, not a module member - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/friend_decl_aliased_struct.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/friend_decl_aliased_struct.exp deleted file mode 100644 index 68f7725d0731e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/friend_decl_aliased_struct.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/friend_decl_aliased_struct.move:8:12 - │ -8 │ friend M; - │ ^ Unexpected module member. A module member identifier is not a valid module - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/functions_dont_shadow_leading_access.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/functions_dont_shadow_leading_access.snap new file mode 100644 index 0000000000000..bcb8d3e77e511 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/functions_dont_shadow_leading_access.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/functions_dont_shadow_leading_access.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/functions_dont_shadow_leading_access_struct.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/functions_dont_shadow_leading_access_struct.exp deleted file mode 100644 index f543741896221..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/functions_dont_shadow_leading_access_struct.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E02010]: invalid name - ┌─ tests/move_2024/expansion/functions_dont_shadow_leading_access_struct.move:3:19 - │ -3 │ public struct f() has copy, drop; - │ ^ Invalid struct name 'f'. Struct names must start with 'A'..'Z' - -error[E02010]: invalid name - ┌─ tests/move_2024/expansion/functions_dont_shadow_leading_access_struct.move:12:19 - │ -12 │ use a::f::f; - │ ^ Invalid struct alias name 'f'. Struct alias names must start with 'A'..'Z' - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/functions_dont_shadow_leading_access_struct.move:15:13 - │ -15 │ f::foo(); // resolves to struct - │ ^ Expected an address or module in this position, not a module member - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/functions_dont_shadow_leading_access_struct.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/functions_dont_shadow_leading_access_struct.snap new file mode 100644 index 0000000000000..a2c6ff9fd52e6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/functions_dont_shadow_leading_access_struct.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/functions_dont_shadow_leading_access_struct.move +--- +error[E02010]: invalid name + ┌─ tests/move_2024/expansion/functions_dont_shadow_leading_access_struct.move:3:19 + │ +3 │ public struct f() has copy, drop; + │ ^ Invalid struct name 'f'. Struct names must start with 'A'..'Z' + +error[E02010]: invalid name + ┌─ tests/move_2024/expansion/functions_dont_shadow_leading_access_struct.move:12:19 + │ +12 │ use a::f::f; + │ ^ Invalid struct alias name 'f'. Struct alias names must start with 'A'..'Z' + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/expansion/functions_dont_shadow_leading_access_struct.move:15:13 + │ +15 │ f::foo(); // resolves to struct + │ ^ Expected an address or module in this position, not a module member diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/global_use.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/global_use.snap new file mode 100644 index 0000000000000..827759ee3b0c5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/global_use.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/global_use.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/implicit_std_aliases.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/implicit_std_aliases.snap new file mode 100644 index 0000000000000..774ba00f09a90 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/implicit_std_aliases.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/implicit_std_aliases.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/invalid_deprecation_locations.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/invalid_deprecation_locations.exp deleted file mode 100644 index 667931ffd7f41..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/invalid_deprecation_locations.exp +++ /dev/null @@ -1,32 +0,0 @@ -error[E02015]: invalid attribute - ┌─ tests/move_2024/expansion/invalid_deprecation_locations.move:5:7 - │ -5 │ #[deprecated] - │ ^^^^^^^^^^ - │ │ - │ Known attribute 'deprecated' is not expected with a friend - │ Expected to be used with one of the following: module, constant, struct, enum, function - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/expansion/invalid_deprecation_locations.move:6:5 - │ -6 │ friend 0x42::k; - │ ^^^^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' - -error[E02015]: invalid attribute - ┌─ tests/move_2024/expansion/invalid_deprecation_locations.move:8:7 - │ -8 │ #[deprecated] - │ ^^^^^^^^^^ - │ │ - │ Known attribute 'deprecated' is not expected with a use - │ Expected to be used with one of the following: module, constant, struct, enum, function - -warning[W09001]: unused alias - ┌─ tests/move_2024/expansion/invalid_deprecation_locations.move:9:15 - │ -9 │ use 0x42::k; - │ ^ Unused 'use' of alias 'k'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/invalid_deprecation_locations.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/invalid_deprecation_locations.snap new file mode 100644 index 0000000000000..774775c75db3b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/invalid_deprecation_locations.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/invalid_deprecation_locations.move +--- +error[E02015]: invalid attribute + ┌─ tests/move_2024/expansion/invalid_deprecation_locations.move:5:7 + │ +5 │ #[deprecated] + │ ^^^^^^^^^^ + │ │ + │ Known attribute 'deprecated' is not expected with a friend + │ Expected to be used with one of the following: module, constant, struct, enum, function + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/expansion/invalid_deprecation_locations.move:6:5 + │ +6 │ friend 0x42::k; + │ ^^^^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' + +error[E02015]: invalid attribute + ┌─ tests/move_2024/expansion/invalid_deprecation_locations.move:8:7 + │ +8 │ #[deprecated] + │ ^^^^^^^^^^ + │ │ + │ Known attribute 'deprecated' is not expected with a use + │ Expected to be used with one of the following: module, constant, struct, enum, function + +warning[W09001]: unused alias + ┌─ tests/move_2024/expansion/invalid_deprecation_locations.move:9:15 + │ +9 │ use 0x42::k; + │ ^ Unused 'use' of alias 'k'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/invalid_tyargs.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/invalid_tyargs.exp deleted file mode 100644 index f076a8da44b12..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/invalid_tyargs.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E03018]: invalid type parameter - ┌─ tests/move_2024/expansion/invalid_tyargs.move:10:27 - │ -10 │ Maybe::Nothing => (), - │ ^^^^^ Cannot use type parameters on an enum variant - │ - = Type arguments are used with the enum, as '0x42::a::Maybe::Nothing' - -error[E02010]: invalid name - ┌─ tests/move_2024/expansion/invalid_tyargs.move:11:13 - │ -11 │ _x => (), - │ ^^ Invalid type arguments on a pattern variable - │ - = Type arguments cannot appear on pattern variables - -error[E03018]: invalid type parameter - ┌─ tests/move_2024/expansion/invalid_tyargs.move:12:24 - │ -12 │ Maybe::Just(_) => (), - │ ^^^^^ Cannot use type parameters on an enum variant - │ - = Type arguments are used with the enum, as '0x42::a::Maybe::Just' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/invalid_tyargs.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/invalid_tyargs.snap new file mode 100644 index 0000000000000..0844a2d6017b9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/invalid_tyargs.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/invalid_tyargs.move +--- +error[E03018]: invalid type parameter + ┌─ tests/move_2024/expansion/invalid_tyargs.move:10:27 + │ +10 │ Maybe::Nothing => (), + │ ^^^^^ Cannot use type parameters on an enum variant + │ + = Type arguments are used with the enum, as '0x42::a::Maybe::Nothing' + +error[E02010]: invalid name + ┌─ tests/move_2024/expansion/invalid_tyargs.move:11:13 + │ +11 │ _x => (), + │ ^^ Invalid type arguments on a pattern variable + │ + = Type arguments cannot appear on pattern variables + +error[E03018]: invalid type parameter + ┌─ tests/move_2024/expansion/invalid_tyargs.move:12:24 + │ +12 │ Maybe::Just(_) => (), + │ ^^^^^ Cannot use type parameters on an enum variant + │ + = Type arguments are used with the enum, as '0x42::a::Maybe::Just' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/leading_builtin_name.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/leading_builtin_name.snap new file mode 100644 index 0000000000000..8630bb8e654b3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/leading_builtin_name.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/leading_builtin_name.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_for_non_macro.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_for_non_macro.exp deleted file mode 100644 index ad31d783c4dd5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_for_non_macro.exp +++ /dev/null @@ -1,30 +0,0 @@ -error[E02010]: invalid name - ┌─ tests/move_2024/expansion/macro_identifier_for_non_macro.move:2:29 - │ -2 │ public struct S() - │ ^^ Invalid type parameter name. Only 'macro fun' type parameter names cat start with '$' - │ - = Type parameter names starting with '$' indicate that their arguments do not have to satisfy certain constraints before the macro is expanded, meaning types like '&mut u64' or '(bool, u8)' may be used as arguments. - -error[E02010]: invalid name - ┌─ tests/move_2024/expansion/macro_identifier_for_non_macro.move:3:16 - │ -3 │ fun foo($x: u64, $f: |u64|) { - │ ^^ Invalid parameter name '$x'. Non-'macro' parameter names cannot start with '$' - │ - = 'macro' parameters start with '$' to indicate that their arguments are not evaluated before the macro is expanded, meaning the entire expression is substituted. This is different from regular function parameters that are evaluated before the function is called. - -error[E02010]: invalid name - ┌─ tests/move_2024/expansion/macro_identifier_for_non_macro.move:3:25 - │ -3 │ fun foo($x: u64, $f: |u64|) { - │ ^^ Invalid parameter name '$f'. Non-'macro' parameter names cannot start with '$' - │ - = 'macro' parameters start with '$' to indicate that their arguments are not evaluated before the macro is expanded, meaning the entire expression is substituted. This is different from regular function parameters that are evaluated before the function is called. - -error[E04030]: invalid usage of lambda type - ┌─ tests/move_2024/expansion/macro_identifier_for_non_macro.move:3:29 - │ -3 │ fun foo($x: u64, $f: |u64|) { - │ ^^^^^ Unexpected lambda type. Lambdas can only be used with 'macro' functions, as parameters or direct arguments - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_for_non_macro.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_for_non_macro.snap new file mode 100644 index 0000000000000..bf83b227a1cb9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_for_non_macro.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/macro_identifier_for_non_macro.move +--- +error[E02010]: invalid name + ┌─ tests/move_2024/expansion/macro_identifier_for_non_macro.move:2:29 + │ +2 │ public struct S() + │ ^^ Invalid type parameter name. Only 'macro fun' type parameter names cat start with '$' + │ + = Type parameter names starting with '$' indicate that their arguments do not have to satisfy certain constraints before the macro is expanded, meaning types like '&mut u64' or '(bool, u8)' may be used as arguments. + +error[E02010]: invalid name + ┌─ tests/move_2024/expansion/macro_identifier_for_non_macro.move:3:16 + │ +3 │ fun foo($x: u64, $f: |u64|) { + │ ^^ Invalid parameter name '$x'. Non-'macro' parameter names cannot start with '$' + │ + = 'macro' parameters start with '$' to indicate that their arguments are not evaluated before the macro is expanded, meaning the entire expression is substituted. This is different from regular function parameters that are evaluated before the function is called. + +error[E02010]: invalid name + ┌─ tests/move_2024/expansion/macro_identifier_for_non_macro.move:3:25 + │ +3 │ fun foo($x: u64, $f: |u64|) { + │ ^^ Invalid parameter name '$f'. Non-'macro' parameter names cannot start with '$' + │ + = 'macro' parameters start with '$' to indicate that their arguments are not evaluated before the macro is expanded, meaning the entire expression is substituted. This is different from regular function parameters that are evaluated before the function is called. + +error[E04030]: invalid usage of lambda type + ┌─ tests/move_2024/expansion/macro_identifier_for_non_macro.move:3:29 + │ +3 │ fun foo($x: u64, $f: |u64|) { + │ ^^^^^ Unexpected lambda type. Lambdas can only be used with 'macro' functions, as parameters or direct arguments diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_invalid_position.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_invalid_position.exp deleted file mode 100644 index eab40b8b85e74..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_invalid_position.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E02010]: invalid name - ┌─ tests/move_2024/expansion/macro_identifier_invalid_position.move:1:8 - │ -1 │ module $a::m {} - │ ^^ Invalid address name '$a'. Identifiers starting with '$' can be used only for parameters and type paramters - -error[E02010]: invalid name - ┌─ tests/move_2024/expansion/macro_identifier_invalid_position.move:2:8 - │ -2 │ module $b::m {} - │ ^^ Invalid address name '$b'. Identifiers starting with '$' can be used only for parameters and type paramters - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_invalid_position.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_invalid_position.snap new file mode 100644 index 0000000000000..5b605a6d62ff7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_invalid_position.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/macro_identifier_invalid_position.move +--- +error[E02010]: invalid name + ┌─ tests/move_2024/expansion/macro_identifier_invalid_position.move:1:8 + │ +1 │ module $a::m {} + │ ^^ Invalid address name '$a'. Identifiers starting with '$' can be used only for parameters and type paramters + +error[E02010]: invalid name + ┌─ tests/move_2024/expansion/macro_identifier_invalid_position.move:2:8 + │ +2 │ module $b::m {} + │ ^^ Invalid address name '$b'. Identifiers starting with '$' can be used only for parameters and type paramters diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_invalid_type_parameter.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_invalid_type_parameter.exp deleted file mode 100644 index 414d4ff5ed414..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_invalid_type_parameter.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E02010]: invalid name - ┌─ tests/move_2024/expansion/macro_identifier_invalid_type_parameter.move:3:19 - │ -3 │ macro fun foo<$_, $__, $_t>() {} - │ ^^ Invalid type parameter name '$_'. Following the '$', the 'macro fun' type parameter must be have a valid type parameter name starting with a letter 'a'..'z' or 'A'..'Z' - │ - = Type parameter names starting with '$' indicate that their arguments do not have to satisfy certain constraints before the macro is expanded, meaning types like '&mut u64' or '(bool, u8)' may be used as arguments. - -error[E02010]: invalid name - ┌─ tests/move_2024/expansion/macro_identifier_invalid_type_parameter.move:3:23 - │ -3 │ macro fun foo<$_, $__, $_t>() {} - │ ^^^ Invalid type parameter name '$__'. Following the '$', the 'macro fun' type parameter must be have a valid type parameter name starting with a letter 'a'..'z' or 'A'..'Z' - │ - = Type parameter names starting with '$' indicate that their arguments do not have to satisfy certain constraints before the macro is expanded, meaning types like '&mut u64' or '(bool, u8)' may be used as arguments. - -error[E02010]: invalid name - ┌─ tests/move_2024/expansion/macro_identifier_invalid_type_parameter.move:3:28 - │ -3 │ macro fun foo<$_, $__, $_t>() {} - │ ^^^ Invalid type parameter name '$_t'. Following the '$', the 'macro fun' type parameter must be have a valid type parameter name starting with a letter 'a'..'z' or 'A'..'Z' - │ - = Type parameter names starting with '$' indicate that their arguments do not have to satisfy certain constraints before the macro is expanded, meaning types like '&mut u64' or '(bool, u8)' may be used as arguments. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_invalid_type_parameter.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_invalid_type_parameter.snap new file mode 100644 index 0000000000000..07d5eec041a7a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_invalid_type_parameter.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/macro_identifier_invalid_type_parameter.move +--- +error[E02010]: invalid name + ┌─ tests/move_2024/expansion/macro_identifier_invalid_type_parameter.move:3:19 + │ +3 │ macro fun foo<$_, $__, $_t>() {} + │ ^^ Invalid type parameter name '$_'. Following the '$', the 'macro fun' type parameter must be have a valid type parameter name starting with a letter 'a'..'z' or 'A'..'Z' + │ + = Type parameter names starting with '$' indicate that their arguments do not have to satisfy certain constraints before the macro is expanded, meaning types like '&mut u64' or '(bool, u8)' may be used as arguments. + +error[E02010]: invalid name + ┌─ tests/move_2024/expansion/macro_identifier_invalid_type_parameter.move:3:23 + │ +3 │ macro fun foo<$_, $__, $_t>() {} + │ ^^^ Invalid type parameter name '$__'. Following the '$', the 'macro fun' type parameter must be have a valid type parameter name starting with a letter 'a'..'z' or 'A'..'Z' + │ + = Type parameter names starting with '$' indicate that their arguments do not have to satisfy certain constraints before the macro is expanded, meaning types like '&mut u64' or '(bool, u8)' may be used as arguments. + +error[E02010]: invalid name + ┌─ tests/move_2024/expansion/macro_identifier_invalid_type_parameter.move:3:28 + │ +3 │ macro fun foo<$_, $__, $_t>() {} + │ ^^^ Invalid type parameter name '$_t'. Following the '$', the 'macro fun' type parameter must be have a valid type parameter name starting with a letter 'a'..'z' or 'A'..'Z' + │ + = Type parameter names starting with '$' indicate that their arguments do not have to satisfy certain constraints before the macro is expanded, meaning types like '&mut u64' or '(bool, u8)' may be used as arguments. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_missing.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_missing.exp deleted file mode 100644 index f3ab5732351c1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_missing.exp +++ /dev/null @@ -1,38 +0,0 @@ -error[E02010]: invalid name - ┌─ tests/move_2024/expansion/macro_identifier_missing.move:2:19 - │ -2 │ macro fun foo(x: u64, f: |u64|) { - │ ----- ^ Invalid type parameter name. 'macro fun' type parameter names must start with '$' - │ │ - │ Declared 'macro' here - │ - = Type parameter names starting with '$' indicate that their arguments do not have to satisfy certain constraints before the macro is expanded, meaning types like '&mut u64' or '(bool, u8)' may be used as arguments. - -error[E02010]: invalid name - ┌─ tests/move_2024/expansion/macro_identifier_missing.move:2:22 - │ -2 │ macro fun foo(x: u64, f: |u64|) { - │ ----- ^ Invalid parameter name 'x'. 'macro' parameter names must start with '$' (or must be '_') - │ │ - │ Declared 'macro' here - │ - = 'macro' parameters start with '$' to indicate that their arguments are not evaluated before the macro is expanded, meaning the entire expression is substituted. This is different from regular function parameters that are evaluated before the function is called. - -error[E02010]: invalid name - ┌─ tests/move_2024/expansion/macro_identifier_missing.move:2:30 - │ -2 │ macro fun foo(x: u64, f: |u64|) { - │ ----- ^ Invalid parameter name 'f'. 'macro' parameter names must start with '$' (or must be '_') - │ │ - │ Declared 'macro' here - │ - = 'macro' parameters start with '$' to indicate that their arguments are not evaluated before the macro is expanded, meaning the entire expression is substituted. This is different from regular function parameters that are evaluated before the function is called. - -error[E04029]: invalid function call - ┌─ tests/move_2024/expansion/macro_identifier_missing.move:3:9 - │ -3 │ f(x) - │ ^ Unexpected invocation of parameter or local 'f'. Non-syntax variables cannot be invoked as functions - │ - = Only macro syntax variables, e.g. '$f', may be invoked as functions. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_missing.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_missing.snap new file mode 100644 index 0000000000000..3f2029451639e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_missing.snap @@ -0,0 +1,45 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/macro_identifier_missing.move +--- +error[E02010]: invalid name + ┌─ tests/move_2024/expansion/macro_identifier_missing.move:2:19 + │ +2 │ macro fun foo(x: u64, f: |u64|) { + │ ----- ^ Invalid type parameter name. 'macro fun' type parameter names must start with '$' + │ │ + │ Declared 'macro' here + │ + = Type parameter names starting with '$' indicate that their arguments do not have to satisfy certain constraints before the macro is expanded, meaning types like '&mut u64' or '(bool, u8)' may be used as arguments. + +error[E02010]: invalid name + ┌─ tests/move_2024/expansion/macro_identifier_missing.move:2:22 + │ +2 │ macro fun foo(x: u64, f: |u64|) { + │ ----- ^ Invalid parameter name 'x'. 'macro' parameter names must start with '$' (or must be '_') + │ │ + │ Declared 'macro' here + │ + = 'macro' parameters start with '$' to indicate that their arguments are not evaluated before the macro is expanded, meaning the entire expression is substituted. This is different from regular function parameters that are evaluated before the function is called. + +error[E02010]: invalid name + ┌─ tests/move_2024/expansion/macro_identifier_missing.move:2:30 + │ +2 │ macro fun foo(x: u64, f: |u64|) { + │ ----- ^ Invalid parameter name 'f'. 'macro' parameter names must start with '$' (or must be '_') + │ │ + │ Declared 'macro' here + │ + = 'macro' parameters start with '$' to indicate that their arguments are not evaluated before the macro is expanded, meaning the entire expression is substituted. This is different from regular function parameters that are evaluated before the function is called. + +error[E04029]: invalid function call + ┌─ tests/move_2024/expansion/macro_identifier_missing.move:3:9 + │ +3 │ f(x) + │ ^ Unexpected invocation of parameter or local 'f'. Non-syntax variables cannot be invoked as functions + │ + = Only macro syntax variables, e.g. '$f', may be invoked as functions. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_valid_names.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_valid_names.snap new file mode 100644 index 0000000000000..3712281965d82 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/macro_identifier_valid_names.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/macro_identifier_valid_names.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/meaningless_copy_move.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/meaningless_copy_move.exp deleted file mode 100644 index a12bd94fa6621..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/meaningless_copy_move.exp +++ /dev/null @@ -1,136 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_2024/expansion/meaningless_copy_move.move:11:14 - │ -11 │ fun test(x: X) { - │ ^ Unused parameter 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/expansion/meaningless_copy_move.move:12:9 - │ -12 │ copy &x; - │ ^^^^ -- Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'copy' of expression - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/expansion/meaningless_copy_move.move:13:9 - │ -13 │ copy *&x; - │ ^^^^ --- Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'copy' of expression - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/expansion/meaningless_copy_move.move:14:9 - │ -14 │ copy &x.y; - │ ^^^^ ---- Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'copy' of expression - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/expansion/meaningless_copy_move.move:15:9 - │ -15 │ copy *&x.y; - │ ^^^^ ----- Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'copy' of expression - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/expansion/meaningless_copy_move.move:16:9 - │ -16 │ copy x.id(); - │ ^^^^ ------ Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'copy' of expression - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/expansion/meaningless_copy_move.move:17:9 - │ -17 │ copy !0; - │ ^^^^ -- Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'copy' of expression - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/expansion/meaningless_copy_move.move:18:9 - │ -18 │ copy 0; - │ ^^^^ - Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'copy' of expression - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/expansion/meaningless_copy_move.move:19:9 - │ -19 │ copy 1 + 1; - │ ^^^^ - Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'copy' of expression - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/expansion/meaningless_copy_move.move:21:9 - │ -21 │ move &x; - │ ^^^^ -- Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'move' of expression - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/expansion/meaningless_copy_move.move:22:9 - │ -22 │ move *&x; - │ ^^^^ --- Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'move' of expression - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/expansion/meaningless_copy_move.move:23:9 - │ -23 │ move &x.y; - │ ^^^^ ---- Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'move' of expression - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/expansion/meaningless_copy_move.move:24:9 - │ -24 │ move *&x.y; - │ ^^^^ ----- Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'move' of expression - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/expansion/meaningless_copy_move.move:25:9 - │ -25 │ move x.id(); - │ ^^^^ ------ Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'move' of expression - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/expansion/meaningless_copy_move.move:26:9 - │ -26 │ move !0; - │ ^^^^ -- Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'move' of expression - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/expansion/meaningless_copy_move.move:27:9 - │ -27 │ move 0; - │ ^^^^ - Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'move' of expression - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/expansion/meaningless_copy_move.move:28:9 - │ -28 │ move 1 + 1; - │ ^^^^ - Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'move' of expression - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/meaningless_copy_move.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/meaningless_copy_move.snap new file mode 100644 index 0000000000000..8088e308c0930 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/meaningless_copy_move.snap @@ -0,0 +1,143 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/meaningless_copy_move.move +--- +warning[W09002]: unused variable + ┌─ tests/move_2024/expansion/meaningless_copy_move.move:11:14 + │ +11 │ fun test(x: X) { + │ ^ Unused parameter 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/expansion/meaningless_copy_move.move:12:9 + │ +12 │ copy &x; + │ ^^^^ -- Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'copy' of expression + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/expansion/meaningless_copy_move.move:13:9 + │ +13 │ copy *&x; + │ ^^^^ --- Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'copy' of expression + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/expansion/meaningless_copy_move.move:14:9 + │ +14 │ copy &x.y; + │ ^^^^ ---- Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'copy' of expression + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/expansion/meaningless_copy_move.move:15:9 + │ +15 │ copy *&x.y; + │ ^^^^ ----- Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'copy' of expression + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/expansion/meaningless_copy_move.move:16:9 + │ +16 │ copy x.id(); + │ ^^^^ ------ Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'copy' of expression + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/expansion/meaningless_copy_move.move:17:9 + │ +17 │ copy !0; + │ ^^^^ -- Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'copy' of expression + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/expansion/meaningless_copy_move.move:18:9 + │ +18 │ copy 0; + │ ^^^^ - Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'copy' of expression + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/expansion/meaningless_copy_move.move:19:9 + │ +19 │ copy 1 + 1; + │ ^^^^ - Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'copy' of expression + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/expansion/meaningless_copy_move.move:21:9 + │ +21 │ move &x; + │ ^^^^ -- Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'move' of expression + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/expansion/meaningless_copy_move.move:22:9 + │ +22 │ move *&x; + │ ^^^^ --- Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'move' of expression + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/expansion/meaningless_copy_move.move:23:9 + │ +23 │ move &x.y; + │ ^^^^ ---- Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'move' of expression + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/expansion/meaningless_copy_move.move:24:9 + │ +24 │ move *&x.y; + │ ^^^^ ----- Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'move' of expression + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/expansion/meaningless_copy_move.move:25:9 + │ +25 │ move x.id(); + │ ^^^^ ------ Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'move' of expression + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/expansion/meaningless_copy_move.move:26:9 + │ +26 │ move !0; + │ ^^^^ -- Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'move' of expression + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/expansion/meaningless_copy_move.move:27:9 + │ +27 │ move 0; + │ ^^^^ - Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'move' of expression + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/expansion/meaningless_copy_move.move:28:9 + │ +28 │ move 1 + 1; + │ ^^^^ - Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'move' of expression diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/missing_mutable_bind_or_pat.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/missing_mutable_bind_or_pat.exp deleted file mode 100644 index 46a10098adaf7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/missing_mutable_bind_or_pat.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[E03019]: invalid pattern - ┌─ tests/move_2024/expansion/missing_mutable_bind_or_pat.move:9:22 - │ -9 │ X::A(mut x) | X::B(_, _) => { - │ ^ ---------- right or-pattern does not - │ │ - │ left or-pattern binds variable x - │ - = Both sides of an or-pattern must bind the same variables. - -error[E03019]: invalid pattern - ┌─ tests/move_2024/expansion/missing_mutable_bind_or_pat.move:18:32 - │ -18 │ X::A(_) | X::B(mut x, _) => { - │ ------- ^ right or-pattern binds variable x - │ │ - │ left or-pattern does not - │ - = Both sides of an or-pattern must bind the same variables. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/missing_mutable_bind_or_pat.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/missing_mutable_bind_or_pat.snap new file mode 100644 index 0000000000000..c3f7bd2b53a96 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/missing_mutable_bind_or_pat.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/missing_mutable_bind_or_pat.move +--- +error[E03019]: invalid pattern + ┌─ tests/move_2024/expansion/missing_mutable_bind_or_pat.move:9:22 + │ +9 │ X::A(mut x) | X::B(_, _) => { + │ ^ ---------- right or-pattern does not + │ │ + │ left or-pattern binds variable x + │ + = Both sides of an or-pattern must bind the same variables. + +error[E03019]: invalid pattern + ┌─ tests/move_2024/expansion/missing_mutable_bind_or_pat.move:18:32 + │ +18 │ X::A(_) | X::B(mut x, _) => { + │ ------- ^ right or-pattern binds variable x + │ │ + │ left or-pattern does not + │ + = Both sides of an or-pattern must bind the same variables. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/module_alias_as_type.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/module_alias_as_type.exp deleted file mode 100644 index f256ea817a321..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/module_alias_as_type.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/module_alias_as_type.move:5:16 - │ -5 │ fun foo(x: X) { x; } - │ ^ Expected a type, function, or constant in this position, not a module - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/module_alias_as_type.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/module_alias_as_type.snap new file mode 100644 index 0000000000000..1f87c86176596 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/module_alias_as_type.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/module_alias_as_type.move +--- +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/expansion/module_alias_as_type.move:5:16 + │ +5 │ fun foo(x: X) { x; } + │ ^ Expected a type, function, or constant in this position, not a module diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/native_macro.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/native_macro.exp deleted file mode 100644 index 0072ff4543de5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/native_macro.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E02007]: invalid 'fun' declaration - ┌─ tests/move_2024/expansion/native_macro.move:3:5 - │ -3 │ native macro fun foo(); - │ ^^^^^^ ----- Function declared as 'macro' here - │ │ - │ Invalid function declaration. 'native' functions cannot be 'macro' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/native_macro.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/native_macro.snap new file mode 100644 index 0000000000000..2d5a59659116d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/native_macro.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/native_macro.move +--- +error[E02007]: invalid 'fun' declaration + ┌─ tests/move_2024/expansion/native_macro.move:3:5 + │ +3 │ native macro fun foo(); + │ ^^^^^^ ----- Function declared as 'macro' here + │ │ + │ Invalid function declaration. 'native' functions cannot be 'macro' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/or_pat_mutability_mismatch.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/or_pat_mutability_mismatch.exp deleted file mode 100644 index 96fc89b2872e9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/or_pat_mutability_mismatch.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[E03019]: invalid pattern - ┌─ tests/move_2024/expansion/or_pat_mutability_mismatch.move:9:18 - │ -9 │ X::A(mut x) | X::B(x, _) => { - │ ^^^ ---------- right or-pattern binds it immutably - │ │ - │ left or-pattern binds variable x mutably - │ - = Both sides of an or-pattern must bind the same variables with the same mutability. - -error[E03019]: invalid pattern - ┌─ tests/move_2024/expansion/or_pat_mutability_mismatch.move:18:28 - │ -18 │ X::A(x) | X::B(mut x, _) => { - │ - ^^^ right or-pattern binds variable x mutably - │ │ - │ left or-pattern binds it immutably - │ - = Both sides of an or-pattern must bind the same variables with the same mutability. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/or_pat_mutability_mismatch.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/or_pat_mutability_mismatch.snap new file mode 100644 index 0000000000000..837ecd78af385 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/or_pat_mutability_mismatch.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/or_pat_mutability_mismatch.move +--- +error[E03019]: invalid pattern + ┌─ tests/move_2024/expansion/or_pat_mutability_mismatch.move:9:18 + │ +9 │ X::A(mut x) | X::B(x, _) => { + │ ^^^ ---------- right or-pattern binds it immutably + │ │ + │ left or-pattern binds variable x mutably + │ + = Both sides of an or-pattern must bind the same variables with the same mutability. + +error[E03019]: invalid pattern + ┌─ tests/move_2024/expansion/or_pat_mutability_mismatch.move:18:28 + │ +18 │ X::A(x) | X::B(mut x, _) => { + │ - ^^^ right or-pattern binds variable x mutably + │ │ + │ left or-pattern binds it immutably + │ + = Both sides of an or-pattern must bind the same variables with the same mutability. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/pattern_ellipsis.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/pattern_ellipsis.snap new file mode 100644 index 0000000000000..622adf5412357 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/pattern_ellipsis.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/pattern_ellipsis.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/pattern_ellipsis_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/pattern_ellipsis_invalid.exp deleted file mode 100644 index 9f55cb2cfaf53..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/pattern_ellipsis_invalid.exp +++ /dev/null @@ -1,69 +0,0 @@ -error[E03019]: invalid pattern - ┌─ tests/move_2024/expansion/pattern_ellipsis_invalid.move:10:20 - │ -10 │ X::A { .., .. } => 0, - │ ^^ -- Ellipsis pattern used again here - │ │ - │ Multiple ellipsis patterns - │ - = An ellipsis pattern can only appear once in a constructor's pattern. - -error[E03019]: invalid pattern - ┌─ tests/move_2024/expansion/pattern_ellipsis_invalid.move:11:20 - │ -11 │ X::B { .., .., .. } => 0, - │ ^^ -- -- Ellipsis pattern used again here - │ │ │ - │ │ Ellipsis pattern used again here - │ Multiple ellipsis patterns - │ - = An ellipsis pattern can only appear once in a constructor's pattern. - -error[E03019]: invalid pattern - ┌─ tests/move_2024/expansion/pattern_ellipsis_invalid.move:12:20 - │ -12 │ X::B { .., .., x} => x, - │ ^^ -- Ellipsis pattern used again here - │ │ - │ Multiple ellipsis patterns - │ - = An ellipsis pattern can only appear once in a constructor's pattern. - -error[E03019]: invalid pattern - ┌─ tests/move_2024/expansion/pattern_ellipsis_invalid.move:13:20 - │ -13 │ X::B { .., x, .. } => x, - │ ^^ -- Ellipsis pattern used again here - │ │ - │ Multiple ellipsis patterns - │ - = An ellipsis pattern can only appear once in a constructor's pattern. - -error[E03019]: invalid pattern - ┌─ tests/move_2024/expansion/pattern_ellipsis_invalid.move:14:18 - │ -14 │ X::C(.., x, ..) => 1, - │ ^^ -- Ellipsis pattern used again here - │ │ - │ Multiple ellipsis patterns - │ - = An ellipsis pattern can only appear once in a constructor's pattern. - -warning[W09002]: unused variable - ┌─ tests/move_2024/expansion/pattern_ellipsis_invalid.move:14:22 - │ -14 │ X::C(.., x, ..) => 1, - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03019]: invalid pattern - ┌─ tests/move_2024/expansion/pattern_ellipsis_invalid.move:15:18 - │ -15 │ X::C(.., ..) => 1, - │ ^^ -- Ellipsis pattern used again here - │ │ - │ Multiple ellipsis patterns - │ - = An ellipsis pattern can only appear once in a constructor's pattern. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/pattern_ellipsis_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/pattern_ellipsis_invalid.snap new file mode 100644 index 0000000000000..17acca895dfd9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/pattern_ellipsis_invalid.snap @@ -0,0 +1,76 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/pattern_ellipsis_invalid.move +--- +error[E03019]: invalid pattern + ┌─ tests/move_2024/expansion/pattern_ellipsis_invalid.move:10:20 + │ +10 │ X::A { .., .. } => 0, + │ ^^ -- Ellipsis pattern used again here + │ │ + │ Multiple ellipsis patterns + │ + = An ellipsis pattern can only appear once in a constructor's pattern. + +error[E03019]: invalid pattern + ┌─ tests/move_2024/expansion/pattern_ellipsis_invalid.move:11:20 + │ +11 │ X::B { .., .., .. } => 0, + │ ^^ -- -- Ellipsis pattern used again here + │ │ │ + │ │ Ellipsis pattern used again here + │ Multiple ellipsis patterns + │ + = An ellipsis pattern can only appear once in a constructor's pattern. + +error[E03019]: invalid pattern + ┌─ tests/move_2024/expansion/pattern_ellipsis_invalid.move:12:20 + │ +12 │ X::B { .., .., x} => x, + │ ^^ -- Ellipsis pattern used again here + │ │ + │ Multiple ellipsis patterns + │ + = An ellipsis pattern can only appear once in a constructor's pattern. + +error[E03019]: invalid pattern + ┌─ tests/move_2024/expansion/pattern_ellipsis_invalid.move:13:20 + │ +13 │ X::B { .., x, .. } => x, + │ ^^ -- Ellipsis pattern used again here + │ │ + │ Multiple ellipsis patterns + │ + = An ellipsis pattern can only appear once in a constructor's pattern. + +error[E03019]: invalid pattern + ┌─ tests/move_2024/expansion/pattern_ellipsis_invalid.move:14:18 + │ +14 │ X::C(.., x, ..) => 1, + │ ^^ -- Ellipsis pattern used again here + │ │ + │ Multiple ellipsis patterns + │ + = An ellipsis pattern can only appear once in a constructor's pattern. + +warning[W09002]: unused variable + ┌─ tests/move_2024/expansion/pattern_ellipsis_invalid.move:14:22 + │ +14 │ X::C(.., x, ..) => 1, + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03019]: invalid pattern + ┌─ tests/move_2024/expansion/pattern_ellipsis_invalid.move:15:18 + │ +15 │ X::C(.., ..) => 1, + │ ^^ -- Ellipsis pattern used again here + │ │ + │ Multiple ellipsis patterns + │ + = An ellipsis pattern can only appear once in a constructor's pattern. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/positional_struct_lhs_unpack.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/positional_struct_lhs_unpack.snap new file mode 100644 index 0000000000000..badfde82df8a5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/positional_struct_lhs_unpack.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/positional_struct_lhs_unpack.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/restricted_module_alias_names.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/restricted_module_alias_names.exp deleted file mode 100644 index f22448483c8c7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/restricted_module_alias_names.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E03011]: invalid use of reserved name - ┌─ tests/move_2024/expansion/restricted_module_alias_names.move:3:20 - │ -3 │ use 0x42::M as Self; - │ ^^^^ Invalid module alias name 'Self'. 'Self' is restricted and cannot be used to name a module alias - -warning[W09001]: unused alias - ┌─ tests/move_2024/expansion/restricted_module_alias_names.move:5:20 - │ -5 │ use 0x42::M as vector; - │ ^^^^^^ Unused 'use' of alias 'vector'. Consider removing it - │ - = This alias does not shadow the built-in type 'vector' in type annotations. - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/restricted_module_alias_names.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/restricted_module_alias_names.snap new file mode 100644 index 0000000000000..961fda5c582f5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/restricted_module_alias_names.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/restricted_module_alias_names.move +--- +error[E03011]: invalid use of reserved name + ┌─ tests/move_2024/expansion/restricted_module_alias_names.move:3:20 + │ +3 │ use 0x42::M as Self; + │ ^^^^ Invalid module alias name 'Self'. 'Self' is restricted and cannot be used to name a module alias + +warning[W09001]: unused alias + ┌─ tests/move_2024/expansion/restricted_module_alias_names.move:5:20 + │ +5 │ use 0x42::M as vector; + │ ^^^^^^ Unused 'use' of alias 'vector'. Consider removing it + │ + = This alias does not shadow the built-in type 'vector' in type annotations. + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/self_leading_access.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/self_leading_access.exp deleted file mode 100644 index ad6ce0b933a27..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/self_leading_access.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/self_leading_access.move:6:9 - │ -6 │ foo::S() - │ ^^^ Expected an address or module in this position, not a module member - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/self_leading_access.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/self_leading_access.snap new file mode 100644 index 0000000000000..b728a515cbf45 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/self_leading_access.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/self_leading_access.move +--- +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/expansion/self_leading_access.move:6:9 + │ +6 │ foo::S() + │ ^^^ Expected an address or module in this position, not a module member diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/type_hole_as_type_param.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/type_hole_as_type_param.exp deleted file mode 100644 index 01c8059930396..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/type_hole_as_type_param.exp +++ /dev/null @@ -1,26 +0,0 @@ -warning[W09006]: unused struct type parameter - ┌─ tests/move_2024/expansion/type_hole_as_type_param.move:2:21 - │ -2 │ public struct S<_>() - │ ^ Unused type parameter '_'. Consider declaring it as phantom - │ - = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03011]: invalid use of reserved name - ┌─ tests/move_2024/expansion/type_hole_as_type_param.move:2:21 - │ -2 │ public struct S<_>() - │ ^ Invalid type parameter name '_'. '_' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_2024/expansion/type_hole_as_type_param.move:3:13 - │ -3 │ fun foo<_>() {} - │ ^ Invalid type parameter name '_'. '_' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_2024/expansion/type_hole_as_type_param.move:4:19 - │ -4 │ macro fun bar<_>() {} - │ ^ Invalid type parameter name '_'. '_' is restricted and cannot be used to name a type parameter - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/type_hole_as_type_param.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/type_hole_as_type_param.snap new file mode 100644 index 0000000000000..ff8e441bf818c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/type_hole_as_type_param.snap @@ -0,0 +1,33 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/type_hole_as_type_param.move +--- +warning[W09006]: unused struct type parameter + ┌─ tests/move_2024/expansion/type_hole_as_type_param.move:2:21 + │ +2 │ public struct S<_>() + │ ^ Unused type parameter '_'. Consider declaring it as phantom + │ + = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03011]: invalid use of reserved name + ┌─ tests/move_2024/expansion/type_hole_as_type_param.move:2:21 + │ +2 │ public struct S<_>() + │ ^ Invalid type parameter name '_'. '_' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_2024/expansion/type_hole_as_type_param.move:3:13 + │ +3 │ fun foo<_>() {} + │ ^ Invalid type parameter name '_'. '_' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_2024/expansion/type_hole_as_type_param.move:4:19 + │ +4 │ macro fun bar<_>() {} + │ ^ Invalid type parameter name '_'. '_' is restricted and cannot be used to name a type parameter diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/type_parameters_shadow_leading_access.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/type_parameters_shadow_leading_access.exp deleted file mode 100644 index f0d9d560e2a01..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/type_parameters_shadow_leading_access.exp +++ /dev/null @@ -1,32 +0,0 @@ -warning[W09001]: unused alias - ┌─ tests/move_2024/expansion/type_parameters_shadow_leading_access.move:7:12 - │ -7 │ use a::T; - │ ^ Unused 'use' of alias 'T'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/type_parameters_shadow_leading_access.move:8:24 - │ -8 │ public fun t(_: T::S): T::S { - │ ^ Could not resolve the name 'T' - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/type_parameters_shadow_leading_access.move:8:31 - │ -8 │ public fun t(_: T::S): T::S { - │ ^ Could not resolve the name 'T' - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/type_parameters_shadow_leading_access.move:9:9 - │ -9 │ T::foo(); - │ ^ Could not resolve the name 'T' - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/type_parameters_shadow_leading_access.move:10:9 - │ -10 │ T::S() - │ ^ Could not resolve the name 'T' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/type_parameters_shadow_leading_access.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/type_parameters_shadow_leading_access.snap new file mode 100644 index 0000000000000..e26f20af5d85c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/type_parameters_shadow_leading_access.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/type_parameters_shadow_leading_access.move +--- +warning[W09001]: unused alias + ┌─ tests/move_2024/expansion/type_parameters_shadow_leading_access.move:7:12 + │ +7 │ use a::T; + │ ^ Unused 'use' of alias 'T'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/expansion/type_parameters_shadow_leading_access.move:8:24 + │ +8 │ public fun t(_: T::S): T::S { + │ ^ Could not resolve the name 'T' + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/expansion/type_parameters_shadow_leading_access.move:8:31 + │ +8 │ public fun t(_: T::S): T::S { + │ ^ Could not resolve the name 'T' + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/expansion/type_parameters_shadow_leading_access.move:9:9 + │ +9 │ T::foo(); + │ ^ Could not resolve the name 'T' + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/expansion/type_parameters_shadow_leading_access.move:10:9 + │ +10 │ T::S() + │ ^ Could not resolve the name 'T' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unbound_module_alias_in_type.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unbound_module_alias_in_type.exp deleted file mode 100644 index 236b6de4b2455..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unbound_module_alias_in_type.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/unbound_module_alias_in_type.move:2:16 - │ -2 │ fun foo(x: X::T) { x; } - │ ^ Could not resolve the name 'X' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unbound_module_alias_in_type.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unbound_module_alias_in_type.snap new file mode 100644 index 0000000000000..fea1cfad43f0e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unbound_module_alias_in_type.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/unbound_module_alias_in_type.move +--- +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/expansion/unbound_module_alias_in_type.move:2:16 + │ +2 │ fun foo(x: X::T) { x; } + │ ^ Could not resolve the name 'X' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unbound_named_address.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unbound_named_address.exp deleted file mode 100644 index 6d59c1c78e797..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unbound_named_address.exp +++ /dev/null @@ -1,56 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/move_2024/expansion/unbound_named_address.move:3:9 - │ -3 │ use B::X; - │ ^^^^ Invalid 'use'. Unbound module: 'B::X' - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/unbound_named_address.move:5:12 - │ -5 │ friend C::M; - │ ^ Could not resolve the name 'C' - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/unbound_named_address.move:6:12 - │ -6 │ friend D::M::foo; - │ ^ Could not resolve the name 'D' - -error[E01003]: invalid modifier - ┌─ tests/move_2024/expansion/unbound_named_address.move:8:5 - │ -8 │ struct S { - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/unbound_named_address.move:9:12 - │ -9 │ x: E::M::S, - │ ^ Could not resolve the name 'E' - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/unbound_named_address.move:13:17 - │ -13 │ let x = F::M::S {}; x; - │ ^ Could not resolve the name 'F' - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/unbound_named_address.move:14:9 - │ -14 │ G::M::foo(); - │ ^ Could not resolve the name 'G' - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/unbound_named_address.move:15:17 - │ -15 │ let c = H::M::C; c; - │ ^ Could not resolve the name 'H' - -error[E03001]: address with no value - ┌─ tests/move_2024/expansion/unbound_named_address.move:16:18 - │ -16 │ let a = @I; a; // suggests declaration - │ ^ address 'I' is not assigned a value. Try assigning it a value when calling the compiler - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unbound_named_address.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unbound_named_address.snap new file mode 100644 index 0000000000000..5e96b30e5548d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unbound_named_address.snap @@ -0,0 +1,63 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/unbound_named_address.move +--- +error[E03002]: unbound module + ┌─ tests/move_2024/expansion/unbound_named_address.move:3:9 + │ +3 │ use B::X; + │ ^^^^ Invalid 'use'. Unbound module: 'B::X' + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/expansion/unbound_named_address.move:5:12 + │ +5 │ friend C::M; + │ ^ Could not resolve the name 'C' + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/expansion/unbound_named_address.move:6:12 + │ +6 │ friend D::M::foo; + │ ^ Could not resolve the name 'D' + +error[E01003]: invalid modifier + ┌─ tests/move_2024/expansion/unbound_named_address.move:8:5 + │ +8 │ struct S { + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/expansion/unbound_named_address.move:9:12 + │ +9 │ x: E::M::S, + │ ^ Could not resolve the name 'E' + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/expansion/unbound_named_address.move:13:17 + │ +13 │ let x = F::M::S {}; x; + │ ^ Could not resolve the name 'F' + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/expansion/unbound_named_address.move:14:9 + │ +14 │ G::M::foo(); + │ ^ Could not resolve the name 'G' + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/expansion/unbound_named_address.move:15:17 + │ +15 │ let c = H::M::C; c; + │ ^ Could not resolve the name 'H' + +error[E03001]: address with no value + ┌─ tests/move_2024/expansion/unbound_named_address.move:16:18 + │ +16 │ let a = @I; a; // suggests declaration + │ ^ address 'I' is not assigned a value. Try assigning it a value when calling the compiler diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_default.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_default.exp deleted file mode 100644 index d3c866bf0ec71..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_default.exp +++ /dev/null @@ -1,49 +0,0 @@ -warning[W02021]: duplicate alias - ┌─ tests/move_2024/expansion/unnecessary_alias_default.move:2:14 - │ -2 │ use std::vector; - │ ^^^^^^ Unnecessary alias 'vector' for module 'std::vector'. This alias is provided by default - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_2024/expansion/unnecessary_alias_default.move:2:14 - │ -2 │ use std::vector; - │ ^^^^^^ Unused 'use' of alias 'vector'. Consider removing it - │ - = This alias does not shadow the built-in type 'vector' in type annotations. - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W02021]: duplicate alias - ┌─ tests/move_2024/expansion/unnecessary_alias_default.move:3:23 - │ -3 │ use std::option::{Self, Option}; - │ ^^^^ Unnecessary alias 'option' for module 'std::option'. This alias is provided by default - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_2024/expansion/unnecessary_alias_default.move:3:23 - │ -3 │ use std::option::{Self, Option}; - │ ^^^^ Unused 'use' of alias 'option'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W02021]: duplicate alias - ┌─ tests/move_2024/expansion/unnecessary_alias_default.move:3:29 - │ -3 │ use std::option::{Self, Option}; - │ ^^^^^^ Unnecessary alias 'Option' for module member 'std::option::Option'. This alias is provided by default - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_2024/expansion/unnecessary_alias_default.move:3:29 - │ -3 │ use std::option::{Self, Option}; - │ ^^^^^^ Unused 'use' of alias 'Option'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_default.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_default.snap new file mode 100644 index 0000000000000..9095b73702c55 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_default.snap @@ -0,0 +1,56 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_default.move +--- +warning[W02021]: duplicate alias + ┌─ tests/move_2024/expansion/unnecessary_alias_default.move:2:14 + │ +2 │ use std::vector; + │ ^^^^^^ Unnecessary alias 'vector' for module 'std::vector'. This alias is provided by default + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/expansion/unnecessary_alias_default.move:2:14 + │ +2 │ use std::vector; + │ ^^^^^^ Unused 'use' of alias 'vector'. Consider removing it + │ + = This alias does not shadow the built-in type 'vector' in type annotations. + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W02021]: duplicate alias + ┌─ tests/move_2024/expansion/unnecessary_alias_default.move:3:23 + │ +3 │ use std::option::{Self, Option}; + │ ^^^^ Unnecessary alias 'option' for module 'std::option'. This alias is provided by default + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/expansion/unnecessary_alias_default.move:3:23 + │ +3 │ use std::option::{Self, Option}; + │ ^^^^ Unused 'use' of alias 'option'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W02021]: duplicate alias + ┌─ tests/move_2024/expansion/unnecessary_alias_default.move:3:29 + │ +3 │ use std::option::{Self, Option}; + │ ^^^^^^ Unnecessary alias 'Option' for module member 'std::option::Option'. This alias is provided by default + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/expansion/unnecessary_alias_default.move:3:29 + │ +3 │ use std::option::{Self, Option}; + │ ^^^^^^ Unused 'use' of alias 'Option'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_explicit.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_explicit.exp deleted file mode 100644 index 6ee7276df26dc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_explicit.exp +++ /dev/null @@ -1,57 +0,0 @@ -warning[W02021]: duplicate alias - ┌─ tests/move_2024/expansion/unnecessary_alias_explicit.move:12:16 - │ - 7 │ use a::m; // unused silenced - │ - The same alias was previously declared here - · -12 │ use a::m; // unused and duplicate - │ ^ Unnecessary alias 'm' for module 'a::m'. It was already in scope - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_2024/expansion/unnecessary_alias_explicit.move:12:16 - │ -12 │ use a::m; // unused and duplicate - │ ^ Unused 'use' of alias 'm'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W02021]: duplicate alias - ┌─ tests/move_2024/expansion/unnecessary_alias_explicit.move:13:19 - │ - 8 │ use a::m::S; // unused silenced - │ - The same alias was previously declared here - · -13 │ use a::m::S; // unused and duplicate - │ ^ Unnecessary alias 'S' for module member 'a::m::S'. It was already in scope - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_2024/expansion/unnecessary_alias_explicit.move:13:19 - │ -13 │ use a::m::S; // unused and duplicate - │ ^ Unused 'use' of alias 'S'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W02021]: duplicate alias - ┌─ tests/move_2024/expansion/unnecessary_alias_explicit.move:14:19 - │ - 9 │ use a::m::foo; // unused silenced - │ --- The same alias was previously declared here - · -14 │ use a::m::foo; // unused and duplicate - │ ^^^ Unnecessary alias 'foo' for module member 'a::m::foo'. It was already in scope - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_2024/expansion/unnecessary_alias_explicit.move:14:19 - │ -14 │ use a::m::foo; // unused and duplicate - │ ^^^ Unused 'use' of alias 'foo'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_explicit.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_explicit.snap new file mode 100644 index 0000000000000..53ab2bd521246 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_explicit.snap @@ -0,0 +1,64 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_explicit.move +--- +warning[W02021]: duplicate alias + ┌─ tests/move_2024/expansion/unnecessary_alias_explicit.move:12:16 + │ + 7 │ use a::m; // unused silenced + │ - The same alias was previously declared here + · +12 │ use a::m; // unused and duplicate + │ ^ Unnecessary alias 'm' for module 'a::m'. It was already in scope + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/expansion/unnecessary_alias_explicit.move:12:16 + │ +12 │ use a::m; // unused and duplicate + │ ^ Unused 'use' of alias 'm'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W02021]: duplicate alias + ┌─ tests/move_2024/expansion/unnecessary_alias_explicit.move:13:19 + │ + 8 │ use a::m::S; // unused silenced + │ - The same alias was previously declared here + · +13 │ use a::m::S; // unused and duplicate + │ ^ Unnecessary alias 'S' for module member 'a::m::S'. It was already in scope + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/expansion/unnecessary_alias_explicit.move:13:19 + │ +13 │ use a::m::S; // unused and duplicate + │ ^ Unused 'use' of alias 'S'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W02021]: duplicate alias + ┌─ tests/move_2024/expansion/unnecessary_alias_explicit.move:14:19 + │ + 9 │ use a::m::foo; // unused silenced + │ --- The same alias was previously declared here + · +14 │ use a::m::foo; // unused and duplicate + │ ^^^ Unnecessary alias 'foo' for module member 'a::m::foo'. It was already in scope + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/expansion/unnecessary_alias_explicit.move:14:19 + │ +14 │ use a::m::foo; // unused and duplicate + │ ^^^ Unused 'use' of alias 'foo'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_implicit.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_implicit.exp deleted file mode 100644 index 8bb732f38a838..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_implicit.exp +++ /dev/null @@ -1,38 +0,0 @@ -warning[W02021]: duplicate alias - ┌─ tests/move_2024/expansion/unnecessary_alias_implicit.move:4:19 - │ -2 │ public struct S() - │ - The same alias was previously declared here -3 │ public fun foo() { -4 │ use a::m::S; // unused and duplciate - │ ^ Unnecessary alias 'S' for module member 'a::m::S'. It was already in scope - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_2024/expansion/unnecessary_alias_implicit.move:4:19 - │ -4 │ use a::m::S; // unused and duplciate - │ ^ Unused 'use' of alias 'S'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W02021]: duplicate alias - ┌─ tests/move_2024/expansion/unnecessary_alias_implicit.move:5:19 - │ -3 │ public fun foo() { - │ --- The same alias was previously declared here -4 │ use a::m::S; // unused and duplciate -5 │ use a::m::foo; // unused and duplciate - │ ^^^ Unnecessary alias 'foo' for module member 'a::m::foo'. It was already in scope - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_2024/expansion/unnecessary_alias_implicit.move:5:19 - │ -5 │ use a::m::foo; // unused and duplciate - │ ^^^ Unused 'use' of alias 'foo'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_implicit.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_implicit.snap new file mode 100644 index 0000000000000..4cfde80effd9e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_implicit.snap @@ -0,0 +1,45 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/unnecessary_alias_implicit.move +--- +warning[W02021]: duplicate alias + ┌─ tests/move_2024/expansion/unnecessary_alias_implicit.move:4:19 + │ +2 │ public struct S() + │ - The same alias was previously declared here +3 │ public fun foo() { +4 │ use a::m::S; // unused and duplciate + │ ^ Unnecessary alias 'S' for module member 'a::m::S'. It was already in scope + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/expansion/unnecessary_alias_implicit.move:4:19 + │ +4 │ use a::m::S; // unused and duplciate + │ ^ Unused 'use' of alias 'S'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W02021]: duplicate alias + ┌─ tests/move_2024/expansion/unnecessary_alias_implicit.move:5:19 + │ +3 │ public fun foo() { + │ --- The same alias was previously declared here +4 │ use a::m::S; // unused and duplciate +5 │ use a::m::foo; // unused and duplciate + │ ^^^ Unnecessary alias 'foo' for module member 'a::m::foo'. It was already in scope + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/expansion/unnecessary_alias_implicit.move:5:19 + │ +5 │ use a::m::foo; // unused and duplciate + │ ^^^ Unused 'use' of alias 'foo'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_function_overlap_with_module.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_function_overlap_with_module.snap new file mode 100644 index 0000000000000..4e1bfbe3f43a0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_function_overlap_with_module.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/use_function_overlap_with_module.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_module_name.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_module_name.snap new file mode 100644 index 0000000000000..dc6a886a12c71 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_module_name.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/use_module_name.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_nested_self_as_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_nested_self_as_invalid.exp deleted file mode 100644 index f13dbad52c02d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_nested_self_as_invalid.exp +++ /dev/null @@ -1,41 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/expansion/use_nested_self_as_invalid.move:2:5 - │ -2 │ struct S {} - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -warning[W09001]: unused alias - ┌─ tests/move_2024/expansion/use_nested_self_as_invalid.move:7:26 - │ -7 │ use 0x2::X::{Self as B, foo, S}; - │ ^ Unused 'use' of alias 'B'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01003]: invalid modifier - ┌─ tests/move_2024/expansion/use_nested_self_as_invalid.move:9:5 - │ -9 │ struct X { f: X::S, f2: S } - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/use_nested_self_as_invalid.move:9:19 - │ -9 │ struct X { f: X::S, f2: S } - │ ^^^^ Unexpected enum variant identifier. An enum variant identifier is not a valid type - │ - = Variants may not be used as types. Use the enum instead. - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/use_nested_self_as_invalid.move:11:9 - │ - 9 │ struct X { f: X::S, f2: S } - │ - But 'X' is an struct -10 │ fun bar() { -11 │ X::foo(); - │ ^ Invalid construction. Expected an enum - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_nested_self_as_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_nested_self_as_invalid.snap new file mode 100644 index 0000000000000..83a4e8db7944e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_nested_self_as_invalid.snap @@ -0,0 +1,48 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/use_nested_self_as_invalid.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/expansion/use_nested_self_as_invalid.move:2:5 + │ +2 │ struct S {} + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +warning[W09001]: unused alias + ┌─ tests/move_2024/expansion/use_nested_self_as_invalid.move:7:26 + │ +7 │ use 0x2::X::{Self as B, foo, S}; + │ ^ Unused 'use' of alias 'B'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01003]: invalid modifier + ┌─ tests/move_2024/expansion/use_nested_self_as_invalid.move:9:5 + │ +9 │ struct X { f: X::S, f2: S } + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/expansion/use_nested_self_as_invalid.move:9:19 + │ +9 │ struct X { f: X::S, f2: S } + │ ^^^^ Unexpected enum variant identifier. An enum variant identifier is not a valid type + │ + = Variants may not be used as types. Use the enum instead. + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/expansion/use_nested_self_as_invalid.move:11:9 + │ + 9 │ struct X { f: X::S, f2: S } + │ - But 'X' is an struct +10 │ fun bar() { +11 │ X::foo(); + │ ^ Invalid construction. Expected an enum diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_nested_self_duplicate.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_nested_self_duplicate.exp deleted file mode 100644 index 4201efc7cd8d2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_nested_self_duplicate.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/expansion/use_nested_self_duplicate.move:2:5 - │ -2 │ struct S {} - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/expansion/use_nested_self_duplicate.move:8:17 - │ -7 │ use 0x2::X; - │ - Alias previously defined here -8 │ use 0x2::X::Self; - │ ^^^^ Duplicate module alias 'X'. Module aliases must be unique within a given namespace - -error[E01003]: invalid modifier - ┌─ tests/move_2024/expansion/use_nested_self_duplicate.move:10:5 - │ -10 │ struct S { f: X::S } - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_nested_self_duplicate.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_nested_self_duplicate.snap new file mode 100644 index 0000000000000..38ffa641d56a5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_nested_self_duplicate.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/use_nested_self_duplicate.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/expansion/use_nested_self_duplicate.move:2:5 + │ +2 │ struct S {} + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/expansion/use_nested_self_duplicate.move:8:17 + │ +7 │ use 0x2::X; + │ - Alias previously defined here +8 │ use 0x2::X::Self; + │ ^^^^ Duplicate module alias 'X'. Module aliases must be unique within a given namespace + +error[E01003]: invalid modifier + ┌─ tests/move_2024/expansion/use_nested_self_duplicate.move:10:5 + │ +10 │ struct S { f: X::S } + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_struct_overlap_with_module.exp b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_struct_overlap_with_module.exp deleted file mode 100644 index 44d88801fde95..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_struct_overlap_with_module.exp +++ /dev/null @@ -1,32 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/expansion/use_struct_overlap_with_module.move:2:5 - │ -2 │ struct S {} - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/expansion/use_struct_overlap_with_module.move:6:29 - │ -6 │ use 0x2::X::{Self, S as X}; - │ ---- ^ Duplicate module member or alias 'X'. Top level names in a namespace must be unique - │ │ - │ Alias previously defined here - -error[E01003]: invalid modifier - ┌─ tests/move_2024/expansion/use_struct_overlap_with_module.move:7:5 - │ -7 │ struct A { f1: X, f2: X::S } - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/expansion/use_struct_overlap_with_module.move:7:27 - │ -7 │ struct A { f1: X, f2: X::S } - │ ^^^^ Unexpected enum variant identifier. An enum variant identifier is not a valid type - │ - = Variants may not be used as types. Use the enum instead. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_struct_overlap_with_module.snap b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_struct_overlap_with_module.snap new file mode 100644 index 0000000000000..9e5bc8159c382 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/expansion/use_struct_overlap_with_module.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/expansion/use_struct_overlap_with_module.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/expansion/use_struct_overlap_with_module.move:2:5 + │ +2 │ struct S {} + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/expansion/use_struct_overlap_with_module.move:6:29 + │ +6 │ use 0x2::X::{Self, S as X}; + │ ---- ^ Duplicate module member or alias 'X'. Top level names in a namespace must be unique + │ │ + │ Alias previously defined here + +error[E01003]: invalid modifier + ┌─ tests/move_2024/expansion/use_struct_overlap_with_module.move:7:5 + │ +7 │ struct A { f1: X, f2: X::S } + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/expansion/use_struct_overlap_with_module.move:7:27 + │ +7 │ struct A { f1: X, f2: X::S } + │ ^^^^ Unexpected enum variant identifier. An enum variant identifier is not a valid type + │ + = Variants may not be used as types. Use the enum instead. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/folding/equal_operand.snap b/external-crates/move/crates/move-compiler/tests/move_2024/folding/equal_operand.snap new file mode 100644 index 0000000000000..6298473913cd1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/folding/equal_operand.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/folding/equal_operand.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/folding/equal_operand_false_negative.snap b/external-crates/move/crates/move-compiler/tests/move_2024/folding/equal_operand_false_negative.snap new file mode 100644 index 0000000000000..8d53d61b4dc91 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/folding/equal_operand_false_negative.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/folding/equal_operand_false_negative.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/abort_pair.exp b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/abort_pair.exp deleted file mode 100644 index 11213a0f76c3a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/abort_pair.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/hlir/abort_pair.move:4:6 - │ -4 │ (abort 0, abort 0) - │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/abort_pair.snap b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/abort_pair.snap new file mode 100644 index 0000000000000..5f2a2d7d9a8fb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/abort_pair.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/hlir/abort_pair.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/hlir/abort_pair.move:4:6 + │ +4 │ (abort 0, abort 0) + │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/break_outer_loop.exp b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/break_outer_loop.exp deleted file mode 100644 index 1248676bfbc1f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/break_outer_loop.exp +++ /dev/null @@ -1,10 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/hlir/break_outer_loop.move:14:13 - │ -14 │ break 'a 5; - │ ^^^^^^^^^^ Any code after this expression will not be reached -15 │ break 10; - │ -------- Unreachable code. This statement (and any following statements) will not be executed. - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/break_outer_loop.snap b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/break_outer_loop.snap new file mode 100644 index 0000000000000..4ee41ad7591d1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/break_outer_loop.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/hlir/break_outer_loop.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/hlir/break_outer_loop.move:14:13 + │ +14 │ break 'a 5; + │ ^^^^^^^^^^ Any code after this expression will not be reached +15 │ break 10; + │ -------- Unreachable code. This statement (and any following statements) will not be executed. + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/dead_code_guard.exp b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/dead_code_guard.exp deleted file mode 100644 index dbb8b6824c571..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/dead_code_guard.exp +++ /dev/null @@ -1,10 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/hlir/dead_code_guard.move:14:20 - │ -14 │ _ if ({return 0; true}) => 1, - │ ^^^^^^^^ ---- Unreachable code. This statement (and any following statements) will not be executed. - │ │ - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/dead_code_guard.snap b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/dead_code_guard.snap new file mode 100644 index 0000000000000..85d977cabfdea --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/dead_code_guard.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/hlir/dead_code_guard.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/hlir/dead_code_guard.move:14:20 + │ +14 │ _ if ({return 0; true}) => 1, + │ ^^^^^^^^ ---- Unreachable code. This statement (and any following statements) will not be executed. + │ │ + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/dead_code_nested_block.exp b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/dead_code_nested_block.exp deleted file mode 100644 index d36d22e904ce2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/dead_code_nested_block.exp +++ /dev/null @@ -1,29 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_2024/hlir/dead_code_nested_block.move:3:11 - │ -3 │ fun test0(cond: bool): u64 { - │ ^^^^ Unused parameter 'cond'. Consider removing or prefixing with an underscore: '_cond' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/hlir/dead_code_nested_block.move:5:9 - │ -5 │ return 'a 5; - │ ^^^^^^^^^^^ Any code after this expression will not be reached -6 │ 0 - │ - Unreachable code. This statement (and any following statements) will not be executed. - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/hlir/dead_code_nested_block.move:13:13 - │ -13 │ return 'a 5 - │ ^^^^^^^^^^^ Any code after this expression will not be reached -14 │ }; -15 │ 0 - │ - Unreachable code. This statement (and any following statements) will not be executed. - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/dead_code_nested_block.snap b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/dead_code_nested_block.snap new file mode 100644 index 0000000000000..0bce56cb65d3e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/dead_code_nested_block.snap @@ -0,0 +1,36 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/hlir/dead_code_nested_block.move +--- +warning[W09002]: unused variable + ┌─ tests/move_2024/hlir/dead_code_nested_block.move:3:11 + │ +3 │ fun test0(cond: bool): u64 { + │ ^^^^ Unused parameter 'cond'. Consider removing or prefixing with an underscore: '_cond' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/hlir/dead_code_nested_block.move:5:9 + │ +5 │ return 'a 5; + │ ^^^^^^^^^^^ Any code after this expression will not be reached +6 │ 0 + │ - Unreachable code. This statement (and any following statements) will not be executed. + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/hlir/dead_code_nested_block.move:13:13 + │ +13 │ return 'a 5 + │ ^^^^^^^^^^^ Any code after this expression will not be reached +14 │ }; +15 │ 0 + │ - Unreachable code. This statement (and any following statements) will not be executed. + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/determine_error.snap b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/determine_error.snap new file mode 100644 index 0000000000000..e3a15000f7217 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/determine_error.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/hlir/determine_error.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/if_abort_statement.exp b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/if_abort_statement.exp deleted file mode 100644 index 76ca9448a74c2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/if_abort_statement.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/hlir/if_abort_statement.move:4:18 - │ -4 │ let x: u64 = if (true) abort 0 else abort 0; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/if_abort_statement.snap b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/if_abort_statement.snap new file mode 100644 index 0000000000000..567ad7f8aaff1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/if_abort_statement.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/hlir/if_abort_statement.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/hlir/if_abort_statement.move:4:18 + │ +4 │ let x: u64 = if (true) abort 0 else abort 0; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/labeled_control_exp_associativity_unreachable_code.exp b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/labeled_control_exp_associativity_unreachable_code.exp deleted file mode 100644 index 5e7c69c6c07a1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/labeled_control_exp_associativity_unreachable_code.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/hlir/labeled_control_exp_associativity_unreachable_code.move:11:13 - │ -11 │ 1 + 'a: loop { foo() } + 2; - │ ^^^^^^^^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/labeled_control_exp_associativity_unreachable_code.snap b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/labeled_control_exp_associativity_unreachable_code.snap new file mode 100644 index 0000000000000..f4587b4791415 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/labeled_control_exp_associativity_unreachable_code.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/hlir/labeled_control_exp_associativity_unreachable_code.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/hlir/labeled_control_exp_associativity_unreachable_code.move:11:13 + │ +11 │ 1 + 'a: loop { foo() } + 2; + │ ^^^^^^^^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/nested_if_abort.snap b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/nested_if_abort.snap new file mode 100644 index 0000000000000..1fbb84069843e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/nested_if_abort.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/hlir/nested_if_abort.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/nested_if_abort_statement.exp b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/nested_if_abort_statement.exp deleted file mode 100644 index bfba37c67fe59..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/nested_if_abort_statement.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/hlir/nested_if_abort_statement.move:5:9 - │ -5 │ if (true) abort 0 else abort 0 - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/hlir/nested_if_abort_statement.move:7:9 - │ -7 │ if (true) abort 0 else abort 0 - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/nested_if_abort_statement.snap b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/nested_if_abort_statement.snap new file mode 100644 index 0000000000000..83ea776646c6e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/nested_if_abort_statement.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/hlir/nested_if_abort_statement.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/hlir/nested_if_abort_statement.move:5:9 + │ +5 │ if (true) abort 0 else abort 0 + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/hlir/nested_if_abort_statement.move:7:9 + │ +7 │ if (true) abort 0 else abort 0 + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/nested_named_block_inner_break.snap b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/nested_named_block_inner_break.snap new file mode 100644 index 0000000000000..54b04b527c721 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/nested_named_block_inner_break.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/hlir/nested_named_block_inner_break.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/no_dead_code_block.snap b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/no_dead_code_block.snap new file mode 100644 index 0000000000000..4cb0aeaf0e40d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/no_dead_code_block.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/hlir/no_dead_code_block.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/return_value.exp b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/return_value.exp deleted file mode 100644 index 8c8cf5d6c3a3c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/return_value.exp +++ /dev/null @@ -1,10 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/hlir/return_value.move:4:5 - │ -4 │ return 5; - │ ^^^^^^^^ Any code after this expression will not be reached -5 │ 10 - │ -- Unreachable code. This statement (and any following statements) will not be executed. - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/return_value.snap b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/return_value.snap new file mode 100644 index 0000000000000..a0c89ca31c825 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/return_value.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/hlir/return_value.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/hlir/return_value.move:4:5 + │ +4 │ return 5; + │ ^^^^^^^^ Any code after this expression will not be reached +5 │ 10 + │ -- Unreachable code. This statement (and any following statements) will not be executed. + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/tail_block_freeze.snap b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/tail_block_freeze.snap new file mode 100644 index 0000000000000..a19f81c726113 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/tail_block_freeze.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/hlir/tail_block_freeze.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/hlir/true_false_nested_abort.snap b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/true_false_nested_abort.snap new file mode 100644 index 0000000000000..acec7e7a52939 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/hlir/true_false_nested_abort.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/hlir/true_false_nested_abort.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_lower_case_incomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_lower_case_incomplete.exp deleted file mode 100644 index 63272320a94b7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_lower_case_incomplete.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03009]: unbound variable - ┌─ tests/move_2024/ide_mode/chain_lower_case_incomplete.move:5:9 - │ -5 │ b - │ ^ Unbound variable 'b' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_lower_case_incomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_lower_case_incomplete.ide.exp deleted file mode 100644 index 77b0838217469..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_lower_case_incomplete.ide.exp +++ /dev/null @@ -1,34 +0,0 @@ -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/chain_lower_case_incomplete.move:1:1 - │ -1 │ ╭ module 0x42::m1 { -2 │ │ public fun bar() {} -3 │ │ -4 │ │ public fun foo() { -5 │ │ b -6 │ │ } -7 │ │ } - │ ╰─^ Possible in-scope names - │ - = members: 'Option -> std::option::Option', 'bar -> 0x42::m1::bar', or 'foo -> 0x42::m1::foo' - = modules: 'Self -> 0x42::m1', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/chain_lower_case_incomplete.move:5:9 - │ -5 │ b - │ ^ Possible in-scope names - │ - = members: 'Option -> std::option::Option', 'bar -> 0x42::m1::bar', or 'foo -> 0x42::m1::foo' - = modules: 'Self -> 0x42::m1', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -error[E03009]: unbound variable - ┌─ tests/move_2024/ide_mode/chain_lower_case_incomplete.move:5:9 - │ -5 │ b - │ ^ Unbound variable 'b' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_lower_case_incomplete.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_lower_case_incomplete.snap new file mode 100644 index 0000000000000..56ad5edd3b14c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_lower_case_incomplete.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/chain_lower_case_incomplete.move +--- +error[E03009]: unbound variable + ┌─ tests/move_2024/ide_mode/chain_lower_case_incomplete.move:5:9 + │ +5 │ b + │ ^ Unbound variable 'b' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_lower_case_incomplete@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_lower_case_incomplete@ide.snap new file mode 100644 index 0000000000000..c433025501eb7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_lower_case_incomplete@ide.snap @@ -0,0 +1,41 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/chain_lower_case_incomplete.move +--- +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/chain_lower_case_incomplete.move:1:1 + │ +1 │ ╭ module 0x42::m1 { +2 │ │ public fun bar() {} +3 │ │ +4 │ │ public fun foo() { +5 │ │ b +6 │ │ } +7 │ │ } + │ ╰─^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'bar -> 0x42::m1::bar', or 'foo -> 0x42::m1::foo' + = modules: 'Self -> 0x42::m1', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/chain_lower_case_incomplete.move:5:9 + │ +5 │ b + │ ^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'bar -> 0x42::m1::bar', or 'foo -> 0x42::m1::foo' + = modules: 'Self -> 0x42::m1', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +error[E03009]: unbound variable + ┌─ tests/move_2024/ide_mode/chain_lower_case_incomplete.move:5:9 + │ +5 │ b + │ ^ Unbound variable 'b' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_upper_case_incomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_upper_case_incomplete.exp deleted file mode 100644 index 53264bfaf9dac..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_upper_case_incomplete.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/ide_mode/chain_upper_case_incomplete.move:5:9 - │ -5 │ B - │ ^ Expected a type, function, or constant in this position, not an address - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_upper_case_incomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_upper_case_incomplete.ide.exp deleted file mode 100644 index 55cf52d9e1f93..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_upper_case_incomplete.ide.exp +++ /dev/null @@ -1,34 +0,0 @@ -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/chain_upper_case_incomplete.move:1:1 - │ -1 │ ╭ module 0x42::m1 { -2 │ │ public fun bar() {} -3 │ │ -4 │ │ public fun foo() { -5 │ │ B -6 │ │ } -7 │ │ } - │ ╰─^ Possible in-scope names - │ - = members: 'Option -> std::option::Option', 'bar -> 0x42::m1::bar', or 'foo -> 0x42::m1::foo' - = modules: 'Self -> 0x42::m1', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/chain_upper_case_incomplete.move:5:9 - │ -5 │ B - │ ^ Possible in-scope names - │ - = members: 'Option -> std::option::Option', 'bar -> 0x42::m1::bar', or 'foo -> 0x42::m1::foo' - = modules: 'Self -> 0x42::m1', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/ide_mode/chain_upper_case_incomplete.move:5:9 - │ -5 │ B - │ ^ Expected a type, function, or constant in this position, not an address - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_upper_case_incomplete.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_upper_case_incomplete.snap new file mode 100644 index 0000000000000..63e3b83349b54 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_upper_case_incomplete.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/chain_upper_case_incomplete.move +--- +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/ide_mode/chain_upper_case_incomplete.move:5:9 + │ +5 │ B + │ ^ Expected a type, function, or constant in this position, not an address diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_upper_case_incomplete@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_upper_case_incomplete@ide.snap new file mode 100644 index 0000000000000..ffc750483b557 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/chain_upper_case_incomplete@ide.snap @@ -0,0 +1,41 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/chain_upper_case_incomplete.move +--- +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/chain_upper_case_incomplete.move:1:1 + │ +1 │ ╭ module 0x42::m1 { +2 │ │ public fun bar() {} +3 │ │ +4 │ │ public fun foo() { +5 │ │ B +6 │ │ } +7 │ │ } + │ ╰─^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'bar -> 0x42::m1::bar', or 'foo -> 0x42::m1::foo' + = modules: 'Self -> 0x42::m1', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/chain_upper_case_incomplete.move:5:9 + │ +5 │ B + │ ^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'bar -> 0x42::m1::bar', or 'foo -> 0x42::m1::foo' + = modules: 'Self -> 0x42::m1', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/ide_mode/chain_upper_case_incomplete.move:5:9 + │ +5 │ B + │ ^ Expected a type, function, or constant in this position, not an address diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.exp deleted file mode 100644 index 4e0dee349a969..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:10:9 - │ -10 │ A - │ ^ Expected a type, function, or constant in this position, not an address - -error[E01016]: invalid name - ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:14:9 - │ -14 │ a:: - │ ^^^ Incomplete name in this position. Expected an identifier after '::' - -error[E01016]: invalid name - ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:18:9 - │ -18 │ a::m:: - │ ^^^^^^ Incomplete name in this position. Expected an identifier after '::' - -error[E01016]: invalid name - ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:22:9 - │ -22 │ a::m::SomeEnum:: - │ ^^^^^^^^^^^^^^^^ Incomplete name in this position. Expected an identifier after '::' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.ide.exp deleted file mode 100644 index 6b0871621b12e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.ide.exp +++ /dev/null @@ -1,98 +0,0 @@ -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:1:1 - │ - 1 │ ╭ module a::m { - 2 │ │ - 3 │ │ public enum SomeEnum { - 4 │ │ SomeVariant, - · │ -24 │ │ -25 │ │ } - │ ╰─^ Possible in-scope names - │ - = members: 'Option -> std::option::Option', 'SomeEnum -> a::m::SomeEnum', 'foo -> a::m::foo', 'member_complete -> a::m::member_complete', 'mod_complete -> a::m::mod_complete', 'pkg_complete -> a::m::pkg_complete', or 'variant_incomplete -> a::m::variant_incomplete' - = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:10:9 - │ -10 │ A - │ ^ Possible in-scope names - │ - = members: 'Option -> std::option::Option', 'SomeEnum -> a::m::SomeEnum', 'foo -> a::m::foo', 'member_complete -> a::m::member_complete', 'mod_complete -> a::m::mod_complete', 'pkg_complete -> a::m::pkg_complete', or 'variant_incomplete -> a::m::variant_incomplete' - = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:10:9 - │ -10 │ A - │ ^ Expected a type, function, or constant in this position, not an address - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:14:9 - │ -14 │ a:: - │ ^ Possible in-scope names - │ - = members: 'Option -> std::option::Option', 'SomeEnum -> a::m::SomeEnum', 'foo -> a::m::foo', 'member_complete -> a::m::member_complete', 'mod_complete -> a::m::mod_complete', 'pkg_complete -> a::m::pkg_complete', or 'variant_incomplete -> a::m::variant_incomplete' - = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -error[E01016]: invalid name - ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:14:9 - │ -14 │ a:: - │ ^^^ Incomplete name in this position. Expected an identifier after '::' - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:18:9 - │ -18 │ a::m:: - │ ^ Possible in-scope names - │ - = members: 'Option -> std::option::Option', 'SomeEnum -> a::m::SomeEnum', 'foo -> a::m::foo', 'member_complete -> a::m::member_complete', 'mod_complete -> a::m::mod_complete', 'pkg_complete -> a::m::pkg_complete', or 'variant_incomplete -> a::m::variant_incomplete' - = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -error[E01016]: invalid name - ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:18:9 - │ -18 │ a::m:: - │ ^^^^^^ Incomplete name in this position. Expected an identifier after '::' - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:22:9 - │ -22 │ a::m::SomeEnum:: - │ ^ Possible in-scope names - │ - = members: 'Option -> std::option::Option', 'SomeEnum -> a::m::SomeEnum', 'foo -> a::m::foo', 'member_complete -> a::m::member_complete', 'mod_complete -> a::m::mod_complete', 'pkg_complete -> a::m::pkg_complete', or 'variant_incomplete -> a::m::variant_incomplete' - = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -error[E01016]: invalid name - ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:22:9 - │ -22 │ a::m::SomeEnum:: - │ ^^^^^^^^^^^^^^^^ Incomplete name in this position. Expected an identifier after '::' - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:27:1 - │ -27 │ ╭ module a::m2 { -28 │ │ public fun foo() {} -29 │ │ } - │ ╰─^ Possible in-scope names - │ - = members: 'Option -> std::option::Option' or 'foo -> a::m2::foo' - = modules: 'Self -> a::m2', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.snap new file mode 100644 index 0000000000000..09513348fd11d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.move +--- +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:10:9 + │ +10 │ A + │ ^ Expected a type, function, or constant in this position, not an address + +error[E01016]: invalid name + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:14:9 + │ +14 │ a:: + │ ^^^ Incomplete name in this position. Expected an identifier after '::' + +error[E01016]: invalid name + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:18:9 + │ +18 │ a::m:: + │ ^^^^^^ Incomplete name in this position. Expected an identifier after '::' + +error[E01016]: invalid name + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:22:9 + │ +22 │ a::m::SomeEnum:: + │ ^^^^^^^^^^^^^^^^ Incomplete name in this position. Expected an identifier after '::' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete@ide.snap new file mode 100644 index 0000000000000..c36572ba0f685 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete@ide.snap @@ -0,0 +1,105 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/colon_colon_incomplete.move +--- +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:1:1 + │ + 1 │ ╭ module a::m { + 2 │ │ + 3 │ │ public enum SomeEnum { + 4 │ │ SomeVariant, + · │ +24 │ │ +25 │ │ } + │ ╰─^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'SomeEnum -> a::m::SomeEnum', 'foo -> a::m::foo', 'member_complete -> a::m::member_complete', 'mod_complete -> a::m::mod_complete', 'pkg_complete -> a::m::pkg_complete', or 'variant_incomplete -> a::m::variant_incomplete' + = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:10:9 + │ +10 │ A + │ ^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'SomeEnum -> a::m::SomeEnum', 'foo -> a::m::foo', 'member_complete -> a::m::member_complete', 'mod_complete -> a::m::mod_complete', 'pkg_complete -> a::m::pkg_complete', or 'variant_incomplete -> a::m::variant_incomplete' + = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:10:9 + │ +10 │ A + │ ^ Expected a type, function, or constant in this position, not an address + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:14:9 + │ +14 │ a:: + │ ^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'SomeEnum -> a::m::SomeEnum', 'foo -> a::m::foo', 'member_complete -> a::m::member_complete', 'mod_complete -> a::m::mod_complete', 'pkg_complete -> a::m::pkg_complete', or 'variant_incomplete -> a::m::variant_incomplete' + = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +error[E01016]: invalid name + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:14:9 + │ +14 │ a:: + │ ^^^ Incomplete name in this position. Expected an identifier after '::' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:18:9 + │ +18 │ a::m:: + │ ^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'SomeEnum -> a::m::SomeEnum', 'foo -> a::m::foo', 'member_complete -> a::m::member_complete', 'mod_complete -> a::m::mod_complete', 'pkg_complete -> a::m::pkg_complete', or 'variant_incomplete -> a::m::variant_incomplete' + = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +error[E01016]: invalid name + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:18:9 + │ +18 │ a::m:: + │ ^^^^^^ Incomplete name in this position. Expected an identifier after '::' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:22:9 + │ +22 │ a::m::SomeEnum:: + │ ^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'SomeEnum -> a::m::SomeEnum', 'foo -> a::m::foo', 'member_complete -> a::m::member_complete', 'mod_complete -> a::m::mod_complete', 'pkg_complete -> a::m::pkg_complete', or 'variant_incomplete -> a::m::variant_incomplete' + = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +error[E01016]: invalid name + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:22:9 + │ +22 │ a::m::SomeEnum:: + │ ^^^^^^^^^^^^^^^^ Incomplete name in this position. Expected an identifier after '::' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/colon_colon_incomplete.move:27:1 + │ +27 │ ╭ module a::m2 { +28 │ │ public fun foo() {} +29 │ │ } + │ ╰─^ Possible in-scope names + │ + = members: 'Option -> std::option::Option' or 'foo -> a::m2::foo' + = modules: 'Self -> a::m2', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.exp deleted file mode 100644 index 193381dcc549e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.exp +++ /dev/null @@ -1,51 +0,0 @@ -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:1:9 - │ -1 │ #[allow(ide_path_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:14:24 - │ -14 │ let _tmp1 = _s.; // incomplete with `;` (next line should parse) - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:15:26 - │ -15 │ let _tmp2 = _s.a.; // incomplete with `;` (next line should parse) - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:17:9 - │ -17 │ let _tmp4 = _s. - │ ^^^ - │ │ - │ Unexpected 'let' - │ Expected an identifier or a decimal number - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:18:9 - │ -18 │ let _tmp5 = _s. // incomplete without `;` (unexpected `}`) - │ ^^^ - │ │ - │ Unexpected 'let' - │ Expected an identifier or a decimal number - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:19:5 - │ -19 │ } - │ ^ - │ │ - │ Unexpected '}' - │ Expected an identifier or a decimal number - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.ide.exp deleted file mode 100644 index 7c0c665776985..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.ide.exp +++ /dev/null @@ -1,99 +0,0 @@ -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:14:23 - │ -14 │ let _tmp1 = _s.; // incomplete with `;` (next line should parse) - │ ^ Possible dot names: 'a' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:14:24 - │ -14 │ let _tmp1 = _s.; // incomplete with `;` (next line should parse) - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:15:23 - │ -15 │ let _tmp2 = _s.a.; // incomplete with `;` (next line should parse) - │ ^ Possible dot names: 'a' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:15:24 - │ -15 │ let _tmp2 = _s.a.; // incomplete with `;` (next line should parse) - │ ^ Possible dot names: 'a' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:15:25 - │ -15 │ let _tmp2 = _s.a.; // incomplete with `;` (next line should parse) - │ ^ Possible dot names: 'x' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:15:26 - │ -15 │ let _tmp2 = _s.a.; // incomplete with `;` (next line should parse) - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:16:23 - │ -16 │ let _tmp3 = _s.a. // incomplete without `;` (unexpected `let`) - │ ^ Possible dot names: 'a' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:16:24 - │ -16 │ let _tmp3 = _s.a. // incomplete without `;` (unexpected `let`) - │ ^ Possible dot names: 'a' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:16:25 - │ -16 │ let _tmp3 = _s.a. // incomplete without `;` (unexpected `let`) - │ ^ Possible dot names: 'x' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:17:9 - │ -17 │ let _tmp4 = _s. - │ ^^^ - │ │ - │ Unexpected 'let' - │ Expected an identifier or a decimal number - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:17:23 - │ -17 │ let _tmp4 = _s. - │ ^ Possible dot names: 'a' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:18:9 - │ -18 │ let _tmp5 = _s. // incomplete without `;` (unexpected `}`) - │ ^^^ - │ │ - │ Unexpected 'let' - │ Expected an identifier or a decimal number - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:18:23 - │ -18 │ let _tmp5 = _s. // incomplete without `;` (unexpected `}`) - │ ^ Possible dot names: 'a' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/dot_incomplete.move:19:5 - │ -19 │ } - │ ^ - │ │ - │ Unexpected '}' - │ Expected an identifier or a decimal number - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.snap new file mode 100644 index 0000000000000..c1211644e2072 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.snap @@ -0,0 +1,58 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.move +--- +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:14:24 + │ +14 │ let _tmp1 = _s.; // incomplete with `;` (next line should parse) + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:15:26 + │ +15 │ let _tmp2 = _s.a.; // incomplete with `;` (next line should parse) + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:17:9 + │ +17 │ let _tmp4 = _s. + │ ^^^ + │ │ + │ Unexpected 'let' + │ Expected an identifier or a decimal number + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:18:9 + │ +18 │ let _tmp5 = _s. // incomplete without `;` (unexpected `}`) + │ ^^^ + │ │ + │ Unexpected 'let' + │ Expected an identifier or a decimal number + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:19:5 + │ +19 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected an identifier or a decimal number diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete@ide.snap new file mode 100644 index 0000000000000..b3cfc14be09fb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete@ide.snap @@ -0,0 +1,106 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/dot_incomplete.move +--- +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:14:23 + │ +14 │ let _tmp1 = _s.; // incomplete with `;` (next line should parse) + │ ^ Possible dot names: 'a' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:14:24 + │ +14 │ let _tmp1 = _s.; // incomplete with `;` (next line should parse) + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:15:23 + │ +15 │ let _tmp2 = _s.a.; // incomplete with `;` (next line should parse) + │ ^ Possible dot names: 'a' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:15:24 + │ +15 │ let _tmp2 = _s.a.; // incomplete with `;` (next line should parse) + │ ^ Possible dot names: 'a' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:15:25 + │ +15 │ let _tmp2 = _s.a.; // incomplete with `;` (next line should parse) + │ ^ Possible dot names: 'x' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:15:26 + │ +15 │ let _tmp2 = _s.a.; // incomplete with `;` (next line should parse) + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:16:23 + │ +16 │ let _tmp3 = _s.a. // incomplete without `;` (unexpected `let`) + │ ^ Possible dot names: 'a' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:16:24 + │ +16 │ let _tmp3 = _s.a. // incomplete without `;` (unexpected `let`) + │ ^ Possible dot names: 'a' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:16:25 + │ +16 │ let _tmp3 = _s.a. // incomplete without `;` (unexpected `let`) + │ ^ Possible dot names: 'x' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:17:9 + │ +17 │ let _tmp4 = _s. + │ ^^^ + │ │ + │ Unexpected 'let' + │ Expected an identifier or a decimal number + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:17:23 + │ +17 │ let _tmp4 = _s. + │ ^ Possible dot names: 'a' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:18:9 + │ +18 │ let _tmp5 = _s. // incomplete without `;` (unexpected `}`) + │ ^^^ + │ │ + │ Unexpected 'let' + │ Expected an identifier or a decimal number + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:18:23 + │ +18 │ let _tmp5 = _s. // incomplete without `;` (unexpected `}`) + │ ^ Possible dot names: 'a' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/dot_incomplete.move:19:5 + │ +19 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected an identifier or a decimal number diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.exp deleted file mode 100644 index 59a9ec67cee3f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.exp +++ /dev/null @@ -1,12 +0,0 @@ -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:1:9 - │ -1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' - -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:1:31 - │ -1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.ide.exp deleted file mode 100644 index 2dc3cd67fe374..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.ide.exp +++ /dev/null @@ -1,78 +0,0 @@ -note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:17:15 - │ -17 │ let A(.., _q) = a; - │ ^^ Ellipsis expansion: _ - -note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:18:19 - │ -18 │ let A(_q, ..) = a; - │ ^^ Ellipsis expansion: _ - -note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:19:15 - │ -19 │ let A(..) = a; - │ ^^ Ellipsis expansion: _, _ - -note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:21:24 - │ -21 │ let B { q: _q, .. } = b; - │ ^^ Ellipsis expansion: a: _ - -note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:22:24 - │ -22 │ let B { a: _a, .. } = b; - │ ^^ Ellipsis expansion: q: _ - -note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:23:17 - │ -23 │ let B { .. } = b; - │ ^^ Ellipsis expansion: a: _, q: _ - -note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:26:22 - │ -26 │ C::X(_q, ..) => (), - │ ^^ Ellipsis expansion: _ - -note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:27:18 - │ -27 │ C::X(.., _z) => (), - │ ^^ Ellipsis expansion: _ - -note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:28:18 - │ -28 │ C::X(..) => (), - │ ^^ Ellipsis expansion: _, _ - -note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:30:27 - │ -30 │ C::Y { y: _y, .. } => (), - │ ^^ Ellipsis expansion: z: _ - -note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:31:20 - │ -31 │ C::Y { .., y: _y } => (), - │ ^^ Ellipsis expansion: z: _ - -note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:32:20 - │ -32 │ C::Y { .., z: _z } => (), - │ ^^ Ellipsis expansion: y: _ - -note[I15005]: IDE ellipsis expansion - ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:33:20 - │ -33 │ C::Y { .. } => () - │ ^^ Ellipsis expansion: y: _, z: _ - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.snap new file mode 100644 index 0000000000000..7efba78741557 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.move +--- +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:1:31 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion@ide.snap new file mode 100644 index 0000000000000..856c8886bfa58 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion@ide.snap @@ -0,0 +1,85 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/ellipsis_expansion.move +--- +note[I15005]: IDE ellipsis expansion + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:17:15 + │ +17 │ let A(.., _q) = a; + │ ^^ Ellipsis expansion: _ + +note[I15005]: IDE ellipsis expansion + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:18:19 + │ +18 │ let A(_q, ..) = a; + │ ^^ Ellipsis expansion: _ + +note[I15005]: IDE ellipsis expansion + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:19:15 + │ +19 │ let A(..) = a; + │ ^^ Ellipsis expansion: _, _ + +note[I15005]: IDE ellipsis expansion + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:21:24 + │ +21 │ let B { q: _q, .. } = b; + │ ^^ Ellipsis expansion: a: _ + +note[I15005]: IDE ellipsis expansion + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:22:24 + │ +22 │ let B { a: _a, .. } = b; + │ ^^ Ellipsis expansion: q: _ + +note[I15005]: IDE ellipsis expansion + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:23:17 + │ +23 │ let B { .. } = b; + │ ^^ Ellipsis expansion: a: _, q: _ + +note[I15005]: IDE ellipsis expansion + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:26:22 + │ +26 │ C::X(_q, ..) => (), + │ ^^ Ellipsis expansion: _ + +note[I15005]: IDE ellipsis expansion + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:27:18 + │ +27 │ C::X(.., _z) => (), + │ ^^ Ellipsis expansion: _ + +note[I15005]: IDE ellipsis expansion + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:28:18 + │ +28 │ C::X(..) => (), + │ ^^ Ellipsis expansion: _, _ + +note[I15005]: IDE ellipsis expansion + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:30:27 + │ +30 │ C::Y { y: _y, .. } => (), + │ ^^ Ellipsis expansion: z: _ + +note[I15005]: IDE ellipsis expansion + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:31:20 + │ +31 │ C::Y { .., y: _y } => (), + │ ^^ Ellipsis expansion: z: _ + +note[I15005]: IDE ellipsis expansion + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:32:20 + │ +32 │ C::Y { .., z: _z } => (), + │ ^^ Ellipsis expansion: y: _ + +note[I15005]: IDE ellipsis expansion + ┌─ tests/move_2024/ide_mode/ellipsis_expansion.move:33:20 + │ +33 │ C::Y { .. } => () + │ ^^ Ellipsis expansion: y: _, z: _ diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.exp deleted file mode 100644 index 3ac1c59ec96e8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.exp +++ /dev/null @@ -1,63 +0,0 @@ -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:9:9 - │ -9 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' - -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:9:31 - │ -9 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' - -warning[W09002]: unused variable - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:16:22 - │ -16 │ public fun test0(in: B>) { - │ ^^ Unused parameter 'in'. Consider removing or prefixing with an underscore: '_in' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:17:29 - │ -17 │ let _ = &in.0.0[1]. ; - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - -warning[W09002]: unused variable - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:20:22 - │ -20 │ public fun test1(in: B>) { - │ ^^ Unused parameter 'in'. Consider removing or prefixing with an underscore: '_in' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:21:34 - │ -21 │ let _ = &in.0.0[1].0[0]. ; - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - -warning[W09002]: unused variable - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:24:22 - │ -24 │ public fun test2(in: B>) { - │ ^^ Unused parameter 'in'. Consider removing or prefixing with an underscore: '_in' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:25:34 - │ -25 │ let _ = &in.0.0[1].0[0]. ; - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.ide.exp deleted file mode 100644 index ebfb867f8fcce..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.ide.exp +++ /dev/null @@ -1,103 +0,0 @@ -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:2:1 - │ -2 │ ╭ module std::vector { -3 │ │ #[syntax(index)] -4 │ │ native public fun vborrow(v: &vector, i: u64): ∈ -5 │ │ #[syntax(index)] -6 │ │ native public fun vborrow_mut(v: &mut vector, i: u64): &mut Element; -7 │ │ } - │ ╰─^ Possible in-scope names - │ - = members: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', or 'vborrow_mut -> std::vector::vborrow_mut' - = modules: 'Self -> std::vector', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:4:51 - │ -4 │ native public fun vborrow(v: &vector, i: u64): ∈ - │ ^^^^^^^ Possible in-scope names - │ - = members: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', or 'vborrow_mut -> std::vector::vborrow_mut' - = modules: 'Self -> std::vector', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: 'Element' - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:4:71 - │ -4 │ native public fun vborrow(v: &vector, i: u64): ∈ - │ ^^^^^^^ Possible in-scope names - │ - = members: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', or 'vborrow_mut -> std::vector::vborrow_mut' - = modules: 'Self -> std::vector', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: 'Element' - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:6:59 - │ -6 │ native public fun vborrow_mut(v: &mut vector, i: u64): &mut Element; - │ ^^^^^^^ Possible in-scope names - │ - = members: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', or 'vborrow_mut -> std::vector::vborrow_mut' - = modules: 'Self -> std::vector', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: 'Element' - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:6:83 - │ -6 │ native public fun vborrow_mut(v: &mut vector, i: u64): &mut Element; - │ ^^^^^^^ Possible in-scope names - │ - = members: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', or 'vborrow_mut -> std::vector::vborrow_mut' - = modules: 'Self -> std::vector', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: 'Element' - -warning[W09009]: unused struct field - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:14:23 - │ -14 │ public struct C { c: u64, d: u64 } has drop; - │ ^ The 'c' field of the 'C' type is unused - │ - = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09009]: unused struct field - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:14:31 - │ -14 │ public struct C { c: u64, d: u64 } has drop; - │ ^ The 'd' field of the 'C' type is unused - │ - = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:17:29 - │ -17 │ let _ = &in.0.0[1]. ; - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:21:34 - │ -21 │ let _ = &in.0.0[1].0[0]. ; - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/index_autocomplete.move:25:34 - │ -25 │ let _ = &in.0.0[1].0[0]. ; - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.snap new file mode 100644 index 0000000000000..b73cc8ce184e3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.snap @@ -0,0 +1,70 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.move +--- +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:9:9 + │ +9 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:9:31 + │ +9 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' + +warning[W09002]: unused variable + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:16:22 + │ +16 │ public fun test0(in: B>) { + │ ^^ Unused parameter 'in'. Consider removing or prefixing with an underscore: '_in' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:17:29 + │ +17 │ let _ = &in.0.0[1]. ; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +warning[W09002]: unused variable + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:20:22 + │ +20 │ public fun test1(in: B>) { + │ ^^ Unused parameter 'in'. Consider removing or prefixing with an underscore: '_in' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:21:34 + │ +21 │ let _ = &in.0.0[1].0[0]. ; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +warning[W09002]: unused variable + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:24:22 + │ +24 │ public fun test2(in: B>) { + │ ^^ Unused parameter 'in'. Consider removing or prefixing with an underscore: '_in' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:25:34 + │ +25 │ let _ = &in.0.0[1].0[0]. ; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete@ide.snap new file mode 100644 index 0000000000000..60e30beb271ae --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete@ide.snap @@ -0,0 +1,110 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/index_autocomplete.move +--- +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:2:1 + │ +2 │ ╭ module std::vector { +3 │ │ #[syntax(index)] +4 │ │ native public fun vborrow(v: &vector, i: u64): ∈ +5 │ │ #[syntax(index)] +6 │ │ native public fun vborrow_mut(v: &mut vector, i: u64): &mut Element; +7 │ │ } + │ ╰─^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', or 'vborrow_mut -> std::vector::vborrow_mut' + = modules: 'Self -> std::vector', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:4:51 + │ +4 │ native public fun vborrow(v: &vector, i: u64): ∈ + │ ^^^^^^^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', or 'vborrow_mut -> std::vector::vborrow_mut' + = modules: 'Self -> std::vector', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'Element' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:4:71 + │ +4 │ native public fun vborrow(v: &vector, i: u64): ∈ + │ ^^^^^^^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', or 'vborrow_mut -> std::vector::vborrow_mut' + = modules: 'Self -> std::vector', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'Element' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:6:59 + │ +6 │ native public fun vborrow_mut(v: &mut vector, i: u64): &mut Element; + │ ^^^^^^^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', or 'vborrow_mut -> std::vector::vborrow_mut' + = modules: 'Self -> std::vector', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'Element' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:6:83 + │ +6 │ native public fun vborrow_mut(v: &mut vector, i: u64): &mut Element; + │ ^^^^^^^ Possible in-scope names + │ + = members: 'Option -> std::option::Option', 'vborrow -> std::vector::vborrow', or 'vborrow_mut -> std::vector::vborrow_mut' + = modules: 'Self -> std::vector', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'Element' + +warning[W09009]: unused struct field + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:14:23 + │ +14 │ public struct C { c: u64, d: u64 } has drop; + │ ^ The 'c' field of the 'C' type is unused + │ + = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09009]: unused struct field + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:14:31 + │ +14 │ public struct C { c: u64, d: u64 } has drop; + │ ^ The 'd' field of the 'C' type is unused + │ + = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:17:29 + │ +17 │ let _ = &in.0.0[1]. ; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:21:34 + │ +21 │ let _ = &in.0.0[1].0[0]. ; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/index_autocomplete.move:25:34 + │ +25 │ let _ = &in.0.0[1].0[0]. ; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.exp deleted file mode 100644 index 0045ad9736ea8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.exp +++ /dev/null @@ -1,6 +0,0 @@ -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:1:9 - │ -1 │ #[allow(ide_path_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.ide.exp deleted file mode 100644 index e7a86a0d5db49..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.ide.exp +++ /dev/null @@ -1,116 +0,0 @@ -warning[W09009]: unused struct field - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:6:23 - │ -6 │ public struct C { c: u64, d: u64 } has drop; - │ ^ The 'c' field of the 'C' type is unused - │ - = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:16:20 - │ -16 │ let _ = &in.0.0; - │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:16:21 - │ -16 │ let _ = &in.0.0; - │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:16:22 - │ -16 │ let _ = &in.0.0; - │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:16:23 - │ -16 │ let _ = &in.0.0; - │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:20:20 - │ -20 │ let _ = &in.0.0.0 ; - │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:20:21 - │ -20 │ let _ = &in.0.0.0 ; - │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:20:22 - │ -20 │ let _ = &in.0.0.0 ; - │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:20:23 - │ -20 │ let _ = &in.0.0.0 ; - │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:20:24 - │ -20 │ let _ = &in.0.0.0 ; - │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:20:25 - │ -20 │ let _ = &in.0.0.0 ; - │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:20 - │ -24 │ let _ = &in.0.0.0.d ; - │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:21 - │ -24 │ let _ = &in.0.0.0.d ; - │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:22 - │ -24 │ let _ = &in.0.0.0.d ; - │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:23 - │ -24 │ let _ = &in.0.0.0.d ; - │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:24 - │ -24 │ let _ = &in.0.0.0.d ; - │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:25 - │ -24 │ let _ = &in.0.0.0.d ; - │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:26 - │ -24 │ let _ = &in.0.0.0.d ; - │ ^ Possible dot names: 'a::m::for_c_0', 'a::m::for_c_1', 'c', or 'd' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:27 - │ -24 │ let _ = &in.0.0.0.d ; - │ ^ Possible dot names: 'a::m::for_c_0', 'a::m::for_c_1', 'c', or 'd' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.snap new file mode 100644 index 0000000000000..6015f1c02c989 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.move +--- +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete@ide.snap new file mode 100644 index 0000000000000..7e706504599dd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete@ide.snap @@ -0,0 +1,123 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/method_and_field_autocomplete.move +--- +warning[W09009]: unused struct field + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:6:23 + │ +6 │ public struct C { c: u64, d: u64 } has drop; + │ ^ The 'c' field of the 'C' type is unused + │ + = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:16:20 + │ +16 │ let _ = &in.0.0; + │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:16:21 + │ +16 │ let _ = &in.0.0; + │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:16:22 + │ +16 │ let _ = &in.0.0; + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:16:23 + │ +16 │ let _ = &in.0.0; + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:20:20 + │ +20 │ let _ = &in.0.0.0 ; + │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:20:21 + │ +20 │ let _ = &in.0.0.0 ; + │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:20:22 + │ +20 │ let _ = &in.0.0.0 ; + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:20:23 + │ +20 │ let _ = &in.0.0.0 ; + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:20:24 + │ +20 │ let _ = &in.0.0.0 ; + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:20:25 + │ +20 │ let _ = &in.0.0.0 ; + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:20 + │ +24 │ let _ = &in.0.0.0.d ; + │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:21 + │ +24 │ let _ = &in.0.0.0.d ; + │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:22 + │ +24 │ let _ = &in.0.0.0.d ; + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:23 + │ +24 │ let _ = &in.0.0.0.d ; + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:24 + │ +24 │ let _ = &in.0.0.0.d ; + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:25 + │ +24 │ let _ = &in.0.0.0.d ; + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:26 + │ +24 │ let _ = &in.0.0.0.d ; + │ ^ Possible dot names: 'a::m::for_c_0', 'a::m::for_c_1', 'c', or 'd' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_and_field_autocomplete.move:24:27 + │ +24 │ let _ = &in.0.0.0.d ; + │ ^ Possible dot names: 'a::m::for_c_0', 'a::m::for_c_1', 'c', or 'd' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.exp deleted file mode 100644 index 8f98f2f3e539f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.exp +++ /dev/null @@ -1,6 +0,0 @@ -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/method_autocomplete.move:1:9 - │ -1 │ #[allow(ide_path_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.ide.exp deleted file mode 100644 index 7e4a864e94f71..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.ide.exp +++ /dev/null @@ -1,100 +0,0 @@ -warning[W09009]: unused struct field - ┌─ tests/move_2024/ide_mode/method_autocomplete.move:6:23 - │ -6 │ public struct C { c: u64, d: u64 } has drop; - │ ^ The 'c' field of the 'C' type is unused - │ - = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09009]: unused struct field - ┌─ tests/move_2024/ide_mode/method_autocomplete.move:6:31 - │ -6 │ public struct C { c: u64, d: u64 } has drop; - │ ^ The 'd' field of the 'C' type is unused - │ - = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_autocomplete.move:16:11 - │ -16 │ in.for_b_0() - │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_autocomplete.move:16:12 - │ -16 │ in.for_b_0() - │ ^^^^^^^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_autocomplete.move:20:11 - │ -20 │ in.0.for_a_0(); - │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_autocomplete.move:20:12 - │ -20 │ in.0.for_a_0(); - │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_autocomplete.move:20:13 - │ -20 │ in.0.for_a_0(); - │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_autocomplete.move:20:14 - │ -20 │ in.0.for_a_0(); - │ ^^^^^^^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:11 - │ -24 │ in.0.0.0.for_c_0(); - │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:12 - │ -24 │ in.0.0.0.for_c_0(); - │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:13 - │ -24 │ in.0.0.0.for_c_0(); - │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:14 - │ -24 │ in.0.0.0.for_c_0(); - │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:15 - │ -24 │ in.0.0.0.for_c_0(); - │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:16 - │ -24 │ in.0.0.0.for_c_0(); - │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:17 - │ -24 │ in.0.0.0.for_c_0(); - │ ^ Possible dot names: 'a::m::for_c_0', 'a::m::for_c_1', 'c', or 'd' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:18 - │ -24 │ in.0.0.0.for_c_0(); - │ ^^^^^^^ Possible dot names: 'a::m::for_c_0', 'a::m::for_c_1', 'c', or 'd' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.snap new file mode 100644 index 0000000000000..d309b0697936d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.move +--- +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/method_autocomplete.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete@ide.snap new file mode 100644 index 0000000000000..c15e806fb2652 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete@ide.snap @@ -0,0 +1,107 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/method_autocomplete.move +--- +warning[W09009]: unused struct field + ┌─ tests/move_2024/ide_mode/method_autocomplete.move:6:23 + │ +6 │ public struct C { c: u64, d: u64 } has drop; + │ ^ The 'c' field of the 'C' type is unused + │ + = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09009]: unused struct field + ┌─ tests/move_2024/ide_mode/method_autocomplete.move:6:31 + │ +6 │ public struct C { c: u64, d: u64 } has drop; + │ ^ The 'd' field of the 'C' type is unused + │ + = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_autocomplete.move:16:11 + │ +16 │ in.for_b_0() + │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_autocomplete.move:16:12 + │ +16 │ in.for_b_0() + │ ^^^^^^^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_autocomplete.move:20:11 + │ +20 │ in.0.for_a_0(); + │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_autocomplete.move:20:12 + │ +20 │ in.0.for_a_0(); + │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_autocomplete.move:20:13 + │ +20 │ in.0.for_a_0(); + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_autocomplete.move:20:14 + │ +20 │ in.0.for_a_0(); + │ ^^^^^^^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:11 + │ +24 │ in.0.0.0.for_c_0(); + │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:12 + │ +24 │ in.0.0.0.for_c_0(); + │ ^ Possible dot names: 'a::m::for_b_0', 'a::m::for_b_1', 'a::m::test0', 'a::m::test1', 'a::m::test2', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:13 + │ +24 │ in.0.0.0.for_c_0(); + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:14 + │ +24 │ in.0.0.0.for_c_0(); + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:15 + │ +24 │ in.0.0.0.for_c_0(); + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:16 + │ +24 │ in.0.0.0.for_c_0(); + │ ^ Possible dot names: 'a::m::for_a_0', 'a::m::for_a_1', or '0' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:17 + │ +24 │ in.0.0.0.for_c_0(); + │ ^ Possible dot names: 'a::m::for_c_0', 'a::m::for_c_1', 'c', or 'd' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/method_autocomplete.move:24:18 + │ +24 │ in.0.0.0.for_c_0(); + │ ^^^^^^^ Possible dot names: 'a::m::for_c_0', 'a::m::for_c_1', 'c', or 'd' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.exp deleted file mode 100644 index ae9f6d8f7b728..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.exp +++ /dev/null @@ -1,24 +0,0 @@ -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/missing_match_bool.move:1:9 - │ -1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' - -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/missing_match_bool.move:1:31 - │ -1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_bool.move:4:16 - │ -4 │ match (true) { - │ ^^^^ Pattern 'false' not covered - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_bool.move:10:16 - │ -10 │ match (true) { - │ ^^^^ Pattern '_' not covered - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.ide.exp deleted file mode 100644 index 487a7ad81adce..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.ide.exp +++ /dev/null @@ -1,29 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_bool.move:4:16 - │ -4 │ match (true) { - │ ^^^^ Pattern 'false' not covered - -note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_bool.move:4:22 - │ -4 │ match (true) { - │ ╭──────────────────────^ -5 │ │ true => 0 -6 │ │ } - │ ╰─────────^ Missing arms: 'false' - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_bool.move:10:16 - │ -10 │ match (true) { - │ ^^^^ Pattern '_' not covered - -note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_bool.move:10:22 - │ -10 │ match (true) { - │ ╭──────────────────────^ -11 │ │ } - │ ╰─────────^ Missing arms: 'false' and 'true' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.snap new file mode 100644 index 0000000000000..917a92e55d2f0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.move +--- +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_bool.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_bool.move:1:31 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_bool.move:4:16 + │ +4 │ match (true) { + │ ^^^^ Pattern 'false' not covered + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_bool.move:10:16 + │ +10 │ match (true) { + │ ^^^^ Pattern '_' not covered diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool@ide.snap new file mode 100644 index 0000000000000..8dfb18f0102f0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool@ide.snap @@ -0,0 +1,36 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/missing_match_bool.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_bool.move:4:16 + │ +4 │ match (true) { + │ ^^^^ Pattern 'false' not covered + +note[I15004]: IDE missing match arms + ┌─ tests/move_2024/ide_mode/missing_match_bool.move:4:22 + │ +4 │ match (true) { + │ ╭──────────────────────^ +5 │ │ true => 0 +6 │ │ } + │ ╰─────────^ Missing arms: 'false' + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_bool.move:10:16 + │ +10 │ match (true) { + │ ^^^^ Pattern '_' not covered + +note[I15004]: IDE missing match arms + ┌─ tests/move_2024/ide_mode/missing_match_bool.move:10:22 + │ +10 │ match (true) { + │ ╭──────────────────────^ +11 │ │ } + │ ╰─────────^ Missing arms: 'false' and 'true' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.exp deleted file mode 100644 index fbaa6d07f3135..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.exp +++ /dev/null @@ -1,36 +0,0 @@ -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:1:9 - │ -1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' - -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:1:31 - │ -1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:10:16 - │ -10 │ match (e) { - │ ^ Pattern '_' not covered - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:15:16 - │ -15 │ match (e) { - │ ^ Pattern 'E::One' not covered - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:21:16 - │ -21 │ match (e) { - │ ^ Pattern 'E::Three { x: _ }' not covered - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:28:16 - │ -28 │ match (e) { - │ ^ Pattern 'E::One' not covered - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.ide.exp deleted file mode 100644 index 5ad9bc654d155..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.ide.exp +++ /dev/null @@ -1,61 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:10:16 - │ -10 │ match (e) { - │ ^ Pattern '_' not covered - -note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:10:19 - │ -10 │ match (e) { - │ ╭───────────────────^ -11 │ │ } - │ ╰─────────^ Missing arms: '0x42::m::E::One', '0x42::m::E::Two(_)', and '0x42::m::E::Three { x }' - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:15:16 - │ -15 │ match (e) { - │ ^ Pattern 'E::One' not covered - -note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:15:19 - │ -15 │ match (e) { - │ ╭───────────────────^ -16 │ │ E::Two(n) => *n -17 │ │ } - │ ╰─────────^ Missing arms: '0x42::m::E::One' and '0x42::m::E::Three { x }' - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:21:16 - │ -21 │ match (e) { - │ ^ Pattern 'E::Three { x: _ }' not covered - -note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:21:19 - │ -21 │ match (e) { - │ ╭───────────────────^ -22 │ │ E::One => 0, -23 │ │ E::Two(n) => *n -24 │ │ } - │ ╰─────────^ Missing arms: '0x42::m::E::Three { x }' - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:28:16 - │ -28 │ match (e) { - │ ^ Pattern 'E::One' not covered - -note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_enum.move:28:19 - │ -28 │ match (e) { - │ ╭───────────────────^ -29 │ │ E::Three { x } => *x, -30 │ │ E::Two(n) => *n -31 │ │ } - │ ╰─────────^ Missing arms: '0x42::m::E::One' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.snap new file mode 100644 index 0000000000000..bf044666ed885 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.move +--- +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:1:31 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:10:16 + │ +10 │ match (e) { + │ ^ Pattern '_' not covered + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:15:16 + │ +15 │ match (e) { + │ ^ Pattern 'E::One' not covered + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:21:16 + │ +21 │ match (e) { + │ ^ Pattern 'E::Three { x: _ }' not covered + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:28:16 + │ +28 │ match (e) { + │ ^ Pattern 'E::One' not covered diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum@ide.snap new file mode 100644 index 0000000000000..64d9341db8a75 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum@ide.snap @@ -0,0 +1,68 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/missing_match_enum.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:10:16 + │ +10 │ match (e) { + │ ^ Pattern '_' not covered + +note[I15004]: IDE missing match arms + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:10:19 + │ +10 │ match (e) { + │ ╭───────────────────^ +11 │ │ } + │ ╰─────────^ Missing arms: '0x42::m::E::One', '0x42::m::E::Two(_)', and '0x42::m::E::Three { x }' + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:15:16 + │ +15 │ match (e) { + │ ^ Pattern 'E::One' not covered + +note[I15004]: IDE missing match arms + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:15:19 + │ +15 │ match (e) { + │ ╭───────────────────^ +16 │ │ E::Two(n) => *n +17 │ │ } + │ ╰─────────^ Missing arms: '0x42::m::E::One' and '0x42::m::E::Three { x }' + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:21:16 + │ +21 │ match (e) { + │ ^ Pattern 'E::Three { x: _ }' not covered + +note[I15004]: IDE missing match arms + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:21:19 + │ +21 │ match (e) { + │ ╭───────────────────^ +22 │ │ E::One => 0, +23 │ │ E::Two(n) => *n +24 │ │ } + │ ╰─────────^ Missing arms: '0x42::m::E::Three { x }' + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:28:16 + │ +28 │ match (e) { + │ ^ Pattern 'E::One' not covered + +note[I15004]: IDE missing match arms + ┌─ tests/move_2024/ide_mode/missing_match_enum.move:28:19 + │ +28 │ match (e) { + │ ╭───────────────────^ +29 │ │ E::Three { x } => *x, +30 │ │ E::Two(n) => *n +31 │ │ } + │ ╰─────────^ Missing arms: '0x42::m::E::One' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.exp deleted file mode 100644 index 40c28103c3dbb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.exp +++ /dev/null @@ -1,26 +0,0 @@ -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/missing_match_lit.move:1:9 - │ -1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' - -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/missing_match_lit.move:1:31 - │ -1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_lit.move:4:16 - │ -4 │ match (0) { - │ ^ Pattern '_0' not covered - │ - = When '_0' is not 1 - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_lit.move:10:16 - │ -10 │ match (0) { - │ ^ Pattern '_' not covered - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.ide.exp deleted file mode 100644 index cc5792f3addca..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.ide.exp +++ /dev/null @@ -1,31 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_lit.move:4:16 - │ -4 │ match (0) { - │ ^ Pattern '_0' not covered - │ - = When '_0' is not 1 - -note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_lit.move:4:19 - │ -4 │ match (0) { - │ ╭───────────────────^ -5 │ │ 1 => 0 -6 │ │ } - │ ╰─────────^ Missing arms: '_' - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_lit.move:10:16 - │ -10 │ match (0) { - │ ^ Pattern '_' not covered - -note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_lit.move:10:19 - │ -10 │ match (0) { - │ ╭───────────────────^ -11 │ │ } - │ ╰─────────^ Missing arms: '_' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.snap new file mode 100644 index 0000000000000..f6508375942df --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.snap @@ -0,0 +1,33 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.move +--- +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_lit.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_lit.move:1:31 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_lit.move:4:16 + │ +4 │ match (0) { + │ ^ Pattern '_0' not covered + │ + = When '_0' is not 1 + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_lit.move:10:16 + │ +10 │ match (0) { + │ ^ Pattern '_' not covered diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit@ide.snap new file mode 100644 index 0000000000000..3aa696b057cd1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit@ide.snap @@ -0,0 +1,38 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/missing_match_lit.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_lit.move:4:16 + │ +4 │ match (0) { + │ ^ Pattern '_0' not covered + │ + = When '_0' is not 1 + +note[I15004]: IDE missing match arms + ┌─ tests/move_2024/ide_mode/missing_match_lit.move:4:19 + │ +4 │ match (0) { + │ ╭───────────────────^ +5 │ │ 1 => 0 +6 │ │ } + │ ╰─────────^ Missing arms: '_' + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_lit.move:10:16 + │ +10 │ match (0) { + │ ^ Pattern '_' not covered + +note[I15004]: IDE missing match arms + ┌─ tests/move_2024/ide_mode/missing_match_lit.move:10:19 + │ +10 │ match (0) { + │ ╭───────────────────^ +11 │ │ } + │ ╰─────────^ Missing arms: '_' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.exp deleted file mode 100644 index 9b008476e2f78..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.exp +++ /dev/null @@ -1,30 +0,0 @@ -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/missing_match_struct.move:1:9 - │ -1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' - -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/missing_match_struct.move:1:31 - │ -1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_struct.move:7:16 - │ -7 │ match (s) { - │ ^ Pattern '_' not covered - -error[E04016]: too few arguments - ┌─ tests/move_2024/ide_mode/missing_match_struct.move:13:13 - │ -13 │ S { } => 0 - │ ^^^^^ Missing pattern for field 'x' in '0x42::m::S' - -error[E04016]: too few arguments - ┌─ tests/move_2024/ide_mode/missing_match_struct.move:13:13 - │ -13 │ S { } => 0 - │ ^^^^^ Missing pattern for field 'y' in '0x42::m::S' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.ide.exp deleted file mode 100644 index acb8d4b3d403e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.ide.exp +++ /dev/null @@ -1,26 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_struct.move:7:16 - │ -7 │ match (s) { - │ ^ Pattern '_' not covered - -note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_struct.move:7:19 - │ -7 │ match (s) { - │ ╭───────────────────^ -8 │ │ } - │ ╰─────────^ Missing arms: '0x42::m::S { x , y }' - -error[E04016]: too few arguments - ┌─ tests/move_2024/ide_mode/missing_match_struct.move:13:13 - │ -13 │ S { } => 0 - │ ^^^^^ Missing pattern for field 'x' in '0x42::m::S' - -error[E04016]: too few arguments - ┌─ tests/move_2024/ide_mode/missing_match_struct.move:13:13 - │ -13 │ S { } => 0 - │ ^^^^^ Missing pattern for field 'y' in '0x42::m::S' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.snap new file mode 100644 index 0000000000000..e2f14a445bad7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.move +--- +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_struct.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_struct.move:1:31 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_struct.move:7:16 + │ +7 │ match (s) { + │ ^ Pattern '_' not covered + +error[E04016]: too few arguments + ┌─ tests/move_2024/ide_mode/missing_match_struct.move:13:13 + │ +13 │ S { } => 0 + │ ^^^^^ Missing pattern for field 'x' in '0x42::m::S' + +error[E04016]: too few arguments + ┌─ tests/move_2024/ide_mode/missing_match_struct.move:13:13 + │ +13 │ S { } => 0 + │ ^^^^^ Missing pattern for field 'y' in '0x42::m::S' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct@ide.snap new file mode 100644 index 0000000000000..4110d48522fcf --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct@ide.snap @@ -0,0 +1,33 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/missing_match_struct.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_struct.move:7:16 + │ +7 │ match (s) { + │ ^ Pattern '_' not covered + +note[I15004]: IDE missing match arms + ┌─ tests/move_2024/ide_mode/missing_match_struct.move:7:19 + │ +7 │ match (s) { + │ ╭───────────────────^ +8 │ │ } + │ ╰─────────^ Missing arms: '0x42::m::S { x , y }' + +error[E04016]: too few arguments + ┌─ tests/move_2024/ide_mode/missing_match_struct.move:13:13 + │ +13 │ S { } => 0 + │ ^^^^^ Missing pattern for field 'x' in '0x42::m::S' + +error[E04016]: too few arguments + ┌─ tests/move_2024/ide_mode/missing_match_struct.move:13:13 + │ +13 │ S { } => 0 + │ ^^^^^ Missing pattern for field 'y' in '0x42::m::S' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.exp deleted file mode 100644 index fd4aee181cc54..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.exp +++ /dev/null @@ -1,42 +0,0 @@ -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:1:9 - │ -1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' - -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:1:31 - │ -1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' - -error[E03009]: unbound variable - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:4:16 - │ -4 │ match (e) { - │ ^ Unbound variable 'e' - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:4:16 - │ -4 │ match (e) { - │ ^ Pattern '_' not covered - -error[E03009]: unbound variable - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:9:16 - │ -9 │ match (e) { - │ ^ Unbound variable 'e' - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:10:13 - │ -10 │ E::Two(n) => n - │ ^ Could not resolve the name 'E' - -error[E03009]: unbound variable - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:10:26 - │ -10 │ E::Two(n) => n - │ ^ Unbound variable 'n' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.ide.exp deleted file mode 100644 index d6b885a93845e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.ide.exp +++ /dev/null @@ -1,47 +0,0 @@ -error[E03009]: unbound variable - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:4:16 - │ -4 │ match (e) { - │ ^ Unbound variable 'e' - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:4:16 - │ -4 │ match (e) { - │ ^ Pattern '_' not covered - -note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:4:19 - │ -4 │ match (e) { - │ ╭───────────────────^ -5 │ │ } - │ ╰─────────^ Missing arms: '_' - -error[E03009]: unbound variable - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:9:16 - │ -9 │ match (e) { - │ ^ Unbound variable 'e' - -note[I15004]: IDE missing match arms - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:9:19 - │ - 9 │ match (e) { - │ ╭───────────────────^ -10 │ │ E::Two(n) => n -11 │ │ } - │ ╰─────────^ Missing arms: '_' - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:10:13 - │ -10 │ E::Two(n) => n - │ ^ Could not resolve the name 'E' - -error[E03009]: unbound variable - ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:10:26 - │ -10 │ E::Two(n) => n - │ ^ Unbound variable 'n' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.snap new file mode 100644 index 0000000000000..5a1d509c2b203 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.snap @@ -0,0 +1,49 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.move +--- +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:1:31 + │ +1 │ #[allow(ide_path_autocomplete,ide_dot_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_dot_autocomplete' + +error[E03009]: unbound variable + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:4:16 + │ +4 │ match (e) { + │ ^ Unbound variable 'e' + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:4:16 + │ +4 │ match (e) { + │ ^ Pattern '_' not covered + +error[E03009]: unbound variable + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:9:16 + │ +9 │ match (e) { + │ ^ Unbound variable 'e' + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:10:13 + │ +10 │ E::Two(n) => n + │ ^ Could not resolve the name 'E' + +error[E03009]: unbound variable + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:10:26 + │ +10 │ E::Two(n) => n + │ ^ Unbound variable 'n' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped@ide.snap new file mode 100644 index 0000000000000..1f88cb82f04d7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped@ide.snap @@ -0,0 +1,54 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/missing_match_untyped.move +--- +error[E03009]: unbound variable + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:4:16 + │ +4 │ match (e) { + │ ^ Unbound variable 'e' + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:4:16 + │ +4 │ match (e) { + │ ^ Pattern '_' not covered + +note[I15004]: IDE missing match arms + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:4:19 + │ +4 │ match (e) { + │ ╭───────────────────^ +5 │ │ } + │ ╰─────────^ Missing arms: '_' + +error[E03009]: unbound variable + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:9:16 + │ +9 │ match (e) { + │ ^ Unbound variable 'e' + +note[I15004]: IDE missing match arms + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:9:19 + │ + 9 │ match (e) { + │ ╭───────────────────^ +10 │ │ E::Two(n) => n +11 │ │ } + │ ╰─────────^ Missing arms: '_' + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:10:13 + │ +10 │ E::Two(n) => n + │ ^ Could not resolve the name 'E' + +error[E03009]: unbound variable + ┌─ tests/move_2024/ide_mode/missing_match_untyped.move:10:26 + │ +10 │ E::Two(n) => n + │ ^ Unbound variable 'n' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.exp deleted file mode 100644 index 575a7d1222305..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.exp +++ /dev/null @@ -1,68 +0,0 @@ -warning[W09001]: unused alias - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:7:16 - │ -7 │ use a::m::{Self, S, A}; - │ ^^^^ Unused 'use' of alias 'm'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:7:22 - │ -7 │ use a::m::{Self, S, A}; - │ ^ Unused 'use' of alias 'S'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:7:25 - │ -7 │ use a::m::{Self, S, A}; - │ ^ Unused 'use' of alias 'A'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:9:18 - │ -9 │ public fun p(a: - │ ^ Unused parameter 'a'. Consider removing or prefixing with an underscore: '_a' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:11:5 - │ - 9 │ public fun p(a: - │ - To match this '(' -10 │ -11 │ public fun q(): - │ ^ Expected ')' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:11:5 - │ -11 │ public fun q(): - │ ^^^^^^ - │ │ - │ Unexpected 'public' - │ Expected a type name - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:12:1 - │ -12 │ } - │ ^ - │ │ - │ Unexpected '}' - │ Expected a type name - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:14:1 - │ -14 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected '{' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.ide.exp deleted file mode 100644 index 2d87fe58ca754..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.ide.exp +++ /dev/null @@ -1,142 +0,0 @@ -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:1:1 - │ -1 │ ╭ module a::m { -2 │ │ public struct S { x: T } -3 │ │ public struct A {} -4 │ │ } - │ ╰─^ Possible in-scope names - │ - = members: 'A -> a::m::A', 'Option -> std::option::Option', or 'S -> a::m::S' - = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -warning[W09009]: unused struct field - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:2:26 - │ -2 │ public struct S { x: T } - │ ^ The 'x' field of the 'S' type is unused - │ - = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:2:29 - │ -2 │ public struct S { x: T } - │ ^ Possible in-scope names - │ - = members: 'A -> a::m::A', 'Option -> std::option::Option', or 'S -> a::m::S' - = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: 'T' - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:6:1 - │ - 6 │ ╭ module a::test { - 7 │ │ use a::m::{Self, S, A}; - 8 │ │ - 9 │ │ public fun p(a: -10 │ │ -11 │ │ public fun q(): -12 │ │ } - │ ╰─^ Possible in-scope names - │ - = members: 'A -> a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' - = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -warning[W09001]: unused alias - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:7:16 - │ -7 │ use a::m::{Self, S, A}; - │ ^^^^ Unused 'use' of alias 'm'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:7:22 - │ -7 │ use a::m::{Self, S, A}; - │ ^ Unused 'use' of alias 'S'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:7:25 - │ -7 │ use a::m::{Self, S, A}; - │ ^ Unused 'use' of alias 'A'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:9:18 - │ -9 │ public fun p(a: - │ ^ Unused parameter 'a'. Consider removing or prefixing with an underscore: '_a' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:11:5 - │ - 9 │ │ public fun p(a: - │ ╰───────────────────^ Possible in-scope names -10 │ -11 │ ╭ public fun q(): - │ - = members: 'A -> a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' - = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:11:5 - │ - 9 │ public fun p(a: - │ - To match this '(' -10 │ -11 │ public fun q(): - │ ^ Expected ')' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:11:5 - │ -11 │ public fun q(): - │ ^^^^^^ - │ │ - │ Unexpected 'public' - │ Expected a type name - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:11:16 - │ -11 │ public fun q(): - │ ^ Possible in-scope names - │ - = members: 'A -> a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' - = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:12:1 - │ -12 │ } - │ ^ - │ │ - │ Unexpected '}' - │ Expected a type name - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:14:1 - │ -14 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected '{' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.snap new file mode 100644 index 0000000000000..5831dc19e6dcb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.snap @@ -0,0 +1,75 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.move +--- +warning[W09001]: unused alias + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:7:16 + │ +7 │ use a::m::{Self, S, A}; + │ ^^^^ Unused 'use' of alias 'm'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:7:22 + │ +7 │ use a::m::{Self, S, A}; + │ ^ Unused 'use' of alias 'S'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:7:25 + │ +7 │ use a::m::{Self, S, A}; + │ ^ Unused 'use' of alias 'A'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:9:18 + │ +9 │ public fun p(a: + │ ^ Unused parameter 'a'. Consider removing or prefixing with an underscore: '_a' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:11:5 + │ + 9 │ public fun p(a: + │ - To match this '(' +10 │ +11 │ public fun q(): + │ ^ Expected ')' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:11:5 + │ +11 │ public fun q(): + │ ^^^^^^ + │ │ + │ Unexpected 'public' + │ Expected a type name + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:12:1 + │ +12 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected a type name + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:14:1 + │ +14 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected '{' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions@ide.snap new file mode 100644 index 0000000000000..a6418aea337ec --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions@ide.snap @@ -0,0 +1,149 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/missing_type_suggestions.move +--- +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:1:1 + │ +1 │ ╭ module a::m { +2 │ │ public struct S { x: T } +3 │ │ public struct A {} +4 │ │ } + │ ╰─^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'Option -> std::option::Option', or 'S -> a::m::S' + = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +warning[W09009]: unused struct field + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:2:26 + │ +2 │ public struct S { x: T } + │ ^ The 'x' field of the 'S' type is unused + │ + = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:2:29 + │ +2 │ public struct S { x: T } + │ ^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'Option -> std::option::Option', or 'S -> a::m::S' + = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:6:1 + │ + 6 │ ╭ module a::test { + 7 │ │ use a::m::{Self, S, A}; + 8 │ │ + 9 │ │ public fun p(a: +10 │ │ +11 │ │ public fun q(): +12 │ │ } + │ ╰─^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' + = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +warning[W09001]: unused alias + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:7:16 + │ +7 │ use a::m::{Self, S, A}; + │ ^^^^ Unused 'use' of alias 'm'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:7:22 + │ +7 │ use a::m::{Self, S, A}; + │ ^ Unused 'use' of alias 'S'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:7:25 + │ +7 │ use a::m::{Self, S, A}; + │ ^ Unused 'use' of alias 'A'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:9:18 + │ +9 │ public fun p(a: + │ ^ Unused parameter 'a'. Consider removing or prefixing with an underscore: '_a' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:11:5 + │ + 9 │ │ public fun p(a: + │ ╰───────────────────^ Possible in-scope names +10 │ +11 │ ╭ public fun q(): + │ + = members: 'A -> a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' + = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:11:5 + │ + 9 │ public fun p(a: + │ - To match this '(' +10 │ +11 │ public fun q(): + │ ^ Expected ')' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:11:5 + │ +11 │ public fun q(): + │ ^^^^^^ + │ │ + │ Unexpected 'public' + │ Expected a type name + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:11:16 + │ +11 │ public fun q(): + │ ^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' + = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:12:1 + │ +12 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected a type name + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/missing_type_suggestions.move:14:1 + │ +14 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected '{' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.exp deleted file mode 100644 index 069200c09440f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.exp +++ /dev/null @@ -1,24 +0,0 @@ -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:1:9 - │ -1 │ #[allow(ide_path_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:14:24 - │ -14 │ let _tmp1 = _s.; - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:15:26 - │ -15 │ let _tmp2 = _s.a.; - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.ide.exp deleted file mode 100644 index 53e71a6b31f48..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.ide.exp +++ /dev/null @@ -1,42 +0,0 @@ -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:14:23 - │ -14 │ let _tmp1 = _s.; - │ ^ Possible dot names: 'a' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:14:24 - │ -14 │ let _tmp1 = _s.; - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:15:23 - │ -15 │ let _tmp2 = _s.a.; - │ ^ Possible dot names: 'a' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:15:24 - │ -15 │ let _tmp2 = _s.a.; - │ ^ Possible dot names: 'a' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:15:25 - │ -15 │ let _tmp2 = _s.a.; - │ ^ Possible dot names: 'x' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:15:26 - │ -15 │ let _tmp2 = _s.a.; - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.snap new file mode 100644 index 0000000000000..9d2967897a6a6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.move +--- +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:14:24 + │ +14 │ let _tmp1 = _s.; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:15:26 + │ +15 │ let _tmp2 = _s.a.; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete@ide.snap new file mode 100644 index 0000000000000..e660cae96174a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete@ide.snap @@ -0,0 +1,49 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/named_struct_autocomplete.move +--- +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:14:23 + │ +14 │ let _tmp1 = _s.; + │ ^ Possible dot names: 'a' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:14:24 + │ +14 │ let _tmp1 = _s.; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:15:23 + │ +15 │ let _tmp2 = _s.a.; + │ ^ Possible dot names: 'a' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:15:24 + │ +15 │ let _tmp2 = _s.a.; + │ ^ Possible dot names: 'a' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:15:25 + │ +15 │ let _tmp2 = _s.a.; + │ ^ Possible dot names: 'x' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/named_struct_autocomplete.move:15:26 + │ +15 │ let _tmp2 = _s.a.; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.exp deleted file mode 100644 index 80ce40f3f9785..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.exp +++ /dev/null @@ -1,12 +0,0 @@ -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/named_struct_middle_autocomplete.move:1:9 - │ -1 │ #[allow(ide_path_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' - -error[E03010]: unbound field - ┌─ tests/move_2024/ide_mode/named_struct_middle_autocomplete.move:14:21 - │ -14 │ let _tmp2 = _s.b.x; - │ ^^^^ Unbound field 'b' in 'a::m::B' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.ide.exp deleted file mode 100644 index 04484c1f18103..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.ide.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E03010]: unbound field - ┌─ tests/move_2024/ide_mode/named_struct_middle_autocomplete.move:14:21 - │ -14 │ let _tmp2 = _s.b.x; - │ ^^^^ Unbound field 'b' in 'a::m::B' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/named_struct_middle_autocomplete.move:14:23 - │ -14 │ let _tmp2 = _s.b.x; - │ ^ Possible dot names: 'a' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/named_struct_middle_autocomplete.move:14:24 - │ -14 │ let _tmp2 = _s.b.x; - │ ^ Possible dot names: 'a' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.snap new file mode 100644 index 0000000000000..06f302ca19cb7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.move +--- +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/named_struct_middle_autocomplete.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +error[E03010]: unbound field + ┌─ tests/move_2024/ide_mode/named_struct_middle_autocomplete.move:14:21 + │ +14 │ let _tmp2 = _s.b.x; + │ ^^^^ Unbound field 'b' in 'a::m::B' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete@ide.snap new file mode 100644 index 0000000000000..60a093ad76ce7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete@ide.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/named_struct_middle_autocomplete.move +--- +error[E03010]: unbound field + ┌─ tests/move_2024/ide_mode/named_struct_middle_autocomplete.move:14:21 + │ +14 │ let _tmp2 = _s.b.x; + │ ^^^^ Unbound field 'b' in 'a::m::B' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/named_struct_middle_autocomplete.move:14:23 + │ +14 │ let _tmp2 = _s.b.x; + │ ^ Possible dot names: 'a' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/named_struct_middle_autocomplete.move:14:24 + │ +14 │ let _tmp2 = _s.b.x; + │ ^ Possible dot names: 'a' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/on_dot_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/on_dot_autocomplete.exp deleted file mode 100644 index d7a3330d71221..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/on_dot_autocomplete.exp +++ /dev/null @@ -1,15 +0,0 @@ -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:1:9 - │ -1 │ #[allow(ide_path_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' - -error[E04023]: invalid method call - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:9 - │ -23 │ c.b.a.b(); // unresolved method name - │ ^^^^^^^^^ - │ │ │ - │ │ No local 'use fun' alias was found for 'a::m::A.b', and no function 'b' was found in the defining module 'a::m' - │ Invalid method call. No known method 'b' on type 'a::m::A' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/on_dot_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/on_dot_autocomplete.ide.exp deleted file mode 100644 index 928a987e3a999..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/on_dot_autocomplete.ide.exp +++ /dev/null @@ -1,105 +0,0 @@ -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:21:10 - │ -21 │ c.b.a; // two dots that should trigger auto-completion - │ ^ Possible dot names: 'b' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:21:11 - │ -21 │ c.b.a; // two dots that should trigger auto-completion - │ ^ Possible dot names: 'b' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:21:12 - │ -21 │ c.b.a; // two dots that should trigger auto-completion - │ ^ Possible dot names: 'a' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:21:13 - │ -21 │ c.b.a; // two dots that should trigger auto-completion - │ ^ Possible dot names: 'a' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:22:10 - │ -22 │ c.b.a.bar(); // resolved method name - │ ^ Possible dot names: 'b' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:22:11 - │ -22 │ c.b.a.bar(); // resolved method name - │ ^ Possible dot names: 'b' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:22:12 - │ -22 │ c.b.a.bar(); // resolved method name - │ ^ Possible dot names: 'a' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:22:13 - │ -22 │ c.b.a.bar(); // resolved method name - │ ^ Possible dot names: 'a' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:22:14 - │ -22 │ c.b.a.bar(); // resolved method name - │ ^ Possible dot names: 'a::m::bar' or 'x' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:22:15 - │ -22 │ c.b.a.bar(); // resolved method name - │ ^^^ Possible dot names: 'a::m::bar' or 'x' - -error[E04023]: invalid method call - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:9 - │ -23 │ c.b.a.b(); // unresolved method name - │ ^^^^^^^^^ - │ │ │ - │ │ No local 'use fun' alias was found for 'a::m::A.b', and no function 'b' was found in the defining module 'a::m' - │ Invalid method call. No known method 'b' on type 'a::m::A' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:10 - │ -23 │ c.b.a.b(); // unresolved method name - │ ^ Possible dot names: 'b' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:11 - │ -23 │ c.b.a.b(); // unresolved method name - │ ^ Possible dot names: 'b' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:12 - │ -23 │ c.b.a.b(); // unresolved method name - │ ^ Possible dot names: 'a' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:13 - │ -23 │ c.b.a.b(); // unresolved method name - │ ^ Possible dot names: 'a' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:14 - │ -23 │ c.b.a.b(); // unresolved method name - │ ^ Possible dot names: 'a::m::bar' or 'x' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:15 - │ -23 │ c.b.a.b(); // unresolved method name - │ ^ Possible dot names: 'a::m::bar' or 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/on_dot_autocomplete.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/on_dot_autocomplete.snap new file mode 100644 index 0000000000000..ac261bbdc49d4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/on_dot_autocomplete.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/on_dot_autocomplete.move +--- +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' + +error[E04023]: invalid method call + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:9 + │ +23 │ c.b.a.b(); // unresolved method name + │ ^^^^^^^^^ + │ │ │ + │ │ No local 'use fun' alias was found for 'a::m::A.b', and no function 'b' was found in the defining module 'a::m' + │ Invalid method call. No known method 'b' on type 'a::m::A' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/on_dot_autocomplete@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/on_dot_autocomplete@ide.snap new file mode 100644 index 0000000000000..0c9a26c023567 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/on_dot_autocomplete@ide.snap @@ -0,0 +1,112 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/on_dot_autocomplete.move +--- +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:21:10 + │ +21 │ c.b.a; // two dots that should trigger auto-completion + │ ^ Possible dot names: 'b' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:21:11 + │ +21 │ c.b.a; // two dots that should trigger auto-completion + │ ^ Possible dot names: 'b' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:21:12 + │ +21 │ c.b.a; // two dots that should trigger auto-completion + │ ^ Possible dot names: 'a' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:21:13 + │ +21 │ c.b.a; // two dots that should trigger auto-completion + │ ^ Possible dot names: 'a' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:22:10 + │ +22 │ c.b.a.bar(); // resolved method name + │ ^ Possible dot names: 'b' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:22:11 + │ +22 │ c.b.a.bar(); // resolved method name + │ ^ Possible dot names: 'b' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:22:12 + │ +22 │ c.b.a.bar(); // resolved method name + │ ^ Possible dot names: 'a' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:22:13 + │ +22 │ c.b.a.bar(); // resolved method name + │ ^ Possible dot names: 'a' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:22:14 + │ +22 │ c.b.a.bar(); // resolved method name + │ ^ Possible dot names: 'a::m::bar' or 'x' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:22:15 + │ +22 │ c.b.a.bar(); // resolved method name + │ ^^^ Possible dot names: 'a::m::bar' or 'x' + +error[E04023]: invalid method call + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:9 + │ +23 │ c.b.a.b(); // unresolved method name + │ ^^^^^^^^^ + │ │ │ + │ │ No local 'use fun' alias was found for 'a::m::A.b', and no function 'b' was found in the defining module 'a::m' + │ Invalid method call. No known method 'b' on type 'a::m::A' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:10 + │ +23 │ c.b.a.b(); // unresolved method name + │ ^ Possible dot names: 'b' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:11 + │ +23 │ c.b.a.b(); // unresolved method name + │ ^ Possible dot names: 'b' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:12 + │ +23 │ c.b.a.b(); // unresolved method name + │ ^ Possible dot names: 'a' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:13 + │ +23 │ c.b.a.b(); // unresolved method name + │ ^ Possible dot names: 'a' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:14 + │ +23 │ c.b.a.b(); // unresolved method name + │ ^ Possible dot names: 'a::m::bar' or 'x' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:15 + │ +23 │ c.b.a.b(); // unresolved method name + │ ^ Possible dot names: 'a::m::bar' or 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/partial_type_suggestions.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/partial_type_suggestions.exp deleted file mode 100644 index e11b3a84f1d49..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/partial_type_suggestions.exp +++ /dev/null @@ -1,66 +0,0 @@ -warning[W09001]: unused alias - ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:7:16 - │ -7 │ use a::m::{Self, S, A}; - │ ^^^^ Unused 'use' of alias 'm'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03008]: too few type arguments - ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:9:28 - │ -9 │ public fun p(): vector' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:11:5 - │ -11 │ public fun q(x: S' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:12:1 - │ -12 │ } - │ ^ - │ │ - │ Unexpected '}' - │ Expected ',' or ')' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:14:1 - │ -11 │ public fun q(x: S { x: T } -3 │ │ public struct A {} -4 │ │ } - │ ╰─^ Possible in-scope names - │ - = members: 'A -> a::m::A', 'Option -> std::option::Option', or 'S -> a::m::S' - = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:2:29 - │ -2 │ public struct S { x: T } - │ ^ Possible in-scope names - │ - = members: 'A -> a::m::A', 'Option -> std::option::Option', or 'S -> a::m::S' - = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: 'T' - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:6:1 - │ - 6 │ ╭ module a::test { - 7 │ │ use a::m::{Self, S, A}; - 8 │ │ - 9 │ │ public fun p(): vector a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' - = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -warning[W09001]: unused alias - ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:7:16 - │ -7 │ use a::m::{Self, S, A}; - │ ^^^^ Unused 'use' of alias 'm'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:9:28 - │ -9 │ public fun p(): vector a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' - = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -error[E03008]: too few type arguments - ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:9:28 - │ -9 │ public fun p(): vector' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:11:5 - │ -11 │ public fun q(x: S a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' - = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:11:23 - │ -11 │ public fun q(x: S a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' - = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:12:1 - │ -11 │ public fun q(x: S' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:12:1 - │ -12 │ } - │ ^ - │ │ - │ Unexpected '}' - │ Expected ',' or ')' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:14:1 - │ -11 │ public fun q(x: S' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:11:5 + │ +11 │ public fun q(x: S' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:12:1 + │ +12 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected ',' or ')' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:14:1 + │ +11 │ public fun q(x: S { x: T } +3 │ │ public struct A {} +4 │ │ } + │ ╰─^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'Option -> std::option::Option', or 'S -> a::m::S' + = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:2:29 + │ +2 │ public struct S { x: T } + │ ^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'Option -> std::option::Option', or 'S -> a::m::S' + = modules: 'Self -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:6:1 + │ + 6 │ ╭ module a::test { + 7 │ │ use a::m::{Self, S, A}; + 8 │ │ + 9 │ │ public fun p(): vector a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' + = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +warning[W09001]: unused alias + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:7:16 + │ +7 │ use a::m::{Self, S, A}; + │ ^^^^ Unused 'use' of alias 'm'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:9:28 + │ +9 │ public fun p(): vector a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' + = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +error[E03008]: too few type arguments + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:9:28 + │ +9 │ public fun p(): vector' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:11:5 + │ +11 │ public fun q(x: S a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' + = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:11:23 + │ +11 │ public fun q(x: S a::m::A', 'Option -> std::option::Option', 'S -> a::m::S', 'p -> a::test::p', or 'q -> a::test::q' + = modules: 'Self -> a::test', 'm -> a::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:12:1 + │ +11 │ public fun q(x: S' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:12:1 + │ +12 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected ',' or ')' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/partial_type_suggestions.move:14:1 + │ +11 │ public fun q(x: S(action: &mut Action): &mut T { - │ - Expected a struct type in the current module but got: 'T' -6 │ &mut action.inner.bar - │ ^^^^^^^^^^^^^^^^ Unbound field 'bar' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete.ide.exp deleted file mode 100644 index cfa978bf4437c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete.ide.exp +++ /dev/null @@ -1,92 +0,0 @@ -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:1:1 - │ -1 │ ╭ module 0x42::m; -2 │ │ -3 │ │ public struct Action { inner: T } -4 │ │ -5 │ │ public fun make_action_ref(action: &mut Action): &mut T { -6 │ │ &mut action.inner.bar -7 │ │ } - │ ╰─^ Possible in-scope names - │ - = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' - = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:3:34 - │ -3 │ public struct Action { inner: T } - │ ^ Possible in-scope names - │ - = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' - = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: 'T' - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:5:44 - │ -5 │ public fun make_action_ref(action: &mut Action): &mut T { - │ ^^^^^^ Possible in-scope names - │ - = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' - = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: 'T' - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:5:51 - │ -5 │ public fun make_action_ref(action: &mut Action): &mut T { - │ ^ Possible in-scope names - │ - = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' - = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: 'T' - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:5:61 - │ -5 │ public fun make_action_ref(action: &mut Action): &mut T { - │ ^ Possible in-scope names - │ - = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' - = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: 'T' - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:6:10 - │ -6 │ &mut action.inner.bar - │ ^^^^^^ Possible in-scope names - │ - = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' - = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: 'T' - -error[E04009]: expected specific type - ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:6:10 - │ -5 │ public fun make_action_ref(action: &mut Action): &mut T { - │ - Expected a struct type in the current module but got: 'T' -6 │ &mut action.inner.bar - │ ^^^^^^^^^^^^^^^^ Unbound field 'bar' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:6:16 - │ -6 │ &mut action.inner.bar - │ ^ Possible dot names: '0x42::m::make_action_ref' or 'inner' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:6:17 - │ -6 │ &mut action.inner.bar - │ ^^^^^ Possible dot names: '0x42::m::make_action_ref' or 'inner' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete.snap new file mode 100644 index 0000000000000..57d8c8b75cc53 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete.move +--- +error[E04009]: expected specific type + ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:6:10 + │ +5 │ public fun make_action_ref(action: &mut Action): &mut T { + │ - Expected a struct type in the current module but got: 'T' +6 │ &mut action.inner.bar + │ ^^^^^^^^^^^^^^^^ Unbound field 'bar' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete@ide.snap new file mode 100644 index 0000000000000..538b63d4761e6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete@ide.snap @@ -0,0 +1,99 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/type_param_autocomplete.move +--- +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:1:1 + │ +1 │ ╭ module 0x42::m; +2 │ │ +3 │ │ public struct Action { inner: T } +4 │ │ +5 │ │ public fun make_action_ref(action: &mut Action): &mut T { +6 │ │ &mut action.inner.bar +7 │ │ } + │ ╰─^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:3:34 + │ +3 │ public struct Action { inner: T } + │ ^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:5:44 + │ +5 │ public fun make_action_ref(action: &mut Action): &mut T { + │ ^^^^^^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:5:51 + │ +5 │ public fun make_action_ref(action: &mut Action): &mut T { + │ ^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:5:61 + │ +5 │ public fun make_action_ref(action: &mut Action): &mut T { + │ ^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:6:10 + │ +6 │ &mut action.inner.bar + │ ^^^^^^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' + +error[E04009]: expected specific type + ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:6:10 + │ +5 │ public fun make_action_ref(action: &mut Action): &mut T { + │ - Expected a struct type in the current module but got: 'T' +6 │ &mut action.inner.bar + │ ^^^^^^^^^^^^^^^^ Unbound field 'bar' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:6:16 + │ +6 │ &mut action.inner.bar + │ ^ Possible dot names: '0x42::m::make_action_ref' or 'inner' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/type_param_autocomplete.move:6:17 + │ +6 │ &mut action.inner.bar + │ ^^^^^ Possible dot names: '0x42::m::make_action_ref' or 'inner' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete.ide.exp deleted file mode 100644 index ed441c4c9c0f3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete.ide.exp +++ /dev/null @@ -1,84 +0,0 @@ -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:1:1 - │ -1 │ ╭ module 0x42::m; -2 │ │ -3 │ │ public struct Action { inner: T } -4 │ │ -5 │ │ public fun make_action_ref(action: &mut Action): &mut T { -6 │ │ &mut action.inner -7 │ │ } - │ ╰─^ Possible in-scope names - │ - = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' - = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:3:34 - │ -3 │ public struct Action { inner: T } - │ ^ Possible in-scope names - │ - = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' - = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: 'T' - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:5:44 - │ -5 │ public fun make_action_ref(action: &mut Action): &mut T { - │ ^^^^^^ Possible in-scope names - │ - = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' - = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: 'T' - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:5:51 - │ -5 │ public fun make_action_ref(action: &mut Action): &mut T { - │ ^ Possible in-scope names - │ - = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' - = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: 'T' - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:5:61 - │ -5 │ public fun make_action_ref(action: &mut Action): &mut T { - │ ^ Possible in-scope names - │ - = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' - = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: 'T' - -note[I15006]: IDE path autocomplete - ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:6:10 - │ -6 │ &mut action.inner - │ ^^^^^^ Possible in-scope names - │ - = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' - = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: 'T' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:6:16 - │ -6 │ &mut action.inner - │ ^ Possible dot names: '0x42::m::make_action_ref' or 'inner' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:6:17 - │ -6 │ &mut action.inner - │ ^^^^^ Possible dot names: '0x42::m::make_action_ref' or 'inner' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete.snap new file mode 100644 index 0000000000000..f2e43357107bb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete@ide.snap new file mode 100644 index 0000000000000..03fc695ceaf77 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete@ide.snap @@ -0,0 +1,91 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/type_param_no_autocomplete.move +--- +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:1:1 + │ +1 │ ╭ module 0x42::m; +2 │ │ +3 │ │ public struct Action { inner: T } +4 │ │ +5 │ │ public fun make_action_ref(action: &mut Action): &mut T { +6 │ │ &mut action.inner +7 │ │ } + │ ╰─^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:3:34 + │ +3 │ public struct Action { inner: T } + │ ^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:5:44 + │ +5 │ public fun make_action_ref(action: &mut Action): &mut T { + │ ^^^^^^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:5:51 + │ +5 │ public fun make_action_ref(action: &mut Action): &mut T { + │ ^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:5:61 + │ +5 │ public fun make_action_ref(action: &mut Action): &mut T { + │ ^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' + +note[I15006]: IDE path autocomplete + ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:6:10 + │ +6 │ &mut action.inner + │ ^^^^^^ Possible in-scope names + │ + = members: 'Action -> 0x42::m::Action', 'Option -> std::option::Option', or 'make_action_ref -> 0x42::m::make_action_ref' + = modules: 'Self -> 0x42::m', 'option -> std::option', or 'vector -> std::vector' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: 'T' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:6:16 + │ +6 │ &mut action.inner + │ ^ Possible dot names: '0x42::m::make_action_ref' or 'inner' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/type_param_no_autocomplete.move:6:17 + │ +6 │ &mut action.inner + │ ^^^^^ Possible dot names: '0x42::m::make_action_ref' or 'inner' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.exp deleted file mode 100644 index 70061d1a0a87d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.exp +++ /dev/null @@ -1,6 +0,0 @@ -warning[W10007]: issue with attribute value - ┌─ tests/move_2024/ide_mode/use_fun_autocomplete.move:1:9 - │ -1 │ #[allow(ide_path_autocomplete)] - │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.ide.exp deleted file mode 100644 index 7fa6e5ced59a7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.ide.exp +++ /dev/null @@ -1,24 +0,0 @@ -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/use_fun_autocomplete.move:12:10 - │ -12 │ s.bak(); // autocompletion to `bak` and `foo` - │ ^ Possible dot names: '0x42::m1::bak', '0x42::m1::foo', '0x42::m1::test1', or '0x42::m1::test2' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/use_fun_autocomplete.move:12:11 - │ -12 │ s.bak(); // autocompletion to `bak` and `foo` - │ ^^^ Possible dot names: '0x42::m1::bak', '0x42::m1::foo', '0x42::m1::test1', or '0x42::m1::test2' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/use_fun_autocomplete.move:17:10 - │ -17 │ s.bar(); // auto-completion to only one (shadowed) `bar` - │ ^ Possible dot names: '0x42::m1::bar', '0x42::m1::test1', or '0x42::m1::test2' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_2024/ide_mode/use_fun_autocomplete.move:17:11 - │ -17 │ s.bar(); // auto-completion to only one (shadowed) `bar` - │ ^^^ Possible dot names: '0x42::m1::bar', '0x42::m1::test1', or '0x42::m1::test2' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.snap new file mode 100644 index 0000000000000..2cfb633c8e6f1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.move +--- +warning[W10007]: issue with attribute value + ┌─ tests/move_2024/ide_mode/use_fun_autocomplete.move:1:9 + │ +1 │ #[allow(ide_path_autocomplete)] + │ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete@ide.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete@ide.snap new file mode 100644 index 0000000000000..e0bf5fa39a3d7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete@ide.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/use_fun_autocomplete.move +--- +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/use_fun_autocomplete.move:12:10 + │ +12 │ s.bak(); // autocompletion to `bak` and `foo` + │ ^ Possible dot names: '0x42::m1::bak', '0x42::m1::foo', '0x42::m1::test1', or '0x42::m1::test2' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/use_fun_autocomplete.move:12:11 + │ +12 │ s.bak(); // autocompletion to `bak` and `foo` + │ ^^^ Possible dot names: '0x42::m1::bak', '0x42::m1::foo', '0x42::m1::test1', or '0x42::m1::test2' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/use_fun_autocomplete.move:17:10 + │ +17 │ s.bar(); // auto-completion to only one (shadowed) `bar` + │ ^ Possible dot names: '0x42::m1::bar', '0x42::m1::test1', or '0x42::m1::test2' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_2024/ide_mode/use_fun_autocomplete.move:17:11 + │ +17 │ s.bar(); // auto-completion to only one (shadowed) `bar` + │ ^^^ Possible dot names: '0x42::m1::bar', '0x42::m1::test1', or '0x42::m1::test2' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_incomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_incomplete.exp deleted file mode 100644 index 0e34cb2cfccff..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_incomplete.exp +++ /dev/null @@ -1,77 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/use_incomplete.move:5:9 - │ -5 │ let _tmp = 42; // reset parser to see if the next line compiles - │ ^^^ - │ │ - │ Unexpected 'let' - │ Expected an identifier - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/use_incomplete.move:11:9 - │ -11 │ let _tmp = 42; // reset parser to see if the next line compiles - │ ^^^ - │ │ - │ Unexpected 'let' - │ Expected ',' or '}' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/use_incomplete.move:11:22 - │ -10 │ use a::m2::{foo - │ - To match this '{' -11 │ let _tmp = 42; // reset parser to see if the next line compiles - │ ^ Expected '}' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/use_incomplete.move:17:9 - │ -17 │ let _tmp = 42; // reset parser to see if the next lines compile - │ ^^^ - │ │ - │ Unexpected 'let' - │ Expected ',' or '}' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/use_incomplete.move:17:22 - │ -16 │ use a::m2::{foo, bar - │ - To match this '{' -17 │ let _tmp = 42; // reset parser to see if the next lines compile - │ ^ Expected '}' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/use_incomplete.move:24:9 - │ -24 │ let _tmp = 42; // reset parser to see if the next lines compile - │ ^^^ - │ │ - │ Unexpected 'let' - │ Expected ',' or '}' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/use_incomplete.move:24:22 - │ -23 │ use a::{m2::{foo, bar - │ - To match this '{' -24 │ let _tmp = 42; // reset parser to see if the next lines compile - │ ^ Expected '}' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/use_incomplete.move:32:9 - │ -32 │ let _tmp = 42; // reset parser to see if the next lines compile - │ ^^^ - │ │ - │ Unexpected 'let' - │ Expected ',' or '}' - -error[E01002]: unexpected token - ┌─ tests/move_2024/ide_mode/use_incomplete.move:32:22 - │ -31 │ use a::{m2::{foo, bar}, m3 - │ - To match this '{' -32 │ let _tmp = 42; // reset parser to see if the next lines compile - │ ^ Expected '}' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_incomplete.snap b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_incomplete.snap new file mode 100644 index 0000000000000..8abde03378172 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_incomplete.snap @@ -0,0 +1,84 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/ide_mode/use_incomplete.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/use_incomplete.move:5:9 + │ +5 │ let _tmp = 42; // reset parser to see if the next line compiles + │ ^^^ + │ │ + │ Unexpected 'let' + │ Expected an identifier + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/use_incomplete.move:11:9 + │ +11 │ let _tmp = 42; // reset parser to see if the next line compiles + │ ^^^ + │ │ + │ Unexpected 'let' + │ Expected ',' or '}' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/use_incomplete.move:11:22 + │ +10 │ use a::m2::{foo + │ - To match this '{' +11 │ let _tmp = 42; // reset parser to see if the next line compiles + │ ^ Expected '}' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/use_incomplete.move:17:9 + │ +17 │ let _tmp = 42; // reset parser to see if the next lines compile + │ ^^^ + │ │ + │ Unexpected 'let' + │ Expected ',' or '}' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/use_incomplete.move:17:22 + │ +16 │ use a::m2::{foo, bar + │ - To match this '{' +17 │ let _tmp = 42; // reset parser to see if the next lines compile + │ ^ Expected '}' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/use_incomplete.move:24:9 + │ +24 │ let _tmp = 42; // reset parser to see if the next lines compile + │ ^^^ + │ │ + │ Unexpected 'let' + │ Expected ',' or '}' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/use_incomplete.move:24:22 + │ +23 │ use a::{m2::{foo, bar + │ - To match this '{' +24 │ let _tmp = 42; // reset parser to see if the next lines compile + │ ^ Expected '}' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/use_incomplete.move:32:9 + │ +32 │ let _tmp = 42; // reset parser to see if the next lines compile + │ ^^^ + │ │ + │ Unexpected 'let' + │ Expected ',' or '}' + +error[E01002]: unexpected token + ┌─ tests/move_2024/ide_mode/use_incomplete.move:32:22 + │ +31 │ use a::{m2::{foo, bar}, m3 + │ - To match this '{' +32 │ let _tmp = 42; // reset parser to see if the next lines compile + │ ^ Expected '}' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match.snap new file mode 100644 index 0000000000000..85578e711a195 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/abc_match.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_binder.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_binder.snap new file mode 100644 index 0000000000000..c5cee9f2e75b7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_binder.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/abc_match_binder.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_invalid_param.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_invalid_param.exp deleted file mode 100644 index 5baf799f5d565..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_invalid_param.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03008]: too few type arguments - ┌─ tests/move_2024/matching/abc_match_invalid_param.move:9:17 - │ -9 │ fun t0(abc: ABC): u64 { - │ ^^^ Invalid instantiation of '0x42::m::ABC'. Expected 1 type argument(s) but got 0 - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_invalid_param.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_invalid_param.snap new file mode 100644 index 0000000000000..eb9817cce04b4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_invalid_param.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/abc_match_invalid_param.move +--- +error[E03008]: too few type arguments + ┌─ tests/move_2024/matching/abc_match_invalid_param.move:9:17 + │ +9 │ fun t0(abc: ABC): u64 { + │ ^^^ Invalid instantiation of '0x42::m::ABC'. Expected 1 type argument(s) but got 0 diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_mut_ref.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_mut_ref.snap new file mode 100644 index 0000000000000..79ca87b0748dd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_mut_ref.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/abc_match_mut_ref.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_no_drop.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_no_drop.snap new file mode 100644 index 0000000000000..ce8cdcb2d4c3c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_no_drop.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/abc_match_no_drop.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_no_drop_exhaustive_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_no_drop_exhaustive_invalid.exp deleted file mode 100644 index 8757b3e87a6ea..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_no_drop_exhaustive_invalid.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/matching/abc_match_no_drop_exhaustive_invalid.move:14:13 - │ - 3 │ public enum ABC { - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - · -10 │ match (ABC::C(0)) { - │ --------- The type '0x42::m::ABC' does not have the ability 'drop' - · -14 │ _ => 1, - │ ^ Cannot ignore values without the 'drop' ability. '_' patterns discard their values - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_no_drop_exhaustive_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_no_drop_exhaustive_invalid.snap new file mode 100644 index 0000000000000..1733139e31a6c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_no_drop_exhaustive_invalid.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/abc_match_no_drop_exhaustive_invalid.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/matching/abc_match_no_drop_exhaustive_invalid.move:14:13 + │ + 3 │ public enum ABC { + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + · +10 │ match (ABC::C(0)) { + │ --------- The type '0x42::m::ABC' does not have the ability 'drop' + · +14 │ _ => 1, + │ ^ Cannot ignore values without the 'drop' ability. '_' patterns discard their values diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_no_drop_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_no_drop_invalid.exp deleted file mode 100644 index 520d5c9c2a646..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_no_drop_invalid.exp +++ /dev/null @@ -1,29 +0,0 @@ -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/matching/abc_match_no_drop_invalid.move:10:27 - │ - 3 │ public enum ABC { - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - · -10 │ match (ABC::C(0)) { - │ --------- The type '0x42::m::ABC' does not have the ability 'drop' - │ ╭─────────────────────────────^ - │ │ ╭───────────────────────────' -11 │ │ │ ABC::C(x) => x, -12 │ │ │ ABC::A(x) => x, -13 │ │ │ _ => 1, -14 │ │ │ } - │ ╰─│─────────^ Invalid return - │ ╰─────────' The match expression takes ownership of this value but does not use it. The value does not have the 'drop' ability and must be consumed before the function returns - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/matching/abc_match_no_drop_invalid.move:13:13 - │ - 3 │ public enum ABC { - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - · -10 │ match (ABC::C(0)) { - │ --------- The type '0x42::m::ABC' does not have the ability 'drop' - · -13 │ _ => 1, - │ ^ Cannot ignore values without the 'drop' ability. '_' patterns discard their values - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_no_drop_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_no_drop_invalid.snap new file mode 100644 index 0000000000000..31eb36ba917c1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_no_drop_invalid.snap @@ -0,0 +1,36 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/abc_match_no_drop_invalid.move +--- +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/matching/abc_match_no_drop_invalid.move:10:27 + │ + 3 │ public enum ABC { + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + · +10 │ match (ABC::C(0)) { + │ --------- The type '0x42::m::ABC' does not have the ability 'drop' + │ ╭─────────────────────────────^ + │ │ ╭───────────────────────────' +11 │ │ │ ABC::C(x) => x, +12 │ │ │ ABC::A(x) => x, +13 │ │ │ _ => 1, +14 │ │ │ } + │ ╰─│─────────^ Invalid return + │ ╰─────────' The match expression takes ownership of this value but does not use it. The value does not have the 'drop' ability and must be consumed before the function returns + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/matching/abc_match_no_drop_invalid.move:13:13 + │ + 3 │ public enum ABC { + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + · +10 │ match (ABC::C(0)) { + │ --------- The type '0x42::m::ABC' does not have the ability 'drop' + · +13 │ _ => 1, + │ ^ Cannot ignore values without the 'drop' ability. '_' patterns discard their values diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_ref.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_ref.snap new file mode 100644 index 0000000000000..3129483268888 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_ref.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/abc_match_ref.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_ref_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_ref_invalid.exp deleted file mode 100644 index bd7bc68a9ed26..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_ref_invalid.exp +++ /dev/null @@ -1,31 +0,0 @@ -error[E03008]: too few type arguments - ┌─ tests/move_2024/matching/abc_match_ref_invalid.move:9:18 - │ -9 │ fun t0(abc: &ABC): u64 { - │ ^^^ Invalid instantiation of '0x42::m::ABC'. Expected 1 type argument(s) but got 0 - -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/abc_match_ref_invalid.move:10:9 - │ - 9 │ fun t0(abc: &ABC): u64 { - │ --- Expected: 'u64' -10 │ ╭ match (abc) { -11 │ │ ABC::C(x) => x, - │ │ --------- Given: '&_' -12 │ │ ABC::A(x) => x, -13 │ │ ABC::B => 1, -14 │ │ } - │ ╰─────────^ Invalid return expression - -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/abc_match_ref_invalid.move:13:23 - │ -11 │ ABC::C(x) => x, - │ --------- Expected: '&_' -12 │ ABC::A(x) => x, -13 │ ABC::B => 1, - │ ^ - │ │ - │ Invalid right-hand side expression - │ Given: integer - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_ref_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_ref_invalid.snap new file mode 100644 index 0000000000000..a7508a64fe40b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_ref_invalid.snap @@ -0,0 +1,38 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/abc_match_ref_invalid.move +--- +error[E03008]: too few type arguments + ┌─ tests/move_2024/matching/abc_match_ref_invalid.move:9:18 + │ +9 │ fun t0(abc: &ABC): u64 { + │ ^^^ Invalid instantiation of '0x42::m::ABC'. Expected 1 type argument(s) but got 0 + +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/abc_match_ref_invalid.move:10:9 + │ + 9 │ fun t0(abc: &ABC): u64 { + │ --- Expected: 'u64' +10 │ ╭ match (abc) { +11 │ │ ABC::C(x) => x, + │ │ --------- Given: '&_' +12 │ │ ABC::A(x) => x, +13 │ │ ABC::B => 1, +14 │ │ } + │ ╰─────────^ Invalid return expression + +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/abc_match_ref_invalid.move:13:23 + │ +11 │ ABC::C(x) => x, + │ --------- Expected: '&_' +12 │ ABC::A(x) => x, +13 │ ABC::B => 1, + │ ^ + │ │ + │ Invalid right-hand side expression + │ Given: integer diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_twice.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_twice.snap new file mode 100644 index 0000000000000..dc6afcd154aee --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_twice.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/abc_match_twice.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_value_wildcard.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_value_wildcard.snap new file mode 100644 index 0000000000000..8211a8857b944 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/abc_match_value_wildcard.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/abc_match_value_wildcard.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_drop.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_drop.snap new file mode 100644 index 0000000000000..2de235d0053fa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_drop.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/at_drop.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_pattern_copy.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_pattern_copy.snap new file mode 100644 index 0000000000000..d6c369639406e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_pattern_copy.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/at_pattern_copy.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_pattern_copy_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_pattern_copy_invalid.exp deleted file mode 100644 index 905f76d0e41df..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_pattern_copy_invalid.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/matching/at_pattern_copy_invalid.move:10:13 - │ - 3 │ public enum Maybe has drop { - │ ----- To satisfy the constraint, the 'copy' ability would need to be added here - · -10 │ just @ Maybe::Just(x) => if (x > 0) { just } else { Maybe::Just(x * 2) }, - │ ^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::m::Maybe' does not have the ability 'copy' - │ `@` patterns will copy non-reference values during unpacking if necessary - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_pattern_copy_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_pattern_copy_invalid.snap new file mode 100644 index 0000000000000..5efe10dc99dda --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_pattern_copy_invalid.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/at_pattern_copy_invalid.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/matching/at_pattern_copy_invalid.move:10:13 + │ + 3 │ public enum Maybe has drop { + │ ----- To satisfy the constraint, the 'copy' ability would need to be added here + · +10 │ just @ Maybe::Just(x) => if (x > 0) { just } else { Maybe::Just(x * 2) }, + │ ^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::m::Maybe' does not have the ability 'copy' + │ `@` patterns will copy non-reference values during unpacking if necessary diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_pattern_drop.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_pattern_drop.snap new file mode 100644 index 0000000000000..623295336cacc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_pattern_drop.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/at_pattern_drop.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_pattern_lit.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_pattern_lit.snap new file mode 100644 index 0000000000000..d91fb214e76e6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_pattern_lit.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/at_pattern_lit.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_pattern_reuse.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_pattern_reuse.snap new file mode 100644 index 0000000000000..9c596d0e1050f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_pattern_reuse.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/at_pattern_reuse.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_patterns.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_patterns.exp deleted file mode 100644 index a74e87dd713c0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_patterns.exp +++ /dev/null @@ -1,28 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/at_patterns.move:30:16 - │ -30 │ match (x) { - │ ^ Pattern 'Maybe::Just(_)' not covered - -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/at_patterns.move:31:13 - │ -31 │ _ @ Maybe::Just(_) => other, - │ ^ Cannot use '_' as a binder in an '@' pattern - -warning[W09002]: unused variable - ┌─ tests/move_2024/matching/at_patterns.move:38:14 - │ -38 │ (x @ Maybe::Nothing) | (x @ Maybe::Just(_)) => other, - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_2024/matching/at_patterns.move:38:37 - │ -38 │ (x @ Maybe::Nothing) | (x @ Maybe::Just(_)) => other, - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_patterns.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_patterns.snap new file mode 100644 index 0000000000000..727e712b7d7c6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_patterns.snap @@ -0,0 +1,35 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/at_patterns.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/at_patterns.move:30:16 + │ +30 │ match (x) { + │ ^ Pattern 'Maybe::Just(_)' not covered + +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/at_patterns.move:31:13 + │ +31 │ _ @ Maybe::Just(_) => other, + │ ^ Cannot use '_' as a binder in an '@' pattern + +warning[W09002]: unused variable + ┌─ tests/move_2024/matching/at_patterns.move:38:14 + │ +38 │ (x @ Maybe::Nothing) | (x @ Maybe::Just(_)) => other, + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_2024/matching/at_patterns.move:38:37 + │ +38 │ (x @ Maybe::Nothing) | (x @ Maybe::Just(_)) => other, + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_patterns_mut_ref.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_patterns_mut_ref.exp deleted file mode 100644 index f6f01b4d4d262..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_patterns_mut_ref.exp +++ /dev/null @@ -1,28 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/at_patterns_mut_ref.move:30:16 - │ -30 │ match (x) { - │ ^ Pattern 'Maybe::Just(_)' not covered - -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/at_patterns_mut_ref.move:31:13 - │ -31 │ _ @ Maybe::Just(_) => other, - │ ^ Cannot use '_' as a binder in an '@' pattern - -warning[W09002]: unused variable - ┌─ tests/move_2024/matching/at_patterns_mut_ref.move:38:14 - │ -38 │ (x @ Maybe::Nothing) | (x @ Maybe::Just(_)) => other, - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_2024/matching/at_patterns_mut_ref.move:38:37 - │ -38 │ (x @ Maybe::Nothing) | (x @ Maybe::Just(_)) => other, - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_patterns_mut_ref.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_patterns_mut_ref.snap new file mode 100644 index 0000000000000..e3c81b05a46fe --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_patterns_mut_ref.snap @@ -0,0 +1,35 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/at_patterns_mut_ref.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/at_patterns_mut_ref.move:30:16 + │ +30 │ match (x) { + │ ^ Pattern 'Maybe::Just(_)' not covered + +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/at_patterns_mut_ref.move:31:13 + │ +31 │ _ @ Maybe::Just(_) => other, + │ ^ Cannot use '_' as a binder in an '@' pattern + +warning[W09002]: unused variable + ┌─ tests/move_2024/matching/at_patterns_mut_ref.move:38:14 + │ +38 │ (x @ Maybe::Nothing) | (x @ Maybe::Just(_)) => other, + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_2024/matching/at_patterns_mut_ref.move:38:37 + │ +38 │ (x @ Maybe::Nothing) | (x @ Maybe::Just(_)) => other, + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_patterns_ref.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_patterns_ref.exp deleted file mode 100644 index cf0cea474c5f2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_patterns_ref.exp +++ /dev/null @@ -1,28 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/at_patterns_ref.move:30:16 - │ -30 │ match (x) { - │ ^ Pattern 'Maybe::Just(_)' not covered - -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/at_patterns_ref.move:31:13 - │ -31 │ _ @ Maybe::Just(_) => other, - │ ^ Cannot use '_' as a binder in an '@' pattern - -warning[W09002]: unused variable - ┌─ tests/move_2024/matching/at_patterns_ref.move:38:14 - │ -38 │ (x @ Maybe::Nothing) | (x @ Maybe::Just(_)) => other, - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_2024/matching/at_patterns_ref.move:38:37 - │ -38 │ (x @ Maybe::Nothing) | (x @ Maybe::Just(_)) => other, - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_patterns_ref.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_patterns_ref.snap new file mode 100644 index 0000000000000..483d74163ec1d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/at_patterns_ref.snap @@ -0,0 +1,35 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/at_patterns_ref.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/at_patterns_ref.move:30:16 + │ +30 │ match (x) { + │ ^ Pattern 'Maybe::Just(_)' not covered + +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/at_patterns_ref.move:31:13 + │ +31 │ _ @ Maybe::Just(_) => other, + │ ^ Cannot use '_' as a binder in an '@' pattern + +warning[W09002]: unused variable + ┌─ tests/move_2024/matching/at_patterns_ref.move:38:14 + │ +38 │ (x @ Maybe::Nothing) | (x @ Maybe::Just(_)) => other, + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_2024/matching/at_patterns_ref.move:38:37 + │ +38 │ (x @ Maybe::Nothing) | (x @ Maybe::Just(_)) => other, + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/bad_guard_1.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/bad_guard_1.snap new file mode 100644 index 0000000000000..dcf5a90f60603 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/bad_guard_1.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/bad_guard_1.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/bad_guard_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/bad_guard_2.snap new file mode 100644 index 0000000000000..d13994cced977 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/bad_guard_2.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/bad_guard_2.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/bad_guard_3.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/bad_guard_3.exp deleted file mode 100644 index 72259a755c30d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/bad_guard_3.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_2024/matching/bad_guard_3.move:16:20 - │ -14 │ match (o) { - │ - It is still being mutably borrowed by this reference -15 │ Option::None => 0, -16 │ _ if ({*o = Option::None; false}) => 1, - │ ^^^^^^^^^^^^^^^^^ Invalid mutation of reference. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/bad_guard_3.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/bad_guard_3.snap new file mode 100644 index 0000000000000..4e1d2be9fae4c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/bad_guard_3.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/bad_guard_3.move +--- +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_2024/matching/bad_guard_3.move:16:20 + │ +14 │ match (o) { + │ - It is still being mutably borrowed by this reference +15 │ Option::None => 0, +16 │ _ if ({*o = Option::None; false}) => 1, + │ ^^^^^^^^^^^^^^^^^ Invalid mutation of reference. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/bad_guard_4.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/bad_guard_4.exp deleted file mode 100644 index 729ac54efd241..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/bad_guard_4.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E04006]: invalid subtype - ┌─ tests/move_2024/matching/bad_guard_4.move:16:21 - │ -16 │ x if ({*x = Option::Some(1); false}) => 1, - │ - ^ - │ │ │ - │ │ Invalid mutation. Expected a mutable reference - │ │ Expected: '&mut _' - │ Given: '&0x42::m::Option<{integer}>' - -warning[W09002]: unused variable - ┌─ tests/move_2024/matching/bad_guard_4.move:18:13 - │ -18 │ x => 10, - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/bad_guard_4.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/bad_guard_4.snap new file mode 100644 index 0000000000000..ca4f04c40cb3e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/bad_guard_4.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/bad_guard_4.move +--- +error[E04006]: invalid subtype + ┌─ tests/move_2024/matching/bad_guard_4.move:16:21 + │ +16 │ x if ({*x = Option::Some(1); false}) => 1, + │ - ^ + │ │ │ + │ │ Invalid mutation. Expected a mutable reference + │ │ Expected: '&mut _' + │ Given: '&0x42::m::Option<{integer}>' + +warning[W09002]: unused variable + ┌─ tests/move_2024/matching/bad_guard_4.move:18:13 + │ +18 │ x => 10, + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/bind_subject.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/bind_subject.snap new file mode 100644 index 0000000000000..53efc455cc48a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/bind_subject.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/bind_subject.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/bool_const_exhaustive.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/bool_const_exhaustive.snap new file mode 100644 index 0000000000000..d36a8ad314cc1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/bool_const_exhaustive.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/bool_const_exhaustive.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_at.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_at.snap new file mode 100644 index 0000000000000..6445bef21e914 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_at.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/const_at.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_in_guard.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_in_guard.snap new file mode 100644 index 0000000000000..0926017e4274e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_in_guard.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/const_in_guard.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_lit.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_lit.snap new file mode 100644 index 0000000000000..429663628f15d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_lit.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/const_lit.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_lit_bool.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_lit_bool.snap new file mode 100644 index 0000000000000..f8fce76823a94 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_lit_bool.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/const_lit_bool.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_matching.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_matching.snap new file mode 100644 index 0000000000000..b8233eb2902e6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_matching.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/const_matching.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_mut_guard.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_mut_guard.snap new file mode 100644 index 0000000000000..864f8f196329e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_mut_guard.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/const_mut_guard.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_opt_result.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_opt_result.snap new file mode 100644 index 0000000000000..c900ef9ccfb2f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_opt_result.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/const_opt_result.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_pair.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_pair.snap new file mode 100644 index 0000000000000..8ca59b0ef13dd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_pair.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/const_pair.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_result.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_result.snap new file mode 100644 index 0000000000000..39792747d15a1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_result.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/const_result.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_self.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_self.snap new file mode 100644 index 0000000000000..0fc895f495a96 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_self.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/const_self.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_visibility.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_visibility.exp deleted file mode 100644 index 0a4d646b1c203..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_visibility.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_2024/matching/const_visibility.move:13:13 - │ - 3 │ const Z: u64 = 0; - │ - Constants are internal to their module, and cannot can be accessed outside of their module - · -13 │ m::Z => 0, - │ ^^^^ Invalid access of '0x42::m::Z' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_visibility.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_visibility.snap new file mode 100644 index 0000000000000..54e3f932a5d5a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/const_visibility.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/const_visibility.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_2024/matching/const_visibility.move:13:13 + │ + 3 │ const Z: u64 = 0; + │ - Constants are internal to their module, and cannot can be accessed outside of their module + · +13 │ m::Z => 0, + │ ^^^^ Invalid access of '0x42::m::Z' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_ctor.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_ctor.exp deleted file mode 100644 index dba95a5a47304..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_ctor.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_ctor.move:9:16 - │ -9 │ match (Option::Some(0)) { - │ ^^^^^^^^^^^^^^^ Pattern 'Option::None' not covered - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_ctor.move:15:16 - │ -15 │ match (opt) { - │ ^^^ Pattern 'Option::Some(Option::Some(_))' not covered - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_ctor.move:22:16 - │ -22 │ match (opt) { - │ ^^^ Pattern 'Option::None' not covered - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_ctor.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_ctor.snap new file mode 100644 index 0000000000000..cf0d3236302fc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_ctor.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/counterexample_ctor.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_ctor.move:9:16 + │ +9 │ match (Option::Some(0)) { + │ ^^^^^^^^^^^^^^^ Pattern 'Option::None' not covered + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_ctor.move:15:16 + │ +15 │ match (opt) { + │ ^^^ Pattern 'Option::Some(Option::Some(_))' not covered + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_ctor.move:22:16 + │ +22 │ match (opt) { + │ ^^^ Pattern 'Option::None' not covered diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_guards.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_guards.exp deleted file mode 100644 index f559190145cf6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_guards.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_guards.move:9:16 - │ -9 │ match (Option::Some(0)) { - │ ^^^^^^^^^^^^^^^ Pattern 'Option::Some(_)' not covered - │ - = Match arms with guards are not considered for coverage. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_guards.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_guards.snap new file mode 100644 index 0000000000000..d11b7a95804e7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_guards.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/counterexample_guards.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_guards.move:9:16 + │ +9 │ match (Option::Some(0)) { + │ ^^^^^^^^^^^^^^^ Pattern 'Option::Some(_)' not covered + │ + = Match arms with guards are not considered for coverage. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_lits.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_lits.exp deleted file mode 100644 index 33652a7db1c08..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_lits.exp +++ /dev/null @@ -1,44 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_lits.move:8:16 - │ -8 │ match (Tuple2::Ctor(0, 1)) { - │ ^^^^^^^^^^^^^^^^^^ Pattern 'Tuple2::Ctor(_0, _)' not covered - │ - = When '_0' is not 0 - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_lits.move:20:16 - │ -20 │ match (tup) { - │ ^^^ Pattern 'Tuple2::Ctor(Tuple2::Ctor(_0, _), _)' not covered - │ - = When '_0' is not 1 - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_lits.move:26:16 - │ -26 │ match (tup) { - │ ^^^ Pattern 'Tuple2::Ctor(false, _)' not covered - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_lits.move:32:16 - │ -32 │ match (tup) { - │ ^^^ Pattern 'Tuple2::Ctor(false, false)' not covered - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_lits.move:48:16 - │ -48 │ match (Tuple2::Ctor(0, 1)) { - │ ^^^^^^^^^^^^^^^^^^ Pattern 'Tuple2::Ctor(_0, _)' not covered - │ - = When '_0' is not 0 or 3 - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_lits.move:55:16 - │ -55 │ match (Tuple2::Ctor(0, 1)) { - │ ^^^^^^^^^^^^^^^^^^ Pattern 'Tuple2::Ctor(_0, _)' not covered - │ - = When '_0' is not 0, 3, 4, or 7 - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_lits.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_lits.snap new file mode 100644 index 0000000000000..d748184bf1ff0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_lits.snap @@ -0,0 +1,51 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/counterexample_lits.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_lits.move:8:16 + │ +8 │ match (Tuple2::Ctor(0, 1)) { + │ ^^^^^^^^^^^^^^^^^^ Pattern 'Tuple2::Ctor(_0, _)' not covered + │ + = When '_0' is not 0 + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_lits.move:20:16 + │ +20 │ match (tup) { + │ ^^^ Pattern 'Tuple2::Ctor(Tuple2::Ctor(_0, _), _)' not covered + │ + = When '_0' is not 1 + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_lits.move:26:16 + │ +26 │ match (tup) { + │ ^^^ Pattern 'Tuple2::Ctor(false, _)' not covered + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_lits.move:32:16 + │ +32 │ match (tup) { + │ ^^^ Pattern 'Tuple2::Ctor(false, false)' not covered + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_lits.move:48:16 + │ +48 │ match (Tuple2::Ctor(0, 1)) { + │ ^^^^^^^^^^^^^^^^^^ Pattern 'Tuple2::Ctor(_0, _)' not covered + │ + = When '_0' is not 0 or 3 + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_lits.move:55:16 + │ +55 │ match (Tuple2::Ctor(0, 1)) { + │ ^^^^^^^^^^^^^^^^^^ Pattern 'Tuple2::Ctor(_0, _)' not covered + │ + = When '_0' is not 0, 3, 4, or 7 diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_lits_long.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_lits_long.exp deleted file mode 100644 index a81b8aff143a9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_lits_long.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_lits_long.move:4:16 - │ -4 │ match (x) { - │ ^ Pattern '_0' not covered - │ - = When '_0' is not 0, 5, 10, or 2 other values - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_lits_long.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_lits_long.snap new file mode 100644 index 0000000000000..344b128c3ef22 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_lits_long.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/counterexample_lits_long.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_lits_long.move:4:16 + │ +4 │ match (x) { + │ ^ Pattern '_0' not covered + │ + = When '_0' is not 0, 5, 10, or 2 other values diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_malformed_match.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_malformed_match.exp deleted file mode 100644 index b9e03d3dc8b3c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_malformed_match.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04016]: too few arguments - ┌─ tests/move_2024/matching/counterexample_malformed_match.move:18:9 - │ -18 │ SomeEnum::PositionalFields(_, ) => (), - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Missing pattern for field '1' in 'a::m::SomeEnum::PositionalFields' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_malformed_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_malformed_match.snap new file mode 100644 index 0000000000000..9a2a97fbac1e3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_malformed_match.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/counterexample_malformed_match.move +--- +error[E04016]: too few arguments + ┌─ tests/move_2024/matching/counterexample_malformed_match.move:18:9 + │ +18 │ SomeEnum::PositionalFields(_, ) => (), + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Missing pattern for field '1' in 'a::m::SomeEnum::PositionalFields' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_malformed_match_2.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_malformed_match_2.exp deleted file mode 100644 index cc95d800f7fc8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_malformed_match_2.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03010]: unbound field - ┌─ tests/move_2024/matching/counterexample_malformed_match_2.move:18:9 - │ -18 │ SomeEnum::PositionalFields(_, _, _) => (), - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Unbound field '2' in 'a::m::SomeEnum::PositionalFields' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_malformed_match_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_malformed_match_2.snap new file mode 100644 index 0000000000000..247dd88f837f0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_malformed_match_2.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/counterexample_malformed_match_2.move +--- +error[E03010]: unbound field + ┌─ tests/move_2024/matching/counterexample_malformed_match_2.move:18:9 + │ +18 │ SomeEnum::PositionalFields(_, _, _) => (), + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Unbound field '2' in 'a::m::SomeEnum::PositionalFields' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_named_ctor.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_named_ctor.exp deleted file mode 100644 index 70e2582893904..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_named_ctor.exp +++ /dev/null @@ -1,34 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_named_ctor.move:9:16 - │ -9 │ match (Option::Some { value: 0 }) { - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Pattern 'Option::None' not covered - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_named_ctor.move:15:16 - │ -15 │ match (opt) { - │ ^^^ Pattern 'Option::Some { value: Option::Some { value: _ } }' not covered - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_named_ctor.move:22:16 - │ -22 │ match (opt) { - │ ^^^ Pattern 'Option::None' not covered - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_named_ctor.move:32:16 - │ -32 │ match (pair) { - │ ^^^^ Pattern 'Pair::P { one: _, two: _0 }' not covered - │ - = When '_0' is not 0 - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_named_ctor.move:38:16 - │ -38 │ match (pair) { - │ ^^^^ Pattern 'Pair::P { one: _, two: _0 }' not covered - │ - = When '_0' is not 0 - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_named_ctor.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_named_ctor.snap new file mode 100644 index 0000000000000..0226e769ad30d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_named_ctor.snap @@ -0,0 +1,41 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/counterexample_named_ctor.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_named_ctor.move:9:16 + │ +9 │ match (Option::Some { value: 0 }) { + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Pattern 'Option::None' not covered + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_named_ctor.move:15:16 + │ +15 │ match (opt) { + │ ^^^ Pattern 'Option::Some { value: Option::Some { value: _ } }' not covered + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_named_ctor.move:22:16 + │ +22 │ match (opt) { + │ ^^^ Pattern 'Option::None' not covered + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_named_ctor.move:32:16 + │ +32 │ match (pair) { + │ ^^^^ Pattern 'Pair::P { one: _, two: _0 }' not covered + │ + = When '_0' is not 0 + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_named_ctor.move:38:16 + │ +38 │ match (pair) { + │ ^^^^ Pattern 'Pair::P { one: _, two: _0 }' not covered + │ + = When '_0' is not 0 diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_struct_named.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_struct_named.exp deleted file mode 100644 index 60540043ee3a6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_struct_named.exp +++ /dev/null @@ -1,44 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_struct_named.move:6:16 - │ -6 │ match (NTuple2 { fst: 0, snd: 1 }) { - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Pattern 'NTuple2 { fst: _0, snd: _ }' not covered - │ - = When '_0' is not 0 - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_struct_named.move:12:16 - │ -12 │ match (NTuple2 { fst: 0, snd: 1 }) { - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Pattern 'NTuple2 { fst: _0, snd: _ }' not covered - │ - = When '_0' is not 0 or 3 - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_struct_named.move:19:16 - │ -19 │ match (tup) { - │ ^^^ Pattern 'NTuple2 { fst: NTuple2 { fst: _0, snd: _ }, snd: _ }' not covered - │ - = When '_0' is not 1 - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_struct_named.move:25:16 - │ -25 │ match (tup) { - │ ^^^ Pattern 'NTuple2 { fst: false, snd: _ }' not covered - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_struct_named.move:31:16 - │ -31 │ match (tup) { - │ ^^^ Pattern 'NTuple2 { fst: false, snd: false }' not covered - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_struct_named.move:38:16 - │ -38 │ match (NTuple2 { fst: 0, snd: 1 }) { - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Pattern 'NTuple2 { fst: _0, snd: _ }' not covered - │ - = When '_0' is not 0, 3, 4, or 7 - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_struct_named.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_struct_named.snap new file mode 100644 index 0000000000000..eb59cb95fbb35 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_struct_named.snap @@ -0,0 +1,51 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/counterexample_struct_named.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_struct_named.move:6:16 + │ +6 │ match (NTuple2 { fst: 0, snd: 1 }) { + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Pattern 'NTuple2 { fst: _0, snd: _ }' not covered + │ + = When '_0' is not 0 + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_struct_named.move:12:16 + │ +12 │ match (NTuple2 { fst: 0, snd: 1 }) { + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Pattern 'NTuple2 { fst: _0, snd: _ }' not covered + │ + = When '_0' is not 0 or 3 + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_struct_named.move:19:16 + │ +19 │ match (tup) { + │ ^^^ Pattern 'NTuple2 { fst: NTuple2 { fst: _0, snd: _ }, snd: _ }' not covered + │ + = When '_0' is not 1 + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_struct_named.move:25:16 + │ +25 │ match (tup) { + │ ^^^ Pattern 'NTuple2 { fst: false, snd: _ }' not covered + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_struct_named.move:31:16 + │ +31 │ match (tup) { + │ ^^^ Pattern 'NTuple2 { fst: false, snd: false }' not covered + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_struct_named.move:38:16 + │ +38 │ match (NTuple2 { fst: 0, snd: 1 }) { + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Pattern 'NTuple2 { fst: _0, snd: _ }' not covered + │ + = When '_0' is not 0, 3, 4, or 7 diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_struct_positional.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_struct_positional.exp deleted file mode 100644 index 5c32ccaa7cfde..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_struct_positional.exp +++ /dev/null @@ -1,44 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_struct_positional.move:6:16 - │ -6 │ match (PTuple2(0, 1)) { - │ ^^^^^^^^^^^^^ Pattern 'PTuple2(_0, _)' not covered - │ - = When '_0' is not 0 - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_struct_positional.move:12:16 - │ -12 │ match (PTuple2(0, 1)) { - │ ^^^^^^^^^^^^^ Pattern 'PTuple2(_0, _)' not covered - │ - = When '_0' is not 0 or 3 - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_struct_positional.move:19:16 - │ -19 │ match (tup) { - │ ^^^ Pattern 'PTuple2(PTuple2(_0, _), _)' not covered - │ - = When '_0' is not 1 - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_struct_positional.move:25:16 - │ -25 │ match (tup) { - │ ^^^ Pattern 'PTuple2(false, _)' not covered - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_struct_positional.move:31:16 - │ -31 │ match (tup) { - │ ^^^ Pattern 'PTuple2(false, false)' not covered - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/counterexample_struct_positional.move:38:16 - │ -38 │ match (PTuple2(0, 1)) { - │ ^^^^^^^^^^^^^ Pattern 'PTuple2(_0, _)' not covered - │ - = When '_0' is not 0, 3, 4, or 7 - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_struct_positional.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_struct_positional.snap new file mode 100644 index 0000000000000..9334897bf2e4b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/counterexample_struct_positional.snap @@ -0,0 +1,51 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/counterexample_struct_positional.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_struct_positional.move:6:16 + │ +6 │ match (PTuple2(0, 1)) { + │ ^^^^^^^^^^^^^ Pattern 'PTuple2(_0, _)' not covered + │ + = When '_0' is not 0 + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_struct_positional.move:12:16 + │ +12 │ match (PTuple2(0, 1)) { + │ ^^^^^^^^^^^^^ Pattern 'PTuple2(_0, _)' not covered + │ + = When '_0' is not 0 or 3 + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_struct_positional.move:19:16 + │ +19 │ match (tup) { + │ ^^^ Pattern 'PTuple2(PTuple2(_0, _), _)' not covered + │ + = When '_0' is not 1 + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_struct_positional.move:25:16 + │ +25 │ match (tup) { + │ ^^^ Pattern 'PTuple2(false, _)' not covered + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_struct_positional.move:31:16 + │ +31 │ match (tup) { + │ ^^^ Pattern 'PTuple2(false, false)' not covered + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/counterexample_struct_positional.move:38:16 + │ +38 │ match (PTuple2(0, 1)) { + │ ^^^^^^^^^^^^^ Pattern 'PTuple2(_0, _)' not covered + │ + = When '_0' is not 0, 3, 4, or 7 diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/drop_ref.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/drop_ref.snap new file mode 100644 index 0000000000000..8e16dbfc06380 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/drop_ref.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/drop_ref.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/duplicate_defns.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/duplicate_defns.exp deleted file mode 100644 index 460e58d0a43c0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/duplicate_defns.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/matching/duplicate_defns.move:9:17 - │ -2 │ public enum X { - │ - Alias previously defined here - · -9 │ public enum X { - │ ^ Duplicate module member or alias 'X'. Top level names in a namespace must be unique - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/matching/duplicate_defns.move:14:19 - │ - 9 │ public enum X { - │ - Alias previously defined here - · -14 │ public struct X(u64, u64, u64) - │ ^ Duplicate module member or alias 'X'. Top level names in a namespace must be unique - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/duplicate_defns.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/duplicate_defns.snap new file mode 100644 index 0000000000000..838f693dc9015 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/duplicate_defns.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/duplicate_defns.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/matching/duplicate_defns.move:9:17 + │ +2 │ public enum X { + │ - Alias previously defined here + · +9 │ public enum X { + │ ^ Duplicate module member or alias 'X'. Top level names in a namespace must be unique + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/matching/duplicate_defns.move:14:19 + │ + 9 │ public enum X { + │ - Alias previously defined here + · +14 │ public struct X(u64, u64, u64) + │ ^ Duplicate module member or alias 'X'. Top level names in a namespace must be unique diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/empty_match.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/empty_match.exp deleted file mode 100644 index 0479240925299..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/empty_match.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E13003]: feature is under active development - ┌─ tests/move_2024/matching/empty_match.move:3:17 - │ -3 │ public enum Empty { - │ ^^^^^ Enums are not supported in bytecode. - │ - = This feature is currently in development. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/enum_no_tyargs_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/enum_no_tyargs_match.snap new file mode 100644 index 0000000000000..524e58a1c0cce --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/enum_no_tyargs_match.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/enum_no_tyargs_match.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/enum_poly_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/enum_poly_match.snap new file mode 100644 index 0000000000000..747b7676c370c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/enum_poly_match.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/enum_poly_match.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/enum_visibility.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/enum_visibility.exp deleted file mode 100644 index 59775a9e6a14d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/enum_visibility.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_2024/matching/enum_visibility.move:15:13 - │ - 3 │ public enum E { - │ - Enum defined in module '0x42::m' - · -15 │ m::E::A(t) => t, - │ ^^^^^^^^^^ Enum variant '0x42::m::E::A' can only be matched within its defining module '0x42::m' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/enum_visibility.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/enum_visibility.snap new file mode 100644 index 0000000000000..f61a806cdb5c8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/enum_visibility.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/enum_visibility.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_2024/matching/enum_visibility.move:15:13 + │ + 3 │ public enum E { + │ - Enum defined in module '0x42::m' + · +15 │ m::E::A(t) => t, + │ ^^^^^^^^^^ Enum variant '0x42::m::E::A' can only be matched within its defining module '0x42::m' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/exhaustive_struct.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/exhaustive_struct.snap new file mode 100644 index 0000000000000..59e114d785e56 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/exhaustive_struct.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/exhaustive_struct.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/fib.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/fib.snap new file mode 100644 index 0000000000000..380422a4b408d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/fib.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/fib.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/field_order_counterexample.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/field_order_counterexample.exp deleted file mode 100644 index a8fb54edd0fc8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/field_order_counterexample.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/field_order_counterexample.move:8:12 - │ -8 │ match (e) { - │ ^ Pattern 'E::V { zero: _0, one: _ }' not covered - │ - = When '_0' is not 0 - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/field_order_counterexample.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/field_order_counterexample.snap new file mode 100644 index 0000000000000..0934b6e045d76 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/field_order_counterexample.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/field_order_counterexample.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/field_order_counterexample.move:8:12 + │ +8 │ match (e) { + │ ^ Pattern 'E::V { zero: _0, one: _ }' not covered + │ + = When '_0' is not 0 diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/generated_0.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/generated_0.snap new file mode 100644 index 0000000000000..46275a412c4cf --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/generated_0.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/generated_0.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/go_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/go_match.snap new file mode 100644 index 0000000000000..efc118787f436 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/go_match.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/go_match.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/go_repro.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/go_repro.snap new file mode 100644 index 0000000000000..44fd8a4893480 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/go_repro.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/go_repro.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard.snap new file mode 100644 index 0000000000000..cd20eb0112935 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/guard.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_backtrack.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_backtrack.snap new file mode 100644 index 0000000000000..1936e72b11494 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_backtrack.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/guard_backtrack.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_backtrack_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_backtrack_2.snap new file mode 100644 index 0000000000000..afe157ef6e9de --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_backtrack_2.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/guard_backtrack_2.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_backtrack_3.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_backtrack_3.snap new file mode 100644 index 0000000000000..4ec97a09762c6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_backtrack_3.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/guard_backtrack_3.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_backtrack_4.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_backtrack_4.snap new file mode 100644 index 0000000000000..7fbf79d4d87f8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_backtrack_4.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/guard_backtrack_4.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_backtrack_5.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_backtrack_5.snap new file mode 100644 index 0000000000000..79ac397b55662 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_backtrack_5.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/guard_backtrack_5.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_binders.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_binders.exp deleted file mode 100644 index 6732ccedba5fd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_binders.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/guard_binders.move:19:32 - │ -19 │ Option::Some(n) if n == &5 => *n, - │ ^ - │ │ - │ Unexpected 'n' - │ Expected '(' - -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/guard_binders.move:28:32 - │ -28 │ Option::Some(n) if n == &5 => *n, - │ ^ - │ │ - │ Unexpected 'n' - │ Expected '(' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_binders.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_binders.snap new file mode 100644 index 0000000000000..f7a5bf2551d46 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_binders.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/guard_binders.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/guard_binders.move:19:32 + │ +19 │ Option::Some(n) if n == &5 => *n, + │ ^ + │ │ + │ Unexpected 'n' + │ Expected '(' + +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/guard_binders.move:28:32 + │ +28 │ Option::Some(n) if n == &5 => *n, + │ ^ + │ │ + │ Unexpected 'n' + │ Expected '(' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_copy.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_copy.exp deleted file mode 100644 index d4906ab713835..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_copy.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/guard_copy.move:17:32 - │ -17 │ Option::Some(n) if check_s(copy n) => n, - │ ^^^^^^^ - │ │ - │ Unexpected 'check_s' - │ Expected '(' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_copy.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_copy.snap new file mode 100644 index 0000000000000..ee582ab2f00fd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_copy.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/guard_copy.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/guard_copy.move:17:32 + │ +17 │ Option::Some(n) if check_s(copy n) => n, + │ ^^^^^^^ + │ │ + │ Unexpected 'check_s' + │ Expected '(' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_invalid_copy.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_invalid_copy.exp deleted file mode 100644 index 90e4b09fa580a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_invalid_copy.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/guard_invalid_copy.move:17:28 - │ -17 │ Option::Some(n) if check_s(n) => n, - │ ^^^^^^^ - │ │ - │ Unexpected 'check_s' - │ Expected '(' - -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/guard_invalid_copy.move:26:28 - │ -26 │ Option::Some(n) if check_s(copy n) => n, - │ ^^^^^^^ - │ │ - │ Unexpected 'check_s' - │ Expected '(' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_invalid_copy.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_invalid_copy.snap new file mode 100644 index 0000000000000..e1211d88ac1dd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_invalid_copy.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/guard_invalid_copy.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/guard_invalid_copy.move:17:28 + │ +17 │ Option::Some(n) if check_s(n) => n, + │ ^^^^^^^ + │ │ + │ Unexpected 'check_s' + │ Expected '(' + +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/guard_invalid_copy.move:26:28 + │ +26 │ Option::Some(n) if check_s(copy n) => n, + │ ^^^^^^^ + │ │ + │ Unexpected 'check_s' + │ Expected '(' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_ref.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_ref.exp deleted file mode 100644 index a1eb116432ea0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_ref.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/guard_ref.move:16:32 - │ -16 │ Option::Some(n) if check_imm_ref_s(n) => n, - │ ^^^^^^^^^^^^^^^ - │ │ - │ Unexpected 'check_imm_ref_s' - │ Expected '(' - -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/guard_ref.move:28:32 - │ -28 │ Option::Some(n) if check_mut_ref_s(n) => n, - │ ^^^^^^^^^^^^^^^ - │ │ - │ Unexpected 'check_mut_ref_s' - │ Expected '(' - -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/guard_ref.move:36:32 - │ -36 │ Option::Some(n) if check_mut_ref_s(n) => n, - │ ^^^^^^^^^^^^^^^ - │ │ - │ Unexpected 'check_mut_ref_s' - │ Expected '(' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_ref.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_ref.snap new file mode 100644 index 0000000000000..df4d55f7f76e3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_ref.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/guard_ref.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/guard_ref.move:16:32 + │ +16 │ Option::Some(n) if check_imm_ref_s(n) => n, + │ ^^^^^^^^^^^^^^^ + │ │ + │ Unexpected 'check_imm_ref_s' + │ Expected '(' + +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/guard_ref.move:28:32 + │ +28 │ Option::Some(n) if check_mut_ref_s(n) => n, + │ ^^^^^^^^^^^^^^^ + │ │ + │ Unexpected 'check_mut_ref_s' + │ Expected '(' + +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/guard_ref.move:36:32 + │ +36 │ Option::Some(n) if check_mut_ref_s(n) => n, + │ ^^^^^^^^^^^^^^^ + │ │ + │ Unexpected 'check_mut_ref_s' + │ Expected '(' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_wild.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_wild.snap new file mode 100644 index 0000000000000..9800a93883056 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_wild.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/guard_wild.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_wild_inexhaustive.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_wild_inexhaustive.exp deleted file mode 100644 index 22bdd8195addb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_wild_inexhaustive.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/guard_wild_inexhaustive.move:9:12 - │ -9 │ match (tile) { - │ ^^^^ Pattern 'Tile::Unwalkable' not covered - │ - = Match arms with guards are not considered for coverage. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_wild_inexhaustive.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_wild_inexhaustive.snap new file mode 100644 index 0000000000000..1869b636640ad --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_wild_inexhaustive.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/guard_wild_inexhaustive.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/guard_wild_inexhaustive.move:9:12 + │ +9 │ match (tile) { + │ ^^^^ Pattern 'Tile::Unwalkable' not covered + │ + = Match arms with guards are not considered for coverage. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_wild_initial.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_wild_initial.snap new file mode 100644 index 0000000000000..93965b2fbd346 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/guard_wild_initial.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/guard_wild_initial.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/haskell_maybe.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/haskell_maybe.snap new file mode 100644 index 0000000000000..e9bbad3618cbd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/haskell_maybe.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/haskell_maybe.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/if_compilation.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/if_compilation.snap new file mode 100644 index 0000000000000..ccd8ae2366e16 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/if_compilation.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/if_compilation.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/incr_in_container.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/incr_in_container.snap new file mode 100644 index 0000000000000..b39ac23f7b800 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/incr_in_container.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/incr_in_container.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/inferred_int_complex.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/inferred_int_complex.snap new file mode 100644 index 0000000000000..d429c18371f21 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/inferred_int_complex.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/inferred_int_complex.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/inferred_int_mut_ref_type.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/inferred_int_mut_ref_type.snap new file mode 100644 index 0000000000000..e6f43e8a6711a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/inferred_int_mut_ref_type.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/inferred_int_mut_ref_type.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/inferred_int_ref_type.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/inferred_int_ref_type.snap new file mode 100644 index 0000000000000..0ef6f5599e35f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/inferred_int_ref_type.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/inferred_int_ref_type.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/inferred_int_subject.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/inferred_int_subject.snap new file mode 100644 index 0000000000000..d1d06544fc2e6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/inferred_int_subject.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/inferred_int_subject.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_at.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_at.exp deleted file mode 100644 index ccee773aee8e4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_at.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/invalid_at.move:8:16 - │ -8 │ match (opt) { - │ ^^^ Pattern '_' not covered - -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/invalid_at.move:9:13 - │ -9 │ _ @ Option::Some(128u8) => (), - │ ^ Cannot use '_' as a binder in an '@' pattern - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_at.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_at.snap new file mode 100644 index 0000000000000..1214da0f980ad --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_at.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_at.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/invalid_at.move:8:16 + │ +8 │ match (opt) { + │ ^^^ Pattern '_' not covered + +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/invalid_at.move:9:13 + │ +9 │ _ @ Option::Some(128u8) => (), + │ ^ Cannot use '_' as a binder in an '@' pattern diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_binding_var.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_binding_var.exp deleted file mode 100644 index 4dfded963ff8c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_binding_var.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/invalid_binding_var.move:8:16 - │ -8 │ match (opt) { - │ ^^^ Pattern 'Option::Some(_)' not covered - -error[E02010]: invalid name - ┌─ tests/move_2024/matching/invalid_binding_var.move:9:26 - │ -9 │ Option::Some(Hello) => (), - │ ^^^^^ Invalid pattern variable name 'Hello'. Pattern variable names must start with 'a'..'z' or '_' - │ - = The compiler may have failed to resolve this constant's name - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_binding_var.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_binding_var.snap new file mode 100644 index 0000000000000..b0c2dcbd265ec --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_binding_var.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_binding_var.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/invalid_binding_var.move:8:16 + │ +8 │ match (opt) { + │ ^^^ Pattern 'Option::Some(_)' not covered + +error[E02010]: invalid name + ┌─ tests/move_2024/matching/invalid_binding_var.move:9:26 + │ +9 │ Option::Some(Hello) => (), + │ ^^^^^ Invalid pattern variable name 'Hello'. Pattern variable names must start with 'a'..'z' or '_' + │ + = The compiler may have failed to resolve this constant's name diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_bool_const_exhasutive.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_bool_const_exhasutive.exp deleted file mode 100644 index 836ed9b7f52bb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_bool_const_exhasutive.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/invalid_bool_const_exhasutive.move:7:16 - │ -7 │ match (b) { - │ ^ Pattern '_' not covered - │ - = Match arms with guards are not considered for coverage. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_bool_const_exhasutive.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_bool_const_exhasutive.snap new file mode 100644 index 0000000000000..710ce228caf14 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_bool_const_exhasutive.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_bool_const_exhasutive.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/invalid_bool_const_exhasutive.move:7:16 + │ +7 │ match (b) { + │ ^ Pattern '_' not covered + │ + = Match arms with guards are not considered for coverage. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_const_match_type.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_const_match_type.exp deleted file mode 100644 index 7cd183457849d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_const_match_type.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/invalid_const_match_type.move:9:17 - │ -3 │ const Z8: u8 = 0; - │ -- Given: 'u8' -4 │ -5 │ public struct S has drop { n: u64 } - │ --- Expected: 'u64' - · -9 │ S { n: Z8 } => n, - │ ^ Invalid pattern field type - -error[E03009]: unbound variable - ┌─ tests/move_2024/matching/invalid_const_match_type.move:9:28 - │ -9 │ S { n: Z8 } => n, - │ ^ Unbound variable 'n' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_const_match_type.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_const_match_type.snap new file mode 100644 index 0000000000000..896c51c25bd82 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_const_match_type.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_const_match_type.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/invalid_const_match_type.move:9:17 + │ +3 │ const Z8: u8 = 0; + │ -- Given: 'u8' +4 │ +5 │ public struct S has drop { n: u64 } + │ --- Expected: 'u64' + · +9 │ S { n: Z8 } => n, + │ ^ Invalid pattern field type + +error[E03009]: unbound variable + ┌─ tests/move_2024/matching/invalid_const_match_type.move:9:28 + │ +9 │ S { n: Z8 } => n, + │ ^ Unbound variable 'n' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_const_mut.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_const_mut.exp deleted file mode 100644 index cedc0b6d48e2c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_const_mut.exp +++ /dev/null @@ -1,54 +0,0 @@ -error[E02010]: invalid name - ┌─ tests/move_2024/matching/invalid_const_mut.move:9:26 - │ -9 │ Box { value: mut ZERO } => ZERO, - │ ^^^ ---- Expected a valid 'enum' variant, 'struct', or 'const', not a variable - │ │ - │ 'mut' can only be used with variable bindings in patterns - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/matching/invalid_const_mut.move:10:13 - │ - 5 │ public struct Box { value: u64 } - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - 6 │ - 7 │ public fun test(b: Box): u64 { - │ --- The type '0x42::m::Box' does not have the ability 'drop' - · -10 │ _ => 10, - │ ^ Cannot ignore values without the 'drop' ability. '_' patterns discard their values - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/matching/invalid_const_mut.move:14:16 - │ - 7 │ public fun test(b: Box): u64 { - │ ---- Alias previously defined here - · -14 │ public fun test(b: &Box): u64 { - │ ^^^^ Duplicate module member or alias 'test'. Top level names in a namespace must be unique - -error[E02010]: invalid name - ┌─ tests/move_2024/matching/invalid_const_mut.move:16:26 - │ -16 │ Box { value: mut ZERO } => ZERO, - │ ^^^ ---- Expected a valid 'enum' variant, 'struct', or 'const', not a variable - │ │ - │ 'mut' can only be used with variable bindings in patterns - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/matching/invalid_const_mut.move:21:16 - │ -14 │ public fun test(b: &Box): u64 { - │ ---- Alias previously defined here - · -21 │ public fun test(b: &mut Box): u64 { - │ ^^^^ Duplicate module member or alias 'test'. Top level names in a namespace must be unique - -error[E02010]: invalid name - ┌─ tests/move_2024/matching/invalid_const_mut.move:23:26 - │ -23 │ Box { value: mut ZERO } => ZERO, - │ ^^^ ---- Expected a valid 'enum' variant, 'struct', or 'const', not a variable - │ │ - │ 'mut' can only be used with variable bindings in patterns - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_const_mut.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_const_mut.snap new file mode 100644 index 0000000000000..9727171019e65 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_const_mut.snap @@ -0,0 +1,61 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_const_mut.move +--- +error[E02010]: invalid name + ┌─ tests/move_2024/matching/invalid_const_mut.move:9:26 + │ +9 │ Box { value: mut ZERO } => ZERO, + │ ^^^ ---- Expected a valid 'enum' variant, 'struct', or 'const', not a variable + │ │ + │ 'mut' can only be used with variable bindings in patterns + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/matching/invalid_const_mut.move:10:13 + │ + 5 │ public struct Box { value: u64 } + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + 6 │ + 7 │ public fun test(b: Box): u64 { + │ --- The type '0x42::m::Box' does not have the ability 'drop' + · +10 │ _ => 10, + │ ^ Cannot ignore values without the 'drop' ability. '_' patterns discard their values + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/matching/invalid_const_mut.move:14:16 + │ + 7 │ public fun test(b: Box): u64 { + │ ---- Alias previously defined here + · +14 │ public fun test(b: &Box): u64 { + │ ^^^^ Duplicate module member or alias 'test'. Top level names in a namespace must be unique + +error[E02010]: invalid name + ┌─ tests/move_2024/matching/invalid_const_mut.move:16:26 + │ +16 │ Box { value: mut ZERO } => ZERO, + │ ^^^ ---- Expected a valid 'enum' variant, 'struct', or 'const', not a variable + │ │ + │ 'mut' can only be used with variable bindings in patterns + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/matching/invalid_const_mut.move:21:16 + │ +14 │ public fun test(b: &Box): u64 { + │ ---- Alias previously defined here + · +21 │ public fun test(b: &mut Box): u64 { + │ ^^^^ Duplicate module member or alias 'test'. Top level names in a namespace must be unique + +error[E02010]: invalid name + ┌─ tests/move_2024/matching/invalid_const_mut.move:23:26 + │ +23 │ Box { value: mut ZERO } => ZERO, + │ ^^^ ---- Expected a valid 'enum' variant, 'struct', or 'const', not a variable + │ │ + │ 'mut' can only be used with variable bindings in patterns diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_const_name_match.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_const_name_match.exp deleted file mode 100644 index 705fb74e9ee02..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_const_name_match.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E02010]: invalid name - ┌─ tests/move_2024/matching/invalid_const_name_match.move:9:20 - │ -9 │ S { n: Z } => 0, - │ ^ Invalid pattern variable name 'Z'. Pattern variable names must start with 'a'..'z' or '_' - │ - = The compiler may have failed to resolve this constant's name - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_const_name_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_const_name_match.snap new file mode 100644 index 0000000000000..6b627ac9009d8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_const_name_match.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_const_name_match.move +--- +error[E02010]: invalid name + ┌─ tests/move_2024/matching/invalid_const_name_match.move:9:20 + │ +9 │ S { n: Z } => 0, + │ ^ Invalid pattern variable name 'Z'. Pattern variable names must start with 'a'..'z' or '_' + │ + = The compiler may have failed to resolve this constant's name diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_ctor.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_ctor.exp deleted file mode 100644 index ae0654a4c5d0c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_ctor.exp +++ /dev/null @@ -1,22 +0,0 @@ -error[E03013]: positional call mismatch - ┌─ tests/move_2024/matching/invalid_empty_ctor.move:8:18 - │ -4 │ None - │ ---- 'None' is declared here - · -8 │ let _x = Empty::None { }; - │ ^^^^^^^^^^^^^^^ Invalid variant instantiation. Empty variant declarations require empty instantiations - │ - = Remove '{ }' arguments from this instantiation - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/matching/invalid_empty_ctor.move:9:18 - │ -4 │ None - │ ---- 'None' is declared here - · -9 │ let _x = Empty::None(); - │ ^^^^^^^^^^^^^ Invalid variant instantiation. Empty variant declarations require empty instantiations - │ - = Remove '()' arguments from this instantiation - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_ctor.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_ctor.snap new file mode 100644 index 0000000000000..b93d41f85bf08 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_ctor.snap @@ -0,0 +1,29 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_empty_ctor.move +--- +error[E03013]: positional call mismatch + ┌─ tests/move_2024/matching/invalid_empty_ctor.move:8:18 + │ +4 │ None + │ ---- 'None' is declared here + · +8 │ let _x = Empty::None { }; + │ ^^^^^^^^^^^^^^^ Invalid variant instantiation. Empty variant declarations require empty instantiations + │ + = Remove '{ }' arguments from this instantiation + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/matching/invalid_empty_ctor.move:9:18 + │ +4 │ None + │ ---- 'None' is declared here + · +9 │ let _x = Empty::None(); + │ ^^^^^^^^^^^^^ Invalid variant instantiation. Empty variant declarations require empty instantiations + │ + = Remove '()' arguments from this instantiation diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_enum.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_enum.exp deleted file mode 100644 index 9aaa6bf1a8c5b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_enum.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E02022]: invalid 'enum' declaration - ┌─ tests/move_2024/matching/invalid_empty_enum.move:2:5 - │ -2 │ ╭ public enum Empty { -3 │ │ -4 │ │ } - │ ╰─────^ An 'enum' must define at least one variant - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_enum.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_enum.snap new file mode 100644 index 0000000000000..2c7491550e144 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_enum.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_empty_enum.move +--- +error[E02022]: invalid 'enum' declaration + ┌─ tests/move_2024/matching/invalid_empty_enum.move:2:5 + │ +2 │ ╭ public enum Empty { +3 │ │ +4 │ │ } + │ ╰─────^ An 'enum' must define at least one variant diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_match.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_match.exp deleted file mode 100644 index 3d5e04070ade5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_match.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/invalid_empty_match.move:7:16 - │ -7 │ match (e) { - │ ^ Pattern '_' not covered - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/invalid_empty_match.move:17:16 - │ -17 │ match (e) { - │ ^ Pattern '_' not covered - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_match.snap new file mode 100644 index 0000000000000..6f347c39a7793 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_match.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_empty_match.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/invalid_empty_match.move:7:16 + │ +7 │ match (e) { + │ ^ Pattern '_' not covered + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/invalid_empty_match.move:17:16 + │ +17 │ match (e) { + │ ^ Pattern '_' not covered diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_match_2.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_match_2.exp deleted file mode 100644 index d217a9fa767e6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_match_2.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[E03013]: positional call mismatch - ┌─ tests/move_2024/matching/invalid_empty_match_2.move:9:13 - │ -4 │ None - │ ---- 'None' is declared here - · -9 │ Empty::None() => () - │ ^^^^^^^^^^^^^ Invalid variant pattern. Empty variant declarations require empty patterns - │ - = Remove '()' arguments from this pattern - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_match_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_match_2.snap new file mode 100644 index 0000000000000..eb7067b8a3805 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_empty_match_2.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_empty_match_2.move +--- +error[E03013]: positional call mismatch + ┌─ tests/move_2024/matching/invalid_empty_match_2.move:9:13 + │ +4 │ None + │ ---- 'None' is declared here + · +9 │ Empty::None() => () + │ ^^^^^^^^^^^^^ Invalid variant pattern. Empty variant declarations require empty patterns + │ + = Remove '()' arguments from this pattern diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_head_ctor.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_head_ctor.exp deleted file mode 100644 index b3bdf7938f2c0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_head_ctor.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/invalid_head_ctor.move:9:13 - │ -9 │ Some(_) => (), - │ ^^^^ Unexpected name access. Expected a valid 'enum' variant, 'struct', or 'const'. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_head_ctor.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_head_ctor.snap new file mode 100644 index 0000000000000..6eacc7dfd1a1a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_head_ctor.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_head_ctor.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/invalid_head_ctor.move:9:13 + │ +9 │ Some(_) => (), + │ ^^^^ Unexpected name access. Expected a valid 'enum' variant, 'struct', or 'const'. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_head_ctor_2.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_head_ctor_2.exp deleted file mode 100644 index 6e639e84557a1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_head_ctor_2.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/invalid_head_ctor_2.move:9:13 - │ -9 │ a(_) => (), - │ ^ Unexpected name access. Expected a valid 'enum' variant, 'struct', or 'const'. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_head_ctor_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_head_ctor_2.snap new file mode 100644 index 0000000000000..7ed1c0e7053a9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_head_ctor_2.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_head_ctor_2.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/invalid_head_ctor_2.move:9:13 + │ +9 │ a(_) => (), + │ ^ Unexpected name access. Expected a valid 'enum' variant, 'struct', or 'const'. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_head_ctor_3.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_head_ctor_3.exp deleted file mode 100644 index 815b5fbf264f8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_head_ctor_3.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03022]: invalid usage position - ┌─ tests/move_2024/matching/invalid_head_ctor_3.move:16:13 - │ -16 │ l::a(_) => (), - │ ^^^^ Invalid module access. Expected a struct or enum, but found function 'a' in module '0x42::l' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_head_ctor_3.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_head_ctor_3.snap new file mode 100644 index 0000000000000..6dbb709d7871a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_head_ctor_3.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_head_ctor_3.move +--- +error[E03022]: invalid usage position + ┌─ tests/move_2024/matching/invalid_head_ctor_3.move:16:13 + │ +16 │ l::a(_) => (), + │ ^^^^ Invalid module access. Expected a struct or enum, but found function 'a' in module '0x42::l' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_incomplete_match.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_incomplete_match.exp deleted file mode 100644 index 7156b8e9f04de..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_incomplete_match.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/invalid_incomplete_match.move:13:16 - │ -13 │ match (x) { - │ ^ Pattern 'Tuple::Two(Maybe::Nothing, _)' not covered - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_incomplete_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_incomplete_match.snap new file mode 100644 index 0000000000000..4c2e352749ded --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_incomplete_match.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_incomplete_match.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/invalid_incomplete_match.move:13:16 + │ +13 │ match (x) { + │ ^ Pattern 'Tuple::Two(Maybe::Nothing, _)' not covered diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_literal.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_literal.exp deleted file mode 100644 index 99f8c9113cc44..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_literal.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/invalid_literal.move:8:16 - │ -8 │ match (opt) { - │ ^^^ Pattern 'Option::Some(_)' not covered - -error[E01006]: invalid number literal - ┌─ tests/move_2024/matching/invalid_literal.move:9:26 - │ -9 │ Option::Some(256u8) => (), - │ ^^^^^ Invalid number literal. The given literal is too large to fit into 'u8' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_literal.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_literal.snap new file mode 100644 index 0000000000000..14b1687aee02e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_literal.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_literal.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/invalid_literal.move:8:16 + │ +8 │ match (opt) { + │ ^^^ Pattern 'Option::Some(_)' not covered + +error[E01006]: invalid number literal + ┌─ tests/move_2024/matching/invalid_literal.move:9:26 + │ +9 │ Option::Some(256u8) => (), + │ ^^^^^ Invalid number literal. The given literal is too large to fit into 'u8' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_literal_2.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_literal_2.exp deleted file mode 100644 index 005d960c2a33b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_literal_2.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/invalid_literal_2.move:9:13 - │ -7 │ fun test(opt: &Option) { - │ -- Expected: 'u8' -8 │ match (opt) { -9 │ Option::Some(false) => (), - │ ^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid pattern - -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/invalid_literal_2.move:10:13 - │ - 7 │ fun test(opt: &Option) { - │ -- Expected: 'u8' - · -10 │ Option::Some(true) => (), - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid pattern - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_literal_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_literal_2.snap new file mode 100644 index 0000000000000..ef2abad026e28 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_literal_2.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_literal_2.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/invalid_literal_2.move:9:13 + │ +7 │ fun test(opt: &Option) { + │ -- Expected: 'u8' +8 │ match (opt) { +9 │ Option::Some(false) => (), + │ ^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid pattern + +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/invalid_literal_2.move:10:13 + │ + 7 │ fun test(opt: &Option) { + │ -- Expected: 'u8' + · +10 │ Option::Some(true) => (), + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid pattern diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_match_lhs.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_match_lhs.exp deleted file mode 100644 index b56d2d65de942..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_match_lhs.exp +++ /dev/null @@ -1,17 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_2024/matching/invalid_match_lhs.move:8:10 - │ -8 │ fun test(z: &mut Maybe) { - │ ^ Unused parameter 'z'. Consider removing or prefixing with an underscore: '_z' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/invalid_match_lhs.move:9:9 - │ -9 │ let { match (z) { Maybe::Just(n) => n, Maybe::Nothing => abort 0 } } = 5; - │ ^ - │ │ - │ Unexpected '{' - │ Expected a variable or struct name - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_match_lhs.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_match_lhs.snap new file mode 100644 index 0000000000000..5fa39d7fb9105 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_match_lhs.snap @@ -0,0 +1,24 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_match_lhs.move +--- +warning[W09002]: unused variable + ┌─ tests/move_2024/matching/invalid_match_lhs.move:8:10 + │ +8 │ fun test(z: &mut Maybe) { + │ ^ Unused parameter 'z'. Consider removing or prefixing with an underscore: '_z' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/invalid_match_lhs.move:9:9 + │ +9 │ let { match (z) { Maybe::Just(n) => n, Maybe::Nothing => abort 0 } } = 5; + │ ^ + │ │ + │ Unexpected '{' + │ Expected a variable or struct name diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_match_tuple.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_match_tuple.exp deleted file mode 100644 index 3ae3051767d79..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_match_tuple.exp +++ /dev/null @@ -1,53 +0,0 @@ -error[E04005]: expected a single type - ┌─ tests/move_2024/matching/invalid_match_tuple.move:6:16 - │ -3 │ fun x(): (u64, u64) { (0, 42) } - │ ---------- Expected a single type, but found expression list type: '(u64, u64)' - · -6 │ match (x()) { - │ ^^^ Invalid 'match' subject - -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/invalid_match_tuple.move:7:15 - │ -7 │ (x, y) => () - │ ^ - │ │ - │ Unexpected ',' - │ Expected ')' - -warning[W09002]: unused variable - ┌─ tests/move_2024/matching/invalid_match_tuple.move:7:17 - │ -7 │ (x, y) => () - │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04005]: expected a single type - ┌─ tests/move_2024/matching/invalid_match_tuple.move:7:17 - │ -3 │ fun x(): (u64, u64) { (0, 42) } - │ ---------- Expected a single type, but found expression list type: '(u64, u64)' - · -7 │ (x, y) => () - │ ^ Invalid type for pattern - -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/invalid_match_tuple.move:7:18 - │ -7 │ (x, y) => () - │ ^ - │ │ - │ Unexpected ')' - │ Expected '=>' - -error[E04005]: expected a single type - ┌─ tests/move_2024/matching/invalid_match_tuple.move:12:16 - │ - 3 │ fun x(): (u64, u64) { (0, 42) } - │ ---------- Expected a single type, but found expression list type: '(u64, u64)' - · -12 │ match (x()) { - │ ^^^ Invalid 'match' subject - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_match_tuple.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_match_tuple.snap new file mode 100644 index 0000000000000..2c9169b122d77 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_match_tuple.snap @@ -0,0 +1,60 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_match_tuple.move +--- +error[E04005]: expected a single type + ┌─ tests/move_2024/matching/invalid_match_tuple.move:6:16 + │ +3 │ fun x(): (u64, u64) { (0, 42) } + │ ---------- Expected a single type, but found expression list type: '(u64, u64)' + · +6 │ match (x()) { + │ ^^^ Invalid 'match' subject + +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/invalid_match_tuple.move:7:15 + │ +7 │ (x, y) => () + │ ^ + │ │ + │ Unexpected ',' + │ Expected ')' + +warning[W09002]: unused variable + ┌─ tests/move_2024/matching/invalid_match_tuple.move:7:17 + │ +7 │ (x, y) => () + │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04005]: expected a single type + ┌─ tests/move_2024/matching/invalid_match_tuple.move:7:17 + │ +3 │ fun x(): (u64, u64) { (0, 42) } + │ ---------- Expected a single type, but found expression list type: '(u64, u64)' + · +7 │ (x, y) => () + │ ^ Invalid type for pattern + +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/invalid_match_tuple.move:7:18 + │ +7 │ (x, y) => () + │ ^ + │ │ + │ Unexpected ')' + │ Expected '=>' + +error[E04005]: expected a single type + ┌─ tests/move_2024/matching/invalid_match_tuple.move:12:16 + │ + 3 │ fun x(): (u64, u64) { (0, 42) } + │ ---------- Expected a single type, but found expression list type: '(u64, u64)' + · +12 │ match (x()) { + │ ^^^ Invalid 'match' subject diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_match_unit.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_match_unit.exp deleted file mode 100644 index bfc4851188aaf..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_match_unit.exp +++ /dev/null @@ -1,30 +0,0 @@ -error[E04005]: expected a single type - ┌─ tests/move_2024/matching/invalid_match_unit.move:6:16 - │ -3 │ fun x() { } - │ - Expected a single type, but found expression list type: '()' - · -6 │ match (x()) { - │ ^^^ Invalid 'match' subject - -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/invalid_match_unit.move:6:16 - │ -6 │ match (x()) { - │ ^^^ Pattern '_' not covered - -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/invalid_match_unit.move:7:14 - │ -7 │ () => () - │ ^ Invalid pattern - -error[E04005]: expected a single type - ┌─ tests/move_2024/matching/invalid_match_unit.move:12:16 - │ - 3 │ fun x() { } - │ - Expected a single type, but found expression list type: '()' - · -12 │ match (x()) { - │ ^^^ Invalid 'match' subject - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_match_unit.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_match_unit.snap new file mode 100644 index 0000000000000..34bcb439da22a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_match_unit.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_match_unit.move +--- +error[E04005]: expected a single type + ┌─ tests/move_2024/matching/invalid_match_unit.move:6:16 + │ +3 │ fun x() { } + │ - Expected a single type, but found expression list type: '()' + · +6 │ match (x()) { + │ ^^^ Invalid 'match' subject + +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/invalid_match_unit.move:6:16 + │ +6 │ match (x()) { + │ ^^^ Pattern '_' not covered + +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/invalid_match_unit.move:7:14 + │ +7 │ () => () + │ ^ Invalid pattern + +error[E04005]: expected a single type + ┌─ tests/move_2024/matching/invalid_match_unit.move:12:16 + │ + 3 │ fun x() { } + │ - Expected a single type, but found expression list type: '()' + · +12 │ match (x()) { + │ ^^^ Invalid 'match' subject diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut.exp deleted file mode 100644 index 63b459824bdcb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut.exp +++ /dev/null @@ -1,30 +0,0 @@ -error[E02010]: invalid name - ┌─ tests/move_2024/matching/invalid_mut.move:10:13 - │ -10 │ mut Maybe::Nothing => (), - │ ^^^ -------------- Expected a valid 'enum' variant, 'struct', or 'const', not a variable - │ │ - │ 'mut' can only be used with variable bindings in patterns - -warning[W09002]: unused variable - ┌─ tests/move_2024/matching/invalid_mut.move:11:17 - │ -11 │ mut x => (), - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02010]: invalid name - ┌─ tests/move_2024/matching/invalid_mut.move:11:17 - │ -11 │ mut x => (), - │ ^ Invalid type arguments on a pattern variable - │ - = Type arguments cannot appear on pattern variables - -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/invalid_mut.move:12:13 - │ -12 │ mut Maybe::Just(_) => (), - │ ^^^ Invalid 'mut' keyword on non-variable pattern - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut.snap new file mode 100644 index 0000000000000..536cf5f470eb5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_mut.move +--- +error[E02010]: invalid name + ┌─ tests/move_2024/matching/invalid_mut.move:10:13 + │ +10 │ mut Maybe::Nothing => (), + │ ^^^ -------------- Expected a valid 'enum' variant, 'struct', or 'const', not a variable + │ │ + │ 'mut' can only be used with variable bindings in patterns + +warning[W09002]: unused variable + ┌─ tests/move_2024/matching/invalid_mut.move:11:17 + │ +11 │ mut x => (), + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02010]: invalid name + ┌─ tests/move_2024/matching/invalid_mut.move:11:17 + │ +11 │ mut x => (), + │ ^ Invalid type arguments on a pattern variable + │ + = Type arguments cannot appear on pattern variables + +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/invalid_mut.move:12:13 + │ +12 │ mut Maybe::Just(_) => (), + │ ^^^ Invalid 'mut' keyword on non-variable pattern diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut_2.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut_2.exp deleted file mode 100644 index a5fdd65bf3ae6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut_2.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/invalid_mut_2.move:9:16 - │ -9 │ match (m) { - │ ^ Pattern 'Maybe::Nothing' not covered - -error[E02010]: invalid name - ┌─ tests/move_2024/matching/invalid_mut_2.move:10:13 - │ -10 │ mut Maybe::Nothing => (), - │ ^^^ -------------- Expected a valid 'enum' variant, 'struct', or 'const', not a variable - │ │ - │ 'mut' can only be used with variable bindings in patterns - -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/invalid_mut_2.move:11:13 - │ -11 │ mut Maybe::Just(_) => (), - │ ^^^ Invalid 'mut' keyword on non-variable pattern - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut_2.snap new file mode 100644 index 0000000000000..e4c693becd948 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut_2.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_mut_2.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/invalid_mut_2.move:9:16 + │ +9 │ match (m) { + │ ^ Pattern 'Maybe::Nothing' not covered + +error[E02010]: invalid name + ┌─ tests/move_2024/matching/invalid_mut_2.move:10:13 + │ +10 │ mut Maybe::Nothing => (), + │ ^^^ -------------- Expected a valid 'enum' variant, 'struct', or 'const', not a variable + │ │ + │ 'mut' can only be used with variable bindings in patterns + +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/invalid_mut_2.move:11:13 + │ +11 │ mut Maybe::Just(_) => (), + │ ^^^ Invalid 'mut' keyword on non-variable pattern diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut_3.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut_3.exp deleted file mode 100644 index 498b5e028f64f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut_3.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/invalid_mut_3.move:9:16 - │ -9 │ match (m) { - │ ^ Pattern 'Maybe::Nothing' not covered - -error[E02010]: invalid name - ┌─ tests/move_2024/matching/invalid_mut_3.move:10:13 - │ -10 │ mut Maybe::Nothing => (), - │ ^^^ -------------- Expected a valid 'enum' variant, 'struct', or 'const', not a variable - │ │ - │ 'mut' can only be used with variable bindings in patterns - -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/invalid_mut_3.move:11:13 - │ -11 │ mut Maybe::Just(_) => (), - │ ^^^ Invalid 'mut' keyword on non-variable pattern - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut_3.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut_3.snap new file mode 100644 index 0000000000000..9c9f1eec97331 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut_3.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_mut_3.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/invalid_mut_3.move:9:16 + │ +9 │ match (m) { + │ ^ Pattern 'Maybe::Nothing' not covered + +error[E02010]: invalid name + ┌─ tests/move_2024/matching/invalid_mut_3.move:10:13 + │ +10 │ mut Maybe::Nothing => (), + │ ^^^ -------------- Expected a valid 'enum' variant, 'struct', or 'const', not a variable + │ │ + │ 'mut' can only be used with variable bindings in patterns + +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/invalid_mut_3.move:11:13 + │ +11 │ mut Maybe::Just(_) => (), + │ ^^^ Invalid 'mut' keyword on non-variable pattern diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut_4.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut_4.exp deleted file mode 100644 index 8d1e54dff542b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut_4.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/invalid_mut_4.move:9:16 - │ -9 │ match (m) { - │ ^ Pattern 'Maybe::Nothing' not covered - -error[E02010]: invalid name - ┌─ tests/move_2024/matching/invalid_mut_4.move:10:13 - │ -10 │ mut Maybe::Nothing => (), - │ ^^^ -------------- Expected a valid 'enum' variant, 'struct', or 'const', not a variable - │ │ - │ 'mut' can only be used with variable bindings in patterns - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut_4.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut_4.snap new file mode 100644 index 0000000000000..26300a4eefe7c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_mut_4.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_mut_4.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/invalid_mut_4.move:9:16 + │ +9 │ match (m) { + │ ^ Pattern 'Maybe::Nothing' not covered + +error[E02010]: invalid name + ┌─ tests/move_2024/matching/invalid_mut_4.move:10:13 + │ +10 │ mut Maybe::Nothing => (), + │ ^^^ -------------- Expected a valid 'enum' variant, 'struct', or 'const', not a variable + │ │ + │ 'mut' can only be used with variable bindings in patterns diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_named_ctor.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_named_ctor.exp deleted file mode 100644 index ce2b7e1335a8a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_named_ctor.exp +++ /dev/null @@ -1,34 +0,0 @@ -error[E03013]: positional call mismatch - ┌─ tests/move_2024/matching/invalid_named_ctor.move:8:18 - │ -4 │ E { x : u64 } - │ ------------- 'E' is declared here - · -8 │ let _x = Entry::E; - │ ^^^^^^^^ Invalid variant instantiation. Named variant declarations require named instantiations - │ - = Named instantiations take arguments using '{ }' - -error[E04016]: too few arguments - ┌─ tests/move_2024/matching/invalid_named_ctor.move:8:18 - │ -8 │ let _x = Entry::E; - │ ^^^^^^^^ Missing argument for field 'x' in '0x42::m::Entry::E' - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/matching/invalid_named_ctor.move:9:18 - │ -4 │ E { x : u64 } - │ ------------- 'E' is declared here - · -9 │ let _x = Entry::E(); - │ ^^^^^^^^^^ Invalid variant instantiation. Named variant declarations require named instantiations - │ - = Named instantiations take arguments using '{ }' - -error[E04016]: too few arguments - ┌─ tests/move_2024/matching/invalid_named_ctor.move:9:18 - │ -9 │ let _x = Entry::E(); - │ ^^^^^^^^^^ Missing argument for field 'x' in '0x42::m::Entry::E' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_named_ctor.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_named_ctor.snap new file mode 100644 index 0000000000000..a4b1acd0b3cc0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_named_ctor.snap @@ -0,0 +1,41 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_named_ctor.move +--- +error[E03013]: positional call mismatch + ┌─ tests/move_2024/matching/invalid_named_ctor.move:8:18 + │ +4 │ E { x : u64 } + │ ------------- 'E' is declared here + · +8 │ let _x = Entry::E; + │ ^^^^^^^^ Invalid variant instantiation. Named variant declarations require named instantiations + │ + = Named instantiations take arguments using '{ }' + +error[E04016]: too few arguments + ┌─ tests/move_2024/matching/invalid_named_ctor.move:8:18 + │ +8 │ let _x = Entry::E; + │ ^^^^^^^^ Missing argument for field 'x' in '0x42::m::Entry::E' + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/matching/invalid_named_ctor.move:9:18 + │ +4 │ E { x : u64 } + │ ------------- 'E' is declared here + · +9 │ let _x = Entry::E(); + │ ^^^^^^^^^^ Invalid variant instantiation. Named variant declarations require named instantiations + │ + = Named instantiations take arguments using '{ }' + +error[E04016]: too few arguments + ┌─ tests/move_2024/matching/invalid_named_ctor.move:9:18 + │ +9 │ let _x = Entry::E(); + │ ^^^^^^^^^^ Missing argument for field 'x' in '0x42::m::Entry::E' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_named_match.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_named_match.exp deleted file mode 100644 index 1e3889e3d2a6b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_named_match.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04016]: too few arguments - ┌─ tests/move_2024/matching/invalid_named_match.move:9:13 - │ -9 │ Entry::One => () - │ ^^^^^^^^^^ Missing pattern for field 'x' in '0x42::m::Entry::One' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_named_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_named_match.snap new file mode 100644 index 0000000000000..fdd03c1cc7ab4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_named_match.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_named_match.move +--- +error[E04016]: too few arguments + ┌─ tests/move_2024/matching/invalid_named_match.move:9:13 + │ +9 │ Entry::One => () + │ ^^^^^^^^^^ Missing pattern for field 'x' in '0x42::m::Entry::One' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_named_match_2.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_named_match_2.exp deleted file mode 100644 index aa2da55f42d6c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_named_match_2.exp +++ /dev/null @@ -1,31 +0,0 @@ -error[E03013]: positional call mismatch - ┌─ tests/move_2024/matching/invalid_named_match_2.move:9:13 - │ -4 │ One { x: u64 } - │ -------------- 'One' is declared here - · -9 │ Entry::One(x) => () - │ ^^^^^^^^^^^^^ Invalid variant pattern. Named variant declarations require named patterns - │ - = Named patterns take arguments using '{ }' - -error[E03010]: unbound field - ┌─ tests/move_2024/matching/invalid_named_match_2.move:9:13 - │ -9 │ Entry::One(x) => () - │ ^^^^^^^^^^^^^ Unbound field '0' in '0x42::m::Entry::One' - -error[E04016]: too few arguments - ┌─ tests/move_2024/matching/invalid_named_match_2.move:9:13 - │ -9 │ Entry::One(x) => () - │ ^^^^^^^^^^^^^ Missing pattern for field 'x' in '0x42::m::Entry::One' - -warning[W09002]: unused variable - ┌─ tests/move_2024/matching/invalid_named_match_2.move:9:24 - │ -9 │ Entry::One(x) => () - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_named_match_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_named_match_2.snap new file mode 100644 index 0000000000000..f098ff4a6d1f9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_named_match_2.snap @@ -0,0 +1,38 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_named_match_2.move +--- +error[E03013]: positional call mismatch + ┌─ tests/move_2024/matching/invalid_named_match_2.move:9:13 + │ +4 │ One { x: u64 } + │ -------------- 'One' is declared here + · +9 │ Entry::One(x) => () + │ ^^^^^^^^^^^^^ Invalid variant pattern. Named variant declarations require named patterns + │ + = Named patterns take arguments using '{ }' + +error[E03010]: unbound field + ┌─ tests/move_2024/matching/invalid_named_match_2.move:9:13 + │ +9 │ Entry::One(x) => () + │ ^^^^^^^^^^^^^ Unbound field '0' in '0x42::m::Entry::One' + +error[E04016]: too few arguments + ┌─ tests/move_2024/matching/invalid_named_match_2.move:9:13 + │ +9 │ Entry::One(x) => () + │ ^^^^^^^^^^^^^ Missing pattern for field 'x' in '0x42::m::Entry::One' + +warning[W09002]: unused variable + ┌─ tests/move_2024/matching/invalid_named_match_2.move:9:24 + │ +9 │ Entry::One(x) => () + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding.exp deleted file mode 100644 index fa4152e0ab386..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[E03019]: invalid pattern - ┌─ tests/move_2024/matching/invalid_or_binding.move:9:24 - │ -9 │ Two::Tuple(x, _) | Two::Tuple(_, _y) => { let _y = x; }, - │ ^ ----------------- right or-pattern does not - │ │ - │ left or-pattern binds variable x - │ - = Both sides of an or-pattern must bind the same variables. - -error[E03019]: invalid pattern - ┌─ tests/move_2024/matching/invalid_or_binding.move:9:46 - │ -9 │ Two::Tuple(x, _) | Two::Tuple(_, _y) => { let _y = x; }, - │ ---------------- ^^ right or-pattern binds variable _y - │ │ - │ left or-pattern does not - │ - = Both sides of an or-pattern must bind the same variables. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding.snap new file mode 100644 index 0000000000000..0bb94c2105db7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_or_binding.move +--- +error[E03019]: invalid pattern + ┌─ tests/move_2024/matching/invalid_or_binding.move:9:24 + │ +9 │ Two::Tuple(x, _) | Two::Tuple(_, _y) => { let _y = x; }, + │ ^ ----------------- right or-pattern does not + │ │ + │ left or-pattern binds variable x + │ + = Both sides of an or-pattern must bind the same variables. + +error[E03019]: invalid pattern + ┌─ tests/move_2024/matching/invalid_or_binding.move:9:46 + │ +9 │ Two::Tuple(x, _) | Two::Tuple(_, _y) => { let _y = x; }, + │ ---------------- ^^ right or-pattern binds variable _y + │ │ + │ left or-pattern does not + │ + = Both sides of an or-pattern must bind the same variables. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding_2.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding_2.exp deleted file mode 100644 index c19603e07bab1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding_2.exp +++ /dev/null @@ -1,38 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_2024/matching/invalid_or_binding_2.move:9:53 - │ -9 │ Three::Tuple(x, _, _) | Three::Tuple(_, y, _) | Three::Tuple(_, _, x) => { let _y = x; }, - │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03019]: invalid pattern - ┌─ tests/move_2024/matching/invalid_or_binding_2.move:9:53 - │ -9 │ Three::Tuple(x, _, _) | Three::Tuple(_, y, _) | Three::Tuple(_, _, x) => { let _y = x; }, - │ ^ --------------------- right or-pattern does not - │ │ - │ left or-pattern binds variable y - │ - = Both sides of an or-pattern must bind the same variables. - -error[E03019]: invalid pattern - ┌─ tests/move_2024/matching/invalid_or_binding_2.move:9:53 - │ -9 │ Three::Tuple(x, _, _) | Three::Tuple(_, y, _) | Three::Tuple(_, _, x) => { let _y = x; }, - │ --------------------- ^ right or-pattern binds variable y - │ │ - │ left or-pattern does not - │ - = Both sides of an or-pattern must bind the same variables. - -error[E03019]: invalid pattern - ┌─ tests/move_2024/matching/invalid_or_binding_2.move:9:80 - │ -9 │ Three::Tuple(x, _, _) | Three::Tuple(_, y, _) | Three::Tuple(_, _, x) => { let _y = x; }, - │ --------------------- ^ right or-pattern binds variable x - │ │ - │ left or-pattern does not - │ - = Both sides of an or-pattern must bind the same variables. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding_2.snap new file mode 100644 index 0000000000000..4ec7d42aec4bc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding_2.snap @@ -0,0 +1,45 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_or_binding_2.move +--- +warning[W09002]: unused variable + ┌─ tests/move_2024/matching/invalid_or_binding_2.move:9:53 + │ +9 │ Three::Tuple(x, _, _) | Three::Tuple(_, y, _) | Three::Tuple(_, _, x) => { let _y = x; }, + │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03019]: invalid pattern + ┌─ tests/move_2024/matching/invalid_or_binding_2.move:9:53 + │ +9 │ Three::Tuple(x, _, _) | Three::Tuple(_, y, _) | Three::Tuple(_, _, x) => { let _y = x; }, + │ ^ --------------------- right or-pattern does not + │ │ + │ left or-pattern binds variable y + │ + = Both sides of an or-pattern must bind the same variables. + +error[E03019]: invalid pattern + ┌─ tests/move_2024/matching/invalid_or_binding_2.move:9:53 + │ +9 │ Three::Tuple(x, _, _) | Three::Tuple(_, y, _) | Three::Tuple(_, _, x) => { let _y = x; }, + │ --------------------- ^ right or-pattern binds variable y + │ │ + │ left or-pattern does not + │ + = Both sides of an or-pattern must bind the same variables. + +error[E03019]: invalid pattern + ┌─ tests/move_2024/matching/invalid_or_binding_2.move:9:80 + │ +9 │ Three::Tuple(x, _, _) | Three::Tuple(_, y, _) | Three::Tuple(_, _, x) => { let _y = x; }, + │ --------------------- ^ right or-pattern binds variable x + │ │ + │ left or-pattern does not + │ + = Both sides of an or-pattern must bind the same variables. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding_3.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding_3.exp deleted file mode 100644 index ae3ad49d77348..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding_3.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/invalid_or_binding_3.move:9:12 - │ -9 │ match (e) { - │ ^ Pattern 'E::Y { y: _ }' not covered - -error[E03010]: unbound field - ┌─ tests/move_2024/matching/invalid_or_binding_3.move:10:22 - │ -10 │ E::X { x } | E::Y { y: _, x } => *x - │ ^^^^^^^^^^^^^^^^ Unbound field 'x' in '0x42::m::E::Y' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding_3.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding_3.snap new file mode 100644 index 0000000000000..f860b092a126d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding_3.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_or_binding_3.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/invalid_or_binding_3.move:9:12 + │ +9 │ match (e) { + │ ^ Pattern 'E::Y { y: _ }' not covered + +error[E03010]: unbound field + ┌─ tests/move_2024/matching/invalid_or_binding_3.move:10:22 + │ +10 │ E::X { x } | E::Y { y: _, x } => *x + │ ^^^^^^^^^^^^^^^^ Unbound field 'x' in '0x42::m::E::Y' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding_4.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding_4.exp deleted file mode 100644 index 83419491bee53..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding_4.exp +++ /dev/null @@ -1,28 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_2024/matching/invalid_or_binding_4.move:11:19 - │ -11 │ E::X { x: y } | E::Y(x) | E::Z { z: x } => *x - │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03019]: invalid pattern - ┌─ tests/move_2024/matching/invalid_or_binding_4.move:11:19 - │ -11 │ E::X { x: y } | E::Y(x) | E::Z { z: x } => *x - │ ^ ----------------------- right or-pattern does not - │ │ - │ left or-pattern binds variable y - │ - = Both sides of an or-pattern must bind the same variables. - -error[E03019]: invalid pattern - ┌─ tests/move_2024/matching/invalid_or_binding_4.move:11:30 - │ -11 │ E::X { x: y } | E::Y(x) | E::Z { z: x } => *x - │ ------------- ^ right or-pattern binds variable x - │ │ - │ left or-pattern does not - │ - = Both sides of an or-pattern must bind the same variables. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding_4.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding_4.snap new file mode 100644 index 0000000000000..6b10dff90fe38 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_binding_4.snap @@ -0,0 +1,35 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_or_binding_4.move +--- +warning[W09002]: unused variable + ┌─ tests/move_2024/matching/invalid_or_binding_4.move:11:19 + │ +11 │ E::X { x: y } | E::Y(x) | E::Z { z: x } => *x + │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03019]: invalid pattern + ┌─ tests/move_2024/matching/invalid_or_binding_4.move:11:19 + │ +11 │ E::X { x: y } | E::Y(x) | E::Z { z: x } => *x + │ ^ ----------------------- right or-pattern does not + │ │ + │ left or-pattern binds variable y + │ + = Both sides of an or-pattern must bind the same variables. + +error[E03019]: invalid pattern + ┌─ tests/move_2024/matching/invalid_or_binding_4.move:11:30 + │ +11 │ E::X { x: y } | E::Y(x) | E::Z { z: x } => *x + │ ------------- ^ right or-pattern binds variable x + │ │ + │ left or-pattern does not + │ + = Both sides of an or-pattern must bind the same variables. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_pattern.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_pattern.exp deleted file mode 100644 index 1842f8ab05e89..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_pattern.exp +++ /dev/null @@ -1,17 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/invalid_or_pattern.move:9:12 - │ -9 │ match (e) { - │ ^ Pattern 'E::Y' not covered - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/matching/invalid_or_pattern.move:10:22 - │ - 5 │ Y - │ - 'Y' is declared here - · -10 │ E::X { x } | E::Y { y: _, x } => *x - │ ^^^^^^^^^^^^^^^^ Invalid variant pattern. Empty variant declarations require empty patterns - │ - = Remove '{ }' arguments from this pattern - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_pattern.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_pattern.snap new file mode 100644 index 0000000000000..5c40934649978 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_pattern.snap @@ -0,0 +1,24 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_or_pattern.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/invalid_or_pattern.move:9:12 + │ +9 │ match (e) { + │ ^ Pattern 'E::Y' not covered + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/matching/invalid_or_pattern.move:10:22 + │ + 5 │ Y + │ - 'Y' is declared here + · +10 │ E::X { x } | E::Y { y: _, x } => *x + │ ^^^^^^^^^^^^^^^^ Invalid variant pattern. Empty variant declarations require empty patterns + │ + = Remove '{ }' arguments from this pattern diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types.exp deleted file mode 100644 index 2dba4ccee21e1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/invalid_or_types.move:10:24 - │ - 4 │ X(u64), - │ --- Given: 'u64' - 5 │ Y(u32) - │ --- Expected: 'u32' - · -10 │ E::X(x) | E::Y(x) => *x - │ ^ Invalid pattern field type - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types.snap new file mode 100644 index 0000000000000..eb833e0e9f2ab --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_or_types.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/invalid_or_types.move:10:24 + │ + 4 │ X(u64), + │ --- Given: 'u64' + 5 │ Y(u32) + │ --- Expected: 'u32' + · +10 │ E::X(x) | E::Y(x) => *x + │ ^ Invalid pattern field type diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types_2.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types_2.exp deleted file mode 100644 index 07790fd3e54ec..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types_2.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/invalid_or_types_2.move:10:35 - │ - 4 │ X { x: u64 }, - │ --- Given: 'u64' - 5 │ Y { y: u64, x: u32 } - │ --- Expected: 'u32' - · -10 │ E::X { x } | E::Y { y: _, x } => *x - │ ^ Invalid pattern field type - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types_2.snap new file mode 100644 index 0000000000000..5716c4b3622ef --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types_2.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_or_types_2.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/invalid_or_types_2.move:10:35 + │ + 4 │ X { x: u64 }, + │ --- Given: 'u64' + 5 │ Y { y: u64, x: u32 } + │ --- Expected: 'u32' + · +10 │ E::X { x } | E::Y { y: _, x } => *x + │ ^ Invalid pattern field type diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types_3.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types_3.exp deleted file mode 100644 index d19b356a5b4cb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types_3.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/invalid_or_types_3.move:10:30 - │ - 4 │ X { x: u64 }, - │ --- Given: 'u64' - 5 │ Y(u32) - │ --- Expected: 'u32' - · -10 │ E::X { x: y } | E::Y(y) => *y - │ ^ Invalid pattern field type - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types_3.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types_3.snap new file mode 100644 index 0000000000000..c18af2de5d107 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types_3.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_or_types_3.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/invalid_or_types_3.move:10:30 + │ + 4 │ X { x: u64 }, + │ --- Given: 'u64' + 5 │ Y(u32) + │ --- Expected: 'u32' + · +10 │ E::X { x: y } | E::Y(y) => *y + │ ^ Invalid pattern field type diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types_4.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types_4.exp deleted file mode 100644 index 055b1ca7d7fb3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types_4.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/invalid_or_types_4.move:11:30 - │ - 4 │ X { x: u64 }, - │ --- Given: 'u64' - 5 │ Y(u32), - │ --- Expected: 'u32' - · -11 │ E::X { x: y } | E::Y(y) | E::Z { z: y } => *y - │ ^ Invalid pattern field type - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types_4.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types_4.snap new file mode 100644 index 0000000000000..14a34532e3dca --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_or_types_4.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_or_types_4.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/invalid_or_types_4.move:11:30 + │ + 4 │ X { x: u64 }, + │ --- Given: 'u64' + 5 │ Y(u32), + │ --- Expected: 'u32' + · +11 │ E::X { x: y } | E::Y(y) | E::Z { z: y } => *y + │ ^ Invalid pattern field type diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_positional_ctor.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_positional_ctor.exp deleted file mode 100644 index 6531322b6e022..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_positional_ctor.exp +++ /dev/null @@ -1,40 +0,0 @@ -error[E03013]: positional call mismatch - ┌─ tests/move_2024/matching/invalid_positional_ctor.move:8:18 - │ -4 │ E(u64) - │ ------ 'E' is declared here - · -8 │ let _x = Entry::E; - │ ^^^^^^^^ Invalid variant instantiation. Positional variant declarations require positional instantiations - │ - = Positional instantiations take arguments using '()' - -error[E04016]: too few arguments - ┌─ tests/move_2024/matching/invalid_positional_ctor.move:8:18 - │ -8 │ let _x = Entry::E; - │ ^^^^^^^^ Missing argument for field '0' in '0x42::m::Entry::E' - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/matching/invalid_positional_ctor.move:9:18 - │ -4 │ E(u64) - │ ------ 'E' is declared here - · -9 │ let _x = Entry::E { x: 32 }; - │ ^^^^^^^^^^^^^^^^^^ Invalid variant instantiation. Positional variant declarations require positional instantiations - │ - = Positional instantiations take arguments using '()' - -error[E03010]: unbound field - ┌─ tests/move_2024/matching/invalid_positional_ctor.move:9:18 - │ -9 │ let _x = Entry::E { x: 32 }; - │ ^^^^^^^^^^^^^^^^^^ Unbound field 'x' in '0x42::m::Entry::E' - -error[E04016]: too few arguments - ┌─ tests/move_2024/matching/invalid_positional_ctor.move:9:18 - │ -9 │ let _x = Entry::E { x: 32 }; - │ ^^^^^^^^^^^^^^^^^^ Missing argument for field '0' in '0x42::m::Entry::E' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_positional_ctor.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_positional_ctor.snap new file mode 100644 index 0000000000000..230d6e0a68954 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_positional_ctor.snap @@ -0,0 +1,47 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_positional_ctor.move +--- +error[E03013]: positional call mismatch + ┌─ tests/move_2024/matching/invalid_positional_ctor.move:8:18 + │ +4 │ E(u64) + │ ------ 'E' is declared here + · +8 │ let _x = Entry::E; + │ ^^^^^^^^ Invalid variant instantiation. Positional variant declarations require positional instantiations + │ + = Positional instantiations take arguments using '()' + +error[E04016]: too few arguments + ┌─ tests/move_2024/matching/invalid_positional_ctor.move:8:18 + │ +8 │ let _x = Entry::E; + │ ^^^^^^^^ Missing argument for field '0' in '0x42::m::Entry::E' + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/matching/invalid_positional_ctor.move:9:18 + │ +4 │ E(u64) + │ ------ 'E' is declared here + · +9 │ let _x = Entry::E { x: 32 }; + │ ^^^^^^^^^^^^^^^^^^ Invalid variant instantiation. Positional variant declarations require positional instantiations + │ + = Positional instantiations take arguments using '()' + +error[E03010]: unbound field + ┌─ tests/move_2024/matching/invalid_positional_ctor.move:9:18 + │ +9 │ let _x = Entry::E { x: 32 }; + │ ^^^^^^^^^^^^^^^^^^ Unbound field 'x' in '0x42::m::Entry::E' + +error[E04016]: too few arguments + ┌─ tests/move_2024/matching/invalid_positional_ctor.move:9:18 + │ +9 │ let _x = Entry::E { x: 32 }; + │ ^^^^^^^^^^^^^^^^^^ Missing argument for field '0' in '0x42::m::Entry::E' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_positional_match.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_positional_match.exp deleted file mode 100644 index 3270f3b7176c6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_positional_match.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04016]: too few arguments - ┌─ tests/move_2024/matching/invalid_positional_match.move:9:13 - │ -9 │ Entry::One => () - │ ^^^^^^^^^^ Missing pattern for field '0' in '0x42::m::Entry::One' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_positional_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_positional_match.snap new file mode 100644 index 0000000000000..8761685616ae5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_positional_match.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_positional_match.move +--- +error[E04016]: too few arguments + ┌─ tests/move_2024/matching/invalid_positional_match.move:9:13 + │ +9 │ Entry::One => () + │ ^^^^^^^^^^ Missing pattern for field '0' in '0x42::m::Entry::One' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_positional_match_2.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_positional_match_2.exp deleted file mode 100644 index f889ea1534a70..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_positional_match_2.exp +++ /dev/null @@ -1,31 +0,0 @@ -error[E03013]: positional call mismatch - ┌─ tests/move_2024/matching/invalid_positional_match_2.move:9:13 - │ -4 │ One(u64) - │ -------- 'One' is declared here - · -9 │ Entry::One { x } => () - │ ^^^^^^^^^^^^^^^^ Invalid variant pattern. Positional variant declarations require positional patterns - │ - = Positional patterns take arguments using '()' - -error[E03010]: unbound field - ┌─ tests/move_2024/matching/invalid_positional_match_2.move:9:13 - │ -9 │ Entry::One { x } => () - │ ^^^^^^^^^^^^^^^^ Unbound field 'x' in '0x42::m::Entry::One' - -error[E04016]: too few arguments - ┌─ tests/move_2024/matching/invalid_positional_match_2.move:9:13 - │ -9 │ Entry::One { x } => () - │ ^^^^^^^^^^^^^^^^ Missing pattern for field '0' in '0x42::m::Entry::One' - -warning[W09002]: unused variable - ┌─ tests/move_2024/matching/invalid_positional_match_2.move:9:26 - │ -9 │ Entry::One { x } => () - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_positional_match_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_positional_match_2.snap new file mode 100644 index 0000000000000..278d3310b9d09 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_positional_match_2.snap @@ -0,0 +1,38 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_positional_match_2.move +--- +error[E03013]: positional call mismatch + ┌─ tests/move_2024/matching/invalid_positional_match_2.move:9:13 + │ +4 │ One(u64) + │ -------- 'One' is declared here + · +9 │ Entry::One { x } => () + │ ^^^^^^^^^^^^^^^^ Invalid variant pattern. Positional variant declarations require positional patterns + │ + = Positional patterns take arguments using '()' + +error[E03010]: unbound field + ┌─ tests/move_2024/matching/invalid_positional_match_2.move:9:13 + │ +9 │ Entry::One { x } => () + │ ^^^^^^^^^^^^^^^^ Unbound field 'x' in '0x42::m::Entry::One' + +error[E04016]: too few arguments + ┌─ tests/move_2024/matching/invalid_positional_match_2.move:9:13 + │ +9 │ Entry::One { x } => () + │ ^^^^^^^^^^^^^^^^ Missing pattern for field '0' in '0x42::m::Entry::One' + +warning[W09002]: unused variable + ┌─ tests/move_2024/matching/invalid_positional_match_2.move:9:26 + │ +9 │ Entry::One { x } => () + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_raw_variant_name.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_raw_variant_name.exp deleted file mode 100644 index 3d913a1831e86..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_raw_variant_name.exp +++ /dev/null @@ -1,33 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/invalid_raw_variant_name.move:10:12 - │ -10 │ match (e) { - │ ^ Pattern 'E::Z { z: _ }' not covered - -error[E03019]: invalid pattern - ┌─ tests/move_2024/matching/invalid_raw_variant_name.move:11:30 - │ -11 │ E::X { x: y } | E::Y(y) | Z { z: y } => *y - │ ^ ---------- right or-pattern does not - │ │ - │ left or-pattern binds variable y - │ - = Both sides of an or-pattern must bind the same variables. - -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/invalid_raw_variant_name.move:11:30 - │ - 4 │ X { x: u64 }, - │ --- Given: 'u64' - 5 │ Y(u32), - │ --- Expected: 'u32' - · -11 │ E::X { x: y } | E::Y(y) | Z { z: y } => *y - │ ^ Invalid pattern field type - -error[E01002]: unexpected token - ┌─ tests/move_2024/matching/invalid_raw_variant_name.move:11:35 - │ -11 │ E::X { x: y } | E::Y(y) | Z { z: y } => *y - │ ^ Unexpected name access. Expected a valid 'enum' variant, 'struct', or 'const'. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_raw_variant_name.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_raw_variant_name.snap new file mode 100644 index 0000000000000..1016868d317cc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_raw_variant_name.snap @@ -0,0 +1,40 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_raw_variant_name.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/invalid_raw_variant_name.move:10:12 + │ +10 │ match (e) { + │ ^ Pattern 'E::Z { z: _ }' not covered + +error[E03019]: invalid pattern + ┌─ tests/move_2024/matching/invalid_raw_variant_name.move:11:30 + │ +11 │ E::X { x: y } | E::Y(y) | Z { z: y } => *y + │ ^ ---------- right or-pattern does not + │ │ + │ left or-pattern binds variable y + │ + = Both sides of an or-pattern must bind the same variables. + +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/invalid_raw_variant_name.move:11:30 + │ + 4 │ X { x: u64 }, + │ --- Given: 'u64' + 5 │ Y(u32), + │ --- Expected: 'u32' + · +11 │ E::X { x: y } | E::Y(y) | Z { z: y } => *y + │ ^ Invalid pattern field type + +error[E01002]: unexpected token + ┌─ tests/move_2024/matching/invalid_raw_variant_name.move:11:35 + │ +11 │ E::X { x: y } | E::Y(y) | Z { z: y } => *y + │ ^ Unexpected name access. Expected a valid 'enum' variant, 'struct', or 'const'. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_repeat_binding.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_repeat_binding.exp deleted file mode 100644 index d898309450559..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_repeat_binding.exp +++ /dev/null @@ -1,10 +0,0 @@ -error[E03019]: invalid pattern - ┌─ tests/move_2024/matching/invalid_repeat_binding.move:9:24 - │ -9 │ Two::Tuple(x, x) => { let _y = x; }, - │ ^ - and repeated here - │ │ - │ binder 'x' is defined here - │ - = A pattern variable must be unique, and must appear once in each or-pattern alternative. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_repeat_binding.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_repeat_binding.snap new file mode 100644 index 0000000000000..f82556899cf4c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_repeat_binding.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_repeat_binding.move +--- +error[E03019]: invalid pattern + ┌─ tests/move_2024/matching/invalid_repeat_binding.move:9:24 + │ +9 │ Two::Tuple(x, x) => { let _y = x; }, + │ ^ - and repeated here + │ │ + │ binder 'x' is defined here + │ + = A pattern variable must be unique, and must appear once in each or-pattern alternative. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_repeat_binding_2.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_repeat_binding_2.exp deleted file mode 100644 index c17f6c729f7a5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_repeat_binding_2.exp +++ /dev/null @@ -1,10 +0,0 @@ -error[E03019]: invalid pattern - ┌─ tests/move_2024/matching/invalid_repeat_binding_2.move:9:24 - │ -9 │ Two::Tuple(x, x) | Two::Tuple(x, _) => { let _y = x; }, - │ ^ - and repeated here - │ │ - │ binder 'x' is defined here - │ - = A pattern variable must be unique, and must appear once in each or-pattern alternative. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_repeat_binding_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_repeat_binding_2.snap new file mode 100644 index 0000000000000..80001219db17d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_repeat_binding_2.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_repeat_binding_2.move +--- +error[E03019]: invalid pattern + ┌─ tests/move_2024/matching/invalid_repeat_binding_2.move:9:24 + │ +9 │ Two::Tuple(x, x) | Two::Tuple(x, _) => { let _y = x; }, + │ ^ - and repeated here + │ │ + │ binder 'x' is defined here + │ + = A pattern variable must be unique, and must appear once in each or-pattern alternative. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_struct_form.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_struct_form.exp deleted file mode 100644 index fa63db90cbf85..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_struct_form.exp +++ /dev/null @@ -1,42 +0,0 @@ -error[E03013]: positional call mismatch - ┌─ tests/move_2024/matching/invalid_struct_form.move:9:13 - │ -3 │ public struct P(u64) has drop; - │ - 'P' is declared here - · -9 │ P { x } => x, - │ ^^^^^^^ Invalid struct pattern. Positional struct declarations require positional patterns - -error[E03010]: unbound field - ┌─ tests/move_2024/matching/invalid_struct_form.move:9:13 - │ -9 │ P { x } => x, - │ ^^^^^^^ Unbound field 'x' in 'a::m::P' - -error[E04016]: too few arguments - ┌─ tests/move_2024/matching/invalid_struct_form.move:9:13 - │ -9 │ P { x } => x, - │ ^^^^^^^ Missing pattern for field '0' in 'a::m::P' - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/matching/invalid_struct_form.move:12:13 - │ - 5 │ public struct N { x: u64 } has drop; - │ - 'N' is declared here - · -12 │ N(x) => x, - │ ^^^^ Invalid struct pattern. Named struct declarations require named patterns - -error[E03010]: unbound field - ┌─ tests/move_2024/matching/invalid_struct_form.move:12:13 - │ -12 │ N(x) => x, - │ ^^^^ Unbound field '0' in 'a::m::N' - -error[E04016]: too few arguments - ┌─ tests/move_2024/matching/invalid_struct_form.move:12:13 - │ -12 │ N(x) => x, - │ ^^^^ Missing pattern for field 'x' in 'a::m::N' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_struct_form.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_struct_form.snap new file mode 100644 index 0000000000000..c6d72f9a905ad --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/invalid_struct_form.snap @@ -0,0 +1,49 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/invalid_struct_form.move +--- +error[E03013]: positional call mismatch + ┌─ tests/move_2024/matching/invalid_struct_form.move:9:13 + │ +3 │ public struct P(u64) has drop; + │ - 'P' is declared here + · +9 │ P { x } => x, + │ ^^^^^^^ Invalid struct pattern. Positional struct declarations require positional patterns + +error[E03010]: unbound field + ┌─ tests/move_2024/matching/invalid_struct_form.move:9:13 + │ +9 │ P { x } => x, + │ ^^^^^^^ Unbound field 'x' in 'a::m::P' + +error[E04016]: too few arguments + ┌─ tests/move_2024/matching/invalid_struct_form.move:9:13 + │ +9 │ P { x } => x, + │ ^^^^^^^ Missing pattern for field '0' in 'a::m::P' + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/matching/invalid_struct_form.move:12:13 + │ + 5 │ public struct N { x: u64 } has drop; + │ - 'N' is declared here + · +12 │ N(x) => x, + │ ^^^^ Invalid struct pattern. Named struct declarations require named patterns + +error[E03010]: unbound field + ┌─ tests/move_2024/matching/invalid_struct_form.move:12:13 + │ +12 │ N(x) => x, + │ ^^^^ Unbound field '0' in 'a::m::N' + +error[E04016]: too few arguments + ┌─ tests/move_2024/matching/invalid_struct_form.move:12:13 + │ +12 │ N(x) => x, + │ ^^^^ Missing pattern for field 'x' in 'a::m::N' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/lit_abort.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/lit_abort.snap new file mode 100644 index 0000000000000..436630f4e2692 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/lit_abort.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/lit_abort.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/lit_borrow_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/lit_borrow_match.snap new file mode 100644 index 0000000000000..e46f60ab313ec --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/lit_borrow_match.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/lit_borrow_match.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/lit_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/lit_match.snap new file mode 100644 index 0000000000000..cdaec5ffb6b43 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/lit_match.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/lit_match.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/lit_mut_borrow_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/lit_mut_borrow_match.snap new file mode 100644 index 0000000000000..72ff7de18d540 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/lit_mut_borrow_match.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/lit_mut_borrow_match.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/macro_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/macro_match.snap new file mode 100644 index 0000000000000..d1f3499019d5d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/macro_match.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/macro_match.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/match_break_parse.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/match_break_parse.snap new file mode 100644 index 0000000000000..17e7020598449 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/match_break_parse.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/match_break_parse.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/match_mut_lit.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/match_mut_lit.snap new file mode 100644 index 0000000000000..9f86002060300 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/match_mut_lit.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/match_mut_lit.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/match_return_parse.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/match_return_parse.snap new file mode 100644 index 0000000000000..2b4c89fdd8ce3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/match_return_parse.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/match_return_parse.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/match_type.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/match_type.snap new file mode 100644 index 0000000000000..219393aff7b69 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/match_type.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/match_type.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/match_type_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/match_type_invalid.exp deleted file mode 100644 index 3feb4492e1e07..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/match_type_invalid.exp +++ /dev/null @@ -1,30 +0,0 @@ -error[E04010]: cannot infer type - ┌─ tests/move_2024/matching/match_type_invalid.move:12:17 - │ -12 │ let o = Option::None; - │ ^^^^^^^^^^^^ Could not infer this type. Try adding an annotation - -error[E04010]: cannot infer type - ┌─ tests/move_2024/matching/match_type_invalid.move:14:13 - │ -14 │ Option::Some(n) => foo(n), - │ ^^^^^^^^^^^^^^^ Could not infer this type. Try adding an annotation - -error[E04010]: cannot infer type - ┌─ tests/move_2024/matching/match_type_invalid.move:14:26 - │ -14 │ Option::Some(n) => foo(n), - │ ^ Could not infer this type. Try adding an annotation - -error[E04010]: cannot infer type - ┌─ tests/move_2024/matching/match_type_invalid.move:14:32 - │ -14 │ Option::Some(n) => foo(n), - │ ^^^^^^ Could not infer this type. Try adding an annotation - -error[E04010]: cannot infer type - ┌─ tests/move_2024/matching/match_type_invalid.move:15:13 - │ -15 │ Option::None => (), - │ ^^^^^^^^^^^^ Could not infer this type. Try adding an annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/match_type_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/match_type_invalid.snap new file mode 100644 index 0000000000000..958aeb6db8732 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/match_type_invalid.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/match_type_invalid.move +--- +error[E04010]: cannot infer type + ┌─ tests/move_2024/matching/match_type_invalid.move:12:17 + │ +12 │ let o = Option::None; + │ ^^^^^^^^^^^^ Could not infer this type. Try adding an annotation + +error[E04010]: cannot infer type + ┌─ tests/move_2024/matching/match_type_invalid.move:14:13 + │ +14 │ Option::Some(n) => foo(n), + │ ^^^^^^^^^^^^^^^ Could not infer this type. Try adding an annotation + +error[E04010]: cannot infer type + ┌─ tests/move_2024/matching/match_type_invalid.move:14:26 + │ +14 │ Option::Some(n) => foo(n), + │ ^ Could not infer this type. Try adding an annotation + +error[E04010]: cannot infer type + ┌─ tests/move_2024/matching/match_type_invalid.move:14:32 + │ +14 │ Option::Some(n) => foo(n), + │ ^^^^^^ Could not infer this type. Try adding an annotation + +error[E04010]: cannot infer type + ┌─ tests/move_2024/matching/match_type_invalid.move:15:13 + │ +15 │ Option::None => (), + │ ^^^^^^^^^^^^ Could not infer this type. Try adding an annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/matching_everywhere.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/matching_everywhere.snap new file mode 100644 index 0000000000000..6c7471bc83238 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/matching_everywhere.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/matching_everywhere.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/memory_test.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/memory_test.exp deleted file mode 100644 index 09f43641bb637..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/memory_test.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_2024/matching/memory_test.move:17:20 - │ -15 │ match (o) { - │ - It is still being mutably borrowed by this reference -16 │ E::A(u) => *u, -17 │ _ if ({*o = E::A(0); false}) => 1, - │ ^^^^^^^^^^^^ Invalid mutation of reference. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/memory_test.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/memory_test.snap new file mode 100644 index 0000000000000..d18aec39e655c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/memory_test.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/memory_test.move +--- +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_2024/matching/memory_test.move:17:20 + │ +15 │ match (o) { + │ - It is still being mutably borrowed by this reference +16 │ E::A(u) => *u, +17 │ _ if ({*o = E::A(0); false}) => 1, + │ ^^^^^^^^^^^^ Invalid mutation of reference. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/multi_or.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/multi_or.snap new file mode 100644 index 0000000000000..e58fa1752380c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/multi_or.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/multi_or.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/multi_or_not_exhaustive.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/multi_or_not_exhaustive.exp deleted file mode 100644 index e904c73611e48..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/multi_or_not_exhaustive.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/matching/multi_or_not_exhaustive.move:12:16 - │ -12 │ match (subject) { - │ ^^^^^^^ Pattern 'ABC::B(_1, _0)' not covered - │ - = When '_1' is not 5 - = When '_0' is not 5 - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/multi_or_not_exhaustive.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/multi_or_not_exhaustive.snap new file mode 100644 index 0000000000000..c748daddf4162 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/multi_or_not_exhaustive.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/multi_or_not_exhaustive.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/matching/multi_or_not_exhaustive.move:12:16 + │ +12 │ match (subject) { + │ ^^^^^^^ Pattern 'ABC::B(_1, _0)' not covered + │ + = When '_1' is not 5 + = When '_0' is not 5 diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/mut_field_alias.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/mut_field_alias.snap new file mode 100644 index 0000000000000..3809d5dbef29e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/mut_field_alias.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/mut_field_alias.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/mut_field_alias_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/mut_field_alias_2.snap new file mode 100644 index 0000000000000..cc5a69e5918c4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/mut_field_alias_2.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/mut_field_alias_2.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/mut_in_guard.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/mut_in_guard.snap new file mode 100644 index 0000000000000..fc97ca40f4c5c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/mut_in_guard.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/mut_in_guard.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/nested_at.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/nested_at.snap new file mode 100644 index 0000000000000..f9f39afa7eef6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/nested_at.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/nested_at.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/nested_bindings.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/nested_bindings.snap new file mode 100644 index 0000000000000..508a2eee79e92 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/nested_bindings.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/nested_bindings.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/nested_either_borrow.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/nested_either_borrow.snap new file mode 100644 index 0000000000000..bbc0b18ed207a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/nested_either_borrow.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/nested_either_borrow.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/nesting_defns.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/nesting_defns.snap new file mode 100644 index 0000000000000..b603a7f98ce93 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/nesting_defns.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/nesting_defns.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/nesting_with_phantoms.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/nesting_with_phantoms.snap new file mode 100644 index 0000000000000..f054a5d95b5ea --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/nesting_with_phantoms.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/nesting_with_phantoms.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/nesting_with_phantoms_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/nesting_with_phantoms_invalid.exp deleted file mode 100644 index ff42c7524b217..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/nesting_with_phantoms_invalid.exp +++ /dev/null @@ -1,17 +0,0 @@ -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_2024/matching/nesting_with_phantoms_invalid.move:20:51 - │ -20 │ public struct PS { s: S , x: X, t: T} - │ - ^ Phantom type parameter cannot be used as a field type - │ │ - │ 'T' declared here as phantom - -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_2024/matching/nesting_with_phantoms_invalid.move:24:19 - │ -22 │ public enum PE { - │ - 'T' declared here as phantom -23 │ One { s: S, x: X }, -24 │ Two(S, X, T), - │ ^ Phantom type parameter cannot be used as a field type - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/nesting_with_phantoms_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/nesting_with_phantoms_invalid.snap new file mode 100644 index 0000000000000..b524bb6f15efb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/nesting_with_phantoms_invalid.snap @@ -0,0 +1,24 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/nesting_with_phantoms_invalid.move +--- +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_2024/matching/nesting_with_phantoms_invalid.move:20:51 + │ +20 │ public struct PS { s: S , x: X, t: T} + │ - ^ Phantom type parameter cannot be used as a field type + │ │ + │ 'T' declared here as phantom + +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_2024/matching/nesting_with_phantoms_invalid.move:24:19 + │ +22 │ public enum PE { + │ - 'T' declared here as phantom +23 │ One { s: S, x: X }, +24 │ Two(S, X, T), + │ ^ Phantom type parameter cannot be used as a field type diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/option_default.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/option_default.snap new file mode 100644 index 0000000000000..bc72a3e83c5de --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/option_default.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/option_default.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/option_enum_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/option_enum_match.snap new file mode 100644 index 0000000000000..39848353b2763 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/option_enum_match.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/option_enum_match.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/phantoms.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/phantoms.snap new file mode 100644 index 0000000000000..4d5e52734fa66 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/phantoms.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/phantoms.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/phantoms_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/phantoms_invalid.exp deleted file mode 100644 index 86d23bd69d5b7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/phantoms_invalid.exp +++ /dev/null @@ -1,104 +0,0 @@ -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_2024/matching/phantoms_invalid.move:9:11 - │ -7 │ public enum Q { - │ - 'X' declared here as phantom -8 │ A, -9 │ B(X), - │ ^ Phantom type parameter cannot be used as a field type - -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_2024/matching/phantoms_invalid.move:15:16 - │ -13 │ public enum R { - │ - 'X' declared here as phantom -14 │ A, -15 │ B { x: X }, - │ ^ Phantom type parameter cannot be used as a field type - -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_2024/matching/phantoms_invalid.move:20:11 - │ -19 │ public enum S { - │ - 'X' declared here as phantom -20 │ A(X), - │ ^ Phantom type parameter cannot be used as a field type - -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_2024/matching/phantoms_invalid.move:21:16 - │ -19 │ public enum S { - │ - 'X' declared here as phantom -20 │ A(X), -21 │ B { x: X }, - │ ^ Phantom type parameter cannot be used as a field type - -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_2024/matching/phantoms_invalid.move:27:13 - │ -25 │ public enum T { - │ - 'X' declared here as phantom -26 │ A, -27 │ B(Y), - │ ^ Phantom type parameter cannot be used as an argument to a non-phantom parameter - -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_2024/matching/phantoms_invalid.move:33:18 - │ -31 │ public enum U { - │ - 'X' declared here as phantom -32 │ A, -33 │ B { x: Y }, - │ ^ Phantom type parameter cannot be used as an argument to a non-phantom parameter - -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_2024/matching/phantoms_invalid.move:38:11 - │ -37 │ public enum V { - │ - 'X' declared here as phantom -38 │ A(X, Y), - │ ^ Phantom type parameter cannot be used as a field type - -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_2024/matching/phantoms_invalid.move:38:16 - │ -37 │ public enum V { - │ - 'X' declared here as phantom -38 │ A(X, Y), - │ ^ Phantom type parameter cannot be used as an argument to a non-phantom parameter - -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_2024/matching/phantoms_invalid.move:39:16 - │ -37 │ public enum V { - │ - 'X' declared here as phantom -38 │ A(X, Y), -39 │ B { x: X, y: Y }, - │ ^ Phantom type parameter cannot be used as a field type - -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_2024/matching/phantoms_invalid.move:39:24 - │ -37 │ public enum V { - │ - 'X' declared here as phantom -38 │ A(X, Y), -39 │ B { x: X, y: Y }, - │ ^ Phantom type parameter cannot be used as an argument to a non-phantom parameter - -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_2024/matching/phantoms_invalid.move:44:11 - │ -43 │ public enum W { - │ - 'X' declared here as phantom -44 │ A(X, V), - │ ^ Phantom type parameter cannot be used as a field type - -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_2024/matching/phantoms_invalid.move:45:26 - │ -43 │ public enum W { - │ - 'X' declared here as phantom -44 │ A(X, V), -45 │ B { v: V , x: X}, - │ ^ Phantom type parameter cannot be used as a field type - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/phantoms_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/phantoms_invalid.snap new file mode 100644 index 0000000000000..e11cbef2353d8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/phantoms_invalid.snap @@ -0,0 +1,111 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/phantoms_invalid.move +--- +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_2024/matching/phantoms_invalid.move:9:11 + │ +7 │ public enum Q { + │ - 'X' declared here as phantom +8 │ A, +9 │ B(X), + │ ^ Phantom type parameter cannot be used as a field type + +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_2024/matching/phantoms_invalid.move:15:16 + │ +13 │ public enum R { + │ - 'X' declared here as phantom +14 │ A, +15 │ B { x: X }, + │ ^ Phantom type parameter cannot be used as a field type + +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_2024/matching/phantoms_invalid.move:20:11 + │ +19 │ public enum S { + │ - 'X' declared here as phantom +20 │ A(X), + │ ^ Phantom type parameter cannot be used as a field type + +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_2024/matching/phantoms_invalid.move:21:16 + │ +19 │ public enum S { + │ - 'X' declared here as phantom +20 │ A(X), +21 │ B { x: X }, + │ ^ Phantom type parameter cannot be used as a field type + +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_2024/matching/phantoms_invalid.move:27:13 + │ +25 │ public enum T { + │ - 'X' declared here as phantom +26 │ A, +27 │ B(Y), + │ ^ Phantom type parameter cannot be used as an argument to a non-phantom parameter + +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_2024/matching/phantoms_invalid.move:33:18 + │ +31 │ public enum U { + │ - 'X' declared here as phantom +32 │ A, +33 │ B { x: Y }, + │ ^ Phantom type parameter cannot be used as an argument to a non-phantom parameter + +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_2024/matching/phantoms_invalid.move:38:11 + │ +37 │ public enum V { + │ - 'X' declared here as phantom +38 │ A(X, Y), + │ ^ Phantom type parameter cannot be used as a field type + +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_2024/matching/phantoms_invalid.move:38:16 + │ +37 │ public enum V { + │ - 'X' declared here as phantom +38 │ A(X, Y), + │ ^ Phantom type parameter cannot be used as an argument to a non-phantom parameter + +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_2024/matching/phantoms_invalid.move:39:16 + │ +37 │ public enum V { + │ - 'X' declared here as phantom +38 │ A(X, Y), +39 │ B { x: X, y: Y }, + │ ^ Phantom type parameter cannot be used as a field type + +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_2024/matching/phantoms_invalid.move:39:24 + │ +37 │ public enum V { + │ - 'X' declared here as phantom +38 │ A(X, Y), +39 │ B { x: X, y: Y }, + │ ^ Phantom type parameter cannot be used as an argument to a non-phantom parameter + +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_2024/matching/phantoms_invalid.move:44:11 + │ +43 │ public enum W { + │ - 'X' declared here as phantom +44 │ A(X, V), + │ ^ Phantom type parameter cannot be used as a field type + +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_2024/matching/phantoms_invalid.move:45:26 + │ +43 │ public enum W { + │ - 'X' declared here as phantom +44 │ A(X, V), +45 │ B { v: V , x: X}, + │ ^ Phantom type parameter cannot be used as a field type diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/raw_address.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/raw_address.snap new file mode 100644 index 0000000000000..d5d6ea65bf549 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/raw_address.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/raw_address.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/raw_address_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/raw_address_invalid.exp deleted file mode 100644 index ec516162de735..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/raw_address_invalid.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/raw_address_invalid.move:10:9 - │ - 7 │ public fun match_e(e: &E, rx: &u64, ry: &u64): (&u64, &u64) { - │ - Expected: '0x42::m::E' - · -10 │ 0x42 => (rx, ry), - │ ^^^^ - │ │ - │ Invalid pattern - │ Given: integer - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/matching/raw_address_invalid.move:11:9 - │ -11 │ 0x42::m => (rx, ry), - │ ^^^^^^^ Unexpected module identifier. A module identifier is not a valid pattern constructor - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/raw_address_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/raw_address_invalid.snap new file mode 100644 index 0000000000000..e8baa4a5aba86 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/raw_address_invalid.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/raw_address_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/raw_address_invalid.move:10:9 + │ + 7 │ public fun match_e(e: &E, rx: &u64, ry: &u64): (&u64, &u64) { + │ - Expected: '0x42::m::E' + · +10 │ 0x42 => (rx, ry), + │ ^^^^ + │ │ + │ Invalid pattern + │ Given: integer + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/matching/raw_address_invalid.move:11:9 + │ +11 │ 0x42::m => (rx, ry), + │ ^^^^^^^ Unexpected module identifier. A module identifier is not a valid pattern constructor diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/ref_borrow.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/ref_borrow.snap new file mode 100644 index 0000000000000..f3e315cbcc514 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/ref_borrow.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/ref_borrow.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/repeat_binding_okay.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/repeat_binding_okay.exp deleted file mode 100644 index 86fda5cce3c01..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/repeat_binding_okay.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E13002]: feature is under active development - ┌─ tests/move_2024/matching/repeat_binding_okay.move:3:17 - │ -3 │ public enum Two{ - │ ^^^ Enums are not supported in bytecode. - │ - = This feature is currently in development. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/rhs_shadow_loop_label.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/rhs_shadow_loop_label.snap new file mode 100644 index 0000000000000..5febe2f1597d8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/rhs_shadow_loop_label.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/rhs_shadow_loop_label.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/rhs_shadow_loop_with_or.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/rhs_shadow_loop_with_or.snap new file mode 100644 index 0000000000000..189d0dc1bfe64 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/rhs_shadow_loop_with_or.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/rhs_shadow_loop_with_or.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/simple_enum_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/simple_enum_match.snap new file mode 100644 index 0000000000000..0a3e64f6bd600 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/simple_enum_match.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/simple_enum_match.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/simple_enum_ref_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/simple_enum_ref_match.snap new file mode 100644 index 0000000000000..6dfd4ed6daf92 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/simple_enum_ref_match.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/simple_enum_ref_match.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/simple_struct_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/simple_struct_match.snap new file mode 100644 index 0000000000000..d05cfbec641c4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/simple_struct_match.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/simple_struct_match.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/simple_struct_ref_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/simple_struct_ref_match.snap new file mode 100644 index 0000000000000..c9588d45ef0cb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/simple_struct_ref_match.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/simple_struct_ref_match.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/singleton_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/singleton_match.snap new file mode 100644 index 0000000000000..61d28f8627660 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/singleton_match.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/singleton_match.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/stack_interp.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/stack_interp.snap new file mode 100644 index 0000000000000..875b6069ae183 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/stack_interp.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/stack_interp.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/stack_interp_macro.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/stack_interp_macro.snap new file mode 100644 index 0000000000000..46639808da4ff --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/stack_interp_macro.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/stack_interp_macro.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/stloc_error.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/stloc_error.snap new file mode 100644 index 0000000000000..d85403739b002 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/stloc_error.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/stloc_error.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_abort.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_abort.snap new file mode 100644 index 0000000000000..a209066ac7077 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_abort.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/struct_abort.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_match_mut.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_match_mut.snap new file mode 100644 index 0000000000000..00f437ee0dd55 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_match_mut.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/struct_match_mut.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_match_mut_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_match_mut_invalid.exp deleted file mode 100644 index 348e5cee0d628..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_match_mut_invalid.exp +++ /dev/null @@ -1,232 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:33:21 - │ - 6 │ public struct NBase has copy, drop { t: u64 } - │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -33 │ t = t + 1; - │ ^ Invalid argument to '+' - -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:33:23 - │ - 6 │ public struct NBase has copy, drop { t: u64 } - │ --- Found: '&u64'. It is not compatible with the other type. - · -33 │ t = t + 1; - │ ^ - Found: integer. It is not compatible with the other type. - │ │ - │ Incompatible arguments to '+' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:33:25 - │ - 6 │ public struct NBase has copy, drop { t: u64 } - │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -33 │ t = t + 1; - │ ^ Invalid argument to '+' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:42:21 - │ - 6 │ public struct NBase has copy, drop { t: u64 } - │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -42 │ x = x + 1; - │ ^ Invalid argument to '+' - -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:42:23 - │ - 6 │ public struct NBase has copy, drop { t: u64 } - │ --- Found: '&u64'. It is not compatible with the other type. - · -42 │ x = x + 1; - │ ^ - Found: integer. It is not compatible with the other type. - │ │ - │ Incompatible arguments to '+' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:42:25 - │ - 6 │ public struct NBase has copy, drop { t: u64 } - │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -42 │ x = x + 1; - │ ^ Invalid argument to '+' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:51:20 - │ - 8 │ public struct PBase(u64) has copy, drop; - │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -51 │ x = x + 1; - │ ^ Invalid argument to '+' - -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:51:22 - │ - 8 │ public struct PBase(u64) has copy, drop; - │ --- Found: '&u64'. It is not compatible with the other type. - · -51 │ x = x + 1; - │ ^ - Found: integer. It is not compatible with the other type. - │ │ - │ Incompatible arguments to '+' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:51:24 - │ - 8 │ public struct PBase(u64) has copy, drop; - │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -51 │ x = x + 1; - │ ^ Invalid argument to '+' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:60:21 - │ - 6 │ public struct NBase has copy, drop { t: u64 } - │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -60 │ t = t + 1; - │ ^ Invalid argument to '+' - -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:60:23 - │ - 6 │ public struct NBase has copy, drop { t: u64 } - │ --- Found: '&u64'. It is not compatible with the other type. - · -60 │ t = t + 1; - │ ^ - Found: integer. It is not compatible with the other type. - │ │ - │ Incompatible arguments to '+' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:60:25 - │ - 6 │ public struct NBase has copy, drop { t: u64 } - │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -60 │ t = t + 1; - │ ^ Invalid argument to '+' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:69:21 - │ - 6 │ public struct NBase has copy, drop { t: u64 } - │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -69 │ x = x + 1; - │ ^ Invalid argument to '+' - -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:69:23 - │ - 6 │ public struct NBase has copy, drop { t: u64 } - │ --- Found: '&u64'. It is not compatible with the other type. - · -69 │ x = x + 1; - │ ^ - Found: integer. It is not compatible with the other type. - │ │ - │ Incompatible arguments to '+' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:69:25 - │ - 6 │ public struct NBase has copy, drop { t: u64 } - │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -69 │ x = x + 1; - │ ^ Invalid argument to '+' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:78:21 - │ - 8 │ public struct PBase(u64) has copy, drop; - │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -78 │ x = x + 1; - │ ^ Invalid argument to '+' - -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:78:23 - │ - 8 │ public struct PBase(u64) has copy, drop; - │ --- Found: '&u64'. It is not compatible with the other type. - · -78 │ x = x + 1; - │ ^ - Found: integer. It is not compatible with the other type. - │ │ - │ Incompatible arguments to '+' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:78:25 - │ - 8 │ public struct PBase(u64) has copy, drop; - │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -78 │ x = x + 1; - │ ^ Invalid argument to '+' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:87:21 - │ - 6 │ public struct NBase has copy, drop { t: u64 } - │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -87 │ x = x + 1; - │ ^ Invalid argument to '+' - -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:87:23 - │ - 6 │ public struct NBase has copy, drop { t: u64 } - │ --- Found: '&u64'. It is not compatible with the other type. - · -87 │ x = x + 1; - │ ^ - Found: integer. It is not compatible with the other type. - │ │ - │ Incompatible arguments to '+' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:87:25 - │ - 6 │ public struct NBase has copy, drop { t: u64 } - │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -87 │ x = x + 1; - │ ^ Invalid argument to '+' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:96:21 - │ - 8 │ public struct PBase(u64) has copy, drop; - │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -96 │ x = x + 1; - │ ^ Invalid argument to '+' - -error[E04007]: incompatible types - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:96:23 - │ - 8 │ public struct PBase(u64) has copy, drop; - │ --- Found: '&u64'. It is not compatible with the other type. - · -96 │ x = x + 1; - │ ^ - Found: integer. It is not compatible with the other type. - │ │ - │ Incompatible arguments to '+' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:96:25 - │ - 8 │ public struct PBase(u64) has copy, drop; - │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -96 │ x = x + 1; - │ ^ Invalid argument to '+' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_match_mut_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_match_mut_invalid.snap new file mode 100644 index 0000000000000..4227b32bf8e33 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_match_mut_invalid.snap @@ -0,0 +1,239 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/struct_match_mut_invalid.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:33:21 + │ + 6 │ public struct NBase has copy, drop { t: u64 } + │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +33 │ t = t + 1; + │ ^ Invalid argument to '+' + +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:33:23 + │ + 6 │ public struct NBase has copy, drop { t: u64 } + │ --- Found: '&u64'. It is not compatible with the other type. + · +33 │ t = t + 1; + │ ^ - Found: integer. It is not compatible with the other type. + │ │ + │ Incompatible arguments to '+' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:33:25 + │ + 6 │ public struct NBase has copy, drop { t: u64 } + │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +33 │ t = t + 1; + │ ^ Invalid argument to '+' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:42:21 + │ + 6 │ public struct NBase has copy, drop { t: u64 } + │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +42 │ x = x + 1; + │ ^ Invalid argument to '+' + +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:42:23 + │ + 6 │ public struct NBase has copy, drop { t: u64 } + │ --- Found: '&u64'. It is not compatible with the other type. + · +42 │ x = x + 1; + │ ^ - Found: integer. It is not compatible with the other type. + │ │ + │ Incompatible arguments to '+' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:42:25 + │ + 6 │ public struct NBase has copy, drop { t: u64 } + │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +42 │ x = x + 1; + │ ^ Invalid argument to '+' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:51:20 + │ + 8 │ public struct PBase(u64) has copy, drop; + │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +51 │ x = x + 1; + │ ^ Invalid argument to '+' + +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:51:22 + │ + 8 │ public struct PBase(u64) has copy, drop; + │ --- Found: '&u64'. It is not compatible with the other type. + · +51 │ x = x + 1; + │ ^ - Found: integer. It is not compatible with the other type. + │ │ + │ Incompatible arguments to '+' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:51:24 + │ + 8 │ public struct PBase(u64) has copy, drop; + │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +51 │ x = x + 1; + │ ^ Invalid argument to '+' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:60:21 + │ + 6 │ public struct NBase has copy, drop { t: u64 } + │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +60 │ t = t + 1; + │ ^ Invalid argument to '+' + +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:60:23 + │ + 6 │ public struct NBase has copy, drop { t: u64 } + │ --- Found: '&u64'. It is not compatible with the other type. + · +60 │ t = t + 1; + │ ^ - Found: integer. It is not compatible with the other type. + │ │ + │ Incompatible arguments to '+' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:60:25 + │ + 6 │ public struct NBase has copy, drop { t: u64 } + │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +60 │ t = t + 1; + │ ^ Invalid argument to '+' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:69:21 + │ + 6 │ public struct NBase has copy, drop { t: u64 } + │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +69 │ x = x + 1; + │ ^ Invalid argument to '+' + +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:69:23 + │ + 6 │ public struct NBase has copy, drop { t: u64 } + │ --- Found: '&u64'. It is not compatible with the other type. + · +69 │ x = x + 1; + │ ^ - Found: integer. It is not compatible with the other type. + │ │ + │ Incompatible arguments to '+' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:69:25 + │ + 6 │ public struct NBase has copy, drop { t: u64 } + │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +69 │ x = x + 1; + │ ^ Invalid argument to '+' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:78:21 + │ + 8 │ public struct PBase(u64) has copy, drop; + │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +78 │ x = x + 1; + │ ^ Invalid argument to '+' + +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:78:23 + │ + 8 │ public struct PBase(u64) has copy, drop; + │ --- Found: '&u64'. It is not compatible with the other type. + · +78 │ x = x + 1; + │ ^ - Found: integer. It is not compatible with the other type. + │ │ + │ Incompatible arguments to '+' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:78:25 + │ + 8 │ public struct PBase(u64) has copy, drop; + │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +78 │ x = x + 1; + │ ^ Invalid argument to '+' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:87:21 + │ + 6 │ public struct NBase has copy, drop { t: u64 } + │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +87 │ x = x + 1; + │ ^ Invalid argument to '+' + +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:87:23 + │ + 6 │ public struct NBase has copy, drop { t: u64 } + │ --- Found: '&u64'. It is not compatible with the other type. + · +87 │ x = x + 1; + │ ^ - Found: integer. It is not compatible with the other type. + │ │ + │ Incompatible arguments to '+' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:87:25 + │ + 6 │ public struct NBase has copy, drop { t: u64 } + │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +87 │ x = x + 1; + │ ^ Invalid argument to '+' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:96:21 + │ + 8 │ public struct PBase(u64) has copy, drop; + │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +96 │ x = x + 1; + │ ^ Invalid argument to '+' + +error[E04007]: incompatible types + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:96:23 + │ + 8 │ public struct PBase(u64) has copy, drop; + │ --- Found: '&u64'. It is not compatible with the other type. + · +96 │ x = x + 1; + │ ^ - Found: integer. It is not compatible with the other type. + │ │ + │ Incompatible arguments to '+' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/matching/struct_match_mut_invalid.move:96:25 + │ + 8 │ public struct PBase(u64) has copy, drop; + │ --- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +96 │ x = x + 1; + │ ^ Invalid argument to '+' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_mut_box.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_mut_box.snap new file mode 100644 index 0000000000000..21d26ec845274 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_mut_box.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/struct_mut_box.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_named.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_named.snap new file mode 100644 index 0000000000000..046023785f77d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_named.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/struct_named.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_named_empty.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_named_empty.snap new file mode 100644 index 0000000000000..87898284f051e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_named_empty.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/struct_named_empty.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_named_empty_value.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_named_empty_value.snap new file mode 100644 index 0000000000000..19f880794a8f5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_named_empty_value.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/struct_named_empty_value.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_named_value.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_named_value.snap new file mode 100644 index 0000000000000..34f6fa029c514 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_named_value.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/struct_named_value.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_nested.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_nested.snap new file mode 100644 index 0000000000000..ce4abe501269b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_nested.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/struct_nested.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_nested_matching.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_nested_matching.snap new file mode 100644 index 0000000000000..42cd3d51028ad --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_nested_matching.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/struct_nested_matching.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_poly.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_poly.snap new file mode 100644 index 0000000000000..9875e8401955d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_poly.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/struct_poly.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_positional.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_positional.snap new file mode 100644 index 0000000000000..6fe37e519b960 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_positional.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/struct_positional.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_positional_empty.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_positional_empty.snap new file mode 100644 index 0000000000000..f411cac0975d7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_positional_empty.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/struct_positional_empty.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_visibility.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_visibility.exp deleted file mode 100644 index bcb378b37546e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_visibility.exp +++ /dev/null @@ -1,7 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_2024/matching/struct_visibility.move:13:13 - │ -13 │ m::S { t } => t, - │ ^^^^^^^^^^ Invalid pattern for '0x42::m::S'. - All struct can only be matched in the module in which they are declared - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_visibility.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_visibility.snap new file mode 100644 index 0000000000000..1245e4a04a93d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/struct_visibility.snap @@ -0,0 +1,14 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/struct_visibility.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_2024/matching/struct_visibility.move:13:13 + │ +13 │ m::S { t } => t, + │ ^^^^^^^^^^ Invalid pattern for '0x42::m::S'. + All struct can only be matched in the module in which they are declared diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/true_false_abort.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/true_false_abort.snap new file mode 100644 index 0000000000000..c54b5814bfefc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/true_false_abort.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/true_false_abort.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/true_false_nested_abort.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/true_false_nested_abort.snap new file mode 100644 index 0000000000000..6250fd63cfdb4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/true_false_nested_abort.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/true_false_nested_abort.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/tuple_specialize.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/tuple_specialize.snap new file mode 100644 index 0000000000000..6073dfefda329 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/tuple_specialize.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/tuple_specialize.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/unused_binding.exp b/external-crates/move/crates/move-compiler/tests/move_2024/matching/unused_binding.exp deleted file mode 100644 index 627bb89aebeef..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/matching/unused_binding.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_2024/matching/unused_binding.move:10:26 - │ -10 │ Option::Some(x) => 0, // x unused - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_2024/matching/unused_binding.move:17:26 - │ -17 │ Option::Some(x) => default, // x unused - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/matching/unused_binding.snap b/external-crates/move/crates/move-compiler/tests/move_2024/matching/unused_binding.snap new file mode 100644 index 0000000000000..5cd03f605c1ec --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/matching/unused_binding.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/matching/unused_binding.move +--- +warning[W09002]: unused variable + ┌─ tests/move_2024/matching/unused_binding.move:10:26 + │ +10 │ Option::Some(x) => 0, // x unused + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_2024/matching/unused_binding.move:17:26 + │ +17 │ Option::Some(x) => default, // x unused + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/all_migrations.exp b/external-crates/move/crates/move-compiler/tests/move_2024/migration/all_migrations.exp deleted file mode 100644 index ca9baad9ea315..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/migration/all_migrations.exp +++ /dev/null @@ -1,96 +0,0 @@ -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/all_migrations.move:6:5 - │ -6 │ friend a::c; - │ ^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/all_migrations.move:12:5 - │ -12 │ friend a::d; - │ ^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/all_migrations.move:20:5 - │ -20 │ friend a::e; - │ ^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' - -error[E01003]: invalid modifier - ┌─ tests/move_2024/migration/all_migrations.move:22:5 - │ -22 │ struct S { f: u64 } - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E01003]: invalid modifier - ┌─ tests/move_2024/migration/all_migrations.move:24:5 - │ -24 │ struct LongerName { - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E01003]: invalid modifier - ┌─ tests/move_2024/migration/all_migrations.move:29:5 - │ -29 │ struct Positional(u64, u64, u64) - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -warning[W09003]: unused assignment - ┌─ tests/move_2024/migration/all_migrations.move:32:20 - │ -32 │ let S { f: fin } = s; - │ ^^^ Unused assignment for variable 'fin'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_fin') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/migration/all_migrations.move:33:9 - │ -32 │ let S { f: fin } = s; - │ --- To use the variable mutably, it must be declared 'mut', e.g. 'mut fin' -33 │ fin = 10; - │ ^^^ Invalid assignment of immutable variable 'fin' - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/migration/all_migrations.move:34:9 - │ -31 │ fun t0(x: u64, s: S): u64 { - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' - · -34 │ x = 20; - │ ^ Invalid assignment of immutable variable 'x' - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/all_migrations.move:38:5 - │ -38 │ public(friend) fun t1() {} - │ ^^^^^^^^^^^^^^ 'public(friend)' is deprecated. Replace with 'public(package)' - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/all_migrations.move:40:5 - │ -40 │ ╭ public( -41 │ │ friend) fun t2() {} - │ ╰───────────────^ 'public(friend)' is deprecated. Replace with 'public(package)' - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/all_migrations.move:43:5 - │ -43 │ ╭ public( -44 │ │ friend -45 │ │ ) fun t3() {} - │ ╰─────────^ 'public(friend)' is deprecated. Replace with 'public(package)' - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/all_migrations.move:47:5 - │ -47 │ ╭ public( -48 │ │ friend -49 │ │ ) fun t4() {} - │ ╰─────^ 'public(friend)' is deprecated. Replace with 'public(package)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/all_migrations.migration.exp b/external-crates/move/crates/move-compiler/tests/move_2024/migration/all_migrations.migration.exp deleted file mode 100644 index 7cc8d2b5b14a0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/migration/all_migrations.migration.exp +++ /dev/null @@ -1,57 +0,0 @@ ---- tests/move_2024/migration/all_migrations.move -+++ tests/move_2024/migration/all_migrations.move -@@ -3,2 +3,2 @@ -- #[test_only] -- friend a::b; -+ /* #[test_only] */ -+ /* friend a::b; */ -@@ -6 +6 @@ -- friend a::c; -+ /* friend a::c; */ -@@ -8 +8 @@ -- #[ext( -+ /* #[ext( -@@ -11,2 +11,2 @@ -- ] -- friend a::d; -+ ] */ -+ /* friend a::d; */ -@@ -14 +14 @@ -- #[ext( -+ /* #[ext( -@@ -19,2 +19,2 @@ -- ] -- friend a::e; -+ ] */ -+ /* friend a::e; */ -@@ -22 +22 @@ -- struct S { f: u64 } -+ public struct S { f: u64 } -@@ -24 +24 @@ -- struct LongerName { -+ public struct LongerName { -@@ -29 +29 @@ -- struct Positional(u64, u64, u64) -+ public struct Positional(u64, u64, u64) -@@ -31,2 +31,2 @@ -- fun t0(x: u64, s: S): u64 { -- let S { f: fin } = s; -+ fun t0(mut x: u64, s: S): u64 { -+ let S { f: mut fin } = s; -@@ -38 +38 @@ -- public(friend) fun t1() {} -+ public(package) fun t1() {} -@@ -40,2 +40 @@ -- public( -- friend) fun t2() {} -+ public(package) fun t2() {} -@@ -43,3 +42 @@ -- public( -- friend -- ) fun t3() {} -+ public(package) fun t3() {} -@@ -47,3 +44 @@ -- public( -- friend -- ) fun t4() {} -+ public(package) fun t4() {} diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/all_migrations.snap b/external-crates/move/crates/move-compiler/tests/move_2024/migration/all_migrations.snap new file mode 100644 index 0000000000000..661bba6eb697b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/migration/all_migrations.snap @@ -0,0 +1,103 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/migration/all_migrations.move +--- +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/all_migrations.move:6:5 + │ +6 │ friend a::c; + │ ^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/all_migrations.move:12:5 + │ +12 │ friend a::d; + │ ^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/all_migrations.move:20:5 + │ +20 │ friend a::e; + │ ^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' + +error[E01003]: invalid modifier + ┌─ tests/move_2024/migration/all_migrations.move:22:5 + │ +22 │ struct S { f: u64 } + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E01003]: invalid modifier + ┌─ tests/move_2024/migration/all_migrations.move:24:5 + │ +24 │ struct LongerName { + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E01003]: invalid modifier + ┌─ tests/move_2024/migration/all_migrations.move:29:5 + │ +29 │ struct Positional(u64, u64, u64) + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +warning[W09003]: unused assignment + ┌─ tests/move_2024/migration/all_migrations.move:32:20 + │ +32 │ let S { f: fin } = s; + │ ^^^ Unused assignment for variable 'fin'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_fin') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/migration/all_migrations.move:33:9 + │ +32 │ let S { f: fin } = s; + │ --- To use the variable mutably, it must be declared 'mut', e.g. 'mut fin' +33 │ fin = 10; + │ ^^^ Invalid assignment of immutable variable 'fin' + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/migration/all_migrations.move:34:9 + │ +31 │ fun t0(x: u64, s: S): u64 { + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' + · +34 │ x = 20; + │ ^ Invalid assignment of immutable variable 'x' + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/all_migrations.move:38:5 + │ +38 │ public(friend) fun t1() {} + │ ^^^^^^^^^^^^^^ 'public(friend)' is deprecated. Replace with 'public(package)' + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/all_migrations.move:40:5 + │ +40 │ ╭ public( +41 │ │ friend) fun t2() {} + │ ╰───────────────^ 'public(friend)' is deprecated. Replace with 'public(package)' + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/all_migrations.move:43:5 + │ +43 │ ╭ public( +44 │ │ friend +45 │ │ ) fun t3() {} + │ ╰─────────^ 'public(friend)' is deprecated. Replace with 'public(package)' + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/all_migrations.move:47:5 + │ +47 │ ╭ public( +48 │ │ friend +49 │ │ ) fun t4() {} + │ ╰─────^ 'public(friend)' is deprecated. Replace with 'public(package)' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/all_migrations@migration.snap b/external-crates/move/crates/move-compiler/tests/move_2024/migration/all_migrations@migration.snap new file mode 100644 index 0000000000000..3f65d00a363b8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/migration/all_migrations@migration.snap @@ -0,0 +1,65 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.migration + lint: false +input_file: crates/move-compiler/tests/move_2024/migration/all_migrations.move +--- +--- tests/move_2024/migration/all_migrations.move ++++ tests/move_2024/migration/all_migrations.move +@@ -3,2 +3,2 @@ +- #[test_only] +- friend a::b; ++ /* #[test_only] */ ++ /* friend a::b; */ +@@ -6 +6 @@ +- friend a::c; ++ /* friend a::c; */ +@@ -8 +8 @@ +- #[ext( ++ /* #[ext( +@@ -11,2 +11,2 @@ +- ] +- friend a::d; ++ ] */ ++ /* friend a::d; */ +@@ -14 +14 @@ +- #[ext( ++ /* #[ext( +@@ -19,2 +19,2 @@ +- ] +- friend a::e; ++ ] */ ++ /* friend a::e; */ +@@ -22 +22 @@ +- struct S { f: u64 } ++ public struct S { f: u64 } +@@ -24 +24 @@ +- struct LongerName { ++ public struct LongerName { +@@ -29 +29 @@ +- struct Positional(u64, u64, u64) ++ public struct Positional(u64, u64, u64) +@@ -31,2 +31,2 @@ +- fun t0(x: u64, s: S): u64 { +- let S { f: fin } = s; ++ fun t0(mut x: u64, s: S): u64 { ++ let S { f: mut fin } = s; +@@ -38 +38 @@ +- public(friend) fun t1() {} ++ public(package) fun t1() {} +@@ -40,2 +40 @@ +- public( +- friend) fun t2() {} ++ public(package) fun t2() {} +@@ -43,3 +42 @@ +- public( +- friend +- ) fun t3() {} ++ public(package) fun t3() {} +@@ -47,3 +44 @@ +- public( +- friend +- ) fun t4() {} ++ public(package) fun t4() {} diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl.exp b/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl.exp deleted file mode 100644 index ee79f9acf71bc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/friend_decl.move:3:5 - │ -3 │ friend a::n1; - │ ^^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/friend_decl.move:4:5 - │ -4 │ friend /* nested */ a::n2; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/friend_decl.move:5:16 - │ -5 │ /* stays */friend /* nested */ a::n3; // stays - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/friend_decl.move:6:16 - │ -6 │ /* stays */friend/* nested */a::n4;// stays - │ ^^^^^^^^^^^^^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl.migration.exp b/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl.migration.exp deleted file mode 100644 index 4cf210da256c4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl.migration.exp +++ /dev/null @@ -1,11 +0,0 @@ ---- tests/move_2024/migration/friend_decl.move -+++ tests/move_2024/migration/friend_decl.move -@@ -3,4 +3,4 @@ -- friend a::n1; -- friend /* nested */ a::n2; -- /* stays */friend /* nested */ a::n3; // stays -- /* stays */friend/* nested */a::n4;// stays -+ /* friend a::n1; */ -+ /* friend /* nested */ a::n2; */ -+ /* stays *//* friend /* nested */ a::n3; */ // stays -+ /* stays *//* friend/* nested */a::n4; */// stays diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl.snap b/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl.snap new file mode 100644 index 0000000000000..d8f5adef7dc67 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/migration/friend_decl.move +--- +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/friend_decl.move:3:5 + │ +3 │ friend a::n1; + │ ^^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/friend_decl.move:4:5 + │ +4 │ friend /* nested */ a::n2; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/friend_decl.move:5:16 + │ +5 │ /* stays */friend /* nested */ a::n3; // stays + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/friend_decl.move:6:16 + │ +6 │ /* stays */friend/* nested */a::n4;// stays + │ ^^^^^^^^^^^^^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl@migration.snap b/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl@migration.snap new file mode 100644 index 0000000000000..b85f59126dbcf --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl@migration.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.migration + lint: false +input_file: crates/move-compiler/tests/move_2024/migration/friend_decl.move +--- +--- tests/move_2024/migration/friend_decl.move ++++ tests/move_2024/migration/friend_decl.move +@@ -3,4 +3,4 @@ +- friend a::n1; +- friend /* nested */ a::n2; +- /* stays */friend /* nested */ a::n3; // stays +- /* stays */friend/* nested */a::n4;// stays ++ /* friend a::n1; */ ++ /* friend /* nested */ a::n2; */ ++ /* stays *//* friend /* nested */ a::n3; */ // stays ++ /* stays *//* friend/* nested */a::n4; */// stays diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_multiline.exp b/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_multiline.exp deleted file mode 100644 index 64ed2196d6e60..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_multiline.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/friend_decl_multiline.move:6:5 - │ -6 │ friend a::b; - │ ^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/friend_decl_multiline.move:14:5 - │ -14 │ friend a::c; - │ ^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_multiline.migration.exp b/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_multiline.migration.exp deleted file mode 100644 index 327c86abd983a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_multiline.migration.exp +++ /dev/null @@ -1,18 +0,0 @@ ---- tests/move_2024/migration/friend_decl_multiline.move -+++ tests/move_2024/migration/friend_decl_multiline.move -@@ -2 +2 @@ -- #[ext( -+ /* #[ext( -@@ -5,2 +5,2 @@ -- ] -- friend a::b; -+ ] */ -+ /* friend a::b; */ -@@ -8 +8 @@ -- #[ext( -+ /* #[ext( -@@ -13,2 +13,2 @@ -- ] -- friend a::c; -+ ] */ -+ /* friend a::c; */ diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_multiline.snap b/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_multiline.snap new file mode 100644 index 0000000000000..5a695998c4308 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_multiline.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/migration/friend_decl_multiline.move +--- +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/friend_decl_multiline.move:6:5 + │ +6 │ friend a::b; + │ ^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/friend_decl_multiline.move:14:5 + │ +14 │ friend a::c; + │ ^^^^^^^^^^^^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_multiline@migration.snap b/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_multiline@migration.snap new file mode 100644 index 0000000000000..ccb10b8dbc2a3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_multiline@migration.snap @@ -0,0 +1,26 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.migration + lint: false +input_file: crates/move-compiler/tests/move_2024/migration/friend_decl_multiline.move +--- +--- tests/move_2024/migration/friend_decl_multiline.move ++++ tests/move_2024/migration/friend_decl_multiline.move +@@ -2 +2 @@ +- #[ext( ++ /* #[ext( +@@ -5,2 +5,2 @@ +- ] +- friend a::b; ++ ] */ ++ /* friend a::b; */ +@@ -8 +8 @@ +- #[ext( ++ /* #[ext( +@@ -13,2 +13,2 @@ +- ] +- friend a::c; ++ ] */ ++ /* friend a::c; */ diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_test_only.migration.exp b/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_test_only.migration.exp deleted file mode 100644 index 18188b26ac3a5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_test_only.migration.exp +++ /dev/null @@ -1,7 +0,0 @@ ---- tests/move_2024/migration/friend_decl_test_only.move -+++ tests/move_2024/migration/friend_decl_test_only.move -@@ -3,2 +3,2 @@ -- #[test_only] -- friend a::n1; -+ /* #[test_only] */ -+ /* friend a::n1; */ diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_test_only.snap b/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_test_only.snap new file mode 100644 index 0000000000000..ad021cf4f2432 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_test_only.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/migration/friend_decl_test_only.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_test_only@migration.snap b/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_test_only@migration.snap new file mode 100644 index 0000000000000..b2629ebf83240 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/migration/friend_decl_test_only@migration.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.migration + lint: false +input_file: crates/move-compiler/tests/move_2024/migration/friend_decl_test_only.move +--- +--- tests/move_2024/migration/friend_decl_test_only.move ++++ tests/move_2024/migration/friend_decl_test_only.move +@@ -3,2 +3,2 @@ +- #[test_only] +- friend a::n1; ++ /* #[test_only] */ ++ /* friend a::n1; */ diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/let_mut_migrate.exp b/external-crates/move/crates/move-compiler/tests/move_2024/migration/let_mut_migrate.exp deleted file mode 100644 index 417d96184c0d7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/migration/let_mut_migrate.exp +++ /dev/null @@ -1,69 +0,0 @@ -warning[W09003]: unused assignment - ┌─ tests/move_2024/migration/let_mut_migrate.move:7:9 - │ -7 │ yip = 0; - │ ^^^ Unused assignment for variable 'yip'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_yip') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/migration/let_mut_migrate.move:7:9 - │ -3 │ public fun t(x: u64, yip: u64, s: S): u64 { - │ --- To use the variable mutably, it must be declared 'mut', e.g. 'mut yip' - · -7 │ yip = 0; - │ ^^^ Invalid assignment of immutable variable 'yip' - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/migration/let_mut_migrate.move:8:9 - │ -3 │ public fun t(x: u64, yip: u64, s: S): u64 { - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' - · -8 │ x = yes + 1; - │ ^ Invalid assignment of immutable variable 'x' - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/migration/let_mut_migrate.move:9:9 - │ -5 │ let S { f: fin } = s; - │ --- To use the variable mutably, it must be declared 'mut', e.g. 'mut fin' - · -9 │ fin = fin + 1; - │ ^^^ Invalid assignment of immutable variable 'fin' - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/migration/let_mut_migrate.move:10:9 - │ - 4 │ let yes = 0; - │ --- To use the variable mutably, it must be declared 'mut', e.g. 'mut yes' - · -10 │ yes = x + fin; - │ ^^^ Invalid assignment of immutable variable 'yes' - -warning[W09003]: unused assignment - ┌─ tests/move_2024/migration/let_mut_migrate.move:15:24 - │ -15 │ let x = 5; let y = 10; - │ ^ Unused assignment for variable 'y'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_y') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/migration/let_mut_migrate.move:16:9 - │ -15 │ let x = 5; let y = 10; - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' -16 │ x = x + 1; - │ ^ Invalid assignment of immutable variable 'x' - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/migration/let_mut_migrate.move:17:9 - │ -15 │ let x = 5; let y = 10; - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut y' -16 │ x = x + 1; -17 │ y = x + 1; - │ ^ Invalid assignment of immutable variable 'y' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/let_mut_migrate.migration.exp b/external-crates/move/crates/move-compiler/tests/move_2024/migration/let_mut_migrate.migration.exp deleted file mode 100644 index 9cd2e67295d7a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/migration/let_mut_migrate.migration.exp +++ /dev/null @@ -1,12 +0,0 @@ ---- tests/move_2024/migration/let_mut_migrate.move -+++ tests/move_2024/migration/let_mut_migrate.move -@@ -3,3 +3,3 @@ -- public fun t(x: u64, yip: u64, s: S): u64 { -- let yes = 0; -- let S { f: fin } = s; -+ public fun t(mut x: u64, mut yip: u64, s: S): u64 { -+ let mut yes = 0; -+ let S { f: mut fin } = s; -@@ -15 +15 @@ -- let x = 5; let y = 10; -+ let mut x = 5; let mut y = 10; diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/let_mut_migrate.snap b/external-crates/move/crates/move-compiler/tests/move_2024/migration/let_mut_migrate.snap new file mode 100644 index 0000000000000..4b7f608a0b147 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/migration/let_mut_migrate.snap @@ -0,0 +1,76 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/migration/let_mut_migrate.move +--- +warning[W09003]: unused assignment + ┌─ tests/move_2024/migration/let_mut_migrate.move:7:9 + │ +7 │ yip = 0; + │ ^^^ Unused assignment for variable 'yip'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_yip') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/migration/let_mut_migrate.move:7:9 + │ +3 │ public fun t(x: u64, yip: u64, s: S): u64 { + │ --- To use the variable mutably, it must be declared 'mut', e.g. 'mut yip' + · +7 │ yip = 0; + │ ^^^ Invalid assignment of immutable variable 'yip' + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/migration/let_mut_migrate.move:8:9 + │ +3 │ public fun t(x: u64, yip: u64, s: S): u64 { + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' + · +8 │ x = yes + 1; + │ ^ Invalid assignment of immutable variable 'x' + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/migration/let_mut_migrate.move:9:9 + │ +5 │ let S { f: fin } = s; + │ --- To use the variable mutably, it must be declared 'mut', e.g. 'mut fin' + · +9 │ fin = fin + 1; + │ ^^^ Invalid assignment of immutable variable 'fin' + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/migration/let_mut_migrate.move:10:9 + │ + 4 │ let yes = 0; + │ --- To use the variable mutably, it must be declared 'mut', e.g. 'mut yes' + · +10 │ yes = x + fin; + │ ^^^ Invalid assignment of immutable variable 'yes' + +warning[W09003]: unused assignment + ┌─ tests/move_2024/migration/let_mut_migrate.move:15:24 + │ +15 │ let x = 5; let y = 10; + │ ^ Unused assignment for variable 'y'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_y') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/migration/let_mut_migrate.move:16:9 + │ +15 │ let x = 5; let y = 10; + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' +16 │ x = x + 1; + │ ^ Invalid assignment of immutable variable 'x' + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/migration/let_mut_migrate.move:17:9 + │ +15 │ let x = 5; let y = 10; + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut y' +16 │ x = x + 1; +17 │ y = x + 1; + │ ^ Invalid assignment of immutable variable 'y' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/let_mut_migrate@migration.snap b/external-crates/move/crates/move-compiler/tests/move_2024/migration/let_mut_migrate@migration.snap new file mode 100644 index 0000000000000..bad878f42d37f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/migration/let_mut_migrate@migration.snap @@ -0,0 +1,20 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.migration + lint: false +input_file: crates/move-compiler/tests/move_2024/migration/let_mut_migrate.move +--- +--- tests/move_2024/migration/let_mut_migrate.move ++++ tests/move_2024/migration/let_mut_migrate.move +@@ -3,3 +3,3 @@ +- public fun t(x: u64, yip: u64, s: S): u64 { +- let yes = 0; +- let S { f: fin } = s; ++ public fun t(mut x: u64, mut yip: u64, s: S): u64 { ++ let mut yes = 0; ++ let S { f: mut fin } = s; +@@ -15 +15 @@ +- let x = 5; let y = 10; ++ let mut x = 5; let mut y = 10; diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/match_okay.exp b/external-crates/move/crates/move-compiler/tests/move_2024/migration/match_okay.exp deleted file mode 100644 index 12661eefc481d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/migration/match_okay.exp +++ /dev/null @@ -1,46 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_2024/migration/match_okay.move:3:12 - │ -3 │ fun t1(t: u64, match: u64): bool { - │ ^ Unused parameter 't'. Consider removing or prefixing with an underscore: '_t' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01002]: unexpected token - ┌─ tests/move_2024/migration/match_okay.move:3:20 - │ -3 │ fun t1(t: u64, match: u64): bool { - │ ^ Unexpected 'match'. Expected a function parameter - -error[E01002]: unexpected token - ┌─ tests/move_2024/migration/match_okay.move:5:5 - │ -5 │ } - │ ^ - │ │ - │ Unexpected '}' - │ Expected '(' - -warning[W09002]: unused variable - ┌─ tests/move_2024/migration/match_okay.move:7:12 - │ -7 │ fun t2(t: u64, match: u64): bool { - │ ^ Unused parameter 't'. Consider removing or prefixing with an underscore: '_t' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01002]: unexpected token - ┌─ tests/move_2024/migration/match_okay.move:7:20 - │ -7 │ fun t2(t: u64, match: u64): bool { - │ ^ Unexpected 'match'. Expected a function parameter - -error[E01002]: unexpected token - ┌─ tests/move_2024/migration/match_okay.move:8:23 - │ -8 │ if (t == match) { true } else { false } - │ ^ - │ │ - │ Unexpected ')' - │ Expected '(' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/match_okay.migration.exp b/external-crates/move/crates/move-compiler/tests/move_2024/migration/match_okay.migration.exp deleted file mode 100644 index ff8508c16c4d3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/migration/match_okay.migration.exp +++ /dev/null @@ -1,12 +0,0 @@ ---- tests/move_2024/migration/match_okay.move -+++ tests/move_2024/migration/match_okay.move -@@ -3,2 +3,2 @@ -- fun t1(t: u64, match: u64): bool { -- t == match -+ fun t1(t: u64, `match`: u64): bool { -+ t == `match` -@@ -7,2 +7,2 @@ -- fun t2(t: u64, match: u64): bool { -- if (t == match) { true } else { false } -+ fun t2(t: u64, `match`: u64): bool { -+ if (t == `match`) { true } else { false } diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/match_okay.snap b/external-crates/move/crates/move-compiler/tests/move_2024/migration/match_okay.snap new file mode 100644 index 0000000000000..497a2494fb814 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/migration/match_okay.snap @@ -0,0 +1,53 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/migration/match_okay.move +--- +warning[W09002]: unused variable + ┌─ tests/move_2024/migration/match_okay.move:3:12 + │ +3 │ fun t1(t: u64, match: u64): bool { + │ ^ Unused parameter 't'. Consider removing or prefixing with an underscore: '_t' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01002]: unexpected token + ┌─ tests/move_2024/migration/match_okay.move:3:20 + │ +3 │ fun t1(t: u64, match: u64): bool { + │ ^ Unexpected 'match'. Expected a function parameter + +error[E01002]: unexpected token + ┌─ tests/move_2024/migration/match_okay.move:5:5 + │ +5 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected '(' + +warning[W09002]: unused variable + ┌─ tests/move_2024/migration/match_okay.move:7:12 + │ +7 │ fun t2(t: u64, match: u64): bool { + │ ^ Unused parameter 't'. Consider removing or prefixing with an underscore: '_t' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01002]: unexpected token + ┌─ tests/move_2024/migration/match_okay.move:7:20 + │ +7 │ fun t2(t: u64, match: u64): bool { + │ ^ Unexpected 'match'. Expected a function parameter + +error[E01002]: unexpected token + ┌─ tests/move_2024/migration/match_okay.move:8:23 + │ +8 │ if (t == match) { true } else { false } + │ ^ + │ │ + │ Unexpected ')' + │ Expected '(' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/match_okay@migration.snap b/external-crates/move/crates/move-compiler/tests/move_2024/migration/match_okay@migration.snap new file mode 100644 index 0000000000000..d78fcba5d6b55 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/migration/match_okay@migration.snap @@ -0,0 +1,20 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.migration + lint: false +input_file: crates/move-compiler/tests/move_2024/migration/match_okay.move +--- +--- tests/move_2024/migration/match_okay.move ++++ tests/move_2024/migration/match_okay.move +@@ -3,2 +3,2 @@ +- fun t1(t: u64, match: u64): bool { +- t == match ++ fun t1(t: u64, `match`: u64): bool { ++ t == `match` +@@ -7,2 +7,2 @@ +- fun t2(t: u64, match: u64): bool { +- if (t == match) { true } else { false } ++ fun t2(t: u64, `match`: u64): bool { ++ if (t == `match`) { true } else { false } diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/multiline.exp b/external-crates/move/crates/move-compiler/tests/move_2024/migration/multiline.exp deleted file mode 100644 index 233c6a6b3c57a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/migration/multiline.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/multiline.move:3:5 - │ -3 │ ╭ friend // why -4 │ │ a::n; - │ ╰─────────^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/multiline.move:5:5 - │ -5 │ ╭ public( // why folks, why -6 │ │ friend -7 │ │ ) fun t() {} - │ ╰─────^ 'public(friend)' is deprecated. Replace with 'public(package)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/multiline.migration.exp b/external-crates/move/crates/move-compiler/tests/move_2024/migration/multiline.migration.exp deleted file mode 100644 index ab87a272e7d46..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/migration/multiline.migration.exp +++ /dev/null @@ -1,11 +0,0 @@ ---- tests/move_2024/migration/multiline.move -+++ tests/move_2024/migration/multiline.move -@@ -3,5 +3,3 @@ -- friend // why -- a::n; -- public( // why folks, why -- friend -- ) fun t() {} -+ /* friend // why -+ a::n; */ -+ public(package) fun t() {} diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/multiline.snap b/external-crates/move/crates/move-compiler/tests/move_2024/migration/multiline.snap new file mode 100644 index 0000000000000..e79ac912e31e2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/migration/multiline.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/migration/multiline.move +--- +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/multiline.move:3:5 + │ +3 │ ╭ friend // why +4 │ │ a::n; + │ ╰─────────^ 'friend's are deprecated. Remove and replace 'public(friend)' with 'public(package)' + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/multiline.move:5:5 + │ +5 │ ╭ public( // why folks, why +6 │ │ friend +7 │ │ ) fun t() {} + │ ╰─────^ 'public(friend)' is deprecated. Replace with 'public(package)' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/multiline@migration.snap b/external-crates/move/crates/move-compiler/tests/move_2024/migration/multiline@migration.snap new file mode 100644 index 0000000000000..bad044b09c683 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/migration/multiline@migration.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.migration + lint: false +input_file: crates/move-compiler/tests/move_2024/migration/multiline.move +--- +--- tests/move_2024/migration/multiline.move ++++ tests/move_2024/migration/multiline.move +@@ -3,5 +3,3 @@ +- friend // why +- a::n; +- public( // why folks, why +- friend +- ) fun t() {} ++ /* friend // why ++ a::n; */ ++ public(package) fun t() {} diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_friend.exp b/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_friend.exp deleted file mode 100644 index 4ab4450529dc6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_friend.exp +++ /dev/null @@ -1,51 +0,0 @@ -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/public_friend.move:3:5 - │ -3 │ public( friend ) fun t0() {} - │ ^^^^^^^^^^^^^^^^ 'public(friend)' is deprecated. Replace with 'public(package)' - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/public_friend.move:5:5 - │ -5 │ public(friend) fun t1() {} - │ ^^^^^^^^^^^^^^ 'public(friend)' is deprecated. Replace with 'public(package)' - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/public_friend.move:7:5 - │ -7 │ ╭ public( -8 │ │ friend) fun t2() {} - │ ╰───────────────^ 'public(friend)' is deprecated. Replace with 'public(package)' - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/public_friend.move:10:5 - │ -10 │ ╭ public( -11 │ │ friend -12 │ │ ) fun t3() {} - │ ╰─────────^ 'public(friend)' is deprecated. Replace with 'public(package)' - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/public_friend.move:14:5 - │ -14 │ ╭ public( -15 │ │ friend -16 │ │ /* comment */ -17 │ │ ) fun t4() {} - │ ╰─────^ 'public(friend)' is deprecated. Replace with 'public(package)' - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/public_friend.move:20:5 - │ -20 │ ╭ public( -21 │ │ friend -22 │ │ /* deleted-comment */ -23 │ │ )/* stays-comment */ fun t5() {} - │ ╰─────^ 'public(friend)' is deprecated. Replace with 'public(package)' - -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/migration/public_friend.move:25:14 - │ -25 │ /*stays*/public(/*deleted*/friend/*deleted*/)/*stays*/fun t6() {} - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 'public(friend)' is deprecated. Replace with 'public(package)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_friend.migration.exp b/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_friend.migration.exp deleted file mode 100644 index 3f8c548d060dd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_friend.migration.exp +++ /dev/null @@ -1,32 +0,0 @@ ---- tests/move_2024/migration/public_friend.move -+++ tests/move_2024/migration/public_friend.move -@@ -3 +3 @@ -- public( friend ) fun t0() {} -+ public(package) fun t0() {} -@@ -5 +5 @@ -- public(friend) fun t1() {} -+ public(package) fun t1() {} -@@ -7,2 +7 @@ -- public( -- friend) fun t2() {} -+ public(package) fun t2() {} -@@ -10,3 +9 @@ -- public( -- friend -- ) fun t3() {} -+ public(package) fun t3() {} -@@ -14,4 +11 @@ -- public( -- friend -- /* comment */ -- ) fun t4() {} -+ public(package) fun t4() {} -@@ -20,4 +14 @@ -- public( -- friend -- /* deleted-comment */ -- )/* stays-comment */ fun t5() {} -+ public(package)/* stays-comment */ fun t5() {} -@@ -25 +16 @@ -- /*stays*/public(/*deleted*/friend/*deleted*/)/*stays*/fun t6() {} -+ /*stays*/public(package)/*stays*/fun t6() {} diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_friend.snap b/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_friend.snap new file mode 100644 index 0000000000000..d9e8771469b12 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_friend.snap @@ -0,0 +1,58 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/migration/public_friend.move +--- +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/public_friend.move:3:5 + │ +3 │ public( friend ) fun t0() {} + │ ^^^^^^^^^^^^^^^^ 'public(friend)' is deprecated. Replace with 'public(package)' + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/public_friend.move:5:5 + │ +5 │ public(friend) fun t1() {} + │ ^^^^^^^^^^^^^^ 'public(friend)' is deprecated. Replace with 'public(package)' + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/public_friend.move:7:5 + │ +7 │ ╭ public( +8 │ │ friend) fun t2() {} + │ ╰───────────────^ 'public(friend)' is deprecated. Replace with 'public(package)' + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/public_friend.move:10:5 + │ +10 │ ╭ public( +11 │ │ friend +12 │ │ ) fun t3() {} + │ ╰─────────^ 'public(friend)' is deprecated. Replace with 'public(package)' + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/public_friend.move:14:5 + │ +14 │ ╭ public( +15 │ │ friend +16 │ │ /* comment */ +17 │ │ ) fun t4() {} + │ ╰─────^ 'public(friend)' is deprecated. Replace with 'public(package)' + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/public_friend.move:20:5 + │ +20 │ ╭ public( +21 │ │ friend +22 │ │ /* deleted-comment */ +23 │ │ )/* stays-comment */ fun t5() {} + │ ╰─────^ 'public(friend)' is deprecated. Replace with 'public(package)' + +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/migration/public_friend.move:25:14 + │ +25 │ /*stays*/public(/*deleted*/friend/*deleted*/)/*stays*/fun t6() {} + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 'public(friend)' is deprecated. Replace with 'public(package)' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_friend@migration.snap b/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_friend@migration.snap new file mode 100644 index 0000000000000..3145890840310 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_friend@migration.snap @@ -0,0 +1,40 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.migration + lint: false +input_file: crates/move-compiler/tests/move_2024/migration/public_friend.move +--- +--- tests/move_2024/migration/public_friend.move ++++ tests/move_2024/migration/public_friend.move +@@ -3 +3 @@ +- public( friend ) fun t0() {} ++ public(package) fun t0() {} +@@ -5 +5 @@ +- public(friend) fun t1() {} ++ public(package) fun t1() {} +@@ -7,2 +7 @@ +- public( +- friend) fun t2() {} ++ public(package) fun t2() {} +@@ -10,3 +9 @@ +- public( +- friend +- ) fun t3() {} ++ public(package) fun t3() {} +@@ -14,4 +11 @@ +- public( +- friend +- /* comment */ +- ) fun t4() {} ++ public(package) fun t4() {} +@@ -20,4 +14 @@ +- public( +- friend +- /* deleted-comment */ +- )/* stays-comment */ fun t5() {} ++ public(package)/* stays-comment */ fun t5() {} +@@ -25 +16 @@ +- /*stays*/public(/*deleted*/friend/*deleted*/)/*stays*/fun t6() {} ++ /*stays*/public(package)/*stays*/fun t6() {} diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_struct_migrate.exp b/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_struct_migrate.exp deleted file mode 100644 index fb107544226f5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_struct_migrate.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/migration/public_struct_migrate.move:2:5 - │ -2 │ struct S { f: u64 } - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E01003]: invalid modifier - ┌─ tests/move_2024/migration/public_struct_migrate.move:4:5 - │ -4 │ struct LongerName { - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E01003]: invalid modifier - ┌─ tests/move_2024/migration/public_struct_migrate.move:9:5 - │ -9 │ struct Positional(u64, u64, u64) - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_struct_migrate.migration.exp b/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_struct_migrate.migration.exp deleted file mode 100644 index 6f8be0ec732fb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_struct_migrate.migration.exp +++ /dev/null @@ -1,11 +0,0 @@ ---- tests/move_2024/migration/public_struct_migrate.move -+++ tests/move_2024/migration/public_struct_migrate.move -@@ -2 +2 @@ -- struct S { f: u64 } -+ public struct S { f: u64 } -@@ -4 +4 @@ -- struct LongerName { -+ public struct LongerName { -@@ -9 +9 @@ -- struct Positional(u64, u64, u64) -+ public struct Positional(u64, u64, u64) diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_struct_migrate.snap b/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_struct_migrate.snap new file mode 100644 index 0000000000000..d6c6c862d8e7c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_struct_migrate.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/migration/public_struct_migrate.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/migration/public_struct_migrate.move:2:5 + │ +2 │ struct S { f: u64 } + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E01003]: invalid modifier + ┌─ tests/move_2024/migration/public_struct_migrate.move:4:5 + │ +4 │ struct LongerName { + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E01003]: invalid modifier + ┌─ tests/move_2024/migration/public_struct_migrate.move:9:5 + │ +9 │ struct Positional(u64, u64, u64) + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_struct_migrate@migration.snap b/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_struct_migrate@migration.snap new file mode 100644 index 0000000000000..7a3e80a59ae78 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/migration/public_struct_migrate@migration.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.migration + lint: false +input_file: crates/move-compiler/tests/move_2024/migration/public_struct_migrate.move +--- +--- tests/move_2024/migration/public_struct_migrate.move ++++ tests/move_2024/migration/public_struct_migrate.move +@@ -2 +2 @@ +- struct S { f: u64 } ++ public struct S { f: u64 } +@@ -4 +4 @@ +- struct LongerName { ++ public struct LongerName { +@@ -9 +9 @@ +- struct Positional(u64, u64, u64) ++ public struct Positional(u64, u64, u64) diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/clever_errors_line_assert.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/clever_errors_line_assert.exp deleted file mode 100644 index c2c8602b077d9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/clever_errors_line_assert.exp +++ /dev/null @@ -1,17 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_2024/naming/clever_errors_line_assert.move:3:9 - │ -3 │ assert(false); - │ ^^^^^^^^^^^^^ 'assert' function syntax has been deprecated and will be removed - │ - = Replace with 'assert!'. 'assert' has been replaced with a 'assert!' built-in macro so that arguments are no longer eagerly evaluated - -error[E04016]: too few arguments - ┌─ tests/move_2024/naming/clever_errors_line_assert.move:3:9 - │ -3 │ assert(false); - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of 'assert'. The call expected 2 argument(s) but got 1 - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/clever_errors_line_assert.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/clever_errors_line_assert.snap new file mode 100644 index 0000000000000..be9ed2ebad3a1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/clever_errors_line_assert.snap @@ -0,0 +1,24 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/clever_errors_line_assert.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_2024/naming/clever_errors_line_assert.move:3:9 + │ +3 │ assert(false); + │ ^^^^^^^^^^^^^ 'assert' function syntax has been deprecated and will be removed + │ + = Replace with 'assert!'. 'assert' has been replaced with a 'assert!' built-in macro so that arguments are no longer eagerly evaluated + +error[E04016]: too few arguments + ┌─ tests/move_2024/naming/clever_errors_line_assert.move:3:9 + │ +3 │ assert(false); + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of 'assert'. The call expected 2 argument(s) but got 1 diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_explicit.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_explicit.exp deleted file mode 100644 index 921e473e3ecce..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_explicit.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/naming/duplicate_use_fun_explicit.move:10:5 - │ - 7 │ public use fun foobar as X.f; - │ - Previously declared here - · -10 │ public use fun foobaz as X.f; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Duplicate 'use fun' for 'a::m::X.f' - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/naming/duplicate_use_fun_explicit.move:25:5 - │ -22 │ public use fun foobar as X.f; - │ - Previously declared here - · -25 │ use fun foobaz as X.f; - │ ^^^^^^^^^^^^^^^^^^^^^^ Duplicate 'use fun' for 'a::m2::X.f' - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/naming/duplicate_use_fun_explicit.move:40:5 - │ -37 │ use fun foobar as X.f; - │ - Previously declared here - · -40 │ use fun foobaz as X.f; - │ ^^^^^^^^^^^^^^^^^^^^^^ Duplicate 'use fun' for 'a::m3::X.f' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_explicit.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_explicit.snap new file mode 100644 index 0000000000000..ae5ce3368518d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_explicit.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_explicit.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/naming/duplicate_use_fun_explicit.move:10:5 + │ + 7 │ public use fun foobar as X.f; + │ - Previously declared here + · +10 │ public use fun foobaz as X.f; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Duplicate 'use fun' for 'a::m::X.f' + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/naming/duplicate_use_fun_explicit.move:25:5 + │ +22 │ public use fun foobar as X.f; + │ - Previously declared here + · +25 │ use fun foobaz as X.f; + │ ^^^^^^^^^^^^^^^^^^^^^^ Duplicate 'use fun' for 'a::m2::X.f' + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/naming/duplicate_use_fun_explicit.move:40:5 + │ +37 │ use fun foobar as X.f; + │ - Previously declared here + · +40 │ use fun foobaz as X.f; + │ ^^^^^^^^^^^^^^^^^^^^^^ Duplicate 'use fun' for 'a::m3::X.f' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_with_fun_declaration.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_with_fun_declaration.exp deleted file mode 100644 index 6c3b2bf11dcbe..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_with_fun_declaration.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/naming/duplicate_use_fun_with_fun_declaration.move:7:9 - │ -4 │ public use fun foobar as X.foobaz; - │ ------ Previously declared here - · -7 │ fun foobaz(_: &X, _: u64) {} - │ ^^^^^^ - Function declarations create an implicit 'use fun' when their first argument is a type defined in the same module - │ │ - │ Duplicate 'use fun' for 'a::m::X.foobaz' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_with_fun_declaration.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_with_fun_declaration.snap new file mode 100644 index 0000000000000..3aa04db41e427 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_with_fun_declaration.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_with_fun_declaration.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/naming/duplicate_use_fun_with_fun_declaration.move:7:9 + │ +4 │ public use fun foobar as X.foobaz; + │ ------ Previously declared here + · +7 │ fun foobaz(_: &X, _: u64) {} + │ ^^^^^^ - Function declarations create an implicit 'use fun' when their first argument is a type defined in the same module + │ │ + │ Duplicate 'use fun' for 'a::m::X.foobaz' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_with_normal_use.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_with_normal_use.exp deleted file mode 100644 index 01e864dce60ed..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_with_normal_use.exp +++ /dev/null @@ -1,22 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/naming/duplicate_use_fun_with_normal_use.move:8:37 - │ -4 │ public fun foobar(_: &X) {} - │ - 'use' function aliases create an implicit 'use fun' when their first argument is a type defined in that module - · -8 │ use a::m::{X, foobar, foobar as foobaz}; - │ ^^^^^^ Duplicate 'use fun' for 'a::m::X.foobaz' -9 │ use fun foobar as X.foobaz; - │ ------ Previously declared here - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/naming/duplicate_use_fun_with_normal_use.move:19:41 - │ - 4 │ public fun foobar(_: &X) {} - │ - 'use' function aliases create an implicit 'use fun' when their first argument is a type defined in that module - · -19 │ use a::m::{X, foobar, foobar as foobaz}; - │ ^^^^^^ Duplicate 'use fun' for 'a::m::X.foobaz' -20 │ use fun foobar as X.foobaz; - │ ------ Previously declared here - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_with_normal_use.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_with_normal_use.snap new file mode 100644 index 0000000000000..12a18bebc8a38 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_with_normal_use.snap @@ -0,0 +1,29 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/duplicate_use_fun_with_normal_use.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/naming/duplicate_use_fun_with_normal_use.move:8:37 + │ +4 │ public fun foobar(_: &X) {} + │ - 'use' function aliases create an implicit 'use fun' when their first argument is a type defined in that module + · +8 │ use a::m::{X, foobar, foobar as foobaz}; + │ ^^^^^^ Duplicate 'use fun' for 'a::m::X.foobaz' +9 │ use fun foobar as X.foobaz; + │ ------ Previously declared here + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/naming/duplicate_use_fun_with_normal_use.move:19:41 + │ + 4 │ public fun foobar(_: &X) {} + │ - 'use' function aliases create an implicit 'use fun' when their first argument is a type defined in that module + · +19 │ use a::m::{X, foobar, foobar as foobaz}; + │ ^^^^^^ Duplicate 'use fun' for 'a::m::X.foobaz' +20 │ use fun foobar as X.foobaz; + │ ------ Previously declared here diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_fun_invalid_redefinition.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_fun_invalid_redefinition.exp deleted file mode 100644 index 77a5ec0568d50..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_fun_invalid_redefinition.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E02015]: invalid attribute - ┌─ tests/move_2024/naming/index_fun_invalid_redefinition.move:8:14 - │ -6 │ public fun index_s(s: &S): &S { s } - │ ------- This syntax method was previously defined here. -7 │ -8 │ #[syntax(index)] - │ ^^^^^ Redefined 'index' 'syntax' method for '0x42::m::S' - -error[E02015]: invalid attribute - ┌─ tests/move_2024/naming/index_fun_invalid_redefinition.move:14:14 - │ -12 │ public fun index_mut_s(s: &mut S): &mut S { s } - │ ----------- This syntax method was previously defined here. -13 │ -14 │ #[syntax(index)] - │ ^^^^^ Redefined mutable 'index' 'syntax' method for '0x42::m::S' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_fun_invalid_redefinition.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_fun_invalid_redefinition.snap new file mode 100644 index 0000000000000..f01a479f7383c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_fun_invalid_redefinition.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/index_fun_invalid_redefinition.move +--- +error[E02015]: invalid attribute + ┌─ tests/move_2024/naming/index_fun_invalid_redefinition.move:8:14 + │ +6 │ public fun index_s(s: &S): &S { s } + │ ------- This syntax method was previously defined here. +7 │ +8 │ #[syntax(index)] + │ ^^^^^ Redefined 'index' 'syntax' method for '0x42::m::S' + +error[E02015]: invalid attribute + ┌─ tests/move_2024/naming/index_fun_invalid_redefinition.move:14:14 + │ +12 │ public fun index_mut_s(s: &mut S): &mut S { s } + │ ----------- This syntax method was previously defined here. +13 │ +14 │ #[syntax(index)] + │ ^^^^^ Redefined mutable 'index' 'syntax' method for '0x42::m::S' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_invalid_return.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_invalid_return.exp deleted file mode 100644 index ce87df9c07a98..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_invalid_return.exp +++ /dev/null @@ -1,57 +0,0 @@ -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_invalid_return.move:5:14 - │ -5 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation. This syntax method must return an immutable reference -6 │ public fun index_s(_s: &S): |u64| -> u64 { abort 0 } - │ -- ------------ This is not an immutable reference - │ │ - │ Immutable subject type defined here - -error[E04030]: invalid usage of lambda type - ┌─ tests/move_2024/naming/index_syntax_methods_invalid_return.move:6:33 - │ -6 │ public fun index_s(_s: &S): |u64| -> u64 { abort 0 } - │ ^^^^^^^^^^^^ Unexpected lambda type. Lambdas can only be used with 'macro' functions, as parameters or direct arguments - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_invalid_return.move:8:14 - │ -8 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation. This syntax method must return a mutable reference -9 │ public fun index_s_mut(_s: &mut S): () { abort 0 } - │ ------ -- This is not a mutable reference - │ │ - │ Mutable subject type defined here - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_invalid_return.move:13:14 - │ -13 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation. A syntax method cannot return a function -14 │ public fun index_t(_t: &T): &(|u64| -> u64) { abort 0 } - │ -------------- But a function type appears in this return type - -error[E04030]: invalid usage of lambda type - ┌─ tests/move_2024/naming/index_syntax_methods_invalid_return.move:14:34 - │ -14 │ public fun index_t(_t: &T): &(|u64| -> u64) { abort 0 } - │ ^^^^^^^^^^^^^^ Unexpected lambda type. Lambdas can only be used with 'macro' functions, as parameters or direct arguments - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_invalid_return.move:16:14 - │ -16 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation. This syntax method cannot return a unit type -17 │ public fun index_t_mut(_t: &mut T): &mut () { abort 0 } - │ -- Unit type occurs as the return type for this function - -error[E04004]: expected a single non-reference type - ┌─ tests/move_2024/naming/index_syntax_methods_invalid_return.move:17:41 - │ -17 │ public fun index_t_mut(_t: &mut T): &mut () { abort 0 } - │ ^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '()' - │ Invalid reference type - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_invalid_return.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_invalid_return.snap new file mode 100644 index 0000000000000..a8b9a6b21cc6e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_invalid_return.snap @@ -0,0 +1,64 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/index_syntax_methods_invalid_return.move +--- +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_invalid_return.move:5:14 + │ +5 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation. This syntax method must return an immutable reference +6 │ public fun index_s(_s: &S): |u64| -> u64 { abort 0 } + │ -- ------------ This is not an immutable reference + │ │ + │ Immutable subject type defined here + +error[E04030]: invalid usage of lambda type + ┌─ tests/move_2024/naming/index_syntax_methods_invalid_return.move:6:33 + │ +6 │ public fun index_s(_s: &S): |u64| -> u64 { abort 0 } + │ ^^^^^^^^^^^^ Unexpected lambda type. Lambdas can only be used with 'macro' functions, as parameters or direct arguments + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_invalid_return.move:8:14 + │ +8 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation. This syntax method must return a mutable reference +9 │ public fun index_s_mut(_s: &mut S): () { abort 0 } + │ ------ -- This is not a mutable reference + │ │ + │ Mutable subject type defined here + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_invalid_return.move:13:14 + │ +13 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation. A syntax method cannot return a function +14 │ public fun index_t(_t: &T): &(|u64| -> u64) { abort 0 } + │ -------------- But a function type appears in this return type + +error[E04030]: invalid usage of lambda type + ┌─ tests/move_2024/naming/index_syntax_methods_invalid_return.move:14:34 + │ +14 │ public fun index_t(_t: &T): &(|u64| -> u64) { abort 0 } + │ ^^^^^^^^^^^^^^ Unexpected lambda type. Lambdas can only be used with 'macro' functions, as parameters or direct arguments + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_invalid_return.move:16:14 + │ +16 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation. This syntax method cannot return a unit type +17 │ public fun index_t_mut(_t: &mut T): &mut () { abort 0 } + │ -- Unit type occurs as the return type for this function + +error[E04004]: expected a single non-reference type + ┌─ tests/move_2024/naming/index_syntax_methods_invalid_return.move:17:41 + │ +17 │ public fun index_t_mut(_t: &mut T): &mut () { abort 0 } + │ ^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '()' + │ Invalid reference type diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_invalid_subject.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_invalid_subject.exp deleted file mode 100644 index 83f4eb9170f35..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_invalid_subject.exp +++ /dev/null @@ -1,56 +0,0 @@ -error[E02015]: invalid attribute - ┌─ tests/move_2024/naming/index_syntax_methods_invalid_subject.move:5:14 - │ -5 │ #[syntax(index)] - │ ^^^^^ 'index' is only valid if the first parameter's type is a reference as '&' or '&mut' -6 │ public fun index_s(_s: S, i: &u64): &u64 { i } - │ - This type is not a reference - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_invalid_subject.move:8:7 - │ -8 │ #[syntax(index)] - │ ^^^^^^^^^^^^^ Invalid syntax annotation. Cannot associate a syntax method with a type parameter -9 │ public fun index_t(_s: T, i: &u64): &u64 { i } - │ - But 'T' was declared as a type parameter here - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_invalid_subject.move:12:40 - │ -12 │ public fun index_multi_s(_mutli_s: (S,S), i: &u64): &u64 { i } - │ ^^^^^ Invalid type for syntax method definition - │ - = Syntax methods may only be defined for single base types - -error[E04005]: expected a single type - ┌─ tests/move_2024/naming/index_syntax_methods_invalid_subject.move:12:40 - │ -12 │ public fun index_multi_s(_mutli_s: (S,S), i: &u64): &u64 { i } - │ ^^^^^ - │ │ - │ Invalid parameter type - │ Expected a single type, but found expression list type: '(0x42::a::S, 0x42::a::S)' - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_invalid_subject.move:15:34 - │ -15 │ public fun index_unit(_unit: (), i: &u64): &u64 { i } - │ ^^ Invalid type for syntax method definition - │ - = Syntax methods may only be defined for single base types - -error[E04005]: expected a single type - ┌─ tests/move_2024/naming/index_syntax_methods_invalid_subject.move:15:34 - │ -15 │ public fun index_unit(_unit: (), i: &u64): &u64 { i } - │ ^^ - │ │ - │ Invalid parameter type - │ Expected a single type, but found expression list type: '()' - -error[E02015]: invalid attribute - ┌─ tests/move_2024/naming/index_syntax_methods_invalid_subject.move:17:7 - │ -17 │ #[syntax(index)] - │ ^^^^^^^^^^^^^ Invalid attribute. syntax is only valid if the function takes at least one parameter - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_invalid_subject.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_invalid_subject.snap new file mode 100644 index 0000000000000..a0d12b5fb800f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_invalid_subject.snap @@ -0,0 +1,63 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/index_syntax_methods_invalid_subject.move +--- +error[E02015]: invalid attribute + ┌─ tests/move_2024/naming/index_syntax_methods_invalid_subject.move:5:14 + │ +5 │ #[syntax(index)] + │ ^^^^^ 'index' is only valid if the first parameter's type is a reference as '&' or '&mut' +6 │ public fun index_s(_s: S, i: &u64): &u64 { i } + │ - This type is not a reference + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_invalid_subject.move:8:7 + │ +8 │ #[syntax(index)] + │ ^^^^^^^^^^^^^ Invalid syntax annotation. Cannot associate a syntax method with a type parameter +9 │ public fun index_t(_s: T, i: &u64): &u64 { i } + │ - But 'T' was declared as a type parameter here + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_invalid_subject.move:12:40 + │ +12 │ public fun index_multi_s(_mutli_s: (S,S), i: &u64): &u64 { i } + │ ^^^^^ Invalid type for syntax method definition + │ + = Syntax methods may only be defined for single base types + +error[E04005]: expected a single type + ┌─ tests/move_2024/naming/index_syntax_methods_invalid_subject.move:12:40 + │ +12 │ public fun index_multi_s(_mutli_s: (S,S), i: &u64): &u64 { i } + │ ^^^^^ + │ │ + │ Invalid parameter type + │ Expected a single type, but found expression list type: '(0x42::a::S, 0x42::a::S)' + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_invalid_subject.move:15:34 + │ +15 │ public fun index_unit(_unit: (), i: &u64): &u64 { i } + │ ^^ Invalid type for syntax method definition + │ + = Syntax methods may only be defined for single base types + +error[E04005]: expected a single type + ┌─ tests/move_2024/naming/index_syntax_methods_invalid_subject.move:15:34 + │ +15 │ public fun index_unit(_unit: (), i: &u64): &u64 { i } + │ ^^ + │ │ + │ Invalid parameter type + │ Expected a single type, but found expression list type: '()' + +error[E02015]: invalid attribute + ┌─ tests/move_2024/naming/index_syntax_methods_invalid_subject.move:17:7 + │ +17 │ #[syntax(index)] + │ ^^^^^^^^^^^^^ Invalid attribute. syntax is only valid if the function takes at least one parameter diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_macro_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_macro_invalid.exp deleted file mode 100644 index 515936543653d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_macro_invalid.exp +++ /dev/null @@ -1,32 +0,0 @@ -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_macro_invalid.move:6:7 - │ -6 │ #[syntax(index)] - │ ^^^^^^^^^^^^^ Syntax attributes may not appear on macro definitions -7 │ public macro fun borrow<$T>($s: &S<$T>, $i: u64): &mut u64 { abort 0 } - │ ----- This function is a macro - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_macro_invalid.move:16:7 - │ -16 │ #[syntax(index)] - │ ^^^^^^^^^^^^^ Syntax attributes may not appear on macro definitions -17 │ public macro fun borrow<$T>($s: &mut S<$T>, $i: u64): &u64 { abort 0 } - │ ----- This function is a macro - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_macro_invalid.move:26:7 - │ -26 │ #[syntax(index)] - │ ^^^^^^^^^^^^^ Syntax attributes may not appear on macro definitions -27 │ public macro fun borrow<$T>($s: &mut S<$T>, $i: u64): &u64 { abort 0 } - │ ----- This function is a macro - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_macro_invalid.move:30:7 - │ -30 │ #[syntax(index)] - │ ^^^^^^^^^^^^^ Syntax attributes may not appear on macro definitions -31 │ public macro fun borrow_mut<$T>($s: &mut S<$T>, $i: u64): &u64 { abort 0 } - │ ----- This function is a macro - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_macro_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_macro_invalid.snap new file mode 100644 index 0000000000000..5b3914c1a1d67 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_macro_invalid.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/index_syntax_methods_macro_invalid.move +--- +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_macro_invalid.move:6:7 + │ +6 │ #[syntax(index)] + │ ^^^^^^^^^^^^^ Syntax attributes may not appear on macro definitions +7 │ public macro fun borrow<$T>($s: &S<$T>, $i: u64): &mut u64 { abort 0 } + │ ----- This function is a macro + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_macro_invalid.move:16:7 + │ +16 │ #[syntax(index)] + │ ^^^^^^^^^^^^^ Syntax attributes may not appear on macro definitions +17 │ public macro fun borrow<$T>($s: &mut S<$T>, $i: u64): &u64 { abort 0 } + │ ----- This function is a macro + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_macro_invalid.move:26:7 + │ +26 │ #[syntax(index)] + │ ^^^^^^^^^^^^^ Syntax attributes may not appear on macro definitions +27 │ public macro fun borrow<$T>($s: &mut S<$T>, $i: u64): &u64 { abort 0 } + │ ----- This function is a macro + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_macro_invalid.move:30:7 + │ +30 │ #[syntax(index)] + │ ^^^^^^^^^^^^^ Syntax attributes may not appear on macro definitions +31 │ public macro fun borrow_mut<$T>($s: &mut S<$T>, $i: u64): &u64 { abort 0 } + │ ----- This function is a macro diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_mismatched_args.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_mismatched_args.exp deleted file mode 100644 index 7d6972ca087cd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_mismatched_args.exp +++ /dev/null @@ -1,19 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/naming/index_syntax_methods_mismatched_args.move:3:5 - │ -3 │ struct S {} - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/naming/index_syntax_methods_mismatched_args.move:6:16 - │ -6 │ public fun index_s(s: &S): &S { s } - │ ^^^^^^^ This index function expects 1 parameters - · -9 │ public fun index_mut_s(s: &mut S, _i: u64): &mut S { s } - │ ----------- This mutable index function expects 2 parameters - │ - = Index operations on the same type must take the name number of parameters - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_mismatched_args.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_mismatched_args.snap new file mode 100644 index 0000000000000..bf8255e06b4fa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_mismatched_args.snap @@ -0,0 +1,26 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/index_syntax_methods_mismatched_args.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/naming/index_syntax_methods_mismatched_args.move:3:5 + │ +3 │ struct S {} + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/naming/index_syntax_methods_mismatched_args.move:6:16 + │ +6 │ public fun index_s(s: &S): &S { s } + │ ^^^^^^^ This index function expects 1 parameters + · +9 │ public fun index_mut_s(s: &mut S, _i: u64): &mut S { s } + │ ----------- This mutable index function expects 2 parameters + │ + = Index operations on the same type must take the name number of parameters diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_return_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_return_invalid.exp deleted file mode 100644 index e6537f6362281..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_return_invalid.exp +++ /dev/null @@ -1,110 +0,0 @@ -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:22:14 - │ -22 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation -23 │ public fun borrow_t(_s: &S, _i: u64): &mut u64 { abort 0 } - │ -- -------- This syntax method must return an immutable reference to match its subject type - │ │ - │ Immutable subject type defined here - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:27:14 - │ -27 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation. This syntax method must return an immutable reference -28 │ public fun borrow_t2(s: &S2, i: u64): u64 { - │ --- --- This is not an immutable reference - │ │ - │ Immutable subject type defined here - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:34:14 - │ -34 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation. This syntax method must return an immutable reference -35 │ public fun borrow_t3(s: &S3, i: u64): bool { - │ --- ---- This is not an immutable reference - │ │ - │ Immutable subject type defined here - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:47:14 - │ -47 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation -48 │ public fun borrow_t(s: &mut S, i: u64): &u64 { - │ ------ ---- This syntax method must return a mutable reference to match its subject type - │ │ - │ Mutable subject type defined here - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:54:14 - │ -54 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation. This syntax method must return a mutable reference -55 │ public fun borrow_t2(s: &mut S2, i: u64): u64 { - │ ------- --- This is not a mutable reference - │ │ - │ Mutable subject type defined here - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:61:14 - │ -61 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation. This syntax method must return a mutable reference -62 │ public fun borrow_t3(s: &mut S3, i: u64): bool { - │ ------- ---- This is not a mutable reference - │ │ - │ Mutable subject type defined here - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:73:14 - │ -73 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation -74 │ public fun borrow_t(_s: &S, _i: u64): &mut u64 { abort 0 } - │ ----- -------- This syntax method must return an immutable reference to match its subject type - │ │ - │ Immutable subject type defined here - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:79:14 - │ -79 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation. This syntax method must return an immutable reference -80 │ public fun borrow_t2(_s: &S2, _i: u64): T { abort 0 } - │ ------ - This is not an immutable reference - │ │ - │ Immutable subject type defined here - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:85:14 - │ -85 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation. This syntax method must return an immutable reference -86 │ public fun borrow_t3(_s: &S3, _i: u64): bool { abort 0 } - │ ------ ---- This is not an immutable reference - │ │ - │ Immutable subject type defined here - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:95:14 - │ -95 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation -96 │ public fun borrow_t(_s: &mut S, _i: u64): &u64 { abort 0 } - │ --------- ---- This syntax method must return a mutable reference to match its subject type - │ │ - │ Mutable subject type defined here - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:101:14 - │ -101 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation. This syntax method must return a mutable reference -102 │ public fun borrow_t2(_s: &mut S2, _i: u64): T { abort 0 } - │ ---------- - This is not a mutable reference - │ │ - │ Mutable subject type defined here - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_return_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_return_invalid.snap new file mode 100644 index 0000000000000..9d0c10b904fc4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_return_invalid.snap @@ -0,0 +1,117 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/index_syntax_methods_return_invalid.move +--- +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:22:14 + │ +22 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation +23 │ public fun borrow_t(_s: &S, _i: u64): &mut u64 { abort 0 } + │ -- -------- This syntax method must return an immutable reference to match its subject type + │ │ + │ Immutable subject type defined here + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:27:14 + │ +27 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation. This syntax method must return an immutable reference +28 │ public fun borrow_t2(s: &S2, i: u64): u64 { + │ --- --- This is not an immutable reference + │ │ + │ Immutable subject type defined here + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:34:14 + │ +34 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation. This syntax method must return an immutable reference +35 │ public fun borrow_t3(s: &S3, i: u64): bool { + │ --- ---- This is not an immutable reference + │ │ + │ Immutable subject type defined here + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:47:14 + │ +47 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation +48 │ public fun borrow_t(s: &mut S, i: u64): &u64 { + │ ------ ---- This syntax method must return a mutable reference to match its subject type + │ │ + │ Mutable subject type defined here + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:54:14 + │ +54 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation. This syntax method must return a mutable reference +55 │ public fun borrow_t2(s: &mut S2, i: u64): u64 { + │ ------- --- This is not a mutable reference + │ │ + │ Mutable subject type defined here + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:61:14 + │ +61 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation. This syntax method must return a mutable reference +62 │ public fun borrow_t3(s: &mut S3, i: u64): bool { + │ ------- ---- This is not a mutable reference + │ │ + │ Mutable subject type defined here + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:73:14 + │ +73 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation +74 │ public fun borrow_t(_s: &S, _i: u64): &mut u64 { abort 0 } + │ ----- -------- This syntax method must return an immutable reference to match its subject type + │ │ + │ Immutable subject type defined here + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:79:14 + │ +79 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation. This syntax method must return an immutable reference +80 │ public fun borrow_t2(_s: &S2, _i: u64): T { abort 0 } + │ ------ - This is not an immutable reference + │ │ + │ Immutable subject type defined here + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:85:14 + │ +85 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation. This syntax method must return an immutable reference +86 │ public fun borrow_t3(_s: &S3, _i: u64): bool { abort 0 } + │ ------ ---- This is not an immutable reference + │ │ + │ Immutable subject type defined here + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:95:14 + │ +95 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation +96 │ public fun borrow_t(_s: &mut S, _i: u64): &u64 { abort 0 } + │ --------- ---- This syntax method must return a mutable reference to match its subject type + │ │ + │ Mutable subject type defined here + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_return_invalid.move:101:14 + │ +101 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation. This syntax method must return a mutable reference +102 │ public fun borrow_t2(_s: &mut S2, _i: u64): T { abort 0 } + │ ---------- - This is not a mutable reference + │ │ + │ Mutable subject type defined here diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_return_mismatch.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_return_mismatch.exp deleted file mode 100644 index 7410a542b494d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_return_mismatch.exp +++ /dev/null @@ -1,65 +0,0 @@ -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_return_mismatch.move:21:14 - │ -21 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation -22 │ public fun borrow_t(s: &S, i: u64): &mut u64 { - │ -- -------- This syntax method must return an immutable reference to match its subject type - │ │ - │ Immutable subject type defined here - -error[E04006]: invalid subtype - ┌─ tests/move_2024/naming/index_syntax_methods_return_mismatch.move:23:9 - │ - 7 │ native public fun borrow(v: &vector, i: u64): ∈ - │ -------- Given: '&u64' - · -22 │ public fun borrow_t(s: &S, i: u64): &mut u64 { - │ -------- Expected: '&mut u64' -23 │ vector::borrow(&s.t, i) - │ ^^^^^^^^^^^^^^^^^^^^^^^ Invalid return expression - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_return_mismatch.move:44:14 - │ -44 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation -45 │ public fun borrow_t_mut(s: &mut S, i: u64): &u64 { - │ ------ ---- This syntax method must return a mutable reference to match its subject type - │ │ - │ Mutable subject type defined here - -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/naming/index_syntax_methods_return_mismatch.move:57:41 - │ -57 │ public fun borrow_t(s: &S, i: u64): &u64 { - │ ^^^^ This index function returns type '&u64' - · -62 │ public fun borrow_q_mut(s: &mut S, i: u64): &mut u32 { - │ -------- - │ │ - │ Expected this mutable index function to return type '&mut u64' - │ It returns type '&mut u32' - │ - = These functions must return the same type, differing only by mutability - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_return_mismatch.move:78:14 - │ -78 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation. This syntax method must return a mutable reference -79 │ public fun borrow_q_mut(s: &mut S, i: u64): u64 { - │ ------ --- This is not a mutable reference - │ │ - │ Mutable subject type defined here - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_return_mismatch.move:91:14 - │ -91 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation. This syntax method must return an immutable reference -92 │ public fun borrow_t(s: &S, i: u64): u64 { - │ -- --- This is not an immutable reference - │ │ - │ Immutable subject type defined here - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_return_mismatch.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_return_mismatch.snap new file mode 100644 index 0000000000000..e54a4296010b8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_return_mismatch.snap @@ -0,0 +1,72 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/index_syntax_methods_return_mismatch.move +--- +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_return_mismatch.move:21:14 + │ +21 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation +22 │ public fun borrow_t(s: &S, i: u64): &mut u64 { + │ -- -------- This syntax method must return an immutable reference to match its subject type + │ │ + │ Immutable subject type defined here + +error[E04006]: invalid subtype + ┌─ tests/move_2024/naming/index_syntax_methods_return_mismatch.move:23:9 + │ + 7 │ native public fun borrow(v: &vector, i: u64): ∈ + │ -------- Given: '&u64' + · +22 │ public fun borrow_t(s: &S, i: u64): &mut u64 { + │ -------- Expected: '&mut u64' +23 │ vector::borrow(&s.t, i) + │ ^^^^^^^^^^^^^^^^^^^^^^^ Invalid return expression + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_return_mismatch.move:44:14 + │ +44 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation +45 │ public fun borrow_t_mut(s: &mut S, i: u64): &u64 { + │ ------ ---- This syntax method must return a mutable reference to match its subject type + │ │ + │ Mutable subject type defined here + +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/naming/index_syntax_methods_return_mismatch.move:57:41 + │ +57 │ public fun borrow_t(s: &S, i: u64): &u64 { + │ ^^^^ This index function returns type '&u64' + · +62 │ public fun borrow_q_mut(s: &mut S, i: u64): &mut u32 { + │ -------- + │ │ + │ Expected this mutable index function to return type '&mut u64' + │ It returns type '&mut u32' + │ + = These functions must return the same type, differing only by mutability + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_return_mismatch.move:78:14 + │ +78 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation. This syntax method must return a mutable reference +79 │ public fun borrow_q_mut(s: &mut S, i: u64): u64 { + │ ------ --- This is not a mutable reference + │ │ + │ Mutable subject type defined here + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_return_mismatch.move:91:14 + │ +91 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation. This syntax method must return an immutable reference +92 │ public fun borrow_t(s: &S, i: u64): u64 { + │ -- --- This is not an immutable reference + │ │ + │ Immutable subject type defined here diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_tyargs_return_mismatch.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_tyargs_return_mismatch.exp deleted file mode 100644 index 09f78a6cae4d2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_tyargs_return_mismatch.exp +++ /dev/null @@ -1,40 +0,0 @@ -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_tyargs_return_mismatch.move:20:14 - │ -20 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation -21 │ public fun borrow_t(s: &S, i: u64, j: T): &mut T { abort 0 } - │ ----- ------ This syntax method must return an immutable reference to match its subject type - │ │ - │ Immutable subject type defined here - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_tyargs_return_mismatch.move:38:14 - │ -38 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation -39 │ public fun borrow_mut(s: &mut S, i: u64, j: T): &T { abort 0 } - │ --------- -- This syntax method must return a mutable reference to match its subject type - │ │ - │ Mutable subject type defined here - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_tyargs_return_mismatch.move:48:14 - │ -48 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation -49 │ public fun borrow_t(s: &S, i: u64, j: T): &mut T { abort 0 } - │ ----- ------ This syntax method must return an immutable reference to match its subject type - │ │ - │ Immutable subject type defined here - -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/naming/index_syntax_methods_tyargs_return_mismatch.move:58:14 - │ -58 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation -59 │ public fun borrow_t(s: &S, i: u64, j: T): &mut T { abort 0 } - │ ----- ------ This syntax method must return an immutable reference to match its subject type - │ │ - │ Immutable subject type defined here - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_tyargs_return_mismatch.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_tyargs_return_mismatch.snap new file mode 100644 index 0000000000000..b87aba8f8f1e4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/index_syntax_methods_tyargs_return_mismatch.snap @@ -0,0 +1,47 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/index_syntax_methods_tyargs_return_mismatch.move +--- +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_tyargs_return_mismatch.move:20:14 + │ +20 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation +21 │ public fun borrow_t(s: &S, i: u64, j: T): &mut T { abort 0 } + │ ----- ------ This syntax method must return an immutable reference to match its subject type + │ │ + │ Immutable subject type defined here + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_tyargs_return_mismatch.move:38:14 + │ +38 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation +39 │ public fun borrow_mut(s: &mut S, i: u64, j: T): &T { abort 0 } + │ --------- -- This syntax method must return a mutable reference to match its subject type + │ │ + │ Mutable subject type defined here + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_tyargs_return_mismatch.move:48:14 + │ +48 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation +49 │ public fun borrow_t(s: &S, i: u64, j: T): &mut T { abort 0 } + │ ----- ------ This syntax method must return an immutable reference to match its subject type + │ │ + │ Immutable subject type defined here + +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/naming/index_syntax_methods_tyargs_return_mismatch.move:58:14 + │ +58 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation +59 │ public fun borrow_t(s: &S, i: u64, j: T): &mut T { abort 0 } + │ ----- ------ This syntax method must return an immutable reference to match its subject type + │ │ + │ Immutable subject type defined here diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_captures_break_and_continue.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_captures_break_and_continue.exp deleted file mode 100644 index b8b877c112a42..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_captures_break_and_continue.exp +++ /dev/null @@ -1,134 +0,0 @@ -error[E04014]: invalid loop control - ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:7:24 - │ -6 │ do!(|| { - │ ╭─────────────' -7 │ │ if (false) break; - │ │ ^^^^^ Invalid 'break'. This usage is not yet supported for lambdas or macros -8 │ │ if (false) continue; -9 │ │ }); - │ ╰─────────' Inside this lambda - -error[E04014]: invalid loop control - ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:8:24 - │ -6 │ do!(|| { - │ ╭─────────────' -7 │ │ if (false) break; -8 │ │ if (false) continue; - │ │ ^^^^^^^^ Invalid 'continue'. This usage is not yet supported for lambdas or macros -9 │ │ }); - │ ╰─────────' Inside this lambda - -error[E04014]: invalid loop control - ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:15:28 - │ -13 │ ╭ loop { -14 │ │ do!(|| { - │ ╭─│─────────────────' -15 │ │ │ if (false) break; - │ │ │ ^^^^^ Invalid 'break'. This usage is not yet supported for lambdas or macros -16 │ │ │ if (false) continue; -17 │ │ │ }); - │ ╰─│─────────────' Inside this lambda -18 │ │ }; - │ ╰─────────' To 'break' to this loop, add a label, e.g. `'label: loop` and `break 'label` - -error[E04014]: invalid loop control - ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:16:28 - │ -13 │ ╭ loop { -14 │ │ do!(|| { - │ ╭─│─────────────────' -15 │ │ │ if (false) break; -16 │ │ │ if (false) continue; - │ │ │ ^^^^^^^^ Invalid 'continue'. This usage is not yet supported for lambdas or macros -17 │ │ │ }); - │ ╰─│─────────────' Inside this lambda -18 │ │ }; - │ ╰─────────' To 'continue' to this loop, add a label, e.g. `'label: loop` and `continue 'label` - -error[E04014]: invalid loop control - ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:22:28 - │ -20 │ ╭ while (true) { -21 │ │ do!(|| { - │ ╭─│─────────────────' -22 │ │ │ if (false) break; - │ │ │ ^^^^^ Invalid 'break'. This usage is not yet supported for lambdas or macros -23 │ │ │ if (false) continue; -24 │ │ │ }); - │ ╰─│─────────────' Inside this lambda -25 │ │ } - │ ╰─────────' To 'break' to this loop, add a label, e.g. `'label: while` and `break 'label` - -error[E04014]: invalid loop control - ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:23:28 - │ -20 │ ╭ while (true) { -21 │ │ do!(|| { - │ ╭─│─────────────────' -22 │ │ │ if (false) break; -23 │ │ │ if (false) continue; - │ │ │ ^^^^^^^^ Invalid 'continue'. This usage is not yet supported for lambdas or macros -24 │ │ │ }); - │ ╰─│─────────────' Inside this lambda -25 │ │ } - │ ╰─────────' To 'continue' to this loop, add a label, e.g. `'label: while` and `continue 'label` - -error[E04014]: invalid loop control - ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:31:28 - │ -29 │ ╭ 'a: loop { -30 │ │ do!(|| { - │ ╭─│─────────────────' -31 │ │ │ if (false) break; - │ │ │ ^^^^^ Invalid 'break'. This usage is not yet supported for lambdas or macros -32 │ │ │ if (false) continue; -33 │ │ │ }); - │ ╰─│─────────────' Inside this lambda -34 │ │ }; - │ ╰─────────' To 'break' to this loop, specify the label, e.g. `break 'a` - -error[E04014]: invalid loop control - ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:32:28 - │ -29 │ ╭ 'a: loop { -30 │ │ do!(|| { - │ ╭─│─────────────────' -31 │ │ │ if (false) break; -32 │ │ │ if (false) continue; - │ │ │ ^^^^^^^^ Invalid 'continue'. This usage is not yet supported for lambdas or macros -33 │ │ │ }); - │ ╰─│─────────────' Inside this lambda -34 │ │ }; - │ ╰─────────' To 'continue' to this loop, specify the label, e.g. `continue 'a` - -error[E04014]: invalid loop control - ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:38:28 - │ -36 │ ╭ 'b: while (true) { -37 │ │ do!(|| { - │ ╭─│─────────────────' -38 │ │ │ if (false) break; - │ │ │ ^^^^^ Invalid 'break'. This usage is not yet supported for lambdas or macros -39 │ │ │ if (false) continue; -40 │ │ │ }); - │ ╰─│─────────────' Inside this lambda -41 │ │ } - │ ╰─────────' To 'break' to this loop, specify the label, e.g. `break 'b` - -error[E04014]: invalid loop control - ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:39:28 - │ -36 │ ╭ 'b: while (true) { -37 │ │ do!(|| { - │ ╭─│─────────────────' -38 │ │ │ if (false) break; -39 │ │ │ if (false) continue; - │ │ │ ^^^^^^^^ Invalid 'continue'. This usage is not yet supported for lambdas or macros -40 │ │ │ }); - │ ╰─│─────────────' Inside this lambda -41 │ │ } - │ ╰─────────' To 'continue' to this loop, specify the label, e.g. `continue 'b` - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_captures_break_and_continue.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_captures_break_and_continue.snap new file mode 100644 index 0000000000000..523e92ed80cfd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_captures_break_and_continue.snap @@ -0,0 +1,141 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/lambda_captures_break_and_continue.move +--- +error[E04014]: invalid loop control + ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:7:24 + │ +6 │ do!(|| { + │ ╭─────────────' +7 │ │ if (false) break; + │ │ ^^^^^ Invalid 'break'. This usage is not yet supported for lambdas or macros +8 │ │ if (false) continue; +9 │ │ }); + │ ╰─────────' Inside this lambda + +error[E04014]: invalid loop control + ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:8:24 + │ +6 │ do!(|| { + │ ╭─────────────' +7 │ │ if (false) break; +8 │ │ if (false) continue; + │ │ ^^^^^^^^ Invalid 'continue'. This usage is not yet supported for lambdas or macros +9 │ │ }); + │ ╰─────────' Inside this lambda + +error[E04014]: invalid loop control + ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:15:28 + │ +13 │ ╭ loop { +14 │ │ do!(|| { + │ ╭─│─────────────────' +15 │ │ │ if (false) break; + │ │ │ ^^^^^ Invalid 'break'. This usage is not yet supported for lambdas or macros +16 │ │ │ if (false) continue; +17 │ │ │ }); + │ ╰─│─────────────' Inside this lambda +18 │ │ }; + │ ╰─────────' To 'break' to this loop, add a label, e.g. `'label: loop` and `break 'label` + +error[E04014]: invalid loop control + ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:16:28 + │ +13 │ ╭ loop { +14 │ │ do!(|| { + │ ╭─│─────────────────' +15 │ │ │ if (false) break; +16 │ │ │ if (false) continue; + │ │ │ ^^^^^^^^ Invalid 'continue'. This usage is not yet supported for lambdas or macros +17 │ │ │ }); + │ ╰─│─────────────' Inside this lambda +18 │ │ }; + │ ╰─────────' To 'continue' to this loop, add a label, e.g. `'label: loop` and `continue 'label` + +error[E04014]: invalid loop control + ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:22:28 + │ +20 │ ╭ while (true) { +21 │ │ do!(|| { + │ ╭─│─────────────────' +22 │ │ │ if (false) break; + │ │ │ ^^^^^ Invalid 'break'. This usage is not yet supported for lambdas or macros +23 │ │ │ if (false) continue; +24 │ │ │ }); + │ ╰─│─────────────' Inside this lambda +25 │ │ } + │ ╰─────────' To 'break' to this loop, add a label, e.g. `'label: while` and `break 'label` + +error[E04014]: invalid loop control + ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:23:28 + │ +20 │ ╭ while (true) { +21 │ │ do!(|| { + │ ╭─│─────────────────' +22 │ │ │ if (false) break; +23 │ │ │ if (false) continue; + │ │ │ ^^^^^^^^ Invalid 'continue'. This usage is not yet supported for lambdas or macros +24 │ │ │ }); + │ ╰─│─────────────' Inside this lambda +25 │ │ } + │ ╰─────────' To 'continue' to this loop, add a label, e.g. `'label: while` and `continue 'label` + +error[E04014]: invalid loop control + ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:31:28 + │ +29 │ ╭ 'a: loop { +30 │ │ do!(|| { + │ ╭─│─────────────────' +31 │ │ │ if (false) break; + │ │ │ ^^^^^ Invalid 'break'. This usage is not yet supported for lambdas or macros +32 │ │ │ if (false) continue; +33 │ │ │ }); + │ ╰─│─────────────' Inside this lambda +34 │ │ }; + │ ╰─────────' To 'break' to this loop, specify the label, e.g. `break 'a` + +error[E04014]: invalid loop control + ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:32:28 + │ +29 │ ╭ 'a: loop { +30 │ │ do!(|| { + │ ╭─│─────────────────' +31 │ │ │ if (false) break; +32 │ │ │ if (false) continue; + │ │ │ ^^^^^^^^ Invalid 'continue'. This usage is not yet supported for lambdas or macros +33 │ │ │ }); + │ ╰─│─────────────' Inside this lambda +34 │ │ }; + │ ╰─────────' To 'continue' to this loop, specify the label, e.g. `continue 'a` + +error[E04014]: invalid loop control + ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:38:28 + │ +36 │ ╭ 'b: while (true) { +37 │ │ do!(|| { + │ ╭─│─────────────────' +38 │ │ │ if (false) break; + │ │ │ ^^^^^ Invalid 'break'. This usage is not yet supported for lambdas or macros +39 │ │ │ if (false) continue; +40 │ │ │ }); + │ ╰─│─────────────' Inside this lambda +41 │ │ } + │ ╰─────────' To 'break' to this loop, specify the label, e.g. `break 'b` + +error[E04014]: invalid loop control + ┌─ tests/move_2024/naming/lambda_captures_break_and_continue.move:39:28 + │ +36 │ ╭ 'b: while (true) { +37 │ │ do!(|| { + │ ╭─│─────────────────' +38 │ │ │ if (false) break; +39 │ │ │ if (false) continue; + │ │ │ ^^^^^^^^ Invalid 'continue'. This usage is not yet supported for lambdas or macros +40 │ │ │ }); + │ ╰─│─────────────' Inside this lambda +41 │ │ } + │ ╰─────────' To 'continue' to this loop, specify the label, e.g. `continue 'b` diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_shadows_function.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_shadows_function.exp deleted file mode 100644 index 23263198999cc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_shadows_function.exp +++ /dev/null @@ -1,18 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_2024/naming/lambda_shadows_function.move:4:22 - │ -4 │ macro fun do<$T>(f: || -> $T): $T { - │ ^ Unused parameter 'f'. Consider removing or prefixing with an underscore: '_f' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02010]: invalid name - ┌─ tests/move_2024/naming/lambda_shadows_function.move:4:22 - │ -4 │ macro fun do<$T>(f: || -> $T): $T { - │ ----- ^ Invalid parameter name 'f'. 'macro' parameter names must start with '$' (or must be '_') - │ │ - │ Declared 'macro' here - │ - = 'macro' parameters start with '$' to indicate that their arguments are not evaluated before the macro is expanded, meaning the entire expression is substituted. This is different from regular function parameters that are evaluated before the function is called. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_shadows_function.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_shadows_function.snap new file mode 100644 index 0000000000000..a07682184c7c3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_shadows_function.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/lambda_shadows_function.move +--- +warning[W09002]: unused variable + ┌─ tests/move_2024/naming/lambda_shadows_function.move:4:22 + │ +4 │ macro fun do<$T>(f: || -> $T): $T { + │ ^ Unused parameter 'f'. Consider removing or prefixing with an underscore: '_f' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02010]: invalid name + ┌─ tests/move_2024/naming/lambda_shadows_function.move:4:22 + │ +4 │ macro fun do<$T>(f: || -> $T): $T { + │ ----- ^ Invalid parameter name 'f'. 'macro' parameter names must start with '$' (or must be '_') + │ │ + │ Declared 'macro' here + │ + = 'macro' parameters start with '$' to indicate that their arguments are not evaluated before the macro is expanded, meaning the entire expression is substituted. This is different from regular function parameters that are evaluated before the function is called. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_to_outer_loop.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_to_outer_loop.snap new file mode 100644 index 0000000000000..c3c2e5bff1af5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_to_outer_loop.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/lambda_to_outer_loop.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_with_control_flow.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_with_control_flow.snap new file mode 100644 index 0000000000000..f6cbf6aa13ef1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_with_control_flow.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/lambda_with_control_flow.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_with_control_flow_named.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_with_control_flow_named.snap new file mode 100644 index 0000000000000..f4a8fe9968549 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_with_control_flow_named.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/lambda_with_control_flow_named.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_with_type_args.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_with_type_args.exp deleted file mode 100644 index 6501f0d0b5b7d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_with_type_args.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03007]: too many type arguments - ┌─ tests/move_2024/naming/lambda_with_type_args.move:3:9 - │ -3 │ $f(0) - │ ^^ Invalid lambda call. Expected zero type arguments - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_with_type_args.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_with_type_args.snap new file mode 100644 index 0000000000000..38232e2e20bdc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/lambda_with_type_args.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/lambda_with_type_args.move +--- +error[E03007]: too many type arguments + ┌─ tests/move_2024/naming/lambda_with_type_args.move:3:9 + │ +3 │ $f(0) + │ ^^ Invalid lambda call. Expected zero type arguments diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/macro_identifier_assignment.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/macro_identifier_assignment.exp deleted file mode 100644 index b4a0fddaf5b99..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/macro_identifier_assignment.exp +++ /dev/null @@ -1,28 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/naming/macro_identifier_assignment.move:2:33 - │ - 2 │ macro fun call($f: |u64| -> u64, $x: u64): u64 { - │ ^^^ - │ │ - │ Invalid type annotation - │ Expected: 'u64' - · -10 │ call!(|_| false, 0) + 1; - │ ----- Given: 'bool' - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/naming/macro_identifier_assignment.move:3:9 - │ -3 │ $f = 0; - │ ^^ Cannot assign to argument for parameter '$f'. Arguments must be used in value positions - │ - = 'macro' parameters are substituted without being evaluated. There is no local variable to assign to - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/naming/macro_identifier_assignment.move:4:9 - │ -4 │ $x = 0; - │ ^^ Cannot assign to argument for parameter '$x'. Arguments must be used in value positions - │ - = 'macro' parameters are substituted without being evaluated. There is no local variable to assign to - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/macro_identifier_assignment.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/macro_identifier_assignment.snap new file mode 100644 index 0000000000000..021545474a538 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/macro_identifier_assignment.snap @@ -0,0 +1,35 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/macro_identifier_assignment.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/naming/macro_identifier_assignment.move:2:33 + │ + 2 │ macro fun call($f: |u64| -> u64, $x: u64): u64 { + │ ^^^ + │ │ + │ Invalid type annotation + │ Expected: 'u64' + · +10 │ call!(|_| false, 0) + 1; + │ ----- Given: 'bool' + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/naming/macro_identifier_assignment.move:3:9 + │ +3 │ $f = 0; + │ ^^ Cannot assign to argument for parameter '$f'. Arguments must be used in value positions + │ + = 'macro' parameters are substituted without being evaluated. There is no local variable to assign to + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/naming/macro_identifier_assignment.move:4:9 + │ +4 │ $x = 0; + │ ^^ Cannot assign to argument for parameter '$x'. Arguments must be used in value positions + │ + = 'macro' parameters are substituted without being evaluated. There is no local variable to assign to diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/macro_parameter_assignment.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/macro_parameter_assignment.exp deleted file mode 100644 index 0b3194257b6b7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/macro_parameter_assignment.exp +++ /dev/null @@ -1,44 +0,0 @@ -error[E02010]: invalid name - ┌─ tests/move_2024/naming/macro_parameter_assignment.move:2:20 - │ -2 │ macro fun call(f: |u64| -> u64, x: u64): u64 { - │ ----- ^ Invalid parameter name 'f'. 'macro' parameter names must start with '$' (or must be '_') - │ │ - │ Declared 'macro' here - │ - = 'macro' parameters start with '$' to indicate that their arguments are not evaluated before the macro is expanded, meaning the entire expression is substituted. This is different from regular function parameters that are evaluated before the function is called. - -error[E02010]: invalid name - ┌─ tests/move_2024/naming/macro_parameter_assignment.move:2:37 - │ -2 │ macro fun call(f: |u64| -> u64, x: u64): u64 { - │ ----- ^ Invalid parameter name 'x'. 'macro' parameter names must start with '$' (or must be '_') - │ │ - │ Declared 'macro' here - │ - = 'macro' parameters start with '$' to indicate that their arguments are not evaluated before the macro is expanded, meaning the entire expression is substituted. This is different from regular function parameters that are evaluated before the function is called. - -error[E04029]: invalid function call - ┌─ tests/move_2024/naming/macro_parameter_assignment.move:5:9 - │ -5 │ f(x) - │ ^ Unexpected invocation of parameter or local 'f'. Non-syntax variables cannot be invoked as functions - │ - = Only macro syntax variables, e.g. '$f', may be invoked as functions. - -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/naming/macro_parameter_assignment.move:10:15 - │ -10 │ call!(|_| 1, 0) + 1; - │ ^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/naming/macro_parameter_assignment.move:10:22 - │ -10 │ call!(|_| 1, 0) + 1; - │ ^ Unused macro argument. Its expression will not be type checked and it will not evaluated - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/macro_parameter_assignment.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/macro_parameter_assignment.snap new file mode 100644 index 0000000000000..a03b425939d1b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/macro_parameter_assignment.snap @@ -0,0 +1,51 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/macro_parameter_assignment.move +--- +error[E02010]: invalid name + ┌─ tests/move_2024/naming/macro_parameter_assignment.move:2:20 + │ +2 │ macro fun call(f: |u64| -> u64, x: u64): u64 { + │ ----- ^ Invalid parameter name 'f'. 'macro' parameter names must start with '$' (or must be '_') + │ │ + │ Declared 'macro' here + │ + = 'macro' parameters start with '$' to indicate that their arguments are not evaluated before the macro is expanded, meaning the entire expression is substituted. This is different from regular function parameters that are evaluated before the function is called. + +error[E02010]: invalid name + ┌─ tests/move_2024/naming/macro_parameter_assignment.move:2:37 + │ +2 │ macro fun call(f: |u64| -> u64, x: u64): u64 { + │ ----- ^ Invalid parameter name 'x'. 'macro' parameter names must start with '$' (or must be '_') + │ │ + │ Declared 'macro' here + │ + = 'macro' parameters start with '$' to indicate that their arguments are not evaluated before the macro is expanded, meaning the entire expression is substituted. This is different from regular function parameters that are evaluated before the function is called. + +error[E04029]: invalid function call + ┌─ tests/move_2024/naming/macro_parameter_assignment.move:5:9 + │ +5 │ f(x) + │ ^ Unexpected invocation of parameter or local 'f'. Non-syntax variables cannot be invoked as functions + │ + = Only macro syntax variables, e.g. '$f', may be invoked as functions. + +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/naming/macro_parameter_assignment.move:10:15 + │ +10 │ call!(|_| 1, 0) + 1; + │ ^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/naming/macro_parameter_assignment.move:10:22 + │ +10 │ call!(|_| 1, 0) + 1; + │ ^ Unused macro argument. Its expression will not be type checked and it will not evaluated + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/macro_var_as_fun_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/macro_var_as_fun_invalid.exp deleted file mode 100644 index 0bc6590ad7ca8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/macro_var_as_fun_invalid.exp +++ /dev/null @@ -1,21 +0,0 @@ -error[E03004]: unbound type - ┌─ tests/move_2024/naming/macro_var_as_fun_invalid.move:3:13 - │ -3 │ let $var = 0; - │ ^^^^ Unbound type '$var' in current scope - -error[E01002]: unexpected token - ┌─ tests/move_2024/naming/macro_var_as_fun_invalid.move:3:18 - │ -3 │ let $var = 0; - │ ^ - │ │ - │ Unexpected '=' - │ Expected '{' - -error[E03005]: unbound unscoped name - ┌─ tests/move_2024/naming/macro_var_as_fun_invalid.move:4:9 - │ -4 │ $var(); - │ ^^^^ Unbound function '$var' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/macro_var_as_fun_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/macro_var_as_fun_invalid.snap new file mode 100644 index 0000000000000..419fefbf84240 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/macro_var_as_fun_invalid.snap @@ -0,0 +1,28 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/macro_var_as_fun_invalid.move +--- +error[E03004]: unbound type + ┌─ tests/move_2024/naming/macro_var_as_fun_invalid.move:3:13 + │ +3 │ let $var = 0; + │ ^^^^ Unbound type '$var' in current scope + +error[E01002]: unexpected token + ┌─ tests/move_2024/naming/macro_var_as_fun_invalid.move:3:18 + │ +3 │ let $var = 0; + │ ^ + │ │ + │ Unexpected '=' + │ Expected '{' + +error[E03005]: unbound unscoped name + ┌─ tests/move_2024/naming/macro_var_as_fun_invalid.move:4:9 + │ +4 │ $var(); + │ ^^^^ Unbound function '$var' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/mut_underscore.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/mut_underscore.exp deleted file mode 100644 index 566e6ea8fec25..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/mut_underscore.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E03016]: invalid 'mut' declaration - ┌─ tests/move_2024/naming/mut_underscore.move:3:13 - │ -3 │ fun foo(mut _: u64) { - │ ^^^ Invalid 'mut' declaration. 'mut' is applied to variables and cannot be applied to the '_' pattern - -error[E03016]: invalid 'mut' declaration - ┌─ tests/move_2024/naming/mut_underscore.move:4:13 - │ -4 │ let mut _ = 0; - │ ^^^ Invalid 'mut' declaration. 'mut' is applied to variables and cannot be applied to the '_' pattern - -error[E03016]: invalid 'mut' declaration - ┌─ tests/move_2024/naming/mut_underscore.move:5:17 - │ -5 │ callf!(|mut _: u64| ()); - │ ^^^ Invalid 'mut' declaration. 'mut' is applied to variables and cannot be applied to the '_' pattern - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/mut_underscore.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/mut_underscore.snap new file mode 100644 index 0000000000000..e55a5dd2f420a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/mut_underscore.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/mut_underscore.move +--- +error[E03016]: invalid 'mut' declaration + ┌─ tests/move_2024/naming/mut_underscore.move:3:13 + │ +3 │ fun foo(mut _: u64) { + │ ^^^ Invalid 'mut' declaration. 'mut' is applied to variables and cannot be applied to the '_' pattern + +error[E03016]: invalid 'mut' declaration + ┌─ tests/move_2024/naming/mut_underscore.move:4:13 + │ +4 │ let mut _ = 0; + │ ^^^ Invalid 'mut' declaration. 'mut' is applied to variables and cannot be applied to the '_' pattern + +error[E03016]: invalid 'mut' declaration + ┌─ tests/move_2024/naming/mut_underscore.move:5:17 + │ +5 │ callf!(|mut _: u64| ()); + │ ^^^ Invalid 'mut' declaration. 'mut' is applied to variables and cannot be applied to the '_' pattern diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/named_blocks_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/named_blocks_invalid.exp deleted file mode 100644 index 987491aee3729..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/named_blocks_invalid.exp +++ /dev/null @@ -1,128 +0,0 @@ -error[E03014]: invalid use of label - ┌─ tests/move_2024/naming/named_blocks_invalid.move:4:31 - │ -4 │ if (cond) { break 'name 10 }; - │ ^^^^^ Invalid usage of 'break' with a named block label - │ - = Named block labels may only be used with 'return', not 'break' or 'continue'. - -error[E03014]: invalid use of label - ┌─ tests/move_2024/naming/named_blocks_invalid.move:5:34 - │ -5 │ if (cond) { continue 'name }; - │ ^^^^^ Invalid usage of 'continue' with a named block label - │ - = Named block labels may only be used with 'return', not 'break' or 'continue'. - -error[E03014]: invalid use of label - ┌─ tests/move_2024/naming/named_blocks_invalid.move:12:32 - │ -12 │ if (cond) { return 'name 10 }; - │ ^^^^^ Invalid usage of 'return' with a loop block label - │ - = Loop labels may only be used with 'break' and 'continue', not 'return' - -error[E03014]: invalid use of label - ┌─ tests/move_2024/naming/named_blocks_invalid.move:19:36 - │ -19 │ if (cond) { return 'outer 10 }; - │ ^^^^^^ Invalid usage of 'return' with a loop block label - │ - = Loop labels may only be used with 'break' and 'continue', not 'return' - -error[E03014]: invalid use of label - ┌─ tests/move_2024/naming/named_blocks_invalid.move:20:36 - │ -20 │ if (cond) { return 'inner 20 }; - │ ^^^^^^ Invalid usage of 'return' with a loop block label - │ - = Loop labels may only be used with 'break' and 'continue', not 'return' - -error[E03014]: invalid use of label - ┌─ tests/move_2024/naming/named_blocks_invalid.move:28:36 - │ -28 │ if (cond) { return 'outer }; - │ ^^^^^^ Invalid usage of 'return' with a loop block label - │ - = Loop labels may only be used with 'break' and 'continue', not 'return' - -error[E03014]: invalid use of label - ┌─ tests/move_2024/naming/named_blocks_invalid.move:29:36 - │ -29 │ if (cond) { return 'inner }; - │ ^^^^^^ Invalid usage of 'return' with a loop block label - │ - = Loop labels may only be used with 'break' and 'continue', not 'return' - -error[E03014]: invalid use of label - ┌─ tests/move_2024/naming/named_blocks_invalid.move:37:36 - │ -37 │ if (cond) { return 'outer }; - │ ^^^^^^ Invalid usage of 'return' with a loop block label - │ - = Loop labels may only be used with 'break' and 'continue', not 'return' - -error[E03014]: invalid use of label - ┌─ tests/move_2024/naming/named_blocks_invalid.move:38:35 - │ -38 │ if (cond) { break 'inner 10 }; - │ ^^^^^^ Invalid usage of 'break' with a named block label - │ - = Named block labels may only be used with 'return', not 'break' or 'continue'. - -error[E03014]: invalid use of label - ┌─ tests/move_2024/naming/named_blocks_invalid.move:47:24 - │ -47 │ return 'l - │ ^^ Invalid usage of 'return' with a loop block label - │ - = Loop labels may only be used with 'break' and 'continue', not 'return' - -error[E03015]: unbound label - ┌─ tests/move_2024/naming/named_blocks_invalid.move:54:32 - │ -54 │ if (cond) { return 'name2 10 }; - │ ^^^^^^ Invalid return. Unbound label 'name2 - -error[E03015]: unbound label - ┌─ tests/move_2024/naming/named_blocks_invalid.move:61:34 - │ -61 │ if (cond) { continue 'name2 }; - │ ^^^^^^ Invalid continue. Unbound label 'name2 - -error[E03015]: unbound label - ┌─ tests/move_2024/naming/named_blocks_invalid.move:62:31 - │ -62 │ if (cond) { break 'name2 10 }; - │ ^^^^^^ Invalid break. Unbound label 'name2 - -error[E03015]: unbound label - ┌─ tests/move_2024/naming/named_blocks_invalid.move:69:35 - │ -69 │ if (cond) { break 'outer 10 }; - │ ^^^^^^ Invalid break. Unbound label 'outer - -error[E03015]: unbound label - ┌─ tests/move_2024/naming/named_blocks_invalid.move:70:35 - │ -70 │ if (cond) { break 'inner 20 }; - │ ^^^^^^ Invalid break. Unbound label 'inner - -error[E03015]: unbound label - ┌─ tests/move_2024/naming/named_blocks_invalid.move:78:38 - │ -78 │ if (cond) { continue 'outer2 }; - │ ^^^^^^^ Invalid continue. Unbound label 'outer2 - -error[E03015]: unbound label - ┌─ tests/move_2024/naming/named_blocks_invalid.move:79:35 - │ -79 │ if (cond) { break 'inner2 }; - │ ^^^^^^^ Invalid break. Unbound label 'inner2 - -error[E03015]: unbound label - ┌─ tests/move_2024/naming/named_blocks_invalid.move:87:23 - │ -87 │ break 'l2 - │ ^^^ Invalid break. Unbound label 'l2 - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/named_blocks_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/named_blocks_invalid.snap new file mode 100644 index 0000000000000..cf764f39f0591 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/named_blocks_invalid.snap @@ -0,0 +1,135 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/named_blocks_invalid.move +--- +error[E03014]: invalid use of label + ┌─ tests/move_2024/naming/named_blocks_invalid.move:4:31 + │ +4 │ if (cond) { break 'name 10 }; + │ ^^^^^ Invalid usage of 'break' with a named block label + │ + = Named block labels may only be used with 'return', not 'break' or 'continue'. + +error[E03014]: invalid use of label + ┌─ tests/move_2024/naming/named_blocks_invalid.move:5:34 + │ +5 │ if (cond) { continue 'name }; + │ ^^^^^ Invalid usage of 'continue' with a named block label + │ + = Named block labels may only be used with 'return', not 'break' or 'continue'. + +error[E03014]: invalid use of label + ┌─ tests/move_2024/naming/named_blocks_invalid.move:12:32 + │ +12 │ if (cond) { return 'name 10 }; + │ ^^^^^ Invalid usage of 'return' with a loop block label + │ + = Loop labels may only be used with 'break' and 'continue', not 'return' + +error[E03014]: invalid use of label + ┌─ tests/move_2024/naming/named_blocks_invalid.move:19:36 + │ +19 │ if (cond) { return 'outer 10 }; + │ ^^^^^^ Invalid usage of 'return' with a loop block label + │ + = Loop labels may only be used with 'break' and 'continue', not 'return' + +error[E03014]: invalid use of label + ┌─ tests/move_2024/naming/named_blocks_invalid.move:20:36 + │ +20 │ if (cond) { return 'inner 20 }; + │ ^^^^^^ Invalid usage of 'return' with a loop block label + │ + = Loop labels may only be used with 'break' and 'continue', not 'return' + +error[E03014]: invalid use of label + ┌─ tests/move_2024/naming/named_blocks_invalid.move:28:36 + │ +28 │ if (cond) { return 'outer }; + │ ^^^^^^ Invalid usage of 'return' with a loop block label + │ + = Loop labels may only be used with 'break' and 'continue', not 'return' + +error[E03014]: invalid use of label + ┌─ tests/move_2024/naming/named_blocks_invalid.move:29:36 + │ +29 │ if (cond) { return 'inner }; + │ ^^^^^^ Invalid usage of 'return' with a loop block label + │ + = Loop labels may only be used with 'break' and 'continue', not 'return' + +error[E03014]: invalid use of label + ┌─ tests/move_2024/naming/named_blocks_invalid.move:37:36 + │ +37 │ if (cond) { return 'outer }; + │ ^^^^^^ Invalid usage of 'return' with a loop block label + │ + = Loop labels may only be used with 'break' and 'continue', not 'return' + +error[E03014]: invalid use of label + ┌─ tests/move_2024/naming/named_blocks_invalid.move:38:35 + │ +38 │ if (cond) { break 'inner 10 }; + │ ^^^^^^ Invalid usage of 'break' with a named block label + │ + = Named block labels may only be used with 'return', not 'break' or 'continue'. + +error[E03014]: invalid use of label + ┌─ tests/move_2024/naming/named_blocks_invalid.move:47:24 + │ +47 │ return 'l + │ ^^ Invalid usage of 'return' with a loop block label + │ + = Loop labels may only be used with 'break' and 'continue', not 'return' + +error[E03015]: unbound label + ┌─ tests/move_2024/naming/named_blocks_invalid.move:54:32 + │ +54 │ if (cond) { return 'name2 10 }; + │ ^^^^^^ Invalid return. Unbound label 'name2 + +error[E03015]: unbound label + ┌─ tests/move_2024/naming/named_blocks_invalid.move:61:34 + │ +61 │ if (cond) { continue 'name2 }; + │ ^^^^^^ Invalid continue. Unbound label 'name2 + +error[E03015]: unbound label + ┌─ tests/move_2024/naming/named_blocks_invalid.move:62:31 + │ +62 │ if (cond) { break 'name2 10 }; + │ ^^^^^^ Invalid break. Unbound label 'name2 + +error[E03015]: unbound label + ┌─ tests/move_2024/naming/named_blocks_invalid.move:69:35 + │ +69 │ if (cond) { break 'outer 10 }; + │ ^^^^^^ Invalid break. Unbound label 'outer + +error[E03015]: unbound label + ┌─ tests/move_2024/naming/named_blocks_invalid.move:70:35 + │ +70 │ if (cond) { break 'inner 20 }; + │ ^^^^^^ Invalid break. Unbound label 'inner + +error[E03015]: unbound label + ┌─ tests/move_2024/naming/named_blocks_invalid.move:78:38 + │ +78 │ if (cond) { continue 'outer2 }; + │ ^^^^^^^ Invalid continue. Unbound label 'outer2 + +error[E03015]: unbound label + ┌─ tests/move_2024/naming/named_blocks_invalid.move:79:35 + │ +79 │ if (cond) { break 'inner2 }; + │ ^^^^^^^ Invalid break. Unbound label 'inner2 + +error[E03015]: unbound label + ┌─ tests/move_2024/naming/named_blocks_invalid.move:87:23 + │ +87 │ break 'l2 + │ ^^^ Invalid break. Unbound label 'l2 diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/non_duplicate_use_fun.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/non_duplicate_use_fun.snap new file mode 100644 index 0000000000000..6c435066594ea --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/non_duplicate_use_fun.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/non_duplicate_use_fun.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/pattern_ellipsis.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/pattern_ellipsis.snap new file mode 100644 index 0000000000000..f7aaae9eed9d8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/pattern_ellipsis.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/pattern_ellipsis.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/pattern_ellipsis_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/pattern_ellipsis_invalid.exp deleted file mode 100644 index 4aaa9fe55afcf..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/pattern_ellipsis_invalid.exp +++ /dev/null @@ -1,154 +0,0 @@ -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:16:13 - │ - 3 │ D - │ - 'D' is declared here - · -16 │ Y::D(..) => 0, - │ ^^^^^^^^ Invalid variant pattern. Empty variant declarations require empty patterns - │ - = Remove '()' arguments from this pattern - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:17:13 - │ - 3 │ D - │ - 'D' is declared here - · -17 │ Y::D{..} => 0, - │ ^^^^^^^^ Invalid variant pattern. Empty variant declarations require empty patterns - │ - = Remove '{ }' arguments from this pattern - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:18:13 - │ - 3 │ D - │ - 'D' is declared here - · -18 │ Y::D(x, ..) => 0, - │ ^^^^^^^^^^^ Invalid variant pattern. Empty variant declarations require empty patterns - │ - = Remove '()' arguments from this pattern - -warning[W09002]: unused variable - ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:18:18 - │ -18 │ Y::D(x, ..) => 0, - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:19:13 - │ - 3 │ D - │ - 'D' is declared here - · -19 │ Y::D{x, ..} => 0, - │ ^^^^^^^^^^^ Invalid variant pattern. Empty variant declarations require empty patterns - │ - = Remove '{ }' arguments from this pattern - -warning[W09002]: unused variable - ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:19:18 - │ -19 │ Y::D{x, ..} => 0, - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:25:13 - │ - 7 │ D() - │ --- 'D' is declared here - · -25 │ X::D{} => 0, - │ ^^^^^^ Invalid variant pattern. Positional variant declarations require positional patterns - │ - = Positional patterns take arguments using '()' - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:26:13 - │ - 7 │ D() - │ --- 'D' is declared here - · -26 │ X::D{..} => 0, - │ ^^^^^^^^ Invalid variant pattern. Positional variant declarations require positional patterns - │ - = Positional patterns take arguments using '()' - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:27:13 - │ - 7 │ D() - │ --- 'D' is declared here - · -27 │ X::D{x, ..} => 0, - │ ^^^^^^^^^^^ Invalid variant pattern. Positional variant declarations require positional patterns - │ - = Positional patterns take arguments using '()' - -error[E03010]: unbound field - ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:27:13 - │ -27 │ X::D{x, ..} => 0, - │ ^^^^^^^^^^^ Unbound field 'x' in '0x42::m::X::D' - -warning[W09002]: unused variable - ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:27:18 - │ -27 │ X::D{x, ..} => 0, - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:33:13 - │ -11 │ D{} - │ --- 'D' is declared here - · -33 │ Z::D() => 0, - │ ^^^^^^ Invalid variant pattern. Named variant declarations require named patterns - │ - = Named patterns take arguments using '{ }' - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:34:13 - │ -11 │ D{} - │ --- 'D' is declared here - · -34 │ Z::D(..) => 0, - │ ^^^^^^^^ Invalid variant pattern. Named variant declarations require named patterns - │ - = Named patterns take arguments using '{ }' - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:35:13 - │ -11 │ D{} - │ --- 'D' is declared here - · -35 │ Z::D(x, ..) => 0, - │ ^^^^^^^^^^^ Invalid variant pattern. Named variant declarations require named patterns - │ - = Named patterns take arguments using '{ }' - -error[E03010]: unbound field - ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:35:13 - │ -35 │ Z::D(x, ..) => 0, - │ ^^^^^^^^^^^ Unbound field '0' in '0x42::m::Z::D' - -warning[W09002]: unused variable - ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:35:18 - │ -35 │ Z::D(x, ..) => 0, - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/pattern_ellipsis_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/pattern_ellipsis_invalid.snap new file mode 100644 index 0000000000000..429d0838e6f0f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/pattern_ellipsis_invalid.snap @@ -0,0 +1,161 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/pattern_ellipsis_invalid.move +--- +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:16:13 + │ + 3 │ D + │ - 'D' is declared here + · +16 │ Y::D(..) => 0, + │ ^^^^^^^^ Invalid variant pattern. Empty variant declarations require empty patterns + │ + = Remove '()' arguments from this pattern + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:17:13 + │ + 3 │ D + │ - 'D' is declared here + · +17 │ Y::D{..} => 0, + │ ^^^^^^^^ Invalid variant pattern. Empty variant declarations require empty patterns + │ + = Remove '{ }' arguments from this pattern + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:18:13 + │ + 3 │ D + │ - 'D' is declared here + · +18 │ Y::D(x, ..) => 0, + │ ^^^^^^^^^^^ Invalid variant pattern. Empty variant declarations require empty patterns + │ + = Remove '()' arguments from this pattern + +warning[W09002]: unused variable + ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:18:18 + │ +18 │ Y::D(x, ..) => 0, + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:19:13 + │ + 3 │ D + │ - 'D' is declared here + · +19 │ Y::D{x, ..} => 0, + │ ^^^^^^^^^^^ Invalid variant pattern. Empty variant declarations require empty patterns + │ + = Remove '{ }' arguments from this pattern + +warning[W09002]: unused variable + ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:19:18 + │ +19 │ Y::D{x, ..} => 0, + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:25:13 + │ + 7 │ D() + │ --- 'D' is declared here + · +25 │ X::D{} => 0, + │ ^^^^^^ Invalid variant pattern. Positional variant declarations require positional patterns + │ + = Positional patterns take arguments using '()' + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:26:13 + │ + 7 │ D() + │ --- 'D' is declared here + · +26 │ X::D{..} => 0, + │ ^^^^^^^^ Invalid variant pattern. Positional variant declarations require positional patterns + │ + = Positional patterns take arguments using '()' + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:27:13 + │ + 7 │ D() + │ --- 'D' is declared here + · +27 │ X::D{x, ..} => 0, + │ ^^^^^^^^^^^ Invalid variant pattern. Positional variant declarations require positional patterns + │ + = Positional patterns take arguments using '()' + +error[E03010]: unbound field + ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:27:13 + │ +27 │ X::D{x, ..} => 0, + │ ^^^^^^^^^^^ Unbound field 'x' in '0x42::m::X::D' + +warning[W09002]: unused variable + ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:27:18 + │ +27 │ X::D{x, ..} => 0, + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:33:13 + │ +11 │ D{} + │ --- 'D' is declared here + · +33 │ Z::D() => 0, + │ ^^^^^^ Invalid variant pattern. Named variant declarations require named patterns + │ + = Named patterns take arguments using '{ }' + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:34:13 + │ +11 │ D{} + │ --- 'D' is declared here + · +34 │ Z::D(..) => 0, + │ ^^^^^^^^ Invalid variant pattern. Named variant declarations require named patterns + │ + = Named patterns take arguments using '{ }' + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:35:13 + │ +11 │ D{} + │ --- 'D' is declared here + · +35 │ Z::D(x, ..) => 0, + │ ^^^^^^^^^^^ Invalid variant pattern. Named variant declarations require named patterns + │ + = Named patterns take arguments using '{ }' + +error[E03010]: unbound field + ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:35:13 + │ +35 │ Z::D(x, ..) => 0, + │ ^^^^^^^^^^^ Unbound field '0' in '0x42::m::Z::D' + +warning[W09002]: unused variable + ┌─ tests/move_2024/naming/pattern_ellipsis_invalid.move:35:18 + │ +35 │ Z::D(x, ..) => 0, + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_pack_fn_call_shadow.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_pack_fn_call_shadow.exp deleted file mode 100644 index 424c2258259f2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_pack_fn_call_shadow.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/naming/positional_pack_fn_call_shadow.move:5:9 - │ -3 │ public struct Foo(u64) has copy, drop; - │ --- Alias previously defined here -4 │ -5 │ fun Foo(_x: u64) { } - │ ^^^ Duplicate module member or alias 'Foo'. Top level names in a namespace must be unique - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_pack_fn_call_shadow.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_pack_fn_call_shadow.snap new file mode 100644 index 0000000000000..7c480585f47a1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_pack_fn_call_shadow.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/positional_pack_fn_call_shadow.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/naming/positional_pack_fn_call_shadow.move:5:9 + │ +3 │ public struct Foo(u64) has copy, drop; + │ --- Alias previously defined here +4 │ +5 │ fun Foo(_x: u64) { } + │ ^^^ Duplicate module member or alias 'Foo'. Top level names in a namespace must be unique diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_pack_of_non_positional_struct.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_pack_of_non_positional_struct.exp deleted file mode 100644 index 6550c3d64f8b5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_pack_of_non_positional_struct.exp +++ /dev/null @@ -1,21 +0,0 @@ -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/positional_pack_of_non_positional_struct.move:6:18 - │ -2 │ public struct Foo { field: u64 } has copy, drop; - │ --- 'Foo' is declared here - · -6 │ let _x = Foo(0); - │ ^^^^^^ Invalid struct instantiation. Named struct declarations require named instantiations - -error[E03010]: unbound field - ┌─ tests/move_2024/naming/positional_pack_of_non_positional_struct.move:6:18 - │ -6 │ let _x = Foo(0); - │ ^^^^^^ Unbound field '0' in '0x42::M::Foo' - -error[E04016]: too few arguments - ┌─ tests/move_2024/naming/positional_pack_of_non_positional_struct.move:6:18 - │ -6 │ let _x = Foo(0); - │ ^^^^^^ Missing argument for field 'field' in '0x42::M::Foo' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_pack_of_non_positional_struct.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_pack_of_non_positional_struct.snap new file mode 100644 index 0000000000000..6f2a76771cdc2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_pack_of_non_positional_struct.snap @@ -0,0 +1,28 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/positional_pack_of_non_positional_struct.move +--- +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/positional_pack_of_non_positional_struct.move:6:18 + │ +2 │ public struct Foo { field: u64 } has copy, drop; + │ --- 'Foo' is declared here + · +6 │ let _x = Foo(0); + │ ^^^^^^ Invalid struct instantiation. Named struct declarations require named instantiations + +error[E03010]: unbound field + ┌─ tests/move_2024/naming/positional_pack_of_non_positional_struct.move:6:18 + │ +6 │ let _x = Foo(0); + │ ^^^^^^ Unbound field '0' in '0x42::M::Foo' + +error[E04016]: too few arguments + ┌─ tests/move_2024/naming/positional_pack_of_non_positional_struct.move:6:18 + │ +6 │ let _x = Foo(0); + │ ^^^^^^ Missing argument for field 'field' in '0x42::M::Foo' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_pack_of_positional_struct.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_pack_of_positional_struct.snap new file mode 100644 index 0000000000000..78e4c3cf68113 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_pack_of_positional_struct.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/positional_pack_of_positional_struct.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_fn_use_alias_shadow.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_fn_use_alias_shadow.snap new file mode 100644 index 0000000000000..a251a93f50717 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_fn_use_alias_shadow.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/positional_struct_fn_use_alias_shadow.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_lhs_unpack.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_lhs_unpack.exp deleted file mode 100644 index fac85060f3e4e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_lhs_unpack.exp +++ /dev/null @@ -1,234 +0,0 @@ -error[E03009]: unbound variable - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:6:13 - │ -6 │ Foo(t, y) = x; - │ ^ Invalid assignment. Unbound variable 't' - -error[E04016]: too few arguments - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:7:9 - │ -7 │ Foo() = x; - │ ^^^^^ Missing assignment for field '0' in '0x42::M::Foo' - -error[E04016]: too few arguments - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:7:9 - │ -7 │ Foo() = x; - │ ^^^^^ Missing assignment for field '1' in '0x42::M::Foo' - -error[E04007]: incompatible types - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:8:9 - │ -5 │ fun f(x: Foo) { - │ --- Expected: '0x42::M::Foo' - · -8 │ Bar() = x; - │ ^^^^^ - │ │ - │ Invalid deconstruction assignment - │ Given: '0x42::M::Bar' - -error[E03010]: unbound field - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:9:9 - │ -9 │ Bar(_, _) = x; - │ ^^^^^^^^^ Unbound field '0' in '0x42::M::Bar' - -error[E03010]: unbound field - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:9:9 - │ -9 │ Bar(_, _) = x; - │ ^^^^^^^^^ Unbound field '1' in '0x42::M::Bar' - -error[E04007]: incompatible types - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:9:9 - │ -5 │ fun f(x: Foo) { - │ --- Expected: '0x42::M::Foo' - · -9 │ Bar(_, _) = x; - │ ^^^^^^^^^ - │ │ - │ Invalid deconstruction assignment - │ Given: '0x42::M::Bar' - -error[E04016]: too few arguments - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:13:13 - │ -13 │ let Foo() = x; - │ ^^^^^ Missing binding for field '0' in '0x42::M::Foo' - -error[E04016]: too few arguments - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:13:13 - │ -13 │ let Foo() = x; - │ ^^^^^ Missing binding for field '1' in '0x42::M::Foo' - -error[E04007]: incompatible types - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:14:13 - │ -12 │ fun g(x: Foo) { - │ --- Expected: '0x42::M::Foo' -13 │ let Foo() = x; -14 │ let Bar() = x; - │ ^^^^^ - │ │ - │ Invalid deconstruction binding - │ Given: '0x42::M::Bar' - -error[E03010]: unbound field - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:15:13 - │ -15 │ let Bar(c, d) = x; - │ ^^^^^^^^^ Unbound field '0' in '0x42::M::Bar' - -error[E03010]: unbound field - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:15:13 - │ -15 │ let Bar(c, d) = x; - │ ^^^^^^^^^ Unbound field '1' in '0x42::M::Bar' - -error[E04007]: incompatible types - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:15:13 - │ -12 │ fun g(x: Foo) { - │ --- Expected: '0x42::M::Foo' - · -15 │ let Bar(c, d) = x; - │ ^^^^^^^^^ - │ │ - │ Invalid deconstruction binding - │ Given: '0x42::M::Bar' - -warning[W09002]: unused variable - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:15:17 - │ -15 │ let Bar(c, d) = x; - │ ^ Unused local variable 'c'. Consider removing or prefixing with an underscore: '_c' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:15:20 - │ -15 │ let Bar(c, d) = x; - │ ^ Unused local variable 'd'. Consider removing or prefixing with an underscore: '_d' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04007]: incompatible types - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:19:9 - │ -18 │ fun h(x: Bar) { - │ --- Expected: '0x42::M::Bar' -19 │ Foo(_, _) = x; - │ ^^^^^^^^^ - │ │ - │ Invalid deconstruction assignment - │ Given: '0x42::M::Foo' - -error[E03009]: unbound variable - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:20:13 - │ -20 │ Foo(t, y) = x; - │ ^ Invalid assignment. Unbound variable 't' - -error[E04007]: incompatible types - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:21:9 - │ -18 │ fun h(x: Bar) { - │ --- Expected: '0x42::M::Bar' - · -21 │ Foo() = x; - │ ^^^^^ - │ │ - │ Invalid deconstruction assignment - │ Given: '0x42::M::Foo' - -error[E04016]: too few arguments - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:21:9 - │ -21 │ Foo() = x; - │ ^^^^^ Missing assignment for field '0' in '0x42::M::Foo' - -error[E04016]: too few arguments - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:21:9 - │ -21 │ Foo() = x; - │ ^^^^^ Missing assignment for field '1' in '0x42::M::Foo' - -error[E03010]: unbound field - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:22:9 - │ -22 │ Bar(_, _) = x; - │ ^^^^^^^^^ Unbound field '0' in '0x42::M::Bar' - -error[E03010]: unbound field - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:22:9 - │ -22 │ Bar(_, _) = x; - │ ^^^^^^^^^ Unbound field '1' in '0x42::M::Bar' - -error[E04007]: incompatible types - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:26:13 - │ -25 │ fun z(x: Bar) { - │ --- Expected: '0x42::M::Bar' -26 │ let Foo(t, y) = x; - │ ^^^^^^^^^ - │ │ - │ Invalid deconstruction binding - │ Given: '0x42::M::Foo' - -warning[W09002]: unused variable - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:26:17 - │ -26 │ let Foo(t, y) = x; - │ ^ Unused local variable 't'. Consider removing or prefixing with an underscore: '_t' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:26:20 - │ -26 │ let Foo(t, y) = x; - │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04007]: incompatible types - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:27:13 - │ -25 │ fun z(x: Bar) { - │ --- Expected: '0x42::M::Bar' -26 │ let Foo(t, y) = x; -27 │ let Foo() = x; - │ ^^^^^ - │ │ - │ Invalid deconstruction binding - │ Given: '0x42::M::Foo' - -error[E04016]: too few arguments - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:27:13 - │ -27 │ let Foo() = x; - │ ^^^^^ Missing binding for field '0' in '0x42::M::Foo' - -error[E04016]: too few arguments - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:27:13 - │ -27 │ let Foo() = x; - │ ^^^^^ Missing binding for field '1' in '0x42::M::Foo' - -error[E03010]: unbound field - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:28:13 - │ -28 │ let Bar(_, _) = x; - │ ^^^^^^^^^ Unbound field '0' in '0x42::M::Bar' - -error[E03010]: unbound field - ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:28:13 - │ -28 │ let Bar(_, _) = x; - │ ^^^^^^^^^ Unbound field '1' in '0x42::M::Bar' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_lhs_unpack.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_lhs_unpack.snap new file mode 100644 index 0000000000000..e750144a7ecfb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_lhs_unpack.snap @@ -0,0 +1,241 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/positional_struct_lhs_unpack.move +--- +error[E03009]: unbound variable + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:6:13 + │ +6 │ Foo(t, y) = x; + │ ^ Invalid assignment. Unbound variable 't' + +error[E04016]: too few arguments + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:7:9 + │ +7 │ Foo() = x; + │ ^^^^^ Missing assignment for field '0' in '0x42::M::Foo' + +error[E04016]: too few arguments + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:7:9 + │ +7 │ Foo() = x; + │ ^^^^^ Missing assignment for field '1' in '0x42::M::Foo' + +error[E04007]: incompatible types + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:8:9 + │ +5 │ fun f(x: Foo) { + │ --- Expected: '0x42::M::Foo' + · +8 │ Bar() = x; + │ ^^^^^ + │ │ + │ Invalid deconstruction assignment + │ Given: '0x42::M::Bar' + +error[E03010]: unbound field + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:9:9 + │ +9 │ Bar(_, _) = x; + │ ^^^^^^^^^ Unbound field '0' in '0x42::M::Bar' + +error[E03010]: unbound field + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:9:9 + │ +9 │ Bar(_, _) = x; + │ ^^^^^^^^^ Unbound field '1' in '0x42::M::Bar' + +error[E04007]: incompatible types + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:9:9 + │ +5 │ fun f(x: Foo) { + │ --- Expected: '0x42::M::Foo' + · +9 │ Bar(_, _) = x; + │ ^^^^^^^^^ + │ │ + │ Invalid deconstruction assignment + │ Given: '0x42::M::Bar' + +error[E04016]: too few arguments + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:13:13 + │ +13 │ let Foo() = x; + │ ^^^^^ Missing binding for field '0' in '0x42::M::Foo' + +error[E04016]: too few arguments + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:13:13 + │ +13 │ let Foo() = x; + │ ^^^^^ Missing binding for field '1' in '0x42::M::Foo' + +error[E04007]: incompatible types + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:14:13 + │ +12 │ fun g(x: Foo) { + │ --- Expected: '0x42::M::Foo' +13 │ let Foo() = x; +14 │ let Bar() = x; + │ ^^^^^ + │ │ + │ Invalid deconstruction binding + │ Given: '0x42::M::Bar' + +error[E03010]: unbound field + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:15:13 + │ +15 │ let Bar(c, d) = x; + │ ^^^^^^^^^ Unbound field '0' in '0x42::M::Bar' + +error[E03010]: unbound field + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:15:13 + │ +15 │ let Bar(c, d) = x; + │ ^^^^^^^^^ Unbound field '1' in '0x42::M::Bar' + +error[E04007]: incompatible types + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:15:13 + │ +12 │ fun g(x: Foo) { + │ --- Expected: '0x42::M::Foo' + · +15 │ let Bar(c, d) = x; + │ ^^^^^^^^^ + │ │ + │ Invalid deconstruction binding + │ Given: '0x42::M::Bar' + +warning[W09002]: unused variable + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:15:17 + │ +15 │ let Bar(c, d) = x; + │ ^ Unused local variable 'c'. Consider removing or prefixing with an underscore: '_c' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:15:20 + │ +15 │ let Bar(c, d) = x; + │ ^ Unused local variable 'd'. Consider removing or prefixing with an underscore: '_d' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04007]: incompatible types + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:19:9 + │ +18 │ fun h(x: Bar) { + │ --- Expected: '0x42::M::Bar' +19 │ Foo(_, _) = x; + │ ^^^^^^^^^ + │ │ + │ Invalid deconstruction assignment + │ Given: '0x42::M::Foo' + +error[E03009]: unbound variable + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:20:13 + │ +20 │ Foo(t, y) = x; + │ ^ Invalid assignment. Unbound variable 't' + +error[E04007]: incompatible types + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:21:9 + │ +18 │ fun h(x: Bar) { + │ --- Expected: '0x42::M::Bar' + · +21 │ Foo() = x; + │ ^^^^^ + │ │ + │ Invalid deconstruction assignment + │ Given: '0x42::M::Foo' + +error[E04016]: too few arguments + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:21:9 + │ +21 │ Foo() = x; + │ ^^^^^ Missing assignment for field '0' in '0x42::M::Foo' + +error[E04016]: too few arguments + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:21:9 + │ +21 │ Foo() = x; + │ ^^^^^ Missing assignment for field '1' in '0x42::M::Foo' + +error[E03010]: unbound field + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:22:9 + │ +22 │ Bar(_, _) = x; + │ ^^^^^^^^^ Unbound field '0' in '0x42::M::Bar' + +error[E03010]: unbound field + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:22:9 + │ +22 │ Bar(_, _) = x; + │ ^^^^^^^^^ Unbound field '1' in '0x42::M::Bar' + +error[E04007]: incompatible types + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:26:13 + │ +25 │ fun z(x: Bar) { + │ --- Expected: '0x42::M::Bar' +26 │ let Foo(t, y) = x; + │ ^^^^^^^^^ + │ │ + │ Invalid deconstruction binding + │ Given: '0x42::M::Foo' + +warning[W09002]: unused variable + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:26:17 + │ +26 │ let Foo(t, y) = x; + │ ^ Unused local variable 't'. Consider removing or prefixing with an underscore: '_t' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:26:20 + │ +26 │ let Foo(t, y) = x; + │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04007]: incompatible types + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:27:13 + │ +25 │ fun z(x: Bar) { + │ --- Expected: '0x42::M::Bar' +26 │ let Foo(t, y) = x; +27 │ let Foo() = x; + │ ^^^^^ + │ │ + │ Invalid deconstruction binding + │ Given: '0x42::M::Foo' + +error[E04016]: too few arguments + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:27:13 + │ +27 │ let Foo() = x; + │ ^^^^^ Missing binding for field '0' in '0x42::M::Foo' + +error[E04016]: too few arguments + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:27:13 + │ +27 │ let Foo() = x; + │ ^^^^^ Missing binding for field '1' in '0x42::M::Foo' + +error[E03010]: unbound field + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:28:13 + │ +28 │ let Bar(_, _) = x; + │ ^^^^^^^^^ Unbound field '0' in '0x42::M::Bar' + +error[E03010]: unbound field + ┌─ tests/move_2024/naming/positional_struct_lhs_unpack.move:28:13 + │ +28 │ let Bar(_, _) = x; + │ ^^^^^^^^^ Unbound field '1' in '0x42::M::Bar' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_non_positional_pack.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_non_positional_pack.exp deleted file mode 100644 index b674e1a74de05..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_non_positional_pack.exp +++ /dev/null @@ -1,21 +0,0 @@ -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/positional_struct_non_positional_pack.move:6:18 - │ -2 │ public struct Foo(u64) has copy, drop; - │ --- 'Foo' is declared here - · -6 │ let _x = Foo { pos0: 0 }; - │ ^^^^^^^^^^^^^^^ Invalid struct instantiation. Positional struct declarations require positional instantiations - -error[E03010]: unbound field - ┌─ tests/move_2024/naming/positional_struct_non_positional_pack.move:6:18 - │ -6 │ let _x = Foo { pos0: 0 }; - │ ^^^^^^^^^^^^^^^ Unbound field 'pos0' in '0x42::M::Foo' - -error[E04016]: too few arguments - ┌─ tests/move_2024/naming/positional_struct_non_positional_pack.move:6:18 - │ -6 │ let _x = Foo { pos0: 0 }; - │ ^^^^^^^^^^^^^^^ Missing argument for field '0' in '0x42::M::Foo' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_non_positional_pack.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_non_positional_pack.snap new file mode 100644 index 0000000000000..a9f3cee924fe6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_non_positional_pack.snap @@ -0,0 +1,28 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/positional_struct_non_positional_pack.move +--- +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/positional_struct_non_positional_pack.move:6:18 + │ +2 │ public struct Foo(u64) has copy, drop; + │ --- 'Foo' is declared here + · +6 │ let _x = Foo { pos0: 0 }; + │ ^^^^^^^^^^^^^^^ Invalid struct instantiation. Positional struct declarations require positional instantiations + +error[E03010]: unbound field + ┌─ tests/move_2024/naming/positional_struct_non_positional_pack.move:6:18 + │ +6 │ let _x = Foo { pos0: 0 }; + │ ^^^^^^^^^^^^^^^ Unbound field 'pos0' in '0x42::M::Foo' + +error[E04016]: too few arguments + ┌─ tests/move_2024/naming/positional_struct_non_positional_pack.move:6:18 + │ +6 │ let _x = Foo { pos0: 0 }; + │ ^^^^^^^^^^^^^^^ Missing argument for field '0' in '0x42::M::Foo' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_non_positional_unpack.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_non_positional_unpack.exp deleted file mode 100644 index a0e605a96af8a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_non_positional_unpack.exp +++ /dev/null @@ -1,58 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_2024/naming/positional_struct_non_positional_unpack.move:5:13 - │ -5 │ let x = Foo(0); - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/positional_struct_non_positional_unpack.move:7:13 - │ -2 │ public struct Foo(u64) has copy, drop; - │ --- 'Foo' is declared here - · -7 │ let Foo { y: _ } = Foo(0); - │ ^^^^^^^^^^^^ Invalid struct deconstruction. Positional struct declarations require positional deconstructions - -error[E03010]: unbound field - ┌─ tests/move_2024/naming/positional_struct_non_positional_unpack.move:7:13 - │ -7 │ let Foo { y: _ } = Foo(0); - │ ^^^^^^^^^^^^ Unbound field 'y' in '0x42::M::Foo' - -error[E04016]: too few arguments - ┌─ tests/move_2024/naming/positional_struct_non_positional_unpack.move:7:13 - │ -7 │ let Foo { y: _ } = Foo(0); - │ ^^^^^^^^^^^^ Missing binding for field '0' in '0x42::M::Foo' - -warning[W09002]: unused variable - ┌─ tests/move_2024/naming/positional_struct_non_positional_unpack.move:12:13 - │ -12 │ let x = Foo(0); - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/positional_struct_non_positional_unpack.move:14:9 - │ - 2 │ public struct Foo(u64) has copy, drop; - │ --- 'Foo' is declared here - · -14 │ Foo { y: _ } = Foo(0); - │ ^^^^^^^^^^^^ Invalid struct deconstruction. Positional struct declarations require positional deconstructions - -error[E03010]: unbound field - ┌─ tests/move_2024/naming/positional_struct_non_positional_unpack.move:14:9 - │ -14 │ Foo { y: _ } = Foo(0); - │ ^^^^^^^^^^^^ Unbound field 'y' in '0x42::M::Foo' - -error[E04016]: too few arguments - ┌─ tests/move_2024/naming/positional_struct_non_positional_unpack.move:14:9 - │ -14 │ Foo { y: _ } = Foo(0); - │ ^^^^^^^^^^^^ Missing assignment for field '0' in '0x42::M::Foo' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_non_positional_unpack.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_non_positional_unpack.snap new file mode 100644 index 0000000000000..5158427224c81 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_non_positional_unpack.snap @@ -0,0 +1,65 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/positional_struct_non_positional_unpack.move +--- +warning[W09002]: unused variable + ┌─ tests/move_2024/naming/positional_struct_non_positional_unpack.move:5:13 + │ +5 │ let x = Foo(0); + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/positional_struct_non_positional_unpack.move:7:13 + │ +2 │ public struct Foo(u64) has copy, drop; + │ --- 'Foo' is declared here + · +7 │ let Foo { y: _ } = Foo(0); + │ ^^^^^^^^^^^^ Invalid struct deconstruction. Positional struct declarations require positional deconstructions + +error[E03010]: unbound field + ┌─ tests/move_2024/naming/positional_struct_non_positional_unpack.move:7:13 + │ +7 │ let Foo { y: _ } = Foo(0); + │ ^^^^^^^^^^^^ Unbound field 'y' in '0x42::M::Foo' + +error[E04016]: too few arguments + ┌─ tests/move_2024/naming/positional_struct_non_positional_unpack.move:7:13 + │ +7 │ let Foo { y: _ } = Foo(0); + │ ^^^^^^^^^^^^ Missing binding for field '0' in '0x42::M::Foo' + +warning[W09002]: unused variable + ┌─ tests/move_2024/naming/positional_struct_non_positional_unpack.move:12:13 + │ +12 │ let x = Foo(0); + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/positional_struct_non_positional_unpack.move:14:9 + │ + 2 │ public struct Foo(u64) has copy, drop; + │ --- 'Foo' is declared here + · +14 │ Foo { y: _ } = Foo(0); + │ ^^^^^^^^^^^^ Invalid struct deconstruction. Positional struct declarations require positional deconstructions + +error[E03010]: unbound field + ┌─ tests/move_2024/naming/positional_struct_non_positional_unpack.move:14:9 + │ +14 │ Foo { y: _ } = Foo(0); + │ ^^^^^^^^^^^^ Unbound field 'y' in '0x42::M::Foo' + +error[E04016]: too few arguments + ┌─ tests/move_2024/naming/positional_struct_non_positional_unpack.move:14:9 + │ +14 │ Foo { y: _ } = Foo(0); + │ ^^^^^^^^^^^^ Missing assignment for field '0' in '0x42::M::Foo' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_resolution.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_resolution.snap new file mode 100644 index 0000000000000..ecb5542588d06 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_struct_resolution.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/positional_struct_resolution.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_unpack_of_non_positional_struct.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_unpack_of_non_positional_struct.exp deleted file mode 100644 index 997a6cd4cb919..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_unpack_of_non_positional_struct.exp +++ /dev/null @@ -1,42 +0,0 @@ -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/positional_unpack_of_non_positional_struct.move:7:13 - │ -2 │ public struct Foo { field: u64 } has copy, drop; - │ --- 'Foo' is declared here - · -7 │ let Foo(_) = x; - │ ^^^^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions - -error[E03010]: unbound field - ┌─ tests/move_2024/naming/positional_unpack_of_non_positional_struct.move:7:13 - │ -7 │ let Foo(_) = x; - │ ^^^^^^ Unbound field '0' in '0x42::M::Foo' - -error[E04016]: too few arguments - ┌─ tests/move_2024/naming/positional_unpack_of_non_positional_struct.move:7:13 - │ -7 │ let Foo(_) = x; - │ ^^^^^^ Missing binding for field 'field' in '0x42::M::Foo' - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/positional_unpack_of_non_positional_struct.move:14:9 - │ - 2 │ public struct Foo { field: u64 } has copy, drop; - │ --- 'Foo' is declared here - · -14 │ Foo(_) = x; - │ ^^^^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions - -error[E03010]: unbound field - ┌─ tests/move_2024/naming/positional_unpack_of_non_positional_struct.move:14:9 - │ -14 │ Foo(_) = x; - │ ^^^^^^ Unbound field '0' in '0x42::M::Foo' - -error[E04016]: too few arguments - ┌─ tests/move_2024/naming/positional_unpack_of_non_positional_struct.move:14:9 - │ -14 │ Foo(_) = x; - │ ^^^^^^ Missing assignment for field 'field' in '0x42::M::Foo' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_unpack_of_non_positional_struct.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_unpack_of_non_positional_struct.snap new file mode 100644 index 0000000000000..aa436d97ea078 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_unpack_of_non_positional_struct.snap @@ -0,0 +1,49 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/positional_unpack_of_non_positional_struct.move +--- +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/positional_unpack_of_non_positional_struct.move:7:13 + │ +2 │ public struct Foo { field: u64 } has copy, drop; + │ --- 'Foo' is declared here + · +7 │ let Foo(_) = x; + │ ^^^^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions + +error[E03010]: unbound field + ┌─ tests/move_2024/naming/positional_unpack_of_non_positional_struct.move:7:13 + │ +7 │ let Foo(_) = x; + │ ^^^^^^ Unbound field '0' in '0x42::M::Foo' + +error[E04016]: too few arguments + ┌─ tests/move_2024/naming/positional_unpack_of_non_positional_struct.move:7:13 + │ +7 │ let Foo(_) = x; + │ ^^^^^^ Missing binding for field 'field' in '0x42::M::Foo' + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/positional_unpack_of_non_positional_struct.move:14:9 + │ + 2 │ public struct Foo { field: u64 } has copy, drop; + │ --- 'Foo' is declared here + · +14 │ Foo(_) = x; + │ ^^^^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions + +error[E03010]: unbound field + ┌─ tests/move_2024/naming/positional_unpack_of_non_positional_struct.move:14:9 + │ +14 │ Foo(_) = x; + │ ^^^^^^ Unbound field '0' in '0x42::M::Foo' + +error[E04016]: too few arguments + ┌─ tests/move_2024/naming/positional_unpack_of_non_positional_struct.move:14:9 + │ +14 │ Foo(_) = x; + │ ^^^^^^ Missing assignment for field 'field' in '0x42::M::Foo' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_unpack_of_positional_struct.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_unpack_of_positional_struct.snap new file mode 100644 index 0000000000000..2c3fa6f54ea8f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/positional_unpack_of_positional_struct.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/positional_unpack_of_positional_struct.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/public_use_fun_invalid_type.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/public_use_fun_invalid_type.exp deleted file mode 100644 index 17c418aba9cff..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/public_use_fun_invalid_type.exp +++ /dev/null @@ -1,33 +0,0 @@ -error[E02017]: invalid 'use fun' declaration - ┌─ tests/move_2024/naming/public_use_fun_invalid_type.move:21:5 - │ - 3 │ public struct X {} - │ - Type defined in another module here - · -21 │ public use fun std::utilities::x_ex as std::utilities::X.ex; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid 'use fun'. Cannot publicly associate a function with a type defined in another module - │ Declared 'public' here. Consider removing to make a local 'use fun' instead - -error[E02017]: invalid 'use fun' declaration - ┌─ tests/move_2024/naming/public_use_fun_invalid_type.move:25:5 - │ -25 │ public use fun std::utilities::vec_ex as vector.ex; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid 'use fun'. Cannot publicly associate a function with a type defined in another module - │ Declared 'public' here. Consider removing to make a local 'use fun' instead - -error[E02017]: invalid 'use fun' declaration - ┌─ tests/move_2024/naming/public_use_fun_invalid_type.move:29:5 - │ - 2 │ module std::utilities { - │ --------- Type defined in another module here - · -29 │ public use fun std::utilities::u64_ex as u64.ex; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid 'use fun'. Cannot publicly associate a function with a type defined in another module - │ Declared 'public' here. Consider removing to make a local 'use fun' instead - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/public_use_fun_invalid_type.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/public_use_fun_invalid_type.snap new file mode 100644 index 0000000000000..80cd571303b5c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/public_use_fun_invalid_type.snap @@ -0,0 +1,40 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/public_use_fun_invalid_type.move +--- +error[E02017]: invalid 'use fun' declaration + ┌─ tests/move_2024/naming/public_use_fun_invalid_type.move:21:5 + │ + 3 │ public struct X {} + │ - Type defined in another module here + · +21 │ public use fun std::utilities::x_ex as std::utilities::X.ex; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid 'use fun'. Cannot publicly associate a function with a type defined in another module + │ Declared 'public' here. Consider removing to make a local 'use fun' instead + +error[E02017]: invalid 'use fun' declaration + ┌─ tests/move_2024/naming/public_use_fun_invalid_type.move:25:5 + │ +25 │ public use fun std::utilities::vec_ex as vector.ex; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid 'use fun'. Cannot publicly associate a function with a type defined in another module + │ Declared 'public' here. Consider removing to make a local 'use fun' instead + +error[E02017]: invalid 'use fun' declaration + ┌─ tests/move_2024/naming/public_use_fun_invalid_type.move:29:5 + │ + 2 │ module std::utilities { + │ --------- Type defined in another module here + · +29 │ public use fun std::utilities::u64_ex as u64.ex; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid 'use fun'. Cannot publicly associate a function with a type defined in another module + │ Declared 'public' here. Consider removing to make a local 'use fun' instead diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/public_use_fun_valid_type.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/public_use_fun_valid_type.snap new file mode 100644 index 0000000000000..486209ac1d859 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/public_use_fun_valid_type.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/public_use_fun_valid_type.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/standalone_mname.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/standalone_mname.exp deleted file mode 100644 index 73e2cee1dc43f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/standalone_mname.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/naming/standalone_mname.move:3:17 - │ -3 │ let m = M; m; - │ ^ Expected a type, function, or constant in this position, not an address - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/standalone_mname.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/standalone_mname.snap new file mode 100644 index 0000000000000..0fa62aa8e9f36 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/standalone_mname.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/standalone_mname.move +--- +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/naming/standalone_mname.move:3:17 + │ +3 │ let m = M; m; + │ ^ Expected a type, function, or constant in this position, not an address diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/standalone_module_ident.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/standalone_module_ident.exp deleted file mode 100644 index 5365a4600c603..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/standalone_module_ident.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/move_2024/naming/standalone_module_ident.move:4:9 - │ -4 │ use 0x2::X; - │ ^^^^^^ Invalid 'use'. Unbound module: '0x2::X' - -error[E03005]: unbound unscoped name - ┌─ tests/move_2024/naming/standalone_module_ident.move:6:17 - │ -6 │ let x = X; x; - │ ^ Unbound constant 'X' - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/naming/standalone_module_ident.move:7:17 - │ -7 │ let x = 0x2::X; x; - │ ^^^^^^ Unexpected module identifier. A module identifier is not a valid expression - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/naming/standalone_module_ident.move:8:17 - │ -8 │ let y = 0x2::Y; y; - │ ^^^^^^ Unexpected module identifier. A module identifier is not a valid expression - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/standalone_module_ident.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/standalone_module_ident.snap new file mode 100644 index 0000000000000..42522870aaf92 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/standalone_module_ident.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/standalone_module_ident.move +--- +error[E03002]: unbound module + ┌─ tests/move_2024/naming/standalone_module_ident.move:4:9 + │ +4 │ use 0x2::X; + │ ^^^^^^ Invalid 'use'. Unbound module: '0x2::X' + +error[E03005]: unbound unscoped name + ┌─ tests/move_2024/naming/standalone_module_ident.move:6:17 + │ +6 │ let x = X; x; + │ ^ Unbound constant 'X' + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/naming/standalone_module_ident.move:7:17 + │ +7 │ let x = 0x2::X; x; + │ ^^^^^^ Unexpected module identifier. A module identifier is not a valid expression + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/naming/standalone_module_ident.move:8:17 + │ +8 │ let y = 0x2::Y; y; + │ ^^^^^^ Unexpected module identifier. A module identifier is not a valid expression diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/struct_ellipsis.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/struct_ellipsis.snap new file mode 100644 index 0000000000000..11255504a74a7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/struct_ellipsis.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/struct_ellipsis.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/struct_ellipsis_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/struct_ellipsis_invalid.exp deleted file mode 100644 index 9699e3b2c5456..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/struct_ellipsis_invalid.exp +++ /dev/null @@ -1,82 +0,0 @@ -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:6:13 - │ -3 │ public struct Y{} - │ - 'Y' is declared here - · -6 │ let Y(..) = x; - │ ^^^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:10:13 - │ - 3 │ public struct Y{} - │ - 'Y' is declared here - · -10 │ let Y(x, ..) = x; - │ ^^^^^^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions - -error[E03010]: unbound field - ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:10:13 - │ -10 │ let Y(x, ..) = x; - │ ^^^^^^^^ Unbound field '0' in '0x42::m::Y' - -warning[W09002]: unused variable - ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:10:15 - │ -10 │ let Y(x, ..) = x; - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:14:13 - │ - 3 │ public struct Y{} - │ - 'Y' is declared here - · -14 │ let Y() = x; - │ ^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:18:13 - │ - 2 │ public struct X() - │ - 'X' is declared here - · -18 │ let X{..} = x; - │ ^^^^^ Invalid struct deconstruction. Positional struct declarations require positional deconstructions - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:22:13 - │ - 2 │ public struct X() - │ - 'X' is declared here - · -22 │ let X{x, ..} = x; - │ ^^^^^^^^ Invalid struct deconstruction. Positional struct declarations require positional deconstructions - -error[E03010]: unbound field - ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:22:13 - │ -22 │ let X{x, ..} = x; - │ ^^^^^^^^ Unbound field 'x' in '0x42::m::X' - -warning[W09002]: unused variable - ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:22:15 - │ -22 │ let X{x, ..} = x; - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:26:13 - │ - 2 │ public struct X() - │ - 'X' is declared here - · -26 │ let X{} = x; - │ ^^^ Invalid struct deconstruction. Positional struct declarations require positional deconstructions - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/struct_ellipsis_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/struct_ellipsis_invalid.snap new file mode 100644 index 0000000000000..9552e74111047 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/struct_ellipsis_invalid.snap @@ -0,0 +1,89 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/struct_ellipsis_invalid.move +--- +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:6:13 + │ +3 │ public struct Y{} + │ - 'Y' is declared here + · +6 │ let Y(..) = x; + │ ^^^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:10:13 + │ + 3 │ public struct Y{} + │ - 'Y' is declared here + · +10 │ let Y(x, ..) = x; + │ ^^^^^^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions + +error[E03010]: unbound field + ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:10:13 + │ +10 │ let Y(x, ..) = x; + │ ^^^^^^^^ Unbound field '0' in '0x42::m::Y' + +warning[W09002]: unused variable + ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:10:15 + │ +10 │ let Y(x, ..) = x; + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:14:13 + │ + 3 │ public struct Y{} + │ - 'Y' is declared here + · +14 │ let Y() = x; + │ ^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:18:13 + │ + 2 │ public struct X() + │ - 'X' is declared here + · +18 │ let X{..} = x; + │ ^^^^^ Invalid struct deconstruction. Positional struct declarations require positional deconstructions + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:22:13 + │ + 2 │ public struct X() + │ - 'X' is declared here + · +22 │ let X{x, ..} = x; + │ ^^^^^^^^ Invalid struct deconstruction. Positional struct declarations require positional deconstructions + +error[E03010]: unbound field + ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:22:13 + │ +22 │ let X{x, ..} = x; + │ ^^^^^^^^ Unbound field 'x' in '0x42::m::X' + +warning[W09002]: unused variable + ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:22:15 + │ +22 │ let X{x, ..} = x; + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/naming/struct_ellipsis_invalid.move:26:13 + │ + 2 │ public struct X() + │ - 'X' is declared here + · +26 │ let X{} = x; + │ ^^^ Invalid struct deconstruction. Positional struct declarations require positional deconstructions diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/syntax_annotation_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/syntax_annotation_invalid.exp deleted file mode 100644 index a046905292151..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/syntax_annotation_invalid.exp +++ /dev/null @@ -1,32 +0,0 @@ -error[E02015]: invalid attribute - ┌─ tests/move_2024/naming/syntax_annotation_invalid.move:5:7 - │ -5 │ #[syntax] - │ ^^^^^^ Expected a parameter list of syntax method usage forms, e.g., 'syntax(index)' - -error[E02015]: invalid attribute - ┌─ tests/move_2024/naming/syntax_annotation_invalid.move:8:14 - │ -8 │ #[syntax(index(A))] - │ ^^^^^ Expected a standalone syntax method identifier, e.g., 'syntax(index)' - -error[E02015]: invalid attribute - ┌─ tests/move_2024/naming/syntax_annotation_invalid.move:14:7 - │ -14 │ #[syntax = index] - │ ^^^^^^^^^^^^^^ Expected a parameter list of syntax method usage forms, e.g., 'syntax(index)' - -error[E02015]: invalid attribute - ┌─ tests/move_2024/naming/syntax_annotation_invalid.move:17:14 - │ -17 │ #[syntax(index = foo)] - │ ^^^^^ Expected a standalone syntax method identifier, e.g., 'syntax(index)' - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/naming/syntax_annotation_invalid.move:22:21 - │ -22 │ #[syntax(index, index)] - │ ----- ^^^^^ Duplicate attribute 'index' attached to the same item - │ │ - │ Attribute previously given here - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/syntax_annotation_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/syntax_annotation_invalid.snap new file mode 100644 index 0000000000000..5663ca8de7a69 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/syntax_annotation_invalid.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/syntax_annotation_invalid.move +--- +error[E02015]: invalid attribute + ┌─ tests/move_2024/naming/syntax_annotation_invalid.move:5:7 + │ +5 │ #[syntax] + │ ^^^^^^ Expected a parameter list of syntax method usage forms, e.g., 'syntax(index)' + +error[E02015]: invalid attribute + ┌─ tests/move_2024/naming/syntax_annotation_invalid.move:8:14 + │ +8 │ #[syntax(index(A))] + │ ^^^^^ Expected a standalone syntax method identifier, e.g., 'syntax(index)' + +error[E02015]: invalid attribute + ┌─ tests/move_2024/naming/syntax_annotation_invalid.move:14:7 + │ +14 │ #[syntax = index] + │ ^^^^^^^^^^^^^^ Expected a parameter list of syntax method usage forms, e.g., 'syntax(index)' + +error[E02015]: invalid attribute + ┌─ tests/move_2024/naming/syntax_annotation_invalid.move:17:14 + │ +17 │ #[syntax(index = foo)] + │ ^^^^^ Expected a standalone syntax method identifier, e.g., 'syntax(index)' + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/naming/syntax_annotation_invalid.move:22:21 + │ +22 │ #[syntax(index, index)] + │ ----- ^^^^^ Duplicate attribute 'index' attached to the same item + │ │ + │ Attribute previously given here diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_invalid_location.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_invalid_location.exp deleted file mode 100644 index 15cdfcda02739..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_invalid_location.exp +++ /dev/null @@ -1,46 +0,0 @@ -error[E03021]: invalid type annotation - ┌─ tests/move_2024/naming/type_hole_invalid_location.move:2:21 - │ -2 │ public struct P(_) - │ ^ Invalid usage of a placeholder for type inference '_'. Struct fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter - -error[E03021]: invalid type annotation - ┌─ tests/move_2024/naming/type_hole_invalid_location.move:3:26 - │ -3 │ public struct S { f: _ } - │ ^ Invalid usage of a placeholder for type inference '_'. Struct fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter - -error[E03021]: invalid type annotation - ┌─ tests/move_2024/naming/type_hole_invalid_location.move:4:23 - │ -4 │ public enum E { P(_), S { f: _ } } - │ ^ Invalid usage of a placeholder for type inference '_'. Enum variant fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter - -error[E03021]: invalid type annotation - ┌─ tests/move_2024/naming/type_hole_invalid_location.move:4:34 - │ -4 │ public enum E { P(_), S { f: _ } } - │ ^ Invalid usage of a placeholder for type inference '_'. Enum variant fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter - -error[E03021]: invalid type annotation - ┌─ tests/move_2024/naming/type_hole_invalid_location.move:5:14 - │ -5 │ const C: _ = 0; - │ ^ Invalid usage of a placeholder for type inference '_'. Constants require fully specified types. Replace '_' with a specific type - -error[E03021]: invalid type annotation - ┌─ tests/move_2024/naming/type_hole_invalid_location.move:6:16 - │ -6 │ fun foo(_: _) {} - │ ^ Invalid usage of a placeholder for type inference '_'. Functions require fully specified types. Replace '_' with a specific type or consider adding a new type parameter - │ - = Only 'macro' functions can use '_' in their signatures - -error[E03021]: invalid type annotation - ┌─ tests/move_2024/naming/type_hole_invalid_location.move:7:16 - │ -7 │ fun bar(): _ { 0 } - │ ^ Invalid usage of a placeholder for type inference '_'. Functions require fully specified types. Replace '_' with a specific type or consider adding a new type parameter - │ - = Only 'macro' functions can use '_' in their signatures - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_invalid_location.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_invalid_location.snap new file mode 100644 index 0000000000000..ba0050e22ebfc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_invalid_location.snap @@ -0,0 +1,53 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/type_hole_invalid_location.move +--- +error[E03021]: invalid type annotation + ┌─ tests/move_2024/naming/type_hole_invalid_location.move:2:21 + │ +2 │ public struct P(_) + │ ^ Invalid usage of a placeholder for type inference '_'. Struct fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter + +error[E03021]: invalid type annotation + ┌─ tests/move_2024/naming/type_hole_invalid_location.move:3:26 + │ +3 │ public struct S { f: _ } + │ ^ Invalid usage of a placeholder for type inference '_'. Struct fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter + +error[E03021]: invalid type annotation + ┌─ tests/move_2024/naming/type_hole_invalid_location.move:4:23 + │ +4 │ public enum E { P(_), S { f: _ } } + │ ^ Invalid usage of a placeholder for type inference '_'. Enum variant fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter + +error[E03021]: invalid type annotation + ┌─ tests/move_2024/naming/type_hole_invalid_location.move:4:34 + │ +4 │ public enum E { P(_), S { f: _ } } + │ ^ Invalid usage of a placeholder for type inference '_'. Enum variant fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter + +error[E03021]: invalid type annotation + ┌─ tests/move_2024/naming/type_hole_invalid_location.move:5:14 + │ +5 │ const C: _ = 0; + │ ^ Invalid usage of a placeholder for type inference '_'. Constants require fully specified types. Replace '_' with a specific type + +error[E03021]: invalid type annotation + ┌─ tests/move_2024/naming/type_hole_invalid_location.move:6:16 + │ +6 │ fun foo(_: _) {} + │ ^ Invalid usage of a placeholder for type inference '_'. Functions require fully specified types. Replace '_' with a specific type or consider adding a new type parameter + │ + = Only 'macro' functions can use '_' in their signatures + +error[E03021]: invalid type annotation + ┌─ tests/move_2024/naming/type_hole_invalid_location.move:7:16 + │ +7 │ fun bar(): _ { 0 } + │ ^ Invalid usage of a placeholder for type inference '_'. Functions require fully specified types. Replace '_' with a specific type or consider adding a new type parameter + │ + = Only 'macro' functions can use '_' in their signatures diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_invalid_location_nested.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_invalid_location_nested.exp deleted file mode 100644 index da565d305a88c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_invalid_location_nested.exp +++ /dev/null @@ -1,60 +0,0 @@ -error[E03021]: invalid type annotation - ┌─ tests/move_2024/naming/type_hole_invalid_location_nested.move:3:31 - │ -3 │ public struct P(Pair) - │ ^ Invalid usage of a placeholder for type inference '_'. Struct fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter - -error[E03021]: invalid type annotation - ┌─ tests/move_2024/naming/type_hole_invalid_location_nested.move:4:31 - │ -4 │ public struct S { f: Pair<_, bool> } - │ ^ Invalid usage of a placeholder for type inference '_'. Struct fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter - -error[E03021]: invalid type annotation - ┌─ tests/move_2024/naming/type_hole_invalid_location_nested.move:5:28 - │ -5 │ public enum E { P(Pair<_, _>), S { f: vector<_> } } - │ ^ Invalid usage of a placeholder for type inference '_'. Enum variant fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter - -error[E03021]: invalid type annotation - ┌─ tests/move_2024/naming/type_hole_invalid_location_nested.move:5:31 - │ -5 │ public enum E { P(Pair<_, _>), S { f: vector<_> } } - │ ^ Invalid usage of a placeholder for type inference '_'. Enum variant fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter - -error[E03021]: invalid type annotation - ┌─ tests/move_2024/naming/type_hole_invalid_location_nested.move:5:50 - │ -5 │ public enum E { P(Pair<_, _>), S { f: vector<_> } } - │ ^ Invalid usage of a placeholder for type inference '_'. Enum variant fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter - -error[E03021]: invalid type annotation - ┌─ tests/move_2024/naming/type_hole_invalid_location_nested.move:6:21 - │ -6 │ const C: vector<_> = vector[0]; - │ ^ Invalid usage of a placeholder for type inference '_'. Constants require fully specified types. Replace '_' with a specific type - -error[E03021]: invalid type annotation - ┌─ tests/move_2024/naming/type_hole_invalid_location_nested.move:7:21 - │ -7 │ fun foo(p: Pair<_, vector>): vector { p.1 } - │ ^ Invalid usage of a placeholder for type inference '_'. Functions require fully specified types. Replace '_' with a specific type or consider adding a new type parameter - │ - = Only 'macro' functions can use '_' in their signatures - -error[E03021]: invalid type annotation - ┌─ tests/move_2024/naming/type_hole_invalid_location_nested.move:8:21 - │ -8 │ fun bar(): Pair<_, _> { Pair(any(), any()) } - │ ^ Invalid usage of a placeholder for type inference '_'. Functions require fully specified types. Replace '_' with a specific type or consider adding a new type parameter - │ - = Only 'macro' functions can use '_' in their signatures - -error[E03021]: invalid type annotation - ┌─ tests/move_2024/naming/type_hole_invalid_location_nested.move:8:24 - │ -8 │ fun bar(): Pair<_, _> { Pair(any(), any()) } - │ ^ Invalid usage of a placeholder for type inference '_'. Functions require fully specified types. Replace '_' with a specific type or consider adding a new type parameter - │ - = Only 'macro' functions can use '_' in their signatures - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_invalid_location_nested.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_invalid_location_nested.snap new file mode 100644 index 0000000000000..559ea18717048 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_invalid_location_nested.snap @@ -0,0 +1,67 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/type_hole_invalid_location_nested.move +--- +error[E03021]: invalid type annotation + ┌─ tests/move_2024/naming/type_hole_invalid_location_nested.move:3:31 + │ +3 │ public struct P(Pair) + │ ^ Invalid usage of a placeholder for type inference '_'. Struct fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter + +error[E03021]: invalid type annotation + ┌─ tests/move_2024/naming/type_hole_invalid_location_nested.move:4:31 + │ +4 │ public struct S { f: Pair<_, bool> } + │ ^ Invalid usage of a placeholder for type inference '_'. Struct fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter + +error[E03021]: invalid type annotation + ┌─ tests/move_2024/naming/type_hole_invalid_location_nested.move:5:28 + │ +5 │ public enum E { P(Pair<_, _>), S { f: vector<_> } } + │ ^ Invalid usage of a placeholder for type inference '_'. Enum variant fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter + +error[E03021]: invalid type annotation + ┌─ tests/move_2024/naming/type_hole_invalid_location_nested.move:5:31 + │ +5 │ public enum E { P(Pair<_, _>), S { f: vector<_> } } + │ ^ Invalid usage of a placeholder for type inference '_'. Enum variant fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter + +error[E03021]: invalid type annotation + ┌─ tests/move_2024/naming/type_hole_invalid_location_nested.move:5:50 + │ +5 │ public enum E { P(Pair<_, _>), S { f: vector<_> } } + │ ^ Invalid usage of a placeholder for type inference '_'. Enum variant fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter + +error[E03021]: invalid type annotation + ┌─ tests/move_2024/naming/type_hole_invalid_location_nested.move:6:21 + │ +6 │ const C: vector<_> = vector[0]; + │ ^ Invalid usage of a placeholder for type inference '_'. Constants require fully specified types. Replace '_' with a specific type + +error[E03021]: invalid type annotation + ┌─ tests/move_2024/naming/type_hole_invalid_location_nested.move:7:21 + │ +7 │ fun foo(p: Pair<_, vector>): vector { p.1 } + │ ^ Invalid usage of a placeholder for type inference '_'. Functions require fully specified types. Replace '_' with a specific type or consider adding a new type parameter + │ + = Only 'macro' functions can use '_' in their signatures + +error[E03021]: invalid type annotation + ┌─ tests/move_2024/naming/type_hole_invalid_location_nested.move:8:21 + │ +8 │ fun bar(): Pair<_, _> { Pair(any(), any()) } + │ ^ Invalid usage of a placeholder for type inference '_'. Functions require fully specified types. Replace '_' with a specific type or consider adding a new type parameter + │ + = Only 'macro' functions can use '_' in their signatures + +error[E03021]: invalid type annotation + ┌─ tests/move_2024/naming/type_hole_invalid_location_nested.move:8:24 + │ +8 │ fun bar(): Pair<_, _> { Pair(any(), any()) } + │ ^ Invalid usage of a placeholder for type inference '_'. Functions require fully specified types. Replace '_' with a specific type or consider adding a new type parameter + │ + = Only 'macro' functions can use '_' in their signatures diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_valid_location.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_valid_location.snap new file mode 100644 index 0000000000000..d220995a28b71 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_valid_location.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/type_hole_valid_location.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_valid_location_invalid_usage.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_valid_location_invalid_usage.exp deleted file mode 100644 index 6bf206a7aa174..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_valid_location_invalid_usage.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/naming/type_hole_valid_location_invalid_usage.move:6:9 - │ -6 │ 0 as S<_>; - │ ^ ---- Found: 'a::m::S<_>'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ │ - │ Invalid argument to 'as' - -error[E04010]: cannot infer type - ┌─ tests/move_2024/naming/type_hole_valid_location_invalid_usage.move:6:16 - │ -6 │ 0 as S<_>; - │ ^ Could not infer this type. Try adding an annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_valid_location_invalid_usage.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_valid_location_invalid_usage.snap new file mode 100644 index 0000000000000..34876c9ae9cb4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_valid_location_invalid_usage.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/type_hole_valid_location_invalid_usage.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/naming/type_hole_valid_location_invalid_usage.move:6:9 + │ +6 │ 0 as S<_>; + │ ^ ---- Found: 'a::m::S<_>'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ │ + │ Invalid argument to 'as' + +error[E04010]: cannot infer type + ┌─ tests/move_2024/naming/type_hole_valid_location_invalid_usage.move:6:16 + │ +6 │ 0 as S<_>; + │ ^ Could not infer this type. Try adding an annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_valid_location_lambda.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_valid_location_lambda.snap new file mode 100644 index 0000000000000..0b066696ad6e4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/type_hole_valid_location_lambda.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/type_hole_valid_location_lambda.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unbound_module.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unbound_module.exp deleted file mode 100644 index cf95a49989109..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unbound_module.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/move_2024/naming/unbound_module.move:2:9 - │ -2 │ use 0x1::X as X; - │ ^^^^^^ Invalid 'use'. Unbound module: '0x1::X' - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/naming/unbound_module.move:4:9 - │ -4 │ X::foo(); - │ ^ Could not resolve the name 'X' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unbound_module.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unbound_module.snap new file mode 100644 index 0000000000000..825a422eec11d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unbound_module.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/unbound_module.move +--- +error[E03002]: unbound module + ┌─ tests/move_2024/naming/unbound_module.move:2:9 + │ +2 │ use 0x1::X as X; + │ ^^^^^^ Invalid 'use'. Unbound module: '0x1::X' + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/naming/unbound_module.move:4:9 + │ +4 │ X::foo(); + │ ^ Could not resolve the name 'X' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unbound_var_call.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unbound_var_call.exp deleted file mode 100644 index 2d728b0368ef7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unbound_var_call.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03005]: unbound unscoped name - ┌─ tests/move_2024/naming/unbound_var_call.move:6:9 - │ -6 │ fo(); - │ ^^ Unbound function 'fo' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unbound_var_call.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unbound_var_call.snap new file mode 100644 index 0000000000000..1708bac7f9825 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unbound_var_call.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/unbound_var_call.move +--- +error[E03005]: unbound unscoped name + ┌─ tests/move_2024/naming/unbound_var_call.move:6:9 + │ +6 │ fo(); + │ ^^ Unbound function 'fo' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unknown_contructor_name.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unknown_contructor_name.exp deleted file mode 100644 index 0e46037f1d110..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unknown_contructor_name.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03005]: unbound unscoped name - ┌─ tests/move_2024/naming/unknown_contructor_name.move:4:13 - │ -4 │ let _ = X>(); - │ ^ Unbound datatype or function 'X' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unknown_contructor_name.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unknown_contructor_name.snap new file mode 100644 index 0000000000000..12b2a778ea8c4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unknown_contructor_name.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/unknown_contructor_name.move +--- +error[E03005]: unbound unscoped name + ┌─ tests/move_2024/naming/unknown_contructor_name.move:4:13 + │ +4 │ let _ = X>(); + │ ^ Unbound datatype or function 'X' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unresolved_type_no_args.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unresolved_type_no_args.exp deleted file mode 100644 index 1670e121647be..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unresolved_type_no_args.exp +++ /dev/null @@ -1,38 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/naming/unresolved_type_no_args.move:2:5 - │ -2 │ struct Mine { f: Q } - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E03004]: unbound type - ┌─ tests/move_2024/naming/unresolved_type_no_args.move:2:22 - │ -2 │ struct Mine { f: Q } - │ ^ Unbound type 'Q' in current scope - -error[E03004]: unbound type - ┌─ tests/move_2024/naming/unresolved_type_no_args.move:3:16 - │ -3 │ fun foo(_: S): G { - │ ^ Unbound type 'S' in current scope - -error[E03004]: unbound type - ┌─ tests/move_2024/naming/unresolved_type_no_args.move:3:20 - │ -3 │ fun foo(_: S): G { - │ ^ Unbound type 'G' in current scope - -error[E03004]: unbound type - ┌─ tests/move_2024/naming/unresolved_type_no_args.move:4:16 - │ -4 │ let _: R = (0: P); - │ ^ Unbound type 'R' in current scope - -error[E03004]: unbound type - ┌─ tests/move_2024/naming/unresolved_type_no_args.move:4:24 - │ -4 │ let _: R = (0: P); - │ ^ Unbound type 'P' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unresolved_type_no_args.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unresolved_type_no_args.snap new file mode 100644 index 0000000000000..f2dabb6781f3d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unresolved_type_no_args.snap @@ -0,0 +1,45 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/unresolved_type_no_args.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/naming/unresolved_type_no_args.move:2:5 + │ +2 │ struct Mine { f: Q } + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E03004]: unbound type + ┌─ tests/move_2024/naming/unresolved_type_no_args.move:2:22 + │ +2 │ struct Mine { f: Q } + │ ^ Unbound type 'Q' in current scope + +error[E03004]: unbound type + ┌─ tests/move_2024/naming/unresolved_type_no_args.move:3:16 + │ +3 │ fun foo(_: S): G { + │ ^ Unbound type 'S' in current scope + +error[E03004]: unbound type + ┌─ tests/move_2024/naming/unresolved_type_no_args.move:3:20 + │ +3 │ fun foo(_: S): G { + │ ^ Unbound type 'G' in current scope + +error[E03004]: unbound type + ┌─ tests/move_2024/naming/unresolved_type_no_args.move:4:16 + │ +4 │ let _: R = (0: P); + │ ^ Unbound type 'R' in current scope + +error[E03004]: unbound type + ┌─ tests/move_2024/naming/unresolved_type_no_args.move:4:24 + │ +4 │ let _: R = (0: P); + │ ^ Unbound type 'P' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unresolved_type_with_args.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unresolved_type_with_args.exp deleted file mode 100644 index 491b26c15bf2d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unresolved_type_with_args.exp +++ /dev/null @@ -1,44 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/naming/unresolved_type_with_args.move:2:5 - │ -2 │ struct Mine { f: Q, g: X } - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E03004]: unbound type - ┌─ tests/move_2024/naming/unresolved_type_with_args.move:2:28 - │ -2 │ struct Mine { f: Q, g: X } - │ ^ Unbound type 'Q' in current scope - -error[E03004]: unbound type - ┌─ tests/move_2024/naming/unresolved_type_with_args.move:2:40 - │ -2 │ struct Mine { f: Q, g: X } - │ ^ Unbound type 'X' in current scope - -error[E03004]: unbound type - ┌─ tests/move_2024/naming/unresolved_type_with_args.move:3:22 - │ -3 │ fun foo(_: S): G { - │ ^ Unbound type 'S' in current scope - -error[E03004]: unbound type - ┌─ tests/move_2024/naming/unresolved_type_with_args.move:3:29 - │ -3 │ fun foo(_: S): G { - │ ^ Unbound type 'G' in current scope - -error[E03004]: unbound type - ┌─ tests/move_2024/naming/unresolved_type_with_args.move:4:16 - │ -4 │ let _: R = (0: P); - │ ^ Unbound type 'R' in current scope - -error[E03004]: unbound type - ┌─ tests/move_2024/naming/unresolved_type_with_args.move:4:27 - │ -4 │ let _: R = (0: P); - │ ^ Unbound type 'P' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unresolved_type_with_args.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unresolved_type_with_args.snap new file mode 100644 index 0000000000000..5a66dfde99e18 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unresolved_type_with_args.snap @@ -0,0 +1,51 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/unresolved_type_with_args.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/naming/unresolved_type_with_args.move:2:5 + │ +2 │ struct Mine { f: Q, g: X } + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E03004]: unbound type + ┌─ tests/move_2024/naming/unresolved_type_with_args.move:2:28 + │ +2 │ struct Mine { f: Q, g: X } + │ ^ Unbound type 'Q' in current scope + +error[E03004]: unbound type + ┌─ tests/move_2024/naming/unresolved_type_with_args.move:2:40 + │ +2 │ struct Mine { f: Q, g: X } + │ ^ Unbound type 'X' in current scope + +error[E03004]: unbound type + ┌─ tests/move_2024/naming/unresolved_type_with_args.move:3:22 + │ +3 │ fun foo(_: S): G { + │ ^ Unbound type 'S' in current scope + +error[E03004]: unbound type + ┌─ tests/move_2024/naming/unresolved_type_with_args.move:3:29 + │ +3 │ fun foo(_: S): G { + │ ^ Unbound type 'G' in current scope + +error[E03004]: unbound type + ┌─ tests/move_2024/naming/unresolved_type_with_args.move:4:16 + │ +4 │ let _: R = (0: P); + │ ^ Unbound type 'R' in current scope + +error[E03004]: unbound type + ┌─ tests/move_2024/naming/unresolved_type_with_args.move:4:27 + │ +4 │ let _: R = (0: P); + │ ^ Unbound type 'P' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unused_by_value_arg.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unused_by_value_arg.exp deleted file mode 100644 index 8938db380bc0d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unused_by_value_arg.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_2024/naming/unused_by_value_arg.move:4:19 - │ -4 │ macro fun foo($x: X) {} - │ ^^ Unused parameter '$x'. Consider removing or prefixing with an underscore: '_$x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09003]: unused assignment - ┌─ tests/move_2024/naming/unused_by_value_arg.move:4:19 - │ -4 │ macro fun foo($x: X) {} - │ ^^ Unused assignment for variable '$x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_$x') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unused_by_value_arg.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unused_by_value_arg.snap new file mode 100644 index 0000000000000..4cdd38f468db3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unused_by_value_arg.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/unused_by_value_arg.move +--- +warning[W09002]: unused variable + ┌─ tests/move_2024/naming/unused_by_value_arg.move:4:19 + │ +4 │ macro fun foo($x: X) {} + │ ^^ Unused parameter '$x'. Consider removing or prefixing with an underscore: '_$x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09003]: unused assignment + ┌─ tests/move_2024/naming/unused_by_value_arg.move:4:19 + │ +4 │ macro fun foo($x: X) {} + │ ^^ Unused assignment for variable '$x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_$x') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unused_lambda_arg.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unused_lambda_arg.exp deleted file mode 100644 index ff0e0fda4d81f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unused_lambda_arg.exp +++ /dev/null @@ -1,32 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_2024/naming/unused_lambda_arg.move:12:13 - │ -12 │ p!(|p| 0); - │ ^ Unused local variable 'p'. Consider removing or prefixing with an underscore: '_p' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_2024/naming/unused_lambda_arg.move:13:24 - │ -13 │ p!(|Point { x, y }| x); - │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_2024/naming/unused_lambda_arg.move:14:13 - │ -14 │ r!(|p| 0); - │ ^ Unused local variable 'p'. Consider removing or prefixing with an underscore: '_p' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_2024/naming/unused_lambda_arg.move:15:24 - │ -15 │ r!(|Point { x, y }| *x); - │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/unused_lambda_arg.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unused_lambda_arg.snap new file mode 100644 index 0000000000000..906c8cfd772b4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/unused_lambda_arg.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/unused_lambda_arg.move +--- +warning[W09002]: unused variable + ┌─ tests/move_2024/naming/unused_lambda_arg.move:12:13 + │ +12 │ p!(|p| 0); + │ ^ Unused local variable 'p'. Consider removing or prefixing with an underscore: '_p' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_2024/naming/unused_lambda_arg.move:13:24 + │ +13 │ p!(|Point { x, y }| x); + │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_2024/naming/unused_lambda_arg.move:14:13 + │ +14 │ r!(|p| 0); + │ ^ Unused local variable 'p'. Consider removing or prefixing with an underscore: '_p' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_2024/naming/unused_lambda_arg.move:15:24 + │ +15 │ r!(|Point { x, y }| *x); + │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_bad_args.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_bad_args.exp deleted file mode 100644 index 62cbc9afdecbb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_bad_args.exp +++ /dev/null @@ -1,81 +0,0 @@ -error[E02017]: invalid 'use fun' declaration - ┌─ tests/move_2024/naming/use_fun_bad_args.move:18:5 - │ - 5 │ public fun val_u64(_: u64) { abort 0 } - │ --- But 'a::m::val_u64' has a first argument of type 'u64' - · -18 │ use fun val_u64 as Y.val_u64; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.val_u64'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) - -error[E02017]: invalid 'use fun' declaration - ┌─ tests/move_2024/naming/use_fun_bad_args.move:19:5 - │ - 6 │ public fun imm_vec(_: &vector) { abort 0 } - │ ------------ But 'a::m::imm_vec' has a first argument of type '&vector' - · -19 │ use fun imm_vec as Y.imm_vec; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.imm_vec'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) - -error[E02017]: invalid 'use fun' declaration - ┌─ tests/move_2024/naming/use_fun_bad_args.move:20:5 - │ - 7 │ public fun mut_addr(_: &mut address) { abort 0 } - │ ------------ But 'a::m::mut_addr' has a first argument of type '&mut address' - · -20 │ use fun mut_addr as Y.mut_addr; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.mut_addr'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) - -error[E02017]: invalid 'use fun' declaration - ┌─ tests/move_2024/naming/use_fun_bad_args.move:22:5 - │ - 9 │ public fun val_x(_: X) { abort 0 } - │ - But 'a::m::val_x' has a first argument of type 'a::m::X' - · -22 │ use fun val_x as Y.val_x; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.val_x'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) - -error[E02017]: invalid 'use fun' declaration - ┌─ tests/move_2024/naming/use_fun_bad_args.move:23:5 - │ -10 │ public fun imm_x(_: &X) { abort 0 } - │ -- But 'a::m::imm_x' has a first argument of type '&a::m::X' - · -23 │ use fun imm_x as Y.imm_x; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.imm_x'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) - -error[E02017]: invalid 'use fun' declaration - ┌─ tests/move_2024/naming/use_fun_bad_args.move:24:5 - │ -11 │ public fun mut_x(_: &mut X) { abort 0 } - │ ------ But 'a::m::mut_x' has a first argument of type '&mut a::m::X' - · -24 │ use fun mut_x as Y.mut_x; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.mut_x'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) - -error[E02017]: invalid 'use fun' declaration - ┌─ tests/move_2024/naming/use_fun_bad_args.move:26:5 - │ -13 │ public fun val_gen(_: T) { abort 0 } - │ - But 'a::m::val_gen' has a first argument of type 'T' - · -26 │ use fun val_gen as Y.val_gen; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.val_gen'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) - -error[E02017]: invalid 'use fun' declaration - ┌─ tests/move_2024/naming/use_fun_bad_args.move:27:5 - │ -14 │ public fun imm_gen(_: &T) { abort 0 } - │ -- But 'a::m::imm_gen' has a first argument of type '&T' - · -27 │ use fun imm_gen as Y.imm_gen; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.imm_gen'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) - -error[E02017]: invalid 'use fun' declaration - ┌─ tests/move_2024/naming/use_fun_bad_args.move:28:5 - │ -15 │ public fun mut_gen(_: &mut T) { abort 0 } - │ ------ But 'a::m::mut_gen' has a first argument of type '&mut T' - · -28 │ use fun mut_gen as Y.mut_gen; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.mut_gen'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_bad_args.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_bad_args.snap new file mode 100644 index 0000000000000..167b4e2ba0c13 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_bad_args.snap @@ -0,0 +1,88 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/use_fun_bad_args.move +--- +error[E02017]: invalid 'use fun' declaration + ┌─ tests/move_2024/naming/use_fun_bad_args.move:18:5 + │ + 5 │ public fun val_u64(_: u64) { abort 0 } + │ --- But 'a::m::val_u64' has a first argument of type 'u64' + · +18 │ use fun val_u64 as Y.val_u64; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.val_u64'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) + +error[E02017]: invalid 'use fun' declaration + ┌─ tests/move_2024/naming/use_fun_bad_args.move:19:5 + │ + 6 │ public fun imm_vec(_: &vector) { abort 0 } + │ ------------ But 'a::m::imm_vec' has a first argument of type '&vector' + · +19 │ use fun imm_vec as Y.imm_vec; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.imm_vec'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) + +error[E02017]: invalid 'use fun' declaration + ┌─ tests/move_2024/naming/use_fun_bad_args.move:20:5 + │ + 7 │ public fun mut_addr(_: &mut address) { abort 0 } + │ ------------ But 'a::m::mut_addr' has a first argument of type '&mut address' + · +20 │ use fun mut_addr as Y.mut_addr; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.mut_addr'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) + +error[E02017]: invalid 'use fun' declaration + ┌─ tests/move_2024/naming/use_fun_bad_args.move:22:5 + │ + 9 │ public fun val_x(_: X) { abort 0 } + │ - But 'a::m::val_x' has a first argument of type 'a::m::X' + · +22 │ use fun val_x as Y.val_x; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.val_x'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) + +error[E02017]: invalid 'use fun' declaration + ┌─ tests/move_2024/naming/use_fun_bad_args.move:23:5 + │ +10 │ public fun imm_x(_: &X) { abort 0 } + │ -- But 'a::m::imm_x' has a first argument of type '&a::m::X' + · +23 │ use fun imm_x as Y.imm_x; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.imm_x'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) + +error[E02017]: invalid 'use fun' declaration + ┌─ tests/move_2024/naming/use_fun_bad_args.move:24:5 + │ +11 │ public fun mut_x(_: &mut X) { abort 0 } + │ ------ But 'a::m::mut_x' has a first argument of type '&mut a::m::X' + · +24 │ use fun mut_x as Y.mut_x; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.mut_x'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) + +error[E02017]: invalid 'use fun' declaration + ┌─ tests/move_2024/naming/use_fun_bad_args.move:26:5 + │ +13 │ public fun val_gen(_: T) { abort 0 } + │ - But 'a::m::val_gen' has a first argument of type 'T' + · +26 │ use fun val_gen as Y.val_gen; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.val_gen'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) + +error[E02017]: invalid 'use fun' declaration + ┌─ tests/move_2024/naming/use_fun_bad_args.move:27:5 + │ +14 │ public fun imm_gen(_: &T) { abort 0 } + │ -- But 'a::m::imm_gen' has a first argument of type '&T' + · +27 │ use fun imm_gen as Y.imm_gen; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.imm_gen'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) + +error[E02017]: invalid 'use fun' declaration + ┌─ tests/move_2024/naming/use_fun_bad_args.move:28:5 + │ +15 │ public fun mut_gen(_: &mut T) { abort 0 } + │ ------ But 'a::m::mut_gen' has a first argument of type '&mut T' + · +28 │ use fun mut_gen as Y.mut_gen; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.mut_gen'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_duplicate_nested_scopes.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_duplicate_nested_scopes.exp deleted file mode 100644 index bf5e7d2e6719f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_duplicate_nested_scopes.exp +++ /dev/null @@ -1,33 +0,0 @@ -warning[W02021]: duplicate alias - ┌─ tests/move_2024/naming/use_fun_duplicate_nested_scopes.move:10:5 - │ - 4 │ public fun foo(_: &S) {} - │ --- The same alias was previously declared here - · -10 │ use fun a::m::foo as S.foo; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Unnecessary method alias 'a::m::S.foo' for 'a::m::foo' - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W02021]: duplicate alias - ┌─ tests/move_2024/naming/use_fun_duplicate_nested_scopes.move:21:9 - │ -19 │ use fun a::m::foo as S.bar; - │ --------------------------- The same alias was previously declared here -20 │ fun call_bar(s: &S) { -21 │ use fun a::m::foo as S.bar; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Duplicate method alias 'a::m::S.bar' for 'a::m::foo' - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W02021]: duplicate alias - ┌─ tests/move_2024/naming/use_fun_duplicate_nested_scopes.move:31:9 - │ -29 │ use a::m::foo as bar; - │ --- The same alias was previously declared here -30 │ fun call_bar(s: &S) { -31 │ use fun a::m::foo as S.bar; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Duplicate method alias 'a::m::S.bar' for 'a::m::foo' - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_duplicate_nested_scopes.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_duplicate_nested_scopes.snap new file mode 100644 index 0000000000000..f22053aac53f2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_duplicate_nested_scopes.snap @@ -0,0 +1,40 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/use_fun_duplicate_nested_scopes.move +--- +warning[W02021]: duplicate alias + ┌─ tests/move_2024/naming/use_fun_duplicate_nested_scopes.move:10:5 + │ + 4 │ public fun foo(_: &S) {} + │ --- The same alias was previously declared here + · +10 │ use fun a::m::foo as S.foo; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Unnecessary method alias 'a::m::S.foo' for 'a::m::foo' + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W02021]: duplicate alias + ┌─ tests/move_2024/naming/use_fun_duplicate_nested_scopes.move:21:9 + │ +19 │ use fun a::m::foo as S.bar; + │ --------------------------- The same alias was previously declared here +20 │ fun call_bar(s: &S) { +21 │ use fun a::m::foo as S.bar; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Duplicate method alias 'a::m::S.bar' for 'a::m::foo' + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W02021]: duplicate alias + ┌─ tests/move_2024/naming/use_fun_duplicate_nested_scopes.move:31:9 + │ +29 │ use a::m::foo as bar; + │ --- The same alias was previously declared here +30 │ fun call_bar(s: &S) { +31 │ use fun a::m::foo as S.bar; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Duplicate method alias 'a::m::S.bar' for 'a::m::foo' + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_duplicate_same_scope.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_duplicate_same_scope.exp deleted file mode 100644 index 85b47c797e4a1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_duplicate_same_scope.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/naming/use_fun_duplicate_same_scope.move:5:9 - │ -4 │ public use fun foo as S.foo; - │ --- Previously declared here -5 │ fun foo(_: &S) {} - │ ^^^ - Function declarations create an implicit 'use fun' when their first argument is a type defined in the same module - │ │ - │ Duplicate 'use fun' for 'a::t1::S.foo' - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/naming/use_fun_duplicate_same_scope.move:12:9 - │ -11 │ public use fun foo as S.bar; - │ --- Previously declared here -12 │ fun bar(_: &S) {} - │ ^^^ - Function declarations create an implicit 'use fun' when their first argument is a type defined in the same module - │ │ - │ Duplicate 'use fun' for 'a::t2::S.bar' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_duplicate_same_scope.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_duplicate_same_scope.snap new file mode 100644 index 0000000000000..bebac16b17d14 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_duplicate_same_scope.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/use_fun_duplicate_same_scope.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/naming/use_fun_duplicate_same_scope.move:5:9 + │ +4 │ public use fun foo as S.foo; + │ --- Previously declared here +5 │ fun foo(_: &S) {} + │ ^^^ - Function declarations create an implicit 'use fun' when their first argument is a type defined in the same module + │ │ + │ Duplicate 'use fun' for 'a::t1::S.foo' + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/naming/use_fun_duplicate_same_scope.move:12:9 + │ +11 │ public use fun foo as S.bar; + │ --- Previously declared here +12 │ fun bar(_: &S) {} + │ ^^^ - Function declarations create an implicit 'use fun' when their first argument is a type defined in the same module + │ │ + │ Duplicate 'use fun' for 'a::t2::S.bar' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_local.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_local.exp deleted file mode 100644 index baeecb403df77..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_local.exp +++ /dev/null @@ -1,28 +0,0 @@ -error[E03005]: unbound unscoped name - ┌─ tests/move_2024/naming/use_fun_local.move:3:17 - │ -3 │ use fun f as u64.f; - │ ^ Unbound function 'f' in current scope - -error[E02010]: invalid name - ┌─ tests/move_2024/naming/use_fun_local.move:7:19 - │ -7 │ macro fun bar(f: u64) { - │ ----- ^ Invalid parameter name 'f'. 'macro' parameter names must start with '$' (or must be '_') - │ │ - │ Declared 'macro' here - │ - = 'macro' parameters start with '$' to indicate that their arguments are not evaluated before the macro is expanded, meaning the entire expression is substituted. This is different from regular function parameters that are evaluated before the function is called. - -error[E03005]: unbound unscoped name - ┌─ tests/move_2024/naming/use_fun_local.move:8:17 - │ -8 │ use fun f as u64.f; - │ ^ Unbound function 'f' in current scope - -error[E03005]: unbound unscoped name - ┌─ tests/move_2024/naming/use_fun_local.move:13:17 - │ -13 │ use fun $f as u64.f; - │ ^^ Unbound function '$f' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_local.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_local.snap new file mode 100644 index 0000000000000..57e84fee4e5fa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_local.snap @@ -0,0 +1,35 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/use_fun_local.move +--- +error[E03005]: unbound unscoped name + ┌─ tests/move_2024/naming/use_fun_local.move:3:17 + │ +3 │ use fun f as u64.f; + │ ^ Unbound function 'f' in current scope + +error[E02010]: invalid name + ┌─ tests/move_2024/naming/use_fun_local.move:7:19 + │ +7 │ macro fun bar(f: u64) { + │ ----- ^ Invalid parameter name 'f'. 'macro' parameter names must start with '$' (or must be '_') + │ │ + │ Declared 'macro' here + │ + = 'macro' parameters start with '$' to indicate that their arguments are not evaluated before the macro is expanded, meaning the entire expression is substituted. This is different from regular function parameters that are evaluated before the function is called. + +error[E03005]: unbound unscoped name + ┌─ tests/move_2024/naming/use_fun_local.move:8:17 + │ +8 │ use fun f as u64.f; + │ ^ Unbound function 'f' in current scope + +error[E03005]: unbound unscoped name + ┌─ tests/move_2024/naming/use_fun_local.move:13:17 + │ +13 │ use fun $f as u64.f; + │ ^^ Unbound function '$f' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_local_doesnt_shadow.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_local_doesnt_shadow.snap new file mode 100644 index 0000000000000..6ee47a5e1a219 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_local_doesnt_shadow.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/use_fun_local_doesnt_shadow.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_no_args.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_no_args.exp deleted file mode 100644 index dac59171d6dcd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_no_args.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E02017]: invalid 'use fun' declaration - ┌─ tests/move_2024/naming/use_fun_no_args.move:6:5 - │ -4 │ public fun no() { abort 0 } - │ -- But 'a::m::no' takes no arguments -5 │ -6 │ use fun no as Y.no; - │ ^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.no'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_no_args.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_no_args.snap new file mode 100644 index 0000000000000..f15f6ffe66aec --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_no_args.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/use_fun_no_args.move +--- +error[E02017]: invalid 'use fun' declaration + ┌─ tests/move_2024/naming/use_fun_no_args.move:6:5 + │ +4 │ public fun no() { abort 0 } + │ -- But 'a::m::no' takes no arguments +5 │ +6 │ use fun no as Y.no; + │ ^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::Y.no'. Expected a 'a::m::Y' type as the first argument (either by reference '&' '&mut' or by value) diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_shadows.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_shadows.snap new file mode 100644 index 0000000000000..166eacdbcfb9c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_shadows.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/use_fun_shadows.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_unbound.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_unbound.exp deleted file mode 100644 index 13d97b12e47bb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_unbound.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E03005]: unbound unscoped name - ┌─ tests/move_2024/naming/use_fun_unbound.move:2:13 - │ -2 │ use fun id as u64.id; - │ ^^ Unbound function 'id' in current scope - -error[E03005]: unbound unscoped name - ┌─ tests/move_2024/naming/use_fun_unbound.move:5:17 - │ -5 │ use fun x as u64.x; - │ ^ Unbound function 'x' in current scope - -error[E03005]: unbound unscoped name - ┌─ tests/move_2024/naming/use_fun_unbound.move:10:17 - │ -10 │ use fun $f as u64.f; - │ ^^ Unbound function '$f' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_unbound.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_unbound.snap new file mode 100644 index 0000000000000..56c005a4b217a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_unbound.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/use_fun_unbound.move +--- +error[E03005]: unbound unscoped name + ┌─ tests/move_2024/naming/use_fun_unbound.move:2:13 + │ +2 │ use fun id as u64.id; + │ ^^ Unbound function 'id' in current scope + +error[E03005]: unbound unscoped name + ┌─ tests/move_2024/naming/use_fun_unbound.move:5:17 + │ +5 │ use fun x as u64.x; + │ ^ Unbound function 'x' in current scope + +error[E03005]: unbound unscoped name + ┌─ tests/move_2024/naming/use_fun_unbound.move:10:17 + │ +10 │ use fun $f as u64.f; + │ ^^ Unbound function '$f' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_with_builtin.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_with_builtin.exp deleted file mode 100644 index b2e9bf3eeef44..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_with_builtin.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E02017]: invalid 'use fun' declaration - ┌─ tests/move_2024/naming/use_fun_with_builtin.move:2:5 - │ -2 │ use fun freeze as vector.freeze; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun'. Cannot use a builtin function as a method - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_with_builtin.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_with_builtin.snap new file mode 100644 index 0000000000000..a5d79076cab4d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_with_builtin.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/use_fun_with_builtin.move +--- +error[E02017]: invalid 'use fun' declaration + ┌─ tests/move_2024/naming/use_fun_with_builtin.move:2:5 + │ +2 │ use fun freeze as vector.freeze; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun'. Cannot use a builtin function as a method diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_with_type_parameter.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_with_type_parameter.exp deleted file mode 100644 index 82e90f0549f74..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_with_type_parameter.exp +++ /dev/null @@ -1,17 +0,0 @@ -error[E02017]: invalid 'use fun' declaration - ┌─ tests/move_2024/naming/use_fun_with_type_parameter.move:3:9 - │ -2 │ fun foo(x: T) { - │ - But 'T' was declared as a type parameter here -3 │ use fun foo as T.foo; - │ ^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun'. Cannot associate a method with a type parameter - -error[E04023]: invalid method call - ┌─ tests/move_2024/naming/use_fun_with_type_parameter.move:4:9 - │ -2 │ fun foo(x: T) { - │ - Method calls are not supported on type parameters. Got an expression of type: 'T' -3 │ use fun foo as T.foo; -4 │ x.foo(); - │ ^^^^^^^ Invalid method call - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_with_type_parameter.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_with_type_parameter.snap new file mode 100644 index 0000000000000..e6e49e01759fd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/use_fun_with_type_parameter.snap @@ -0,0 +1,24 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/use_fun_with_type_parameter.move +--- +error[E02017]: invalid 'use fun' declaration + ┌─ tests/move_2024/naming/use_fun_with_type_parameter.move:3:9 + │ +2 │ fun foo(x: T) { + │ - But 'T' was declared as a type parameter here +3 │ use fun foo as T.foo; + │ ^^^^^^^^^^^^^^^^^^^^^ Invalid 'use fun'. Cannot associate a method with a type parameter + +error[E04023]: invalid method call + ┌─ tests/move_2024/naming/use_fun_with_type_parameter.move:4:9 + │ +2 │ fun foo(x: T) { + │ - Method calls are not supported on type parameters. Got an expression of type: 'T' +3 │ use fun foo as T.foo; +4 │ x.foo(); + │ ^^^^^^^ Invalid method call diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/var_as_fun_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/var_as_fun_invalid.exp deleted file mode 100644 index e2b263a8d63fe..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/var_as_fun_invalid.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E04029]: invalid function call - ┌─ tests/move_2024/naming/var_as_fun_invalid.move:4:9 - │ -4 │ var(); - │ ^^^ Unexpected invocation of parameter or local 'var'. Non-syntax variables cannot be invoked as functions - │ - = Only macro syntax variables, e.g. '$var', may be invoked as functions. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/var_as_fun_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/var_as_fun_invalid.snap new file mode 100644 index 0000000000000..2496aac13fa59 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/var_as_fun_invalid.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/var_as_fun_invalid.move +--- +error[E04029]: invalid function call + ┌─ tests/move_2024/naming/var_as_fun_invalid.move:4:9 + │ +4 │ var(); + │ ^^^ Unexpected invocation of parameter or local 'var'. Non-syntax variables cannot be invoked as functions + │ + = Only macro syntax variables, e.g. '$var', may be invoked as functions. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/var_as_fun_macro.exp b/external-crates/move/crates/move-compiler/tests/move_2024/naming/var_as_fun_macro.exp deleted file mode 100644 index c6235075cc25d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/naming/var_as_fun_macro.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/naming/var_as_fun_macro.move:3:9 - │ -3 │ $var(); - │ ^^^^^^ Cannot call non-lambda argument - · -8 │ test_panic!(0) - │ - Expected a lambda argument - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/naming/var_as_fun_macro.snap b/external-crates/move/crates/move-compiler/tests/move_2024/naming/var_as_fun_macro.snap new file mode 100644 index 0000000000000..7b1c3c25bd54c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/naming/var_as_fun_macro.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/naming/var_as_fun_macro.move +--- +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/naming/var_as_fun_macro.move:3:9 + │ +3 │ $var(); + │ ^^^^^^ Cannot call non-lambda argument + · +8 │ test_panic!(0) + │ - Expected a lambda argument diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_and_postfix.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_and_postfix.exp deleted file mode 100644 index 40e513f35491a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_and_postfix.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/parser/ability_modifier_infix_and_postfix.move:3:41 - │ -3 │ public struct Foo has copy, drop {} has store; - │ --- ^^^ Duplicate ability declaration. Abilities can be declared before or after the field declarations, but not both. - │ │ - │ Ability declaration previously given here - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_and_postfix.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_and_postfix.snap new file mode 100644 index 0000000000000..528a0214cf8c7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_and_postfix.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_and_postfix.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/parser/ability_modifier_infix_and_postfix.move:3:41 + │ +3 │ public struct Foo has copy, drop {} has store; + │ --- ^^^ Duplicate ability declaration. Abilities can be declared before or after the field declarations, but not both. + │ │ + │ Ability declaration previously given here diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_and_postfix_native_struct.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_and_postfix_native_struct.exp deleted file mode 100644 index 23a4cf856c4ef..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_and_postfix_native_struct.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifier_infix_and_postfix_native_struct.move:4:46 - │ -4 │ public native struct Foo has copy, drop; has store; - │ ^^^ - │ │ - │ Unexpected 'has' - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', 'struct', or 'enum' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_and_postfix_native_struct.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_and_postfix_native_struct.snap new file mode 100644 index 0000000000000..65e539f1a0756 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_and_postfix_native_struct.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_and_postfix_native_struct.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifier_infix_and_postfix_native_struct.move:4:46 + │ +4 │ public native struct Foo has copy, drop; has store; + │ ^^^ + │ │ + │ Unexpected 'has' + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', 'struct', or 'enum' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_postfix_no_fields.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_postfix_no_fields.exp deleted file mode 100644 index db76dc43decb9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_postfix_no_fields.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifier_infix_postfix_no_fields.move:3:45 - │ -3 │ public native struct Foo has copy, drop has store; - │ ^^^ - │ │ - │ Unexpected 'has' - │ Expected one of: ',', '{', '(', or ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_postfix_no_fields.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_postfix_no_fields.snap new file mode 100644 index 0000000000000..f964dae3d795b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_postfix_no_fields.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_postfix_no_fields.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifier_infix_postfix_no_fields.move:3:45 + │ +3 │ public native struct Foo has copy, drop has store; + │ ^^^ + │ │ + │ Unexpected 'has' + │ Expected one of: ',', '{', '(', or ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_postfix_no_fields_with_comma_sep.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_postfix_no_fields_with_comma_sep.exp deleted file mode 100644 index 94ddd24561a43..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_postfix_no_fields_with_comma_sep.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifier_infix_postfix_no_fields_with_comma_sep.move:3:46 - │ -3 │ public native struct Foo has copy, drop, has store; - │ ^^^ Unexpected 'has'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_postfix_no_fields_with_comma_sep.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_postfix_no_fields_with_comma_sep.snap new file mode 100644 index 0000000000000..270e7e175ae55 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_postfix_no_fields_with_comma_sep.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/ability_modifier_infix_postfix_no_fields_with_comma_sep.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifier_infix_postfix_no_fields_with_comma_sep.move:3:46 + │ +3 │ public native struct Foo has copy, drop, has store; + │ ^^^ Unexpected 'has'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_invalid_infix_with_valid_postfix.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_invalid_infix_with_valid_postfix.exp deleted file mode 100644 index f6762a2b72620..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_invalid_infix_with_valid_postfix.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/parser/ability_modifier_invalid_infix_with_valid_postfix.move:3:5 - │ -3 │ struct Foo has {} has copy; - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifier_invalid_infix_with_valid_postfix.move:3:20 - │ -3 │ struct Foo has {} has copy; - │ ^ Unexpected '{'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_invalid_infix_with_valid_postfix.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_invalid_infix_with_valid_postfix.snap new file mode 100644 index 0000000000000..b240ec42effe5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_invalid_infix_with_valid_postfix.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/ability_modifier_invalid_infix_with_valid_postfix.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/parser/ability_modifier_invalid_infix_with_valid_postfix.move:3:5 + │ +3 │ struct Foo has {} has copy; + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifier_invalid_infix_with_valid_postfix.move:3:20 + │ +3 │ struct Foo has {} has copy; + │ ^ Unexpected '{'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_no_abilities.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_no_abilities.exp deleted file mode 100644 index b6d6170ecb09f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_no_abilities.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/parser/ability_modifier_no_abilities.move:3:5 - │ -3 │ struct Foo has {} - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifier_no_abilities.move:3:20 - │ -3 │ struct Foo has {} - │ ^ Unexpected '{'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_no_abilities.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_no_abilities.snap new file mode 100644 index 0000000000000..e58b8f2dd0742 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_no_abilities.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/ability_modifier_no_abilities.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/parser/ability_modifier_no_abilities.move:3:5 + │ +3 │ struct Foo has {} + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifier_no_abilities.move:3:20 + │ +3 │ struct Foo has {} + │ ^ Unexpected '{'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_missing_commas.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_missing_commas.exp deleted file mode 100644 index 756fd19d90e79..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_missing_commas.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifier_postfix_missing_commas.move:3:36 - │ -3 │ public struct Foo {} has store copy; - │ ^^^^ - │ │ - │ Unexpected 'copy' - │ Expected one of: ',' or ';' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifier_postfix_missing_commas.move:5:1 - │ -5 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', 'struct', or 'enum' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_missing_commas.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_missing_commas.snap new file mode 100644 index 0000000000000..6766cf1a5cd10 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_missing_commas.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_missing_commas.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifier_postfix_missing_commas.move:3:36 + │ +3 │ public struct Foo {} has store copy; + │ ^^^^ + │ │ + │ Unexpected 'copy' + │ Expected one of: ',' or ';' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifier_postfix_missing_commas.move:5:1 + │ +5 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', 'struct', or 'enum' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_missing_semi_multiple_structs.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_missing_semi_multiple_structs.exp deleted file mode 100644 index 0f66d963ba5d7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_missing_semi_multiple_structs.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifier_postfix_missing_semi_multiple_structs.move:4:5 - │ -4 │ public struct Bar has key {} - │ ^^^^^^ - │ │ - │ Unexpected 'public' - │ Expected one of: ',' or ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_missing_semi_multiple_structs.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_missing_semi_multiple_structs.snap new file mode 100644 index 0000000000000..1e93d7c59fd39 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_missing_semi_multiple_structs.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_missing_semi_multiple_structs.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifier_postfix_missing_semi_multiple_structs.move:4:5 + │ +4 │ public struct Bar has key {} + │ ^^^^^^ + │ │ + │ Unexpected 'public' + │ Expected one of: ',' or ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_abilities_no_semi.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_abilities_no_semi.exp deleted file mode 100644 index 9dbe9838cf7cd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_abilities_no_semi.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifier_postfix_no_abilities_no_semi.move:4:1 - │ -4 │ } - │ ^ Unexpected '}'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifier_postfix_no_abilities_no_semi.move:5:1 - │ -5 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', 'struct', or 'enum' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_abilities_no_semi.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_abilities_no_semi.snap new file mode 100644 index 0000000000000..d4f9eb19e3e3a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_abilities_no_semi.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_abilities_no_semi.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifier_postfix_no_abilities_no_semi.move:4:1 + │ +4 │ } + │ ^ Unexpected '}'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifier_postfix_no_abilities_no_semi.move:5:1 + │ +5 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', 'struct', or 'enum' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_abilities_with_semi.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_abilities_with_semi.exp deleted file mode 100644 index ce74efb8f5345..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_abilities_with_semi.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifier_postfix_no_abilities_with_semi.move:3:29 - │ -3 │ public struct Foo {} has; - │ ^ Unexpected ';'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifier_postfix_no_abilities_with_semi.move:5:1 - │ -5 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', 'struct', or 'enum' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_abilities_with_semi.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_abilities_with_semi.snap new file mode 100644 index 0000000000000..e959f7f22b014 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_abilities_with_semi.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_abilities_with_semi.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifier_postfix_no_abilities_with_semi.move:3:29 + │ +3 │ public struct Foo {} has; + │ ^ Unexpected ';'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifier_postfix_no_abilities_with_semi.move:5:1 + │ +5 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', 'struct', or 'enum' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_fields.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_fields.exp deleted file mode 100644 index ce7d4627d711a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_fields.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifier_postfix_no_fields.move:3:45 - │ -3 │ public native struct Foo has copy, drop has store; - │ ^^^ - │ │ - │ Unexpected 'has' - │ Expected one of: ',', '{', '(', or ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_fields.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_fields.snap new file mode 100644 index 0000000000000..494cac8c50301 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_fields.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_fields.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifier_postfix_no_fields.move:3:45 + │ +3 │ public native struct Foo has copy, drop has store; + │ ^^^ + │ │ + │ Unexpected 'has' + │ Expected one of: ',', '{', '(', or ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_semi.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_semi.exp deleted file mode 100644 index 3a2efb0b77be5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_semi.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifier_postfix_no_semi.move:4:1 - │ -4 │ } - │ ^ - │ │ - │ Unexpected '}' - │ Expected one of: ',' or ';' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifier_postfix_no_semi.move:5:1 - │ -5 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', 'struct', or 'enum' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_semi.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_semi.snap new file mode 100644 index 0000000000000..df8e44c9c4764 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_semi.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_no_semi.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifier_postfix_no_semi.move:4:1 + │ +4 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected one of: ',' or ';' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifier_postfix_no_semi.move:5:1 + │ +5 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', 'struct', or 'enum' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_with_semi.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_with_semi.snap new file mode 100644 index 0000000000000..ce192f75b16e2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_with_semi.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/ability_modifier_postfix_with_semi.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifies_infix_no_abilities_postfix.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifies_infix_no_abilities_postfix.exp deleted file mode 100644 index d8944f01b73a9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifies_infix_no_abilities_postfix.exp +++ /dev/null @@ -1,31 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/parser/ability_modifies_infix_no_abilities_postfix.move:3:5 - │ -3 │ struct Foo has copy {} has; - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E01003]: invalid modifier - ┌─ tests/move_2024/parser/ability_modifies_infix_no_abilities_postfix.move:3:28 - │ -3 │ struct Foo has copy {} has; - │ --- ^^^ Duplicate ability declaration. Abilities can be declared before or after the field declarations, but not both. - │ │ - │ Ability declaration previously given here - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifies_infix_no_abilities_postfix.move:3:31 - │ -3 │ struct Foo has copy {} has; - │ ^ Unexpected ';'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifies_infix_no_abilities_postfix.move:5:1 - │ -5 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', 'struct', or 'enum' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifies_infix_no_abilities_postfix.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifies_infix_no_abilities_postfix.snap new file mode 100644 index 0000000000000..2190f35ca59c0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifies_infix_no_abilities_postfix.snap @@ -0,0 +1,38 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/ability_modifies_infix_no_abilities_postfix.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/parser/ability_modifies_infix_no_abilities_postfix.move:3:5 + │ +3 │ struct Foo has copy {} has; + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E01003]: invalid modifier + ┌─ tests/move_2024/parser/ability_modifies_infix_no_abilities_postfix.move:3:28 + │ +3 │ struct Foo has copy {} has; + │ --- ^^^ Duplicate ability declaration. Abilities can be declared before or after the field declarations, but not both. + │ │ + │ Ability declaration previously given here + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifies_infix_no_abilities_postfix.move:3:31 + │ +3 │ struct Foo has copy {} has; + │ ^ Unexpected ';'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifies_infix_no_abilities_postfix.move:5:1 + │ +5 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', 'struct', or 'enum' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifies_no_abilities_infix_postfix.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifies_no_abilities_infix_postfix.exp deleted file mode 100644 index 271c51f1b1409..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifies_no_abilities_infix_postfix.exp +++ /dev/null @@ -1,29 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/parser/ability_modifies_no_abilities_infix_postfix.move:3:5 - │ -3 │ struct Foo has {} has; - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifies_no_abilities_infix_postfix.move:3:20 - │ -3 │ struct Foo has {} has; - │ ^ Unexpected '{'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifies_no_abilities_infix_postfix.move:3:26 - │ -3 │ struct Foo has {} has; - │ ^ Unexpected ';'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/ability_modifies_no_abilities_infix_postfix.move:5:1 - │ -5 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', 'struct', or 'enum' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifies_no_abilities_infix_postfix.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifies_no_abilities_infix_postfix.snap new file mode 100644 index 0000000000000..b2afebc0e84bd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/ability_modifies_no_abilities_infix_postfix.snap @@ -0,0 +1,36 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/ability_modifies_no_abilities_infix_postfix.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/parser/ability_modifies_no_abilities_infix_postfix.move:3:5 + │ +3 │ struct Foo has {} has; + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifies_no_abilities_infix_postfix.move:3:20 + │ +3 │ struct Foo has {} has; + │ ^ Unexpected '{'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifies_no_abilities_infix_postfix.move:3:26 + │ +3 │ struct Foo has {} has; + │ ^ Unexpected ';'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/ability_modifies_no_abilities_infix_postfix.move:5:1 + │ +5 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', 'struct', or 'enum' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid.exp deleted file mode 100644 index 623dd61ab29c6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid.exp +++ /dev/null @@ -1,63 +0,0 @@ -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid.move:4:9 - │ -4 │ if (cond) x else { x } as u32; - │ ^^^^^^^^^^^^^^^^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid.move:5:9 - │ -5 │ while (cond) {} as u32; - │ ^^^^^^^^^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/cast_invalid.move:5:9 - │ -5 │ while (cond) {} as u32; - │ ^^^^^^^^^^^^^^^ - │ │ - │ Invalid argument to 'as' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid.move:6:9 - │ -6 │ loop {} as u32; - │ ^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid.move:7:9 - │ -7 │ 'l: { 0 } as u32; - │ ^^^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E04031]: invalid usage of lambda - ┌─ tests/move_2024/parser/cast_invalid.move:8:9 - │ -8 │ || { 0 } as u32; - │ ^^^^^^^^^^^^^^^ Lambdas can only be used directly as arguments to 'macro' functions - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid.move:9:9 - │ -9 │ return as u32; - │ ^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid.move:11:13 - │ -11 │ break as u32; - │ ^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid.move:12:13 - │ -12 │ continue as u32; - │ ^^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid.move:14:9 - │ -14 │ 0 as u32 as u32; - │ ^^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid.snap new file mode 100644 index 0000000000000..169b6ed6261f4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid.snap @@ -0,0 +1,70 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/cast_invalid.move +--- +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid.move:4:9 + │ +4 │ if (cond) x else { x } as u32; + │ ^^^^^^^^^^^^^^^^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid.move:5:9 + │ +5 │ while (cond) {} as u32; + │ ^^^^^^^^^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/cast_invalid.move:5:9 + │ +5 │ while (cond) {} as u32; + │ ^^^^^^^^^^^^^^^ + │ │ + │ Invalid argument to 'as' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid.move:6:9 + │ +6 │ loop {} as u32; + │ ^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid.move:7:9 + │ +7 │ 'l: { 0 } as u32; + │ ^^^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E04031]: invalid usage of lambda + ┌─ tests/move_2024/parser/cast_invalid.move:8:9 + │ +8 │ || { 0 } as u32; + │ ^^^^^^^^^^^^^^^ Lambdas can only be used directly as arguments to 'macro' functions + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid.move:9:9 + │ +9 │ return as u32; + │ ^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid.move:11:13 + │ +11 │ break as u32; + │ ^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid.move:12:13 + │ +12 │ continue as u32; + │ ^^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid.move:14:9 + │ +14 │ 0 as u32 as u32; + │ ^^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid_complex.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid_complex.exp deleted file mode 100644 index 826238fa1fc11..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid_complex.exp +++ /dev/null @@ -1,80 +0,0 @@ -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid_complex.move:6:9 - │ -6 │ 1 + s.f as u32; - │ ^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid_complex.move:7:9 - │ -7 │ 1 + S { f: 0 }.f as u32; - │ ^^^^^^^^^^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/cast_invalid_complex.move:8:9 - │ -8 │ *if (cond) { &0 } else { &mut 0 } as u32; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'u32' - │ Invalid dereference. - │ Expected: '&_' - -error[E04010]: cannot infer type - ┌─ tests/move_2024/parser/cast_invalid_complex.move:8:9 - │ -8 │ *if (cond) { &0 } else { &mut 0 } as u32; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not infer this type. Try adding an annotation - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid_complex.move:8:10 - │ -8 │ *if (cond) { &0 } else { &mut 0 } as u32; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/cast_invalid_complex.move:8:10 - │ -8 │ *if (cond) { &0 } else { &mut 0 } as u32; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ Invalid argument to 'as' - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid_complex.move:9:9 - │ -9 │ *if (cond) { &s } else {&mut s}.f_imm() as u32; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/cast_invalid_complex.move:11:10 - │ -11 │ (*if (cond) { &0 } else { &mut 0 } as u32); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'u32' - │ Invalid dereference. - │ Expected: '&_' - -error[E04010]: cannot infer type - ┌─ tests/move_2024/parser/cast_invalid_complex.move:11:10 - │ -11 │ (*if (cond) { &0 } else { &mut 0 } as u32); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not infer this type. Try adding an annotation - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid_complex.move:11:11 - │ -11 │ (*if (cond) { &0 } else { &mut 0 } as u32); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/cast_invalid_complex.move:11:11 - │ -11 │ (*if (cond) { &0 } else { &mut 0 } as u32); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ Invalid argument to 'as' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid_complex.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid_complex.snap new file mode 100644 index 0000000000000..2d17d823dece4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid_complex.snap @@ -0,0 +1,87 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/cast_invalid_complex.move +--- +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid_complex.move:6:9 + │ +6 │ 1 + s.f as u32; + │ ^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid_complex.move:7:9 + │ +7 │ 1 + S { f: 0 }.f as u32; + │ ^^^^^^^^^^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/cast_invalid_complex.move:8:9 + │ +8 │ *if (cond) { &0 } else { &mut 0 } as u32; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'u32' + │ Invalid dereference. + │ Expected: '&_' + +error[E04010]: cannot infer type + ┌─ tests/move_2024/parser/cast_invalid_complex.move:8:9 + │ +8 │ *if (cond) { &0 } else { &mut 0 } as u32; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not infer this type. Try adding an annotation + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid_complex.move:8:10 + │ +8 │ *if (cond) { &0 } else { &mut 0 } as u32; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/cast_invalid_complex.move:8:10 + │ +8 │ *if (cond) { &0 } else { &mut 0 } as u32; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ Invalid argument to 'as' + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid_complex.move:9:9 + │ +9 │ *if (cond) { &s } else {&mut s}.f_imm() as u32; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/cast_invalid_complex.move:11:10 + │ +11 │ (*if (cond) { &0 } else { &mut 0 } as u32); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'u32' + │ Invalid dereference. + │ Expected: '&_' + +error[E04010]: cannot infer type + ┌─ tests/move_2024/parser/cast_invalid_complex.move:11:10 + │ +11 │ (*if (cond) { &0 } else { &mut 0 } as u32); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not infer this type. Try adding an annotation + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid_complex.move:11:11 + │ +11 │ (*if (cond) { &0 } else { &mut 0 } as u32); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/cast_invalid_complex.move:11:11 + │ +11 │ (*if (cond) { &0 } else { &mut 0 } as u32); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ Invalid argument to 'as' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid_made_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid_made_valid.snap new file mode 100644 index 0000000000000..5952f564b7f75 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid_made_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/cast_invalid_made_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid_ops.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid_ops.exp deleted file mode 100644 index d5c955b55b043..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid_ops.exp +++ /dev/null @@ -1,87 +0,0 @@ -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid_ops.move:4:9 - │ -4 │ x + y as u32; - │ ^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid_ops.move:5:9 - │ -5 │ x - y as u32; - │ ^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid_ops.move:6:9 - │ -6 │ x * y as u32; - │ ^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid_ops.move:7:9 - │ -7 │ x / y as u32; - │ ^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid_ops.move:8:9 - │ -8 │ x % y as u32; - │ ^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid_ops.move:9:9 - │ -9 │ x & y as u32; - │ ^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid_ops.move:10:9 - │ -10 │ x | y as u32; - │ ^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid_ops.move:11:9 - │ -11 │ x ^ y as u32; - │ ^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid_ops.move:12:9 - │ -12 │ x << y as u32; - │ ^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid_ops.move:13:9 - │ -13 │ x >> y as u32; - │ ^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E01015]: ambiguous 'as' - ┌─ tests/move_2024/parser/cast_invalid_ops.move:14:9 - │ -14 │ !x as u32; - │ ^^ Potentially ambiguous 'as'. Add parentheses to disambiguate - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/cast_invalid_ops.move:14:9 - │ -14 │ !x as u32; - │ ^^ - │ │ - │ Invalid argument to 'as' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/cast_invalid_ops.move:14:10 - │ - 3 │ fun ops(x: u8, y: u8) { - │ -- Given: 'u8' - · -14 │ !x as u32; - │ ^ - │ │ - │ Invalid argument to '!' - │ Expected: 'bool' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid_ops.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid_ops.snap new file mode 100644 index 0000000000000..8dc9ab4f304e7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_invalid_ops.snap @@ -0,0 +1,94 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/cast_invalid_ops.move +--- +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid_ops.move:4:9 + │ +4 │ x + y as u32; + │ ^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid_ops.move:5:9 + │ +5 │ x - y as u32; + │ ^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid_ops.move:6:9 + │ +6 │ x * y as u32; + │ ^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid_ops.move:7:9 + │ +7 │ x / y as u32; + │ ^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid_ops.move:8:9 + │ +8 │ x % y as u32; + │ ^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid_ops.move:9:9 + │ +9 │ x & y as u32; + │ ^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid_ops.move:10:9 + │ +10 │ x | y as u32; + │ ^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid_ops.move:11:9 + │ +11 │ x ^ y as u32; + │ ^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid_ops.move:12:9 + │ +12 │ x << y as u32; + │ ^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid_ops.move:13:9 + │ +13 │ x >> y as u32; + │ ^^^^^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E01015]: ambiguous 'as' + ┌─ tests/move_2024/parser/cast_invalid_ops.move:14:9 + │ +14 │ !x as u32; + │ ^^ Potentially ambiguous 'as'. Add parentheses to disambiguate + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/cast_invalid_ops.move:14:9 + │ +14 │ !x as u32; + │ ^^ + │ │ + │ Invalid argument to 'as' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/cast_invalid_ops.move:14:10 + │ + 3 │ fun ops(x: u8, y: u8) { + │ -- Given: 'u8' + · +14 │ !x as u32; + │ ^ + │ │ + │ Invalid argument to '!' + │ Expected: 'bool' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_valid.snap new file mode 100644 index 0000000000000..a27d78f6dceb7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/cast_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_valid_bad_types.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_valid_bad_types.exp deleted file mode 100644 index 7cd05ff52c404..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_valid_bad_types.exp +++ /dev/null @@ -1,100 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/cast_valid_bad_types.move:4:22 - │ -4 │ while (cond) x as u32; - │ ^^^^^^^^ - │ │ │ - │ │ Given: 'u32' - │ Invalid loop body - │ Expected: '()' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/cast_valid_bad_types.move:5:14 - │ -5 │ loop x as u32; - │ ^^^^^^^^ - │ │ │ - │ │ Given: 'u32' - │ Invalid loop body - │ Expected: '()' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/cast_valid_bad_types.move:6:17 - │ -6 │ cond && x as u8; - │ -- ^^^^^^^ - │ │ │ │ - │ │ │ Given: 'u8' - │ │ Invalid argument to '&&' - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/cast_valid_bad_types.move:7:17 - │ -7 │ cond || x as u8; - │ -- ^^^^^^^ - │ │ │ │ - │ │ │ Given: 'u8' - │ │ Invalid argument to '||' - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/cast_valid_bad_types.move:8:9 - │ -8 │ x as u8 && cond; - │ ^^^^^^^ -- Expected: 'bool' - │ │ │ - │ │ Given: 'u8' - │ Invalid argument to '&&' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/cast_valid_bad_types.move:9:9 - │ -9 │ x as u8 || cond; - │ ^^^^^^^ -- Expected: 'bool' - │ │ │ - │ │ Given: 'u8' - │ Invalid argument to '||' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/cast_valid_bad_types.move:10:10 - │ -10 │ (!x as u32); - │ ^^ - │ │ - │ Invalid argument to 'as' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/cast_valid_bad_types.move:10:11 - │ - 3 │ fun invalid_types(cond: bool, x: u64) { - │ --- Given: 'u64' - · -10 │ (!x as u32); - │ ^ - │ │ - │ Invalid argument to '!' - │ Expected: 'bool' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/cast_valid_bad_types.move:11:10 - │ -11 │ (!x) as u32; - │ ^^ - │ │ - │ Invalid argument to 'as' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/cast_valid_bad_types.move:11:11 - │ - 3 │ fun invalid_types(cond: bool, x: u64) { - │ --- Given: 'u64' - · -11 │ (!x) as u32; - │ ^ - │ │ - │ Invalid argument to '!' - │ Expected: 'bool' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_valid_bad_types.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_valid_bad_types.snap new file mode 100644 index 0000000000000..69876380283b8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_valid_bad_types.snap @@ -0,0 +1,107 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/cast_valid_bad_types.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/cast_valid_bad_types.move:4:22 + │ +4 │ while (cond) x as u32; + │ ^^^^^^^^ + │ │ │ + │ │ Given: 'u32' + │ Invalid loop body + │ Expected: '()' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/cast_valid_bad_types.move:5:14 + │ +5 │ loop x as u32; + │ ^^^^^^^^ + │ │ │ + │ │ Given: 'u32' + │ Invalid loop body + │ Expected: '()' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/cast_valid_bad_types.move:6:17 + │ +6 │ cond && x as u8; + │ -- ^^^^^^^ + │ │ │ │ + │ │ │ Given: 'u8' + │ │ Invalid argument to '&&' + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/cast_valid_bad_types.move:7:17 + │ +7 │ cond || x as u8; + │ -- ^^^^^^^ + │ │ │ │ + │ │ │ Given: 'u8' + │ │ Invalid argument to '||' + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/cast_valid_bad_types.move:8:9 + │ +8 │ x as u8 && cond; + │ ^^^^^^^ -- Expected: 'bool' + │ │ │ + │ │ Given: 'u8' + │ Invalid argument to '&&' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/cast_valid_bad_types.move:9:9 + │ +9 │ x as u8 || cond; + │ ^^^^^^^ -- Expected: 'bool' + │ │ │ + │ │ Given: 'u8' + │ Invalid argument to '||' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/cast_valid_bad_types.move:10:10 + │ +10 │ (!x as u32); + │ ^^ + │ │ + │ Invalid argument to 'as' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/cast_valid_bad_types.move:10:11 + │ + 3 │ fun invalid_types(cond: bool, x: u64) { + │ --- Given: 'u64' + · +10 │ (!x as u32); + │ ^ + │ │ + │ Invalid argument to '!' + │ Expected: 'bool' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/cast_valid_bad_types.move:11:10 + │ +11 │ (!x) as u32; + │ ^^ + │ │ + │ Invalid argument to 'as' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/cast_valid_bad_types.move:11:11 + │ + 3 │ fun invalid_types(cond: bool, x: u64) { + │ --- Given: 'u64' + · +11 │ (!x) as u32; + │ ^ + │ │ + │ Invalid argument to '!' + │ Expected: 'bool' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_valid_complex.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_valid_complex.snap new file mode 100644 index 0000000000000..5c5f331739366 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_valid_complex.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/cast_valid_complex.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_valid_ops.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_valid_ops.snap new file mode 100644 index 0000000000000..56448ebebd17e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/cast_valid_ops.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/cast_valid_ops.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/complex_as.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/complex_as.exp deleted file mode 100644 index b14754cbb6dc0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/complex_as.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/complex_as.move:6:18 - │ -6 │ let _x = x as Cup; - │ ^ ------- Found: '0x42::m::Cup'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ │ - │ Invalid argument to 'as' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/complex_as.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/complex_as.snap new file mode 100644 index 0000000000000..8e1c0811877eb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/complex_as.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/complex_as.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/complex_as.move:6:18 + │ +6 │ let _x = x as Cup; + │ ^ ------- Found: '0x42::m::Cup'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ │ + │ Invalid argument to 'as' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_precedence.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_precedence.snap new file mode 100644 index 0000000000000..d96f95923ece9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_precedence.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/dot_call_precedence.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_precedence_term.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_precedence_term.snap new file mode 100644 index 0000000000000..de5faf20df7f7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_precedence_term.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/dot_call_precedence_term.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_precedence_term_nonsense.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_precedence_term_nonsense.exp deleted file mode 100644 index 853d4f196701a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_precedence_term_nonsense.exp +++ /dev/null @@ -1,96 +0,0 @@ -error[E04023]: invalid method call - ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:18:13 - │ -18 │ break.xval(); - │ ^^^^^^^^^^^^ - │ │ - │ Invalid method call - │ Unable to infer type for method call. Try annotating this type - -error[E04023]: invalid method call - ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:19:13 - │ -19 │ continue.xval(); - │ ^^^^^^^^^^^^^^^ - │ │ - │ Invalid method call - │ Unable to infer type for method call. Try annotating this type - -error[E04010]: cannot infer type - ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:21:9 - │ -21 │ vector [] .length(); - │ ^^^^^^^^^ Could not infer this type. Try adding an annotation - -error[E04010]: cannot infer type - ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:21:9 - │ -21 │ vector [] .length(); - │ ^^^^^^^^^^^^^^^^^^^ Could not infer this type. Try adding an annotation - -error[E04023]: invalid method call - ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:22:9 - │ -22 │ (X{}, Y{}).xval(); - │ ^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid method call - │ Method calls are only supported on single types. Got an expression of type: '(a::m::X, a::m::Y)' - -error[E04023]: invalid method call - ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:23:9 - │ -23 │ 0.next(); - │ ^^^^^^^^ - │ │ - │ Invalid method call - │ Unable to infer type for method call. Try annotating this type - -error[E04023]: invalid method call - ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:24:9 - │ -24 │ while (cond) { }.xeat(); - │ ^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid method call - │ Method calls are only supported on single types. Got an expression of type: '()' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:25:9 - │ -16 │ fun t(cond: bool) { - │ - Expected: '()' - · -25 │ return { X{} }.xval(); - │ ^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'a::m::X' - │ Invalid return - -error[E04023]: invalid method call - ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:25:9 - │ -25 │ return { X{} }.xval(); - │ ^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid method call - │ Unable to infer type for method call. Try annotating this type - -error[E04023]: invalid method call - ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:26:9 - │ -26 │ return.xval(); - │ ^^^^^^^^^^^^^ - │ │ - │ Invalid method call - │ Unable to infer type for method call. Try annotating this type - -error[E04023]: invalid method call - ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:27:9 - │ -27 │ abort { 0 } .length(); - │ ^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid method call - │ Unable to infer type for method call. Try annotating this type - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_precedence_term_nonsense.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_precedence_term_nonsense.snap new file mode 100644 index 0000000000000..a8c7a5143c955 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_precedence_term_nonsense.snap @@ -0,0 +1,103 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/dot_call_precedence_term_nonsense.move +--- +error[E04023]: invalid method call + ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:18:13 + │ +18 │ break.xval(); + │ ^^^^^^^^^^^^ + │ │ + │ Invalid method call + │ Unable to infer type for method call. Try annotating this type + +error[E04023]: invalid method call + ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:19:13 + │ +19 │ continue.xval(); + │ ^^^^^^^^^^^^^^^ + │ │ + │ Invalid method call + │ Unable to infer type for method call. Try annotating this type + +error[E04010]: cannot infer type + ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:21:9 + │ +21 │ vector [] .length(); + │ ^^^^^^^^^ Could not infer this type. Try adding an annotation + +error[E04010]: cannot infer type + ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:21:9 + │ +21 │ vector [] .length(); + │ ^^^^^^^^^^^^^^^^^^^ Could not infer this type. Try adding an annotation + +error[E04023]: invalid method call + ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:22:9 + │ +22 │ (X{}, Y{}).xval(); + │ ^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid method call + │ Method calls are only supported on single types. Got an expression of type: '(a::m::X, a::m::Y)' + +error[E04023]: invalid method call + ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:23:9 + │ +23 │ 0.next(); + │ ^^^^^^^^ + │ │ + │ Invalid method call + │ Unable to infer type for method call. Try annotating this type + +error[E04023]: invalid method call + ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:24:9 + │ +24 │ while (cond) { }.xeat(); + │ ^^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid method call + │ Method calls are only supported on single types. Got an expression of type: '()' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:25:9 + │ +16 │ fun t(cond: bool) { + │ - Expected: '()' + · +25 │ return { X{} }.xval(); + │ ^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'a::m::X' + │ Invalid return + +error[E04023]: invalid method call + ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:25:9 + │ +25 │ return { X{} }.xval(); + │ ^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid method call + │ Unable to infer type for method call. Try annotating this type + +error[E04023]: invalid method call + ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:26:9 + │ +26 │ return.xval(); + │ ^^^^^^^^^^^^^ + │ │ + │ Invalid method call + │ Unable to infer type for method call. Try annotating this type + +error[E04023]: invalid method call + ┌─ tests/move_2024/parser/dot_call_precedence_term_nonsense.move:27:9 + │ +27 │ abort { 0 } .length(); + │ ^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid method call + │ Unable to infer type for method call. Try annotating this type diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_type_arguments.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_type_arguments.snap new file mode 100644 index 0000000000000..c55d30cfd8377 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_type_arguments.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/dot_call_type_arguments.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_type_arguments_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_type_arguments_invalid.exp deleted file mode 100644 index 83a2706b7b87a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_type_arguments_invalid.exp +++ /dev/null @@ -1,38 +0,0 @@ -error[E03010]: unbound field - ┌─ tests/move_2024/parser/dot_call_type_arguments_invalid.move:12:9 - │ -12 │ c.uncup (); - │ ^^^^^^^ Unbound field 'uncup' in 'a::m::Cup' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/dot_call_type_arguments_invalid.move:12:9 - │ -12 │ c.uncup (); - │ ^^^^^^^^^^^^ - │ │ - │ Invalid argument to '>' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E03009]: unbound variable - ┌─ tests/move_2024/parser/dot_call_type_arguments_invalid.move:12:18 - │ -12 │ c.uncup (); - │ ^^^ Unbound variable 'u64' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/dot_call_type_arguments_invalid.move:12:21 - │ -12 │ c.uncup (); - │ ------------^ -- Found: '()'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '>' - │ Found: 'bool'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/dot_call_type_arguments_invalid.move:12:23 - │ -12 │ c.uncup (); - │ ------------ ^^ Invalid argument to '>' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_type_arguments_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_type_arguments_invalid.snap new file mode 100644 index 0000000000000..93a091ccfc014 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_call_type_arguments_invalid.snap @@ -0,0 +1,45 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/dot_call_type_arguments_invalid.move +--- +error[E03010]: unbound field + ┌─ tests/move_2024/parser/dot_call_type_arguments_invalid.move:12:9 + │ +12 │ c.uncup (); + │ ^^^^^^^ Unbound field 'uncup' in 'a::m::Cup' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/dot_call_type_arguments_invalid.move:12:9 + │ +12 │ c.uncup (); + │ ^^^^^^^^^^^^ + │ │ + │ Invalid argument to '>' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E03009]: unbound variable + ┌─ tests/move_2024/parser/dot_call_type_arguments_invalid.move:12:18 + │ +12 │ c.uncup (); + │ ^^^ Unbound variable 'u64' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/dot_call_type_arguments_invalid.move:12:21 + │ +12 │ c.uncup (); + │ ------------^ -- Found: '()'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '>' + │ Found: 'bool'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/dot_call_type_arguments_invalid.move:12:23 + │ +12 │ c.uncup (); + │ ------------ ^^ Invalid argument to '>' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_incomplete.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_incomplete.exp deleted file mode 100644 index 0668e65aaf13c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_incomplete.exp +++ /dev/null @@ -1,36 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/dot_incomplete.move:12:23 - │ -12 │ let _tmp1 = s.; // incomplete with `;` (next line should parse) - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/dot_incomplete.move:13:37 - │ -13 │ let _tmp2 = s.another_field.; // incomplete with `;` (next line should parse) - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/dot_incomplete.move:15:9 - │ -15 │ let _tmp4 = s; - │ ^^^ - │ │ - │ Unexpected 'let' - │ Expected an identifier or a decimal number - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/dot_incomplete.move:17:5 - │ -17 │ } - │ ^ - │ │ - │ Unexpected '}' - │ Expected an identifier or a decimal number - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_incomplete.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_incomplete.snap new file mode 100644 index 0000000000000..02eb0906610c6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/dot_incomplete.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/dot_incomplete.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/dot_incomplete.move:12:23 + │ +12 │ let _tmp1 = s.; // incomplete with `;` (next line should parse) + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/dot_incomplete.move:13:37 + │ +13 │ let _tmp2 = s.another_field.; // incomplete with `;` (next line should parse) + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/dot_incomplete.move:15:9 + │ +15 │ let _tmp4 = s; + │ ^^^ + │ │ + │ Unexpected 'let' + │ Expected an identifier or a decimal number + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/dot_incomplete.move:17:5 + │ +17 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected an identifier or a decimal number diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/duplicate_macro_modifier.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/duplicate_macro_modifier.exp deleted file mode 100644 index da324d1cca748..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/duplicate_macro_modifier.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/parser/duplicate_macro_modifier.move:2:11 - │ -2 │ macro macro fun foo() {} - │ ----- ^^^^^ Duplicate 'macro' modifier - │ │ - │ 'macro' modifier previously given here - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/duplicate_macro_modifier.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/duplicate_macro_modifier.snap new file mode 100644 index 0000000000000..4203c3631120e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/duplicate_macro_modifier.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/duplicate_macro_modifier.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/parser/duplicate_macro_modifier.move:2:11 + │ +2 │ macro macro fun foo() {} + │ ----- ^^^^^ Duplicate 'macro' modifier + │ │ + │ 'macro' modifier previously given here diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum.snap new file mode 100644 index 0000000000000..1529b8afcc513 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/enum.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum_invalid.exp deleted file mode 100644 index f72f0b3927e61..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum_invalid.exp +++ /dev/null @@ -1,31 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/parser/enum_invalid.move:2:5 - │ -2 │ enum Temperature { - │ ^^^^ Invalid enum declaration. Internal enum declarations are not yet supported - │ - = Visibility annotations are required on enum declarations. - -error[E01003]: invalid modifier - ┌─ tests/move_2024/parser/enum_invalid.move:8:5 - │ -8 │ public(package) enum EnumWithPhantom { - │ ^^^^^^^^^^^^^^^ Invalid enum declaration. 'public(package)' enum declarations are not yet supported - │ - = Visibility annotations are required on enum declarations. - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/enum_invalid.move:13:13 - │ -13 │ Done(x: u64), - │ ^ Cannot use named fields in a positional definition - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/enum_invalid.move:14:18 - │ -14 │ Add { u64 }, - │ ^ - │ │ - │ Unexpected '}' - │ Expected ':' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum_invalid.snap new file mode 100644 index 0000000000000..3a107660d5606 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum_invalid.snap @@ -0,0 +1,38 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/enum_invalid.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/parser/enum_invalid.move:2:5 + │ +2 │ enum Temperature { + │ ^^^^ Invalid enum declaration. Internal enum declarations are not yet supported + │ + = Visibility annotations are required on enum declarations. + +error[E01003]: invalid modifier + ┌─ tests/move_2024/parser/enum_invalid.move:8:5 + │ +8 │ public(package) enum EnumWithPhantom { + │ ^^^^^^^^^^^^^^^ Invalid enum declaration. 'public(package)' enum declarations are not yet supported + │ + = Visibility annotations are required on enum declarations. + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/enum_invalid.move:13:13 + │ +13 │ Done(x: u64), + │ ^ Cannot use named fields in a positional definition + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/enum_invalid.move:14:18 + │ +14 │ Add { u64 }, + │ ^ + │ │ + │ Unexpected '}' + │ Expected ':' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum_invalid_2.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum_invalid_2.exp deleted file mode 100644 index 266a538c439c7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum_invalid_2.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/enum_invalid_2.move:3:13 - │ -3 │ Done(x: u64), - │ ^ Cannot use named fields in a positional definition - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/enum_invalid_2.move:4:18 - │ -4 │ Add { u64 }, - │ ^ - │ │ - │ Unexpected '}' - │ Expected ':' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum_invalid_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum_invalid_2.snap new file mode 100644 index 0000000000000..8511569e0cdff --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum_invalid_2.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/enum_invalid_2.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/enum_invalid_2.move:3:13 + │ +3 │ Done(x: u64), + │ ^ Cannot use named fields in a positional definition + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/enum_invalid_2.move:4:18 + │ +4 │ Add { u64 }, + │ ^ + │ │ + │ Unexpected '}' + │ Expected ':' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum_keyword.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum_keyword.exp deleted file mode 100644 index ccaf6af99072e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum_keyword.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/enum_keyword.move:1:11 - │ -1 │ module a::enum {} - │ ^^^^ - │ │ - │ Unexpected 'enum' - │ Expected an identifier - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum_keyword.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum_keyword.snap new file mode 100644 index 0000000000000..512518ba890b3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/enum_keyword.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/enum_keyword.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/enum_keyword.move:1:11 + │ +1 │ module a::enum {} + │ ^^^^ + │ │ + │ Unexpected 'enum' + │ Expected an identifier diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/for_keyword.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/for_keyword.exp deleted file mode 100644 index 0afa7e75c2291..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/for_keyword.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/for_keyword.move:2:9 - │ -2 │ fun for(_: u64): bool { false } - │ ^^^ - │ │ - │ Unexpected 'for' - │ Expected an identifier - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/for_keyword.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/for_keyword.snap new file mode 100644 index 0000000000000..073aed587bc1d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/for_keyword.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/for_keyword.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/for_keyword.move:2:9 + │ +2 │ fun for(_: u64): bool { false } + │ ^^^ + │ │ + │ Unexpected 'for' + │ Expected an identifier diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/friend_decl_qualified_struct.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/friend_decl_qualified_struct.exp deleted file mode 100644 index 3f53281c77592..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/friend_decl_qualified_struct.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/parser/friend_decl_qualified_struct.move:2:5 - │ -2 │ struct A {} - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/parser/friend_decl_qualified_struct.move:6:12 - │ -6 │ friend 0x42::A::A; - │ ^^^^^^^^^^ Unexpected module member identifier. A module member identifier is not a valid module - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/friend_decl_qualified_struct.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/friend_decl_qualified_struct.snap new file mode 100644 index 0000000000000..cbccfdb6cb661 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/friend_decl_qualified_struct.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/friend_decl_qualified_struct.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/parser/friend_decl_qualified_struct.move:2:5 + │ +2 │ struct A {} + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/parser/friend_decl_qualified_struct.move:6:12 + │ +6 │ friend 0x42::A::A; + │ ^^^^^^^^^^ Unexpected module member identifier. A module member identifier is not a valid module diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_exists_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_exists_invalid.exp deleted file mode 100644 index 7b59b63dd2b1b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_exists_invalid.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/global_access_exists_invalid.move:6:26 - │ -6 │ let _ : bool = ::exists(0x0); - │ ^^^^^^ Expected '::' after the global address in this module access chain - │ - = Access chains that start with '::' must be multi-part - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_exists_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_exists_invalid.snap new file mode 100644 index 0000000000000..45bc4ac249279 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_exists_invalid.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/global_access_exists_invalid.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/global_access_exists_invalid.move:6:26 + │ +6 │ let _ : bool = ::exists(0x0); + │ ^^^^^^ Expected '::' after the global address in this module access chain + │ + = Access chains that start with '::' must be multi-part diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_pack.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_pack.exp deleted file mode 100644 index cd87d4fa9a9c4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_pack.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/parser/global_access_pack.move:3:5 - │ -3 │ struct S { } - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_pack.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_pack.snap new file mode 100644 index 0000000000000..ad9a2e04c675f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_pack.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/global_access_pack.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/parser/global_access_pack.move:3:5 + │ +3 │ struct S { } + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_pack_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_pack_invalid.exp deleted file mode 100644 index 2be4fc370ef32..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_pack_invalid.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/global_access_pack_invalid.move:3:11 - │ -3 │ ::S { } - │ ^ Expected '::' after the global address in this module access chain - │ - = Access chains that start with '::' must be multi-part - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_pack_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_pack_invalid.snap new file mode 100644 index 0000000000000..90926c02d1193 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_pack_invalid.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/global_access_pack_invalid.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/global_access_pack_invalid.move:3:11 + │ +3 │ ::S { } + │ ^ Expected '::' after the global address in this module access chain + │ + = Access chains that start with '::' must be multi-part diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_value.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_value.exp deleted file mode 100644 index dea99379caff9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_value.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/global_access_value.move:3:13 - │ -3 │ 1 + ::global_value - │ ^^ - │ │ - │ Unexpected '::' - │ Expected an expression term - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_value_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_value_invalid.exp deleted file mode 100644 index 107926abb771d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_value_invalid.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/global_access_value_invalid.move:3:15 - │ -3 │ 1 + ::global_value - │ ^^^^^^^^^^^^ Expected '::' after the global address in this module access chain - │ - = Access chains that start with '::' must be multi-part - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_value_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_value_invalid.snap new file mode 100644 index 0000000000000..ac0f4155237f7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_value_invalid.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/global_access_value_invalid.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/global_access_value_invalid.move:3:15 + │ +3 │ 1 + ::global_value + │ ^^^^^^^^^^^^ Expected '::' after the global address in this module access chain + │ + = Access chains that start with '::' must be multi-part diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_value_invalid_macro_ident.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_value_invalid_macro_ident.exp deleted file mode 100644 index f9651c0efd561..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_value_invalid_macro_ident.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/global_access_value_invalid_macro_ident.move:3:9 - │ -3 │ ::$a; - │ ^^ - │ │ - │ Unexpected '::' - │ Expected An identifier after '::' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_value_invalid_macro_ident.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_value_invalid_macro_ident.snap new file mode 100644 index 0000000000000..763c05f7bce4f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/global_access_value_invalid_macro_ident.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/global_access_value_invalid_macro_ident.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/global_access_value_invalid_macro_ident.move:3:9 + │ +3 │ ::$a; + │ ^^ + │ │ + │ Unexpected '::' + │ Expected An identifier after '::' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_labels_0.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_labels_0.exp deleted file mode 100644 index 6e11e1599711c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_labels_0.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/invalid_labels_0.move:3:18 - │ -3 │ let _x = 'a'; - │ ^^^ Single-quote (') may only prefix control flow labels - │ - = Character literals are not supported, and string literals use double-quote ("). - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_labels_0.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_labels_0.snap new file mode 100644 index 0000000000000..257cf6e84a7dc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_labels_0.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/invalid_labels_0.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/invalid_labels_0.move:3:18 + │ +3 │ let _x = 'a'; + │ ^^^ Single-quote (') may only prefix control flow labels + │ + = Character literals are not supported, and string literals use double-quote ("). diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_labels_1.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_labels_1.exp deleted file mode 100644 index 7d61f8f402400..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_labels_1.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/invalid_labels_1.move:3:14 - │ -3 │ loop 'block': { - │ ^^^^^^^ Single-quote (') may only prefix control flow labels - │ - = Character literals are not supported, and string literals use double-quote ("). - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_labels_1.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_labels_1.snap new file mode 100644 index 0000000000000..1189e6ca4a281 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_labels_1.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/invalid_labels_1.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/invalid_labels_1.move:3:14 + │ +3 │ loop 'block': { + │ ^^^^^^^ Single-quote (') may only prefix control flow labels + │ + = Character literals are not supported, and string literals use double-quote ("). diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_labels_2.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_labels_2.exp deleted file mode 100644 index 2e064358aba1e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_labels_2.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/invalid_labels_2.move:3:14 - │ -3 │ loop 'block' { - │ ^^^^^^^ Single-quote (') may only prefix control flow labels - │ - = Character literals are not supported, and string literals use double-quote ("). - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_labels_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_labels_2.snap new file mode 100644 index 0000000000000..2f81d0f3ca272 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_labels_2.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/invalid_labels_2.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/invalid_labels_2.move:3:14 + │ +3 │ loop 'block' { + │ ^^^^^^^ Single-quote (') may only prefix control flow labels + │ + = Character literals are not supported, and string literals use double-quote ("). diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_bang.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_bang.exp deleted file mode 100644 index f4529c6d74f7b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_bang.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/parser/invalid_macro_bang.move:3:17 - │ -3 │ fun bar() { foo!(42) } - │ ^^^^^^^^ Expected name to be followed by a brace-enclosed list of field expressions or a parenthesized list of arguments for a function call - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/invalid_macro_bang.move:3:25 - │ -3 │ fun bar() { foo!(42) } - │ ^ - │ │ - │ Unexpected '!' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_bang.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_bang.snap new file mode 100644 index 0000000000000..380e3bcaa6a7d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_bang.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/invalid_macro_bang.move +--- +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/parser/invalid_macro_bang.move:3:17 + │ +3 │ fun bar() { foo!(42) } + │ ^^^^^^^^ Expected name to be followed by a brace-enclosed list of field expressions or a parenthesized list of arguments for a function call + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/invalid_macro_bang.move:3:25 + │ +3 │ fun bar() { foo!(42) } + │ ^ + │ │ + │ Unexpected '!' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_bang_no_args.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_bang_no_args.exp deleted file mode 100644 index 0a2fb151984f8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_bang_no_args.exp +++ /dev/null @@ -1,17 +0,0 @@ -error[E04016]: too few arguments - ┌─ tests/move_2024/parser/invalid_macro_bang_no_args.move:3:17 - │ -3 │ fun bar() { foo!; } - │ ^^^^- Found 0 argument(s) here - │ │ - │ Invalid call of 'a::m::foo'. The call expected 1 argument(s) but got 0 - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/invalid_macro_bang_no_args.move:3:21 - │ -3 │ fun bar() { foo!; } - │ ^ - │ │ - │ Unexpected ';' - │ Expected '(' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_bang_no_args.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_bang_no_args.snap new file mode 100644 index 0000000000000..f8802a07d7cb3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_bang_no_args.snap @@ -0,0 +1,24 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/invalid_macro_bang_no_args.move +--- +error[E04016]: too few arguments + ┌─ tests/move_2024/parser/invalid_macro_bang_no_args.move:3:17 + │ +3 │ fun bar() { foo!; } + │ ^^^^- Found 0 argument(s) here + │ │ + │ Invalid call of 'a::m::foo'. The call expected 1 argument(s) but got 0 + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/invalid_macro_bang_no_args.move:3:21 + │ +3 │ fun bar() { foo!; } + │ ^ + │ │ + │ Unexpected ';' + │ Expected '(' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_identifier_usage.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_identifier_usage.exp deleted file mode 100644 index 5d2e3c90284ed..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_identifier_usage.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/invalid_macro_identifier_usage.move:2:9 - │ -2 │ fun $foo() { let $x = 0; } - │ ^^^^ - │ │ - │ Unexpected '$foo' - │ Expected an identifier - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/invalid_macro_identifier_usage.move:3:19 - │ -3 │ public struct $X() - │ ^^ - │ │ - │ Unexpected '$X' - │ Expected an identifier - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/invalid_macro_identifier_usage.move:4:11 - │ -4 │ const $C: u64 = 0; - │ ^^ - │ │ - │ Unexpected '$C' - │ Expected an identifier - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_identifier_usage.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_identifier_usage.snap new file mode 100644 index 0000000000000..4741656fec5c8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_identifier_usage.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/invalid_macro_identifier_usage.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/invalid_macro_identifier_usage.move:2:9 + │ +2 │ fun $foo() { let $x = 0; } + │ ^^^^ + │ │ + │ Unexpected '$foo' + │ Expected an identifier + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/invalid_macro_identifier_usage.move:3:19 + │ +3 │ public struct $X() + │ ^^ + │ │ + │ Unexpected '$X' + │ Expected an identifier + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/invalid_macro_identifier_usage.move:4:11 + │ +4 │ const $C: u64 = 0; + │ ^^ + │ │ + │ Unexpected '$C' + │ Expected an identifier diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_locs.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_locs.exp deleted file mode 100644 index 60ffee9f5a8c1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_locs.exp +++ /dev/null @@ -1,213 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_2024/parser/invalid_macro_locs.move:6:9 - │ - 3 │ public struct S { u: T } - │ - Struct defined in module 'a::m' - · - 6 │ S{ u: $u } - │ ^^^^^^^^^^ Struct 'a::m::S' can only be instantiated within its defining module 'a::m' - · -25 │ a::m!::make_s!(0u64) - │ ------------------------- While expanding this macro - │ - = This visibility error occurs in a macro body while expanding the macro 'a::m::make_s' - = Visibility inside of expanded macros is resolved in the scope of the caller. - -error[E04001]: restricted visibility - ┌─ tests/move_2024/parser/invalid_macro_locs.move:6:9 - │ - 3 │ public struct S { u: T } - │ - Struct defined in module 'a::m' - · - 6 │ S{ u: $u } - │ ^^^^^^^^^^ Struct 'a::m::S' can only be instantiated within its defining module 'a::m' - · -29 │ a!::m!::make_s!(0u64) - │ -------------------------- While expanding this macro - │ - = This visibility error occurs in a macro body while expanding the macro 'a::m::make_s' - = Visibility inside of expanded macros is resolved in the scope of the caller. - -error[E04029]: invalid function call - ┌─ tests/move_2024/parser/invalid_macro_locs.move:13:9 - │ - 5 │ public macro fun make_s<$T>($u: $T): S<$T> { - │ ----- 'macro' function is declared here - · -13 │ a!::m::make_s(0u64) - │ ^^^^^^^^^^^^^^^^^^^^^^^^ 'make_s' is a macro function and must be called with a `!`. Try replacing with 'make_s!' - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_macro_locs.move:13:13 - │ -13 │ a!::m::make_s(0u64) - │ - ^ A macro call cannot have name access entries after it - │ │ - │ Macro invocation given here - -error[E04029]: invalid function call - ┌─ tests/move_2024/parser/invalid_macro_locs.move:17:9 - │ - 5 │ public macro fun make_s<$T>($u: $T): S<$T> { - │ ----- 'macro' function is declared here - · -17 │ a::m!::make_s(0u64) - │ ^^^^^^^^^^^^^^^^^^^^^^^^ 'make_s' is a macro function and must be called with a `!`. Try replacing with 'make_s!' - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_macro_locs.move:17:16 - │ -17 │ a::m!::make_s(0u64) - │ - ^^^^^^ A macro call cannot have name access entries after it - │ │ - │ Macro invocation given here - -error[E04029]: invalid function call - ┌─ tests/move_2024/parser/invalid_macro_locs.move:21:9 - │ - 5 │ public macro fun make_s<$T>($u: $T): S<$T> { - │ ----- 'macro' function is declared here - · -21 │ a!::m!::make_s(0u64) - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ 'make_s' is a macro function and must be called with a `!`. Try replacing with 'make_s!' - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_macro_locs.move:21:13 - │ -21 │ a!::m!::make_s(0u64) - │ - ^ A macro call cannot have name access entries after it - │ │ - │ Macro invocation given here - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_macro_locs.move:21:17 - │ -21 │ a!::m!::make_s(0u64) - │ - ^^^^^^ A macro call cannot have name access entries after it - │ │ - │ Macro invocation given here - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_macro_locs.move:25:16 - │ -25 │ a::m!::make_s!(0u64) - │ - ^^^^^^ A macro call cannot have name access entries after it - │ │ - │ Macro invocation given here - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_macro_locs.move:29:13 - │ -29 │ a!::m!::make_s!(0u64) - │ - ^ A macro call cannot have name access entries after it - │ │ - │ Macro invocation given here - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_macro_locs.move:29:17 - │ -29 │ a!::m!::make_s!(0u64) - │ - ^^^^^^ A macro call cannot have name access entries after it - │ │ - │ Macro invocation given here - -error[E04001]: restricted visibility - ┌─ tests/move_2024/parser/invalid_macro_locs.move:39:9 - │ -36 │ public struct S { u: T } - │ - Struct defined in module '0x42::m' - · -39 │ S{ u: $u } - │ ^^^^^^^^^^ Struct '0x42::m::S' can only be instantiated within its defining module '0x42::m' - · -58 │ 0x42::m!::make_s!(0u64) - │ ---------------------------- While expanding this macro - │ - = This visibility error occurs in a macro body while expanding the macro '0x42::m::make_s' - = Visibility inside of expanded macros is resolved in the scope of the caller. - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/invalid_macro_locs.move:46:13 - │ -46 │ 0x42!::m::make_s(0u64) - │ ^ - │ │ - │ Unexpected '!' - │ Expected ';' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/invalid_macro_locs.move:46:13 - │ -45 │ fun test00(): 0x42::m::S { - │ --------------- Expected: '0x42::m::S' -46 │ 0x42!::m::make_s(0u64) - │ ^ - │ │ - │ Invalid return expression - │ Given: '()' - -error[E04029]: invalid function call - ┌─ tests/move_2024/parser/invalid_macro_locs.move:50:9 - │ -38 │ public macro fun make_s<$T>($u: $T): S<$T> { - │ ----- 'macro' function is declared here - · -50 │ 0x42::m!::make_s(0u64) - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 'make_s' is a macro function and must be called with a `!`. Try replacing with 'make_s!' - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_macro_locs.move:50:19 - │ -50 │ 0x42::m!::make_s(0u64) - │ - ^^^^^^ A macro call cannot have name access entries after it - │ │ - │ Macro invocation given here - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/invalid_macro_locs.move:54:13 - │ -54 │ 0x42!::m!::make_s(0u64) - │ ^ - │ │ - │ Unexpected '!' - │ Expected ';' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/invalid_macro_locs.move:54:13 - │ -53 │ fun test02(): 0x42::m::S { - │ --------------- Expected: '0x42::m::S' -54 │ 0x42!::m!::make_s(0u64) - │ ^ - │ │ - │ Invalid return expression - │ Given: '()' - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_macro_locs.move:58:19 - │ -58 │ 0x42::m!::make_s!(0u64) - │ - ^^^^^^ A macro call cannot have name access entries after it - │ │ - │ Macro invocation given here - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/invalid_macro_locs.move:62:13 - │ -62 │ 0x42!::m!::make_s!(0u64) - │ ^ - │ │ - │ Unexpected '!' - │ Expected ';' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/invalid_macro_locs.move:62:13 - │ -61 │ fun test04(): 0x42::m::S { - │ --------------- Expected: '0x42::m::S' -62 │ 0x42!::m!::make_s!(0u64) - │ ^ - │ │ - │ Invalid return expression - │ Given: '()' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_locs.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_locs.snap new file mode 100644 index 0000000000000..f2c8759cdc40b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_locs.snap @@ -0,0 +1,220 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/invalid_macro_locs.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_2024/parser/invalid_macro_locs.move:6:9 + │ + 3 │ public struct S { u: T } + │ - Struct defined in module 'a::m' + · + 6 │ S{ u: $u } + │ ^^^^^^^^^^ Struct 'a::m::S' can only be instantiated within its defining module 'a::m' + · +25 │ a::m!::make_s!(0u64) + │ ------------------------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::make_s' + = Visibility inside of expanded macros is resolved in the scope of the caller. + +error[E04001]: restricted visibility + ┌─ tests/move_2024/parser/invalid_macro_locs.move:6:9 + │ + 3 │ public struct S { u: T } + │ - Struct defined in module 'a::m' + · + 6 │ S{ u: $u } + │ ^^^^^^^^^^ Struct 'a::m::S' can only be instantiated within its defining module 'a::m' + · +29 │ a!::m!::make_s!(0u64) + │ -------------------------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::make_s' + = Visibility inside of expanded macros is resolved in the scope of the caller. + +error[E04029]: invalid function call + ┌─ tests/move_2024/parser/invalid_macro_locs.move:13:9 + │ + 5 │ public macro fun make_s<$T>($u: $T): S<$T> { + │ ----- 'macro' function is declared here + · +13 │ a!::m::make_s(0u64) + │ ^^^^^^^^^^^^^^^^^^^^^^^^ 'make_s' is a macro function and must be called with a `!`. Try replacing with 'make_s!' + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_macro_locs.move:13:13 + │ +13 │ a!::m::make_s(0u64) + │ - ^ A macro call cannot have name access entries after it + │ │ + │ Macro invocation given here + +error[E04029]: invalid function call + ┌─ tests/move_2024/parser/invalid_macro_locs.move:17:9 + │ + 5 │ public macro fun make_s<$T>($u: $T): S<$T> { + │ ----- 'macro' function is declared here + · +17 │ a::m!::make_s(0u64) + │ ^^^^^^^^^^^^^^^^^^^^^^^^ 'make_s' is a macro function and must be called with a `!`. Try replacing with 'make_s!' + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_macro_locs.move:17:16 + │ +17 │ a::m!::make_s(0u64) + │ - ^^^^^^ A macro call cannot have name access entries after it + │ │ + │ Macro invocation given here + +error[E04029]: invalid function call + ┌─ tests/move_2024/parser/invalid_macro_locs.move:21:9 + │ + 5 │ public macro fun make_s<$T>($u: $T): S<$T> { + │ ----- 'macro' function is declared here + · +21 │ a!::m!::make_s(0u64) + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ 'make_s' is a macro function and must be called with a `!`. Try replacing with 'make_s!' + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_macro_locs.move:21:13 + │ +21 │ a!::m!::make_s(0u64) + │ - ^ A macro call cannot have name access entries after it + │ │ + │ Macro invocation given here + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_macro_locs.move:21:17 + │ +21 │ a!::m!::make_s(0u64) + │ - ^^^^^^ A macro call cannot have name access entries after it + │ │ + │ Macro invocation given here + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_macro_locs.move:25:16 + │ +25 │ a::m!::make_s!(0u64) + │ - ^^^^^^ A macro call cannot have name access entries after it + │ │ + │ Macro invocation given here + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_macro_locs.move:29:13 + │ +29 │ a!::m!::make_s!(0u64) + │ - ^ A macro call cannot have name access entries after it + │ │ + │ Macro invocation given here + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_macro_locs.move:29:17 + │ +29 │ a!::m!::make_s!(0u64) + │ - ^^^^^^ A macro call cannot have name access entries after it + │ │ + │ Macro invocation given here + +error[E04001]: restricted visibility + ┌─ tests/move_2024/parser/invalid_macro_locs.move:39:9 + │ +36 │ public struct S { u: T } + │ - Struct defined in module '0x42::m' + · +39 │ S{ u: $u } + │ ^^^^^^^^^^ Struct '0x42::m::S' can only be instantiated within its defining module '0x42::m' + · +58 │ 0x42::m!::make_s!(0u64) + │ ---------------------------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro '0x42::m::make_s' + = Visibility inside of expanded macros is resolved in the scope of the caller. + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/invalid_macro_locs.move:46:13 + │ +46 │ 0x42!::m::make_s(0u64) + │ ^ + │ │ + │ Unexpected '!' + │ Expected ';' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/invalid_macro_locs.move:46:13 + │ +45 │ fun test00(): 0x42::m::S { + │ --------------- Expected: '0x42::m::S' +46 │ 0x42!::m::make_s(0u64) + │ ^ + │ │ + │ Invalid return expression + │ Given: '()' + +error[E04029]: invalid function call + ┌─ tests/move_2024/parser/invalid_macro_locs.move:50:9 + │ +38 │ public macro fun make_s<$T>($u: $T): S<$T> { + │ ----- 'macro' function is declared here + · +50 │ 0x42::m!::make_s(0u64) + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 'make_s' is a macro function and must be called with a `!`. Try replacing with 'make_s!' + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_macro_locs.move:50:19 + │ +50 │ 0x42::m!::make_s(0u64) + │ - ^^^^^^ A macro call cannot have name access entries after it + │ │ + │ Macro invocation given here + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/invalid_macro_locs.move:54:13 + │ +54 │ 0x42!::m!::make_s(0u64) + │ ^ + │ │ + │ Unexpected '!' + │ Expected ';' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/invalid_macro_locs.move:54:13 + │ +53 │ fun test02(): 0x42::m::S { + │ --------------- Expected: '0x42::m::S' +54 │ 0x42!::m!::make_s(0u64) + │ ^ + │ │ + │ Invalid return expression + │ Given: '()' + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_macro_locs.move:58:19 + │ +58 │ 0x42::m!::make_s!(0u64) + │ - ^^^^^^ A macro call cannot have name access entries after it + │ │ + │ Macro invocation given here + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/invalid_macro_locs.move:62:13 + │ +62 │ 0x42!::m!::make_s!(0u64) + │ ^ + │ │ + │ Unexpected '!' + │ Expected ';' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/invalid_macro_locs.move:62:13 + │ +61 │ fun test04(): 0x42::m::S { + │ --------------- Expected: '0x42::m::S' +62 │ 0x42!::m!::make_s!(0u64) + │ ^ + │ │ + │ Invalid return expression + │ Given: '()' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_modifier.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_modifier.exp deleted file mode 100644 index 8fe31a27633ce..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_modifier.exp +++ /dev/null @@ -1,40 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/parser/invalid_macro_modifier.move:2:5 - │ -2 │ macro const X: u64 = 0; - │ ^^^^^ Invalid constant declaration. 'macro' is used only on functions - -error[E01003]: invalid modifier - ┌─ tests/move_2024/parser/invalid_macro_modifier.move:3:5 - │ -3 │ macro public struct S() - │ ^^^^^ Invalid struct declaration. 'macro' is used only on functions - -error[E01003]: invalid modifier - ┌─ tests/move_2024/parser/invalid_macro_modifier.move:4:5 - │ -4 │ macro use a::m as n; - │ ^^^^^ Invalid use declaration. 'macro' is used only on functions - -warning[W09001]: unused alias - ┌─ tests/move_2024/parser/invalid_macro_modifier.move:4:23 - │ -4 │ macro use a::m as n; - │ ^ Unused 'use' of alias 'n'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01003]: invalid modifier - ┌─ tests/move_2024/parser/invalid_macro_modifier.move:5:5 - │ -5 │ macro use fun foo as S.bar; - │ ^^^^^ Invalid use declaration. 'macro' is used only on functions - -warning[W09001]: unused alias - ┌─ tests/move_2024/parser/invalid_macro_modifier.move:5:5 - │ -5 │ macro use fun foo as S.bar; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Unused 'use fun' of 'a::m::S.bar'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_modifier.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_modifier.snap new file mode 100644 index 0000000000000..ab64dee14542c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_macro_modifier.snap @@ -0,0 +1,47 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/invalid_macro_modifier.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/parser/invalid_macro_modifier.move:2:5 + │ +2 │ macro const X: u64 = 0; + │ ^^^^^ Invalid constant declaration. 'macro' is used only on functions + +error[E01003]: invalid modifier + ┌─ tests/move_2024/parser/invalid_macro_modifier.move:3:5 + │ +3 │ macro public struct S() + │ ^^^^^ Invalid struct declaration. 'macro' is used only on functions + +error[E01003]: invalid modifier + ┌─ tests/move_2024/parser/invalid_macro_modifier.move:4:5 + │ +4 │ macro use a::m as n; + │ ^^^^^ Invalid use declaration. 'macro' is used only on functions + +warning[W09001]: unused alias + ┌─ tests/move_2024/parser/invalid_macro_modifier.move:4:23 + │ +4 │ macro use a::m as n; + │ ^ Unused 'use' of alias 'n'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01003]: invalid modifier + ┌─ tests/move_2024/parser/invalid_macro_modifier.move:5:5 + │ +5 │ macro use fun foo as S.bar; + │ ^^^^^ Invalid use declaration. 'macro' is used only on functions + +warning[W09001]: unused alias + ┌─ tests/move_2024/parser/invalid_macro_modifier.move:5:5 + │ +5 │ macro use fun foo as S.bar; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Unused 'use fun' of 'a::m::S.bar'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_mut_usage_match.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_mut_usage_match.exp deleted file mode 100644 index 3aec94494084a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_mut_usage_match.exp +++ /dev/null @@ -1,72 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:9:15 - │ -9 │ match (o) { - │ ^ Pattern 'Option::None' not covered - -error[E04016]: too few arguments - ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:10:10 - │ -10 │ Option::Other { mut x: mut y } => y, - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Missing pattern for field 'x' in '0x42::m::Option::Other' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:10:26 - │ -10 │ Option::Other { mut x: mut y } => y, - │ ^^^ 'mut' modifier can only be used on variable bindings - -error[E03009]: unbound variable - ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:10:44 - │ -10 │ Option::Other { mut x: mut y } => y, - │ ^ Unbound variable 'y' - -error[E02010]: invalid name - ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:11:33 - │ -11 │ Option::Other { x: mut y } => y, - │ ^ Invalid type arguments on a pattern variable - │ - = Type arguments cannot appear on pattern variables - -error[E04016]: too few arguments - ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:12:10 - │ -12 │ Option::Other { mut x: y } => y, - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Missing pattern for field 'x' in '0x42::m::Option::Other' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:12:26 - │ -12 │ Option::Other { mut x: y } => y, - │ ^^^ 'mut' modifier can only be used on variable bindings - -error[E03009]: unbound variable - ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:12:40 - │ -12 │ Option::Other { mut x: y } => y, - │ ^ Unbound variable 'y' - -warning[W09002]: unused variable - ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:13:10 - │ -13 │ x @ mut Option::Some(true) => true, - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:13:14 - │ -13 │ x @ mut Option::Some(true) => true, - │ ^^^ Invalid 'mut' keyword on non-variable pattern - -error[E02010]: invalid name - ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:14:10 - │ -14 │ mut Option::None => false, - │ ^^^ ------------ Expected a valid 'enum' variant, 'struct', or 'const', not a variable - │ │ - │ 'mut' can only be used with variable bindings in patterns - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_mut_usage_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_mut_usage_match.snap new file mode 100644 index 0000000000000..4ea83b74be77e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_mut_usage_match.snap @@ -0,0 +1,79 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/invalid_mut_usage_match.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:9:15 + │ +9 │ match (o) { + │ ^ Pattern 'Option::None' not covered + +error[E04016]: too few arguments + ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:10:10 + │ +10 │ Option::Other { mut x: mut y } => y, + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Missing pattern for field 'x' in '0x42::m::Option::Other' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:10:26 + │ +10 │ Option::Other { mut x: mut y } => y, + │ ^^^ 'mut' modifier can only be used on variable bindings + +error[E03009]: unbound variable + ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:10:44 + │ +10 │ Option::Other { mut x: mut y } => y, + │ ^ Unbound variable 'y' + +error[E02010]: invalid name + ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:11:33 + │ +11 │ Option::Other { x: mut y } => y, + │ ^ Invalid type arguments on a pattern variable + │ + = Type arguments cannot appear on pattern variables + +error[E04016]: too few arguments + ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:12:10 + │ +12 │ Option::Other { mut x: y } => y, + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Missing pattern for field 'x' in '0x42::m::Option::Other' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:12:26 + │ +12 │ Option::Other { mut x: y } => y, + │ ^^^ 'mut' modifier can only be used on variable bindings + +error[E03009]: unbound variable + ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:12:40 + │ +12 │ Option::Other { mut x: y } => y, + │ ^ Unbound variable 'y' + +warning[W09002]: unused variable + ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:13:10 + │ +13 │ x @ mut Option::Some(true) => true, + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:13:14 + │ +13 │ x @ mut Option::Some(true) => true, + │ ^^^ Invalid 'mut' keyword on non-variable pattern + +error[E02010]: invalid name + ┌─ tests/move_2024/parser/invalid_mut_usage_match.move:14:10 + │ +14 │ mut Option::None => false, + │ ^^^ ------------ Expected a valid 'enum' variant, 'struct', or 'const', not a variable + │ │ + │ 'mut' can only be used with variable bindings in patterns diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.exp deleted file mode 100644 index 5e5bfec29ddd8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.exp +++ /dev/null @@ -1,48 +0,0 @@ -error[E03013]: positional call mismatch - ┌─ tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.move:26:13 - │ - 4 │ public struct Bar { - │ --- 'Bar' is declared here - · -26 │ let Bar(Foo(Bar(Foo(x, y)), z)) = y; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions - -error[E03010]: unbound field - ┌─ tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.move:26:13 - │ -26 │ let Bar(Foo(Bar(Foo(x, y)), z)) = y; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Unbound field '0' in '0x42::M::Bar' - -error[E04016]: too few arguments - ┌─ tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.move:26:13 - │ -26 │ let Bar(Foo(Bar(Foo(x, y)), z)) = y; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Missing binding for field 'f' in '0x42::M::Bar' - -error[E03013]: positional call mismatch - ┌─ tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.move:26:21 - │ - 4 │ public struct Bar { - │ --- 'Bar' is declared here - · -26 │ let Bar(Foo(Bar(Foo(x, y)), z)) = y; - │ ^^^^^^^^^^^^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions - -error[E03010]: unbound field - ┌─ tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.move:26:21 - │ -26 │ let Bar(Foo(Bar(Foo(x, y)), z)) = y; - │ ^^^^^^^^^^^^^^ Unbound field '0' in '0x42::M::Bar' - -error[E04010]: cannot infer type - ┌─ tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.move:26:21 - │ -26 │ let Bar(Foo(Bar(Foo(x, y)), z)) = y; - │ ^^^^^^^^^^^^^^ Could not infer this type. Try adding an annotation - -error[E04016]: too few arguments - ┌─ tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.move:26:21 - │ -26 │ let Bar(Foo(Bar(Foo(x, y)), z)) = y; - │ ^^^^^^^^^^^^^^ Missing binding for field 'f' in '0x42::M::Bar' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.snap new file mode 100644 index 0000000000000..b34a84d0be71f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.snap @@ -0,0 +1,55 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.move +--- +error[E03013]: positional call mismatch + ┌─ tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.move:26:13 + │ + 4 │ public struct Bar { + │ --- 'Bar' is declared here + · +26 │ let Bar(Foo(Bar(Foo(x, y)), z)) = y; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions + +error[E03010]: unbound field + ┌─ tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.move:26:13 + │ +26 │ let Bar(Foo(Bar(Foo(x, y)), z)) = y; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Unbound field '0' in '0x42::M::Bar' + +error[E04016]: too few arguments + ┌─ tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.move:26:13 + │ +26 │ let Bar(Foo(Bar(Foo(x, y)), z)) = y; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Missing binding for field 'f' in '0x42::M::Bar' + +error[E03013]: positional call mismatch + ┌─ tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.move:26:21 + │ + 4 │ public struct Bar { + │ --- 'Bar' is declared here + · +26 │ let Bar(Foo(Bar(Foo(x, y)), z)) = y; + │ ^^^^^^^^^^^^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions + +error[E03010]: unbound field + ┌─ tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.move:26:21 + │ +26 │ let Bar(Foo(Bar(Foo(x, y)), z)) = y; + │ ^^^^^^^^^^^^^^ Unbound field '0' in '0x42::M::Bar' + +error[E04010]: cannot infer type + ┌─ tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.move:26:21 + │ +26 │ let Bar(Foo(Bar(Foo(x, y)), z)) = y; + │ ^^^^^^^^^^^^^^ Could not infer this type. Try adding an annotation + +error[E04016]: too few arguments + ┌─ tests/move_2024/parser/invalid_positional_struct_unpack_deeply_nested.move:26:21 + │ +26 │ let Bar(Foo(Bar(Foo(x, y)), z)) = y; + │ ^^^^^^^^^^^^^^ Missing binding for field 'f' in '0x42::M::Bar' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_tyarg_locs.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_tyarg_locs.exp deleted file mode 100644 index ba7046e825fd5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_tyarg_locs.exp +++ /dev/null @@ -1,422 +0,0 @@ -error[E03008]: too few type arguments - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:12:19 - │ -12 │ fun test00(): a::m::S { - │ ^^^^^^^^^^^^ Invalid instantiation of 'a::m::S'. Expected 1 type argument(s) but got 0 - -error[E03018]: invalid type parameter - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:12:23 - │ -12 │ fun test00(): a::m::S { - │ ^^^^^ Cannot use type parameters on a module - -error[E03018]: invalid type parameter - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:13:13 - │ -13 │ a::m::make_s(0u64) - │ ^^^^^ Cannot use type parameters on a module - -error[E03008]: too few type arguments - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:16:19 - │ -16 │ fun test01(): a::m::S { - │ ^^^^^^^^^^^^ Invalid instantiation of 'a::m::S'. Expected 1 type argument(s) but got 0 - -error[E03018]: invalid type parameter - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:16:20 - │ -16 │ fun test01(): a::m::S { - │ ^^^^^ Cannot use type parameters on an address - -error[E03018]: invalid type parameter - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:17:10 - │ -17 │ a::m::make_s(0u64) - │ ^^^^^ Cannot use type parameters on an address - -error[E03008]: too few type arguments - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:20:19 - │ -20 │ fun test02(): a::m::S { - │ ^^^^^^^^^^^^^^^^^ Invalid instantiation of 'a::m::S'. Expected 1 type argument(s) but got 0 - -error[E03018]: invalid type parameter - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:20:20 - │ -20 │ fun test02(): a::m::S { - │ ^^^^^ Cannot use type parameters on an address - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:20:28 - │ -20 │ fun test02(): a::m::S { - │ ----- ^^^^^ Paths cannot include type arguments more than once - │ │ - │ Previous type arguments appeared here - │ - = Type arguments should only appear on module members - -error[E03018]: invalid type parameter - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:21:10 - │ -21 │ a::m::make_s(0u64) - │ ^^^^^ Cannot use type parameters on an address - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:21:18 - │ -21 │ a::m::make_s(0u64) - │ ----- ^^^^^ Paths cannot include type arguments more than once - │ │ - │ Previous type arguments appeared here - │ - = Type arguments should only appear on module members - -error[E03008]: too few type arguments - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:24:19 - │ -24 │ fun test03(): a::m::S { - │ ^^^^^^^^^^^^^^^^^ Invalid instantiation of 'a::m::S'. Expected 1 type argument(s) but got 0 - -error[E03018]: invalid type parameter - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:24:23 - │ -24 │ fun test03(): a::m::S { - │ ^^^^^ Cannot use type parameters on a module - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:24:31 - │ -24 │ fun test03(): a::m::S { - │ ----- ^^^^^ Paths cannot include type arguments more than once - │ │ - │ Previous type arguments appeared here - │ - = Type arguments should only appear on module members - -error[E03018]: invalid type parameter - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:25:13 - │ -25 │ a::m::make_s(0u64) - │ ^^^^^ Cannot use type parameters on a module - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:25:26 - │ -25 │ a::m::make_s(0u64) - │ ----- ^^^^^ Paths cannot include type arguments more than once - │ │ - │ Previous type arguments appeared here - │ - = Type arguments should only appear on module members - -error[E03008]: too few type arguments - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:28:19 - │ -28 │ fun test04(): a::m::S { - │ ^^^^^^^^^^^^^^^^^^^^^^ Invalid instantiation of 'a::m::S'. Expected 1 type argument(s) but got 0 - -error[E03018]: invalid type parameter - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:28:20 - │ -28 │ fun test04(): a::m::S { - │ ^^^^^ Cannot use type parameters on an address - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:28:28 - │ -28 │ fun test04(): a::m::S { - │ ----- ^^^^^ Paths cannot include type arguments more than once - │ │ - │ Previous type arguments appeared here - │ - = Type arguments should only appear on module members - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:28:36 - │ -28 │ fun test04(): a::m::S { - │ ----- ^^^^^ Paths cannot include type arguments more than once - │ │ - │ Previous type arguments appeared here - │ - = Type arguments should only appear on module members - -error[E03018]: invalid type parameter - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:29:10 - │ -29 │ a::m::make_s(0u64) - │ ^^^^^ Cannot use type parameters on an address - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:29:18 - │ -29 │ a::m::make_s(0u64) - │ ----- ^^^^^ Paths cannot include type arguments more than once - │ │ - │ Previous type arguments appeared here - │ - = Type arguments should only appear on module members - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:29:31 - │ -29 │ a::m::make_s(0u64) - │ ----- ^^^^^ Paths cannot include type arguments more than once - │ │ - │ Previous type arguments appeared here - │ - = Type arguments should only appear on module members - -error[E03008]: too few type arguments - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:46:19 - │ -46 │ fun test00(): 0x42::m::S { - │ ^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::m::S'. Expected 1 type argument(s) but got 0 - -error[E03018]: invalid type parameter - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:46:26 - │ -46 │ fun test00(): 0x42::m::S { - │ ^^^^^ Cannot use type parameters on a module - -error[E03018]: invalid type parameter - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:47:16 - │ -47 │ 0x42::m::make_s(0u64) - │ ^^^^^ Cannot use type parameters on a module - -error[E03008]: too few type arguments - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:50:19 - │ -50 │ fun test01(): 0x42::m::S { - │ ^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::m::S'. Expected 1 type argument(s) but got 0 - -error[E03018]: invalid type parameter - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:50:23 - │ -50 │ fun test01(): 0x42::m::S { - │ ^^^^^ Cannot use type parameters on an address - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:51:9 - │ -51 │ 0x42::m::make_s(0u64) - │ ^^^^^^^^ - │ │ - │ Invalid argument to '>' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:51:9 - │ -50 │ fun test01(): 0x42::m::S { - │ --------------- Expected: '0x42::m::S<_>' -51 │ 0x42::m::make_s(0u64) - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid return expression - │ Given: 'bool' - -error[E03009]: unbound variable - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:51:14 - │ -51 │ 0x42::m::make_s(0u64) - │ ^^^ Unbound variable 'u64' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:51:18 - │ -51 │ 0x42::m::make_s(0u64) - │ -------- ^^^^^^^^^^^^^^^^^ Invalid argument to '>' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:51:20 - │ -51 │ 0x42::m::make_s(0u64) - │ ^ Could not resolve the name 'm' - -error[E03008]: too few type arguments - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:54:19 - │ -54 │ fun test02(): 0x42::m::S { - │ ^^^^^^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::m::S'. Expected 1 type argument(s) but got 0 - -error[E03018]: invalid type parameter - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:54:23 - │ -54 │ fun test02(): 0x42::m::S { - │ ^^^^^ Cannot use type parameters on an address - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:54:31 - │ -54 │ fun test02(): 0x42::m::S { - │ ----- ^^^^^ Paths cannot include type arguments more than once - │ │ - │ Previous type arguments appeared here - │ - = Type arguments should only appear on module members - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:55:9 - │ -55 │ 0x42::m::make_s(0u64) - │ ^^^^^^^^ - │ │ - │ Invalid argument to '>' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:55:9 - │ -54 │ fun test02(): 0x42::m::S { - │ -------------------- Expected: '0x42::m::S<_>' -55 │ 0x42::m::make_s(0u64) - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid return expression - │ Given: 'bool' - -error[E03009]: unbound variable - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:55:14 - │ -55 │ 0x42::m::make_s(0u64) - │ ^^^ Unbound variable 'u64' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:55:18 - │ -55 │ 0x42::m::make_s(0u64) - │ -------- ^^^^^^^^^^^^^^^^^^^^^^ Invalid argument to '>' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:55:20 - │ -55 │ 0x42::m::make_s(0u64) - │ ^ Could not resolve the name 'm' - -error[E03008]: too few type arguments - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:58:19 - │ -58 │ fun test03(): 0x42::m::S { - │ ^^^^^^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::m::S'. Expected 1 type argument(s) but got 0 - -error[E03018]: invalid type parameter - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:58:26 - │ -58 │ fun test03(): 0x42::m::S { - │ ^^^^^ Cannot use type parameters on a module - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:58:34 - │ -58 │ fun test03(): 0x42::m::S { - │ ----- ^^^^^ Paths cannot include type arguments more than once - │ │ - │ Previous type arguments appeared here - │ - = Type arguments should only appear on module members - -error[E03018]: invalid type parameter - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:59:16 - │ -59 │ 0x42::m::make_s(0u64) - │ ^^^^^ Cannot use type parameters on a module - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:59:29 - │ -59 │ 0x42::m::make_s(0u64) - │ ----- ^^^^^ Paths cannot include type arguments more than once - │ │ - │ Previous type arguments appeared here - │ - = Type arguments should only appear on module members - -error[E03008]: too few type arguments - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:62:19 - │ -62 │ fun test04(): 0x42::m::S { - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::m::S'. Expected 1 type argument(s) but got 0 - -error[E03018]: invalid type parameter - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:62:23 - │ -62 │ fun test04(): 0x42::m::S { - │ ^^^^^ Cannot use type parameters on an address - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:62:31 - │ -62 │ fun test04(): 0x42::m::S { - │ ----- ^^^^^ Paths cannot include type arguments more than once - │ │ - │ Previous type arguments appeared here - │ - = Type arguments should only appear on module members - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:62:39 - │ -62 │ fun test04(): 0x42::m::S { - │ ----- ^^^^^ Paths cannot include type arguments more than once - │ │ - │ Previous type arguments appeared here - │ - = Type arguments should only appear on module members - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:63:9 - │ -63 │ 0x42::m::make_s(0u64) - │ ^^^^^^^^ - │ │ - │ Invalid argument to '>' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:63:9 - │ -62 │ fun test04(): 0x42::m::S { - │ ------------------------- Expected: '0x42::m::S<_>' -63 │ 0x42::m::make_s(0u64) - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid return expression - │ Given: 'bool' - -error[E03009]: unbound variable - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:63:14 - │ -63 │ 0x42::m::make_s(0u64) - │ ^^^ Unbound variable 'u64' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:63:18 - │ -63 │ 0x42::m::make_s(0u64) - │ -------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid argument to '>' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:63:20 - │ -63 │ 0x42::m::make_s(0u64) - │ ^ Could not resolve the name 'm' - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:63:34 - │ -63 │ 0x42::m::make_s(0u64) - │ ----- ^^^^^ Paths cannot include type arguments more than once - │ │ - │ Previous type arguments appeared here - │ - = Type arguments should only appear on module members - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_tyarg_locs.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_tyarg_locs.snap new file mode 100644 index 0000000000000..dc76aa177bd17 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/invalid_tyarg_locs.snap @@ -0,0 +1,429 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/invalid_tyarg_locs.move +--- +error[E03008]: too few type arguments + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:12:19 + │ +12 │ fun test00(): a::m::S { + │ ^^^^^^^^^^^^ Invalid instantiation of 'a::m::S'. Expected 1 type argument(s) but got 0 + +error[E03018]: invalid type parameter + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:12:23 + │ +12 │ fun test00(): a::m::S { + │ ^^^^^ Cannot use type parameters on a module + +error[E03018]: invalid type parameter + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:13:13 + │ +13 │ a::m::make_s(0u64) + │ ^^^^^ Cannot use type parameters on a module + +error[E03008]: too few type arguments + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:16:19 + │ +16 │ fun test01(): a::m::S { + │ ^^^^^^^^^^^^ Invalid instantiation of 'a::m::S'. Expected 1 type argument(s) but got 0 + +error[E03018]: invalid type parameter + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:16:20 + │ +16 │ fun test01(): a::m::S { + │ ^^^^^ Cannot use type parameters on an address + +error[E03018]: invalid type parameter + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:17:10 + │ +17 │ a::m::make_s(0u64) + │ ^^^^^ Cannot use type parameters on an address + +error[E03008]: too few type arguments + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:20:19 + │ +20 │ fun test02(): a::m::S { + │ ^^^^^^^^^^^^^^^^^ Invalid instantiation of 'a::m::S'. Expected 1 type argument(s) but got 0 + +error[E03018]: invalid type parameter + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:20:20 + │ +20 │ fun test02(): a::m::S { + │ ^^^^^ Cannot use type parameters on an address + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:20:28 + │ +20 │ fun test02(): a::m::S { + │ ----- ^^^^^ Paths cannot include type arguments more than once + │ │ + │ Previous type arguments appeared here + │ + = Type arguments should only appear on module members + +error[E03018]: invalid type parameter + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:21:10 + │ +21 │ a::m::make_s(0u64) + │ ^^^^^ Cannot use type parameters on an address + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:21:18 + │ +21 │ a::m::make_s(0u64) + │ ----- ^^^^^ Paths cannot include type arguments more than once + │ │ + │ Previous type arguments appeared here + │ + = Type arguments should only appear on module members + +error[E03008]: too few type arguments + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:24:19 + │ +24 │ fun test03(): a::m::S { + │ ^^^^^^^^^^^^^^^^^ Invalid instantiation of 'a::m::S'. Expected 1 type argument(s) but got 0 + +error[E03018]: invalid type parameter + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:24:23 + │ +24 │ fun test03(): a::m::S { + │ ^^^^^ Cannot use type parameters on a module + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:24:31 + │ +24 │ fun test03(): a::m::S { + │ ----- ^^^^^ Paths cannot include type arguments more than once + │ │ + │ Previous type arguments appeared here + │ + = Type arguments should only appear on module members + +error[E03018]: invalid type parameter + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:25:13 + │ +25 │ a::m::make_s(0u64) + │ ^^^^^ Cannot use type parameters on a module + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:25:26 + │ +25 │ a::m::make_s(0u64) + │ ----- ^^^^^ Paths cannot include type arguments more than once + │ │ + │ Previous type arguments appeared here + │ + = Type arguments should only appear on module members + +error[E03008]: too few type arguments + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:28:19 + │ +28 │ fun test04(): a::m::S { + │ ^^^^^^^^^^^^^^^^^^^^^^ Invalid instantiation of 'a::m::S'. Expected 1 type argument(s) but got 0 + +error[E03018]: invalid type parameter + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:28:20 + │ +28 │ fun test04(): a::m::S { + │ ^^^^^ Cannot use type parameters on an address + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:28:28 + │ +28 │ fun test04(): a::m::S { + │ ----- ^^^^^ Paths cannot include type arguments more than once + │ │ + │ Previous type arguments appeared here + │ + = Type arguments should only appear on module members + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:28:36 + │ +28 │ fun test04(): a::m::S { + │ ----- ^^^^^ Paths cannot include type arguments more than once + │ │ + │ Previous type arguments appeared here + │ + = Type arguments should only appear on module members + +error[E03018]: invalid type parameter + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:29:10 + │ +29 │ a::m::make_s(0u64) + │ ^^^^^ Cannot use type parameters on an address + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:29:18 + │ +29 │ a::m::make_s(0u64) + │ ----- ^^^^^ Paths cannot include type arguments more than once + │ │ + │ Previous type arguments appeared here + │ + = Type arguments should only appear on module members + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:29:31 + │ +29 │ a::m::make_s(0u64) + │ ----- ^^^^^ Paths cannot include type arguments more than once + │ │ + │ Previous type arguments appeared here + │ + = Type arguments should only appear on module members + +error[E03008]: too few type arguments + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:46:19 + │ +46 │ fun test00(): 0x42::m::S { + │ ^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::m::S'. Expected 1 type argument(s) but got 0 + +error[E03018]: invalid type parameter + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:46:26 + │ +46 │ fun test00(): 0x42::m::S { + │ ^^^^^ Cannot use type parameters on a module + +error[E03018]: invalid type parameter + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:47:16 + │ +47 │ 0x42::m::make_s(0u64) + │ ^^^^^ Cannot use type parameters on a module + +error[E03008]: too few type arguments + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:50:19 + │ +50 │ fun test01(): 0x42::m::S { + │ ^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::m::S'. Expected 1 type argument(s) but got 0 + +error[E03018]: invalid type parameter + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:50:23 + │ +50 │ fun test01(): 0x42::m::S { + │ ^^^^^ Cannot use type parameters on an address + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:51:9 + │ +51 │ 0x42::m::make_s(0u64) + │ ^^^^^^^^ + │ │ + │ Invalid argument to '>' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:51:9 + │ +50 │ fun test01(): 0x42::m::S { + │ --------------- Expected: '0x42::m::S<_>' +51 │ 0x42::m::make_s(0u64) + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid return expression + │ Given: 'bool' + +error[E03009]: unbound variable + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:51:14 + │ +51 │ 0x42::m::make_s(0u64) + │ ^^^ Unbound variable 'u64' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:51:18 + │ +51 │ 0x42::m::make_s(0u64) + │ -------- ^^^^^^^^^^^^^^^^^ Invalid argument to '>' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:51:20 + │ +51 │ 0x42::m::make_s(0u64) + │ ^ Could not resolve the name 'm' + +error[E03008]: too few type arguments + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:54:19 + │ +54 │ fun test02(): 0x42::m::S { + │ ^^^^^^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::m::S'. Expected 1 type argument(s) but got 0 + +error[E03018]: invalid type parameter + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:54:23 + │ +54 │ fun test02(): 0x42::m::S { + │ ^^^^^ Cannot use type parameters on an address + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:54:31 + │ +54 │ fun test02(): 0x42::m::S { + │ ----- ^^^^^ Paths cannot include type arguments more than once + │ │ + │ Previous type arguments appeared here + │ + = Type arguments should only appear on module members + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:55:9 + │ +55 │ 0x42::m::make_s(0u64) + │ ^^^^^^^^ + │ │ + │ Invalid argument to '>' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:55:9 + │ +54 │ fun test02(): 0x42::m::S { + │ -------------------- Expected: '0x42::m::S<_>' +55 │ 0x42::m::make_s(0u64) + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid return expression + │ Given: 'bool' + +error[E03009]: unbound variable + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:55:14 + │ +55 │ 0x42::m::make_s(0u64) + │ ^^^ Unbound variable 'u64' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:55:18 + │ +55 │ 0x42::m::make_s(0u64) + │ -------- ^^^^^^^^^^^^^^^^^^^^^^ Invalid argument to '>' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:55:20 + │ +55 │ 0x42::m::make_s(0u64) + │ ^ Could not resolve the name 'm' + +error[E03008]: too few type arguments + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:58:19 + │ +58 │ fun test03(): 0x42::m::S { + │ ^^^^^^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::m::S'. Expected 1 type argument(s) but got 0 + +error[E03018]: invalid type parameter + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:58:26 + │ +58 │ fun test03(): 0x42::m::S { + │ ^^^^^ Cannot use type parameters on a module + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:58:34 + │ +58 │ fun test03(): 0x42::m::S { + │ ----- ^^^^^ Paths cannot include type arguments more than once + │ │ + │ Previous type arguments appeared here + │ + = Type arguments should only appear on module members + +error[E03018]: invalid type parameter + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:59:16 + │ +59 │ 0x42::m::make_s(0u64) + │ ^^^^^ Cannot use type parameters on a module + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:59:29 + │ +59 │ 0x42::m::make_s(0u64) + │ ----- ^^^^^ Paths cannot include type arguments more than once + │ │ + │ Previous type arguments appeared here + │ + = Type arguments should only appear on module members + +error[E03008]: too few type arguments + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:62:19 + │ +62 │ fun test04(): 0x42::m::S { + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::m::S'. Expected 1 type argument(s) but got 0 + +error[E03018]: invalid type parameter + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:62:23 + │ +62 │ fun test04(): 0x42::m::S { + │ ^^^^^ Cannot use type parameters on an address + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:62:31 + │ +62 │ fun test04(): 0x42::m::S { + │ ----- ^^^^^ Paths cannot include type arguments more than once + │ │ + │ Previous type arguments appeared here + │ + = Type arguments should only appear on module members + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:62:39 + │ +62 │ fun test04(): 0x42::m::S { + │ ----- ^^^^^ Paths cannot include type arguments more than once + │ │ + │ Previous type arguments appeared here + │ + = Type arguments should only appear on module members + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:63:9 + │ +63 │ 0x42::m::make_s(0u64) + │ ^^^^^^^^ + │ │ + │ Invalid argument to '>' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:63:9 + │ +62 │ fun test04(): 0x42::m::S { + │ ------------------------- Expected: '0x42::m::S<_>' +63 │ 0x42::m::make_s(0u64) + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid return expression + │ Given: 'bool' + +error[E03009]: unbound variable + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:63:14 + │ +63 │ 0x42::m::make_s(0u64) + │ ^^^ Unbound variable 'u64' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:63:18 + │ +63 │ 0x42::m::make_s(0u64) + │ -------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid argument to '>' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:63:20 + │ +63 │ 0x42::m::make_s(0u64) + │ ^ Could not resolve the name 'm' + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/invalid_tyarg_locs.move:63:34 + │ +63 │ 0x42::m::make_s(0u64) + │ ----- ^^^^^ Paths cannot include type arguments more than once + │ │ + │ Previous type arguments appeared here + │ + = Type arguments should only appear on module members diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_block_given_to_break_return_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_block_given_to_break_return_invalid.exp deleted file mode 100644 index b60b2c31c03f8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_block_given_to_break_return_invalid.exp +++ /dev/null @@ -1,60 +0,0 @@ -error[E03015]: unbound label - ┌─ tests/move_2024/parser/labeled_block_given_to_break_return_invalid.move:4:15 - │ -4 │ break 'a: { 1 }; - │ ^^ Invalid break. Unbound label 'a - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/labeled_block_given_to_break_return_invalid.move:4:17 - │ -4 │ break 'a: { 1 }; - │ ^ - │ │ - │ Unexpected ':' - │ Expected ';' - -error[E03015]: unbound label - ┌─ tests/move_2024/parser/labeled_block_given_to_break_return_invalid.move:8:16 - │ -8 │ return 'a: { 1 }; - │ ^^ Invalid return. Unbound label 'a - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/labeled_block_given_to_break_return_invalid.move:8:18 - │ -8 │ return 'a: { 1 }; - │ ^ - │ │ - │ Unexpected ':' - │ Expected ';' - -error[E03015]: unbound label - ┌─ tests/move_2024/parser/labeled_block_given_to_break_return_invalid.move:12:15 - │ -12 │ break 'a: loop {}; - │ ^^ Invalid break. Unbound label 'a - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/labeled_block_given_to_break_return_invalid.move:12:17 - │ -12 │ break 'a: loop {}; - │ ^ - │ │ - │ Unexpected ':' - │ Expected ';' - -error[E03015]: unbound label - ┌─ tests/move_2024/parser/labeled_block_given_to_break_return_invalid.move:16:16 - │ -16 │ return 'a: while (cond) { 1 }; - │ ^^ Invalid return. Unbound label 'a - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/labeled_block_given_to_break_return_invalid.move:16:18 - │ -16 │ return 'a: while (cond) { 1 }; - │ ^ - │ │ - │ Unexpected ':' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_block_given_to_break_return_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_block_given_to_break_return_invalid.snap new file mode 100644 index 0000000000000..57e605896368e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_block_given_to_break_return_invalid.snap @@ -0,0 +1,67 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/labeled_block_given_to_break_return_invalid.move +--- +error[E03015]: unbound label + ┌─ tests/move_2024/parser/labeled_block_given_to_break_return_invalid.move:4:15 + │ +4 │ break 'a: { 1 }; + │ ^^ Invalid break. Unbound label 'a + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/labeled_block_given_to_break_return_invalid.move:4:17 + │ +4 │ break 'a: { 1 }; + │ ^ + │ │ + │ Unexpected ':' + │ Expected ';' + +error[E03015]: unbound label + ┌─ tests/move_2024/parser/labeled_block_given_to_break_return_invalid.move:8:16 + │ +8 │ return 'a: { 1 }; + │ ^^ Invalid return. Unbound label 'a + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/labeled_block_given_to_break_return_invalid.move:8:18 + │ +8 │ return 'a: { 1 }; + │ ^ + │ │ + │ Unexpected ':' + │ Expected ';' + +error[E03015]: unbound label + ┌─ tests/move_2024/parser/labeled_block_given_to_break_return_invalid.move:12:15 + │ +12 │ break 'a: loop {}; + │ ^^ Invalid break. Unbound label 'a + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/labeled_block_given_to_break_return_invalid.move:12:17 + │ +12 │ break 'a: loop {}; + │ ^ + │ │ + │ Unexpected ':' + │ Expected ';' + +error[E03015]: unbound label + ┌─ tests/move_2024/parser/labeled_block_given_to_break_return_invalid.move:16:16 + │ +16 │ return 'a: while (cond) { 1 }; + │ ^^ Invalid return. Unbound label 'a + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/labeled_block_given_to_break_return_invalid.move:16:18 + │ +16 │ return 'a: while (cond) { 1 }; + │ ^ + │ │ + │ Unexpected ':' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_block_given_to_break_return_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_block_given_to_break_return_valid.snap new file mode 100644 index 0000000000000..358b836094d64 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_block_given_to_break_return_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/labeled_block_given_to_break_return_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_as_term.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_as_term.snap new file mode 100644 index 0000000000000..1f83f3e808d8c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_as_term.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/labeled_control_exp_as_term.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity.snap new file mode 100644 index 0000000000000..c518b22b82743 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_else_after_if_block.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_else_after_if_block.exp deleted file mode 100644 index 6132dd17b75fe..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_else_after_if_block.exp +++ /dev/null @@ -1,37 +0,0 @@ -error[E04005]: expected a single type - ┌─ tests/move_2024/parser/labeled_control_exp_associativity_else_after_if_block.move:13:9 - │ -13 │ if (cond) 'a: { s1 }.f else s2.f - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid dot access - │ Expected a single type, but found expression list type: '()' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/labeled_control_exp_associativity_else_after_if_block.move:13:9 - │ -13 │ if (cond) 'a: { s1 }.f else s2.f - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: '0x42::M::S' - │ Invalid 'if'. The body of an 'if' without an 'else' must have type '()' - │ Expected: '()' - -error[E04009]: expected specific type - ┌─ tests/move_2024/parser/labeled_control_exp_associativity_else_after_if_block.move:13:9 - │ -13 │ if (cond) 'a: { s1 }.f else s2.f - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Unbound field 'f' - │ Expected a struct type in the current module but got: '()' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/labeled_control_exp_associativity_else_after_if_block.move:13:32 - │ -13 │ if (cond) 'a: { s1 }.f else s2.f - │ ^^^^ - │ │ - │ Unexpected 'else' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_else_after_if_block.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_else_after_if_block.snap new file mode 100644 index 0000000000000..fa676f12972cd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_else_after_if_block.snap @@ -0,0 +1,44 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_else_after_if_block.move +--- +error[E04005]: expected a single type + ┌─ tests/move_2024/parser/labeled_control_exp_associativity_else_after_if_block.move:13:9 + │ +13 │ if (cond) 'a: { s1 }.f else s2.f + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid dot access + │ Expected a single type, but found expression list type: '()' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/labeled_control_exp_associativity_else_after_if_block.move:13:9 + │ +13 │ if (cond) 'a: { s1 }.f else s2.f + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: '0x42::M::S' + │ Invalid 'if'. The body of an 'if' without an 'else' must have type '()' + │ Expected: '()' + +error[E04009]: expected specific type + ┌─ tests/move_2024/parser/labeled_control_exp_associativity_else_after_if_block.move:13:9 + │ +13 │ if (cond) 'a: { s1 }.f else s2.f + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Unbound field 'f' + │ Expected a struct type in the current module but got: '()' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/labeled_control_exp_associativity_else_after_if_block.move:13:32 + │ +13 │ if (cond) 'a: { s1 }.f else s2.f + │ ^^^^ + │ │ + │ Unexpected 'else' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_field_access.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_field_access.snap new file mode 100644 index 0000000000000..e3f7089b434a7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_field_access.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_field_access.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.exp deleted file mode 100644 index c97e100134719..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.exp +++ /dev/null @@ -1,124 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:12:9 - │ - 7 │ fun bar(): u64 { 0 } - │ --- Given: 'u64' - · -12 │ if (cond) bar() + 1; - │ ^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid 'if'. The body of an 'if' without an 'else' must have type '()' - │ Expected: '()' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:15:9 - │ -15 │ if (cond) 'a: { foo() } + 1; - │ ^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid argument to '+' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:15:33 - │ -15 │ if (cond) 'a: { foo() } + 1; - │ ----------------------- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '+' - │ Found: '()'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:15:35 - │ -15 │ if (cond) 'a: { foo() } + 1; - │ ----------------------- ^ Invalid argument to '+' - │ │ - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:19:26 - │ - 7 │ fun bar(): u64 { 0 } - │ --- Given: 'u64' - · -19 │ 'a: while (cond) bar() + 2; - │ ^^^^^^^^^ - │ │ - │ Invalid loop body - │ Expected: '()' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:22:9 - │ -22 │ 'a: while (cond) { foo() } + 2; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid argument to '+' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:22:36 - │ -22 │ 'a: while (cond) { foo() } + 2; - │ -------------------------- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '+' - │ Found: '()'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:22:38 - │ -22 │ 'a: while (cond) { foo() } + 2; - │ -------------------------- ^ Invalid argument to '+' - │ │ - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:23:9 - │ -23 │ while (cond) 'a: { return 'a foo() } + 2; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid argument to '+' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:23:46 - │ -23 │ while (cond) 'a: { return 'a foo() } + 2; - │ ------------------------------------ ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '+' - │ Found: '()'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:23:48 - │ -23 │ while (cond) 'a: { return 'a foo() } + 2; - │ ------------------------------------ ^ Invalid argument to '+' - │ │ - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:27:18 - │ - 7 │ fun bar(): u64 { 0 } - │ --- Given: 'u64' - · -27 │ 'a: loop bar() + 2; - │ ^^^^^^^^^ - │ │ - │ Invalid loop body - │ Expected: '()' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:32:27 - │ -32 │ let _: u64 = loop 'a: { return 'a 0 } + 1; - │ ^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid loop body - │ Expected: '()' - │ Given: integer - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.snap new file mode 100644 index 0000000000000..b6c3b1e1107a1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.snap @@ -0,0 +1,131 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:12:9 + │ + 7 │ fun bar(): u64 { 0 } + │ --- Given: 'u64' + · +12 │ if (cond) bar() + 1; + │ ^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid 'if'. The body of an 'if' without an 'else' must have type '()' + │ Expected: '()' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:15:9 + │ +15 │ if (cond) 'a: { foo() } + 1; + │ ^^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid argument to '+' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:15:33 + │ +15 │ if (cond) 'a: { foo() } + 1; + │ ----------------------- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '+' + │ Found: '()'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:15:35 + │ +15 │ if (cond) 'a: { foo() } + 1; + │ ----------------------- ^ Invalid argument to '+' + │ │ + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:19:26 + │ + 7 │ fun bar(): u64 { 0 } + │ --- Given: 'u64' + · +19 │ 'a: while (cond) bar() + 2; + │ ^^^^^^^^^ + │ │ + │ Invalid loop body + │ Expected: '()' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:22:9 + │ +22 │ 'a: while (cond) { foo() } + 2; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid argument to '+' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:22:36 + │ +22 │ 'a: while (cond) { foo() } + 2; + │ -------------------------- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '+' + │ Found: '()'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:22:38 + │ +22 │ 'a: while (cond) { foo() } + 2; + │ -------------------------- ^ Invalid argument to '+' + │ │ + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:23:9 + │ +23 │ while (cond) 'a: { return 'a foo() } + 2; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid argument to '+' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:23:46 + │ +23 │ while (cond) 'a: { return 'a foo() } + 2; + │ ------------------------------------ ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '+' + │ Found: '()'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:23:48 + │ +23 │ while (cond) 'a: { return 'a foo() } + 2; + │ ------------------------------------ ^ Invalid argument to '+' + │ │ + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:27:18 + │ + 7 │ fun bar(): u64 { 0 } + │ --- Given: 'u64' + · +27 │ 'a: loop bar() + 2; + │ ^^^^^^^^^ + │ │ + │ Invalid loop body + │ Expected: '()' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/labeled_control_exp_associativity_typing_invalid.move:32:27 + │ +32 │ let _: u64 = loop 'a: { return 'a 0 } + 1; + │ ^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid loop body + │ Expected: '()' + │ Given: integer diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_typing_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_typing_valid.snap new file mode 100644 index 0000000000000..76011d406c797 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_typing_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_typing_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_unreachable_code.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_unreachable_code.exp deleted file mode 100644 index cfa3dece29ed5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_unreachable_code.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/parser/labeled_control_exp_associativity_unreachable_code.move:11:13 - │ -11 │ 1 + 'a: loop { foo() } + 2; - │ ^^^^^^^^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_unreachable_code.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_unreachable_code.snap new file mode 100644 index 0000000000000..405896f7b3b5e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_unreachable_code.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/labeled_control_exp_associativity_unreachable_code.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/parser/labeled_control_exp_associativity_unreachable_code.move:11:13 + │ +11 │ 1 + 'a: loop { foo() } + 2; + │ ^^^^^^^^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_lambda_body.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_lambda_body.snap new file mode 100644 index 0000000000000..08bbc3464a6af --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_lambda_body.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/labeled_lambda_body.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_lambda_body_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_lambda_body_invalid.exp deleted file mode 100644 index 2730857b45b00..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_lambda_body_invalid.exp +++ /dev/null @@ -1,66 +0,0 @@ -error[E04016]: too few arguments - ┌─ tests/move_2024/parser/labeled_lambda_body_invalid.move:7:9 - │ -7 │ call!(|x| -> u64 'a: 0); // parsing error needs a block - │ ^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 0 argument(s) here - │ Invalid call of 'a::m::call'. The call expected 1 argument(s) but got 0 - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/parser/labeled_lambda_body_invalid.move:7:9 - │ -7 │ call!(|x| -> u64 'a: 0); // parsing error needs a block - │ ^^^^^^^^^^^^^^^^^^^^^^^ Unable to bind lambda to parameter '$f'. The lambda must be passed directly - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/labeled_lambda_body_invalid.move:7:30 - │ -7 │ call!(|x| -> u64 'a: 0); // parsing error needs a block - │ ^ - │ │ - │ Unexpected '0' - │ Expected '{' - -error[E04016]: too few arguments - ┌─ tests/move_2024/parser/labeled_lambda_body_invalid.move:11:9 - │ -11 │ call!(|x| -> u64 'a: loop { break 'a 0 }); // parsing error needs a block - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 0 argument(s) here - │ Invalid call of 'a::m::call'. The call expected 1 argument(s) but got 0 - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/parser/labeled_lambda_body_invalid.move:11:9 - │ -11 │ call!(|x| -> u64 'a: loop { break 'a 0 }); // parsing error needs a block - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Unable to bind lambda to parameter '$f'. The lambda must be passed directly - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/labeled_lambda_body_invalid.move:11:30 - │ -11 │ call!(|x| -> u64 'a: loop { break 'a 0 }); // parsing error needs a block - │ ^^^^ - │ │ - │ Unexpected 'loop' - │ Expected '{' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/labeled_lambda_body_invalid.move:15:46 - │ -15 │ call!(|x| -> u64 'a: { return 'a x } + 1); // parsing error, lambdas cant appear in binop - │ ^ - │ │ - │ Unexpected '+' - │ Expected ',' or ')' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/labeled_lambda_body_invalid.move:19:32 - │ -19 │ call!(|x| -> u64 { x } + 1); // parsing error, lambdas cant appear in binop - │ ^ - │ │ - │ Unexpected '+' - │ Expected ',' or ')' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_lambda_body_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_lambda_body_invalid.snap new file mode 100644 index 0000000000000..3504c69d646ac --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/labeled_lambda_body_invalid.snap @@ -0,0 +1,73 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/labeled_lambda_body_invalid.move +--- +error[E04016]: too few arguments + ┌─ tests/move_2024/parser/labeled_lambda_body_invalid.move:7:9 + │ +7 │ call!(|x| -> u64 'a: 0); // parsing error needs a block + │ ^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 0 argument(s) here + │ Invalid call of 'a::m::call'. The call expected 1 argument(s) but got 0 + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/parser/labeled_lambda_body_invalid.move:7:9 + │ +7 │ call!(|x| -> u64 'a: 0); // parsing error needs a block + │ ^^^^^^^^^^^^^^^^^^^^^^^ Unable to bind lambda to parameter '$f'. The lambda must be passed directly + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/labeled_lambda_body_invalid.move:7:30 + │ +7 │ call!(|x| -> u64 'a: 0); // parsing error needs a block + │ ^ + │ │ + │ Unexpected '0' + │ Expected '{' + +error[E04016]: too few arguments + ┌─ tests/move_2024/parser/labeled_lambda_body_invalid.move:11:9 + │ +11 │ call!(|x| -> u64 'a: loop { break 'a 0 }); // parsing error needs a block + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 0 argument(s) here + │ Invalid call of 'a::m::call'. The call expected 1 argument(s) but got 0 + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/parser/labeled_lambda_body_invalid.move:11:9 + │ +11 │ call!(|x| -> u64 'a: loop { break 'a 0 }); // parsing error needs a block + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Unable to bind lambda to parameter '$f'. The lambda must be passed directly + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/labeled_lambda_body_invalid.move:11:30 + │ +11 │ call!(|x| -> u64 'a: loop { break 'a 0 }); // parsing error needs a block + │ ^^^^ + │ │ + │ Unexpected 'loop' + │ Expected '{' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/labeled_lambda_body_invalid.move:15:46 + │ +15 │ call!(|x| -> u64 'a: { return 'a x } + 1); // parsing error, lambdas cant appear in binop + │ ^ + │ │ + │ Unexpected '+' + │ Expected ',' or ')' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/labeled_lambda_body_invalid.move:19:32 + │ +19 │ call!(|x| -> u64 { x } + 1); // parsing error, lambdas cant appear in binop + │ ^ + │ │ + │ Unexpected '+' + │ Expected ',' or ')' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/lambda_expression_return_type.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/lambda_expression_return_type.snap new file mode 100644 index 0000000000000..7166c9fcc6f52 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/lambda_expression_return_type.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/lambda_expression_return_type.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/lambda_expression_return_type_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/lambda_expression_return_type_invalid.exp deleted file mode 100644 index eaf18607cc58d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/lambda_expression_return_type_invalid.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E04016]: too few arguments - ┌─ tests/move_2024/parser/lambda_expression_return_type_invalid.move:7:9 - │ -7 │ call!(|| -> u64 0); - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 0 argument(s) here - │ Invalid call of 'a::m::call'. The call expected 1 argument(s) but got 0 - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/parser/lambda_expression_return_type_invalid.move:7:9 - │ -7 │ call!(|| -> u64 0); - │ ^^^^^^^^^^^^^^^^^^ Unable to bind lambda to parameter '$f'. The lambda must be passed directly - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/lambda_expression_return_type_invalid.move:7:25 - │ -7 │ call!(|| -> u64 0); - │ ^ - │ │ - │ Unexpected '0' - │ Expected '{' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/lambda_expression_return_type_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/lambda_expression_return_type_invalid.snap new file mode 100644 index 0000000000000..604e9ffdd676c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/lambda_expression_return_type_invalid.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/lambda_expression_return_type_invalid.move +--- +error[E04016]: too few arguments + ┌─ tests/move_2024/parser/lambda_expression_return_type_invalid.move:7:9 + │ +7 │ call!(|| -> u64 0); + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 0 argument(s) here + │ Invalid call of 'a::m::call'. The call expected 1 argument(s) but got 0 + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/parser/lambda_expression_return_type_invalid.move:7:9 + │ +7 │ call!(|| -> u64 0); + │ ^^^^^^^^^^^^^^^^^^ Unable to bind lambda to parameter '$f'. The lambda must be passed directly + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/lambda_expression_return_type_invalid.move:7:25 + │ +7 │ call!(|| -> u64 0); + │ ^ + │ │ + │ Unexpected '0' + │ Expected '{' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/lambda_expression_return_type_named_block.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/lambda_expression_return_type_named_block.snap new file mode 100644 index 0000000000000..c215fcb1864c2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/lambda_expression_return_type_named_block.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/lambda_expression_return_type_named_block.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/lambda_lvalue.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/lambda_lvalue.snap new file mode 100644 index 0000000000000..0a7d714f14144 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/lambda_lvalue.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/lambda_lvalue.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/lambda_lvalue_with_types.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/lambda_lvalue_with_types.snap new file mode 100644 index 0000000000000..3ec9cf7b8e4f5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/lambda_lvalue_with_types.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/lambda_lvalue_with_types.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/long_path.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/long_path.exp deleted file mode 100644 index 0dbd2aa5175ab..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/long_path.exp +++ /dev/null @@ -1,33 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/parser/long_path.move:7:26 - │ -7 │ public struct A { y: 0x42::m::X::Y } - │ ^^^^^^^^^^^^^ Unexpected enum variant identifier. An enum variant identifier is not a valid type - │ - = Variants may not be used as types. Use the enum instead. - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/parser/long_path.move:8:26 - │ -8 │ public struct B { x: 0x42::m::X::X } - │ ^^^^^^^^^^^^^ Unexpected enum variant identifier. An enum variant identifier is not a valid type - │ - = Variants may not be used as types. Use the enum instead. - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/parser/long_path.move:10:27 - │ -10 │ fun foo(): 0x42::m::X<042::m::Y::Y> { - │ ^^^^^^^^^^^^ Unexpected enum variant identifier. An enum variant identifier is not a valid type - │ - = Variants may not be used as types. Use the enum instead. - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/parser/long_path.move:11:9 - │ - 2 │ public struct X { t: T } - │ - But 'X' is an struct - · -11 │ 0x42::m::X::X { t: abort 0 } - │ ^^^^^^^^^^ Invalid construction. Expected an enum - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/long_path.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/long_path.snap new file mode 100644 index 0000000000000..cedc7701329b0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/long_path.snap @@ -0,0 +1,40 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/long_path.move +--- +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/parser/long_path.move:7:26 + │ +7 │ public struct A { y: 0x42::m::X::Y } + │ ^^^^^^^^^^^^^ Unexpected enum variant identifier. An enum variant identifier is not a valid type + │ + = Variants may not be used as types. Use the enum instead. + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/parser/long_path.move:8:26 + │ +8 │ public struct B { x: 0x42::m::X::X } + │ ^^^^^^^^^^^^^ Unexpected enum variant identifier. An enum variant identifier is not a valid type + │ + = Variants may not be used as types. Use the enum instead. + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/parser/long_path.move:10:27 + │ +10 │ fun foo(): 0x42::m::X<042::m::Y::Y> { + │ ^^^^^^^^^^^^ Unexpected enum variant identifier. An enum variant identifier is not a valid type + │ + = Variants may not be used as types. Use the enum instead. + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/parser/long_path.move:11:9 + │ + 2 │ public struct X { t: T } + │ - But 'X' is an struct + · +11 │ 0x42::m::X::X { t: abort 0 } + │ ^^^^^^^^^^ Invalid construction. Expected an enum diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/macro_identifier_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/macro_identifier_invalid.exp deleted file mode 100644 index c58ac0acb608d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/macro_identifier_invalid.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/macro_identifier_invalid.move:2:19 - │ -2 │ macro fun foo($0: u64) { - │ ^ Expected an identifier following '$', e.g. '$x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/macro_identifier_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/macro_identifier_invalid.snap new file mode 100644 index 0000000000000..023bac440cd81 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/macro_identifier_invalid.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/macro_identifier_invalid.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/macro_identifier_invalid.move:2:19 + │ +2 │ macro fun foo($0: u64) { + │ ^ Expected an identifier following '$', e.g. '$x' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/macro_identifier_invalid_no_following_characters.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/macro_identifier_invalid_no_following_characters.exp deleted file mode 100644 index b903821dfa902..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/macro_identifier_invalid_no_following_characters.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/macro_identifier_invalid_no_following_characters.move:2:19 - │ -2 │ macro fun foo($ - │ ^ Expected an identifier following '$', e.g. '$x' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/macro_identifier_invalid_no_following_characters.move:3:1 - │ -3 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected '{' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/macro_identifier_invalid_no_following_characters.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/macro_identifier_invalid_no_following_characters.snap new file mode 100644 index 0000000000000..830048574b46d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/macro_identifier_invalid_no_following_characters.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/macro_identifier_invalid_no_following_characters.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/macro_identifier_invalid_no_following_characters.move:2:19 + │ +2 │ macro fun foo($ + │ ^ Expected an identifier following '$', e.g. '$x' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/macro_identifier_invalid_no_following_characters.move:3:1 + │ +3 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected '{' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/match.snap new file mode 100644 index 0000000000000..9886938fa1b91 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/match.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/match.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/match_keyword.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/match_keyword.exp deleted file mode 100644 index 74b5be3773c28..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/match_keyword.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/match_keyword.move:2:9 - │ -2 │ fun match(_: u64): bool { false } - │ ^^^^^ - │ │ - │ Unexpected 'match' - │ Expected an identifier - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/match_keyword.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/match_keyword.snap new file mode 100644 index 0000000000000..98f5d338ece2e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/match_keyword.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/match_keyword.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/match_keyword.move:2:9 + │ +2 │ fun match(_: u64): bool { false } + │ ^^^^^ + │ │ + │ Unexpected 'match' + │ Expected an identifier diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_field_pun_invalid_assign.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_field_pun_invalid_assign.exp deleted file mode 100644 index 912691a866ff3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_field_pun_invalid_assign.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E04016]: too few arguments - ┌─ tests/move_2024/parser/mut_field_pun_invalid_assign.move:6:9 - │ -6 │ S { mut f } = s; - │ ^^^^^^^^^^^ Missing assignment for field 'f' in 'a::m::S' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/mut_field_pun_invalid_assign.move:6:13 - │ -6 │ S { mut f } = s; - │ ^ Unexpected 'mut'. Expected a field expression - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_field_pun_invalid_assign.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_field_pun_invalid_assign.snap new file mode 100644 index 0000000000000..ef7bc108ecf6e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_field_pun_invalid_assign.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/mut_field_pun_invalid_assign.move +--- +error[E04016]: too few arguments + ┌─ tests/move_2024/parser/mut_field_pun_invalid_assign.move:6:9 + │ +6 │ S { mut f } = s; + │ ^^^^^^^^^^^ Missing assignment for field 'f' in 'a::m::S' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/mut_field_pun_invalid_assign.move:6:13 + │ +6 │ S { mut f } = s; + │ ^ Unexpected 'mut'. Expected a field expression diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_field_pun_invalid_pack.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_field_pun_invalid_pack.exp deleted file mode 100644 index 3e0386ef28920..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_field_pun_invalid_pack.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E04016]: too few arguments - ┌─ tests/move_2024/parser/mut_field_pun_invalid_pack.move:6:9 - │ -6 │ S { mut f } - │ ^^^^^^^^^^^ Missing argument for field 'f' in 'a::m::S' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/mut_field_pun_invalid_pack.move:6:13 - │ -6 │ S { mut f } - │ ^ Unexpected 'mut'. Expected a field expression - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_field_pun_invalid_pack.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_field_pun_invalid_pack.snap new file mode 100644 index 0000000000000..2b23cee6df376 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_field_pun_invalid_pack.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/mut_field_pun_invalid_pack.move +--- +error[E04016]: too few arguments + ┌─ tests/move_2024/parser/mut_field_pun_invalid_pack.move:6:9 + │ +6 │ S { mut f } + │ ^^^^^^^^^^^ Missing argument for field 'f' in 'a::m::S' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/mut_field_pun_invalid_pack.move:6:13 + │ +6 │ S { mut f } + │ ^ Unexpected 'mut'. Expected a field expression diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_field_pun_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_field_pun_valid.snap new file mode 100644 index 0000000000000..a2258c141abe0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_field_pun_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/mut_field_pun_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_keyword.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_keyword.exp deleted file mode 100644 index 718456cd9958e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_keyword.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/mut_keyword.move:5:23 - │ -5 │ public fun foo(mut: &mut u64): &mut u64 { - │ ^ - │ │ - │ Unexpected ':' - │ Expected an identifier - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/mut_keyword.move:6:9 - │ -6 │ mut - │ ^^^ - │ │ - │ Unexpected 'mut' - │ Expected an expression term - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_keyword.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_keyword.snap new file mode 100644 index 0000000000000..43a2377737955 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_keyword.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/mut_keyword.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/mut_keyword.move:5:23 + │ +5 │ public fun foo(mut: &mut u64): &mut u64 { + │ ^ + │ │ + │ Unexpected ':' + │ Expected an identifier + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/mut_keyword.move:6:9 + │ +6 │ mut + │ ^^^ + │ │ + │ Unexpected 'mut' + │ Expected an expression term diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_match.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_match.exp deleted file mode 100644 index 19b8a36d96ab3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_match.exp +++ /dev/null @@ -1,10 +0,0 @@ -warning[W09012]: unused 'mut' modifiers - ┌─ tests/move_2024/parser/mut_match.move:11:30 - │ -11 │ Option::Other { mut x } => x, - │ --- ^ The variable 'x' is never used mutably - │ │ - │ Consider removing the 'mut' declaration here - │ - = This warning can be suppressed with '#[allow(unused_let_mut)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_match.snap new file mode 100644 index 0000000000000..1bb4c8369b210 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_match.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/mut_match.move +--- +warning[W09012]: unused 'mut' modifiers + ┌─ tests/move_2024/parser/mut_match.move:11:30 + │ +11 │ Option::Other { mut x } => x, + │ --- ^ The variable 'x' is never used mutably + │ │ + │ Consider removing the 'mut' declaration here + │ + = This warning can be suppressed with '#[allow(unused_let_mut)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_space.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_space.snap new file mode 100644 index 0000000000000..daf56bde5969b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/mut_space.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/mut_space.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_blocks.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_blocks.snap new file mode 100644 index 0000000000000..93cebced160f9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_blocks.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/named_blocks.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_blocks_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_blocks_invalid.exp deleted file mode 100644 index 3a662550b49a2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_blocks_invalid.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E03009]: unbound variable - ┌─ tests/move_2024/parser/named_blocks_invalid.move:4:9 - │ -4 │ name: { - │ ^^^^ Unbound variable 'name' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/named_blocks_invalid.move:4:13 - │ -4 │ name: { - │ ^ - │ │ - │ Unexpected ':' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_blocks_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_blocks_invalid.snap new file mode 100644 index 0000000000000..1e570e4ddf8ea --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_blocks_invalid.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/named_blocks_invalid.move +--- +error[E03009]: unbound variable + ┌─ tests/move_2024/parser/named_blocks_invalid.move:4:9 + │ +4 │ name: { + │ ^^^^ Unbound variable 'name' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/named_blocks_invalid.move:4:13 + │ +4 │ name: { + │ ^ + │ │ + │ Unexpected ':' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_blocks_invalid_2.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_blocks_invalid_2.exp deleted file mode 100644 index 1010cc8012ba1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_blocks_invalid_2.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/named_blocks_invalid_2.move:4:15 - │ -4 │ 'name { - │ ^ - │ │ - │ Unexpected '{' - │ Expected ':' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_blocks_invalid_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_blocks_invalid_2.snap new file mode 100644 index 0000000000000..686036a210ea6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_blocks_invalid_2.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/named_blocks_invalid_2.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/named_blocks_invalid_2.move:4:15 + │ +4 │ 'name { + │ ^ + │ │ + │ Unexpected '{' + │ Expected ':' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_struct_with_positional_fields.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_struct_with_positional_fields.exp deleted file mode 100644 index 6086ecd38b8db..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_struct_with_positional_fields.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/named_struct_with_positional_fields.move:3:26 - │ -3 │ public struct Foo{u64, u16} has copy, drop; - │ ^ - │ │ - │ Unexpected ',' - │ Expected ':' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/named_struct_with_positional_fields.move:3:31 - │ -3 │ public struct Foo{u64, u16} has copy, drop; - │ ^ - │ │ - │ Unexpected '}' - │ Expected ':' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_struct_with_positional_fields.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_struct_with_positional_fields.snap new file mode 100644 index 0000000000000..aea1b21411734 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/named_struct_with_positional_fields.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/named_struct_with_positional_fields.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/named_struct_with_positional_fields.move:3:26 + │ +3 │ public struct Foo{u64, u16} has copy, drop; + │ ^ + │ │ + │ Unexpected ',' + │ Expected ':' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/named_struct_with_positional_fields.move:3:31 + │ +3 │ public struct Foo{u64, u16} has copy, drop; + │ ^ + │ │ + │ Unexpected '}' + │ Expected ':' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/new_keywords_restricted_ident.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/new_keywords_restricted_ident.snap new file mode 100644 index 0000000000000..65f8c5e8c6705 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/new_keywords_restricted_ident.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/new_keywords_restricted_ident.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/path_usage.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/path_usage.exp deleted file mode 100644 index 0ede17edc4272..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/path_usage.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04027]: invalid 'move' usage - ┌─ tests/move_2024/parser/path_usage.move:16:9 - │ -16 │ move x.y.z; - │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/path_usage.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/path_usage.snap new file mode 100644 index 0000000000000..ffb392a4bd16a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/path_usage.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/path_usage.move +--- +error[E04027]: invalid 'move' usage + ┌─ tests/move_2024/parser/path_usage.move:16:9 + │ +16 │ move x.y.z; + │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/pattern_ellipsis.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/pattern_ellipsis.snap new file mode 100644 index 0000000000000..d14c7abec8261 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/pattern_ellipsis.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/pattern_ellipsis.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/pattern_ellipsis_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/pattern_ellipsis_invalid.exp deleted file mode 100644 index 0de9d7dae4c02..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/pattern_ellipsis_invalid.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/parser/pattern_ellipsis_invalid.move:9:16 - │ -9 │ match (x) { - │ ^ Pattern '_' not covered - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/pattern_ellipsis_invalid.move:10:13 - │ -10 │ .. - │ ^ Unexpected '..'. Expected a call argument expression - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/pattern_ellipsis_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/pattern_ellipsis_invalid.snap new file mode 100644 index 0000000000000..56d3529d2d43a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/pattern_ellipsis_invalid.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/pattern_ellipsis_invalid.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/parser/pattern_ellipsis_invalid.move:9:16 + │ +9 │ match (x) { + │ ^ Pattern '_' not covered + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/pattern_ellipsis_invalid.move:10:13 + │ +10 │ .. + │ ^ Unexpected '..'. Expected a call argument expression diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_field_access.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_field_access.exp deleted file mode 100644 index 933db15beef82..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_field_access.exp +++ /dev/null @@ -1,40 +0,0 @@ -error[E03010]: unbound field - ┌─ tests/move_2024/parser/positional_field_access.move:25:9 - │ -25 │ y.0x0 + y.0xff - │ ^^^^^ Unbound field '0x0' in '0x42::M::Foo' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/positional_field_access.move:25:11 - │ -25 │ y.0x0 + y.0xff - │ ^^^ Invalid field access. Expected a decimal number but was given a hexadecimal - │ - = Positional fields must be a decimal number in the range [0 .. 255] and not be typed, e.g. `0` - -error[E03010]: unbound field - ┌─ tests/move_2024/parser/positional_field_access.move:25:17 - │ -25 │ y.0x0 + y.0xff - │ ^^^^^^ Unbound field '0xff' in '0x42::M::Foo' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/positional_field_access.move:25:19 - │ -25 │ y.0x0 + y.0xff - │ ^^^^ Invalid field access. Expected a decimal number but was given a hexadecimal - │ - = Positional fields must be a decimal number in the range [0 .. 255] and not be typed, e.g. `0` - -error[E03010]: unbound field - ┌─ tests/move_2024/parser/positional_field_access.move:29:9 - │ -29 │ y.1_0 + y.1_0_0 - │ ^^^^^ Unbound field '10' in '0x42::M::Foo' - -error[E03010]: unbound field - ┌─ tests/move_2024/parser/positional_field_access.move:29:17 - │ -29 │ y.1_0 + y.1_0_0 - │ ^^^^^^^ Unbound field '100' in '0x42::M::Foo' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_field_access.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_field_access.snap new file mode 100644 index 0000000000000..c9859a68a2e54 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_field_access.snap @@ -0,0 +1,47 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/positional_field_access.move +--- +error[E03010]: unbound field + ┌─ tests/move_2024/parser/positional_field_access.move:25:9 + │ +25 │ y.0x0 + y.0xff + │ ^^^^^ Unbound field '0x0' in '0x42::M::Foo' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/positional_field_access.move:25:11 + │ +25 │ y.0x0 + y.0xff + │ ^^^ Invalid field access. Expected a decimal number but was given a hexadecimal + │ + = Positional fields must be a decimal number in the range [0 .. 255] and not be typed, e.g. `0` + +error[E03010]: unbound field + ┌─ tests/move_2024/parser/positional_field_access.move:25:17 + │ +25 │ y.0x0 + y.0xff + │ ^^^^^^ Unbound field '0xff' in '0x42::M::Foo' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/positional_field_access.move:25:19 + │ +25 │ y.0x0 + y.0xff + │ ^^^^ Invalid field access. Expected a decimal number but was given a hexadecimal + │ + = Positional fields must be a decimal number in the range [0 .. 255] and not be typed, e.g. `0` + +error[E03010]: unbound field + ┌─ tests/move_2024/parser/positional_field_access.move:29:9 + │ +29 │ y.1_0 + y.1_0_0 + │ ^^^^^ Unbound field '10' in '0x42::M::Foo' + +error[E03010]: unbound field + ┌─ tests/move_2024/parser/positional_field_access.move:29:17 + │ +29 │ y.1_0 + y.1_0_0 + │ ^^^^^^^ Unbound field '100' in '0x42::M::Foo' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_field_access_greater_than_u8_max.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_field_access_greater_than_u8_max.exp deleted file mode 100644 index 0955fc79e710e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_field_access_greater_than_u8_max.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E03010]: unbound field - ┌─ tests/move_2024/parser/positional_field_access_greater_than_u8_max.move:5:9 - │ -5 │ y.256 - │ ^^^^^ Unbound field '256' in '0x42::M::Foo' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/positional_field_access_greater_than_u8_max.move:5:11 - │ -5 │ y.256 - │ ^^^ Invalid field access. Expected a number less than or equal to 255 - │ - = Positional fields must be a decimal number in the range [0 .. 255] and not be typed, e.g. `0` - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_field_access_greater_than_u8_max.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_field_access_greater_than_u8_max.snap new file mode 100644 index 0000000000000..4295703046ac1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_field_access_greater_than_u8_max.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/positional_field_access_greater_than_u8_max.move +--- +error[E03010]: unbound field + ┌─ tests/move_2024/parser/positional_field_access_greater_than_u8_max.move:5:9 + │ +5 │ y.256 + │ ^^^^^ Unbound field '256' in '0x42::M::Foo' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/positional_field_access_greater_than_u8_max.move:5:11 + │ +5 │ y.256 + │ ^^^ Invalid field access. Expected a number less than or equal to 255 + │ + = Positional fields must be a decimal number in the range [0 .. 255] and not be typed, e.g. `0` diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_field_access_no_annotations.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_field_access_no_annotations.exp deleted file mode 100644 index 28c30cd3aeebd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_field_access_no_annotations.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E03010]: unbound field - ┌─ tests/move_2024/parser/positional_field_access_no_annotations.move:5:9 - │ -5 │ y.0_u8 - │ ^^^^^^ Unbound field '0_u8' in '0x42::M::Foo' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/positional_field_access_no_annotations.move:5:11 - │ -5 │ y.0_u8 - │ ^^^^ Invalid field access. Expected a number less than or equal to 255 - │ - = Positional fields must be a decimal number in the range [0 .. 255] and not be typed, e.g. `0` - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_field_access_no_annotations.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_field_access_no_annotations.snap new file mode 100644 index 0000000000000..8bc228e6c0d7b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_field_access_no_annotations.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/positional_field_access_no_annotations.move +--- +error[E03010]: unbound field + ┌─ tests/move_2024/parser/positional_field_access_no_annotations.move:5:9 + │ +5 │ y.0_u8 + │ ^^^^^^ Unbound field '0_u8' in '0x42::M::Foo' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/positional_field_access_no_annotations.move:5:11 + │ +5 │ y.0_u8 + │ ^^^^ Invalid field access. Expected a number less than or equal to 255 + │ + = Positional fields must be a decimal number in the range [0 .. 255] and not be typed, e.g. `0` diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_explicit_type_arg_assign.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_explicit_type_arg_assign.exp deleted file mode 100644 index 83d5f26a3553d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_explicit_type_arg_assign.exp +++ /dev/null @@ -1,46 +0,0 @@ -error[E03022]: invalid usage position - ┌─ tests/move_2024/parser/positional_struct_explicit_type_arg_assign.move:5:9 - │ -5 │ Foo (_) = Foo(0); - │ ^^^ Expected a local or constant, but found struct 'Foo' in current scope - │ - = Structs with positional arguments must be written as 'Foo( ... )' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/positional_struct_explicit_type_arg_assign.move:5:9 - │ -5 │ Foo (_) = Foo(0); - │ ^^^^^^^^ - │ │ - │ Invalid argument to '>' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E03009]: unbound variable - ┌─ tests/move_2024/parser/positional_struct_explicit_type_arg_assign.move:5:14 - │ -5 │ Foo (_) = Foo(0); - │ ^^^ Unbound variable 'u64' - -error[E03009]: unbound variable - ┌─ tests/move_2024/parser/positional_struct_explicit_type_arg_assign.move:5:19 - │ -5 │ Foo (_) = Foo(0); - │ ^ Unbound variable '_' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/positional_struct_explicit_type_arg_assign.move:5:19 - │ -5 │ Foo (_) = Foo(0); - │ -------- ^ Invalid argument to '>' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/positional_struct_explicit_type_arg_assign.move:5:22 - │ -5 │ Foo (_) = Foo(0); - │ ^ - │ │ - │ Unexpected '=' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_explicit_type_arg_assign.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_explicit_type_arg_assign.snap new file mode 100644 index 0000000000000..42efeedf17df4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_explicit_type_arg_assign.snap @@ -0,0 +1,53 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/positional_struct_explicit_type_arg_assign.move +--- +error[E03022]: invalid usage position + ┌─ tests/move_2024/parser/positional_struct_explicit_type_arg_assign.move:5:9 + │ +5 │ Foo (_) = Foo(0); + │ ^^^ Expected a local or constant, but found struct 'Foo' in current scope + │ + = Structs with positional arguments must be written as 'Foo( ... )' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/positional_struct_explicit_type_arg_assign.move:5:9 + │ +5 │ Foo (_) = Foo(0); + │ ^^^^^^^^ + │ │ + │ Invalid argument to '>' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E03009]: unbound variable + ┌─ tests/move_2024/parser/positional_struct_explicit_type_arg_assign.move:5:14 + │ +5 │ Foo (_) = Foo(0); + │ ^^^ Unbound variable 'u64' + +error[E03009]: unbound variable + ┌─ tests/move_2024/parser/positional_struct_explicit_type_arg_assign.move:5:19 + │ +5 │ Foo (_) = Foo(0); + │ ^ Unbound variable '_' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/positional_struct_explicit_type_arg_assign.move:5:19 + │ +5 │ Foo (_) = Foo(0); + │ -------- ^ Invalid argument to '>' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/positional_struct_explicit_type_arg_assign.move:5:22 + │ +5 │ Foo (_) = Foo(0); + │ ^ + │ │ + │ Unexpected '=' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_explicit_type_args.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_explicit_type_args.exp deleted file mode 100644 index b399226af892b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_explicit_type_args.exp +++ /dev/null @@ -1,40 +0,0 @@ -error[E03022]: invalid usage position - ┌─ tests/move_2024/parser/positional_struct_explicit_type_args.move:16:17 - │ -16 │ let _ = Foo (0); - │ ^^^ Expected a local or constant, but found struct 'Foo' in current scope - │ - = Structs with positional arguments must be written as 'Foo( ... )' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/positional_struct_explicit_type_args.move:16:17 - │ -16 │ let _ = Foo (0); - │ ^^^^^^^^ - │ │ - │ Invalid argument to '>' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E03009]: unbound variable - ┌─ tests/move_2024/parser/positional_struct_explicit_type_args.move:16:22 - │ -16 │ let _ = Foo (0); - │ ^^^ Unbound variable 'u64' - -error[E04007]: incompatible types - ┌─ tests/move_2024/parser/positional_struct_explicit_type_args.move:16:25 - │ -16 │ let _ = Foo (0); - │ --------^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '>' - │ Found: 'bool'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/parser/positional_struct_explicit_type_args.move:16:27 - │ -16 │ let _ = Foo (0); - │ -------- ^ Invalid argument to '>' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_explicit_type_args.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_explicit_type_args.snap new file mode 100644 index 0000000000000..eb1b0d7680fe8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_explicit_type_args.snap @@ -0,0 +1,47 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/positional_struct_explicit_type_args.move +--- +error[E03022]: invalid usage position + ┌─ tests/move_2024/parser/positional_struct_explicit_type_args.move:16:17 + │ +16 │ let _ = Foo (0); + │ ^^^ Expected a local or constant, but found struct 'Foo' in current scope + │ + = Structs with positional arguments must be written as 'Foo( ... )' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/positional_struct_explicit_type_args.move:16:17 + │ +16 │ let _ = Foo (0); + │ ^^^^^^^^ + │ │ + │ Invalid argument to '>' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E03009]: unbound variable + ┌─ tests/move_2024/parser/positional_struct_explicit_type_args.move:16:22 + │ +16 │ let _ = Foo (0); + │ ^^^ Unbound variable 'u64' + +error[E04007]: incompatible types + ┌─ tests/move_2024/parser/positional_struct_explicit_type_args.move:16:25 + │ +16 │ let _ = Foo (0); + │ --------^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '>' + │ Found: 'bool'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/parser/positional_struct_explicit_type_args.move:16:27 + │ +16 │ let _ = Foo (0); + │ -------- ^ Invalid argument to '>' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_keyword_field.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_keyword_field.exp deleted file mode 100644 index 13a9cbb0c8025..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_keyword_field.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/positional_struct_fields_keyword_field.move:3:23 - │ -3 │ public struct Foo(fun) - │ ^ Unexpected 'fun'. Expected a type - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/positional_struct_fields_keyword_field.move:3:26 - │ -3 │ public struct Foo(fun) - │ ^ - │ │ - │ Unexpected ')' - │ Expected an identifier - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_keyword_field.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_keyword_field.snap new file mode 100644 index 0000000000000..0f91cd57df03b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_keyword_field.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/positional_struct_fields_keyword_field.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/positional_struct_fields_keyword_field.move:3:23 + │ +3 │ public struct Foo(fun) + │ ^ Unexpected 'fun'. Expected a type + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/positional_struct_fields_keyword_field.move:3:26 + │ +3 │ public struct Foo(fun) + │ ^ + │ │ + │ Unexpected ')' + │ Expected an identifier diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_non_type_field.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_non_type_field.exp deleted file mode 100644 index 38d513fccd621..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_non_type_field.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E03004]: unbound type - ┌─ tests/move_2024/parser/positional_struct_fields_non_type_field.move:3:23 - │ -3 │ public struct Foo(Not a type) - │ ^^^ Unbound type 'Not' in current scope - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/positional_struct_fields_non_type_field.move:3:27 - │ -3 │ public struct Foo(Not a type) - │ ^ - │ │ - │ Unexpected 'a' - │ Expected ',' or ')' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_non_type_field.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_non_type_field.snap new file mode 100644 index 0000000000000..cace9fe7e4ab2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_non_type_field.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/positional_struct_fields_non_type_field.move +--- +error[E03004]: unbound type + ┌─ tests/move_2024/parser/positional_struct_fields_non_type_field.move:3:23 + │ +3 │ public struct Foo(Not a type) + │ ^^^ Unbound type 'Not' in current scope + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/positional_struct_fields_non_type_field.move:3:27 + │ +3 │ public struct Foo(Not a type) + │ ^ + │ │ + │ Unexpected 'a' + │ Expected ',' or ')' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_simple.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_simple.snap new file mode 100644 index 0000000000000..2aad30a0faf0a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_simple.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/positional_struct_fields_simple.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_simple_construct.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_simple_construct.snap new file mode 100644 index 0000000000000..9eeb78ba51407 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_simple_construct.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/positional_struct_fields_simple_construct.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_with_idents.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_with_idents.exp deleted file mode 100644 index 0916fcadd75e6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_with_idents.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/positional_struct_fields_with_idents.move:3:23 - │ -3 │ public struct Foo(x: u64) has copy, drop; - │ ^ Cannot use named fields in a positional definition - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_with_idents.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_with_idents.snap new file mode 100644 index 0000000000000..ecbab7092056a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_fields_with_idents.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/positional_struct_fields_with_idents.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/positional_struct_fields_with_idents.move:3:23 + │ +3 │ public struct Foo(x: u64) has copy, drop; + │ ^ Cannot use named fields in a positional definition diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_unpack.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_unpack.snap new file mode 100644 index 0000000000000..f982712915f97 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_unpack.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/positional_struct_unpack.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_using_curlies.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_using_curlies.exp deleted file mode 100644 index aa15d8eeb5dc1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_using_curlies.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/positional_struct_using_curlies.move:3:29 - │ -3 │ public struct Foo { u64 } - │ ^ - │ │ - │ Unexpected '}' - │ Expected ':' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_using_curlies.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_using_curlies.snap new file mode 100644 index 0000000000000..9960e7a4352c2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_struct_using_curlies.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/positional_struct_using_curlies.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/positional_struct_using_curlies.move:3:29 + │ +3 │ public struct Foo { u64 } + │ ^ + │ │ + │ Unexpected '}' + │ Expected ':' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_with_named_struct_field.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_with_named_struct_field.exp deleted file mode 100644 index 02c91597602a6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_with_named_struct_field.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/positional_with_named_struct_field.move:3:23 - │ -3 │ public struct Foo(f: u64) has copy, drop; - │ ^ Cannot use named fields in a positional definition - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_with_named_struct_field.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_with_named_struct_field.snap new file mode 100644 index 0000000000000..381f99bdc6c5d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/positional_with_named_struct_field.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/positional_with_named_struct_field.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/positional_with_named_struct_field.move:3:23 + │ +3 │ public struct Foo(f: u64) has copy, drop; + │ ^ Cannot use named fields in a positional definition diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/struct_ellipsis.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/struct_ellipsis.snap new file mode 100644 index 0000000000000..9b19a855eb17a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/struct_ellipsis.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/struct_ellipsis.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/struct_ellipsis_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/struct_ellipsis_invalid.exp deleted file mode 100644 index 631200af32eec..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/struct_ellipsis_invalid.exp +++ /dev/null @@ -1,23 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_2024/parser/struct_ellipsis_invalid.move:8:11 - │ -8 │ fun f(y: X): u64 { - │ ^ Unused parameter 'y'. Consider removing or prefixing with an underscore: '_y' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/struct_ellipsis_invalid.move:9:13 - │ -9 │ let .. = y; - │ ^^ - │ │ - │ Unexpected '..' - │ Expected a variable or struct name - -error[E03009]: unbound variable - ┌─ tests/move_2024/parser/struct_ellipsis_invalid.move:10:9 - │ -10 │ x - │ ^ Unbound variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/struct_ellipsis_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/struct_ellipsis_invalid.snap new file mode 100644 index 0000000000000..9e3729fb3f4c1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/struct_ellipsis_invalid.snap @@ -0,0 +1,30 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/struct_ellipsis_invalid.move +--- +warning[W09002]: unused variable + ┌─ tests/move_2024/parser/struct_ellipsis_invalid.move:8:11 + │ +8 │ fun f(y: X): u64 { + │ ^ Unused parameter 'y'. Consider removing or prefixing with an underscore: '_y' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/struct_ellipsis_invalid.move:9:13 + │ +9 │ let .. = y; + │ ^^ + │ │ + │ Unexpected '..' + │ Expected a variable or struct name + +error[E03009]: unbound variable + ┌─ tests/move_2024/parser/struct_ellipsis_invalid.move:10:9 + │ +10 │ x + │ ^ Unbound variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/struct_public.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/struct_public.exp deleted file mode 100644 index 48870472d41fc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/struct_public.exp +++ /dev/null @@ -1,40 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/parser/struct_public.move:3:5 - │ -3 │ struct Foo {} - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E01003]: invalid modifier - ┌─ tests/move_2024/parser/struct_public.move:4:5 - │ -4 │ public(friend) struct Foo {} - │ ^^^^^^^^^^^^^^ Invalid struct declaration. 'public(friend)' struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/parser/struct_public.move:4:27 - │ -3 │ struct Foo {} - │ --- Alias previously defined here -4 │ public(friend) struct Foo {} - │ ^^^ Duplicate module member or alias 'Foo'. Top level names in a namespace must be unique - -error[E01003]: invalid modifier - ┌─ tests/move_2024/parser/struct_public.move:5:5 - │ -5 │ public(package) struct Foo {} - │ ^^^^^^^^^^^^^^^ Invalid struct declaration. 'public(package)' struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/parser/struct_public.move:5:28 - │ -4 │ public(friend) struct Foo {} - │ --- Alias previously defined here -5 │ public(package) struct Foo {} - │ ^^^ Duplicate module member or alias 'Foo'. Top level names in a namespace must be unique - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/struct_public.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/struct_public.snap new file mode 100644 index 0000000000000..534c5ef1f67f4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/struct_public.snap @@ -0,0 +1,47 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/struct_public.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/parser/struct_public.move:3:5 + │ +3 │ struct Foo {} + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E01003]: invalid modifier + ┌─ tests/move_2024/parser/struct_public.move:4:5 + │ +4 │ public(friend) struct Foo {} + │ ^^^^^^^^^^^^^^ Invalid struct declaration. 'public(friend)' struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/parser/struct_public.move:4:27 + │ +3 │ struct Foo {} + │ --- Alias previously defined here +4 │ public(friend) struct Foo {} + │ ^^^ Duplicate module member or alias 'Foo'. Top level names in a namespace must be unique + +error[E01003]: invalid modifier + ┌─ tests/move_2024/parser/struct_public.move:5:5 + │ +5 │ public(package) struct Foo {} + │ ^^^^^^^^^^^^^^^ Invalid struct declaration. 'public(package)' struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/parser/struct_public.move:5:28 + │ +4 │ public(friend) struct Foo {} + │ --- Alias previously defined here +5 │ public(package) struct Foo {} + │ ^^^ Duplicate module member or alias 'Foo'. Top level names in a namespace must be unique diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module.snap new file mode 100644 index 0000000000000..f4c5e591f9350 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/top_level_module.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_address_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_address_invalid.exp deleted file mode 100644 index 1037a555a6ebd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_address_invalid.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/parser/top_level_module_address_invalid.move:1:1 - │ -1 │ address a { - │ ^^^^^^^ 'address' blocks are deprecated. Use addresses directly in module definitions instead. -2 │ module m; - │ - Replace with 'a::m' - -error[E02004]: invalid 'module' declaration - ┌─ tests/move_2024/parser/top_level_module_address_invalid.move:2:12 - │ -2 │ module m; - │ ^ Cannot define 'module' label in address block - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_address_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_address_invalid.snap new file mode 100644 index 0000000000000..7d91afce7a3cb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_address_invalid.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/top_level_module_address_invalid.move +--- +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/parser/top_level_module_address_invalid.move:1:1 + │ +1 │ address a { + │ ^^^^^^^ 'address' blocks are deprecated. Use addresses directly in module definitions instead. +2 │ module m; + │ - Replace with 'a::m' + +error[E02004]: invalid 'module' declaration + ┌─ tests/move_2024/parser/top_level_module_address_invalid.move:2:12 + │ +2 │ module m; + │ ^ Cannot define 'module' label in address block diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_double_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_double_invalid.exp deleted file mode 100644 index 332b02fd9ee40..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_double_invalid.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[E02004]: invalid 'module' declaration - ┌─ tests/move_2024/parser/top_level_module_double_invalid.move:7:11 - │ -1 │ module a::m; - │ - Previous definition here - · -7 │ module a::n; - │ ^ Cannot define a 'module' label form in a file with multiple modules - │ - = Either move each 'module' label and definitions into its own file or define each as 'module { contents }' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_double_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_double_invalid.snap new file mode 100644 index 0000000000000..87ae41a807f93 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_double_invalid.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/top_level_module_double_invalid.move +--- +error[E02004]: invalid 'module' declaration + ┌─ tests/move_2024/parser/top_level_module_double_invalid.move:7:11 + │ +1 │ module a::m; + │ - Previous definition here + · +7 │ module a::n; + │ ^ Cannot define a 'module' label form in a file with multiple modules + │ + = Either move each 'module' label and definitions into its own file or define each as 'module { contents }' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_mixed_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_mixed_invalid.snap new file mode 100644 index 0000000000000..731585eea301b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_mixed_invalid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/top_level_module_mixed_invalid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_mixed_invalid_2.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_mixed_invalid_2.exp deleted file mode 100644 index d122dc4db51fb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_mixed_invalid_2.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[E02004]: invalid 'module' declaration - ┌─ tests/move_2024/parser/top_level_module_mixed_invalid_2.move:7:11 - │ -1 │ module a::n { - │ - Previous definition here - · -7 │ module a::m; - │ ^ Cannot define a 'module' label form in a file with multiple modules - │ - = Either move each 'module' label and definitions into its own file or define each as 'module { contents }' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_mixed_invalid_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_mixed_invalid_2.snap new file mode 100644 index 0000000000000..c9e7b73d57f29 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/top_level_module_mixed_invalid_2.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/top_level_module_mixed_invalid_2.move +--- +error[E02004]: invalid 'module' declaration + ┌─ tests/move_2024/parser/top_level_module_mixed_invalid_2.move:7:11 + │ +1 │ module a::n { + │ - Previous definition here + · +7 │ module a::m; + │ ^ Cannot define a 'module' label form in a file with multiple modules + │ + = Either move each 'module' label and definitions into its own file or define each as 'module { contents }' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/type_hole.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/type_hole.snap new file mode 100644 index 0000000000000..6814d1fe5f205 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/type_hole.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/type_hole.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/type_kewyord.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/type_kewyord.exp deleted file mode 100644 index 10398f3fc29f5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/type_kewyord.exp +++ /dev/null @@ -1,17 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/parser/type_kewyord.move:2:5 - │ -2 │ struct type { t: T } - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/type_kewyord.move:2:12 - │ -2 │ struct type { t: T } - │ ^^^^ - │ │ - │ Unexpected 'type' - │ Expected an identifier - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/type_kewyord.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/type_kewyord.snap new file mode 100644 index 0000000000000..dc8d12b15a332 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/type_kewyord.snap @@ -0,0 +1,24 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/type_kewyord.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/parser/type_kewyord.move:2:5 + │ +2 │ struct type { t: T } + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/type_kewyord.move:2:12 + │ +2 │ struct type { t: T } + │ ^^^^ + │ │ + │ Unexpected 'type' + │ Expected an identifier diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun.snap new file mode 100644 index 0000000000000..92031a1e80c09 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/use_fun.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_multi.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_multi.exp deleted file mode 100644 index 61b96e84a339e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_multi.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/use_fun_multi.move:2:20 - │ -2 │ use fun foo as (u64, bool).foo; - │ ^ - │ │ - │ Unexpected '(' - │ Expected a type name with no type arguments - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_multi.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_multi.snap new file mode 100644 index 0000000000000..71fa1f9e08d38 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_multi.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/use_fun_multi.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/use_fun_multi.move:2:20 + │ +2 │ use fun foo as (u64, bool).foo; + │ ^ + │ │ + │ Unexpected '(' + │ Expected a type name with no type arguments diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_ref.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_ref.exp deleted file mode 100644 index 323a355b72d95..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_ref.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/use_fun_ref.move:3:20 - │ -3 │ use fun foo as &X.foo; - │ ^ - │ │ - │ Unexpected '&' - │ Expected a type name with no type arguments - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_ref.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_ref.snap new file mode 100644 index 0000000000000..031d0fa187f37 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_ref.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/use_fun_ref.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/use_fun_ref.move:3:20 + │ +3 │ use fun foo as &X.foo; + │ ^ + │ │ + │ Unexpected '&' + │ Expected a type name with no type arguments diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_type_args.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_type_args.exp deleted file mode 100644 index 7836c21adc710..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_type_args.exp +++ /dev/null @@ -1,24 +0,0 @@ -warning[W09001]: unused alias - ┌─ tests/move_2024/parser/use_fun_type_args.move:3:5 - │ -3 │ use fun foo as X.foo; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Unused 'use fun' of 'a::m::X.foo'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01016]: invalid name - ┌─ tests/move_2024/parser/use_fun_type_args.move:3:21 - │ -3 │ use fun foo as X.foo; - │ ^^^^^ Type arguments are disallowed here. Expected a type name with no type arguments - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/parser/use_fun_type_args.move:4:9 - │ -3 │ use fun foo as X.foo; - │ --- Previously declared here -4 │ fun foo(_: X) { abort 0 } - │ ^^^ ---- Function declarations create an implicit 'use fun' when their first argument is a type defined in the same module - │ │ - │ Duplicate 'use fun' for 'a::m::X.foo' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_type_args.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_type_args.snap new file mode 100644 index 0000000000000..dd5e9da9dbdcd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_type_args.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/use_fun_type_args.move +--- +warning[W09001]: unused alias + ┌─ tests/move_2024/parser/use_fun_type_args.move:3:5 + │ +3 │ use fun foo as X.foo; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Unused 'use fun' of 'a::m::X.foo'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01016]: invalid name + ┌─ tests/move_2024/parser/use_fun_type_args.move:3:21 + │ +3 │ use fun foo as X.foo; + │ ^^^^^ Type arguments are disallowed here. Expected a type name with no type arguments + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/parser/use_fun_type_args.move:4:9 + │ +3 │ use fun foo as X.foo; + │ --- Previously declared here +4 │ fun foo(_: X) { abort 0 } + │ ^^^ ---- Function declarations create an implicit 'use fun' when their first argument is a type defined in the same module + │ │ + │ Duplicate 'use fun' for 'a::m::X.foo' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_unit.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_unit.exp deleted file mode 100644 index fc4e4f9f8c6bb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_unit.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_2024/parser/use_fun_unit.move:2:20 - │ -2 │ use fun foo as ().foo; - │ ^ - │ │ - │ Unexpected '(' - │ Expected a type name with no type arguments - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_unit.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_unit.snap new file mode 100644 index 0000000000000..224168772afdf --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_unit.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/use_fun_unit.move +--- +error[E01002]: unexpected token + ┌─ tests/move_2024/parser/use_fun_unit.move:2:20 + │ +2 │ use fun foo as ().foo; + │ ^ + │ │ + │ Unexpected '(' + │ Expected a type name with no type arguments diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_visibility.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_visibility.exp deleted file mode 100644 index afb0ba24a27cd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_visibility.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E02017]: invalid 'use fun' declaration - ┌─ tests/move_2024/parser/use_fun_visibility.move:2:5 - │ -2 │ public(friend) use fun foo as S.g; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid visibility for 'use fun' declaration - │ Module level 'use fun' declarations can be 'public' for the module's types, otherwise they must internal to declared scope. - -error[E02017]: invalid 'use fun' declaration - ┌─ tests/move_2024/parser/use_fun_visibility.move:3:5 - │ -3 │ public(package) use fun foo as S.h; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid visibility for 'use fun' declaration - │ Module level 'use fun' declarations can be 'public' for the module's types, otherwise they must internal to declared scope. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_visibility.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_visibility.snap new file mode 100644 index 0000000000000..36258f6d8092f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/use_fun_visibility.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/use_fun_visibility.move +--- +error[E02017]: invalid 'use fun' declaration + ┌─ tests/move_2024/parser/use_fun_visibility.move:2:5 + │ +2 │ public(friend) use fun foo as S.g; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid visibility for 'use fun' declaration + │ Module level 'use fun' declarations can be 'public' for the module's types, otherwise they must internal to declared scope. + +error[E02017]: invalid 'use fun' declaration + ┌─ tests/move_2024/parser/use_fun_visibility.move:3:5 + │ +3 │ public(package) use fun foo as S.h; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid visibility for 'use fun' declaration + │ Module level 'use fun' declarations can be 'public' for the module's types, otherwise they must internal to declared scope. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parser/valid_fun_types.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parser/valid_fun_types.snap new file mode 100644 index 0000000000000..3603914e9f29f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parser/valid_fun_types.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parser/valid_fun_types.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_normal_usage.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_normal_usage.exp deleted file mode 100644 index 99138d35a8501..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_normal_usage.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/parsing/address_normal_usage.move:1:1 - │ -1 │ address 0x2 { - │ ^^^^^^^ 'address' blocks are deprecated. Use addresses directly in module definitions instead. -2 │ module m { - │ - Replace with '0x2::m' -3 │ } -4 │ module m2 { - │ -- Replace with '0x2::m2' -5 │ } -6 │ module m3 { - │ -- Replace with '0x2::m3' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_normal_usage.migration.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_normal_usage.migration.exp deleted file mode 100644 index 65e5ca8c51d2f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_normal_usage.migration.exp +++ /dev/null @@ -1,16 +0,0 @@ ---- tests/move_2024/parsing/address_normal_usage.move -+++ tests/move_2024/parsing/address_normal_usage.move -@@ -1,2 +1,2 @@ --address 0x2 { --module m { -+/* address 0x2 { */ -+module 0x2::m { -@@ -4,3 +4 @@ --module m2 { --} --module m3 { -+module 0x2::m2 { -@@ -7,0 +6 @@ -+module 0x2::m3 { -@@ -8,0 +8 @@ -+/* } */ diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_normal_usage.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_normal_usage.snap new file mode 100644 index 0000000000000..cdc82a8e53e60 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_normal_usage.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parsing/address_normal_usage.move +--- +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/parsing/address_normal_usage.move:1:1 + │ +1 │ address 0x2 { + │ ^^^^^^^ 'address' blocks are deprecated. Use addresses directly in module definitions instead. +2 │ module m { + │ - Replace with '0x2::m' +3 │ } +4 │ module m2 { + │ -- Replace with '0x2::m2' +5 │ } +6 │ module m3 { + │ -- Replace with '0x2::m3' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_normal_usage@migration.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_normal_usage@migration.snap new file mode 100644 index 0000000000000..df8f6d181c352 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_normal_usage@migration.snap @@ -0,0 +1,24 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.migration + lint: false +input_file: crates/move-compiler/tests/move_2024/parsing/address_normal_usage.move +--- +--- tests/move_2024/parsing/address_normal_usage.move ++++ tests/move_2024/parsing/address_normal_usage.move +@@ -1,2 +1,2 @@ +-address 0x2 { +-module m { ++/* address 0x2 { */ ++module 0x2::m { +@@ -4,3 +4 @@ +-module m2 { +-} +-module m3 { ++module 0x2::m2 { +@@ -7,0 +6 @@ ++module 0x2::m3 { +@@ -8,0 +8 @@ ++/* } */ diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_weird_formatting.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_weird_formatting.exp deleted file mode 100644 index 95e21a04ec2e1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_weird_formatting.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E13002]: feature is deprecated in specified edition - ┌─ tests/move_2024/parsing/address_weird_formatting.move:1:1 - │ -1 │ address - │ ^^^^^^^ 'address' blocks are deprecated. Use addresses directly in module definitions instead. - · -6 │ module m { - │ - Replace with '0x2::m' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_weird_formatting.migration.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_weird_formatting.migration.exp deleted file mode 100644 index d27629284a449..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_weird_formatting.migration.exp +++ /dev/null @@ -1,12 +0,0 @@ ---- tests/move_2024/parsing/address_weird_formatting.move -+++ tests/move_2024/parsing/address_weird_formatting.move -@@ -1 +1 @@ --address -+/* address -@@ -5,3 +5,3 @@ --{ -- module m { -- }} -+{ */ -+ module 0x2::m { -+ }/* } */ diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_weird_formatting.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_weird_formatting.snap new file mode 100644 index 0000000000000..3183f1fb8c94f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_weird_formatting.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parsing/address_weird_formatting.move +--- +error[E13002]: feature is deprecated in specified edition + ┌─ tests/move_2024/parsing/address_weird_formatting.move:1:1 + │ +1 │ address + │ ^^^^^^^ 'address' blocks are deprecated. Use addresses directly in module definitions instead. + · +6 │ module m { + │ - Replace with '0x2::m' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_weird_formatting@migration.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_weird_formatting@migration.snap new file mode 100644 index 0000000000000..34511cfb92584 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/address_weird_formatting@migration.snap @@ -0,0 +1,20 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.migration + lint: false +input_file: crates/move-compiler/tests/move_2024/parsing/address_weird_formatting.move +--- +--- tests/move_2024/parsing/address_weird_formatting.move ++++ tests/move_2024/parsing/address_weird_formatting.move +@@ -1 +1 @@ +-address ++/* address +@@ -5,3 +5,3 @@ +-{ +- module m { +- }} ++{ */ ++ module 0x2::m { ++ }/* } */ diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parsing/clever_errors_raw_abort.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/clever_errors_raw_abort.snap new file mode 100644 index 0000000000000..5eb6bd86e06dc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/clever_errors_raw_abort.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parsing/clever_errors_raw_abort.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parsing/expr_abort_missing_value.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/expr_abort_missing_value.snap new file mode 100644 index 0000000000000..59f49cba32774 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/expr_abort_missing_value.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parsing/expr_abort_missing_value.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parsing/move_copy_precedence.exp b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/move_copy_precedence.exp deleted file mode 100644 index 14793be98fcdf..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/parsing/move_copy_precedence.exp +++ /dev/null @@ -1,28 +0,0 @@ -warning[W09003]: unused assignment - ┌─ tests/move_2024/parsing/move_copy_precedence.move:11:13 - │ -11 │ let s1 = s; - │ ^^ Unused assignment for variable 's1'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_s1') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09003]: unused assignment - ┌─ tests/move_2024/parsing/move_copy_precedence.move:12:13 - │ -12 │ let s2 = s; - │ ^^ Unused assignment for variable 's2'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_s2') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04027]: invalid 'move' usage - ┌─ tests/move_2024/parsing/move_copy_precedence.move:14:9 - │ -14 │ move s1.f + 1; - │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported - -error[E04027]: invalid 'move' usage - ┌─ tests/move_2024/parsing/move_copy_precedence.move:16:10 - │ -16 │ &move s2.f; - │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/parsing/move_copy_precedence.snap b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/move_copy_precedence.snap new file mode 100644 index 0000000000000..9036bc2896bb2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/parsing/move_copy_precedence.snap @@ -0,0 +1,35 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/parsing/move_copy_precedence.move +--- +warning[W09003]: unused assignment + ┌─ tests/move_2024/parsing/move_copy_precedence.move:11:13 + │ +11 │ let s1 = s; + │ ^^ Unused assignment for variable 's1'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_s1') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09003]: unused assignment + ┌─ tests/move_2024/parsing/move_copy_precedence.move:12:13 + │ +12 │ let s2 = s; + │ ^^ Unused assignment for variable 's2'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_s2') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04027]: invalid 'move' usage + ┌─ tests/move_2024/parsing/move_copy_precedence.move:14:9 + │ +14 │ move s1.f + 1; + │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported + +error[E04027]: invalid 'move' usage + ┌─ tests/move_2024/parsing/move_copy_precedence.move:16:10 + │ +16 │ &move s2.f; + │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/struct_invalid_visibility_progress_inside.exp b/external-crates/move/crates/move-compiler/tests/move_2024/struct_invalid_visibility_progress_inside.exp deleted file mode 100644 index 40d470726cae7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/struct_invalid_visibility_progress_inside.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_2024/struct_invalid_visibility_progress_inside.move:2:5 - │ -2 │ struct Foo { - │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported - │ - = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. - -error[E03004]: unbound type - ┌─ tests/move_2024/struct_invalid_visibility_progress_inside.move:3:12 - │ -3 │ x: Bar, - │ ^^^ Unbound type 'Bar' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/struct_invalid_visibility_progress_inside.snap b/external-crates/move/crates/move-compiler/tests/move_2024/struct_invalid_visibility_progress_inside.snap new file mode 100644 index 0000000000000..7c11555dc3c37 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/struct_invalid_visibility_progress_inside.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/struct_invalid_visibility_progress_inside.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_2024/struct_invalid_visibility_progress_inside.move:2:5 + │ +2 │ struct Foo { + │ ^^^^^^ Invalid struct declaration. Internal struct declarations are not yet supported + │ + = Visibility annotations are required on struct declarations from the Move 2024 edition onwards. + +error[E03004]: unbound type + ┌─ tests/move_2024/struct_invalid_visibility_progress_inside.move:3:12 + │ +3 │ x: Bar, + │ ^^^ Unbound type 'Bar' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/sui_mode/enums_no_key.exp b/external-crates/move/crates/move-compiler/tests/move_2024/sui_mode/enums_no_key.exp deleted file mode 100644 index 56e9354607139..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/sui_mode/enums_no_key.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[Sui E02007]: invalid object declaration - ┌─ tests/move_2024/sui_mode/enums_no_key.move:3:17 - │ -3 │ public enum S has key { - │ ^ --- Enums cannot have the 'key' ability. - │ │ - │ Invalid object 'S' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/sui_mode/enums_no_key.snap b/external-crates/move/crates/move-compiler/tests/move_2024/sui_mode/enums_no_key.snap new file mode 100644 index 0000000000000..7a168bad93a7c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/sui_mode/enums_no_key.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/sui_mode/enums_no_key.move +--- +error[Sui E02007]: invalid object declaration + ┌─ tests/move_2024/sui_mode/enums_no_key.move:3:17 + │ +3 │ public enum S has key { + │ ^ --- Enums cannot have the 'key' ability. + │ │ + │ Invalid object 'S' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/to_bytecode/clever_assertions.snap b/external-crates/move/crates/move-compiler/tests/move_2024/to_bytecode/clever_assertions.snap new file mode 100644 index 0000000000000..cd8a365930455 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/to_bytecode/clever_assertions.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/to_bytecode/clever_assertions.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/to_bytecode/positional_unpack_of_positional_struct.snap b/external-crates/move/crates/move-compiler/tests/move_2024/to_bytecode/positional_unpack_of_positional_struct.snap new file mode 100644 index 0000000000000..d7184095b2d1b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/to_bytecode/positional_unpack_of_positional_struct.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/to_bytecode/positional_unpack_of_positional_struct.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/all_dot_paths_valid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/all_dot_paths_valid.exp deleted file mode 100644 index 1bc4dc59e411b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/all_dot_paths_valid.exp +++ /dev/null @@ -1,63 +0,0 @@ -error[E04012]: invalid type for constant - ┌─ tests/move_2024/typing/all_dot_paths_valid.move:2:16 - │ -2 │ const ZED: Z = Z { f: 0 }; - │ ^ - │ │ - │ Unpermitted constant type - │ Found: 'a::m::Z'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_2024/typing/all_dot_paths_valid.move:2:20 - │ -2 │ const ZED: Z = Z { f: 0 }; - │ ^^^^^^^^^^ Structs are not supported in constants - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_2024/typing/all_dot_paths_valid.move:25:14 - │ -25 │ copy ZED.f; - │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_2024/typing/all_dot_paths_valid.move:39:10 - │ -39 │ &VEC; - │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_2024/typing/all_dot_paths_valid.move:40:10 - │ -40 │ &ZED.f; - │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_2024/typing/all_dot_paths_valid.move:51:14 - │ -51 │ &mut VEC; - │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_2024/typing/all_dot_paths_valid.move:52:14 - │ -52 │ &mut ZED.f; - │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_2024/typing/all_dot_paths_valid.move:64:9 - │ -64 │ ZED.f; - │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/all_dot_paths_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/all_dot_paths_valid.snap new file mode 100644 index 0000000000000..9cd7496327ed1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/all_dot_paths_valid.snap @@ -0,0 +1,70 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/all_dot_paths_valid.move +--- +error[E04012]: invalid type for constant + ┌─ tests/move_2024/typing/all_dot_paths_valid.move:2:16 + │ +2 │ const ZED: Z = Z { f: 0 }; + │ ^ + │ │ + │ Unpermitted constant type + │ Found: 'a::m::Z'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_2024/typing/all_dot_paths_valid.move:2:20 + │ +2 │ const ZED: Z = Z { f: 0 }; + │ ^^^^^^^^^^ Structs are not supported in constants + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_2024/typing/all_dot_paths_valid.move:25:14 + │ +25 │ copy ZED.f; + │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_2024/typing/all_dot_paths_valid.move:39:10 + │ +39 │ &VEC; + │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_2024/typing/all_dot_paths_valid.move:40:10 + │ +40 │ &ZED.f; + │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_2024/typing/all_dot_paths_valid.move:51:14 + │ +51 │ &mut VEC; + │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_2024/typing/all_dot_paths_valid.move:52:14 + │ +52 │ &mut ZED.f; + │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_2024/typing/all_dot_paths_valid.move:64:9 + │ +64 │ ZED.f; + │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/all_index_paths.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/all_index_paths.exp deleted file mode 100644 index 632ca6fd8af87..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/all_index_paths.exp +++ /dev/null @@ -1,159 +0,0 @@ -error[E04012]: invalid type for constant - ┌─ tests/move_2024/typing/all_index_paths.move:46:16 - │ -46 │ const VEC: vector = vector[]; - │ ^^^^^^^^^ - │ │ │ - │ │ Found: 'a::m::X'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - │ Unpermitted constant type - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/typing/all_index_paths.move:63:9 - │ -63 │ copy t.u.vs[n].w.xs[m+1].deref(); - │ ^^^^ --------------------------- Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'copy' of expression - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/typing/all_index_paths.move:64:9 - │ -64 │ copy t.u.vs[n].w.xs[m+1].deref().id(); - │ ^^^^ -------------------------------- Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'copy' of expression - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_2024/typing/all_index_paths.move:65:14 - │ -65 │ copy VEC[n+1]; - │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/typing/all_index_paths.move:66:9 - │ -66 │ copy VEC[n+1].id_u64(); - │ ^^^^ ----------------- Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'copy' of expression - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/typing/all_index_paths.move:67:9 - │ -67 │ copy VEC.id(); - │ ^^^^ -------- Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'copy' of expression - -error[E04027]: invalid 'move' usage - ┌─ tests/move_2024/typing/all_index_paths.move:84:9 - │ -84 │ move t2.u; - │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported - -error[E04027]: invalid 'move' usage - ┌─ tests/move_2024/typing/all_index_paths.move:85:10 - │ -85 │ (move t2.u).vs[2]; - │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported - -error[E04027]: invalid 'move' usage - ┌─ tests/move_2024/typing/all_index_paths.move:86:10 - │ -86 │ (move t2.u).vs[2].w; - │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported - -error[E04027]: invalid 'move' usage - ┌─ tests/move_2024/typing/all_index_paths.move:87:10 - │ -87 │ (move t2.u).vs[2].w.xs[m+1]; - │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported - -error[E04027]: invalid 'move' usage - ┌─ tests/move_2024/typing/all_index_paths.move:88:10 - │ -88 │ (move t2.u).vs[2].w.xs[m+1].y; - │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported - -error[E04027]: invalid 'move' usage - ┌─ tests/move_2024/typing/all_index_paths.move:89:10 - │ -89 │ (move t2.u).vs[2].w.xs[m+1].y.z; - │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/typing/all_index_paths.move:90:9 - │ -90 │ move VEC.id(); - │ ^^^^ -------- Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'move' of expression - -error[E04004]: expected a single non-reference type - ┌─ tests/move_2024/typing/all_index_paths.move:104:9 - │ - 18 │ fun ref_unused(_x: &X) { } - │ ---------- Expected a single non-reference type, but found: '()' - · -104 │ &t2.u.vs[2].w.xs[m+1].ref_unused(); // invalid -- trying to borrow `()` - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid borrow - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_2024/typing/all_index_paths.move:108:10 - │ -108 │ &VEC[n+1]; - │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_2024/typing/all_index_paths.move:109:10 - │ -109 │ &VEC[n+1].id(); - │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04004]: expected a single non-reference type - ┌─ tests/move_2024/typing/all_index_paths.move:124:9 - │ - 18 │ fun ref_unused(_x: &X) { } - │ ---------- Expected a single non-reference type, but found: '()' - · -124 │ &mut t2.u.vs[2].w.xs[m+1].ref_unused(); // invalid -- trying to borrow `()` - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid borrow - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_2024/typing/all_index_paths.move:128:14 - │ -128 │ &mut VEC[n+1]; - │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_2024/typing/all_index_paths.move:129:14 - │ -129 │ &mut VEC[n+1].id(); - │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_2024/typing/all_index_paths.move:145:9 - │ -145 │ VEC[n+1]; - │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_2024/typing/all_index_paths.move:146:9 - │ -146 │ VEC[n+1].id(); - │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/all_index_paths.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/all_index_paths.snap new file mode 100644 index 0000000000000..7230466469e37 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/all_index_paths.snap @@ -0,0 +1,166 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/all_index_paths.move +--- +error[E04012]: invalid type for constant + ┌─ tests/move_2024/typing/all_index_paths.move:46:16 + │ +46 │ const VEC: vector = vector[]; + │ ^^^^^^^^^ + │ │ │ + │ │ Found: 'a::m::X'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' + │ Unpermitted constant type + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/typing/all_index_paths.move:63:9 + │ +63 │ copy t.u.vs[n].w.xs[m+1].deref(); + │ ^^^^ --------------------------- Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'copy' of expression + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/typing/all_index_paths.move:64:9 + │ +64 │ copy t.u.vs[n].w.xs[m+1].deref().id(); + │ ^^^^ -------------------------------- Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'copy' of expression + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_2024/typing/all_index_paths.move:65:14 + │ +65 │ copy VEC[n+1]; + │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/typing/all_index_paths.move:66:9 + │ +66 │ copy VEC[n+1].id_u64(); + │ ^^^^ ----------------- Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'copy' of expression + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/typing/all_index_paths.move:67:9 + │ +67 │ copy VEC.id(); + │ ^^^^ -------- Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'copy' of expression + +error[E04027]: invalid 'move' usage + ┌─ tests/move_2024/typing/all_index_paths.move:84:9 + │ +84 │ move t2.u; + │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported + +error[E04027]: invalid 'move' usage + ┌─ tests/move_2024/typing/all_index_paths.move:85:10 + │ +85 │ (move t2.u).vs[2]; + │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported + +error[E04027]: invalid 'move' usage + ┌─ tests/move_2024/typing/all_index_paths.move:86:10 + │ +86 │ (move t2.u).vs[2].w; + │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported + +error[E04027]: invalid 'move' usage + ┌─ tests/move_2024/typing/all_index_paths.move:87:10 + │ +87 │ (move t2.u).vs[2].w.xs[m+1]; + │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported + +error[E04027]: invalid 'move' usage + ┌─ tests/move_2024/typing/all_index_paths.move:88:10 + │ +88 │ (move t2.u).vs[2].w.xs[m+1].y; + │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported + +error[E04027]: invalid 'move' usage + ┌─ tests/move_2024/typing/all_index_paths.move:89:10 + │ +89 │ (move t2.u).vs[2].w.xs[m+1].y.z; + │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/typing/all_index_paths.move:90:9 + │ +90 │ move VEC.id(); + │ ^^^^ -------- Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'move' of expression + +error[E04004]: expected a single non-reference type + ┌─ tests/move_2024/typing/all_index_paths.move:104:9 + │ + 18 │ fun ref_unused(_x: &X) { } + │ ---------- Expected a single non-reference type, but found: '()' + · +104 │ &t2.u.vs[2].w.xs[m+1].ref_unused(); // invalid -- trying to borrow `()` + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid borrow + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_2024/typing/all_index_paths.move:108:10 + │ +108 │ &VEC[n+1]; + │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_2024/typing/all_index_paths.move:109:10 + │ +109 │ &VEC[n+1].id(); + │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04004]: expected a single non-reference type + ┌─ tests/move_2024/typing/all_index_paths.move:124:9 + │ + 18 │ fun ref_unused(_x: &X) { } + │ ---------- Expected a single non-reference type, but found: '()' + · +124 │ &mut t2.u.vs[2].w.xs[m+1].ref_unused(); // invalid -- trying to borrow `()` + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid borrow + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_2024/typing/all_index_paths.move:128:14 + │ +128 │ &mut VEC[n+1]; + │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_2024/typing/all_index_paths.move:129:14 + │ +129 │ &mut VEC[n+1].id(); + │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_2024/typing/all_index_paths.move:145:9 + │ +145 │ VEC[n+1]; + │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_2024/typing/all_index_paths.move:146:9 + │ +146 │ VEC[n+1].id(); + │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/all_valid_index_paths.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/all_valid_index_paths.snap new file mode 100644 index 0000000000000..efefbd99da227 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/all_valid_index_paths.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/all_valid_index_paths.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/allow_deprecated.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/allow_deprecated.snap new file mode 100644 index 0000000000000..26f7e13cb186c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/allow_deprecated.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/allow_deprecated.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/annotated_lambda.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/annotated_lambda.exp deleted file mode 100644 index 7f1005dd84391..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/annotated_lambda.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/annotated_lambda.move:8:15 - │ -8 │ call!((|| 1 : || -> u64)) - │ ^^^^^^^^^^^^^^^^^^ Unable to bind lambda to parameter '$f'. The lambda must be passed directly - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/annotated_lambda.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/annotated_lambda.snap new file mode 100644 index 0000000000000..9d2054caac9fc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/annotated_lambda.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/annotated_lambda.move +--- +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/annotated_lambda.move:8:15 + │ +8 │ call!((|| 1 : || -> u64)) + │ ^^^^^^^^^^^^^^^^^^ Unable to bind lambda to parameter '$f'. The lambda must be passed directly diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/break_in_macro_arg_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/break_in_macro_arg_invalid.exp deleted file mode 100644 index bd0ecf0881f46..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/break_in_macro_arg_invalid.exp +++ /dev/null @@ -1,36 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/break_in_macro_arg_invalid.move:8:14 - │ - 8 │ foo!('a: { - │ ╭──────────────^ - 9 │ │ if (cond) return'a vector[]; - │ │ -------- Found: 'vector<_>'. It is not compatible with the other type. -10 │ │ 0 - │ │ - Found: integer. It is not compatible with the other type. -11 │ │ }); - │ ╰─────────^ Invalid named block - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/break_in_macro_arg_invalid.move:9:32 - │ -9 │ if (cond) return'a vector[]; - │ ^^^^^^^^ Could not infer this type. Try adding an annotation - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/break_in_macro_arg_invalid.move:12:14 - │ -12 │ foo!('a: { - │ ╭──────────────^ -13 │ │ if (cond) return'a 0; - │ │ ---------- Found: integer. It is not compatible with the other type. -14 │ │ vector[] - │ │ -------- Found: 'vector<_>'. It is not compatible with the other type. -15 │ │ }); - │ ╰─────────^ Invalid named block - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/break_in_macro_arg_invalid.move:14:13 - │ -14 │ vector[] - │ ^^^^^^^^ Could not infer this type. Try adding an annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/break_in_macro_arg_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/break_in_macro_arg_invalid.snap new file mode 100644 index 0000000000000..68dbd79704cc1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/break_in_macro_arg_invalid.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/break_in_macro_arg_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/break_in_macro_arg_invalid.move:8:14 + │ + 8 │ foo!('a: { + │ ╭──────────────^ + 9 │ │ if (cond) return'a vector[]; + │ │ -------- Found: 'vector<_>'. It is not compatible with the other type. +10 │ │ 0 + │ │ - Found: integer. It is not compatible with the other type. +11 │ │ }); + │ ╰─────────^ Invalid named block + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/break_in_macro_arg_invalid.move:9:32 + │ +9 │ if (cond) return'a vector[]; + │ ^^^^^^^^ Could not infer this type. Try adding an annotation + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/break_in_macro_arg_invalid.move:12:14 + │ +12 │ foo!('a: { + │ ╭──────────────^ +13 │ │ if (cond) return'a 0; + │ │ ---------- Found: integer. It is not compatible with the other type. +14 │ │ vector[] + │ │ -------- Found: 'vector<_>'. It is not compatible with the other type. +15 │ │ }); + │ ╰─────────^ Invalid named block + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/break_in_macro_arg_invalid.move:14:13 + │ +14 │ vector[] + │ ^^^^^^^^ Could not infer this type. Try adding an annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/by_value_method.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/by_value_method.snap new file mode 100644 index 0000000000000..422daf76d7ddb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/by_value_method.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/by_value_method.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/call_on_non_lambda_arg.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/call_on_non_lambda_arg.exp deleted file mode 100644 index 3c504686e8a41..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/call_on_non_lambda_arg.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/call_on_non_lambda_arg.move:4:9 - │ - 4 │ $x(0); - │ ^^^^^ Cannot call non-lambda argument - · -11 │ foo!(|x| x, 0); - │ - Expected a lambda argument - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/call_on_non_lambda_arg.move:9:9 - │ -2 │ macro fun foo($f: |u64| -> u64, $x: u64) { - │ --- Expected: 'u64' - · -9 │ foo!(0, |x| x); - │ ^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: '|_| -> _' - │ Invalid call of 'a::m::foo'. Invalid argument for parameter '$x' - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/call_on_non_lambda_arg.move:9:14 - │ -9 │ foo!(0, |x| x); - │ ^ Unable to bind lambda to parameter '$f'. The lambda must be passed directly - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/call_on_non_lambda_arg.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/call_on_non_lambda_arg.snap new file mode 100644 index 0000000000000..e37ffed54e9a3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/call_on_non_lambda_arg.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/call_on_non_lambda_arg.move +--- +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/call_on_non_lambda_arg.move:4:9 + │ + 4 │ $x(0); + │ ^^^^^ Cannot call non-lambda argument + · +11 │ foo!(|x| x, 0); + │ - Expected a lambda argument + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/call_on_non_lambda_arg.move:9:9 + │ +2 │ macro fun foo($f: |u64| -> u64, $x: u64) { + │ --- Expected: 'u64' + · +9 │ foo!(0, |x| x); + │ ^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: '|_| -> _' + │ Invalid call of 'a::m::foo'. Invalid argument for parameter '$x' + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/call_on_non_lambda_arg.move:9:14 + │ +9 │ foo!(0, |x| x); + │ ^ Unable to bind lambda to parameter '$f'. The lambda must be passed directly diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/call_target_mismatch.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/call_target_mismatch.exp deleted file mode 100644 index 8074b473f430c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/call_target_mismatch.exp +++ /dev/null @@ -1,36 +0,0 @@ -error[E04029]: invalid function call - ┌─ tests/move_2024/typing/call_target_mismatch.move:9:20 - │ -4 │ fun not_a_macro(_: X) { - │ ----------- Normal (non-'macro') function is declared here - · -9 │ not_a_macro!(X()); - │ ^ 'not_a_macro' is not a macro function and cannot be called with a `!`. Try replacing with 'not_a_macro' - -error[E04029]: invalid function call - ┌─ tests/move_2024/typing/call_target_mismatch.move:10:9 - │ - 6 │ macro fun a_macro(_: X) {} - │ ----- 'macro' function is declared here - · -10 │ a_macro(X()); - │ ^^^^^^^^^^^^ 'a_macro' is a macro function and must be called with a `!`. Try replacing with 'a_macro!' - -error[E04029]: invalid function call - ┌─ tests/move_2024/typing/call_target_mismatch.move:11:24 - │ - 4 │ fun not_a_macro(_: X) { - │ ----------- Normal (non-'macro') function is declared here - · -11 │ X().not_a_macro!(); - │ ^ 'not_a_macro' is not a macro function and cannot be called with a `!`. Try replacing with 'not_a_macro' - -error[E04029]: invalid function call - ┌─ tests/move_2024/typing/call_target_mismatch.move:12:9 - │ - 6 │ macro fun a_macro(_: X) {} - │ ----- 'macro' function is declared here - · -12 │ X().a_macro(); - │ ^^^^^^^^^^^^^ 'a_macro' is a macro function and must be called with a `!`. Try replacing with 'a_macro!' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/call_target_mismatch.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/call_target_mismatch.snap new file mode 100644 index 0000000000000..666301dd07919 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/call_target_mismatch.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/call_target_mismatch.move +--- +error[E04029]: invalid function call + ┌─ tests/move_2024/typing/call_target_mismatch.move:9:20 + │ +4 │ fun not_a_macro(_: X) { + │ ----------- Normal (non-'macro') function is declared here + · +9 │ not_a_macro!(X()); + │ ^ 'not_a_macro' is not a macro function and cannot be called with a `!`. Try replacing with 'not_a_macro' + +error[E04029]: invalid function call + ┌─ tests/move_2024/typing/call_target_mismatch.move:10:9 + │ + 6 │ macro fun a_macro(_: X) {} + │ ----- 'macro' function is declared here + · +10 │ a_macro(X()); + │ ^^^^^^^^^^^^ 'a_macro' is a macro function and must be called with a `!`. Try replacing with 'a_macro!' + +error[E04029]: invalid function call + ┌─ tests/move_2024/typing/call_target_mismatch.move:11:24 + │ + 4 │ fun not_a_macro(_: X) { + │ ----------- Normal (non-'macro') function is declared here + · +11 │ X().not_a_macro!(); + │ ^ 'not_a_macro' is not a macro function and cannot be called with a `!`. Try replacing with 'not_a_macro' + +error[E04029]: invalid function call + ┌─ tests/move_2024/typing/call_target_mismatch.move:12:9 + │ + 6 │ macro fun a_macro(_: X) {} + │ ----- 'macro' function is declared here + · +12 │ X().a_macro(); + │ ^^^^^^^^^^^^^ 'a_macro' is a macro function and must be called with a `!`. Try replacing with 'a_macro!' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/clever_assertions_no_annotation.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/clever_assertions_no_annotation.exp deleted file mode 100644 index 02546dabd0511..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/clever_assertions_no_annotation.exp +++ /dev/null @@ -1,22 +0,0 @@ -error[E04035]: invalid constant usage in error context - ┌─ tests/move_2024/typing/clever_assertions_no_annotation.move:5:24 - │ -2 │ const X: vector = b"foo"; - │ - 'X' defined here with no '#[error]' annotation - · -5 │ assert!(false, X); - │ ^ Invalid error code for assertion, expected a u64 or constant declared with '#[error]' annotation - │ - = Non-u64 constants can only be used as error codes if the '#[error]' attribute is added to them. - -error[E04035]: invalid constant usage in error context - ┌─ tests/move_2024/typing/clever_assertions_no_annotation.move:9:15 - │ -2 │ const X: vector = b"foo"; - │ - 'X' defined here with no '#[error]' annotation - · -9 │ abort X - │ ^ Invalid error code for abort, expected a u64 or constant declared with '#[error]' annotation - │ - = Non-u64 constants can only be used as error codes if the '#[error]' attribute is added to them. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/clever_assertions_no_annotation.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/clever_assertions_no_annotation.snap new file mode 100644 index 0000000000000..f4cae429692c9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/clever_assertions_no_annotation.snap @@ -0,0 +1,29 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/clever_assertions_no_annotation.move +--- +error[E04035]: invalid constant usage in error context + ┌─ tests/move_2024/typing/clever_assertions_no_annotation.move:5:24 + │ +2 │ const X: vector = b"foo"; + │ - 'X' defined here with no '#[error]' annotation + · +5 │ assert!(false, X); + │ ^ Invalid error code for assertion, expected a u64 or constant declared with '#[error]' annotation + │ + = Non-u64 constants can only be used as error codes if the '#[error]' attribute is added to them. + +error[E04035]: invalid constant usage in error context + ┌─ tests/move_2024/typing/clever_assertions_no_annotation.move:9:15 + │ +2 │ const X: vector = b"foo"; + │ - 'X' defined here with no '#[error]' annotation + · +9 │ abort X + │ ^ Invalid error code for abort, expected a u64 or constant declared with '#[error]' annotation + │ + = Non-u64 constants can only be used as error codes if the '#[error]' attribute is added to them. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/const_method_subject.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/const_method_subject.snap new file mode 100644 index 0000000000000..2b7aab2d8b0e0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/const_method_subject.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/const_method_subject.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/const_method_subject_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/const_method_subject_invalid.exp deleted file mode 100644 index 604d75d5932eb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/const_method_subject_invalid.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[W04028]: implicit copy of a constant - ┌─ tests/move_2024/typing/const_method_subject_invalid.move:12:8 - │ -12 │ ZERO.add1_mut() - │ ^^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_2024/typing/const_method_subject_invalid.move:22:8 - │ -22 │ ZERO.deref_and_add() - │ ^^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/const_method_subject_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/const_method_subject_invalid.snap new file mode 100644 index 0000000000000..9d6ab50dd0ce8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/const_method_subject_invalid.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/const_method_subject_invalid.move +--- +warning[W04028]: implicit copy of a constant + ┌─ tests/move_2024/typing/const_method_subject_invalid.move:12:8 + │ +12 │ ZERO.add1_mut() + │ ^^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_2024/typing/const_method_subject_invalid.move:22:8 + │ +22 │ ZERO.deref_and_add() + │ ^^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/defines_primitive.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/defines_primitive.snap new file mode 100644 index 0000000000000..b9098237f74ec --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/defines_primitive.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/defines_primitive.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecated_macros.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecated_macros.exp deleted file mode 100644 index ba5059a343e6a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecated_macros.exp +++ /dev/null @@ -1,120 +0,0 @@ -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_macros.move:10:37 - │ -10 │ macro fun call_with_x($f: || -> X): X { - │ ^ The struct '0x42::m::X' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_macros.move:10:41 - │ -10 │ macro fun call_with_x($f: || -> X): X { - │ ^ The struct '0x42::m::X' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_macros.move:11:9 - │ -11 │ f(); - │ ^ The function '0x42::m::f' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_macros.move:16:9 - │ -16 │ f(); - │ ^ The function '0x42::m::f' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_macros.move:21:9 - │ -21 │ f(); - │ ^ The function '0x42::m::f' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_macros.move:26:9 - │ -26 │ f(); - │ ^ The function '0x42::m::f' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_macros.move:27:25 - │ -27 │ call_with_x!(|| X()); - │ ^ The struct '0x42::m::X' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_macros.move:31:9 - │ -31 │ f(); - │ ^ The function '0x42::m::f' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_macros.move:32:18 - │ -32 │ call!(|| X()); - │ ^ The struct '0x42::m::X' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_macros.move:33:20 - │ -33 │ call!(|| Y()); - │ ^ The struct '0x42::m::X' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_macros.move:34:22 - │ -34 │ call!(|| Y>()); - │ ^ The struct '0x42::m::X' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_macros.move:38:9 - │ -38 │ f(); - │ ^ The function '0x42::m::f' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_macros.move:39:25 - │ -39 │ call_unders!(|| X()); - │ ^ The struct '0x42::m::X' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_macros.move:40:27 - │ -40 │ call_unders!(|| Y()); - │ ^ The struct '0x42::m::X' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_macros.move:41:29 - │ -41 │ call_unders!(|| Y>()); - │ ^ The struct '0x42::m::X' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecated_macros.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecated_macros.snap new file mode 100644 index 0000000000000..c9b8121b929bf --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecated_macros.snap @@ -0,0 +1,127 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/deprecated_macros.move +--- +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_macros.move:10:37 + │ +10 │ macro fun call_with_x($f: || -> X): X { + │ ^ The struct '0x42::m::X' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_macros.move:10:41 + │ +10 │ macro fun call_with_x($f: || -> X): X { + │ ^ The struct '0x42::m::X' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_macros.move:11:9 + │ +11 │ f(); + │ ^ The function '0x42::m::f' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_macros.move:16:9 + │ +16 │ f(); + │ ^ The function '0x42::m::f' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_macros.move:21:9 + │ +21 │ f(); + │ ^ The function '0x42::m::f' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_macros.move:26:9 + │ +26 │ f(); + │ ^ The function '0x42::m::f' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_macros.move:27:25 + │ +27 │ call_with_x!(|| X()); + │ ^ The struct '0x42::m::X' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_macros.move:31:9 + │ +31 │ f(); + │ ^ The function '0x42::m::f' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_macros.move:32:18 + │ +32 │ call!(|| X()); + │ ^ The struct '0x42::m::X' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_macros.move:33:20 + │ +33 │ call!(|| Y()); + │ ^ The struct '0x42::m::X' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_macros.move:34:22 + │ +34 │ call!(|| Y>()); + │ ^ The struct '0x42::m::X' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_macros.move:38:9 + │ +38 │ f(); + │ ^ The function '0x42::m::f' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_macros.move:39:25 + │ +39 │ call_unders!(|| X()); + │ ^ The struct '0x42::m::X' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_macros.move:40:27 + │ +40 │ call_unders!(|| Y()); + │ ^ The struct '0x42::m::X' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_macros.move:41:29 + │ +41 │ call_unders!(|| Y>()); + │ ^ The struct '0x42::m::X' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecated_ty_params.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecated_ty_params.exp deleted file mode 100644 index 775f6c163fac2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecated_ty_params.exp +++ /dev/null @@ -1,48 +0,0 @@ -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_ty_params.move:9:19 - │ -9 │ let _ = Y(); - │ ^ The struct '0x42::m::X' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_ty_params.move:10:15 - │ -10 │ let Y() = Y(); - │ ^ The struct '0x42::m::X' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_ty_params.move:10:24 - │ -10 │ let Y() = Y(); - │ ^ The struct '0x42::m::X' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_ty_params.move:16:11 - │ -16 │ g(); - │ ^ The struct '0x42::m::X' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_ty_params.move:17:13 - │ -17 │ g>(); - │ ^ The struct '0x42::m::X' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecated_ty_params.move:18:19 - │ -18 │ g>>>>(); - │ ^ The struct '0x42::m::X' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecated_ty_params.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecated_ty_params.snap new file mode 100644 index 0000000000000..da191bf0148e7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecated_ty_params.snap @@ -0,0 +1,55 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/deprecated_ty_params.move +--- +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_ty_params.move:9:19 + │ +9 │ let _ = Y(); + │ ^ The struct '0x42::m::X' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_ty_params.move:10:15 + │ +10 │ let Y() = Y(); + │ ^ The struct '0x42::m::X' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_ty_params.move:10:24 + │ +10 │ let Y() = Y(); + │ ^ The struct '0x42::m::X' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_ty_params.move:16:11 + │ +16 │ g(); + │ ^ The struct '0x42::m::X' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_ty_params.move:17:13 + │ +17 │ g>(); + │ ^ The struct '0x42::m::X' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecated_ty_params.move:18:19 + │ +18 │ g>>>>(); + │ ^ The struct '0x42::m::X' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecation_inter_module_calls.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecation_inter_module_calls.exp deleted file mode 100644 index 18cc37dc16194..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecation_inter_module_calls.exp +++ /dev/null @@ -1,112 +0,0 @@ -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:23:12 - │ -23 │ f: X, - │ ^ The '0x7::l::X' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:27:14 - │ -27 │ Some(X), - │ ^ The '0x7::l::X' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:28:20 - │ -28 │ Other { y: X }, - │ ^ The '0x7::l::X' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:38:24 - │ -38 │ public fun lol(_: &X) { } - │ ^ The '0x7::l::X' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:40:32 - │ -40 │ public fun quux(x: 0x7::l::X) { - │ ^ The '0x7::l::X' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:41:17 - │ -41 │ 0x7::l::foo(); - │ ^^^ The '0x7::l::foo' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:42:11 - │ -42 │ x.bar(); - │ ^^^ The method 'bar' resolves to the function '0x7::l::bar' in the module '0x7::l' which is deprecated. This function, and the method are deprecated since the whole module is marked deprecated: Use the k module instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:47:12 - │ -47 │ l::foo(); - │ ^^^ The '0x7::l::foo' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:52:34 - │ -52 │ public fun dep_meth_call(x: &X) { - │ ^ The '0x7::l::X' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:53:11 - │ -53 │ x.bar(); - │ ^^^ The method 'bar' resolves to the function '0x7::l::bar' in the module '0x7::l' which is deprecated. This function, and the method are deprecated since the whole module is marked deprecated: Use the k module instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:58:11 - │ -58 │ x.lol(); - │ ^^^ The method 'lol' resolves to the function '0x7::l::other_dep' which is deprecated: More specific deprecations override less specific ones. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:59:11 - │ -59 │ x.rofl(); - │ ^^^^ The method 'rofl' resolves to the function '0x7::l::other' in the module '0x7::l' which is deprecated. This function, and the method are deprecated since the whole module is marked deprecated: Use the k module instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:66:33 - │ -66 │ let _ = T::Some(0x7::l::make_x()); - │ ^^^^^^ The '0x7::l::make_x' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:67:39 - │ -67 │ let _ = T::Other { y: 0x7::l::make_x()}; - │ ^^^^^^ The '0x7::l::make_x' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecation_inter_module_calls.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecation_inter_module_calls.snap new file mode 100644 index 0000000000000..fb10b629e4adc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecation_inter_module_calls.snap @@ -0,0 +1,119 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/deprecation_inter_module_calls.move +--- +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:23:12 + │ +23 │ f: X, + │ ^ The '0x7::l::X' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:27:14 + │ +27 │ Some(X), + │ ^ The '0x7::l::X' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:28:20 + │ +28 │ Other { y: X }, + │ ^ The '0x7::l::X' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:38:24 + │ +38 │ public fun lol(_: &X) { } + │ ^ The '0x7::l::X' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:40:32 + │ +40 │ public fun quux(x: 0x7::l::X) { + │ ^ The '0x7::l::X' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:41:17 + │ +41 │ 0x7::l::foo(); + │ ^^^ The '0x7::l::foo' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:42:11 + │ +42 │ x.bar(); + │ ^^^ The method 'bar' resolves to the function '0x7::l::bar' in the module '0x7::l' which is deprecated. This function, and the method are deprecated since the whole module is marked deprecated: Use the k module instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:47:12 + │ +47 │ l::foo(); + │ ^^^ The '0x7::l::foo' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:52:34 + │ +52 │ public fun dep_meth_call(x: &X) { + │ ^ The '0x7::l::X' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:53:11 + │ +53 │ x.bar(); + │ ^^^ The method 'bar' resolves to the function '0x7::l::bar' in the module '0x7::l' which is deprecated. This function, and the method are deprecated since the whole module is marked deprecated: Use the k module instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:58:11 + │ +58 │ x.lol(); + │ ^^^ The method 'lol' resolves to the function '0x7::l::other_dep' which is deprecated: More specific deprecations override less specific ones. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:59:11 + │ +59 │ x.rofl(); + │ ^^^^ The method 'rofl' resolves to the function '0x7::l::other' in the module '0x7::l' which is deprecated. This function, and the method are deprecated since the whole module is marked deprecated: Use the k module instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:66:33 + │ +66 │ let _ = T::Some(0x7::l::make_x()); + │ ^^^^^^ The '0x7::l::make_x' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_inter_module_calls.move:67:39 + │ +67 │ let _ = T::Other { y: 0x7::l::make_x()}; + │ ^^^^^^ The '0x7::l::make_x' member of the module '0x7::l' is deprecated. It is deprecated since its whole module is marked deprecated: Use the k module instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecation_intra_module_calls.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecation_intra_module_calls.exp deleted file mode 100644 index 92ff5c4df6bac..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecation_intra_module_calls.exp +++ /dev/null @@ -1,128 +0,0 @@ -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:8:21 - │ -8 │ public struct Z(Y) has drop; - │ ^ The struct '0x7::l::Y' is deprecated: Use the other struct instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:15:26 - │ -15 │ public fun other(y: &Y): &Y { y } - │ ^ The struct '0x7::l::Y' is deprecated: Use the other struct instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:15:31 - │ -15 │ public fun other(y: &Y): &Y { y } - │ ^ The struct '0x7::l::Y' is deprecated: Use the other struct instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:21:9 - │ -21 │ internal(); - │ ^^^^^^^^ The function '0x7::l::internal' is deprecated: This is a deprecated function within a deprecated module. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:23:17 - │ -23 │ let y = other(&Y()); - │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:23:24 - │ -23 │ let y = other(&Y()); - │ ^ The struct '0x7::l::Y' is deprecated: Use the other struct instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:9 - │ -26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); - │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:15 - │ -26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); - │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:21 - │ -26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); - │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:27 - │ -26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); - │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:33 - │ -26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); - │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:39 - │ -26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); - │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:45 - │ -26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); - │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:51 - │ -26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); - │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:57 - │ -26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); - │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:63 - │ -26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); - │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecation_intra_module_calls.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecation_intra_module_calls.snap new file mode 100644 index 0000000000000..50c7635acf58f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecation_intra_module_calls.snap @@ -0,0 +1,135 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/deprecation_intra_module_calls.move +--- +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:8:21 + │ +8 │ public struct Z(Y) has drop; + │ ^ The struct '0x7::l::Y' is deprecated: Use the other struct instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:15:26 + │ +15 │ public fun other(y: &Y): &Y { y } + │ ^ The struct '0x7::l::Y' is deprecated: Use the other struct instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:15:31 + │ +15 │ public fun other(y: &Y): &Y { y } + │ ^ The struct '0x7::l::Y' is deprecated: Use the other struct instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:21:9 + │ +21 │ internal(); + │ ^^^^^^^^ The function '0x7::l::internal' is deprecated: This is a deprecated function within a deprecated module. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:23:17 + │ +23 │ let y = other(&Y()); + │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:23:24 + │ +23 │ let y = other(&Y()); + │ ^ The struct '0x7::l::Y' is deprecated: Use the other struct instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:9 + │ +26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); + │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:15 + │ +26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); + │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:21 + │ +26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); + │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:27 + │ +26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); + │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:33 + │ +26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); + │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:39 + │ +26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); + │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:45 + │ +26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); + │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:51 + │ +26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); + │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:57 + │ +26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); + │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_intra_module_calls.move:26:63 + │ +26 │ other(other(other(other(other(other(other(other(other(other(y)))))))))); + │ ^^^^^ The function '0x7::l::other' is deprecated: Use the other function instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecation_use_in_constants.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecation_use_in_constants.exp deleted file mode 100644 index f1290d757cb6e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecation_use_in_constants.exp +++ /dev/null @@ -1,32 +0,0 @@ -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_use_in_constants.move:15:9 - │ -15 │ A + B + C + D + E + B - │ ^ The constant '0x42::m::A' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_use_in_constants.move:15:13 - │ -15 │ A + B + C + D + E + B - │ ^ The constant '0x42::m::B' is deprecated: use D instead - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_use_in_constants.move:15:17 - │ -15 │ A + B + C + D + E + B - │ ^ The constant '0x42::m::C' is deprecated: You should use E instead - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/deprecation_use_in_constants.move:15:29 - │ -15 │ A + B + C + D + E + B - │ ^ The constant '0x42::m::B' is deprecated: use D instead - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecation_use_in_constants.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecation_use_in_constants.snap new file mode 100644 index 0000000000000..167321f9bc67b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/deprecation_use_in_constants.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/deprecation_use_in_constants.move +--- +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_use_in_constants.move:15:9 + │ +15 │ A + B + C + D + E + B + │ ^ The constant '0x42::m::A' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_use_in_constants.move:15:13 + │ +15 │ A + B + C + D + E + B + │ ^ The constant '0x42::m::B' is deprecated: use D instead + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_use_in_constants.move:15:17 + │ +15 │ A + B + C + D + E + B + │ ^ The constant '0x42::m::C' is deprecated: You should use E instead + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/deprecation_use_in_constants.move:15:29 + │ +15 │ A + B + C + D + E + B + │ ^ The constant '0x42::m::B' is deprecated: use D instead + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_fails_to_resolve_help.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_fails_to_resolve_help.exp deleted file mode 100644 index e54579452a139..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_fails_to_resolve_help.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_fails_to_resolve_help.move:31:9 - │ -13 │ public fun zero(): Point { - │ ---- The function 'a::space::zero' exists, but it takes no arguments - · -31 │ p.zero(); - │ ^^^^^^^^ Invalid method call. No known method 'zero' on type 'a::space::Point' - -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_fails_to_resolve_help.move:32:9 - │ -21 │ public fun len(_: &Line): u64 { - │ ----- The function 'a::space::len' exists, but it has a different type for its first argument, '&a::space::Line' - · -32 │ p.len(); - │ ^^^^^^^ Invalid method call. No known method 'len' on type 'a::space::Point' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_fails_to_resolve_help.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_fails_to_resolve_help.snap new file mode 100644 index 0000000000000..5f6ec075f365b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_fails_to_resolve_help.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/dot_call_fails_to_resolve_help.move +--- +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_fails_to_resolve_help.move:31:9 + │ +13 │ public fun zero(): Point { + │ ---- The function 'a::space::zero' exists, but it takes no arguments + · +31 │ p.zero(); + │ ^^^^^^^^ Invalid method call. No known method 'zero' on type 'a::space::Point' + +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_fails_to_resolve_help.move:32:9 + │ +21 │ public fun len(_: &Line): u64 { + │ ----- The function 'a::space::len' exists, but it has a different type for its first argument, '&a::space::Line' + · +32 │ p.len(); + │ ^^^^^^^ Invalid method call. No known method 'len' on type 'a::space::Point' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_fails_to_resolve_help_under_alias.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_fails_to_resolve_help_under_alias.exp deleted file mode 100644 index a20b42739e9ab..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_fails_to_resolve_help_under_alias.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_fails_to_resolve_help_under_alias.move:34:9 - │ -34 │ p.z(); - │ ^^^^^ - │ │ │ - │ │ No local 'use fun' alias was found for 'a::space::Point.z', and no function 'z' was found in the defining module 'a::space' - │ Invalid method call. No known method 'z' on type 'a::space::Point' - -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_fails_to_resolve_help_under_alias.move:35:9 - │ -35 │ p.l(); - │ ^^^^^ - │ │ │ - │ │ No local 'use fun' alias was found for 'a::space::Point.l', and no function 'l' was found in the defining module 'a::space' - │ Invalid method call. No known method 'l' on type 'a::space::Point' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_fails_to_resolve_help_under_alias.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_fails_to_resolve_help_under_alias.snap new file mode 100644 index 0000000000000..79ccd1fb6c294 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_fails_to_resolve_help_under_alias.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/dot_call_fails_to_resolve_help_under_alias.move +--- +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_fails_to_resolve_help_under_alias.move:34:9 + │ +34 │ p.z(); + │ ^^^^^ + │ │ │ + │ │ No local 'use fun' alias was found for 'a::space::Point.z', and no function 'z' was found in the defining module 'a::space' + │ Invalid method call. No known method 'z' on type 'a::space::Point' + +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_fails_to_resolve_help_under_alias.move:35:9 + │ +35 │ p.l(); + │ ^^^^^ + │ │ │ + │ │ No local 'use fun' alias was found for 'a::space::Point.l', and no function 'l' was found in the defining module 'a::space' + │ Invalid method call. No known method 'l' on type 'a::space::Point' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_mut_ref.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_mut_ref.snap new file mode 100644 index 0000000000000..cd46e8ccacfec --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_mut_ref.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/dot_call_mut_ref.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_no_parameters.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_no_parameters.exp deleted file mode 100644 index f3e1e8889a666..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_no_parameters.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_no_parameters.move:9:5 - │ -6 │ fun h() {} - │ - The function '0x42::t::h' exists, but it takes no arguments - · -9 │ x.h(); - │ ^^^^^ Invalid method call. No known method 'h' on type '0x42::t::X' - -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_no_parameters.move:13:5 - │ - 6 │ fun h() {} - │ - The function '0x42::t::h' exists, but it takes no arguments - · -13 │ y.x.h(); - │ ^^^^^^^ Invalid method call. No known method 'h' on type '0x42::t::X' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_no_parameters.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_no_parameters.snap new file mode 100644 index 0000000000000..92c6578bcf2f4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_no_parameters.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/dot_call_no_parameters.move +--- +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_no_parameters.move:9:5 + │ +6 │ fun h() {} + │ - The function '0x42::t::h' exists, but it takes no arguments + · +9 │ x.h(); + │ ^^^^^ Invalid method call. No known method 'h' on type '0x42::t::X' + +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_no_parameters.move:13:5 + │ + 6 │ fun h() {} + │ - The function '0x42::t::h' exists, but it takes no arguments + · +13 │ y.x.h(); + │ ^^^^^^^ Invalid method call. No known method 'h' on type '0x42::t::X' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_non_struct.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_non_struct.exp deleted file mode 100644 index 72686085d4c6e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_non_struct.exp +++ /dev/null @@ -1,120 +0,0 @@ -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/dot_call_non_struct.move:6:9 - │ -6 │ let x; - │ ^ Could not infer this type. Try adding an annotation - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/dot_call_non_struct.move:8:15 - │ -8 │ let cup = Cup { value: x }; - │ ^^^^^^^^^^^^^^^^ Could not infer this type. Try adding an annotation - -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_non_struct.move:9:5 - │ -9 │ 0.f(); - │ ^^^^^ - │ │ - │ Invalid method call - │ Unable to infer type for method call. Try annotating this type - -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_non_struct.move:10:5 - │ -10 │ 0u64.f(); - │ ^^^^^^^^ - │ │ │ - │ │ No local 'use fun' alias was found for 'u64.f', and no function 'f' was found in the defining module 'std::u64' - │ Invalid method call. No known method 'f' on type 'u64' - -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_non_struct.move:11:5 - │ -11 │ ().f(); - │ ^^^^^^ - │ │ - │ Invalid method call - │ Method calls are only supported on single types. Got an expression of type: '()' - -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_non_struct.move:12:5 - │ -12 │ (0, 1).f(); - │ ^^^^^^^^^^ - │ │ - │ Invalid method call - │ Method calls are only supported on single types. Got an expression of type: '({integer}, {integer})' - -error[E04005]: expected a single type - ┌─ tests/move_2024/typing/dot_call_non_struct.move:13:5 - │ -13 │ ().f.f(); - │ ^^ - │ │ - │ Invalid dot access - │ Expected a single type, but found expression list type: '()' - -error[E04009]: expected specific type - ┌─ tests/move_2024/typing/dot_call_non_struct.move:13:5 - │ -13 │ ().f.f(); - │ ^^^^ - │ │ - │ Unbound field 'f' - │ Expected a struct type in the current module but got: '()' - -error[E04005]: expected a single type - ┌─ tests/move_2024/typing/dot_call_non_struct.move:14:5 - │ -14 │ (0, 1).f.f(); - │ ^^^^^^ - │ │ - │ Invalid dot access - │ Expected a single type, but found expression list type: '(u64, u64)' - -error[E04009]: expected specific type - ┌─ tests/move_2024/typing/dot_call_non_struct.move:14:5 - │ -14 │ (0, 1).f.f(); - │ ^^^^^^^^ - │ │ - │ Unbound field 'f' - │ Expected a struct type in the current module but got: '({integer}, {integer})' - -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_non_struct.move:15:5 - │ - 6 │ let x; - │ - Unable to infer type for method call. Try annotating this type - · -15 │ x.f(); - │ ^^^^^ Invalid method call - -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_non_struct.move:16:5 - │ - 6 │ let x; - │ - Unable to infer type for method call. Try annotating this type - · -16 │ y.f(); - │ ^^^^^ Invalid method call - -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_non_struct.move:17:5 - │ - 8 │ let cup = Cup { value: x }; - │ ---------------- Unable to infer type for method call. Try annotating this type - · -17 │ cup.value.f(); - │ ^^^^^^^^^^^^^ Invalid method call - -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_non_struct.move:18:5 - │ - 5 │ fun call(t: T) { - │ - Method calls are not supported on type parameters. Got an expression of type: 'T' - · -18 │ t.f(); - │ ^^^^^ Invalid method call - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_non_struct.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_non_struct.snap new file mode 100644 index 0000000000000..0fc436b668cf9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_non_struct.snap @@ -0,0 +1,127 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/dot_call_non_struct.move +--- +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/dot_call_non_struct.move:6:9 + │ +6 │ let x; + │ ^ Could not infer this type. Try adding an annotation + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/dot_call_non_struct.move:8:15 + │ +8 │ let cup = Cup { value: x }; + │ ^^^^^^^^^^^^^^^^ Could not infer this type. Try adding an annotation + +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_non_struct.move:9:5 + │ +9 │ 0.f(); + │ ^^^^^ + │ │ + │ Invalid method call + │ Unable to infer type for method call. Try annotating this type + +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_non_struct.move:10:5 + │ +10 │ 0u64.f(); + │ ^^^^^^^^ + │ │ │ + │ │ No local 'use fun' alias was found for 'u64.f', and no function 'f' was found in the defining module 'std::u64' + │ Invalid method call. No known method 'f' on type 'u64' + +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_non_struct.move:11:5 + │ +11 │ ().f(); + │ ^^^^^^ + │ │ + │ Invalid method call + │ Method calls are only supported on single types. Got an expression of type: '()' + +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_non_struct.move:12:5 + │ +12 │ (0, 1).f(); + │ ^^^^^^^^^^ + │ │ + │ Invalid method call + │ Method calls are only supported on single types. Got an expression of type: '({integer}, {integer})' + +error[E04005]: expected a single type + ┌─ tests/move_2024/typing/dot_call_non_struct.move:13:5 + │ +13 │ ().f.f(); + │ ^^ + │ │ + │ Invalid dot access + │ Expected a single type, but found expression list type: '()' + +error[E04009]: expected specific type + ┌─ tests/move_2024/typing/dot_call_non_struct.move:13:5 + │ +13 │ ().f.f(); + │ ^^^^ + │ │ + │ Unbound field 'f' + │ Expected a struct type in the current module but got: '()' + +error[E04005]: expected a single type + ┌─ tests/move_2024/typing/dot_call_non_struct.move:14:5 + │ +14 │ (0, 1).f.f(); + │ ^^^^^^ + │ │ + │ Invalid dot access + │ Expected a single type, but found expression list type: '(u64, u64)' + +error[E04009]: expected specific type + ┌─ tests/move_2024/typing/dot_call_non_struct.move:14:5 + │ +14 │ (0, 1).f.f(); + │ ^^^^^^^^ + │ │ + │ Unbound field 'f' + │ Expected a struct type in the current module but got: '({integer}, {integer})' + +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_non_struct.move:15:5 + │ + 6 │ let x; + │ - Unable to infer type for method call. Try annotating this type + · +15 │ x.f(); + │ ^^^^^ Invalid method call + +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_non_struct.move:16:5 + │ + 6 │ let x; + │ - Unable to infer type for method call. Try annotating this type + · +16 │ y.f(); + │ ^^^^^ Invalid method call + +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_non_struct.move:17:5 + │ + 8 │ let cup = Cup { value: x }; + │ ---------------- Unable to infer type for method call. Try annotating this type + · +17 │ cup.value.f(); + │ ^^^^^^^^^^^^^ Invalid method call + +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_non_struct.move:18:5 + │ + 5 │ fun call(t: T) { + │ - Method calls are not supported on type parameters. Got an expression of type: 'T' + · +18 │ t.f(); + │ ^^^^^ Invalid method call diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_owned.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_owned.snap new file mode 100644 index 0000000000000..5e5a8aeb57a43 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_owned.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/dot_call_owned.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_owned_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_owned_invalid.exp deleted file mode 100644 index 67e6ea831da07..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_owned_invalid.exp +++ /dev/null @@ -1,33 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/dot_call_owned_invalid.move:9:5 - │ -6 │ fun f(_self: X) {} - │ - Expected: '0x42::t::X' -7 │ -8 │ public fun foo (x: &X, y1: Y, y2: &Y) { - │ -- Given: '&0x42::t::X' -9 │ x.f(); - │ ^^^^^ Invalid call of '0x42::t::f'. Invalid argument for parameter '_self' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/dot_call_owned_invalid.move:10:5 - │ - 3 │ public struct X has drop {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here - 4 │ public struct Y has drop { x: X } - │ - The type '0x42::t::X' does not have the ability 'copy' - · -10 │ y1.x.f(); - │ ^^^^^^^^ Invalid implicit copy of field 'x' without the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/dot_call_owned_invalid.move:11:5 - │ - 3 │ public struct X has drop {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here - 4 │ public struct Y has drop { x: X } - │ - The type '0x42::t::X' does not have the ability 'copy' - · -11 │ y2.x.f(); - │ ^^^^^^^^ Invalid implicit copy of field 'x' without the 'copy' ability - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_owned_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_owned_invalid.snap new file mode 100644 index 0000000000000..aa26b86401416 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_owned_invalid.snap @@ -0,0 +1,40 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/dot_call_owned_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/dot_call_owned_invalid.move:9:5 + │ +6 │ fun f(_self: X) {} + │ - Expected: '0x42::t::X' +7 │ +8 │ public fun foo (x: &X, y1: Y, y2: &Y) { + │ -- Given: '&0x42::t::X' +9 │ x.f(); + │ ^^^^^ Invalid call of '0x42::t::f'. Invalid argument for parameter '_self' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/dot_call_owned_invalid.move:10:5 + │ + 3 │ public struct X has drop {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here + 4 │ public struct Y has drop { x: X } + │ - The type '0x42::t::X' does not have the ability 'copy' + · +10 │ y1.x.f(); + │ ^^^^^^^^ Invalid implicit copy of field 'x' without the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/dot_call_owned_invalid.move:11:5 + │ + 3 │ public struct X has drop {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here + 4 │ public struct Y has drop { x: X } + │ - The type '0x42::t::X' does not have the ability 'copy' + · +11 │ y2.x.f(); + │ ^^^^^^^^ Invalid implicit copy of field 'x' without the 'copy' ability diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_private.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_private.exp deleted file mode 100644 index 953ffc3511b23..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_private.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/dot_call_private.move:16:5 - │ - 5 │ fun f(_self: &X) {} - │ - This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module - · -16 │ x.f(); - │ ^^^^^ Invalid call to internal function '0x42::t::f' - -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/dot_call_private.move:17:5 - │ - 5 │ fun f(_self: &X) {} - │ - This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module - · -17 │ y.x.f(); - │ ^^^^^^^ Invalid call to internal function '0x42::t::f' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_private.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_private.snap new file mode 100644 index 0000000000000..f4d0f9af968dc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_private.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/dot_call_private.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/dot_call_private.move:16:5 + │ + 5 │ fun f(_self: &X) {} + │ - This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module + · +16 │ x.f(); + │ ^^^^^ Invalid call to internal function '0x42::t::f' + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/dot_call_private.move:17:5 + │ + 5 │ fun f(_self: &X) {} + │ - This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module + · +17 │ y.x.f(); + │ ^^^^^^^ Invalid call to internal function '0x42::t::f' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_private_field.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_private_field.exp deleted file mode 100644 index 55d68890c59a5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_private_field.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/dot_call_private_field.move:13:5 - │ -13 │ y.x.f() - │ ^^^ Invalid access of field 'x' on the struct '0x42::t::Y'. The field 'x' can only be accessed within the module '0x42::t' since it defines 'Y' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_private_field.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_private_field.snap new file mode 100644 index 0000000000000..3bff8b3e98c5f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_private_field.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/dot_call_private_field.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/dot_call_private_field.move:13:5 + │ +13 │ y.x.f() + │ ^^^ Invalid access of field 'x' on the struct '0x42::t::Y'. The field 'x' can only be accessed within the module '0x42::t' since it defines 'Y' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_public.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_public.snap new file mode 100644 index 0000000000000..fc0c336158d88 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_public.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/dot_call_public.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_ref.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_ref.snap new file mode 100644 index 0000000000000..7bd0fa4d09f58 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_ref.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/dot_call_ref.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_ref_mut_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_ref_mut_invalid.exp deleted file mode 100644 index 565d94eb020b0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_ref_mut_invalid.exp +++ /dev/null @@ -1,19 +0,0 @@ -error[E04006]: invalid subtype - ┌─ tests/move_2024/typing/dot_call_ref_mut_invalid.move:9:5 - │ -6 │ fun f(_self: &mut X) {} - │ ------ Expected: '&mut 0x42::t::X' -7 │ -8 │ public fun foo(x: &X) { - │ -- Given: '&0x42::t::X' -9 │ x.f(); - │ ^^^^^ Invalid call of '0x42::t::f'. Invalid argument for parameter '_self' - -error[E07001]: referential transparency violated - ┌─ tests/move_2024/typing/dot_call_ref_mut_invalid.move:13:5 - │ -12 │ public fun bar(y: &Y) { - │ -- Immutable because of this position -13 │ y.x.f(); - │ ^^^^^^^ Invalid mutable borrow from an immutable reference - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_ref_mut_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_ref_mut_invalid.snap new file mode 100644 index 0000000000000..b6ca48eee0039 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_ref_mut_invalid.snap @@ -0,0 +1,26 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/dot_call_ref_mut_invalid.move +--- +error[E04006]: invalid subtype + ┌─ tests/move_2024/typing/dot_call_ref_mut_invalid.move:9:5 + │ +6 │ fun f(_self: &mut X) {} + │ ------ Expected: '&mut 0x42::t::X' +7 │ +8 │ public fun foo(x: &X) { + │ -- Given: '&0x42::t::X' +9 │ x.f(); + │ ^^^^^ Invalid call of '0x42::t::f'. Invalid argument for parameter '_self' + +error[E07001]: referential transparency violated + ┌─ tests/move_2024/typing/dot_call_ref_mut_invalid.move:13:5 + │ +12 │ public fun bar(y: &Y) { + │ -- Immutable because of this position +13 │ y.x.f(); + │ ^^^^^^^ Invalid mutable borrow from an immutable reference diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_unbound.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_unbound.exp deleted file mode 100644 index 3053fc405a760..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_unbound.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_unbound.move:6:5 - │ -6 │ x.f(); - │ ^^^^^ - │ │ │ - │ │ No local 'use fun' alias was found for '0x42::t::X.f', and no function 'f' was found in the defining module '0x42::t' - │ Invalid method call. No known method 'f' on type '0x42::t::X' - -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_unbound.move:18:5 - │ -18 │ x.f(); - │ ^^^^^ - │ │ │ - │ │ No local 'use fun' alias was found for '0x42::t::X.f', and no function 'f' was found in the defining module '0x42::t' - │ Invalid method call. No known method 'f' on type '0x42::t::X' - -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_unbound.move:19:5 - │ -19 │ y.x.f(); - │ ^^^^^^^ - │ │ │ - │ │ No local 'use fun' alias was found for '0x42::t::X.f', and no function 'f' was found in the defining module '0x42::t' - │ Invalid method call. No known method 'f' on type '0x42::t::X' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_unbound.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_unbound.snap new file mode 100644 index 0000000000000..d673520b78d8a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_unbound.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/dot_call_unbound.move +--- +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_unbound.move:6:5 + │ +6 │ x.f(); + │ ^^^^^ + │ │ │ + │ │ No local 'use fun' alias was found for '0x42::t::X.f', and no function 'f' was found in the defining module '0x42::t' + │ Invalid method call. No known method 'f' on type '0x42::t::X' + +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_unbound.move:18:5 + │ +18 │ x.f(); + │ ^^^^^ + │ │ │ + │ │ No local 'use fun' alias was found for '0x42::t::X.f', and no function 'f' was found in the defining module '0x42::t' + │ Invalid method call. No known method 'f' on type '0x42::t::X' + +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_unbound.move:19:5 + │ +19 │ y.x.f(); + │ ^^^^^^^ + │ │ │ + │ │ No local 'use fun' alias was found for '0x42::t::X.f', and no function 'f' was found in the defining module '0x42::t' + │ Invalid method call. No known method 'f' on type '0x42::t::X' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_wrong_type_in_module.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_wrong_type_in_module.exp deleted file mode 100644 index 6f1e9935bd02f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_wrong_type_in_module.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_wrong_type_in_module.move:10:5 - │ - 7 │ fun g(_self: Z) {} - │ - The function '0x42::t::g' exists, but it has a different type for its first argument, '0x42::t::Z' - · -10 │ x.g(); - │ ^^^^^ Invalid method call. No known method 'g' on type '0x42::t::X' - -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/dot_call_wrong_type_in_module.move:14:5 - │ - 7 │ fun g(_self: Z) {} - │ - The function '0x42::t::g' exists, but it has a different type for its first argument, '0x42::t::Z' - · -14 │ y.x.g(); - │ ^^^^^^^ Invalid method call. No known method 'g' on type '0x42::t::X' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_wrong_type_in_module.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_wrong_type_in_module.snap new file mode 100644 index 0000000000000..a44b0604a26b2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/dot_call_wrong_type_in_module.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/dot_call_wrong_type_in_module.move +--- +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_wrong_type_in_module.move:10:5 + │ + 7 │ fun g(_self: Z) {} + │ - The function '0x42::t::g' exists, but it has a different type for its first argument, '0x42::t::Z' + · +10 │ x.g(); + │ ^^^^^ Invalid method call. No known method 'g' on type '0x42::t::X' + +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/dot_call_wrong_type_in_module.move:14:5 + │ + 7 │ fun g(_self: Z) {} + │ - The function '0x42::t::g' exists, but it has a different type for its first argument, '0x42::t::Z' + · +14 │ y.x.g(); + │ ^^^^^^^ Invalid method call. No known method 'g' on type '0x42::t::X' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/duplicate_defines_primitive.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/duplicate_defines_primitive.exp deleted file mode 100644 index 8d45aad08e11a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/duplicate_defines_primitive.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E10004]: invalid usage of known attribute - ┌─ tests/move_2024/typing/duplicate_defines_primitive.move:4:3 - │ -2 │ module a::m {} - │ - Previously declared here -3 │ -4 │ #[defines_primitive(signer)] - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Duplicate definer annotated for primitive type 'signer' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/duplicate_defines_primitive.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/duplicate_defines_primitive.snap new file mode 100644 index 0000000000000..56b0ed30bcec8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/duplicate_defines_primitive.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/duplicate_defines_primitive.move +--- +error[E10004]: invalid usage of known attribute + ┌─ tests/move_2024/typing/duplicate_defines_primitive.move:4:3 + │ +2 │ module a::m {} + │ - Previously declared here +3 │ +4 │ #[defines_primitive(signer)] + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Duplicate definer annotated for primitive type 'signer' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_invalid.exp deleted file mode 100644 index 4a75dabc55ee2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_invalid.exp +++ /dev/null @@ -1,132 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/eq_invalid.move:12:17 - │ -12 │ (0: u8) == (1: u128); - │ -- ^^ ---- Found: 'u128'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '==' - │ Found: 'u8'. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/eq_invalid.move:13:11 - │ -13 │ 0 == false; - │ - ^^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '==' - │ Found: integer. It is not compatible with the other type. - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_invalid.move:21:9 - │ - 3 │ public struct R has key { - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -20 │ fun t1(r: R) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' -21 │ r == r; - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_invalid.move:21:14 - │ - 3 │ public struct R has key { - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -20 │ fun t1(r: R) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' -21 │ r == r; - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_invalid.move:25:9 - │ -25 │ G0{ f: R { f: 1 } } == G0{ f: R { f: 1 } }; - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::G0<0x8675309::M::R>' can have the ability 'drop' but the type argument '0x8675309::M::R' does not have the required ability 'drop' - │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x8675309::M::G0<0x8675309::M::R>' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_invalid.move:25:35 - │ -25 │ G0{ f: R { f: 1 } } == G0{ f: R { f: 1 } }; - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::G0<0x8675309::M::R>' can have the ability 'drop' but the type argument '0x8675309::M::R' does not have the required ability 'drop' - │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x8675309::M::G0<0x8675309::M::R>' does not have the ability 'drop' - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/eq_invalid.move:27:9 - │ -27 │ G2{} == G2{}; - │ ^^^^ Could not infer this type. Try adding an annotation - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/eq_invalid.move:27:17 - │ -27 │ G2{} == G2{}; - │ ^^^^ Could not infer this type. Try adding an annotation - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_invalid.move:28:9 - │ - 7 │ public struct G1 { f: T } - │ -- To satisfy the constraint, the 'drop' ability would need to be added here - · -28 │ G1{ f: t } == G1{ f: t }; - │ ^^^^^^^^^^ - │ │ - │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x8675309::M::G1' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_invalid.move:28:23 - │ - 7 │ public struct G1 { f: T } - │ -- To satisfy the constraint, the 'drop' ability would need to be added here - · -28 │ G1{ f: t } == G1{ f: t }; - │ ^^^^^^^^^^ - │ │ - │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x8675309::M::G1' does not have the ability 'drop' - -error[E04005]: expected a single type - ┌─ tests/move_2024/typing/eq_invalid.move:32:9 - │ -32 │ () == (); - │ ^^^^^^^^ - │ │ │ - │ │ Expected a single type, but found expression list type: '()' - │ Incompatible arguments to '==' - -error[E04005]: expected a single type - ┌─ tests/move_2024/typing/eq_invalid.move:33:9 - │ -33 │ (0, 1) == (0, 1); - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single type, but found expression list type: '(u64, u64)' - │ Incompatible arguments to '==' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/eq_invalid.move:34:19 - │ -34 │ (1, 2, 3) == (0, 1); - │ --------- ^^ ------ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - │ │ │ - │ │ Incompatible arguments to '==' - │ Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/eq_invalid.move:35:16 - │ -35 │ (0, 1) == (1, 2, 3); - │ ------ ^^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - │ │ │ - │ │ Incompatible arguments to '==' - │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_invalid.snap new file mode 100644 index 0000000000000..ecc64a53d9902 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_invalid.snap @@ -0,0 +1,139 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/eq_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/eq_invalid.move:12:17 + │ +12 │ (0: u8) == (1: u128); + │ -- ^^ ---- Found: 'u128'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '==' + │ Found: 'u8'. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/eq_invalid.move:13:11 + │ +13 │ 0 == false; + │ - ^^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '==' + │ Found: integer. It is not compatible with the other type. + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_invalid.move:21:9 + │ + 3 │ public struct R has key { + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +20 │ fun t1(r: R) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' +21 │ r == r; + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_invalid.move:21:14 + │ + 3 │ public struct R has key { + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +20 │ fun t1(r: R) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' +21 │ r == r; + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_invalid.move:25:9 + │ +25 │ G0{ f: R { f: 1 } } == G0{ f: R { f: 1 } }; + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::G0<0x8675309::M::R>' can have the ability 'drop' but the type argument '0x8675309::M::R' does not have the required ability 'drop' + │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x8675309::M::G0<0x8675309::M::R>' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_invalid.move:25:35 + │ +25 │ G0{ f: R { f: 1 } } == G0{ f: R { f: 1 } }; + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::G0<0x8675309::M::R>' can have the ability 'drop' but the type argument '0x8675309::M::R' does not have the required ability 'drop' + │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x8675309::M::G0<0x8675309::M::R>' does not have the ability 'drop' + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/eq_invalid.move:27:9 + │ +27 │ G2{} == G2{}; + │ ^^^^ Could not infer this type. Try adding an annotation + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/eq_invalid.move:27:17 + │ +27 │ G2{} == G2{}; + │ ^^^^ Could not infer this type. Try adding an annotation + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_invalid.move:28:9 + │ + 7 │ public struct G1 { f: T } + │ -- To satisfy the constraint, the 'drop' ability would need to be added here + · +28 │ G1{ f: t } == G1{ f: t }; + │ ^^^^^^^^^^ + │ │ + │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x8675309::M::G1' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_invalid.move:28:23 + │ + 7 │ public struct G1 { f: T } + │ -- To satisfy the constraint, the 'drop' ability would need to be added here + · +28 │ G1{ f: t } == G1{ f: t }; + │ ^^^^^^^^^^ + │ │ + │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x8675309::M::G1' does not have the ability 'drop' + +error[E04005]: expected a single type + ┌─ tests/move_2024/typing/eq_invalid.move:32:9 + │ +32 │ () == (); + │ ^^^^^^^^ + │ │ │ + │ │ Expected a single type, but found expression list type: '()' + │ Incompatible arguments to '==' + +error[E04005]: expected a single type + ┌─ tests/move_2024/typing/eq_invalid.move:33:9 + │ +33 │ (0, 1) == (0, 1); + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single type, but found expression list type: '(u64, u64)' + │ Incompatible arguments to '==' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/eq_invalid.move:34:19 + │ +34 │ (1, 2, 3) == (0, 1); + │ --------- ^^ ------ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. + │ │ │ + │ │ Incompatible arguments to '==' + │ Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/eq_invalid.move:35:16 + │ +35 │ (0, 1) == (1, 2, 3); + │ ------ ^^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + │ │ │ + │ │ Incompatible arguments to '==' + │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_ref_tvars.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_ref_tvars.exp deleted file mode 100644 index 73866f56863e1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_ref_tvars.exp +++ /dev/null @@ -1,65 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/eq_ref_tvars.move:18:11 - │ -15 │ let x: T = any(); - │ --- Found: 'u64'. It is not compatible with the other type. -16 │ let y: &T = abort 0; - │ ---- Found: 'bool'. It is not compatible with the other type. -17 │ let z: &mut T = abort 0; -18 │ x == y && x == z - │ ^^ Incompatible arguments to '==' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/eq_ref_tvars.move:18:21 - │ -15 │ let x: T = any(); - │ --- Found: 'u64'. It is not compatible with the other type. -16 │ let y: &T = abort 0; -17 │ let z: &mut T = abort 0; - │ ---- Found: 'bool'. It is not compatible with the other type. -18 │ x == y && x == z - │ ^^ Incompatible arguments to '==' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/eq_ref_tvars.move:48:31 - │ -45 │ let a: &T = abort 0; - │ --- Found: 'u64'. It is not compatible with the other type. -46 │ let b: &mut T = abort 0; -47 │ let (c, d): (&mut T, &T) = abort 0; - │ ---- Found: 'bool'. It is not compatible with the other type. -48 │ a == b && c == d && a == c && b == d - │ ^^ Incompatible arguments to '==' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/eq_ref_tvars.move:48:41 - │ -46 │ let b: &mut T = abort 0; - │ --- Found: 'u64'. It is not compatible with the other type. -47 │ let (c, d): (&mut T, &T) = abort 0; - │ ---- Found: 'bool'. It is not compatible with the other type. -48 │ a == b && c == d && a == c && b == d - │ ^^ Incompatible arguments to '==' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/eq_ref_tvars.move:73:11 - │ -72 │ let x: T = option_take(&mut c); - │ --- Found: 'u64'. It is not compatible with the other type. -73 │ x == &mut T { q: false }; - │ ^^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ - │ Incompatible arguments to '==' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/eq_ref_tvars.move:74:9 - │ -72 │ let x: T = option_take(&mut c); - │ --- Expected: 'u64' -73 │ x == &mut T { q: false }; -74 │ option_fill(&mut c, T { q: false }); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid call of 'a::m::option_fill'. Invalid argument for parameter '_e' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_ref_tvars.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_ref_tvars.snap new file mode 100644 index 0000000000000..4238b654be697 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_ref_tvars.snap @@ -0,0 +1,72 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/eq_ref_tvars.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/eq_ref_tvars.move:18:11 + │ +15 │ let x: T = any(); + │ --- Found: 'u64'. It is not compatible with the other type. +16 │ let y: &T = abort 0; + │ ---- Found: 'bool'. It is not compatible with the other type. +17 │ let z: &mut T = abort 0; +18 │ x == y && x == z + │ ^^ Incompatible arguments to '==' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/eq_ref_tvars.move:18:21 + │ +15 │ let x: T = any(); + │ --- Found: 'u64'. It is not compatible with the other type. +16 │ let y: &T = abort 0; +17 │ let z: &mut T = abort 0; + │ ---- Found: 'bool'. It is not compatible with the other type. +18 │ x == y && x == z + │ ^^ Incompatible arguments to '==' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/eq_ref_tvars.move:48:31 + │ +45 │ let a: &T = abort 0; + │ --- Found: 'u64'. It is not compatible with the other type. +46 │ let b: &mut T = abort 0; +47 │ let (c, d): (&mut T, &T) = abort 0; + │ ---- Found: 'bool'. It is not compatible with the other type. +48 │ a == b && c == d && a == c && b == d + │ ^^ Incompatible arguments to '==' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/eq_ref_tvars.move:48:41 + │ +46 │ let b: &mut T = abort 0; + │ --- Found: 'u64'. It is not compatible with the other type. +47 │ let (c, d): (&mut T, &T) = abort 0; + │ ---- Found: 'bool'. It is not compatible with the other type. +48 │ a == b && c == d && a == c && b == d + │ ^^ Incompatible arguments to '==' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/eq_ref_tvars.move:73:11 + │ +72 │ let x: T = option_take(&mut c); + │ --- Found: 'u64'. It is not compatible with the other type. +73 │ x == &mut T { q: false }; + │ ^^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ + │ Incompatible arguments to '==' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/eq_ref_tvars.move:74:9 + │ +72 │ let x: T = option_take(&mut c); + │ --- Expected: 'u64' +73 │ x == &mut T { q: false }; +74 │ option_fill(&mut c, T { q: false }); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid call of 'a::m::option_fill'. Invalid argument for parameter '_e' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_refs_struct.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_refs_struct.snap new file mode 100644 index 0000000000000..e4990698a97df --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_refs_struct.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/eq_refs_struct.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_refs_struct_invalid_no_drop.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_refs_struct_invalid_no_drop.exp deleted file mode 100644 index 4935e9b839dc5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_refs_struct_invalid_no_drop.exp +++ /dev/null @@ -1,623 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:6:9 - │ -3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here -4 │ -5 │ public fun test_0(a: S, b: S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -6 │ a == b - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:6:14 - │ -3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here -4 │ -5 │ public fun test_0(a: S, b: S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -6 │ a == b - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:10:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · - 9 │ public fun test_1(a: S, b: &S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'a' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -10 │ a == b - │ ^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:14:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -13 │ public fun test_2(a: S, b: &mut S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'a' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -14 │ a == b - │ ^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:18:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -17 │ public fun test_3(a: &S, b: S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'b' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -18 │ a == b - │ ^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:22:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -21 │ public fun test_6(a: &mut S, b: S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'b' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -22 │ a == b - │ ^^^^^^ Invalid return - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:26:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -25 │ public fun test_9(a: S, b: S, c: S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -26 │ a == b && b == c && a == c - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:26:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -25 │ public fun test_9(a: S, b: S, c: S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'a' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns -26 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:26:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -25 │ public fun test_9(a: S, b: S, c: S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'b' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns -26 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:26:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -25 │ public fun test_9(a: S, b: S, c: S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'c' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns -26 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:26:14 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -25 │ public fun test_9(a: S, b: S, c: S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -26 │ a == b && b == c && a == c - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:26:19 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -25 │ public fun test_9(a: S, b: S, c: S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -26 │ a == b && b == c && a == c - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:26:24 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -25 │ public fun test_9(a: S, b: S, c: S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -26 │ a == b && b == c && a == c - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:26:29 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -25 │ public fun test_9(a: S, b: S, c: S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -26 │ a == b && b == c && a == c - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:26:34 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -25 │ public fun test_9(a: S, b: S, c: S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -26 │ a == b && b == c && a == c - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:30:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -29 │ public fun test_10(a: S, b: S, c: &S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -30 │ a == b && b == c && a == c - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:30:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -29 │ public fun test_10(a: S, b: S, c: &S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'a' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -30 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:30:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -29 │ public fun test_10(a: S, b: S, c: &S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'b' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -30 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:30:14 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -29 │ public fun test_10(a: S, b: S, c: &S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -30 │ a == b && b == c && a == c - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:34:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -33 │ public fun test_11(a: S, b: S, c: &mut S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -34 │ a == b && b == c && a == c - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:34:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -33 │ public fun test_11(a: S, b: S, c: &mut S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'a' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -34 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:34:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -33 │ public fun test_11(a: S, b: S, c: &mut S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'b' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -34 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:34:14 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -33 │ public fun test_11(a: S, b: S, c: &mut S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -34 │ a == b && b == c && a == c - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:38:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -37 │ public fun test_12(a: S, b: &S, c: S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'a' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns -38 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:38:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -37 │ public fun test_12(a: S, b: &S, c: S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'c' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns -38 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:38:29 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -37 │ public fun test_12(a: S, b: &S, c: S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -38 │ a == b && b == c && a == c - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:38:34 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -37 │ public fun test_12(a: S, b: &S, c: S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -38 │ a == b && b == c && a == c - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:42:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -41 │ public fun test_13(a: S, b: &S, c: &S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'a' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -42 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:46:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -45 │ public fun test_14(a: S, b: &S, c: &mut S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'a' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -46 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:50:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -49 │ public fun test_15(a: S, b: &mut S, c: S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'a' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns -50 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:50:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -49 │ public fun test_15(a: S, b: &mut S, c: S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'c' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns -50 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:50:29 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -49 │ public fun test_15(a: S, b: &mut S, c: S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -50 │ a == b && b == c && a == c - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:50:34 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -49 │ public fun test_15(a: S, b: &mut S, c: S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -50 │ a == b && b == c && a == c - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:54:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -53 │ public fun test_16(a: S, b: &mut S, c: &S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'a' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -54 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:58:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -57 │ public fun test_17(a: S, b: &mut S, c: &mut S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'a' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -58 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:62:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -61 │ public fun test_18(a: &S, b: S, c: S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'b' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns -62 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:62:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -61 │ public fun test_18(a: &S, b: S, c: S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'c' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -62 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:62:19 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -61 │ public fun test_18(a: &S, b: S, c: S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -62 │ a == b && b == c && a == c - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:62:24 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -61 │ public fun test_18(a: &S, b: S, c: S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -62 │ a == b && b == c && a == c - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:66:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -65 │ public fun test_19(a: &S, b: S, c: &S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'b' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -66 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:70:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -69 │ public fun test_20(a: &S, b: S, c: &mut S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'b' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -70 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:74:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -73 │ public fun test_21(a: &S, b: &S, c: S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'c' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -74 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:78:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -77 │ public fun test_24(a: &S, b: &mut S, c: S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'c' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -78 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:82:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -81 │ public fun test_27(a: &mut S, b: S, c: S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'b' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns -82 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:82:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -81 │ public fun test_27(a: &mut S, b: S, c: S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'c' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -82 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:82:19 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -81 │ public fun test_27(a: &mut S, b: S, c: S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -82 │ a == b && b == c && a == c - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:82:24 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -81 │ public fun test_27(a: &mut S, b: S, c: S): bool { - │ - The type '0x42::a::S' does not have the ability 'drop' -82 │ a == b && b == c && a == c - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:86:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -85 │ public fun test_28(a: &mut S, b: S, c: &S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'b' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -86 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:90:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -89 │ public fun test_29(a: &mut S, b: S, c: &mut S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'b' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -90 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:94:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -93 │ public fun test_30(a: &mut S, b: &S, c: S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'c' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -94 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:98:9 - │ - 3 │ public struct S has copy {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -97 │ public fun test_33(a: &mut S, b: &mut S, c: S): bool { - │ - - The type '0x42::a::S' does not have the ability 'drop' - │ │ - │ The parameter 'c' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -98 │ a == b && b == c && a == c - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_refs_struct_invalid_no_drop.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_refs_struct_invalid_no_drop.snap new file mode 100644 index 0000000000000..c15e900ca8d3d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_refs_struct_invalid_no_drop.snap @@ -0,0 +1,630 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:6:9 + │ +3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here +4 │ +5 │ public fun test_0(a: S, b: S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +6 │ a == b + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:6:14 + │ +3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here +4 │ +5 │ public fun test_0(a: S, b: S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +6 │ a == b + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:10:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · + 9 │ public fun test_1(a: S, b: &S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'a' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +10 │ a == b + │ ^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:14:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +13 │ public fun test_2(a: S, b: &mut S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'a' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +14 │ a == b + │ ^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:18:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +17 │ public fun test_3(a: &S, b: S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'b' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +18 │ a == b + │ ^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:22:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +21 │ public fun test_6(a: &mut S, b: S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'b' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +22 │ a == b + │ ^^^^^^ Invalid return + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:26:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +25 │ public fun test_9(a: S, b: S, c: S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +26 │ a == b && b == c && a == c + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:26:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +25 │ public fun test_9(a: S, b: S, c: S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'a' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns +26 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:26:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +25 │ public fun test_9(a: S, b: S, c: S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'b' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns +26 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:26:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +25 │ public fun test_9(a: S, b: S, c: S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'c' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns +26 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:26:14 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +25 │ public fun test_9(a: S, b: S, c: S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +26 │ a == b && b == c && a == c + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:26:19 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +25 │ public fun test_9(a: S, b: S, c: S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +26 │ a == b && b == c && a == c + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:26:24 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +25 │ public fun test_9(a: S, b: S, c: S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +26 │ a == b && b == c && a == c + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:26:29 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +25 │ public fun test_9(a: S, b: S, c: S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +26 │ a == b && b == c && a == c + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:26:34 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +25 │ public fun test_9(a: S, b: S, c: S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +26 │ a == b && b == c && a == c + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:30:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +29 │ public fun test_10(a: S, b: S, c: &S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +30 │ a == b && b == c && a == c + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:30:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +29 │ public fun test_10(a: S, b: S, c: &S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'a' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +30 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:30:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +29 │ public fun test_10(a: S, b: S, c: &S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'b' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +30 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:30:14 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +29 │ public fun test_10(a: S, b: S, c: &S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +30 │ a == b && b == c && a == c + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:34:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +33 │ public fun test_11(a: S, b: S, c: &mut S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +34 │ a == b && b == c && a == c + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:34:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +33 │ public fun test_11(a: S, b: S, c: &mut S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'a' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +34 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:34:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +33 │ public fun test_11(a: S, b: S, c: &mut S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'b' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +34 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:34:14 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +33 │ public fun test_11(a: S, b: S, c: &mut S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +34 │ a == b && b == c && a == c + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:38:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +37 │ public fun test_12(a: S, b: &S, c: S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'a' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns +38 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:38:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +37 │ public fun test_12(a: S, b: &S, c: S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'c' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns +38 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:38:29 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +37 │ public fun test_12(a: S, b: &S, c: S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +38 │ a == b && b == c && a == c + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:38:34 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +37 │ public fun test_12(a: S, b: &S, c: S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +38 │ a == b && b == c && a == c + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:42:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +41 │ public fun test_13(a: S, b: &S, c: &S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'a' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +42 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:46:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +45 │ public fun test_14(a: S, b: &S, c: &mut S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'a' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +46 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:50:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +49 │ public fun test_15(a: S, b: &mut S, c: S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'a' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns +50 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:50:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +49 │ public fun test_15(a: S, b: &mut S, c: S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'c' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns +50 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:50:29 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +49 │ public fun test_15(a: S, b: &mut S, c: S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +50 │ a == b && b == c && a == c + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:50:34 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +49 │ public fun test_15(a: S, b: &mut S, c: S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +50 │ a == b && b == c && a == c + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:54:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +53 │ public fun test_16(a: S, b: &mut S, c: &S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'a' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +54 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:58:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +57 │ public fun test_17(a: S, b: &mut S, c: &mut S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'a' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +58 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:62:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +61 │ public fun test_18(a: &S, b: S, c: S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'b' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns +62 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:62:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +61 │ public fun test_18(a: &S, b: S, c: S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'c' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +62 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:62:19 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +61 │ public fun test_18(a: &S, b: S, c: S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +62 │ a == b && b == c && a == c + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:62:24 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +61 │ public fun test_18(a: &S, b: S, c: S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +62 │ a == b && b == c && a == c + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:66:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +65 │ public fun test_19(a: &S, b: S, c: &S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'b' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +66 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:70:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +69 │ public fun test_20(a: &S, b: S, c: &mut S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'b' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +70 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:74:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +73 │ public fun test_21(a: &S, b: &S, c: S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'c' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +74 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:78:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +77 │ public fun test_24(a: &S, b: &mut S, c: S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'c' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +78 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:82:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +81 │ public fun test_27(a: &mut S, b: S, c: S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'b' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns +82 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:82:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +81 │ public fun test_27(a: &mut S, b: S, c: S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'c' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +82 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:82:19 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +81 │ public fun test_27(a: &mut S, b: S, c: S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +82 │ a == b && b == c && a == c + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:82:24 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +81 │ public fun test_27(a: &mut S, b: S, c: S): bool { + │ - The type '0x42::a::S' does not have the ability 'drop' +82 │ a == b && b == c && a == c + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:86:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +85 │ public fun test_28(a: &mut S, b: S, c: &S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'b' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +86 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:90:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +89 │ public fun test_29(a: &mut S, b: S, c: &mut S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'b' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +90 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:94:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +93 │ public fun test_30(a: &mut S, b: &S, c: S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'c' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +94 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/eq_refs_struct_invalid_no_drop.move:98:9 + │ + 3 │ public struct S has copy {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +97 │ public fun test_33(a: &mut S, b: &mut S, c: S): bool { + │ - - The type '0x42::a::S' does not have the ability 'drop' + │ │ + │ The parameter 'c' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +98 │ a == b && b == c && a == c + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_refs_struct_no_drop.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_refs_struct_no_drop.snap new file mode 100644 index 0000000000000..f672179b3da50 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/eq_refs_struct_no_drop.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/eq_refs_struct_no_drop.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/explicit_const_copy.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/explicit_const_copy.snap new file mode 100644 index 0000000000000..8cb4d792a4a7b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/explicit_const_copy.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/explicit_const_copy.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/implicit_const_copy_method.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/implicit_const_copy_method.exp deleted file mode 100644 index 3885956cc0bdf..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/implicit_const_copy_method.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[W04028]: implicit copy of a constant - ┌─ tests/move_2024/typing/implicit_const_copy_method.move:8:9 - │ -8 │ BYTES.length(); - │ ^^^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_2024/typing/implicit_const_copy_method.move:9:9 - │ -9 │ BYTES.push_back(0); - │ ^^^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/implicit_const_copy_method.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/implicit_const_copy_method.snap new file mode 100644 index 0000000000000..0e4a9cd08581f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/implicit_const_copy_method.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/implicit_const_copy_method.move +--- +warning[W04028]: implicit copy of a constant + ┌─ tests/move_2024/typing/implicit_const_copy_method.move:8:9 + │ +8 │ BYTES.length(); + │ ^^^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_2024/typing/implicit_const_copy_method.move:9:9 + │ +9 │ BYTES.push_back(0); + │ ^^^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_constraints_unsatisfied.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_constraints_unsatisfied.exp deleted file mode 100644 index 37f8d2c5f807a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_constraints_unsatisfied.exp +++ /dev/null @@ -1,242 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:18:18 - │ - 6 │ public fun in(self: &Box): &T { &self.value } - │ ---- 'copy' constraint declared here - · -17 │ public fun test01(b: &Box) { - │ - - The type 'A' does not have the ability 'copy' - │ │ - │ To satisfy the constraint, the 'copy' ability would need to be added here -18 │ let _b_val = b[]; - │ ^^^ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:18:18 - │ - 6 │ public fun in(self: &Box): &T { &self.value } - │ ---- 'drop' constraint declared here - · -17 │ public fun test01(b: &Box) { - │ - - The type 'A' does not have the ability 'drop' - │ │ - │ To satisfy the constraint, the 'drop' ability would need to be added here -18 │ let _b_val = b[]; - │ ^^^ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:18:18 - │ -17 │ public fun test01(b: &Box) { - │ - - The type 'A' does not have the ability 'copy' - │ │ - │ To satisfy the constraint, the 'copy' ability would need to be added here -18 │ let _b_val = b[]; - │ ^^^ Invalid implicit copy of index result without the 'copy' ability - -error[E06001]: unused value without 'drop' - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:18:21 - │ -17 │ public fun test01(b: &Box) { - │ - - The type 'A' does not have the ability 'drop' - │ │ - │ To satisfy the constraint, the 'drop' ability would need to be added here -18 │ let _b_val = b[]; - │ ------ ^ Invalid return - │ │ - │ The local variable '_b_val' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:23:18 - │ - 6 │ public fun in(self: &Box): &T { &self.value } - │ ---- 'copy' constraint declared here - · -22 │ public fun test02(b: &mut Box) { - │ - - The type 'A' does not have the ability 'copy' - │ │ - │ To satisfy the constraint, the 'copy' ability would need to be added here -23 │ let _b_val = &b[]; - │ ^^^^ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:23:18 - │ - 6 │ public fun in(self: &Box): &T { &self.value } - │ ---- 'drop' constraint declared here - · -22 │ public fun test02(b: &mut Box) { - │ - - The type 'A' does not have the ability 'drop' - │ │ - │ To satisfy the constraint, the 'drop' ability would need to be added here -23 │ let _b_val = &b[]; - │ ^^^^ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:23:19 - │ - 6 │ public fun in(self: &Box): &T { &self.value } - │ ---- 'copy' constraint declared here - · -22 │ public fun test02(b: &mut Box) { - │ - - The type 'A' does not have the ability 'copy' - │ │ - │ To satisfy the constraint, the 'copy' ability would need to be added here -23 │ let _b_val = &b[]; - │ ^^^ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:23:19 - │ - 6 │ public fun in(self: &Box): &T { &self.value } - │ ---- 'drop' constraint declared here - · -22 │ public fun test02(b: &mut Box) { - │ - - The type 'A' does not have the ability 'drop' - │ │ - │ To satisfy the constraint, the 'drop' ability would need to be added here -23 │ let _b_val = &b[]; - │ ^^^ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:28:18 - │ - 9 │ public fun in_mut(self: &mut Box): &mut T { &mut self.value } - │ ---- 'copy' constraint declared here - · -27 │ public fun test03(b: &mut Box) { - │ - - The type 'A' does not have the ability 'copy' - │ │ - │ To satisfy the constraint, the 'copy' ability would need to be added here -28 │ let _b_val = &mut b[]; - │ ^^^^^^^^ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:28:23 - │ - 6 │ public fun in(self: &Box): &T { &self.value } - │ ---- 'copy' constraint declared here - · -27 │ public fun test03(b: &mut Box) { - │ - - The type 'A' does not have the ability 'copy' - │ │ - │ To satisfy the constraint, the 'copy' ability would need to be added here -28 │ let _b_val = &mut b[]; - │ ^^^ 'copy' constraint not satisifed - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:33:18 - │ -33 │ let _b_val = copy &mut _b[]; - │ ^^^^ --------- Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'copy' of expression - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:38:18 - │ - 6 │ public fun in(self: &Box): &T { &self.value } - │ ---- 'drop' constraint declared here - · -37 │ public fun test05(b: &Box, mb: &mut Box) { - │ - - The type 'A' does not have the ability 'drop' - │ │ - │ To satisfy the constraint, the 'drop' ability would need to be added here -38 │ let _b_val = &b[]; // invalid - │ ^^^^ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:38:19 - │ - 6 │ public fun in(self: &Box): &T { &self.value } - │ ---- 'drop' constraint declared here - · -37 │ public fun test05(b: &Box, mb: &mut Box) { - │ - - The type 'A' does not have the ability 'drop' - │ │ - │ To satisfy the constraint, the 'drop' ability would need to be added here -38 │ let _b_val = &b[]; // invalid - │ ^^^ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:39:19 - │ - 9 │ public fun in_mut(self: &mut Box): &mut T { &mut self.value } - │ ---- 'copy' constraint declared here - · -37 │ public fun test05(b: &Box, mb: &mut Box) { - │ - - The type 'B' does not have the ability 'copy' - │ │ - │ To satisfy the constraint, the 'copy' ability would need to be added here -38 │ let _b_val = &b[]; // invalid -39 │ let _mb_val = &mut mb[]; // invalid - │ ^^^^^^^^^ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:39:24 - │ - 6 │ public fun in(self: &Box): &T { &self.value } - │ ---- 'copy' constraint declared here - · -37 │ public fun test05(b: &Box, mb: &mut Box) { - │ - - The type 'B' does not have the ability 'copy' - │ │ - │ To satisfy the constraint, the 'copy' ability would need to be added here -38 │ let _b_val = &b[]; // invalid -39 │ let _mb_val = &mut mb[]; // invalid - │ ^^^^ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:44:18 - │ - 6 │ public fun in(self: &Box): &T { &self.value } - │ ---- 'copy' constraint declared here - · -43 │ public fun test06(b: &Box, mb: &mut Box) { - │ - - The type 'A' does not have the ability 'copy' - │ │ - │ To satisfy the constraint, the 'copy' ability would need to be added here -44 │ let _b_val = &b[]; - │ ^^^^ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:44:19 - │ - 6 │ public fun in(self: &Box): &T { &self.value } - │ ---- 'copy' constraint declared here - · -43 │ public fun test06(b: &Box, mb: &mut Box) { - │ - - The type 'A' does not have the ability 'copy' - │ │ - │ To satisfy the constraint, the 'copy' ability would need to be added here -44 │ let _b_val = &b[]; - │ ^^^ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:45:19 - │ - 9 │ public fun in_mut(self: &mut Box): &mut T { &mut self.value } - │ ---- 'drop' constraint declared here - · -43 │ public fun test06(b: &Box, mb: &mut Box) { - │ - - The type 'B' does not have the ability 'drop' - │ │ - │ To satisfy the constraint, the 'drop' ability would need to be added here -44 │ let _b_val = &b[]; -45 │ let _mb_val = &mut mb[]; - │ ^^^^^^^^^ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:45:24 - │ - 6 │ public fun in(self: &Box): &T { &self.value } - │ ---- 'drop' constraint declared here - · -43 │ public fun test06(b: &Box, mb: &mut Box) { - │ - - The type 'B' does not have the ability 'drop' - │ │ - │ To satisfy the constraint, the 'drop' ability would need to be added here -44 │ let _b_val = &b[]; -45 │ let _mb_val = &mut mb[]; - │ ^^^^ 'drop' constraint not satisifed - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_constraints_unsatisfied.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_constraints_unsatisfied.snap new file mode 100644 index 0000000000000..4128291c4ac26 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_constraints_unsatisfied.snap @@ -0,0 +1,249 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_call_constraints_unsatisfied.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:18:18 + │ + 6 │ public fun in(self: &Box): &T { &self.value } + │ ---- 'copy' constraint declared here + · +17 │ public fun test01(b: &Box) { + │ - - The type 'A' does not have the ability 'copy' + │ │ + │ To satisfy the constraint, the 'copy' ability would need to be added here +18 │ let _b_val = b[]; + │ ^^^ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:18:18 + │ + 6 │ public fun in(self: &Box): &T { &self.value } + │ ---- 'drop' constraint declared here + · +17 │ public fun test01(b: &Box) { + │ - - The type 'A' does not have the ability 'drop' + │ │ + │ To satisfy the constraint, the 'drop' ability would need to be added here +18 │ let _b_val = b[]; + │ ^^^ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:18:18 + │ +17 │ public fun test01(b: &Box) { + │ - - The type 'A' does not have the ability 'copy' + │ │ + │ To satisfy the constraint, the 'copy' ability would need to be added here +18 │ let _b_val = b[]; + │ ^^^ Invalid implicit copy of index result without the 'copy' ability + +error[E06001]: unused value without 'drop' + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:18:21 + │ +17 │ public fun test01(b: &Box) { + │ - - The type 'A' does not have the ability 'drop' + │ │ + │ To satisfy the constraint, the 'drop' ability would need to be added here +18 │ let _b_val = b[]; + │ ------ ^ Invalid return + │ │ + │ The local variable '_b_val' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:23:18 + │ + 6 │ public fun in(self: &Box): &T { &self.value } + │ ---- 'copy' constraint declared here + · +22 │ public fun test02(b: &mut Box) { + │ - - The type 'A' does not have the ability 'copy' + │ │ + │ To satisfy the constraint, the 'copy' ability would need to be added here +23 │ let _b_val = &b[]; + │ ^^^^ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:23:18 + │ + 6 │ public fun in(self: &Box): &T { &self.value } + │ ---- 'drop' constraint declared here + · +22 │ public fun test02(b: &mut Box) { + │ - - The type 'A' does not have the ability 'drop' + │ │ + │ To satisfy the constraint, the 'drop' ability would need to be added here +23 │ let _b_val = &b[]; + │ ^^^^ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:23:19 + │ + 6 │ public fun in(self: &Box): &T { &self.value } + │ ---- 'copy' constraint declared here + · +22 │ public fun test02(b: &mut Box) { + │ - - The type 'A' does not have the ability 'copy' + │ │ + │ To satisfy the constraint, the 'copy' ability would need to be added here +23 │ let _b_val = &b[]; + │ ^^^ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:23:19 + │ + 6 │ public fun in(self: &Box): &T { &self.value } + │ ---- 'drop' constraint declared here + · +22 │ public fun test02(b: &mut Box) { + │ - - The type 'A' does not have the ability 'drop' + │ │ + │ To satisfy the constraint, the 'drop' ability would need to be added here +23 │ let _b_val = &b[]; + │ ^^^ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:28:18 + │ + 9 │ public fun in_mut(self: &mut Box): &mut T { &mut self.value } + │ ---- 'copy' constraint declared here + · +27 │ public fun test03(b: &mut Box) { + │ - - The type 'A' does not have the ability 'copy' + │ │ + │ To satisfy the constraint, the 'copy' ability would need to be added here +28 │ let _b_val = &mut b[]; + │ ^^^^^^^^ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:28:23 + │ + 6 │ public fun in(self: &Box): &T { &self.value } + │ ---- 'copy' constraint declared here + · +27 │ public fun test03(b: &mut Box) { + │ - - The type 'A' does not have the ability 'copy' + │ │ + │ To satisfy the constraint, the 'copy' ability would need to be added here +28 │ let _b_val = &mut b[]; + │ ^^^ 'copy' constraint not satisifed + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:33:18 + │ +33 │ let _b_val = copy &mut _b[]; + │ ^^^^ --------- Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'copy' of expression + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:38:18 + │ + 6 │ public fun in(self: &Box): &T { &self.value } + │ ---- 'drop' constraint declared here + · +37 │ public fun test05(b: &Box, mb: &mut Box) { + │ - - The type 'A' does not have the ability 'drop' + │ │ + │ To satisfy the constraint, the 'drop' ability would need to be added here +38 │ let _b_val = &b[]; // invalid + │ ^^^^ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:38:19 + │ + 6 │ public fun in(self: &Box): &T { &self.value } + │ ---- 'drop' constraint declared here + · +37 │ public fun test05(b: &Box, mb: &mut Box) { + │ - - The type 'A' does not have the ability 'drop' + │ │ + │ To satisfy the constraint, the 'drop' ability would need to be added here +38 │ let _b_val = &b[]; // invalid + │ ^^^ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:39:19 + │ + 9 │ public fun in_mut(self: &mut Box): &mut T { &mut self.value } + │ ---- 'copy' constraint declared here + · +37 │ public fun test05(b: &Box, mb: &mut Box) { + │ - - The type 'B' does not have the ability 'copy' + │ │ + │ To satisfy the constraint, the 'copy' ability would need to be added here +38 │ let _b_val = &b[]; // invalid +39 │ let _mb_val = &mut mb[]; // invalid + │ ^^^^^^^^^ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:39:24 + │ + 6 │ public fun in(self: &Box): &T { &self.value } + │ ---- 'copy' constraint declared here + · +37 │ public fun test05(b: &Box, mb: &mut Box) { + │ - - The type 'B' does not have the ability 'copy' + │ │ + │ To satisfy the constraint, the 'copy' ability would need to be added here +38 │ let _b_val = &b[]; // invalid +39 │ let _mb_val = &mut mb[]; // invalid + │ ^^^^ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:44:18 + │ + 6 │ public fun in(self: &Box): &T { &self.value } + │ ---- 'copy' constraint declared here + · +43 │ public fun test06(b: &Box, mb: &mut Box) { + │ - - The type 'A' does not have the ability 'copy' + │ │ + │ To satisfy the constraint, the 'copy' ability would need to be added here +44 │ let _b_val = &b[]; + │ ^^^^ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:44:19 + │ + 6 │ public fun in(self: &Box): &T { &self.value } + │ ---- 'copy' constraint declared here + · +43 │ public fun test06(b: &Box, mb: &mut Box) { + │ - - The type 'A' does not have the ability 'copy' + │ │ + │ To satisfy the constraint, the 'copy' ability would need to be added here +44 │ let _b_val = &b[]; + │ ^^^ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:45:19 + │ + 9 │ public fun in_mut(self: &mut Box): &mut T { &mut self.value } + │ ---- 'drop' constraint declared here + · +43 │ public fun test06(b: &Box, mb: &mut Box) { + │ - - The type 'B' does not have the ability 'drop' + │ │ + │ To satisfy the constraint, the 'drop' ability would need to be added here +44 │ let _b_val = &b[]; +45 │ let _mb_val = &mut mb[]; + │ ^^^^^^^^^ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/index_call_constraints_unsatisfied.move:45:24 + │ + 6 │ public fun in(self: &Box): &T { &self.value } + │ ---- 'drop' constraint declared here + · +43 │ public fun test06(b: &Box, mb: &mut Box) { + │ - - The type 'B' does not have the ability 'drop' + │ │ + │ To satisfy the constraint, the 'drop' ability would need to be added here +44 │ let _b_val = &b[]; +45 │ let _mb_val = &mut mb[]; + │ ^^^^ 'drop' constraint not satisifed diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_imm_ref_imm_borrow.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_imm_ref_imm_borrow.snap new file mode 100644 index 0000000000000..525f0c35781c4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_imm_ref_imm_borrow.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_call_imm_ref_imm_borrow.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_imm_ref_owned.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_imm_ref_owned.snap new file mode 100644 index 0000000000000..46740c7baa009 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_imm_ref_owned.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_call_imm_ref_owned.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_incompatible_constraints.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_incompatible_constraints.exp deleted file mode 100644 index c391ca56be106..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_incompatible_constraints.exp +++ /dev/null @@ -1,39 +0,0 @@ -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/index_call_incompatible_constraints.move:6:15 - │ -6 │ public fun in(self: &Box): &T { &self.value } - │ ^ ---- Ability defined here - │ │ - │ This index function type parameter has the 'drop' ability - · -9 │ public fun in_mut(self: &mut Box): &mut T { &mut self.value } - │ - This mutable index function type parameter does not - │ - = Index operations on use the same abilities for their type parameters - -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/index_call_incompatible_constraints.move:9:19 - │ -6 │ public fun in(self: &Box): &T { &self.value } - │ - This index function type parameter does not - · -9 │ public fun in_mut(self: &mut Box): &mut T { &mut self.value } - │ ^ ---- Ability defined here - │ │ - │ This mutable index function type parameter has the 'copy' ability - │ - = Index operations on use the same abilities for their type parameters - -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/index_call_incompatible_constraints.move:14:16 - │ -14 │ public fun in2(self: &Box2): &T { &self.value } - │ ^ ----- Ability defined here - │ │ - │ This index function type parameter has the 'store' ability - · -17 │ public fun in_mut2(self: &mut Box2): &mut T { &mut self.value } - │ - This mutable index function type parameter does not - │ - = Index operations on use the same abilities for their type parameters - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_incompatible_constraints.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_incompatible_constraints.snap new file mode 100644 index 0000000000000..30bdc565e8209 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_incompatible_constraints.snap @@ -0,0 +1,46 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_call_incompatible_constraints.move +--- +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/index_call_incompatible_constraints.move:6:15 + │ +6 │ public fun in(self: &Box): &T { &self.value } + │ ^ ---- Ability defined here + │ │ + │ This index function type parameter has the 'drop' ability + · +9 │ public fun in_mut(self: &mut Box): &mut T { &mut self.value } + │ - This mutable index function type parameter does not + │ + = Index operations on use the same abilities for their type parameters + +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/index_call_incompatible_constraints.move:9:19 + │ +6 │ public fun in(self: &Box): &T { &self.value } + │ - This index function type parameter does not + · +9 │ public fun in_mut(self: &mut Box): &mut T { &mut self.value } + │ ^ ---- Ability defined here + │ │ + │ This mutable index function type parameter has the 'copy' ability + │ + = Index operations on use the same abilities for their type parameters + +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/index_call_incompatible_constraints.move:14:16 + │ +14 │ public fun in2(self: &Box2): &T { &self.value } + │ ^ ----- Ability defined here + │ │ + │ This index function type parameter has the 'store' ability + · +17 │ public fun in_mut2(self: &mut Box2): &mut T { &mut self.value } + │ - This mutable index function type parameter does not + │ + = Index operations on use the same abilities for their type parameters diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_invalid_args.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_invalid_args.exp deleted file mode 100644 index b8ec6c01489ee..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_invalid_args.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_call_invalid_args.move:13:5 - │ -10 │ public fun f(_self: &X, z: &Z): &Z { z } - │ - Expected: '0x42::t::Z' -11 │ -12 │ public fun foo (y: Y, i: &u64) { - │ --- Given: 'u64' -13 │ y.x[i].i; - │ ^^^^^^ Invalid call of '0x42::t::f'. Invalid argument for parameter 'z' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_invalid_args.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_invalid_args.snap new file mode 100644 index 0000000000000..a881e04cf0609 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_invalid_args.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_call_invalid_args.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_call_invalid_args.move:13:5 + │ +10 │ public fun f(_self: &X, z: &Z): &Z { z } + │ - Expected: '0x42::t::Z' +11 │ +12 │ public fun foo (y: Y, i: &u64) { + │ --- Given: 'u64' +13 │ y.x[i].i; + │ ^^^^^^ Invalid call of '0x42::t::f'. Invalid argument for parameter 'z' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_mut_ref_imm_borrow.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_mut_ref_imm_borrow.snap new file mode 100644 index 0000000000000..fa735f3d8a60d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_mut_ref_imm_borrow.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_call_mut_ref_imm_borrow.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_mut_ref_mut_borrow.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_mut_ref_mut_borrow.snap new file mode 100644 index 0000000000000..b4a45f7877329 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_mut_ref_mut_borrow.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_call_mut_ref_mut_borrow.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_mut_ref_owned.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_mut_ref_owned.snap new file mode 100644 index 0000000000000..b297fbe966637 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_mut_ref_owned.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_call_mut_ref_owned.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_no_args.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_no_args.snap new file mode 100644 index 0000000000000..829f5ddb12353 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_no_args.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_call_no_args.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_owned.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_owned.snap new file mode 100644 index 0000000000000..3bef714280620 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_call_owned.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_call_owned.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_fun_invalid_visibility.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_fun_invalid_visibility.exp deleted file mode 100644 index e2caa8d374cab..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_fun_invalid_visibility.exp +++ /dev/null @@ -1,36 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/index_fun_invalid_visibility.move:44:19 - │ - 7 │ fun index_a(a: &A): &A { a } - │ ------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module - · -44 │ let _a0 = &a[]; - │ ^^^^ Invalid call to internal function '0x42::m::index_a' - -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/index_fun_invalid_visibility.move:49:19 - │ -22 │ fun index_b_mut(b: &mut B): &mut B { b } - │ ----------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module - · -49 │ let _b0 = &mut b[]; - │ ^^^^^^^^ Invalid call to internal function '0x42::m::index_b_mut' - -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/index_fun_invalid_visibility.move:52:19 - │ -31 │ fun index_c(c: &C): &C { c } - │ ------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module - · -52 │ let _c0 = &c[]; - │ ^^^^ Invalid call to internal function '0x42::m::index_c' - -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/index_fun_invalid_visibility.move:53:19 - │ -34 │ fun index_c_mut(c: &mut C): &mut C { c } - │ ----------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module - · -53 │ let _c0 = &mut c[]; - │ ^^^^^^^^ Invalid call to internal function '0x42::m::index_c_mut' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_fun_invalid_visibility.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_fun_invalid_visibility.snap new file mode 100644 index 0000000000000..f2757a9a336f6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_fun_invalid_visibility.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_fun_invalid_visibility.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/index_fun_invalid_visibility.move:44:19 + │ + 7 │ fun index_a(a: &A): &A { a } + │ ------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module + · +44 │ let _a0 = &a[]; + │ ^^^^ Invalid call to internal function '0x42::m::index_a' + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/index_fun_invalid_visibility.move:49:19 + │ +22 │ fun index_b_mut(b: &mut B): &mut B { b } + │ ----------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module + · +49 │ let _b0 = &mut b[]; + │ ^^^^^^^^ Invalid call to internal function '0x42::m::index_b_mut' + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/index_fun_invalid_visibility.move:52:19 + │ +31 │ fun index_c(c: &C): &C { c } + │ ------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module + · +52 │ let _c0 = &c[]; + │ ^^^^ Invalid call to internal function '0x42::m::index_c' + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/index_fun_invalid_visibility.move:53:19 + │ +34 │ fun index_c_mut(c: &mut C): &mut C { c } + │ ----------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module + · +53 │ let _c0 = &mut c[]; + │ ^^^^^^^^ Invalid call to internal function '0x42::m::index_c_mut' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_fun_invalid_visibility_2.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_fun_invalid_visibility_2.exp deleted file mode 100644 index f3fe342fea092..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_fun_invalid_visibility_2.exp +++ /dev/null @@ -1,36 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/index_fun_invalid_visibility_2.move:44:19 - │ - 7 │ fun index_a(a: &A): &A { a } - │ ------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module - · -44 │ let _a0 = &a[]; - │ ^^^^ Invalid call to internal function '0x42::m::index_a' - -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/index_fun_invalid_visibility_2.move:49:19 - │ -22 │ fun index_b_mut(b: &mut B): &mut B { b } - │ ----------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module - · -49 │ let _b0 = &mut b[]; - │ ^^^^^^^^ Invalid call to internal function '0x42::m::index_b_mut' - -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/index_fun_invalid_visibility_2.move:52:19 - │ -31 │ fun index_c(c: &C): &C { c } - │ ------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module - · -52 │ let _c0 = &c[]; - │ ^^^^ Invalid call to internal function '0x42::m::index_c' - -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/index_fun_invalid_visibility_2.move:53:19 - │ -34 │ fun index_c_mut(c: &mut C): &mut C { c } - │ ----------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module - · -53 │ let _c0 = &mut c[]; - │ ^^^^^^^^ Invalid call to internal function '0x42::m::index_c_mut' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_fun_invalid_visibility_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_fun_invalid_visibility_2.snap new file mode 100644 index 0000000000000..1f7be144f4f26 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_fun_invalid_visibility_2.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_fun_invalid_visibility_2.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/index_fun_invalid_visibility_2.move:44:19 + │ + 7 │ fun index_a(a: &A): &A { a } + │ ------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module + · +44 │ let _a0 = &a[]; + │ ^^^^ Invalid call to internal function '0x42::m::index_a' + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/index_fun_invalid_visibility_2.move:49:19 + │ +22 │ fun index_b_mut(b: &mut B): &mut B { b } + │ ----------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module + · +49 │ let _b0 = &mut b[]; + │ ^^^^^^^^ Invalid call to internal function '0x42::m::index_b_mut' + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/index_fun_invalid_visibility_2.move:52:19 + │ +31 │ fun index_c(c: &C): &C { c } + │ ------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module + · +52 │ let _c0 = &c[]; + │ ^^^^ Invalid call to internal function '0x42::m::index_c' + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/index_fun_invalid_visibility_2.move:53:19 + │ +34 │ fun index_c_mut(c: &mut C): &mut C { c } + │ ----------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module + · +53 │ let _c0 = &mut c[]; + │ ^^^^^^^^ Invalid call to internal function '0x42::m::index_c_mut' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_fun_pub_pkg_visibility.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_fun_pub_pkg_visibility.snap new file mode 100644 index 0000000000000..31440465171f9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_fun_pub_pkg_visibility.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_fun_pub_pkg_visibility.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_fun_valid_visibility.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_fun_valid_visibility.snap new file mode 100644 index 0000000000000..542d5a52ac36e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_fun_valid_visibility.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_fun_valid_visibility.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_invalid_crash.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_invalid_crash.exp deleted file mode 100644 index 94adf5f742b71..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_invalid_crash.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_invalid_crash.move:13:5 - │ -12 │ public fun index_by_reference(table: &mut Table>) { - │ --- Expected: 'u64' -13 │ table[&1].push_back(3); - │ ^^^^^^^^^ - │ │ │ - │ │ Given: '&{integer}' - │ Invalid call of 'a::m::borrow'. Invalid argument for parameter '_k' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_invalid_crash.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_invalid_crash.snap new file mode 100644 index 0000000000000..d592053b14cea --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_invalid_crash.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_invalid_crash.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_invalid_crash.move:13:5 + │ +12 │ public fun index_by_reference(table: &mut Table>) { + │ --- Expected: 'u64' +13 │ table[&1].push_back(3); + │ ^^^^^^^^^ + │ │ │ + │ │ Given: '&{integer}' + │ Invalid call of 'a::m::borrow'. Invalid argument for parameter '_k' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_base_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_base_valid.snap new file mode 100644 index 0000000000000..df011d45cdda8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_base_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_syntax_methods_base_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_miscalled.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_miscalled.exp deleted file mode 100644 index 6b6390727e395..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_miscalled.exp +++ /dev/null @@ -1,294 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:30:10 - │ - 8 │ native public fun borrow(v: &vector, i: u64): ∈ - │ --- Expected: 'u64' - · -29 │ public fun miscall0(s: &S, i: u32): &u64 { - │ --- Given: 'u32' -30 │ &s.t[i] - │ ^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:34:14 - │ - 8 │ native public fun borrow(v: &vector, i: u64): ∈ - │ --- Expected: 'u64' - · -33 │ public fun miscall1(s: &mut S, i: u32): &mut u64 { - │ --- Given: 'u32' -34 │ &mut s.t[i] - │ ^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:38:10 - │ - 8 │ native public fun borrow(v: &vector, i: u64): ∈ - │ --- Expected: 'u64' - · -37 │ public fun miscall2(s: &S, i: T): &u64 { - │ - Given: 'T' -38 │ &s.t[i] - │ ^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:43:14 - │ - 8 │ native public fun borrow(v: &vector, i: u64): ∈ - │ --- Expected: 'u64' - · -42 │ public fun miscall3(s: &mut S, i: T): &mut u64 { - │ - Given: 'T' -43 │ &mut s.t[i] - │ ^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:52:10 - │ -20 │ public fun borrow_s(s: &S, i: u64): &u64 { - │ --- Expected: 'u64' - · -51 │ fun miscall0(s: &s::S, i: u32): &u64 { - │ --- Given: 'u32' -52 │ &s[i] - │ ^^^^ Invalid call of 'a::s::borrow_s'. Invalid argument for parameter 'i' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:56:14 - │ -20 │ public fun borrow_s(s: &S, i: u64): &u64 { - │ --- Expected: 'u64' - · -55 │ fun miscall1(s: &mut s::S, i: u32): &mut u64 { - │ --- Given: 'u32' -56 │ &mut s[i] - │ ^^^^ Invalid call of 'a::s::borrow_s'. Invalid argument for parameter 'i' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:60:10 - │ -20 │ public fun borrow_s(s: &S, i: u64): &u64 { - │ --- Expected: 'u64' - · -59 │ fun miscall2(s: &s::S, i: T): &u64 { - │ - Given: 'T' -60 │ &s[i] - │ ^^^^ Invalid call of 'a::s::borrow_s'. Invalid argument for parameter 'i' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:64:14 - │ -20 │ public fun borrow_s(s: &S, i: u64): &u64 { - │ --- Expected: 'u64' - · -63 │ fun miscall3(s: &mut s::S, i: T): &mut u64 { - │ - Given: 'T' -64 │ &mut s[i] - │ ^^^^ Invalid call of 'a::s::borrow_s'. Invalid argument for parameter 'i' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:80:10 - │ -77 │ public fun borrow_mirror(_q: &Q, i: &mut u64): &u64 { i } - │ -------- Expected: '&mut u64' -78 │ -79 │ fun miscall0(q: &Q, i: u32): &u64 { - │ --- Given: 'u32' -80 │ &q[i] - │ ^^^^ Invalid call of 'a::mirror::borrow_mirror'. Invalid argument for parameter 'i' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:84:14 - │ -77 │ public fun borrow_mirror(_q: &Q, i: &mut u64): &u64 { i } - │ -------- Expected: '&mut u64' - · -83 │ fun miscall1(q: &mut Q, i: u32): &mut u64 { - │ --- Given: 'u32' -84 │ &mut q[i] - │ ^^^^ Invalid call of 'a::mirror::borrow_mirror'. Invalid argument for parameter 'i' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:88:10 - │ -77 │ public fun borrow_mirror(_q: &Q, i: &mut u64): &u64 { i } - │ -------- Expected: '&mut u64' - · -87 │ fun miscall2(q: &Q, i: T): &u64 { - │ - Given: 'T' -88 │ &q[i] - │ ^^^^ Invalid call of 'a::mirror::borrow_mirror'. Invalid argument for parameter 'i' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:92:14 - │ -77 │ public fun borrow_mirror(_q: &Q, i: &mut u64): &u64 { i } - │ -------- Expected: '&mut u64' - · -91 │ fun miscall3(q: &mut Q, i: T): &mut u64 { - │ - Given: 'T' -92 │ &mut q[i] - │ ^^^^ Invalid call of 'a::mirror::borrow_mirror'. Invalid argument for parameter 'i' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:100:10 - │ - 8 │ native public fun borrow(v: &vector, i: u64): ∈ - │ --- Expected: 'u64' - · - 99 │ public fun miscall1(v: &vector, i: u32): &T { - │ --- Given: 'u32' -100 │ &v[i] - │ ^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:104:14 - │ - 8 │ native public fun borrow(v: &vector, i: u64): ∈ - │ --- Expected: 'u64' - · -103 │ public fun miscall2(v: &mut vector, i: u32): &mut T { - │ --- Given: 'u32' -104 │ &mut v[i] - │ ^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:108:10 - │ - 8 │ native public fun borrow(v: &vector, i: u64): ∈ - │ --- Expected: 'u64' - · -107 │ public fun miscall3(v: &vector, i: U): &T { - │ - Given: 'U' -108 │ &v[i] - │ ^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:112:14 - │ - 8 │ native public fun borrow(v: &vector, i: u64): ∈ - │ --- Expected: 'u64' - · -111 │ public fun miscall4(v: &mut vector, i: U): &mut T { - │ - Given: 'U' -112 │ &mut v[i] - │ ^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' - -error[E04017]: too many arguments - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:120:9 - │ -120 │ &v[i, j] - │ ^^^^^^^^ - │ │ │ - │ │ Found 3 argument(s) here - │ Invalid call of 'std::vector::borrow'. The call expected 2 argument(s) but got 3 - -error[E04017]: too many arguments - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:120:10 - │ -120 │ &v[i, j] - │ ^^^^^^^ - │ ││ - │ │Found 3 argument(s) here - │ Invalid call of 'std::vector::borrow'. The call expected 2 argument(s) but got 3 - -error[E04017]: too many arguments - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:124:9 - │ -124 │ &mut v[i, j] - │ ^^^^^^^^^^^^ - │ │ │ - │ │ Found 3 argument(s) here - │ Invalid call of 'std::vector::borrow_mut'. The call expected 2 argument(s) but got 3 - -error[E04017]: too many arguments - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:124:14 - │ -124 │ &mut v[i, j] - │ ^^^^^^^ - │ ││ - │ │Found 3 argument(s) here - │ Invalid call of 'std::vector::borrow'. The call expected 2 argument(s) but got 3 - -error[E04017]: too many arguments - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:128:10 - │ -128 │ &v[i, j] - │ ^^^^^^^ - │ ││ - │ │Found 3 argument(s) here - │ Invalid call of 'std::vector::borrow'. The call expected 2 argument(s) but got 3 - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:128:10 - │ - 8 │ native public fun borrow(v: &vector, i: u64): ∈ - │ --- Expected: 'u64' - · -127 │ public fun miscall3(v: &vector, i: U, j: V): &T { - │ - Given: 'U' -128 │ &v[i, j] - │ ^^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' - -error[E03004]: unbound type - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:131:59 - │ -131 │ public fun miscall4(v: &mut vector, i: U, j : V): &mut T { - │ ^ Unbound type 'V' in current scope - -error[E04017]: too many arguments - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:132:14 - │ -132 │ &mut v[i, j] - │ ^^^^^^^ - │ ││ - │ │Found 3 argument(s) here - │ Invalid call of 'std::vector::borrow'. The call expected 2 argument(s) but got 3 - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:132:14 - │ - 8 │ native public fun borrow(v: &vector, i: u64): ∈ - │ --- Expected: 'u64' - · -131 │ public fun miscall4(v: &mut vector, i: U, j : V): &mut T { - │ - Given: 'U' -132 │ &mut v[i, j] - │ ^^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' - -error[E04016]: too few arguments - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:152:9 - │ -152 │ &s[i] - │ ^^^^^ - │ │ │ - │ │ Found 2 argument(s) here - │ Invalid call of 'a::too_few_args::borrow_s'. The call expected 3 argument(s) but got 2 - -error[E04016]: too few arguments - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:152:10 - │ -152 │ &s[i] - │ ^^^^ - │ ││ - │ │Found 2 argument(s) here - │ Invalid call of 'a::too_few_args::borrow_s'. The call expected 3 argument(s) but got 2 - -error[E04016]: too few arguments - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:156:9 - │ -156 │ &mut s[i] - │ ^^^^^^^^^ - │ │ │ - │ │ Found 2 argument(s) here - │ Invalid call of 'a::too_few_args::borrow_s_mut'. The call expected 3 argument(s) but got 2 - -error[E04016]: too few arguments - ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:156:14 - │ -156 │ &mut s[i] - │ ^^^^ - │ ││ - │ │Found 2 argument(s) here - │ Invalid call of 'a::too_few_args::borrow_s'. The call expected 3 argument(s) but got 2 - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_miscalled.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_miscalled.snap new file mode 100644 index 0000000000000..6b12fb966e15e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_miscalled.snap @@ -0,0 +1,301 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_syntax_methods_miscalled.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:30:10 + │ + 8 │ native public fun borrow(v: &vector, i: u64): ∈ + │ --- Expected: 'u64' + · +29 │ public fun miscall0(s: &S, i: u32): &u64 { + │ --- Given: 'u32' +30 │ &s.t[i] + │ ^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:34:14 + │ + 8 │ native public fun borrow(v: &vector, i: u64): ∈ + │ --- Expected: 'u64' + · +33 │ public fun miscall1(s: &mut S, i: u32): &mut u64 { + │ --- Given: 'u32' +34 │ &mut s.t[i] + │ ^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:38:10 + │ + 8 │ native public fun borrow(v: &vector, i: u64): ∈ + │ --- Expected: 'u64' + · +37 │ public fun miscall2(s: &S, i: T): &u64 { + │ - Given: 'T' +38 │ &s.t[i] + │ ^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:43:14 + │ + 8 │ native public fun borrow(v: &vector, i: u64): ∈ + │ --- Expected: 'u64' + · +42 │ public fun miscall3(s: &mut S, i: T): &mut u64 { + │ - Given: 'T' +43 │ &mut s.t[i] + │ ^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:52:10 + │ +20 │ public fun borrow_s(s: &S, i: u64): &u64 { + │ --- Expected: 'u64' + · +51 │ fun miscall0(s: &s::S, i: u32): &u64 { + │ --- Given: 'u32' +52 │ &s[i] + │ ^^^^ Invalid call of 'a::s::borrow_s'. Invalid argument for parameter 'i' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:56:14 + │ +20 │ public fun borrow_s(s: &S, i: u64): &u64 { + │ --- Expected: 'u64' + · +55 │ fun miscall1(s: &mut s::S, i: u32): &mut u64 { + │ --- Given: 'u32' +56 │ &mut s[i] + │ ^^^^ Invalid call of 'a::s::borrow_s'. Invalid argument for parameter 'i' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:60:10 + │ +20 │ public fun borrow_s(s: &S, i: u64): &u64 { + │ --- Expected: 'u64' + · +59 │ fun miscall2(s: &s::S, i: T): &u64 { + │ - Given: 'T' +60 │ &s[i] + │ ^^^^ Invalid call of 'a::s::borrow_s'. Invalid argument for parameter 'i' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:64:14 + │ +20 │ public fun borrow_s(s: &S, i: u64): &u64 { + │ --- Expected: 'u64' + · +63 │ fun miscall3(s: &mut s::S, i: T): &mut u64 { + │ - Given: 'T' +64 │ &mut s[i] + │ ^^^^ Invalid call of 'a::s::borrow_s'. Invalid argument for parameter 'i' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:80:10 + │ +77 │ public fun borrow_mirror(_q: &Q, i: &mut u64): &u64 { i } + │ -------- Expected: '&mut u64' +78 │ +79 │ fun miscall0(q: &Q, i: u32): &u64 { + │ --- Given: 'u32' +80 │ &q[i] + │ ^^^^ Invalid call of 'a::mirror::borrow_mirror'. Invalid argument for parameter 'i' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:84:14 + │ +77 │ public fun borrow_mirror(_q: &Q, i: &mut u64): &u64 { i } + │ -------- Expected: '&mut u64' + · +83 │ fun miscall1(q: &mut Q, i: u32): &mut u64 { + │ --- Given: 'u32' +84 │ &mut q[i] + │ ^^^^ Invalid call of 'a::mirror::borrow_mirror'. Invalid argument for parameter 'i' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:88:10 + │ +77 │ public fun borrow_mirror(_q: &Q, i: &mut u64): &u64 { i } + │ -------- Expected: '&mut u64' + · +87 │ fun miscall2(q: &Q, i: T): &u64 { + │ - Given: 'T' +88 │ &q[i] + │ ^^^^ Invalid call of 'a::mirror::borrow_mirror'. Invalid argument for parameter 'i' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:92:14 + │ +77 │ public fun borrow_mirror(_q: &Q, i: &mut u64): &u64 { i } + │ -------- Expected: '&mut u64' + · +91 │ fun miscall3(q: &mut Q, i: T): &mut u64 { + │ - Given: 'T' +92 │ &mut q[i] + │ ^^^^ Invalid call of 'a::mirror::borrow_mirror'. Invalid argument for parameter 'i' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:100:10 + │ + 8 │ native public fun borrow(v: &vector, i: u64): ∈ + │ --- Expected: 'u64' + · + 99 │ public fun miscall1(v: &vector, i: u32): &T { + │ --- Given: 'u32' +100 │ &v[i] + │ ^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:104:14 + │ + 8 │ native public fun borrow(v: &vector, i: u64): ∈ + │ --- Expected: 'u64' + · +103 │ public fun miscall2(v: &mut vector, i: u32): &mut T { + │ --- Given: 'u32' +104 │ &mut v[i] + │ ^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:108:10 + │ + 8 │ native public fun borrow(v: &vector, i: u64): ∈ + │ --- Expected: 'u64' + · +107 │ public fun miscall3(v: &vector, i: U): &T { + │ - Given: 'U' +108 │ &v[i] + │ ^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:112:14 + │ + 8 │ native public fun borrow(v: &vector, i: u64): ∈ + │ --- Expected: 'u64' + · +111 │ public fun miscall4(v: &mut vector, i: U): &mut T { + │ - Given: 'U' +112 │ &mut v[i] + │ ^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' + +error[E04017]: too many arguments + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:120:9 + │ +120 │ &v[i, j] + │ ^^^^^^^^ + │ │ │ + │ │ Found 3 argument(s) here + │ Invalid call of 'std::vector::borrow'. The call expected 2 argument(s) but got 3 + +error[E04017]: too many arguments + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:120:10 + │ +120 │ &v[i, j] + │ ^^^^^^^ + │ ││ + │ │Found 3 argument(s) here + │ Invalid call of 'std::vector::borrow'. The call expected 2 argument(s) but got 3 + +error[E04017]: too many arguments + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:124:9 + │ +124 │ &mut v[i, j] + │ ^^^^^^^^^^^^ + │ │ │ + │ │ Found 3 argument(s) here + │ Invalid call of 'std::vector::borrow_mut'. The call expected 2 argument(s) but got 3 + +error[E04017]: too many arguments + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:124:14 + │ +124 │ &mut v[i, j] + │ ^^^^^^^ + │ ││ + │ │Found 3 argument(s) here + │ Invalid call of 'std::vector::borrow'. The call expected 2 argument(s) but got 3 + +error[E04017]: too many arguments + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:128:10 + │ +128 │ &v[i, j] + │ ^^^^^^^ + │ ││ + │ │Found 3 argument(s) here + │ Invalid call of 'std::vector::borrow'. The call expected 2 argument(s) but got 3 + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:128:10 + │ + 8 │ native public fun borrow(v: &vector, i: u64): ∈ + │ --- Expected: 'u64' + · +127 │ public fun miscall3(v: &vector, i: U, j: V): &T { + │ - Given: 'U' +128 │ &v[i, j] + │ ^^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' + +error[E03004]: unbound type + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:131:59 + │ +131 │ public fun miscall4(v: &mut vector, i: U, j : V): &mut T { + │ ^ Unbound type 'V' in current scope + +error[E04017]: too many arguments + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:132:14 + │ +132 │ &mut v[i, j] + │ ^^^^^^^ + │ ││ + │ │Found 3 argument(s) here + │ Invalid call of 'std::vector::borrow'. The call expected 2 argument(s) but got 3 + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:132:14 + │ + 8 │ native public fun borrow(v: &vector, i: u64): ∈ + │ --- Expected: 'u64' + · +131 │ public fun miscall4(v: &mut vector, i: U, j : V): &mut T { + │ - Given: 'U' +132 │ &mut v[i, j] + │ ^^^^^^^ Invalid call of 'std::vector::borrow'. Invalid argument for parameter 'i' + +error[E04016]: too few arguments + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:152:9 + │ +152 │ &s[i] + │ ^^^^^ + │ │ │ + │ │ Found 2 argument(s) here + │ Invalid call of 'a::too_few_args::borrow_s'. The call expected 3 argument(s) but got 2 + +error[E04016]: too few arguments + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:152:10 + │ +152 │ &s[i] + │ ^^^^ + │ ││ + │ │Found 2 argument(s) here + │ Invalid call of 'a::too_few_args::borrow_s'. The call expected 3 argument(s) but got 2 + +error[E04016]: too few arguments + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:156:9 + │ +156 │ &mut s[i] + │ ^^^^^^^^^ + │ │ │ + │ │ Found 2 argument(s) here + │ Invalid call of 'a::too_few_args::borrow_s_mut'. The call expected 3 argument(s) but got 2 + +error[E04016]: too few arguments + ┌─ tests/move_2024/typing/index_syntax_methods_miscalled.move:156:14 + │ +156 │ &mut s[i] + │ ^^^^ + │ ││ + │ │Found 2 argument(s) here + │ Invalid call of 'a::too_few_args::borrow_s'. The call expected 3 argument(s) but got 2 diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_tyargs_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_tyargs_valid.snap new file mode 100644 index 0000000000000..d1e6fa3ff6ba6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_tyargs_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_syntax_methods_tyargs_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_unsupported.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_unsupported.exp deleted file mode 100644 index 2e0ed72924744..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_unsupported.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E02015]: invalid attribute - ┌─ tests/move_2024/typing/index_syntax_methods_unsupported.move:29:14 - │ -29 │ #[syntax(for)] - │ ^^^ 'for' syntax attributes are not currently supported - -error[E02015]: invalid attribute - ┌─ tests/move_2024/typing/index_syntax_methods_unsupported.move:34:14 - │ -34 │ #[syntax(assign)] - │ ^^^^^^ 'assign' syntax attributes are not currently supported - -error[E02015]: invalid attribute - ┌─ tests/move_2024/typing/index_syntax_methods_unsupported.move:39:14 - │ -39 │ #[syntax(nonsense)] - │ ^^^^^^^^ Invalid syntax method identifier 'nonsense' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_unsupported.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_unsupported.snap new file mode 100644 index 0000000000000..13be2c0ddfbbd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_unsupported.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_syntax_methods_unsupported.move +--- +error[E02015]: invalid attribute + ┌─ tests/move_2024/typing/index_syntax_methods_unsupported.move:29:14 + │ +29 │ #[syntax(for)] + │ ^^^ 'for' syntax attributes are not currently supported + +error[E02015]: invalid attribute + ┌─ tests/move_2024/typing/index_syntax_methods_unsupported.move:34:14 + │ +34 │ #[syntax(assign)] + │ ^^^^^^ 'assign' syntax attributes are not currently supported + +error[E02015]: invalid attribute + ┌─ tests/move_2024/typing/index_syntax_methods_unsupported.move:39:14 + │ +39 │ #[syntax(nonsense)] + │ ^^^^^^^^ Invalid syntax method identifier 'nonsense' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_unsupported_mutability.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_unsupported_mutability.exp deleted file mode 100644 index 34cfea1b8e406..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_unsupported_mutability.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E02020]: no valid 'syntax' declaration found - ┌─ tests/move_2024/typing/index_syntax_methods_unsupported_mutability.move:42:9 - │ -42 │ s[i].mut_deref(); - │ ^^^^ Could not find a mutable index 'syntax' method - -error[E02020]: no valid 'syntax' declaration found - ┌─ tests/move_2024/typing/index_syntax_methods_unsupported_mutability.move:43:9 - │ -43 │ t[i].deref(); - │ ^^^^ Could not find an immutable index 'syntax' method - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_unsupported_mutability.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_unsupported_mutability.snap new file mode 100644 index 0000000000000..e5f3e1de2c0b1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_syntax_methods_unsupported_mutability.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_syntax_methods_unsupported_mutability.move +--- +error[E02020]: no valid 'syntax' declaration found + ┌─ tests/move_2024/typing/index_syntax_methods_unsupported_mutability.move:42:9 + │ +42 │ s[i].mut_deref(); + │ ^^^^ Could not find a mutable index 'syntax' method + +error[E02020]: no valid 'syntax' declaration found + ┌─ tests/move_2024/typing/index_syntax_methods_unsupported_mutability.move:43:9 + │ +43 │ t[i].deref(); + │ ^^^^ Could not find an immutable index 'syntax' method diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_underspecified.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_underspecified.exp deleted file mode 100644 index 1720d3066b96f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_underspecified.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/index_underspecified.move:13:5 - │ -12 │ public fun index_by_reference(table: &mut Table) { - │ --- Expected: 'u64' -13 │ table[&1].push_back(3); - │ ^^^^^^^^^ - │ │ │ - │ │ Given: '&{integer}' - │ Invalid call of 'a::m::borrow'. Invalid argument for parameter '_k' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_underspecified.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_underspecified.snap new file mode 100644 index 0000000000000..4a76652e76119 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/index_underspecified.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/index_underspecified.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/index_underspecified.move:13:5 + │ +12 │ public fun index_by_reference(table: &mut Table) { + │ --- Expected: 'u64' +13 │ table[&1].push_back(3); + │ ^^^^^^^^^ + │ │ │ + │ │ Given: '&{integer}' + │ Invalid call of 'a::m::borrow'. Invalid argument for parameter '_k' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/internal_module_deprecations.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/internal_module_deprecations.exp deleted file mode 100644 index cc691e606495f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/internal_module_deprecations.exp +++ /dev/null @@ -1,136 +0,0 @@ -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/internal_module_deprecations.move:3:13 - │ -3 │ Bad(A), - │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/internal_module_deprecations.move:26:9 - │ -26 │ foo(); - │ ^^^ The function '0x42::m::foo' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/internal_module_deprecations.move:27:9 - │ -27 │ foo(); - │ ^^^ The function '0x42::m::foo' is deprecated - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/internal_module_deprecations.move:28:9 - │ -28 │ bar_dep(); - │ ^^^^^^^ The function '0x42::m::bar_dep' is deprecated: Use the baz function instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/internal_module_deprecations.move:31:23 - │ -31 │ public fun qux(_: A) { } - │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/internal_module_deprecations.move:33:30 - │ -33 │ public fun return_dep(): A { - │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/internal_module_deprecations.move:34:9 - │ -34 │ A() - │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/internal_module_deprecations.move:38:9 - │ -38 │ H - │ ^ The constant '0x42::m::H' is deprecated: Use the L constant instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/internal_module_deprecations.move:42:15 - │ -42 │ abort OldError - │ ^^^^^^^^ The constant '0x42::m::OldError' is deprecated: Use `NewError` instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/internal_module_deprecations.move:46:18 - │ -46 │ let y = (A(): A); - │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/internal_module_deprecations.move:46:23 - │ -46 │ let y = (A(): A); - │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/internal_module_deprecations.move:48:13 - │ -48 │ A() => (), - │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/internal_module_deprecations.move:50:9 - │ -50 │ A() = A(); - │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/internal_module_deprecations.move:50:15 - │ -50 │ A() = A(); - │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/internal_module_deprecations.move:51:13 - │ -51 │ let A() = A(); - │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/internal_module_deprecations.move:51:19 - │ -51 │ let A() = A(); - │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04037]: deprecated usage - ┌─ tests/move_2024/typing/internal_module_deprecations.move:55:24 - │ -55 │ let _ = R::Bad(A()); - │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. - │ - = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/internal_module_deprecations.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/internal_module_deprecations.snap new file mode 100644 index 0000000000000..464314023e157 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/internal_module_deprecations.snap @@ -0,0 +1,143 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/internal_module_deprecations.move +--- +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/internal_module_deprecations.move:3:13 + │ +3 │ Bad(A), + │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/internal_module_deprecations.move:26:9 + │ +26 │ foo(); + │ ^^^ The function '0x42::m::foo' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/internal_module_deprecations.move:27:9 + │ +27 │ foo(); + │ ^^^ The function '0x42::m::foo' is deprecated + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/internal_module_deprecations.move:28:9 + │ +28 │ bar_dep(); + │ ^^^^^^^ The function '0x42::m::bar_dep' is deprecated: Use the baz function instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/internal_module_deprecations.move:31:23 + │ +31 │ public fun qux(_: A) { } + │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/internal_module_deprecations.move:33:30 + │ +33 │ public fun return_dep(): A { + │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/internal_module_deprecations.move:34:9 + │ +34 │ A() + │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/internal_module_deprecations.move:38:9 + │ +38 │ H + │ ^ The constant '0x42::m::H' is deprecated: Use the L constant instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/internal_module_deprecations.move:42:15 + │ +42 │ abort OldError + │ ^^^^^^^^ The constant '0x42::m::OldError' is deprecated: Use `NewError` instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/internal_module_deprecations.move:46:18 + │ +46 │ let y = (A(): A); + │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/internal_module_deprecations.move:46:23 + │ +46 │ let y = (A(): A); + │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/internal_module_deprecations.move:48:13 + │ +48 │ A() => (), + │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/internal_module_deprecations.move:50:9 + │ +50 │ A() = A(); + │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/internal_module_deprecations.move:50:15 + │ +50 │ A() = A(); + │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/internal_module_deprecations.move:51:13 + │ +51 │ let A() = A(); + │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/internal_module_deprecations.move:51:19 + │ +51 │ let A() = A(); + │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04037]: deprecated usage + ┌─ tests/move_2024/typing/internal_module_deprecations.move:55:24 + │ +55 │ let _ = R::Bad(A()); + │ ^ The struct '0x42::m::A' is deprecated: Use the B struct instead. + │ + = This warning can be suppressed with '#[allow(deprecated_usage)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/invalid_assertion_const.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/invalid_assertion_const.exp deleted file mode 100644 index 76b6387bdc360..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/invalid_assertion_const.exp +++ /dev/null @@ -1,22 +0,0 @@ -error[E04035]: invalid constant usage in error context - ┌─ tests/move_2024/typing/invalid_assertion_const.move:5:15 - │ -2 │ const X: vector = b"X"; - │ - 'X' defined here with no '#[error]' annotation - · -5 │ abort X; - │ ^ Invalid error code for abort, expected a u64 or constant declared with '#[error]' annotation - │ - = Non-u64 constants can only be used as error codes if the '#[error]' attribute is added to them. - -error[E04035]: invalid constant usage in error context - ┌─ tests/move_2024/typing/invalid_assertion_const.move:9:24 - │ -2 │ const X: vector = b"X"; - │ - 'X' defined here with no '#[error]' annotation - · -9 │ assert!(false, X); - │ ^ Invalid error code for assertion, expected a u64 or constant declared with '#[error]' annotation - │ - = Non-u64 constants can only be used as error codes if the '#[error]' attribute is added to them. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/invalid_assertion_const.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/invalid_assertion_const.snap new file mode 100644 index 0000000000000..7fe34049a4f5a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/invalid_assertion_const.snap @@ -0,0 +1,29 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/invalid_assertion_const.move +--- +error[E04035]: invalid constant usage in error context + ┌─ tests/move_2024/typing/invalid_assertion_const.move:5:15 + │ +2 │ const X: vector = b"X"; + │ - 'X' defined here with no '#[error]' annotation + · +5 │ abort X; + │ ^ Invalid error code for abort, expected a u64 or constant declared with '#[error]' annotation + │ + = Non-u64 constants can only be used as error codes if the '#[error]' attribute is added to them. + +error[E04035]: invalid constant usage in error context + ┌─ tests/move_2024/typing/invalid_assertion_const.move:9:24 + │ +2 │ const X: vector = b"X"; + │ - 'X' defined here with no '#[error]' annotation + · +9 │ assert!(false, X); + │ ^ Invalid error code for assertion, expected a u64 or constant declared with '#[error]' annotation + │ + = Non-u64 constants can only be used as error codes if the '#[error]' attribute is added to them. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/invalid_capabilities.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/invalid_capabilities.exp deleted file mode 100644 index 3473f76de9b6a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/invalid_capabilities.exp +++ /dev/null @@ -1,144 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/invalid_capabilities.move:8:37 - │ -3 │ public struct Nothing { } - │ ------- To satisfy the constraint, the 'copy' ability would need to be added here - · -8 │ public enum ECopy0 has copy { V(Nothing) } - │ ^^^^^^^ - │ │ - │ Invalid field type. The enum was declared with the ability 'copy' so all fields require the ability 'copy' - │ The type '0x42::m::Nothing' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/invalid_capabilities.move:9:37 - │ -4 │ public struct Drop has drop { } - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - · -9 │ public enum ECopy1 has copy { V(Drop) } - │ ^^^^ - │ │ - │ Invalid field type. The enum was declared with the ability 'copy' so all fields require the ability 'copy' - │ The type '0x42::m::Drop' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/invalid_capabilities.move:10:37 - │ - 6 │ public struct Store has store { } - │ ----- To satisfy the constraint, the 'copy' ability would need to be added here - · -10 │ public enum ECopy2 has copy { V(Store) } - │ ^^^^^ - │ │ - │ Invalid field type. The enum was declared with the ability 'copy' so all fields require the ability 'copy' - │ The type '0x42::m::Store' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/invalid_capabilities.move:13:12 - │ - 3 │ public struct Nothing { } - │ ------- To satisfy the constraint, the 'copy' ability would need to be added here - · -13 │ V1(Nothing) - │ ^^^^^^^ - │ │ - │ Invalid field type. The enum was declared with the ability 'copy' so all fields require the ability 'copy' - │ The type '0x42::m::Nothing' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/invalid_capabilities.move:16:37 - │ - 3 │ public struct Nothing { } - │ ------- To satisfy the constraint, the 'drop' ability would need to be added here - · -16 │ public enum EDrop0 has drop { V(Nothing) } - │ ^^^^^^^ - │ │ - │ Invalid field type. The enum was declared with the ability 'drop' so all fields require the ability 'drop' - │ The type '0x42::m::Nothing' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/invalid_capabilities.move:17:37 - │ - 5 │ public struct Copy has copy { } - │ ---- To satisfy the constraint, the 'drop' ability would need to be added here - · -17 │ public enum EDrop1 has drop { V(Copy) } - │ ^^^^ - │ │ - │ Invalid field type. The enum was declared with the ability 'drop' so all fields require the ability 'drop' - │ The type '0x42::m::Copy' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/invalid_capabilities.move:18:37 - │ - 6 │ public struct Store has store { } - │ ----- To satisfy the constraint, the 'drop' ability would need to be added here - · -18 │ public enum EDrop2 has drop { V(Store) } - │ ^^^^^ - │ │ - │ Invalid field type. The enum was declared with the ability 'drop' so all fields require the ability 'drop' - │ The type '0x42::m::Store' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/invalid_capabilities.move:21:12 - │ - 3 │ public struct Nothing { } - │ ------- To satisfy the constraint, the 'drop' ability would need to be added here - · -21 │ V1(Nothing) - │ ^^^^^^^ - │ │ - │ Invalid field type. The enum was declared with the ability 'drop' so all fields require the ability 'drop' - │ The type '0x42::m::Nothing' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/invalid_capabilities.move:24:39 - │ - 3 │ public struct Nothing { } - │ ------- To satisfy the constraint, the 'store' ability would need to be added here - · -24 │ public enum EStore0 has store { V(Nothing) } - │ ^^^^^^^ - │ │ - │ Invalid field type. The enum was declared with the ability 'store' so all fields require the ability 'store' - │ The type '0x42::m::Nothing' does not have the ability 'store' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/invalid_capabilities.move:25:39 - │ - 5 │ public struct Copy has copy { } - │ ---- To satisfy the constraint, the 'store' ability would need to be added here - · -25 │ public enum EStore1 has store { V(Copy) } - │ ^^^^ - │ │ - │ Invalid field type. The enum was declared with the ability 'store' so all fields require the ability 'store' - │ The type '0x42::m::Copy' does not have the ability 'store' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/invalid_capabilities.move:26:39 - │ - 4 │ public struct Drop has drop { } - │ ---- To satisfy the constraint, the 'store' ability would need to be added here - · -26 │ public enum EStore2 has store { V(Drop) } - │ ^^^^ - │ │ - │ Invalid field type. The enum was declared with the ability 'store' so all fields require the ability 'store' - │ The type '0x42::m::Drop' does not have the ability 'store' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/invalid_capabilities.move:29:12 - │ - 3 │ public struct Nothing { } - │ ------- To satisfy the constraint, the 'store' ability would need to be added here - · -29 │ V1(Nothing) - │ ^^^^^^^ - │ │ - │ Invalid field type. The enum was declared with the ability 'store' so all fields require the ability 'store' - │ The type '0x42::m::Nothing' does not have the ability 'store' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/invalid_capabilities.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/invalid_capabilities.snap new file mode 100644 index 0000000000000..f77518f12c82d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/invalid_capabilities.snap @@ -0,0 +1,151 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/invalid_capabilities.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/invalid_capabilities.move:8:37 + │ +3 │ public struct Nothing { } + │ ------- To satisfy the constraint, the 'copy' ability would need to be added here + · +8 │ public enum ECopy0 has copy { V(Nothing) } + │ ^^^^^^^ + │ │ + │ Invalid field type. The enum was declared with the ability 'copy' so all fields require the ability 'copy' + │ The type '0x42::m::Nothing' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/invalid_capabilities.move:9:37 + │ +4 │ public struct Drop has drop { } + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + · +9 │ public enum ECopy1 has copy { V(Drop) } + │ ^^^^ + │ │ + │ Invalid field type. The enum was declared with the ability 'copy' so all fields require the ability 'copy' + │ The type '0x42::m::Drop' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/invalid_capabilities.move:10:37 + │ + 6 │ public struct Store has store { } + │ ----- To satisfy the constraint, the 'copy' ability would need to be added here + · +10 │ public enum ECopy2 has copy { V(Store) } + │ ^^^^^ + │ │ + │ Invalid field type. The enum was declared with the ability 'copy' so all fields require the ability 'copy' + │ The type '0x42::m::Store' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/invalid_capabilities.move:13:12 + │ + 3 │ public struct Nothing { } + │ ------- To satisfy the constraint, the 'copy' ability would need to be added here + · +13 │ V1(Nothing) + │ ^^^^^^^ + │ │ + │ Invalid field type. The enum was declared with the ability 'copy' so all fields require the ability 'copy' + │ The type '0x42::m::Nothing' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/invalid_capabilities.move:16:37 + │ + 3 │ public struct Nothing { } + │ ------- To satisfy the constraint, the 'drop' ability would need to be added here + · +16 │ public enum EDrop0 has drop { V(Nothing) } + │ ^^^^^^^ + │ │ + │ Invalid field type. The enum was declared with the ability 'drop' so all fields require the ability 'drop' + │ The type '0x42::m::Nothing' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/invalid_capabilities.move:17:37 + │ + 5 │ public struct Copy has copy { } + │ ---- To satisfy the constraint, the 'drop' ability would need to be added here + · +17 │ public enum EDrop1 has drop { V(Copy) } + │ ^^^^ + │ │ + │ Invalid field type. The enum was declared with the ability 'drop' so all fields require the ability 'drop' + │ The type '0x42::m::Copy' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/invalid_capabilities.move:18:37 + │ + 6 │ public struct Store has store { } + │ ----- To satisfy the constraint, the 'drop' ability would need to be added here + · +18 │ public enum EDrop2 has drop { V(Store) } + │ ^^^^^ + │ │ + │ Invalid field type. The enum was declared with the ability 'drop' so all fields require the ability 'drop' + │ The type '0x42::m::Store' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/invalid_capabilities.move:21:12 + │ + 3 │ public struct Nothing { } + │ ------- To satisfy the constraint, the 'drop' ability would need to be added here + · +21 │ V1(Nothing) + │ ^^^^^^^ + │ │ + │ Invalid field type. The enum was declared with the ability 'drop' so all fields require the ability 'drop' + │ The type '0x42::m::Nothing' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/invalid_capabilities.move:24:39 + │ + 3 │ public struct Nothing { } + │ ------- To satisfy the constraint, the 'store' ability would need to be added here + · +24 │ public enum EStore0 has store { V(Nothing) } + │ ^^^^^^^ + │ │ + │ Invalid field type. The enum was declared with the ability 'store' so all fields require the ability 'store' + │ The type '0x42::m::Nothing' does not have the ability 'store' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/invalid_capabilities.move:25:39 + │ + 5 │ public struct Copy has copy { } + │ ---- To satisfy the constraint, the 'store' ability would need to be added here + · +25 │ public enum EStore1 has store { V(Copy) } + │ ^^^^ + │ │ + │ Invalid field type. The enum was declared with the ability 'store' so all fields require the ability 'store' + │ The type '0x42::m::Copy' does not have the ability 'store' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/invalid_capabilities.move:26:39 + │ + 4 │ public struct Drop has drop { } + │ ---- To satisfy the constraint, the 'store' ability would need to be added here + · +26 │ public enum EStore2 has store { V(Drop) } + │ ^^^^ + │ │ + │ Invalid field type. The enum was declared with the ability 'store' so all fields require the ability 'store' + │ The type '0x42::m::Drop' does not have the ability 'store' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/invalid_capabilities.move:29:12 + │ + 3 │ public struct Nothing { } + │ ------- To satisfy the constraint, the 'store' ability would need to be added here + · +29 │ V1(Nothing) + │ ^^^^^^^ + │ │ + │ Invalid field type. The enum was declared with the ability 'store' so all fields require the ability 'store' + │ The type '0x42::m::Nothing' does not have the ability 'store' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/invalid_deprecation_attributes.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/invalid_deprecation_attributes.exp deleted file mode 100644 index 5a19cba61e49f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/invalid_deprecation_attributes.exp +++ /dev/null @@ -1,60 +0,0 @@ -error[E10004]: invalid usage of known attribute - ┌─ tests/move_2024/typing/invalid_deprecation_attributes.move:2:7 - │ -2 │ #[deprecated = b"This is a deprecated function"] - │ ^^^^^^^^^^ Invalid 'deprecated' attribute - │ - = Deprecation attributes must be written as `#[deprecated]` or `#[deprecated(note = b"message")]` - -error[E10004]: invalid usage of known attribute - ┌─ tests/move_2024/typing/invalid_deprecation_attributes.move:5:7 - │ -5 │ #[deprecated(msg = b"This is a deprecated function")] - │ ^^^^^^^^^^ Invalid 'deprecated' attribute - │ - = Deprecation attributes must be written as `#[deprecated]` or `#[deprecated(note = b"message")]` - -error[E10004]: invalid usage of known attribute - ┌─ tests/move_2024/typing/invalid_deprecation_attributes.move:8:7 - │ -8 │ #[deprecated(b"This is a deprecated function")] - │ ^^^^^^^^^^ Invalid 'deprecated' attribute - │ - = Deprecation attributes must be written as `#[deprecated]` or `#[deprecated(note = b"message")]` - -error[E01002]: unexpected token - ┌─ tests/move_2024/typing/invalid_deprecation_attributes.move:8:18 - │ -8 │ #[deprecated(b"This is a deprecated function")] - │ ^ Unexpected ''. Expected attribute - -error[E10004]: invalid usage of known attribute - ┌─ tests/move_2024/typing/invalid_deprecation_attributes.move:11:7 - │ -11 │ #[deprecated(note = b"This is a deprecated function", other = b"other")] - │ ^^^^^^^^^^ Invalid 'deprecated' attribute - │ - = Deprecation attributes must be written as `#[deprecated]` or `#[deprecated(note = b"message")]` - -error[E10004]: invalid usage of known attribute - ┌─ tests/move_2024/typing/invalid_deprecation_attributes.move:14:7 - │ -14 │ #[deprecated(note = 123)] - │ ^^^^^^^^^^ Invalid 'deprecated' attribute - │ - = Deprecation attributes must be written as `#[deprecated]` or `#[deprecated(note = b"message")]` - -warning[W02018]: unknown attribute - ┌─ tests/move_2024/typing/invalid_deprecation_attributes.move:17:7 - │ -17 │ #[deprication] - │ ^^^^^^^^^^^ Unknown attribute 'deprication'. Custom attributes must be wrapped in 'ext', e.g. #[ext(deprication)] - -error[E10004]: invalid usage of known attribute - ┌─ tests/move_2024/typing/invalid_deprecation_attributes.move:20:7 - │ -20 │ #[deprecated(foo)] - │ ^^^^^^^^^^ Invalid 'deprecated' attribute - │ - = Deprecation attributes must be written as `#[deprecated]` or `#[deprecated(note = b"message")]` - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/invalid_deprecation_attributes.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/invalid_deprecation_attributes.snap new file mode 100644 index 0000000000000..661f3a1f35457 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/invalid_deprecation_attributes.snap @@ -0,0 +1,67 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/invalid_deprecation_attributes.move +--- +error[E10004]: invalid usage of known attribute + ┌─ tests/move_2024/typing/invalid_deprecation_attributes.move:2:7 + │ +2 │ #[deprecated = b"This is a deprecated function"] + │ ^^^^^^^^^^ Invalid 'deprecated' attribute + │ + = Deprecation attributes must be written as `#[deprecated]` or `#[deprecated(note = b"message")]` + +error[E10004]: invalid usage of known attribute + ┌─ tests/move_2024/typing/invalid_deprecation_attributes.move:5:7 + │ +5 │ #[deprecated(msg = b"This is a deprecated function")] + │ ^^^^^^^^^^ Invalid 'deprecated' attribute + │ + = Deprecation attributes must be written as `#[deprecated]` or `#[deprecated(note = b"message")]` + +error[E10004]: invalid usage of known attribute + ┌─ tests/move_2024/typing/invalid_deprecation_attributes.move:8:7 + │ +8 │ #[deprecated(b"This is a deprecated function")] + │ ^^^^^^^^^^ Invalid 'deprecated' attribute + │ + = Deprecation attributes must be written as `#[deprecated]` or `#[deprecated(note = b"message")]` + +error[E01002]: unexpected token + ┌─ tests/move_2024/typing/invalid_deprecation_attributes.move:8:18 + │ +8 │ #[deprecated(b"This is a deprecated function")] + │ ^ Unexpected ''. Expected attribute + +error[E10004]: invalid usage of known attribute + ┌─ tests/move_2024/typing/invalid_deprecation_attributes.move:11:7 + │ +11 │ #[deprecated(note = b"This is a deprecated function", other = b"other")] + │ ^^^^^^^^^^ Invalid 'deprecated' attribute + │ + = Deprecation attributes must be written as `#[deprecated]` or `#[deprecated(note = b"message")]` + +error[E10004]: invalid usage of known attribute + ┌─ tests/move_2024/typing/invalid_deprecation_attributes.move:14:7 + │ +14 │ #[deprecated(note = 123)] + │ ^^^^^^^^^^ Invalid 'deprecated' attribute + │ + = Deprecation attributes must be written as `#[deprecated]` or `#[deprecated(note = b"message")]` + +warning[W02018]: unknown attribute + ┌─ tests/move_2024/typing/invalid_deprecation_attributes.move:17:7 + │ +17 │ #[deprication] + │ ^^^^^^^^^^^ Unknown attribute 'deprication'. Custom attributes must be wrapped in 'ext', e.g. #[ext(deprication)] + +error[E10004]: invalid usage of known attribute + ┌─ tests/move_2024/typing/invalid_deprecation_attributes.move:20:7 + │ +20 │ #[deprecated(foo)] + │ ^^^^^^^^^^ Invalid 'deprecated' attribute + │ + = Deprecation attributes must be written as `#[deprecated]` or `#[deprecated(note = b"message")]` diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_annotated_return_type.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_annotated_return_type.snap new file mode 100644 index 0000000000000..6c8ccfda5f4e3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_annotated_return_type.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/lambda_annotated_return_type.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_annotated_return_type_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_annotated_return_type_invalid.exp deleted file mode 100644 index cd0fba9e9c7d6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_annotated_return_type_invalid.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/lambda_annotated_return_type_invalid.move:13:9 - │ -13 │ call!(|| -> X { 0 }).foo(); - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Given: integer - │ │ Expected: 'a::m::X' - │ Invalid type annotation - -error[E04006]: invalid subtype - ┌─ tests/move_2024/typing/lambda_annotated_return_type_invalid.move:14:9 - │ -14 │ call!(|| -> &mut u64 { &0 }); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Given: '&{integer}' - │ │ Expected: '&mut u64' - │ Invalid type annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_annotated_return_type_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_annotated_return_type_invalid.snap new file mode 100644 index 0000000000000..e1b33225b4289 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_annotated_return_type_invalid.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/lambda_annotated_return_type_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/lambda_annotated_return_type_invalid.move:13:9 + │ +13 │ call!(|| -> X { 0 }).foo(); + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Given: integer + │ │ Expected: 'a::m::X' + │ Invalid type annotation + +error[E04006]: invalid subtype + ┌─ tests/move_2024/typing/lambda_annotated_return_type_invalid.move:14:9 + │ +14 │ call!(|| -> &mut u64 { &0 }); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Given: '&{integer}' + │ │ Expected: '&mut u64' + │ Invalid type annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return.snap new file mode 100644 index 0000000000000..aac92f7e6ee0e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/lambda_return.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return_invalid_conditional.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return_invalid_conditional.exp deleted file mode 100644 index 9027b3146e619..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return_invalid_conditional.exp +++ /dev/null @@ -1,72 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/lambda_return_invalid_conditional.move:7:18 - │ -7 │ call!(|| { if (cond) return 0; &1 }); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found: '&{integer}'. It is not compatible with the other type. - │ │ Found: integer. It is not compatible with the other type. - │ Invalid lambda return - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/lambda_return_invalid_conditional.move:8:18 - │ -8 │ call!(|| { if (cond) 1 else return &0 }); - │ ---------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - │ │ │ │ - │ │ │ Found: '&{integer}'. It is not compatible with the other type. - │ │ Invalid lambda return - │ Found: integer. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/lambda_return_invalid_conditional.move:9:18 - │ -9 │ call!(|| { if (cond) return 0; &1 }); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found: '&{integer}'. It is not compatible with the other type. - │ │ Found: integer. It is not compatible with the other type. - │ Invalid lambda return - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/lambda_return_invalid_conditional.move:10:18 - │ -10 │ call!(|| { if (cond) 1 else return &0 }); - │ ---------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - │ │ │ │ - │ │ │ Found: '&{integer}'. It is not compatible with the other type. - │ │ Invalid lambda return - │ Found: integer. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/lambda_return_invalid_conditional.move:11:18 - │ -11 │ call!(|| { if (cond) return (vector[], 0, false); (vector[0], true) }); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found expression list of length 2: '(vector<{integer}>, bool)'. It is not compatible with the other type of length 3. - │ │ Found expression list of length 3: '(vector<_>, {integer}, bool)'. It is not compatible with the other type of length 2. - │ Invalid lambda return - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/lambda_return_invalid_conditional.move:11:38 - │ -11 │ call!(|| { if (cond) return (vector[], 0, false); (vector[0], true) }); - │ ^^^^^^^^ Could not infer this type. Try adding an annotation - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/lambda_return_invalid_conditional.move:12:18 - │ -12 │ call!(|| { if (cond) (vector[], 0, false) else return (vector[0], true) }); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found expression list of length 2: '(vector<{integer}>, bool)'. It is not compatible with the other type of length 3. - │ │ Found expression list of length 3: '(vector<_>, {integer}, bool)'. It is not compatible with the other type of length 2. - │ Invalid lambda return - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/lambda_return_invalid_conditional.move:12:31 - │ -12 │ call!(|| { if (cond) (vector[], 0, false) else return (vector[0], true) }); - │ ^^^^^^^^ Could not infer this type. Try adding an annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return_invalid_conditional.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return_invalid_conditional.snap new file mode 100644 index 0000000000000..c4891461da7be --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return_invalid_conditional.snap @@ -0,0 +1,79 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/lambda_return_invalid_conditional.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/lambda_return_invalid_conditional.move:7:18 + │ +7 │ call!(|| { if (cond) return 0; &1 }); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found: '&{integer}'. It is not compatible with the other type. + │ │ Found: integer. It is not compatible with the other type. + │ Invalid lambda return + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/lambda_return_invalid_conditional.move:8:18 + │ +8 │ call!(|| { if (cond) 1 else return &0 }); + │ ---------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- + │ │ │ │ + │ │ │ Found: '&{integer}'. It is not compatible with the other type. + │ │ Invalid lambda return + │ Found: integer. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/lambda_return_invalid_conditional.move:9:18 + │ +9 │ call!(|| { if (cond) return 0; &1 }); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found: '&{integer}'. It is not compatible with the other type. + │ │ Found: integer. It is not compatible with the other type. + │ Invalid lambda return + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/lambda_return_invalid_conditional.move:10:18 + │ +10 │ call!(|| { if (cond) 1 else return &0 }); + │ ---------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- + │ │ │ │ + │ │ │ Found: '&{integer}'. It is not compatible with the other type. + │ │ Invalid lambda return + │ Found: integer. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/lambda_return_invalid_conditional.move:11:18 + │ +11 │ call!(|| { if (cond) return (vector[], 0, false); (vector[0], true) }); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found expression list of length 2: '(vector<{integer}>, bool)'. It is not compatible with the other type of length 3. + │ │ Found expression list of length 3: '(vector<_>, {integer}, bool)'. It is not compatible with the other type of length 2. + │ Invalid lambda return + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/lambda_return_invalid_conditional.move:11:38 + │ +11 │ call!(|| { if (cond) return (vector[], 0, false); (vector[0], true) }); + │ ^^^^^^^^ Could not infer this type. Try adding an annotation + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/lambda_return_invalid_conditional.move:12:18 + │ +12 │ call!(|| { if (cond) (vector[], 0, false) else return (vector[0], true) }); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found expression list of length 2: '(vector<{integer}>, bool)'. It is not compatible with the other type of length 3. + │ │ Found expression list of length 3: '(vector<_>, {integer}, bool)'. It is not compatible with the other type of length 2. + │ Invalid lambda return + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/lambda_return_invalid_conditional.move:12:31 + │ +12 │ call!(|| { if (cond) (vector[], 0, false) else return (vector[0], true) }); + │ ^^^^^^^^ Could not infer this type. Try adding an annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return_invalid_simple.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return_invalid_simple.exp deleted file mode 100644 index 44f24d5990c45..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return_invalid_simple.exp +++ /dev/null @@ -1,30 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/lambda_return_invalid_simple.move:8:23 - │ -8 │ call!(|| return &0); - │ --- ^^^^^^^^^ - │ │ │ │ - │ │ │ Found: '&{integer}'. It is not compatible with the other type. - │ │ Invalid lambda return - │ Found: 'u64'. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/lambda_return_invalid_simple.move:9:24 - │ -9 │ call!<&u64>(|| return 0); - │ ---- ^^^^^^^^ - │ │ │ - │ │ Invalid lambda return - │ │ Found: integer. It is not compatible with the other type. - │ Found: '&u64'. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/lambda_return_invalid_simple.move:10:30 - │ -10 │ call!<(&u64, u8)>(|| return (&0, 1, 3)); - │ ---------- ^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found expression list of length 3: '(&{integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - │ │ Invalid lambda return - │ Found expression list of length 2: '(&u64, u8)'. It is not compatible with the other type of length 3. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return_invalid_simple.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return_invalid_simple.snap new file mode 100644 index 0000000000000..5b3899858c343 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return_invalid_simple.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/lambda_return_invalid_simple.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/lambda_return_invalid_simple.move:8:23 + │ +8 │ call!(|| return &0); + │ --- ^^^^^^^^^ + │ │ │ │ + │ │ │ Found: '&{integer}'. It is not compatible with the other type. + │ │ Invalid lambda return + │ Found: 'u64'. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/lambda_return_invalid_simple.move:9:24 + │ +9 │ call!<&u64>(|| return 0); + │ ---- ^^^^^^^^ + │ │ │ + │ │ Invalid lambda return + │ │ Found: integer. It is not compatible with the other type. + │ Found: '&u64'. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/lambda_return_invalid_simple.move:10:30 + │ +10 │ call!<(&u64, u8)>(|| return (&0, 1, 3)); + │ ---------- ^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found expression list of length 3: '(&{integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + │ │ Invalid lambda return + │ Found expression list of length 2: '(&u64, u8)'. It is not compatible with the other type of length 3. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return_mismatched.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return_mismatched.exp deleted file mode 100644 index 054a3bb0a2d76..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return_mismatched.exp +++ /dev/null @@ -1,57 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/lambda_return_mismatched.move:9:23 - │ -8 │ if (cond) return 0; - │ -------- Expected: integer -9 │ if (cond) return false; - │ ^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid return - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/lambda_return_mismatched.move:10:13 - │ - 8 │ if (cond) return 0; - │ -------- Expected: integer - 9 │ if (cond) return false; -10 │ return @0 - │ ^^^^^^^^^ - │ │ │ - │ │ Given: 'address' - │ Invalid return - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/lambda_return_mismatched.move:15:13 - │ -13 │ if (cond) return &0; - │ -- Expected: '&{integer}' -14 │ if (cond) return &mut 0; -15 │ return 0 - │ ^^^^^^^^ - │ │ │ - │ │ Given: integer - │ Invalid return - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/lambda_return_mismatched.move:19:23 - │ -18 │ if (cond) return (&0, vector[0]); - │ - Expected: integer -19 │ if (cond) return (&mut 0, vector[false]); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid return - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/lambda_return_mismatched.move:24:23 - │ -23 │ if (cond) return (&0, vector[0]); - │ --------------- Expected expression list of length 2: '(&{integer}, vector<{integer}>)' -24 │ if (cond) return (&0, vector[0], 1); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given expression list of length 3: '(&{integer}, vector<{integer}>, {integer})' - │ Invalid return - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return_mismatched.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return_mismatched.snap new file mode 100644 index 0000000000000..ae1ec6acfa6ac --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_return_mismatched.snap @@ -0,0 +1,64 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/lambda_return_mismatched.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/lambda_return_mismatched.move:9:23 + │ +8 │ if (cond) return 0; + │ -------- Expected: integer +9 │ if (cond) return false; + │ ^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid return + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/lambda_return_mismatched.move:10:13 + │ + 8 │ if (cond) return 0; + │ -------- Expected: integer + 9 │ if (cond) return false; +10 │ return @0 + │ ^^^^^^^^^ + │ │ │ + │ │ Given: 'address' + │ Invalid return + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/lambda_return_mismatched.move:15:13 + │ +13 │ if (cond) return &0; + │ -- Expected: '&{integer}' +14 │ if (cond) return &mut 0; +15 │ return 0 + │ ^^^^^^^^ + │ │ │ + │ │ Given: integer + │ Invalid return + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/lambda_return_mismatched.move:19:23 + │ +18 │ if (cond) return (&0, vector[0]); + │ - Expected: integer +19 │ if (cond) return (&mut 0, vector[false]); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid return + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/lambda_return_mismatched.move:24:23 + │ +23 │ if (cond) return (&0, vector[0]); + │ --------------- Expected expression list of length 2: '(&{integer}, vector<{integer}>)' +24 │ if (cond) return (&0, vector[0], 1); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given expression list of length 3: '(&{integer}, vector<{integer}>, {integer})' + │ Invalid return diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_subtyping_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_subtyping_invalid.exp deleted file mode 100644 index f347b0a49b224..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_subtyping_invalid.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E04006]: invalid subtype - ┌─ tests/move_2024/typing/lambda_subtyping_invalid.move:12:9 - │ - 2 │ macro fun imm_arg($f: |&u64| -> u64) { - │ ---- Given: '&u64' - · -12 │ imm_arg!(|x: &mut u64| *x = 1); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected: '&mut u64' - │ Invalid call of 'a::m::imm_arg'. Invalid argument for parameter '$f' - -error[E04006]: invalid subtype - ┌─ tests/move_2024/typing/lambda_subtyping_invalid.move:13:9 - │ - 7 │ macro fun mut_ret($f: || -> &mut u64) { - │ -------- Expected: '&mut u64' - · -13 │ mut_ret!(|| -> &u64 { &0 }); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: '&u64' - │ Invalid call of 'a::m::mut_ret'. Invalid argument for parameter '$f' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_subtyping_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_subtyping_invalid.snap new file mode 100644 index 0000000000000..78256b66a590d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_subtyping_invalid.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/lambda_subtyping_invalid.move +--- +error[E04006]: invalid subtype + ┌─ tests/move_2024/typing/lambda_subtyping_invalid.move:12:9 + │ + 2 │ macro fun imm_arg($f: |&u64| -> u64) { + │ ---- Given: '&u64' + · +12 │ imm_arg!(|x: &mut u64| *x = 1); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected: '&mut u64' + │ Invalid call of 'a::m::imm_arg'. Invalid argument for parameter '$f' + +error[E04006]: invalid subtype + ┌─ tests/move_2024/typing/lambda_subtyping_invalid.move:13:9 + │ + 7 │ macro fun mut_ret($f: || -> &mut u64) { + │ -------- Expected: '&mut u64' + · +13 │ mut_ret!(|| -> &u64 { &0 }); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: '&u64' + │ Invalid call of 'a::m::mut_ret'. Invalid argument for parameter '$f' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_subtyping_usage_respects_annotations.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_subtyping_usage_respects_annotations.exp deleted file mode 100644 index 7693e405d5bdd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_subtyping_usage_respects_annotations.exp +++ /dev/null @@ -1,34 +0,0 @@ -error[E04006]: invalid subtype - ┌─ tests/move_2024/typing/lambda_subtyping_usage_respects_annotations.move:15:10 - │ -15 │ *$f() = 0; - │ ^^^^ - │ │ - │ Invalid mutation. Expected a mutable reference - │ Expected: '&mut _' - · -24 │ return_imm!(|| &mut x); - │ ------ Given: '&u64' - -error[E04006]: invalid subtype - ┌─ tests/move_2024/typing/lambda_subtyping_usage_respects_annotations.move:20:24 - │ - 3 │ macro fun pass_imm($f: |&u64|) { - │ ---- Given: '&u64' - · -20 │ pass_imm!(|x| *x = 0); - │ ^ - │ │ - │ Invalid mutation. Expected a mutable reference - │ Expected: '&mut _' - -error[E04006]: invalid subtype - ┌─ tests/move_2024/typing/lambda_subtyping_usage_respects_annotations.move:21:30 - │ -21 │ pass_mut!(|x: &u64| *x = 0); - │ ---- ^ - │ │ │ - │ │ Invalid mutation. Expected a mutable reference - │ │ Expected: '&mut _' - │ Given: '&u64' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_subtyping_usage_respects_annotations.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_subtyping_usage_respects_annotations.snap new file mode 100644 index 0000000000000..fff03871399b6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_subtyping_usage_respects_annotations.snap @@ -0,0 +1,41 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/lambda_subtyping_usage_respects_annotations.move +--- +error[E04006]: invalid subtype + ┌─ tests/move_2024/typing/lambda_subtyping_usage_respects_annotations.move:15:10 + │ +15 │ *$f() = 0; + │ ^^^^ + │ │ + │ Invalid mutation. Expected a mutable reference + │ Expected: '&mut _' + · +24 │ return_imm!(|| &mut x); + │ ------ Given: '&u64' + +error[E04006]: invalid subtype + ┌─ tests/move_2024/typing/lambda_subtyping_usage_respects_annotations.move:20:24 + │ + 3 │ macro fun pass_imm($f: |&u64|) { + │ ---- Given: '&u64' + · +20 │ pass_imm!(|x| *x = 0); + │ ^ + │ │ + │ Invalid mutation. Expected a mutable reference + │ Expected: '&mut _' + +error[E04006]: invalid subtype + ┌─ tests/move_2024/typing/lambda_subtyping_usage_respects_annotations.move:21:30 + │ +21 │ pass_mut!(|x: &u64| *x = 0); + │ ---- ^ + │ │ │ + │ │ Invalid mutation. Expected a mutable reference + │ │ Expected: '&mut _' + │ Given: '&u64' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_subtyping_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_subtyping_valid.snap new file mode 100644 index 0000000000000..c7b8fc18352fb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/lambda_subtyping_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/lambda_subtyping_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_assign.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_assign.exp deleted file mode 100644 index ba27740dfd988..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_assign.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/let_mut_assign.move:7:9 - │ -3 │ public fun t(x: u64, s: S): u64 { - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' - · -7 │ x = y + 1; - │ ^ Invalid assignment of immutable variable 'x' - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/let_mut_assign.move:8:9 - │ -5 │ let S { f } = s; - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut f' - · -8 │ f = f + 1; - │ ^ Invalid assignment of immutable variable 'f' - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/let_mut_assign.move:9:9 - │ -4 │ let y = 0; - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut y' - · -9 │ y = x + f; - │ ^ Invalid assignment of immutable variable 'y' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_assign.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_assign.snap new file mode 100644 index 0000000000000..63f00e38ddd91 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_assign.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/let_mut_assign.move +--- +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/let_mut_assign.move:7:9 + │ +3 │ public fun t(x: u64, s: S): u64 { + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' + · +7 │ x = y + 1; + │ ^ Invalid assignment of immutable variable 'x' + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/let_mut_assign.move:8:9 + │ +5 │ let S { f } = s; + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut f' + · +8 │ f = f + 1; + │ ^ Invalid assignment of immutable variable 'f' + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/let_mut_assign.move:9:9 + │ +4 │ let y = 0; + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut y' + · +9 │ y = x + f; + │ ^ Invalid assignment of immutable variable 'y' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_assign_loop_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_assign_loop_invalid.exp deleted file mode 100644 index 8f8234e7f1fbb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_assign_loop_invalid.exp +++ /dev/null @@ -1,55 +0,0 @@ -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/let_mut_assign_loop_invalid.move:4:24 - │ -3 │ let a; - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut a' -4 │ while (cond) { a = 0; a; }; - │ ^ - │ │ - │ Invalid assignment of immutable variable 'a' - │ The variable is assigned multiple times here in a loop - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/let_mut_assign_loop_invalid.move:9:16 - │ -8 │ let b; - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut b' -9 │ loop { b = 0; b; } - │ ^ - │ │ - │ Invalid assignment of immutable variable 'b' - │ The variable is assigned multiple times here in a loop - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/let_mut_assign_loop_invalid.move:14:24 - │ -13 │ let x; - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' -14 │ while (cond) { x = 1; x; }; - │ ^ - │ │ - │ Invalid assignment of immutable variable 'x' - │ The variable is assigned multiple times here in a loop - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/let_mut_assign_loop_invalid.move:15:9 - │ -13 │ let x; - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' -14 │ while (cond) { x = 1; x; }; - │ - The variable was initially assigned here -15 │ x = 1; - │ ^ Invalid assignment of immutable variable 'x' - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/let_mut_assign_loop_invalid.move:22:13 - │ -20 │ let x; - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' -21 │ loop { -22 │ x = 0; - │ ^ - │ │ - │ Invalid assignment of immutable variable 'x' - │ The variable is assigned multiple times here in a loop - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_assign_loop_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_assign_loop_invalid.snap new file mode 100644 index 0000000000000..46c346410bfdd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_assign_loop_invalid.snap @@ -0,0 +1,62 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/let_mut_assign_loop_invalid.move +--- +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/let_mut_assign_loop_invalid.move:4:24 + │ +3 │ let a; + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut a' +4 │ while (cond) { a = 0; a; }; + │ ^ + │ │ + │ Invalid assignment of immutable variable 'a' + │ The variable is assigned multiple times here in a loop + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/let_mut_assign_loop_invalid.move:9:16 + │ +8 │ let b; + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut b' +9 │ loop { b = 0; b; } + │ ^ + │ │ + │ Invalid assignment of immutable variable 'b' + │ The variable is assigned multiple times here in a loop + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/let_mut_assign_loop_invalid.move:14:24 + │ +13 │ let x; + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' +14 │ while (cond) { x = 1; x; }; + │ ^ + │ │ + │ Invalid assignment of immutable variable 'x' + │ The variable is assigned multiple times here in a loop + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/let_mut_assign_loop_invalid.move:15:9 + │ +13 │ let x; + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' +14 │ while (cond) { x = 1; x; }; + │ - The variable was initially assigned here +15 │ x = 1; + │ ^ Invalid assignment of immutable variable 'x' + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/let_mut_assign_loop_invalid.move:22:13 + │ +20 │ let x; + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' +21 │ loop { +22 │ x = 0; + │ ^ + │ │ + │ Invalid assignment of immutable variable 'x' + │ The variable is assigned multiple times here in a loop diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_assign_loop_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_assign_loop_valid.snap new file mode 100644 index 0000000000000..3a52c2d4c76cf --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_assign_loop_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/let_mut_assign_loop_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_borrow_mut.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_borrow_mut.exp deleted file mode 100644 index dea877510e49f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_borrow_mut.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/let_mut_borrow_mut.move:7:13 - │ -3 │ public fun t(x: u64, s: S) { - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' - · -7 │ foo(&mut x); - │ ^^^^^^ Invalid mutable borrow of immutable variable 'x' - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/let_mut_borrow_mut.move:8:13 - │ -4 │ let y = 0; - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut y' - · -8 │ foo(&mut y); - │ ^^^^^^ Invalid mutable borrow of immutable variable 'y' - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/let_mut_borrow_mut.move:9:13 - │ -5 │ let S { f } = s; - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut f' - · -9 │ foo(&mut f); - │ ^^^^^^ Invalid mutable borrow of immutable variable 'f' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_borrow_mut.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_borrow_mut.snap new file mode 100644 index 0000000000000..b32f54af70711 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_borrow_mut.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/let_mut_borrow_mut.move +--- +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/let_mut_borrow_mut.move:7:13 + │ +3 │ public fun t(x: u64, s: S) { + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' + · +7 │ foo(&mut x); + │ ^^^^^^ Invalid mutable borrow of immutable variable 'x' + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/let_mut_borrow_mut.move:8:13 + │ +4 │ let y = 0; + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut y' + · +8 │ foo(&mut y); + │ ^^^^^^ Invalid mutable borrow of immutable variable 'y' + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/let_mut_borrow_mut.move:9:13 + │ +5 │ let S { f } = s; + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut f' + · +9 │ foo(&mut f); + │ ^^^^^^ Invalid mutable borrow of immutable variable 'f' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_borrow_mut_dot_call.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_borrow_mut_dot_call.exp deleted file mode 100644 index 2495486805772..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_borrow_mut_dot_call.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/let_mut_borrow_mut_dot_call.move:8:9 - │ -4 │ public fun t(x: S, r: R) { - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' - · -8 │ x.foo(); - │ ^ Invalid mutable borrow of immutable variable 'x' - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/let_mut_borrow_mut_dot_call.move:9:9 - │ -5 │ let y = S { f: 0 }; - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut y' - · -9 │ y.foo(); - │ ^ Invalid mutable borrow of immutable variable 'y' - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/let_mut_borrow_mut_dot_call.move:10:9 - │ - 6 │ let R { s } = r; - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut s' - · -10 │ s.foo(); - │ ^ Invalid mutable borrow of immutable variable 's' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_borrow_mut_dot_call.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_borrow_mut_dot_call.snap new file mode 100644 index 0000000000000..bf55018ffc682 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_borrow_mut_dot_call.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/let_mut_borrow_mut_dot_call.move +--- +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/let_mut_borrow_mut_dot_call.move:8:9 + │ +4 │ public fun t(x: S, r: R) { + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' + · +8 │ x.foo(); + │ ^ Invalid mutable borrow of immutable variable 'x' + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/let_mut_borrow_mut_dot_call.move:9:9 + │ +5 │ let y = S { f: 0 }; + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut y' + · +9 │ y.foo(); + │ ^ Invalid mutable borrow of immutable variable 'y' + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/let_mut_borrow_mut_dot_call.move:10:9 + │ + 6 │ let R { s } = r; + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut s' + · +10 │ s.foo(); + │ ^ Invalid mutable borrow of immutable variable 's' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_decl.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_decl.exp deleted file mode 100644 index 7d7f32d4f527d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_decl.exp +++ /dev/null @@ -1,32 +0,0 @@ -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/let_mut_decl.move:6:9 - │ -3 │ let x; - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' -4 │ x = 0; - │ - The variable was initially assigned here -5 │ move x; -6 │ x = 1; - │ ^ Invalid assignment of immutable variable 'x' - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/let_mut_decl.move:14:9 - │ -11 │ let x; - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' -12 │ x = 0; - │ - The variable was initially assigned here -13 │ if (cond) { move x; }; -14 │ x = 1; - │ ^ Invalid assignment of immutable variable 'x' - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/let_mut_decl.move:21:9 - │ -19 │ let x; - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' -20 │ if (cond) { x = 0; copy x; }; - │ - The variable was initially assigned here -21 │ x = 1; - │ ^ Invalid assignment of immutable variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_decl.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_decl.snap new file mode 100644 index 0000000000000..fca0772362948 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_decl.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/let_mut_decl.move +--- +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/let_mut_decl.move:6:9 + │ +3 │ let x; + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' +4 │ x = 0; + │ - The variable was initially assigned here +5 │ move x; +6 │ x = 1; + │ ^ Invalid assignment of immutable variable 'x' + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/let_mut_decl.move:14:9 + │ +11 │ let x; + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' +12 │ x = 0; + │ - The variable was initially assigned here +13 │ if (cond) { move x; }; +14 │ x = 1; + │ ^ Invalid assignment of immutable variable 'x' + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/let_mut_decl.move:21:9 + │ +19 │ let x; + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' +20 │ if (cond) { x = 0; copy x; }; + │ - The variable was initially assigned here +21 │ x = 1; + │ ^ Invalid assignment of immutable variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_initial_assign.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_initial_assign.snap new file mode 100644 index 0000000000000..9e75147c629e4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_initial_assign.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/let_mut_initial_assign.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_macro_return.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_macro_return.exp deleted file mode 100644 index 8830b43bb6aad..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_macro_return.exp +++ /dev/null @@ -1,21 +0,0 @@ -warning[W09012]: unused 'mut' modifiers - ┌─ tests/move_2024/typing/let_mut_macro_return.move:3:17 - │ -3 │ let mut i = $start; - │ --- ^ The variable 'i' is never used mutably - │ │ - │ Consider removing the 'mut' declaration here - │ - = This warning can be suppressed with '#[allow(unused_let_mut)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/typing/let_mut_macro_return.move:16:35 - │ - 7 │ i = i + 1; - │ --------- Unreachable code. This statement (and any following statements) will not be executed. - · -16 │ 'a: { for_each!(0, 1, |_| return 'a) } - │ ^^^^^^^^^ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_macro_return.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_macro_return.snap new file mode 100644 index 0000000000000..a7eff0812c594 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_macro_return.snap @@ -0,0 +1,28 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/let_mut_macro_return.move +--- +warning[W09012]: unused 'mut' modifiers + ┌─ tests/move_2024/typing/let_mut_macro_return.move:3:17 + │ +3 │ let mut i = $start; + │ --- ^ The variable 'i' is never used mutably + │ │ + │ Consider removing the 'mut' declaration here + │ + = This warning can be suppressed with '#[allow(unused_let_mut)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/typing/let_mut_macro_return.move:16:35 + │ + 7 │ i = i + 1; + │ --------- Unreachable code. This statement (and any following statements) will not be executed. + · +16 │ 'a: { for_each!(0, 1, |_| return 'a) } + │ ^^^^^^^^^ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_shadow.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_shadow.exp deleted file mode 100644 index 49a2599c9cdbb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_shadow.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/let_mut_shadow.move:9:9 - │ -3 │ public fun foo(x: u64) { - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' - · -9 │ x = x + 1; - │ ^ Invalid assignment of immutable variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_shadow.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_shadow.snap new file mode 100644 index 0000000000000..1294a2cb77ad1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/let_mut_shadow.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/let_mut_shadow.move +--- +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/let_mut_shadow.move:9:9 + │ +3 │ public fun foo(x: u64) { + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' + · +9 │ x = x + 1; + │ ^ Invalid assignment of immutable variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_deref.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_deref.exp deleted file mode 100644 index 26692795fe1f2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_deref.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/macro_arg_by_name_invalid_usage_deref.move:4:9 - │ -4 │ $_x = 0; - │ ^^^ Cannot assign to argument for parameter '$_x'. Arguments must be used in value positions - │ - = 'macro' parameters are substituted without being evaluated. There is no local variable to assign to - -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/typing/macro_arg_by_name_invalid_usage_deref.move:9:14 - │ -9 │ foo!(*x); - │ ^^ Unused macro argument. Its expression will not be type checked and it will not evaluated - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_deref.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_deref.snap new file mode 100644 index 0000000000000..870c9295a5111 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_deref.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_deref.move +--- +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/macro_arg_by_name_invalid_usage_deref.move:4:9 + │ +4 │ $_x = 0; + │ ^^^ Cannot assign to argument for parameter '$_x'. Arguments must be used in value positions + │ + = 'macro' parameters are substituted without being evaluated. There is no local variable to assign to + +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/typing/macro_arg_by_name_invalid_usage_deref.move:9:14 + │ +9 │ foo!(*x); + │ ^^ Unused macro argument. Its expression will not be type checked and it will not evaluated + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_value.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_value.exp deleted file mode 100644 index 874201d64ffa0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_value.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/typing/macro_arg_by_name_invalid_usage_value.move:4:14 - │ -4 │ copy $x; - │ ^^ Macro parameters are not allowed to appear in paths - │ - = To use a macro parameter as a value in a path expression, first bind it to a local variable, e.g. 'let x = $x;' - = Macro parameters are always treated as value expressions, and are not modified by path operations. - Path operations include 'move', 'copy', '&', '&mut', and field references - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/typing/macro_arg_by_name_invalid_usage_value.move:5:14 - │ -5 │ move $x; - │ ^^ Macro parameters are not allowed to appear in paths - │ - = To use a macro parameter as a value in a path expression, first bind it to a local variable, e.g. 'let x = $x;' - = Macro parameters are always treated as value expressions, and are not modified by path operations. - Path operations include 'move', 'copy', '&', '&mut', and field references - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_value.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_value.snap new file mode 100644 index 0000000000000..7264af2ebe1b7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_value.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_value.move +--- +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/typing/macro_arg_by_name_invalid_usage_value.move:4:14 + │ +4 │ copy $x; + │ ^^ Macro parameters are not allowed to appear in paths + │ + = To use a macro parameter as a value in a path expression, first bind it to a local variable, e.g. 'let x = $x;' + = Macro parameters are always treated as value expressions, and are not modified by path operations. + Path operations include 'move', 'copy', '&', '&mut', and field references + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/typing/macro_arg_by_name_invalid_usage_value.move:5:14 + │ +5 │ move $x; + │ ^^ Macro parameters are not allowed to appear in paths + │ + = To use a macro parameter as a value in a path expression, first bind it to a local variable, e.g. 'let x = $x;' + = Macro parameters are always treated as value expressions, and are not modified by path operations. + Path operations include 'move', 'copy', '&', '&mut', and field references diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_var.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_var.exp deleted file mode 100644 index b90baf5d03163..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_var.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/typing/macro_arg_by_name_invalid_usage_var.move:4:14 - │ -4 │ copy $x; - │ ^^ Macro parameters are not allowed to appear in paths - │ - = To use a macro parameter as a value in a path expression, first bind it to a local variable, e.g. 'let x = $x;' - = Macro parameters are always treated as value expressions, and are not modified by path operations. - Path operations include 'move', 'copy', '&', '&mut', and field references - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/typing/macro_arg_by_name_invalid_usage_var.move:5:14 - │ -5 │ move $x; - │ ^^ Macro parameters are not allowed to appear in paths - │ - = To use a macro parameter as a value in a path expression, first bind it to a local variable, e.g. 'let x = $x;' - = Macro parameters are always treated as value expressions, and are not modified by path operations. - Path operations include 'move', 'copy', '&', '&mut', and field references - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_var.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_var.snap new file mode 100644 index 0000000000000..004cb1cb4b2f5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_var.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_invalid_usage_var.move +--- +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/typing/macro_arg_by_name_invalid_usage_var.move:4:14 + │ +4 │ copy $x; + │ ^^ Macro parameters are not allowed to appear in paths + │ + = To use a macro parameter as a value in a path expression, first bind it to a local variable, e.g. 'let x = $x;' + = Macro parameters are always treated as value expressions, and are not modified by path operations. + Path operations include 'move', 'copy', '&', '&mut', and field references + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/typing/macro_arg_by_name_invalid_usage_var.move:5:14 + │ +5 │ move $x; + │ ^^ Macro parameters are not allowed to appear in paths + │ + = To use a macro parameter as a value in a path expression, first bind it to a local variable, e.g. 'let x = $x;' + = Macro parameters are always treated as value expressions, and are not modified by path operations. + Path operations include 'move', 'copy', '&', '&mut', and field references diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_strange_usage.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_strange_usage.exp deleted file mode 100644 index 4863bc6f263fc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_strange_usage.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_arg_by_name_strange_usage.move:18:14 - │ - 2 │ public struct X() has drop; - │ - To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct S { f: X } has drop; - │ - The type 'a::m::X' does not have the ability 'copy' - · -18 │ foo!(s.f); // TODO improve this error message - │ ^^^ Invalid implicit copy of field 'f' without the 'copy' ability - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_strange_usage.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_strange_usage.snap new file mode 100644 index 0000000000000..bce49e017b891 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_strange_usage.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_strange_usage.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_arg_by_name_strange_usage.move:18:14 + │ + 2 │ public struct X() has drop; + │ - To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct S { f: X } has drop; + │ - The type 'a::m::X' does not have the ability 'copy' + · +18 │ foo!(s.f); // TODO improve this error message + │ ^^^ Invalid implicit copy of field 'f' without the 'copy' ability diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_strange_usage_fields.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_strange_usage_fields.snap new file mode 100644 index 0000000000000..841380aa8cc0e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_strange_usage_fields.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_arg_by_name_strange_usage_fields.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_by_name_gives_unique_locals.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_by_name_gives_unique_locals.exp deleted file mode 100644 index 746082591dd58..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_by_name_gives_unique_locals.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E07005]: invalid transfer of references - ┌─ tests/move_2024/typing/macro_by_name_gives_unique_locals.move:13:9 - │ -13 │ check_unique(s1, s2) - │ ^^^^^^^^^^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed - · -25 │ foo!(&mut s); - │ ------ It is still being mutably borrowed by this reference - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_by_name_gives_unique_locals.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_by_name_gives_unique_locals.snap new file mode 100644 index 0000000000000..3131310cba90e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_by_name_gives_unique_locals.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_by_name_gives_unique_locals.move +--- +error[E07005]: invalid transfer of references + ┌─ tests/move_2024/typing/macro_by_name_gives_unique_locals.move:13:9 + │ +13 │ check_unique(s1, s2) + │ ^^^^^^^^^^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed + · +25 │ foo!(&mut s); + │ ------ It is still being mutably borrowed by this reference diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_call_indirect_lambda_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_call_indirect_lambda_invalid.exp deleted file mode 100644 index 91c4a821931a6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_call_indirect_lambda_invalid.exp +++ /dev/null @@ -1,80 +0,0 @@ -error[E04031]: invalid usage of lambda - ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:3:12 - │ -3 │ $f($x) - │ ^^ Lambdas can only be used directly as arguments to 'macro' functions - -error[E04031]: invalid usage of lambda - ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:7:17 - │ -7 │ let f = |x| x + 1; - │ ^^^^^^^^^ Lambdas can only be used directly as arguments to 'macro' functions - -warning[W09002]: unused variable - ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:8:13 - │ -8 │ let x = apply!(f, 1); - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:8:24 - │ -8 │ let x = apply!(f, 1); - │ ^ Unable to bind lambda to parameter '$f'. The lambda must be passed directly - -error[E04030]: invalid usage of lambda type - ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:12:13 - │ -12 │ let f: |u64| -> u64; - │ ^ Unexpected lambda type. Lambdas can only be used with 'macro' functions, as parameters or direct arguments - -warning[W09002]: unused variable - ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:13:13 - │ -13 │ let x = apply!(f, 1); - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:13:24 - │ -13 │ let x = apply!(f, 1); - │ ^ Unable to bind lambda to parameter '$f'. The lambda must be passed directly - -warning[W09002]: unused variable - ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:17:13 - │ -17 │ let x = apply!((0: |u64| -> u64), 1); - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:17:24 - │ -17 │ let x = apply!((0: |u64| -> u64), 1); - │ ^^^^^^^^^^^^^^^^^ Unable to bind lambda to parameter '$f'. The lambda must be passed directly - -warning[W09002]: unused variable - ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:21:13 - │ -21 │ let x = apply!(|x| x, |x| x); - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:21:17 - │ - 2 │ macro fun apply($f: |u64| -> u64, $x: u64): u64 { - │ --- Expected: 'u64' - · -21 │ let x = apply!(|x| x, |x| x); - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: '|_| -> _' - │ Invalid call of 'a::m::apply'. Invalid argument for parameter '$x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_call_indirect_lambda_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_call_indirect_lambda_invalid.snap new file mode 100644 index 0000000000000..6fd6716ca456e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_call_indirect_lambda_invalid.snap @@ -0,0 +1,87 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_call_indirect_lambda_invalid.move +--- +error[E04031]: invalid usage of lambda + ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:3:12 + │ +3 │ $f($x) + │ ^^ Lambdas can only be used directly as arguments to 'macro' functions + +error[E04031]: invalid usage of lambda + ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:7:17 + │ +7 │ let f = |x| x + 1; + │ ^^^^^^^^^ Lambdas can only be used directly as arguments to 'macro' functions + +warning[W09002]: unused variable + ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:8:13 + │ +8 │ let x = apply!(f, 1); + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:8:24 + │ +8 │ let x = apply!(f, 1); + │ ^ Unable to bind lambda to parameter '$f'. The lambda must be passed directly + +error[E04030]: invalid usage of lambda type + ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:12:13 + │ +12 │ let f: |u64| -> u64; + │ ^ Unexpected lambda type. Lambdas can only be used with 'macro' functions, as parameters or direct arguments + +warning[W09002]: unused variable + ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:13:13 + │ +13 │ let x = apply!(f, 1); + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:13:24 + │ +13 │ let x = apply!(f, 1); + │ ^ Unable to bind lambda to parameter '$f'. The lambda must be passed directly + +warning[W09002]: unused variable + ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:17:13 + │ +17 │ let x = apply!((0: |u64| -> u64), 1); + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:17:24 + │ +17 │ let x = apply!((0: |u64| -> u64), 1); + │ ^^^^^^^^^^^^^^^^^ Unable to bind lambda to parameter '$f'. The lambda must be passed directly + +warning[W09002]: unused variable + ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:21:13 + │ +21 │ let x = apply!(|x| x, |x| x); + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macro_call_indirect_lambda_invalid.move:21:17 + │ + 2 │ macro fun apply($f: |u64| -> u64, $x: u64): u64 { + │ --- Expected: 'u64' + · +21 │ let x = apply!(|x| x, |x| x); + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: '|_| -> _' + │ Invalid call of 'a::m::apply'. Invalid argument for parameter '$x' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_dependency_cycle.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_dependency_cycle.snap new file mode 100644 index 0000000000000..9d684f5dfd735 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_dependency_cycle.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_dependency_cycle.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_dot_call_auto_borrow.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_dot_call_auto_borrow.snap new file mode 100644 index 0000000000000..910666fa3cc91 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_dot_call_auto_borrow.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_dot_call_auto_borrow.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_constraint.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_constraint.snap new file mode 100644 index 0000000000000..2039daba70367 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_constraint.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_duck_typing_constraint.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_constraint_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_constraint_invalid.exp deleted file mode 100644 index 8c01e08517e2f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_constraint_invalid.exp +++ /dev/null @@ -1,57 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_duck_typing_constraint_invalid.move:9:41 - │ - 2 │ public struct X() has copy, drop; - │ ---- 'copy' constraint declared here - 3 │ public struct None() has drop; - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - · - 9 │ macro fun needs_copy<$T, $U, $V>(_: X<$T>, _: $U, $v: $V): X<$U> { - │ ^^^^^ 'copy' constraint not satisifed - · -17 │ needs_copy!(X(), None(), None()); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_duck_typing_constraint_invalid.move:9:64 - │ - 2 │ public struct X() has copy, drop; - │ ---- 'copy' constraint declared here - 3 │ public struct None() has drop; - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - · - 9 │ macro fun needs_copy<$T, $U, $V>(_: X<$T>, _: $U, $v: $V): X<$U> { - │ ^^^^^ 'copy' constraint not satisifed - · -17 │ needs_copy!(X(), None(), None()); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_duck_typing_constraint_invalid.move:11:9 - │ - 3 │ public struct None() has drop; - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 4 │ - 5 │ fun mycopy(t: &T): T { - │ ---- 'copy' constraint declared here - · -11 │ mycopy(&v); - │ ^^^^^^^^^^ 'copy' constraint not satisifed - · -17 │ needs_copy!(X(), None(), None()); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_duck_typing_constraint_invalid.move:12:9 - │ - 2 │ public struct X() has copy, drop; - │ ---- 'copy' constraint declared here - 3 │ public struct None() has drop; - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - · -12 │ X() - │ ^^^ 'copy' constraint not satisifed - · -17 │ needs_copy!(X(), None(), None()); - │ ---- The type 'a::m::None' does not have the ability 'copy' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_constraint_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_constraint_invalid.snap new file mode 100644 index 0000000000000..9da2e2c442dcf --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_constraint_invalid.snap @@ -0,0 +1,64 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_duck_typing_constraint_invalid.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_duck_typing_constraint_invalid.move:9:41 + │ + 2 │ public struct X() has copy, drop; + │ ---- 'copy' constraint declared here + 3 │ public struct None() has drop; + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + · + 9 │ macro fun needs_copy<$T, $U, $V>(_: X<$T>, _: $U, $v: $V): X<$U> { + │ ^^^^^ 'copy' constraint not satisifed + · +17 │ needs_copy!(X(), None(), None()); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_duck_typing_constraint_invalid.move:9:64 + │ + 2 │ public struct X() has copy, drop; + │ ---- 'copy' constraint declared here + 3 │ public struct None() has drop; + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + · + 9 │ macro fun needs_copy<$T, $U, $V>(_: X<$T>, _: $U, $v: $V): X<$U> { + │ ^^^^^ 'copy' constraint not satisifed + · +17 │ needs_copy!(X(), None(), None()); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_duck_typing_constraint_invalid.move:11:9 + │ + 3 │ public struct None() has drop; + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 4 │ + 5 │ fun mycopy(t: &T): T { + │ ---- 'copy' constraint declared here + · +11 │ mycopy(&v); + │ ^^^^^^^^^^ 'copy' constraint not satisifed + · +17 │ needs_copy!(X(), None(), None()); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_duck_typing_constraint_invalid.move:12:9 + │ + 2 │ public struct X() has copy, drop; + │ ---- 'copy' constraint declared here + 3 │ public struct None() has drop; + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + · +12 │ X() + │ ^^^ 'copy' constraint not satisifed + · +17 │ needs_copy!(X(), None(), None()); + │ ---- The type 'a::m::None' does not have the ability 'copy' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_method.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_method.snap new file mode 100644 index 0000000000000..f431d894f8e62 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_method.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_duck_typing_method.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_method_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_method_invalid.exp deleted file mode 100644 index 8f29fe065adfa..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_method_invalid.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/macro_duck_typing_method_invalid.move:5:9 - │ -5 │ x.foo() - │ ^^^^^^^ - │ │ │ - │ │ No local 'use fun' alias was found for 'a::m::X.foo', and no function 'foo' was found in the defining module 'a::m' - │ Invalid method call. No known method 'foo' on type 'a::m::X' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_method_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_method_invalid.snap new file mode 100644 index 0000000000000..b65badec95376 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_method_invalid.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_duck_typing_method_invalid.move +--- +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/macro_duck_typing_method_invalid.move:5:9 + │ +5 │ x.foo() + │ ^^^^^^^ + │ │ │ + │ │ No local 'use fun' alias was found for 'a::m::X.foo', and no function 'foo' was found in the defining module 'a::m' + │ Invalid method call. No known method 'foo' on type 'a::m::X' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_specific_type.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_specific_type.snap new file mode 100644 index 0000000000000..cb8780c5434eb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_specific_type.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_duck_typing_specific_type.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_specific_type_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_specific_type_invalid.exp deleted file mode 100644 index 7970de55fcbd9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_specific_type_invalid.exp +++ /dev/null @@ -1,51 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macro_duck_typing_specific_type_invalid.move:5:14 - │ - 5 │ ($x: X); - │ ^ - │ │ - │ Invalid type annotation - │ Expected: 'a::m::X' - · -17 │ is_x!(0); - │ -------- Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macro_duck_typing_specific_type_invalid.move:8:37 - │ - 8 │ macro fun is_x_ret<$T>($x: $T): X { - │ ^ - │ │ - │ Invalid type annotation - │ Expected: 'a::m::X' - · -18 │ is_x_ret!(0); - │ ------------ Given: integer - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/typing/macro_duck_typing_specific_type_invalid.move:13:10 - │ -13 │ ($x as $T); - │ ^^ Invalid argument to 'as' - · -19 │ is_num!(X()); - │ --- Found: 'a::m::X'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/typing/macro_duck_typing_specific_type_invalid.move:13:10 - │ -13 │ ($x as $T); - │ ^^ Invalid argument to 'as' - · -20 │ is_num!(@0); - │ -- Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/typing/macro_duck_typing_specific_type_invalid.move:13:10 - │ -13 │ ($x as $T); - │ ^^ Invalid argument to 'as' - · -21 │ is_num!(vector[0]); - │ --------- Found: 'vector'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_specific_type_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_specific_type_invalid.snap new file mode 100644 index 0000000000000..15d01415b5c7a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_duck_typing_specific_type_invalid.snap @@ -0,0 +1,58 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_duck_typing_specific_type_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macro_duck_typing_specific_type_invalid.move:5:14 + │ + 5 │ ($x: X); + │ ^ + │ │ + │ Invalid type annotation + │ Expected: 'a::m::X' + · +17 │ is_x!(0); + │ -------- Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macro_duck_typing_specific_type_invalid.move:8:37 + │ + 8 │ macro fun is_x_ret<$T>($x: $T): X { + │ ^ + │ │ + │ Invalid type annotation + │ Expected: 'a::m::X' + · +18 │ is_x_ret!(0); + │ ------------ Given: integer + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/typing/macro_duck_typing_specific_type_invalid.move:13:10 + │ +13 │ ($x as $T); + │ ^^ Invalid argument to 'as' + · +19 │ is_num!(X()); + │ --- Found: 'a::m::X'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/typing/macro_duck_typing_specific_type_invalid.move:13:10 + │ +13 │ ($x as $T); + │ ^^ Invalid argument to 'as' + · +20 │ is_num!(@0); + │ -- Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/typing/macro_duck_typing_specific_type_invalid.move:13:10 + │ +13 │ ($x as $T); + │ ^^ Invalid argument to 'as' + · +21 │ is_num!(vector[0]); + │ --------- Found: 'vector'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_subst_tparams.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_subst_tparams.snap new file mode 100644 index 0000000000000..fd79dd18866fa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_subst_tparams.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_subst_tparams.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_subst_tparams_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_subst_tparams_invalid.exp deleted file mode 100644 index b4ce70e90390e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_subst_tparams_invalid.exp +++ /dev/null @@ -1,206 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:10:31 - │ - 2 │ public struct None() has drop; - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct X() has copy, drop, store; - │ ---- 'copy' constraint declared here - · -10 │ macro fun useless<$U>($x: X<$U>): X<$U> { - │ ^^^^^ 'copy' constraint not satisifed - · -27 │ useless!(X()); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:10:39 - │ - 2 │ public struct None() has drop; - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct X() has copy, drop, store; - │ ---- 'copy' constraint declared here - · -10 │ macro fun useless<$U>($x: X<$U>): X<$U> { - │ ^^^^^ 'copy' constraint not satisifed - · -27 │ useless!(X()); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:12:16 - │ - 2 │ public struct None() has drop; - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct X() has copy, drop, store; - │ ---- 'copy' constraint declared here - · -12 │ freeze>(&mut X()); - │ ^^^^^ 'copy' constraint not satisifed - · -27 │ useless!(X()); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:12:28 - │ - 2 │ public struct None() has drop; - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct X() has copy, drop, store; - │ ---- 'copy' constraint declared here - · -12 │ freeze>(&mut X()); - │ ^^^ 'copy' constraint not satisifed - · -27 │ useless!(X()); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:13:9 - │ - 2 │ public struct None() has drop; - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct X() has copy, drop, store; - 4 │ public fun f(_: X) {} - │ ---- 'copy' constraint declared here - · -13 │ f<$U>(X()); - │ ^^^^^^^^^^ 'copy' constraint not satisifed - · -27 │ useless!(X()); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:13:15 - │ - 2 │ public struct None() has drop; - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct X() has copy, drop, store; - │ ---- 'copy' constraint declared here - · -13 │ f<$U>(X()); - │ ^^^ 'copy' constraint not satisifed - · -27 │ useless!(X()); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:14:9 - │ - 2 │ public struct None() has drop; - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct X() has copy, drop, store; - │ ---- 'copy' constraint declared here - · -14 │ X<$U>(); - │ ^^^^^^^ 'copy' constraint not satisifed - · -27 │ useless!(X()); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:15:9 - │ - 2 │ public struct None() has drop; - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct X() has copy, drop, store; - 4 │ public fun f(_: X) {} - │ ---- 'copy' constraint declared here - · -15 │ x.f<$U>(); - │ ^^^^^^^^^ 'copy' constraint not satisifed - · -27 │ useless!(X()); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:16:23 - │ - 2 │ public struct None() has drop; - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct X() has copy, drop, store; - │ ---- 'copy' constraint declared here - · -16 │ apply!(x, |_: X<$U>| ()); - │ ^^^^^ 'copy' constraint not satisifed - · -27 │ useless!(X()); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:17:9 - │ - 2 │ public struct None() has drop; - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct X() has copy, drop, store; - │ ---- 'copy' constraint declared here - · -17 │ X<$U>() = x; - │ ^^^^^^^ 'copy' constraint not satisifed - · -27 │ useless!(X()); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:18:16 - │ - 2 │ public struct None() has drop; - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct X() has copy, drop, store; - │ ---- 'copy' constraint declared here - · -18 │ let _: X<$U> = x; - │ ^^^^^ 'copy' constraint not satisifed - · -27 │ useless!(X()); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:19:13 - │ - 2 │ public struct None() has drop; - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct X() has copy, drop, store; - │ ---- 'copy' constraint declared here - · -19 │ let X<$U>() = x; - │ ^^^^^^^ 'copy' constraint not satisifed - · -27 │ useless!(X()); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E04003]: built-in operation not supported - ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:20:10 - │ -20 │ (0 as $U); - │ ^ Invalid argument to 'as' - · -27 │ useless!(X()); - │ ---- Found: 'a::m::None'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:21:13 - │ - 2 │ public struct None() has drop; - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct X() has copy, drop, store; - │ ---- 'copy' constraint declared here - · -21 │ (x: X<$U>); - │ ^^^^^ 'copy' constraint not satisifed - · -27 │ useless!(X()); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:27:24 - │ - 2 │ public struct None() has drop; - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct X() has copy, drop, store; - │ ---- 'copy' constraint declared here - · -27 │ useless!(X()); - │ ---- ^^^ 'copy' constraint not satisifed - │ │ - │ The type 'a::m::None' does not have the ability 'copy' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_subst_tparams_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_subst_tparams_invalid.snap new file mode 100644 index 0000000000000..92888e7bba070 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_subst_tparams_invalid.snap @@ -0,0 +1,213 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_subst_tparams_invalid.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:10:31 + │ + 2 │ public struct None() has drop; + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct X() has copy, drop, store; + │ ---- 'copy' constraint declared here + · +10 │ macro fun useless<$U>($x: X<$U>): X<$U> { + │ ^^^^^ 'copy' constraint not satisifed + · +27 │ useless!(X()); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:10:39 + │ + 2 │ public struct None() has drop; + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct X() has copy, drop, store; + │ ---- 'copy' constraint declared here + · +10 │ macro fun useless<$U>($x: X<$U>): X<$U> { + │ ^^^^^ 'copy' constraint not satisifed + · +27 │ useless!(X()); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:12:16 + │ + 2 │ public struct None() has drop; + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct X() has copy, drop, store; + │ ---- 'copy' constraint declared here + · +12 │ freeze>(&mut X()); + │ ^^^^^ 'copy' constraint not satisifed + · +27 │ useless!(X()); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:12:28 + │ + 2 │ public struct None() has drop; + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct X() has copy, drop, store; + │ ---- 'copy' constraint declared here + · +12 │ freeze>(&mut X()); + │ ^^^ 'copy' constraint not satisifed + · +27 │ useless!(X()); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:13:9 + │ + 2 │ public struct None() has drop; + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct X() has copy, drop, store; + 4 │ public fun f(_: X) {} + │ ---- 'copy' constraint declared here + · +13 │ f<$U>(X()); + │ ^^^^^^^^^^ 'copy' constraint not satisifed + · +27 │ useless!(X()); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:13:15 + │ + 2 │ public struct None() has drop; + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct X() has copy, drop, store; + │ ---- 'copy' constraint declared here + · +13 │ f<$U>(X()); + │ ^^^ 'copy' constraint not satisifed + · +27 │ useless!(X()); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:14:9 + │ + 2 │ public struct None() has drop; + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct X() has copy, drop, store; + │ ---- 'copy' constraint declared here + · +14 │ X<$U>(); + │ ^^^^^^^ 'copy' constraint not satisifed + · +27 │ useless!(X()); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:15:9 + │ + 2 │ public struct None() has drop; + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct X() has copy, drop, store; + 4 │ public fun f(_: X) {} + │ ---- 'copy' constraint declared here + · +15 │ x.f<$U>(); + │ ^^^^^^^^^ 'copy' constraint not satisifed + · +27 │ useless!(X()); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:16:23 + │ + 2 │ public struct None() has drop; + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct X() has copy, drop, store; + │ ---- 'copy' constraint declared here + · +16 │ apply!(x, |_: X<$U>| ()); + │ ^^^^^ 'copy' constraint not satisifed + · +27 │ useless!(X()); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:17:9 + │ + 2 │ public struct None() has drop; + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct X() has copy, drop, store; + │ ---- 'copy' constraint declared here + · +17 │ X<$U>() = x; + │ ^^^^^^^ 'copy' constraint not satisifed + · +27 │ useless!(X()); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:18:16 + │ + 2 │ public struct None() has drop; + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct X() has copy, drop, store; + │ ---- 'copy' constraint declared here + · +18 │ let _: X<$U> = x; + │ ^^^^^ 'copy' constraint not satisifed + · +27 │ useless!(X()); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:19:13 + │ + 2 │ public struct None() has drop; + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct X() has copy, drop, store; + │ ---- 'copy' constraint declared here + · +19 │ let X<$U>() = x; + │ ^^^^^^^ 'copy' constraint not satisifed + · +27 │ useless!(X()); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E04003]: built-in operation not supported + ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:20:10 + │ +20 │ (0 as $U); + │ ^ Invalid argument to 'as' + · +27 │ useless!(X()); + │ ---- Found: 'a::m::None'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:21:13 + │ + 2 │ public struct None() has drop; + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct X() has copy, drop, store; + │ ---- 'copy' constraint declared here + · +21 │ (x: X<$U>); + │ ^^^^^ 'copy' constraint not satisifed + · +27 │ useless!(X()); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macro_subst_tparams_invalid.move:27:24 + │ + 2 │ public struct None() has drop; + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct X() has copy, drop, store; + │ ---- 'copy' constraint declared here + · +27 │ useless!(X()); + │ ---- ^^^ 'copy' constraint not satisifed + │ │ + │ The type 'a::m::None' does not have the ability 'copy' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_type_args_ref_or_tuple.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_type_args_ref_or_tuple.snap new file mode 100644 index 0000000000000..6f9b0246552b2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_type_args_ref_or_tuple.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_type_args_ref_or_tuple.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_unique_use_fun_scopes.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_unique_use_fun_scopes.snap new file mode 100644 index 0000000000000..d66c02e2dfbe8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_unique_use_fun_scopes.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_unique_use_fun_scopes.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_unique_use_fun_scopes_captured_lambda.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_unique_use_fun_scopes_captured_lambda.snap new file mode 100644 index 0000000000000..7149cf9cc5820 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_unique_use_fun_scopes_captured_lambda.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_unique_use_fun_scopes_captured_lambda.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_unique_use_fun_scopes_cross_module.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_unique_use_fun_scopes_cross_module.snap new file mode 100644 index 0000000000000..5efa7252d0c93 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_unique_use_fun_scopes_cross_module.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_unique_use_fun_scopes_cross_module.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_unique_use_fun_scopes_in_lambda_arg.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_unique_use_fun_scopes_in_lambda_arg.snap new file mode 100644 index 0000000000000..b19c08b8c461e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_unique_use_fun_scopes_in_lambda_arg.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_unique_use_fun_scopes_in_lambda_arg.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_enum_error.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_enum_error.exp deleted file mode 100644 index 5fe822f5e0c8d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_enum_error.exp +++ /dev/null @@ -1,30 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/macro_visibility_enum_error.move:8:17 - │ - 3 │ public enum E { - │ - Enum defined in module 'a::m' - · - 8 │ let e = E::V(); - │ ^^^^^^ Enum variant 'a::m::E::V' can only be instantiated within its defining module 'a::m' - · -19 │ test!(); - │ ------- While expanding this macro - │ - = This visibility error occurs in a macro body while expanding the macro 'a::m::test' - = Visibility inside of expanded macros is resolved in the scope of the caller. - -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/macro_visibility_enum_error.move:10:13 - │ - 3 │ public enum E { - │ - Enum defined in module 'a::m' - · -10 │ E::V() => (), - │ ^^^^^^ Enum variant 'a::m::E::V' can only be matched within its defining module 'a::m' - · -19 │ test!(); - │ ------- While expanding this macro - │ - = This visibility error occurs in a macro body while expanding the macro 'a::m::test' - = Visibility inside of expanded macros is resolved in the scope of the caller. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_enum_error.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_enum_error.snap new file mode 100644 index 0000000000000..84bdd8f9c6ee7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_enum_error.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_visibility_enum_error.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macro_visibility_enum_error.move:8:17 + │ + 3 │ public enum E { + │ - Enum defined in module 'a::m' + · + 8 │ let e = E::V(); + │ ^^^^^^ Enum variant 'a::m::E::V' can only be instantiated within its defining module 'a::m' + · +19 │ test!(); + │ ------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::test' + = Visibility inside of expanded macros is resolved in the scope of the caller. + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macro_visibility_enum_error.move:10:13 + │ + 3 │ public enum E { + │ - Enum defined in module 'a::m' + · +10 │ E::V() => (), + │ ^^^^^^ Enum variant 'a::m::E::V' can only be matched within its defining module 'a::m' + · +19 │ test!(); + │ ------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::test' + = Visibility inside of expanded macros is resolved in the scope of the caller. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_function_error.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_function_error.exp deleted file mode 100644 index 300a7b27797b6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_function_error.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macro_visibility_function_error.move:5:22 - │ - 5 │ public macro fun test() { - │ ^^^^ - │ │ - │ Invalid type annotation - │ Expected: '()' - · -14 │ test!(); - │ ------- Given: 'u64' - -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/macro_visibility_function_error.move:6:6 - │ - 3 │ fun zero(): u64 { 0 } - │ ---- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module - · - 6 │ zero() - │ ^^^^^^ Invalid call to internal function 'a::m::zero' - · -14 │ test!(); - │ ------- While expanding this macro - │ - = This visibility error occurs in a macro body while expanding the macro 'a::m::test' - = Visibility inside of expanded macros is resolved in the scope of the caller. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_function_error.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_function_error.snap new file mode 100644 index 0000000000000..cb71aca4c1c6d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_function_error.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_visibility_function_error.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macro_visibility_function_error.move:5:22 + │ + 5 │ public macro fun test() { + │ ^^^^ + │ │ + │ Invalid type annotation + │ Expected: '()' + · +14 │ test!(); + │ ------- Given: 'u64' + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macro_visibility_function_error.move:6:6 + │ + 3 │ fun zero(): u64 { 0 } + │ ---- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module + · + 6 │ zero() + │ ^^^^^^ Invalid call to internal function 'a::m::zero' + · +14 │ test!(); + │ ------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::test' + = Visibility inside of expanded macros is resolved in the scope of the caller. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_higher_order_error.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_higher_order_error.exp deleted file mode 100644 index 379b9a436be1d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_higher_order_error.exp +++ /dev/null @@ -1,30 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/macro_visibility_higher_order_error.move:12:21 - │ - 8 │ public struct S { } - │ - Struct defined in module 'a::m' - · -12 │ let s = S { }; - │ ^^^^^ Struct 'a::m::S' can only be instantiated within its defining module 'a::m' - · -22 │ test!(); - │ ------- While expanding this macro - │ - = This visibility error occurs in a macro body while expanding the macros 'a::m::test' and 'a::l::test' - = Visibility inside of expanded macros is resolved in the scope of the caller. - -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/macro_visibility_higher_order_error.move:13:17 - │ - 8 │ public struct S { } - │ - Struct defined in module 'a::m' - · -13 │ let S { } = s; - │ ^^^^^ Struct 'a::m::S' can only be used in deconstruction binding within its defining module 'a::m' - · -22 │ test!(); - │ ------- While expanding this macro - │ - = This visibility error occurs in a macro body while expanding the macros 'a::m::test' and 'a::l::test' - = Visibility inside of expanded macros is resolved in the scope of the caller. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_higher_order_error.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_higher_order_error.snap new file mode 100644 index 0000000000000..211586dda39d0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_higher_order_error.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_visibility_higher_order_error.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macro_visibility_higher_order_error.move:12:21 + │ + 8 │ public struct S { } + │ - Struct defined in module 'a::m' + · +12 │ let s = S { }; + │ ^^^^^ Struct 'a::m::S' can only be instantiated within its defining module 'a::m' + · +22 │ test!(); + │ ------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macros 'a::m::test' and 'a::l::test' + = Visibility inside of expanded macros is resolved in the scope of the caller. + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macro_visibility_higher_order_error.move:13:17 + │ + 8 │ public struct S { } + │ - Struct defined in module 'a::m' + · +13 │ let S { } = s; + │ ^^^^^ Struct 'a::m::S' can only be used in deconstruction binding within its defining module 'a::m' + · +22 │ test!(); + │ ------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macros 'a::m::test' and 'a::l::test' + = Visibility inside of expanded macros is resolved in the scope of the caller. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_struct_error.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_struct_error.exp deleted file mode 100644 index d5722933655a8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_struct_error.exp +++ /dev/null @@ -1,30 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/macro_visibility_struct_error.move:6:17 - │ - 3 │ public struct S { } - │ - Struct defined in module 'a::m' - · - 6 │ let s = S { }; - │ ^^^^^ Struct 'a::m::S' can only be instantiated within its defining module 'a::m' - · -15 │ test!(); - │ ------- While expanding this macro - │ - = This visibility error occurs in a macro body while expanding the macro 'a::m::test' - = Visibility inside of expanded macros is resolved in the scope of the caller. - -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/macro_visibility_struct_error.move:7:13 - │ - 3 │ public struct S { } - │ - Struct defined in module 'a::m' - · - 7 │ let S { } = s; - │ ^^^^^ Struct 'a::m::S' can only be used in deconstruction binding within its defining module 'a::m' - · -15 │ test!(); - │ ------- While expanding this macro - │ - = This visibility error occurs in a macro body while expanding the macro 'a::m::test' - = Visibility inside of expanded macros is resolved in the scope of the caller. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_struct_error.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_struct_error.snap new file mode 100644 index 0000000000000..33fa179b8522e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macro_visibility_struct_error.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macro_visibility_struct_error.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macro_visibility_struct_error.move:6:17 + │ + 3 │ public struct S { } + │ - Struct defined in module 'a::m' + · + 6 │ let s = S { }; + │ ^^^^^ Struct 'a::m::S' can only be instantiated within its defining module 'a::m' + · +15 │ test!(); + │ ------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::test' + = Visibility inside of expanded macros is resolved in the scope of the caller. + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macro_visibility_struct_error.move:7:13 + │ + 3 │ public struct S { } + │ - Struct defined in module 'a::m' + · + 7 │ let S { } = s; + │ ^^^^^ Struct 'a::m::S' can only be used in deconstruction binding within its defining module 'a::m' + · +15 │ test!(); + │ ------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::test' + = Visibility inside of expanded macros is resolved in the scope of the caller. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_dont_allow_paths.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_dont_allow_paths.exp deleted file mode 100644 index 22eb6b712f4c6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_dont_allow_paths.exp +++ /dev/null @@ -1,50 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/typing/macros_dont_allow_paths.move:6:18 - │ -6 │ let _m = $s.x; // disallowed - │ ^^ Macro parameters are not allowed to appear in paths - │ - = To use a macro parameter as a value in a path expression, first bind it to a local variable, e.g. 'let s = $s;' - = Macro parameters are always treated as value expressions, and are not modified by path operations. - Path operations include 'move', 'copy', '&', '&mut', and field references - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/typing/macros_dont_allow_paths.move:7:24 - │ -7 │ let _vs = &mut $y; // disallowed - │ ^^ Macro parameters are not allowed to appear in paths - │ - = To use a macro parameter as a value in a path expression, first bind it to a local variable, e.g. 'let y = $y;' - = Macro parameters are always treated as value expressions, and are not modified by path operations. - Path operations include 'move', 'copy', '&', '&mut', and field references - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/typing/macros_dont_allow_paths.move:8:19 - │ -8 │ let _q = &$n; // disallowed - │ ^^ Macro parameters are not allowed to appear in paths - │ - = To use a macro parameter as a value in a path expression, first bind it to a local variable, e.g. 'let n = $n;' - = Macro parameters are always treated as value expressions, and are not modified by path operations. - Path operations include 'move', 'copy', '&', '&mut', and field references - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/typing/macros_dont_allow_paths.move:9:23 - │ -9 │ let _q = copy $n; // disallowed - │ ^^ Macro parameters are not allowed to appear in paths - │ - = To use a macro parameter as a value in a path expression, first bind it to a local variable, e.g. 'let n = $n;' - = Macro parameters are always treated as value expressions, and are not modified by path operations. - Path operations include 'move', 'copy', '&', '&mut', and field references - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/typing/macros_dont_allow_paths.move:10:23 - │ -10 │ let _q = move $n; // disallowed - │ ^^ Macro parameters are not allowed to appear in paths - │ - = To use a macro parameter as a value in a path expression, first bind it to a local variable, e.g. 'let n = $n;' - = Macro parameters are always treated as value expressions, and are not modified by path operations. - Path operations include 'move', 'copy', '&', '&mut', and field references - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_dont_allow_paths.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_dont_allow_paths.snap new file mode 100644 index 0000000000000..6dde25316ea1b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_dont_allow_paths.snap @@ -0,0 +1,57 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_dont_allow_paths.move +--- +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/typing/macros_dont_allow_paths.move:6:18 + │ +6 │ let _m = $s.x; // disallowed + │ ^^ Macro parameters are not allowed to appear in paths + │ + = To use a macro parameter as a value in a path expression, first bind it to a local variable, e.g. 'let s = $s;' + = Macro parameters are always treated as value expressions, and are not modified by path operations. + Path operations include 'move', 'copy', '&', '&mut', and field references + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/typing/macros_dont_allow_paths.move:7:24 + │ +7 │ let _vs = &mut $y; // disallowed + │ ^^ Macro parameters are not allowed to appear in paths + │ + = To use a macro parameter as a value in a path expression, first bind it to a local variable, e.g. 'let y = $y;' + = Macro parameters are always treated as value expressions, and are not modified by path operations. + Path operations include 'move', 'copy', '&', '&mut', and field references + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/typing/macros_dont_allow_paths.move:8:19 + │ +8 │ let _q = &$n; // disallowed + │ ^^ Macro parameters are not allowed to appear in paths + │ + = To use a macro parameter as a value in a path expression, first bind it to a local variable, e.g. 'let n = $n;' + = Macro parameters are always treated as value expressions, and are not modified by path operations. + Path operations include 'move', 'copy', '&', '&mut', and field references + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/typing/macros_dont_allow_paths.move:9:23 + │ +9 │ let _q = copy $n; // disallowed + │ ^^ Macro parameters are not allowed to appear in paths + │ + = To use a macro parameter as a value in a path expression, first bind it to a local variable, e.g. 'let n = $n;' + = Macro parameters are always treated as value expressions, and are not modified by path operations. + Path operations include 'move', 'copy', '&', '&mut', and field references + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/typing/macros_dont_allow_paths.move:10:23 + │ +10 │ let _q = move $n; // disallowed + │ ^^ Macro parameters are not allowed to appear in paths + │ + = To use a macro parameter as a value in a path expression, first bind it to a local variable, e.g. 'let n = $n;' + = Macro parameters are always treated as value expressions, and are not modified by path operations. + Path operations include 'move', 'copy', '&', '&mut', and field references diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes.snap new file mode 100644 index 0000000000000..170fbd2b91c9e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_block_labels.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_block_labels.snap new file mode 100644 index 0000000000000..ea45463bf518c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_block_labels.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_block_labels.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_by_name_arg.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_by_name_arg.snap new file mode 100644 index 0000000000000..250693b58b708 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_by_name_arg.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_by_name_arg.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_nested.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_nested.snap new file mode 100644 index 0000000000000..ca3553bece6ac --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_nested.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_nested.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture.exp deleted file mode 100644 index f58debab2de4d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E03009]: unbound variable - ┌─ tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture.move:16:17 - │ -16 │ foo!(|| x); - │ ^ Unbound variable 'x' - -error[E03009]: unbound variable - ┌─ tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture.move:17:17 - │ -17 │ bar!(|| x); - │ ^ Unbound variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture.snap new file mode 100644 index 0000000000000..1da6e1c58f6ae --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture.move +--- +error[E03009]: unbound variable + ┌─ tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture.move:16:17 + │ +16 │ foo!(|| x); + │ ^ Unbound variable 'x' + +error[E03009]: unbound variable + ┌─ tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture.move:17:17 + │ +17 │ bar!(|| x); + │ ^ Unbound variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture_by_name_arg.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture_by_name_arg.exp deleted file mode 100644 index 197fafee65b81..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture_by_name_arg.exp +++ /dev/null @@ -1,48 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture_by_name_arg.move:4:23 - │ - 4 │ macro fun foo($f: u64): u64 { - │ ^^^ - │ │ - │ Invalid type annotation - │ Expected: 'u64' - · -15 │ let x = vector[]; - │ ------------- Given: 'vector' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture_by_name_arg.move:4:23 - │ - 4 │ macro fun foo($f: u64): u64 { - │ ^^^ - │ │ - │ Invalid type annotation - │ Expected: 'u64' - · -19 │ let x = vector[]; - │ ------------- Given: 'vector' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture_by_name_arg.move:9:23 - │ - 9 │ macro fun bar($f: u64): u64 { - │ ^^^ - │ │ - │ Invalid type annotation - │ Expected: 'u64' - · -15 │ let x = vector[]; - │ ------------- Given: 'vector' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture_by_name_arg.move:9:23 - │ - 9 │ macro fun bar($f: u64): u64 { - │ ^^^ - │ │ - │ Invalid type annotation - │ Expected: 'u64' - · -19 │ let x = vector[]; - │ ------------- Given: 'vector' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture_by_name_arg.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture_by_name_arg.snap new file mode 100644 index 0000000000000..877514e99735c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture_by_name_arg.snap @@ -0,0 +1,55 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture_by_name_arg.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture_by_name_arg.move:4:23 + │ + 4 │ macro fun foo($f: u64): u64 { + │ ^^^ + │ │ + │ Invalid type annotation + │ Expected: 'u64' + · +15 │ let x = vector[]; + │ ------------- Given: 'vector' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture_by_name_arg.move:4:23 + │ + 4 │ macro fun foo($f: u64): u64 { + │ ^^^ + │ │ + │ Invalid type annotation + │ Expected: 'u64' + · +19 │ let x = vector[]; + │ ------------- Given: 'vector' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture_by_name_arg.move:9:23 + │ + 9 │ macro fun bar($f: u64): u64 { + │ ^^^ + │ │ + │ Invalid type annotation + │ Expected: 'u64' + · +15 │ let x = vector[]; + │ ------------- Given: 'vector' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_have_unique_scopes_unhygienic_capture_by_name_arg.move:9:23 + │ + 9 │ macro fun bar($f: u64): u64 { + │ ^^^ + │ │ + │ Invalid type annotation + │ Expected: 'u64' + · +19 │ let x = vector[]; + │ ------------- Given: 'vector' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_lambdas_checked.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_lambdas_checked.snap new file mode 100644 index 0000000000000..4606d281cbf07 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_lambdas_checked.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_lambdas_checked.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_lambdas_checked_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_lambdas_checked_invalid.exp deleted file mode 100644 index 4cebd692b966c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_lambdas_checked_invalid.exp +++ /dev/null @@ -1,38 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid.move:9:19 - │ -9 │ foo!>( - │ --- ^^^^^^^^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: 'vector' - │ Given: 'u64' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid.move:14:19 - │ -14 │ foo!>( - │ --- ^^^^^^^^^^ - │ │ │ │ - │ │ │ Expected: 'u8' - │ │ Invalid type annotation - │ Given: 'u64' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid.move:19:19 - │ -19 │ foo!>( - │ ^^^^^^^^^^ - │ │ │ - │ │ Expected: 'u8' - │ Invalid type annotation - · -22 │ || vector[vector[]], // invalid - │ -------- Given: 'vector<_>' - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid.move:22:23 - │ -22 │ || vector[vector[]], // invalid - │ ^^^^^^^^ Could not infer this type. Try adding an annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_lambdas_checked_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_lambdas_checked_invalid.snap new file mode 100644 index 0000000000000..ef57378125c4c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_lambdas_checked_invalid.snap @@ -0,0 +1,45 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_lambdas_checked_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid.move:9:19 + │ +9 │ foo!>( + │ --- ^^^^^^^^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: 'vector' + │ Given: 'u64' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid.move:14:19 + │ +14 │ foo!>( + │ --- ^^^^^^^^^^ + │ │ │ │ + │ │ │ Expected: 'u8' + │ │ Invalid type annotation + │ Given: 'u64' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid.move:19:19 + │ +19 │ foo!>( + │ ^^^^^^^^^^ + │ │ │ + │ │ Expected: 'u8' + │ Invalid type annotation + · +22 │ || vector[vector[]], // invalid + │ -------- Given: 'vector<_>' + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid.move:22:23 + │ +22 │ || vector[vector[]], // invalid + │ ^^^^^^^^ Could not infer this type. Try adding an annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_lambdas_checked_invalid_arity.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_lambdas_checked_invalid_arity.exp deleted file mode 100644 index 045e94db973a0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_lambdas_checked_invalid_arity.exp +++ /dev/null @@ -1,116 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:2:73 - │ - 2 │ macro fun foo<$T, $U>($f: |$T| -> $U, $g: |$T, $T| -> $U, $h: || -> ($U, $U)) { - │ ^^^^^^^^ - │ │ - │ Invalid type annotation - │ Expected expression list of length 2: '(vector, vector)' - · -32 │ || (b"hello", b"world", b"!"), // invalid - │ -------------------------- Given expression list of length 3: '(vector, vector, vector)' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:2:73 - │ - 2 │ macro fun foo<$T, $U>($f: |$T| -> $U, $g: |$T, $T| -> $U, $h: || -> ($U, $U)) { - │ ^^^^^^^^ - │ │ - │ Invalid type annotation - │ Expected: '(vector, vector)' - · -37 │ || b"hello", // invalid - │ -------- Given: 'vector' - -error[E04017]: too many arguments - ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:3:9 - │ -3 │ $f(0); - │ ^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid lambda call of '$f'. The call expected 0 argument(s) but got 1 - -error[E04016]: too few arguments - ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:3:9 - │ -3 │ $f(0); - │ ^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid lambda call of '$f'. The call expected 2 argument(s) but got 1 - -error[E04016]: too few arguments - ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:4:9 - │ -4 │ $g(0, 1); - │ ^^^^^^^^ - │ │ │ - │ │ Found 2 argument(s) here - │ Invalid lambda call of '$g'. The call expected 3 argument(s) but got 2 - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:9:9 - │ - 2 │ macro fun foo<$T, $U>($f: |$T| -> $U, $g: |$T, $T| -> $U, $h: || -> ($U, $U)) { - │ ---------- Expected a lambda with 1 arguments: '|u64| -> vector' - · - 9 │ ╭ foo!>( -10 │ │ || vector[], // invalid - │ │ ----------- Given lambda with 0 arguments: '|| -> _' -11 │ │ |a, b| vector[(a as u8), (b as u8)], -12 │ │ || (b"hello", b"world"), -13 │ │ ); - │ ╰─────────^ Invalid call of 'a::m::foo'. Invalid argument for parameter '$f' - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:10:16 - │ -10 │ || vector[], // invalid - │ ^^^^^^^^ Could not infer this type. Try adding an annotation - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:14:9 - │ - 2 │ macro fun foo<$T, $U>($f: |$T| -> $U, $g: |$T, $T| -> $U, $h: || -> ($U, $U)) { - │ ---------- Expected a lambda with 1 arguments: '|u64| -> vector' - · -14 │ ╭ foo!>( -15 │ │ |_, _| vector[], // invalid - │ │ --------------- Given lambda with 2 arguments: '|_, _| -> _' -16 │ │ |a, b| vector[(a as u8), (b as u8)], -17 │ │ || (b"hello", b"world"), -18 │ │ ); - │ ╰─────────^ Invalid call of 'a::m::foo'. Invalid argument for parameter '$f' - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:15:20 - │ -15 │ |_, _| vector[], // invalid - │ ^^^^^^^^ Could not infer this type. Try adding an annotation - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:19:19 - │ -19 │ foo!>( - │ ^^^^^^^^^^ - │ │ - │ Invalid type annotation - │ Expected: 'vector' -20 │ |_| (vector[], vector[]), // invalid - │ ---------------------------- Given: '(vector, vector)' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:24:9 - │ - 2 │ macro fun foo<$T, $U>($f: |$T| -> $U, $g: |$T, $T| -> $U, $h: || -> ($U, $U)) { - │ -------------- Expected a lambda with 2 arguments: '|u64, u64| -> vector' - · -24 │ ╭ foo!>( -25 │ │ |_| vector[], -26 │ │ |a, b, _| vector[(a as u8), (b as u8)], // invalid - │ │ -------------------------------------- Given lambda with 3 arguments: '|_, _, _| -> _' -27 │ │ || (b"hello", b"world"), -28 │ │ ); - │ ╰─────────^ Invalid call of 'a::m::foo'. Invalid argument for parameter '$g' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_lambdas_checked_invalid_arity.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_lambdas_checked_invalid_arity.snap new file mode 100644 index 0000000000000..c282f118631d8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_lambdas_checked_invalid_arity.snap @@ -0,0 +1,123 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:2:73 + │ + 2 │ macro fun foo<$T, $U>($f: |$T| -> $U, $g: |$T, $T| -> $U, $h: || -> ($U, $U)) { + │ ^^^^^^^^ + │ │ + │ Invalid type annotation + │ Expected expression list of length 2: '(vector, vector)' + · +32 │ || (b"hello", b"world", b"!"), // invalid + │ -------------------------- Given expression list of length 3: '(vector, vector, vector)' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:2:73 + │ + 2 │ macro fun foo<$T, $U>($f: |$T| -> $U, $g: |$T, $T| -> $U, $h: || -> ($U, $U)) { + │ ^^^^^^^^ + │ │ + │ Invalid type annotation + │ Expected: '(vector, vector)' + · +37 │ || b"hello", // invalid + │ -------- Given: 'vector' + +error[E04017]: too many arguments + ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:3:9 + │ +3 │ $f(0); + │ ^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid lambda call of '$f'. The call expected 0 argument(s) but got 1 + +error[E04016]: too few arguments + ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:3:9 + │ +3 │ $f(0); + │ ^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid lambda call of '$f'. The call expected 2 argument(s) but got 1 + +error[E04016]: too few arguments + ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:4:9 + │ +4 │ $g(0, 1); + │ ^^^^^^^^ + │ │ │ + │ │ Found 2 argument(s) here + │ Invalid lambda call of '$g'. The call expected 3 argument(s) but got 2 + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:9:9 + │ + 2 │ macro fun foo<$T, $U>($f: |$T| -> $U, $g: |$T, $T| -> $U, $h: || -> ($U, $U)) { + │ ---------- Expected a lambda with 1 arguments: '|u64| -> vector' + · + 9 │ ╭ foo!>( +10 │ │ || vector[], // invalid + │ │ ----------- Given lambda with 0 arguments: '|| -> _' +11 │ │ |a, b| vector[(a as u8), (b as u8)], +12 │ │ || (b"hello", b"world"), +13 │ │ ); + │ ╰─────────^ Invalid call of 'a::m::foo'. Invalid argument for parameter '$f' + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:10:16 + │ +10 │ || vector[], // invalid + │ ^^^^^^^^ Could not infer this type. Try adding an annotation + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:14:9 + │ + 2 │ macro fun foo<$T, $U>($f: |$T| -> $U, $g: |$T, $T| -> $U, $h: || -> ($U, $U)) { + │ ---------- Expected a lambda with 1 arguments: '|u64| -> vector' + · +14 │ ╭ foo!>( +15 │ │ |_, _| vector[], // invalid + │ │ --------------- Given lambda with 2 arguments: '|_, _| -> _' +16 │ │ |a, b| vector[(a as u8), (b as u8)], +17 │ │ || (b"hello", b"world"), +18 │ │ ); + │ ╰─────────^ Invalid call of 'a::m::foo'. Invalid argument for parameter '$f' + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:15:20 + │ +15 │ |_, _| vector[], // invalid + │ ^^^^^^^^ Could not infer this type. Try adding an annotation + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:19:19 + │ +19 │ foo!>( + │ ^^^^^^^^^^ + │ │ + │ Invalid type annotation + │ Expected: 'vector' +20 │ |_| (vector[], vector[]), // invalid + │ ---------------------------- Given: '(vector, vector)' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_lambdas_checked_invalid_arity.move:24:9 + │ + 2 │ macro fun foo<$T, $U>($f: |$T| -> $U, $g: |$T, $T| -> $U, $h: || -> ($U, $U)) { + │ -------------- Expected a lambda with 2 arguments: '|u64, u64| -> vector' + · +24 │ ╭ foo!>( +25 │ │ |_| vector[], +26 │ │ |a, b, _| vector[(a as u8), (b as u8)], // invalid + │ │ -------------------------------------- Given lambda with 3 arguments: '|_, _, _| -> _' +27 │ │ || (b"hello", b"world"), +28 │ │ ); + │ ╰─────────^ Invalid call of 'a::m::foo'. Invalid argument for parameter '$g' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_not_type_checked.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_not_type_checked.snap new file mode 100644 index 0000000000000..ff11a383613d5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_not_type_checked.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_not_type_checked.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_not_type_checked_called.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_not_type_checked_called.exp deleted file mode 100644 index 902e7bc8427dd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_not_type_checked_called.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_not_type_checked_called.move:4:11 - │ -4 │ 1 + b"2" - │ - ^ ---- Found: 'vector'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '+' - │ Found: integer. It is not compatible with the other type. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_not_type_checked_called.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_not_type_checked_called.snap new file mode 100644 index 0000000000000..392c5f5ee7877 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_not_type_checked_called.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_not_type_checked_called.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_not_type_checked_called.move:4:11 + │ +4 │ 1 + b"2" + │ - ^ ---- Found: 'vector'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '+' + │ Found: integer. It is not compatible with the other type. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_return_checked_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_return_checked_invalid.exp deleted file mode 100644 index 7f23eb6e0ee2b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_return_checked_invalid.exp +++ /dev/null @@ -1,75 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_return_checked_invalid.move:6:8 - │ - 4 │ $y: u64, - │ --- Given: 'u64' - 5 │ $z: &mut u64 - 6 │ ): (u64, $T, $U) { - │ ^^^^^^^^^^^^^ Invalid type annotation - · -19 │ foo!(1, 2u64, &mut 3u64); - │ -- Expected: 'u8' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_return_checked_invalid.move:10:42 - │ -10 │ macro fun ref<$T, $U>($f: || -> $T): &$U { - │ ^^^ - │ │ - │ Invalid type annotation - │ Expected: '&u64' - · -20 │ ref!(|| &1); - │ --------------------- Given: 'u64' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_return_checked_invalid.move:14:45 - │ -14 │ macro fun double<$T, $U>($f: || -> $T): ($U, $U) { - │ ^^^^^^^^ - │ │ - │ Invalid type annotation - │ Expected: '(u64, u64)' - · -21 │ double!(|| (0, 0)); - │ ---------------------------- Given: 'u64' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_return_checked_invalid.move:14:45 - │ -14 │ macro fun double<$T, $U>($f: || -> $T): ($U, $U) { - │ ^^^^^^^^ - │ │ - │ Invalid type annotation - │ Expected: '(u64, u64)' - · -22 │ double!(|| 0); - │ ----------------------- Given: 'u64' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_return_checked_invalid.move:20:13 - │ -20 │ ref!(|| &1); - │ ^^^ -- Given: '&{integer}' - │ │ - │ Invalid type annotation - │ Expected: 'u64' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_return_checked_invalid.move:21:16 - │ -21 │ double!(|| (0, 0)); - │ ^^^ ------ Given: '({integer}, {integer})' - │ │ - │ Invalid type annotation - │ Expected: 'u64' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_return_checked_invalid.move:23:16 - │ -23 │ double!<(u64, u64), u64>(|| (&0, &0)); - │ ^^^^^^^^^^ -- Given: '&{integer}' - │ ││ - │ │Expected: 'u64' - │ Invalid type annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_return_checked_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_return_checked_invalid.snap new file mode 100644 index 0000000000000..dab730775d2bb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_return_checked_invalid.snap @@ -0,0 +1,82 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_return_checked_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_return_checked_invalid.move:6:8 + │ + 4 │ $y: u64, + │ --- Given: 'u64' + 5 │ $z: &mut u64 + 6 │ ): (u64, $T, $U) { + │ ^^^^^^^^^^^^^ Invalid type annotation + · +19 │ foo!(1, 2u64, &mut 3u64); + │ -- Expected: 'u8' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_return_checked_invalid.move:10:42 + │ +10 │ macro fun ref<$T, $U>($f: || -> $T): &$U { + │ ^^^ + │ │ + │ Invalid type annotation + │ Expected: '&u64' + · +20 │ ref!(|| &1); + │ --------------------- Given: 'u64' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_return_checked_invalid.move:14:45 + │ +14 │ macro fun double<$T, $U>($f: || -> $T): ($U, $U) { + │ ^^^^^^^^ + │ │ + │ Invalid type annotation + │ Expected: '(u64, u64)' + · +21 │ double!(|| (0, 0)); + │ ---------------------------- Given: 'u64' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_return_checked_invalid.move:14:45 + │ +14 │ macro fun double<$T, $U>($f: || -> $T): ($U, $U) { + │ ^^^^^^^^ + │ │ + │ Invalid type annotation + │ Expected: '(u64, u64)' + · +22 │ double!(|| 0); + │ ----------------------- Given: 'u64' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_return_checked_invalid.move:20:13 + │ +20 │ ref!(|| &1); + │ ^^^ -- Given: '&{integer}' + │ │ + │ Invalid type annotation + │ Expected: 'u64' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_return_checked_invalid.move:21:16 + │ +21 │ double!(|| (0, 0)); + │ ^^^ ------ Given: '({integer}, {integer})' + │ │ + │ Invalid type annotation + │ Expected: 'u64' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_return_checked_invalid.move:23:16 + │ +23 │ double!<(u64, u64), u64>(|| (&0, &0)); + │ ^^^^^^^^^^ -- Given: '&{integer}' + │ ││ + │ │Expected: 'u64' + │ Invalid type annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_return_checked_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_return_checked_valid.snap new file mode 100644 index 0000000000000..a978a945b8d27 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_return_checked_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_return_checked_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_types_checked_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_types_checked_invalid.snap new file mode 100644 index 0000000000000..8a253d58d97ab --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_types_checked_invalid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_types_checked_invalid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_types_checked_invalid_constraints.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_types_checked_invalid_constraints.exp deleted file mode 100644 index 9b194ced897d9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_types_checked_invalid_constraints.exp +++ /dev/null @@ -1,127 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:8:14 - │ - 2 │ public struct None() - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct NeedsCopy {} has copy, drop, store; - │ ---- 'copy' constraint declared here - · - 8 │ $_n: NeedsCopy<$T>, - │ ^^^^^^^^^^^^^ 'copy' constraint not satisifed - · -24 │ foo!>(0, &mut 1, NeedsCopy {}); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:10:16 - │ - 2 │ public struct None() - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct NeedsCopy {} has copy, drop, store; - │ ---- 'copy' constraint declared here - · -10 │ let _: NeedsCopy<$U> = NeedsCopy {}; - │ ^^^^^^^^^^^^^ 'copy' constraint not satisifed - · -26 │ foo!(0, &mut 1, NeedsCopy {}); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:10:32 - │ - 2 │ public struct None() - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct NeedsCopy {} has copy, drop, store; - │ ---- 'copy' constraint declared here - · -10 │ let _: NeedsCopy<$U> = NeedsCopy {}; - │ ^^^^^^^^^^^^ 'copy' constraint not satisifed - · -26 │ foo!(0, &mut 1, NeedsCopy {}); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:14:9 - │ -14 │ NeedsCopy {} - │ ^^^^^^^^^^^^ Could not infer this type. Try adding an annotation - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:17:27 - │ - 2 │ public struct None() - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct NeedsCopy {} has copy, drop, store; - │ ---- 'copy' constraint declared here - · -17 │ macro fun ret2<$T>(): NeedsCopy<$T> { - │ ^^^^^^^^^^^^^ 'copy' constraint not satisifed - · -28 │ ret2!(); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:18:9 - │ - 2 │ public struct None() - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct NeedsCopy {} has copy, drop, store; - │ ---- 'copy' constraint declared here - · -18 │ NeedsCopy {} - │ ^^^^^^^^^^^^ 'copy' constraint not satisifed - · -28 │ ret2!(); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:24:9 - │ - 2 │ public struct None() - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - · - 5 │ macro fun foo<$T: copy, $U>( - │ ---- 'copy' constraint declared here - · -24 │ foo!>(0, &mut 1, NeedsCopy {}); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type 'a::m::None' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:25:19 - │ - 2 │ public struct None() - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct NeedsCopy {} has copy, drop, store; - │ ---- 'copy' constraint declared here - · -25 │ foo!>(0, &mut 1, NeedsCopy {}); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type 'a::m::None' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:27:9 - │ - 2 │ public struct None() - │ ---- To satisfy the constraint, the 'drop' ability would need to be added here - · -27 │ ret!(); - │ ^^^^^^^^^^^^ - │ │ │ - │ │ The type 'a::m::None' does not have the ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:27:14 - │ -27 │ ret!(); - │ -----^^^^--- - │ │ │ - │ │ Invalid type annotation - │ │ Expected: 'a::m::None' - │ Given: 'a::m::NeedsCopy<_>' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_types_checked_invalid_constraints.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_types_checked_invalid_constraints.snap new file mode 100644 index 0000000000000..cb31fb6f05554 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_types_checked_invalid_constraints.snap @@ -0,0 +1,134 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_types_checked_invalid_constraints.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:8:14 + │ + 2 │ public struct None() + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct NeedsCopy {} has copy, drop, store; + │ ---- 'copy' constraint declared here + · + 8 │ $_n: NeedsCopy<$T>, + │ ^^^^^^^^^^^^^ 'copy' constraint not satisifed + · +24 │ foo!>(0, &mut 1, NeedsCopy {}); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:10:16 + │ + 2 │ public struct None() + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct NeedsCopy {} has copy, drop, store; + │ ---- 'copy' constraint declared here + · +10 │ let _: NeedsCopy<$U> = NeedsCopy {}; + │ ^^^^^^^^^^^^^ 'copy' constraint not satisifed + · +26 │ foo!(0, &mut 1, NeedsCopy {}); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:10:32 + │ + 2 │ public struct None() + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct NeedsCopy {} has copy, drop, store; + │ ---- 'copy' constraint declared here + · +10 │ let _: NeedsCopy<$U> = NeedsCopy {}; + │ ^^^^^^^^^^^^ 'copy' constraint not satisifed + · +26 │ foo!(0, &mut 1, NeedsCopy {}); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:14:9 + │ +14 │ NeedsCopy {} + │ ^^^^^^^^^^^^ Could not infer this type. Try adding an annotation + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:17:27 + │ + 2 │ public struct None() + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct NeedsCopy {} has copy, drop, store; + │ ---- 'copy' constraint declared here + · +17 │ macro fun ret2<$T>(): NeedsCopy<$T> { + │ ^^^^^^^^^^^^^ 'copy' constraint not satisifed + · +28 │ ret2!(); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:18:9 + │ + 2 │ public struct None() + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct NeedsCopy {} has copy, drop, store; + │ ---- 'copy' constraint declared here + · +18 │ NeedsCopy {} + │ ^^^^^^^^^^^^ 'copy' constraint not satisifed + · +28 │ ret2!(); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:24:9 + │ + 2 │ public struct None() + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + · + 5 │ macro fun foo<$T: copy, $U>( + │ ---- 'copy' constraint declared here + · +24 │ foo!>(0, &mut 1, NeedsCopy {}); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type 'a::m::None' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:25:19 + │ + 2 │ public struct None() + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct NeedsCopy {} has copy, drop, store; + │ ---- 'copy' constraint declared here + · +25 │ foo!>(0, &mut 1, NeedsCopy {}); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type 'a::m::None' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:27:9 + │ + 2 │ public struct None() + │ ---- To satisfy the constraint, the 'drop' ability would need to be added here + · +27 │ ret!(); + │ ^^^^^^^^^^^^ + │ │ │ + │ │ The type 'a::m::None' does not have the ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints.move:27:14 + │ +27 │ ret!(); + │ -----^^^^--- + │ │ │ + │ │ Invalid type annotation + │ │ Expected: 'a::m::None' + │ Given: 'a::m::NeedsCopy<_>' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_types_checked_invalid_constraints_simple.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_types_checked_invalid_constraints_simple.exp deleted file mode 100644 index 089eb252c7af6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_types_checked_invalid_constraints_simple.exp +++ /dev/null @@ -1,54 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints_simple.move:7:26 - │ - 2 │ public struct None() - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct NeedsCopy {} has copy, drop, store; - │ ---- 'copy' constraint declared here - · - 7 │ macro fun bar<$T>(_: NeedsCopy<$T>) {} - │ ^^^^^^^^^^^^^ 'copy' constraint not satisifed - · -14 │ bar!(NeedsCopy {}); - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints_simple.move:9:26 - │ - 2 │ public struct None() - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ public struct NeedsCopy {} has copy, drop, store; - │ ---- 'copy' constraint declared here - · - 9 │ macro fun baz<$T>(): NeedsCopy<$T> { abort 0 } - │ ^^^^^^^^^^^^^ 'copy' constraint not satisifed - · -18 │ baz!() - │ ---- The type 'a::m::None' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints_simple.move:13:9 - │ - 2 │ public struct None() - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - · - 5 │ macro fun foo<$T: copy>() {} - │ ---- 'copy' constraint declared here - · -13 │ foo!(); - │ ^^^^^^^^^^^^ - │ │ │ - │ │ The type 'a::m::None' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints_simple.move:18:9 - │ - 9 │ macro fun baz<$T>(): NeedsCopy<$T> { abort 0 } - │ ------------- Given: 'a::m::NeedsCopy' - · -17 │ fun t2() { - │ -- Expected: '()' -18 │ baz!() - │ ^^^^^^^^^^^^ Invalid return expression - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_types_checked_invalid_constraints_simple.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_types_checked_invalid_constraints_simple.snap new file mode 100644 index 0000000000000..56a0cd84e79e7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_types_checked_invalid_constraints_simple.snap @@ -0,0 +1,61 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_types_checked_invalid_constraints_simple.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints_simple.move:7:26 + │ + 2 │ public struct None() + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct NeedsCopy {} has copy, drop, store; + │ ---- 'copy' constraint declared here + · + 7 │ macro fun bar<$T>(_: NeedsCopy<$T>) {} + │ ^^^^^^^^^^^^^ 'copy' constraint not satisifed + · +14 │ bar!(NeedsCopy {}); + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints_simple.move:9:26 + │ + 2 │ public struct None() + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ public struct NeedsCopy {} has copy, drop, store; + │ ---- 'copy' constraint declared here + · + 9 │ macro fun baz<$T>(): NeedsCopy<$T> { abort 0 } + │ ^^^^^^^^^^^^^ 'copy' constraint not satisifed + · +18 │ baz!() + │ ---- The type 'a::m::None' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints_simple.move:13:9 + │ + 2 │ public struct None() + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + · + 5 │ macro fun foo<$T: copy>() {} + │ ---- 'copy' constraint declared here + · +13 │ foo!(); + │ ^^^^^^^^^^^^ + │ │ │ + │ │ The type 'a::m::None' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/macros_types_checked_invalid_constraints_simple.move:18:9 + │ + 9 │ macro fun baz<$T>(): NeedsCopy<$T> { abort 0 } + │ ------------- Given: 'a::m::NeedsCopy' + · +17 │ fun t2() { + │ -- Expected: '()' +18 │ baz!() + │ ^^^^^^^^^^^^ Invalid return expression diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_types_checked_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_types_checked_valid.snap new file mode 100644 index 0000000000000..922b6fa7e6339 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_types_checked_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_types_checked_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_visibility_not_checked.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_visibility_not_checked.snap new file mode 100644 index 0000000000000..a454b5c4036fa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_visibility_not_checked.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_visibility_not_checked.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_visibility_not_checked_called.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_visibility_not_checked_called.exp deleted file mode 100644 index dda9440b645b8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_visibility_not_checked_called.exp +++ /dev/null @@ -1,84 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:9:9 - │ - 4 │ public(package) fun package() {} - │ --------------- A 'public(package)' function can only be called from the same address and package as module 'a::m' in package ''. This call is from address 'b' in package '' - · - 9 │ package(); - │ ^^^^^^^^^ Invalid call to 'public(package)' visible function 'a::m::package' - · -29 │ a::m::t0!(); - │ ----------- While expanding this macro - │ - = This visibility error occurs in a macro body while expanding the macro 'a::m::t0' - = Visibility inside of expanded macros is resolved in the scope of the caller. - -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:10:9 - │ - 3 │ fun private() {} - │ ------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module - · -10 │ private(); - │ ^^^^^^^^^ Invalid call to internal function 'a::m::private' - · -21 │ a::m::t0!(); - │ ----------- While expanding this macro - │ - = This visibility error occurs in a macro body while expanding the macro 'a::m::t0' - = Visibility inside of expanded macros is resolved in the scope of the caller. - -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:10:9 - │ - 3 │ fun private() {} - │ ------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module - · -10 │ private(); - │ ^^^^^^^^^ Invalid call to internal function 'a::m::private' - · -29 │ a::m::t0!(); - │ ----------- While expanding this macro - │ - = This visibility error occurs in a macro body while expanding the macro 'a::m::t0' - = Visibility inside of expanded macros is resolved in the scope of the caller. - -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:14:9 - │ - 3 │ fun private() {} - │ ------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module - · -14 │ private(); - │ ^^^^^^^^^ Invalid call to internal function 'a::m::private' - · -22 │ a::m::t1!(); - │ ----------- While expanding this macro - │ - = This visibility error occurs in a macro body while expanding the macro 'a::m::t1' - = Visibility inside of expanded macros is resolved in the scope of the caller. - -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:14:9 - │ - 3 │ fun private() {} - │ ------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module - · -14 │ private(); - │ ^^^^^^^^^ Invalid call to internal function 'a::m::private' - · -30 │ a::m::t1!(); - │ ----------- While expanding this macro - │ - = This visibility error occurs in a macro body while expanding the macro 'a::m::t1' - = Visibility inside of expanded macros is resolved in the scope of the caller. - -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:30:9 - │ -13 │ public(package) macro fun t1() { - │ --------------- A 'public(package)' function can only be called from the same address and package as module 'a::m' in package ''. This call is from address 'b' in package '' - · -30 │ a::m::t1!(); - │ ^^^^^^^^^^^ Invalid call to 'public(package)' visible function 'a::m::t1' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_visibility_not_checked_called.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_visibility_not_checked_called.snap new file mode 100644 index 0000000000000..3d6e8a65bce46 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/macros_visibility_not_checked_called.snap @@ -0,0 +1,91 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/macros_visibility_not_checked_called.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:9:9 + │ + 4 │ public(package) fun package() {} + │ --------------- A 'public(package)' function can only be called from the same address and package as module 'a::m' in package ''. This call is from address 'b' in package '' + · + 9 │ package(); + │ ^^^^^^^^^ Invalid call to 'public(package)' visible function 'a::m::package' + · +29 │ a::m::t0!(); + │ ----------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::t0' + = Visibility inside of expanded macros is resolved in the scope of the caller. + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:10:9 + │ + 3 │ fun private() {} + │ ------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module + · +10 │ private(); + │ ^^^^^^^^^ Invalid call to internal function 'a::m::private' + · +21 │ a::m::t0!(); + │ ----------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::t0' + = Visibility inside of expanded macros is resolved in the scope of the caller. + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:10:9 + │ + 3 │ fun private() {} + │ ------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module + · +10 │ private(); + │ ^^^^^^^^^ Invalid call to internal function 'a::m::private' + · +29 │ a::m::t0!(); + │ ----------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::t0' + = Visibility inside of expanded macros is resolved in the scope of the caller. + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:14:9 + │ + 3 │ fun private() {} + │ ------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module + · +14 │ private(); + │ ^^^^^^^^^ Invalid call to internal function 'a::m::private' + · +22 │ a::m::t1!(); + │ ----------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::t1' + = Visibility inside of expanded macros is resolved in the scope of the caller. + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:14:9 + │ + 3 │ fun private() {} + │ ------- This function is internal to its module. Only 'public' and 'public(package)' functions can be called outside of their module + · +14 │ private(); + │ ^^^^^^^^^ Invalid call to internal function 'a::m::private' + · +30 │ a::m::t1!(); + │ ----------- While expanding this macro + │ + = This visibility error occurs in a macro body while expanding the macro 'a::m::t1' + = Visibility inside of expanded macros is resolved in the scope of the caller. + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/macros_visibility_not_checked_called.move:30:9 + │ +13 │ public(package) macro fun t1() { + │ --------------- A 'public(package)' function can only be called from the same address and package as module 'a::m' in package ''. This call is from address 'b' in package '' + · +30 │ a::m::t1!(); + │ ^^^^^^^^^^^ Invalid call to 'public(package)' visible function 'a::m::t1' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/match_counterexample_bool.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/match_counterexample_bool.exp deleted file mode 100644 index 8641269c85371..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/match_counterexample_bool.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04036]: non-exhaustive pattern - ┌─ tests/move_2024/typing/match_counterexample_bool.move:5:16 - │ -5 │ match (x) { - │ ^ Pattern 'false' not covered - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/match_counterexample_bool.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/match_counterexample_bool.snap new file mode 100644 index 0000000000000..84d94c4e904ef --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/match_counterexample_bool.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/match_counterexample_bool.move +--- +error[E04036]: non-exhaustive pattern + ┌─ tests/move_2024/typing/match_counterexample_bool.move:5:16 + │ +5 │ match (x) { + │ ^ Pattern 'false' not covered diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/meaningless_move.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/meaningless_move.exp deleted file mode 100644 index c837cfd66c0fa..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/meaningless_move.exp +++ /dev/null @@ -1,61 +0,0 @@ -error[E04012]: invalid type for constant - ┌─ tests/move_2024/typing/meaningless_move.move:2:16 - │ -2 │ const ZED: Z = Z { f: 0 }; - │ ^ - │ │ - │ Unpermitted constant type - │ Found: 'a::m::Z'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_2024/typing/meaningless_move.move:2:20 - │ -2 │ const ZED: Z = Z { f: 0 }; - │ ^^^^^^^^^^ Structs are not supported in constants - -error[E04027]: invalid 'move' usage - ┌─ tests/move_2024/typing/meaningless_move.move:19:9 - │ -19 │ move x.y; - │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported - -error[E04027]: invalid 'move' usage - ┌─ tests/move_2024/typing/meaningless_move.move:20:9 - │ -20 │ move x.y.z; - │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported - -error[E04027]: invalid 'move' usage - ┌─ tests/move_2024/typing/meaningless_move.move:21:9 - │ -21 │ move x.y.z.f; - │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported - -error[E04027]: invalid 'move' usage - ┌─ tests/move_2024/typing/meaningless_move.move:22:9 - │ -22 │ move V; - │ ^^^^ Invalid 'move'. Cannot 'move' constants - -error[E04027]: invalid 'move' usage - ┌─ tests/move_2024/typing/meaningless_move.move:23:9 - │ -23 │ move ZED.f; - │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_2024/typing/meaningless_move.move:23:14 - │ -23 │ move ZED.f; - │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01013]: invalid 'move' or 'copy' - ┌─ tests/move_2024/typing/meaningless_move.move:24:9 - │ -24 │ move x.id(); - │ ^^^^ ------ Expected a name or path access, e.g. 'x' or 'e.f' - │ │ - │ Invalid 'move' of expression - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/meaningless_move.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/meaningless_move.snap new file mode 100644 index 0000000000000..94bda14c2b35e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/meaningless_move.snap @@ -0,0 +1,68 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/meaningless_move.move +--- +error[E04012]: invalid type for constant + ┌─ tests/move_2024/typing/meaningless_move.move:2:16 + │ +2 │ const ZED: Z = Z { f: 0 }; + │ ^ + │ │ + │ Unpermitted constant type + │ Found: 'a::m::Z'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_2024/typing/meaningless_move.move:2:20 + │ +2 │ const ZED: Z = Z { f: 0 }; + │ ^^^^^^^^^^ Structs are not supported in constants + +error[E04027]: invalid 'move' usage + ┌─ tests/move_2024/typing/meaningless_move.move:19:9 + │ +19 │ move x.y; + │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported + +error[E04027]: invalid 'move' usage + ┌─ tests/move_2024/typing/meaningless_move.move:20:9 + │ +20 │ move x.y.z; + │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported + +error[E04027]: invalid 'move' usage + ┌─ tests/move_2024/typing/meaningless_move.move:21:9 + │ +21 │ move x.y.z.f; + │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported + +error[E04027]: invalid 'move' usage + ┌─ tests/move_2024/typing/meaningless_move.move:22:9 + │ +22 │ move V; + │ ^^^^ Invalid 'move'. Cannot 'move' constants + +error[E04027]: invalid 'move' usage + ┌─ tests/move_2024/typing/meaningless_move.move:23:9 + │ +23 │ move ZED.f; + │ ^^^^ Invalid 'move'. 'move' works only with variables, e.g. 'move x'. 'move' on a path access is not supported + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_2024/typing/meaningless_move.move:23:14 + │ +23 │ move ZED.f; + │ ^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01013]: invalid 'move' or 'copy' + ┌─ tests/move_2024/typing/meaningless_move.move:24:9 + │ +24 │ move x.id(); + │ ^^^^ ------ Expected a name or path access, e.g. 'x' or 'e.f' + │ │ + │ Invalid 'move' of expression diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/mismatched_lambda_arity.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/mismatched_lambda_arity.exp deleted file mode 100644 index 0c315db414e81..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/mismatched_lambda_arity.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E04016]: too few arguments - ┌─ tests/move_2024/typing/mismatched_lambda_arity.move:3:9 - │ -3 │ $f(); - │ ^^^^ - │ │ │ - │ │ Found 0 argument(s) here - │ Invalid lambda call of '$f'. The call expected 2 argument(s) but got 0 - -error[E04016]: too few arguments - ┌─ tests/move_2024/typing/mismatched_lambda_arity.move:4:9 - │ -4 │ $f(0); - │ ^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid lambda call of '$f'. The call expected 2 argument(s) but got 1 - -error[E04017]: too many arguments - ┌─ tests/move_2024/typing/mismatched_lambda_arity.move:5:9 - │ -5 │ $f(0, 1, 2); - │ ^^^^^^^^^^^ - │ │ │ - │ │ Found 3 argument(s) here - │ Invalid lambda call of '$f'. The call expected 2 argument(s) but got 3 - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/mismatched_lambda_arity.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/mismatched_lambda_arity.snap new file mode 100644 index 0000000000000..ce9b3b0b58310 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/mismatched_lambda_arity.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/mismatched_lambda_arity.move +--- +error[E04016]: too few arguments + ┌─ tests/move_2024/typing/mismatched_lambda_arity.move:3:9 + │ +3 │ $f(); + │ ^^^^ + │ │ │ + │ │ Found 0 argument(s) here + │ Invalid lambda call of '$f'. The call expected 2 argument(s) but got 0 + +error[E04016]: too few arguments + ┌─ tests/move_2024/typing/mismatched_lambda_arity.move:4:9 + │ +4 │ $f(0); + │ ^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid lambda call of '$f'. The call expected 2 argument(s) but got 1 + +error[E04017]: too many arguments + ┌─ tests/move_2024/typing/mismatched_lambda_arity.move:5:9 + │ +5 │ $f(0, 1, 2); + │ ^^^^^^^^^^^ + │ │ │ + │ │ Found 3 argument(s) here + │ Invalid lambda call of '$f'. The call expected 2 argument(s) but got 3 diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_mixed_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_mixed_invalid.snap new file mode 100644 index 0000000000000..c5c93a3b4362b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_mixed_invalid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/module_call_visibility_mixed_invalid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_nested.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_nested.exp deleted file mode 100644 index faf662181e775..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_nested.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E03003]: unbound module member - ┌─ tests/move_2024/typing/module_call_visibility_nested.move:15:56 - │ -15 │ public(package) fun f_package_call_friend(): u64 { mod_0::f_pkg_friend() } - │ ^^^^^^^^^^^^^^^^^^^ Invalid module access. Unbound function 'f_pkg_friend' in module '0x42::mod_0' - -error[E03003]: unbound module member - ┌─ tests/move_2024/typing/module_call_visibility_nested.move:16:46 - │ -16 │ public fun f_public_call_friend(): u64 { mod_0::f_pkg_friend() } - │ ^^^^^^^^^^^^^^^^^^^ Invalid module access. Unbound function 'f_pkg_friend' in module '0x42::mod_0' - -error[E03003]: unbound module member - ┌─ tests/move_2024/typing/module_call_visibility_nested.move:17:40 - │ -17 │ fun f_private_call_friend(): u64 { mod_0::f_pkg_friend() } - │ ^^^^^^^^^^^^^^^^^^^ Invalid module access. Unbound function 'f_pkg_friend' in module '0x42::mod_0' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_nested.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_nested.snap new file mode 100644 index 0000000000000..5036d4b69f44a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_nested.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/module_call_visibility_nested.move +--- +error[E03003]: unbound module member + ┌─ tests/move_2024/typing/module_call_visibility_nested.move:15:56 + │ +15 │ public(package) fun f_package_call_friend(): u64 { mod_0::f_pkg_friend() } + │ ^^^^^^^^^^^^^^^^^^^ Invalid module access. Unbound function 'f_pkg_friend' in module '0x42::mod_0' + +error[E03003]: unbound module member + ┌─ tests/move_2024/typing/module_call_visibility_nested.move:16:46 + │ +16 │ public fun f_public_call_friend(): u64 { mod_0::f_pkg_friend() } + │ ^^^^^^^^^^^^^^^^^^^ Invalid module access. Unbound function 'f_pkg_friend' in module '0x42::mod_0' + +error[E03003]: unbound module member + ┌─ tests/move_2024/typing/module_call_visibility_nested.move:17:40 + │ +17 │ fun f_private_call_friend(): u64 { mod_0::f_pkg_friend() } + │ ^^^^^^^^^^^^^^^^^^^ Invalid module access. Unbound function 'f_pkg_friend' in module '0x42::mod_0' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_package.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_package.snap new file mode 100644 index 0000000000000..6df22592e1038 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_package.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/module_call_visibility_package.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_package_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_package_invalid.exp deleted file mode 100644 index 4a2f18529f87f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_package_invalid.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/module_call_visibility_package_invalid.move:10:52 - │ - 3 │ public(package) fun f_pkg_public() {} - │ --------------- A 'public(package)' function can only be called from the same address and package as module '0x42::mod_0' in package ''. This call is from address '0x54' in package '' - · -10 │ public(package) fun f_package_call_package() { mod_0::f_pkg_public() } - │ ^^^^^^^^^^^^^^^^^^^^^ Invalid call to 'public(package)' visible function '0x42::mod_0::f_pkg_public' - -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/module_call_visibility_package_invalid.move:11:42 - │ - 3 │ public(package) fun f_pkg_public() {} - │ --------------- A 'public(package)' function can only be called from the same address and package as module '0x42::mod_0' in package ''. This call is from address '0x54' in package '' - · -11 │ public fun f_public_call_package() { mod_0::f_pkg_public() } - │ ^^^^^^^^^^^^^^^^^^^^^ Invalid call to 'public(package)' visible function '0x42::mod_0::f_pkg_public' - -error[E04001]: restricted visibility - ┌─ tests/move_2024/typing/module_call_visibility_package_invalid.move:12:36 - │ - 3 │ public(package) fun f_pkg_public() {} - │ --------------- A 'public(package)' function can only be called from the same address and package as module '0x42::mod_0' in package ''. This call is from address '0x54' in package '' - · -12 │ fun f_private_call_package() { mod_0::f_pkg_public() } - │ ^^^^^^^^^^^^^^^^^^^^^ Invalid call to 'public(package)' visible function '0x42::mod_0::f_pkg_public' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_package_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_package_invalid.snap new file mode 100644 index 0000000000000..fff6516913695 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_package_invalid.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/module_call_visibility_package_invalid.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/module_call_visibility_package_invalid.move:10:52 + │ + 3 │ public(package) fun f_pkg_public() {} + │ --------------- A 'public(package)' function can only be called from the same address and package as module '0x42::mod_0' in package ''. This call is from address '0x54' in package '' + · +10 │ public(package) fun f_package_call_package() { mod_0::f_pkg_public() } + │ ^^^^^^^^^^^^^^^^^^^^^ Invalid call to 'public(package)' visible function '0x42::mod_0::f_pkg_public' + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/module_call_visibility_package_invalid.move:11:42 + │ + 3 │ public(package) fun f_pkg_public() {} + │ --------------- A 'public(package)' function can only be called from the same address and package as module '0x42::mod_0' in package ''. This call is from address '0x54' in package '' + · +11 │ public fun f_public_call_package() { mod_0::f_pkg_public() } + │ ^^^^^^^^^^^^^^^^^^^^^ Invalid call to 'public(package)' visible function '0x42::mod_0::f_pkg_public' + +error[E04001]: restricted visibility + ┌─ tests/move_2024/typing/module_call_visibility_package_invalid.move:12:36 + │ + 3 │ public(package) fun f_pkg_public() {} + │ --------------- A 'public(package)' function can only be called from the same address and package as module '0x42::mod_0' in package ''. This call is from address '0x54' in package '' + · +12 │ fun f_private_call_package() { mod_0::f_pkg_public() } + │ ^^^^^^^^^^^^^^^^^^^^^ Invalid call to 'public(package)' visible function '0x42::mod_0::f_pkg_public' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_package_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_package_valid.snap new file mode 100644 index 0000000000000..a402ee9f52cee --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/module_call_visibility_package_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/module_call_visibility_package_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/multiple_deprecation_attributes_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/multiple_deprecation_attributes_invalid.exp deleted file mode 100644 index 966fabb679c54..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/multiple_deprecation_attributes_invalid.exp +++ /dev/null @@ -1,32 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/typing/multiple_deprecation_attributes_invalid.move:3:7 - │ -2 │ #[deprecated] - │ ---------- Attribute previously given here -3 │ #[deprecated] - │ ^^^^^^^^^^ Duplicate attribute 'deprecated' attached to the same item - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/typing/multiple_deprecation_attributes_invalid.move:7:7 - │ -6 │ #[deprecated(note = b"note")] - │ ---------- Attribute previously given here -7 │ #[deprecated] - │ ^^^^^^^^^^ Duplicate attribute 'deprecated' attached to the same item - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/typing/multiple_deprecation_attributes_invalid.move:10:19 - │ -10 │ #[deprecated, deprecated(note = b"note")] - │ ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^ Duplicate attribute 'deprecated' attached to the same item - │ │ - │ Attribute previously given here - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_2024/typing/multiple_deprecation_attributes_invalid.move:13:19 - │ -13 │ #[deprecated, deprecated] - │ ---------- ^^^^^^^^^^ Duplicate attribute 'deprecated' attached to the same item - │ │ - │ Attribute previously given here - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/multiple_deprecation_attributes_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/multiple_deprecation_attributes_invalid.snap new file mode 100644 index 0000000000000..b48b277ea3246 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/multiple_deprecation_attributes_invalid.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/multiple_deprecation_attributes_invalid.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/typing/multiple_deprecation_attributes_invalid.move:3:7 + │ +2 │ #[deprecated] + │ ---------- Attribute previously given here +3 │ #[deprecated] + │ ^^^^^^^^^^ Duplicate attribute 'deprecated' attached to the same item + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/typing/multiple_deprecation_attributes_invalid.move:7:7 + │ +6 │ #[deprecated(note = b"note")] + │ ---------- Attribute previously given here +7 │ #[deprecated] + │ ^^^^^^^^^^ Duplicate attribute 'deprecated' attached to the same item + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/typing/multiple_deprecation_attributes_invalid.move:10:19 + │ +10 │ #[deprecated, deprecated(note = b"note")] + │ ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^ Duplicate attribute 'deprecated' attached to the same item + │ │ + │ Attribute previously given here + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_2024/typing/multiple_deprecation_attributes_invalid.move:13:19 + │ +13 │ #[deprecated, deprecated] + │ ---------- ^^^^^^^^^^ Duplicate attribute 'deprecated' attached to the same item + │ │ + │ Attribute previously given here diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/multiple_fake_dot_call_candidates.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/multiple_fake_dot_call_candidates.snap new file mode 100644 index 0000000000000..c3320b3787683 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/multiple_fake_dot_call_candidates.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/multiple_fake_dot_call_candidates.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/mut_patterns.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/mut_patterns.exp deleted file mode 100644 index b23c26f3d5df4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/mut_patterns.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/mut_patterns.move:27:17 - │ -26 │ X::A(x, _) | X::B { x } => { - │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' -27 │ x = x + 1; - │ ^ Invalid assignment of immutable variable 'x' - -error[E04024]: invalid usage of immutable variable - ┌─ tests/move_2024/typing/mut_patterns.move:27:17 - │ -26 │ X::A(x, _) | X::B { x } => { - │ - - The variable was initially assigned here - │ │ - │ To use the variable mutably, it must be declared 'mut', e.g. 'mut x' -27 │ x = x + 1; - │ ^ Invalid assignment of immutable variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/mut_patterns.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/mut_patterns.snap new file mode 100644 index 0000000000000..8723c8b57e326 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/mut_patterns.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/mut_patterns.move +--- +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/mut_patterns.move:27:17 + │ +26 │ X::A(x, _) | X::B { x } => { + │ - To use the variable mutably, it must be declared 'mut', e.g. 'mut x' +27 │ x = x + 1; + │ ^ Invalid assignment of immutable variable 'x' + +error[E04024]: invalid usage of immutable variable + ┌─ tests/move_2024/typing/mut_patterns.move:27:17 + │ +26 │ X::A(x, _) | X::B { x } => { + │ - - The variable was initially assigned here + │ │ + │ To use the variable mutably, it must be declared 'mut', e.g. 'mut x' +27 │ x = x + 1; + │ ^ Invalid assignment of immutable variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/mut_ref_match.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/mut_ref_match.exp deleted file mode 100644 index d2ad0a2f51342..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/mut_ref_match.exp +++ /dev/null @@ -1,10 +0,0 @@ -warning[W09012]: unused 'mut' modifiers - ┌─ tests/move_2024/typing/mut_ref_match.move:9:22 - │ -9 │ X::A(mut a) => { - │ --- ^ The variable 'a' is never used mutably - │ │ - │ Consider removing the 'mut' declaration here - │ - = This warning can be suppressed with '#[allow(unused_let_mut)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/mut_ref_match.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/mut_ref_match.snap new file mode 100644 index 0000000000000..5c85bd63ae51d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/mut_ref_match.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/mut_ref_match.move +--- +warning[W09012]: unused 'mut' modifiers + ┌─ tests/move_2024/typing/mut_ref_match.move:9:22 + │ +9 │ X::A(mut a) => { + │ --- ^ The variable 'a' is never used mutably + │ │ + │ Consider removing the 'mut' declaration here + │ + = This warning can be suppressed with '#[allow(unused_let_mut)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/named_block_invalid_if.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/named_block_invalid_if.exp deleted file mode 100644 index af549552af01a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/named_block_invalid_if.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/named_block_invalid_if.move:4:5 - │ -4 │ ╭ 'a: { -5 │ │ if (cond) { return 'a 5 } - │ │ ------------------------- - │ │ │ │ - │ │ │ Found: integer. It is not compatible with the other type. - │ │ Found: '()'. It is not compatible with the other type. -6 │ │ } - │ ╰─────^ Invalid named block - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/named_block_invalid_if.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/named_block_invalid_if.snap new file mode 100644 index 0000000000000..88c67e7d4c442 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/named_block_invalid_if.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/named_block_invalid_if.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/named_block_invalid_if.move:4:5 + │ +4 │ ╭ 'a: { +5 │ │ if (cond) { return 'a 5 } + │ │ ------------------------- + │ │ │ │ + │ │ │ Found: integer. It is not compatible with the other type. + │ │ Found: '()'. It is not compatible with the other type. +6 │ │ } + │ ╰─────^ Invalid named block diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/neq_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/neq_invalid.exp deleted file mode 100644 index a67dc28bdea09..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/neq_invalid.exp +++ /dev/null @@ -1,160 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/neq_invalid.move:9:17 - │ -9 │ (0: u8) != (1: u128); - │ -- ^^ ---- Found: 'u128'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '!=' - │ Found: 'u8'. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/neq_invalid.move:10:11 - │ -10 │ 0 != false; - │ - ^^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '!=' - │ Found: integer. It is not compatible with the other type. - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/neq_invalid.move:18:9 - │ - 3 │ public struct R { f: u64 } - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -17 │ fun t1(r: R) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' -18 │ r != r; - │ ^ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/neq_invalid.move:18:14 - │ - 3 │ public struct R { f: u64 } - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -17 │ fun t1(r: R) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' -18 │ r != r; - │ ^ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/neq_invalid.move:22:9 - │ - 4 │ public struct G0 {} - │ -- To satisfy the constraint, the 'drop' ability would need to be added here - · -22 │ G0{} != G0{}; - │ ^^^^ - │ │ - │ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x8675309::M::G0<_>' does not have the ability 'drop' - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/neq_invalid.move:22:9 - │ -22 │ G0{} != G0{}; - │ ^^^^ Could not infer this type. Try adding an annotation - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/neq_invalid.move:22:17 - │ - 4 │ public struct G0 {} - │ -- To satisfy the constraint, the 'drop' ability would need to be added here - · -22 │ G0{} != G0{}; - │ ^^^^ - │ │ - │ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x8675309::M::G0<_>' does not have the ability 'drop' - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/neq_invalid.move:22:17 - │ -22 │ G0{} != G0{}; - │ ^^^^ Could not infer this type. Try adding an annotation - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/neq_invalid.move:23:9 - │ - 5 │ public struct G1 {} - │ -- To satisfy the constraint, the 'drop' ability would need to be added here - · -23 │ G1{} != G1{}; - │ ^^^^ - │ │ - │ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x8675309::M::G1<_>' does not have the ability 'drop' - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/neq_invalid.move:23:9 - │ -23 │ G1{} != G1{}; - │ ^^^^ Could not infer this type. Try adding an annotation - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/neq_invalid.move:23:17 - │ - 5 │ public struct G1 {} - │ -- To satisfy the constraint, the 'drop' ability would need to be added here - · -23 │ G1{} != G1{}; - │ ^^^^ - │ │ - │ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x8675309::M::G1<_>' does not have the ability 'drop' - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/neq_invalid.move:23:17 - │ -23 │ G1{} != G1{}; - │ ^^^^ Could not infer this type. Try adding an annotation - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/neq_invalid.move:24:9 - │ -24 │ G2{} != G2{}; - │ ^^^^ Could not infer this type. Try adding an annotation - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/neq_invalid.move:24:17 - │ -24 │ G2{} != G2{}; - │ ^^^^ Could not infer this type. Try adding an annotation - -error[E04005]: expected a single type - ┌─ tests/move_2024/typing/neq_invalid.move:28:9 - │ -28 │ () != (); - │ ^^^^^^^^ - │ │ │ - │ │ Expected a single type, but found expression list type: '()' - │ Incompatible arguments to '!=' - -error[E04005]: expected a single type - ┌─ tests/move_2024/typing/neq_invalid.move:29:9 - │ -29 │ (0, 1) != (0, 1); - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single type, but found expression list type: '(u64, u64)' - │ Incompatible arguments to '!=' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/neq_invalid.move:30:19 - │ -30 │ (1, 2, 3) != (0, 1); - │ --------- ^^ ------ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - │ │ │ - │ │ Incompatible arguments to '!=' - │ Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/neq_invalid.move:31:16 - │ -31 │ (0, 1) != (1, 2, 3); - │ ------ ^^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - │ │ │ - │ │ Incompatible arguments to '!=' - │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/neq_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/neq_invalid.snap new file mode 100644 index 0000000000000..ad532fdc23c97 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/neq_invalid.snap @@ -0,0 +1,167 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/neq_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/neq_invalid.move:9:17 + │ +9 │ (0: u8) != (1: u128); + │ -- ^^ ---- Found: 'u128'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '!=' + │ Found: 'u8'. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/neq_invalid.move:10:11 + │ +10 │ 0 != false; + │ - ^^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '!=' + │ Found: integer. It is not compatible with the other type. + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/neq_invalid.move:18:9 + │ + 3 │ public struct R { f: u64 } + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +17 │ fun t1(r: R) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' +18 │ r != r; + │ ^ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/neq_invalid.move:18:14 + │ + 3 │ public struct R { f: u64 } + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +17 │ fun t1(r: R) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' +18 │ r != r; + │ ^ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/neq_invalid.move:22:9 + │ + 4 │ public struct G0 {} + │ -- To satisfy the constraint, the 'drop' ability would need to be added here + · +22 │ G0{} != G0{}; + │ ^^^^ + │ │ + │ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x8675309::M::G0<_>' does not have the ability 'drop' + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/neq_invalid.move:22:9 + │ +22 │ G0{} != G0{}; + │ ^^^^ Could not infer this type. Try adding an annotation + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/neq_invalid.move:22:17 + │ + 4 │ public struct G0 {} + │ -- To satisfy the constraint, the 'drop' ability would need to be added here + · +22 │ G0{} != G0{}; + │ ^^^^ + │ │ + │ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x8675309::M::G0<_>' does not have the ability 'drop' + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/neq_invalid.move:22:17 + │ +22 │ G0{} != G0{}; + │ ^^^^ Could not infer this type. Try adding an annotation + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/neq_invalid.move:23:9 + │ + 5 │ public struct G1 {} + │ -- To satisfy the constraint, the 'drop' ability would need to be added here + · +23 │ G1{} != G1{}; + │ ^^^^ + │ │ + │ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x8675309::M::G1<_>' does not have the ability 'drop' + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/neq_invalid.move:23:9 + │ +23 │ G1{} != G1{}; + │ ^^^^ Could not infer this type. Try adding an annotation + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/neq_invalid.move:23:17 + │ + 5 │ public struct G1 {} + │ -- To satisfy the constraint, the 'drop' ability would need to be added here + · +23 │ G1{} != G1{}; + │ ^^^^ + │ │ + │ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x8675309::M::G1<_>' does not have the ability 'drop' + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/neq_invalid.move:23:17 + │ +23 │ G1{} != G1{}; + │ ^^^^ Could not infer this type. Try adding an annotation + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/neq_invalid.move:24:9 + │ +24 │ G2{} != G2{}; + │ ^^^^ Could not infer this type. Try adding an annotation + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/neq_invalid.move:24:17 + │ +24 │ G2{} != G2{}; + │ ^^^^ Could not infer this type. Try adding an annotation + +error[E04005]: expected a single type + ┌─ tests/move_2024/typing/neq_invalid.move:28:9 + │ +28 │ () != (); + │ ^^^^^^^^ + │ │ │ + │ │ Expected a single type, but found expression list type: '()' + │ Incompatible arguments to '!=' + +error[E04005]: expected a single type + ┌─ tests/move_2024/typing/neq_invalid.move:29:9 + │ +29 │ (0, 1) != (0, 1); + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single type, but found expression list type: '(u64, u64)' + │ Incompatible arguments to '!=' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/neq_invalid.move:30:19 + │ +30 │ (1, 2, 3) != (0, 1); + │ --------- ^^ ------ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. + │ │ │ + │ │ Incompatible arguments to '!=' + │ Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/neq_invalid.move:31:16 + │ +31 │ (0, 1) != (1, 2, 3); + │ ------ ^^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + │ │ │ + │ │ Incompatible arguments to '!=' + │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/num_infer.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/num_infer.exp deleted file mode 100644 index f22c48f0e9cae..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/num_infer.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/num_infer.move:27:34 - │ - 5 │ native public fun vborrow(v: &vector, i: u64): ∈ - │ --- Expected: 'u64' - · -26 │ let idx = rnd % (matches.length() as u256); - │ ---- Given: 'u256' -27 │ let game = orders.remove(matches[idx]); - │ ^^^^^^^^^^^^ Invalid call of 'std::vector::vborrow'. Invalid argument for parameter 'i' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/num_infer.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/num_infer.snap new file mode 100644 index 0000000000000..7af46a7b28c7e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/num_infer.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/num_infer.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/num_infer.move:27:34 + │ + 5 │ native public fun vborrow(v: &vector, i: u64): ∈ + │ --- Expected: 'u64' + · +26 │ let idx = rnd % (matches.length() as u256); + │ ---- Given: 'u256' +27 │ let game = orders.remove(matches[idx]); + │ ^^^^^^^^^^^^ Invalid call of 'std::vector::vborrow'. Invalid argument for parameter 'i' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/primitive_index_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/primitive_index_invalid.exp deleted file mode 100644 index e0f16bd3706d4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/primitive_index_invalid.exp +++ /dev/null @@ -1,10 +0,0 @@ -error[E02019]: invalid 'syntax' method type - ┌─ tests/move_2024/typing/primitive_index_invalid.move:4:14 - │ -4 │ #[syntax(index)] - │ ^^^^^ Invalid syntax annotation -5 │ native public fun vborrow(v: &vector, i: u64): &mut Element; - │ ---------------- ------------ This syntax method must return an immutable reference to match its subject type - │ │ - │ Immutable subject type defined here - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/primitive_index_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/primitive_index_invalid.snap new file mode 100644 index 0000000000000..23855fc862199 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/primitive_index_invalid.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/primitive_index_invalid.move +--- +error[E02019]: invalid 'syntax' method type + ┌─ tests/move_2024/typing/primitive_index_invalid.move:4:14 + │ +4 │ #[syntax(index)] + │ ^^^^^ Invalid syntax annotation +5 │ native public fun vborrow(v: &vector, i: u64): &mut Element; + │ ---------------- ------------ This syntax method must return an immutable reference to match its subject type + │ │ + │ Immutable subject type defined here diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/primitive_index_invalid_2.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/primitive_index_invalid_2.exp deleted file mode 100644 index 273c7534199d8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/primitive_index_invalid_2.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/primitive_index_invalid_2.move:5:64 - │ -5 │ native public fun vborrow(v: &vector, i: u64): ∈ - │ ^^^ This parameter has type 'u64' -6 │ #[syntax(index)] -7 │ native public fun vborrow_mut(v: &mut vector, i: u32): &mut Element; - │ --- - │ │ - │ Expected this parameter to have type 'u64' - │ It has type 'u32' - │ - = Index operation non-subject parameter types must match exactly - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/primitive_index_invalid_2.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/primitive_index_invalid_2.snap new file mode 100644 index 0000000000000..248e769b9f750 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/primitive_index_invalid_2.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/primitive_index_invalid_2.move +--- +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/primitive_index_invalid_2.move:5:64 + │ +5 │ native public fun vborrow(v: &vector, i: u64): ∈ + │ ^^^ This parameter has type 'u64' +6 │ #[syntax(index)] +7 │ native public fun vborrow_mut(v: &mut vector, i: u32): &mut Element; + │ --- + │ │ + │ Expected this parameter to have type 'u64' + │ It has type 'u32' + │ + = Index operation non-subject parameter types must match exactly diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/primitive_index_test.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/primitive_index_test.snap new file mode 100644 index 0000000000000..f45cdc7e8011c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/primitive_index_test.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/primitive_index_test.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_by_name_arg_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_by_name_arg_invalid.exp deleted file mode 100644 index d2ab526ed6416..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_by_name_arg_invalid.exp +++ /dev/null @@ -1,42 +0,0 @@ -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/recursive_macros_by_name_arg_invalid.move:8:9 - │ - 4 │ bar!(foo!($f)) - │ -------------- From this macro expansion - · - 8 │ foo!(bar!($f)) - │ ^^^^^^^^^^^^^^ Recursive macro expansion. 'a::m::foo' cannot recursively expand itself - · -28 │ foo!(0); - │ ------- 'a::m::foo' previously expanded here - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/recursive_macros_by_name_arg_invalid.move:12:14 - │ -12 │ $f + arg!($f) - │ ^^^^^^^^ Recursive macro expansion. 'a::m::arg' cannot recursively expand itself - · -29 │ arg!({ let x = 0; x }); - │ ---------------------- 'a::m::arg' previously expanded here - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/recursive_macros_by_name_arg_invalid.move:16:14 - │ -16 │ $f + arg_eta!({ $f }) - │ ^^^^^^^^^^^^^^^^ Recursive macro expansion. 'a::m::arg_eta' cannot recursively expand itself - · -30 │ arg_eta!({ let x = 0; x }); - │ -------------------------- 'a::m::arg_eta' previously expanded here - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/recursive_macros_by_name_arg_invalid.move:20:23 - │ -20 │ $f + apply!({ arg_apply!($f) }) - │ ---------^^^^^^^^^^^^^^--- - │ │ │ - │ │ Recursive macro expansion. 'a::m::arg_apply' cannot recursively expand itself - │ From this macro expansion - · -31 │ arg_apply!({ let x = 0; x }); - │ ---------------------------- 'a::m::arg_apply' previously expanded here - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_by_name_arg_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_by_name_arg_invalid.snap new file mode 100644 index 0000000000000..1836a1659b9ba --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_by_name_arg_invalid.snap @@ -0,0 +1,49 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/recursive_macros_by_name_arg_invalid.move +--- +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/recursive_macros_by_name_arg_invalid.move:8:9 + │ + 4 │ bar!(foo!($f)) + │ -------------- From this macro expansion + · + 8 │ foo!(bar!($f)) + │ ^^^^^^^^^^^^^^ Recursive macro expansion. 'a::m::foo' cannot recursively expand itself + · +28 │ foo!(0); + │ ------- 'a::m::foo' previously expanded here + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/recursive_macros_by_name_arg_invalid.move:12:14 + │ +12 │ $f + arg!($f) + │ ^^^^^^^^ Recursive macro expansion. 'a::m::arg' cannot recursively expand itself + · +29 │ arg!({ let x = 0; x }); + │ ---------------------- 'a::m::arg' previously expanded here + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/recursive_macros_by_name_arg_invalid.move:16:14 + │ +16 │ $f + arg_eta!({ $f }) + │ ^^^^^^^^^^^^^^^^ Recursive macro expansion. 'a::m::arg_eta' cannot recursively expand itself + · +30 │ arg_eta!({ let x = 0; x }); + │ -------------------------- 'a::m::arg_eta' previously expanded here + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/recursive_macros_by_name_arg_invalid.move:20:23 + │ +20 │ $f + apply!({ arg_apply!($f) }) + │ ---------^^^^^^^^^^^^^^--- + │ │ │ + │ │ Recursive macro expansion. 'a::m::arg_apply' cannot recursively expand itself + │ From this macro expansion + · +31 │ arg_apply!({ let x = 0; x }); + │ ---------------------------- 'a::m::arg_apply' previously expanded here diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_by_name_arg_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_by_name_arg_valid.snap new file mode 100644 index 0000000000000..32c99b4a349d9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_by_name_arg_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/recursive_macros_by_name_arg_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_invalid.exp deleted file mode 100644 index bc5859f111781..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_invalid.exp +++ /dev/null @@ -1,48 +0,0 @@ -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/recursive_macros_invalid.move:4:13 - │ - 4 │ 1 + self_cyle!() - │ ^^^^^^^^^^^^ Recursive macro expansion. 'a::m::self_cyle' cannot recursively expand itself - · -39 │ self_cyle!(); - │ ------------ 'a::m::self_cyle' previously expanded here - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/recursive_macros_invalid.move:17:9 - │ - 9 │ cycle2!() - │ --------- From this macro expansion - · -13 │ cycle3!() - │ --------- From this macro expansion - · -17 │ cycle1!() - │ ^^^^^^^^^ Recursive macro expansion. 'a::m::cycle1' cannot recursively expand itself - · -40 │ cycle1!(); - │ --------- 'a::m::cycle1' previously expanded here - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/recursive_macros_invalid.move:22:19 - │ -22 │ apply!(|| cycle_app!(|| $f())) - │ ----------^^^^^^^^^^^^^^^^^^^- - │ │ │ - │ │ Recursive macro expansion. 'a::m::cycle_app' cannot recursively expand itself - │ From this macro expansion - · -41 │ cycle_app!(|| 1); - │ ---------------- 'a::m::cycle_app' previously expanded here - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/recursive_macros_invalid.move:31:18 - │ -31 │ by_name!(cycle_by_name!($f)) - │ ---------^^^^^^^^^^^^^^^^^^- - │ │ │ - │ │ Recursive macro expansion. 'a::m::cycle_by_name' cannot recursively expand itself - │ From this macro expansion - · -42 │ cycle_by_name!(1); - │ ----------------- 'a::m::cycle_by_name' previously expanded here - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_invalid.snap new file mode 100644 index 0000000000000..922216dd730b5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_invalid.snap @@ -0,0 +1,55 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/recursive_macros_invalid.move +--- +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/recursive_macros_invalid.move:4:13 + │ + 4 │ 1 + self_cyle!() + │ ^^^^^^^^^^^^ Recursive macro expansion. 'a::m::self_cyle' cannot recursively expand itself + · +39 │ self_cyle!(); + │ ------------ 'a::m::self_cyle' previously expanded here + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/recursive_macros_invalid.move:17:9 + │ + 9 │ cycle2!() + │ --------- From this macro expansion + · +13 │ cycle3!() + │ --------- From this macro expansion + · +17 │ cycle1!() + │ ^^^^^^^^^ Recursive macro expansion. 'a::m::cycle1' cannot recursively expand itself + · +40 │ cycle1!(); + │ --------- 'a::m::cycle1' previously expanded here + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/recursive_macros_invalid.move:22:19 + │ +22 │ apply!(|| cycle_app!(|| $f())) + │ ----------^^^^^^^^^^^^^^^^^^^- + │ │ │ + │ │ Recursive macro expansion. 'a::m::cycle_app' cannot recursively expand itself + │ From this macro expansion + · +41 │ cycle_app!(|| 1); + │ ---------------- 'a::m::cycle_app' previously expanded here + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/recursive_macros_invalid.move:31:18 + │ +31 │ by_name!(cycle_by_name!($f)) + │ ---------^^^^^^^^^^^^^^^^^^- + │ │ │ + │ │ Recursive macro expansion. 'a::m::cycle_by_name' cannot recursively expand itself + │ From this macro expansion + · +42 │ cycle_by_name!(1); + │ ----------------- 'a::m::cycle_by_name' previously expanded here diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_invalid_lambdas.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_invalid_lambdas.exp deleted file mode 100644 index bab476467fa9e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_invalid_lambdas.exp +++ /dev/null @@ -1,42 +0,0 @@ -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/recursive_macros_invalid_lambdas.move:8:9 - │ - 4 │ bar!(|| foo!($f)) - │ ----------------- From this macro expansion - · - 8 │ foo!(|| bar!($f)) - │ ^^^^^^^^^^^^^^^^^ Recursive macro expansion. 'a::m::foo' cannot recursively expand itself - · -28 │ foo!(|| 0); - │ ---------- 'a::m::foo' previously expanded here - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/recursive_macros_invalid_lambdas.move:12:12 - │ -12 │ $f(arg!($f)) - │ ^^^^^^^^ Recursive macro expansion. 'a::m::arg' cannot recursively expand itself - · -29 │ arg!(|x| x); - │ ----------- 'a::m::arg' previously expanded here - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/recursive_macros_invalid_lambdas.move:16:12 - │ -16 │ $f(arg_eta!(|x| $f(x))) - │ ^^^^^^^^^^^^^^^^^^^ Recursive macro expansion. 'a::m::arg_eta' cannot recursively expand itself - · -30 │ arg_eta!(|x| x); - │ --------------- 'a::m::arg_eta' previously expanded here - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/recursive_macros_invalid_lambdas.move:20:22 - │ -20 │ $f(apply!(|| arg_apply!($f))) - │ ----------^^^^^^^^^^^^^^- - │ │ │ - │ │ Recursive macro expansion. 'a::m::arg_apply' cannot recursively expand itself - │ From this macro expansion - · -31 │ arg_apply!(|x| x); - │ ----------------- 'a::m::arg_apply' previously expanded here - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_invalid_lambdas.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_invalid_lambdas.snap new file mode 100644 index 0000000000000..f215b91d8aef3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_invalid_lambdas.snap @@ -0,0 +1,49 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/recursive_macros_invalid_lambdas.move +--- +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/recursive_macros_invalid_lambdas.move:8:9 + │ + 4 │ bar!(|| foo!($f)) + │ ----------------- From this macro expansion + · + 8 │ foo!(|| bar!($f)) + │ ^^^^^^^^^^^^^^^^^ Recursive macro expansion. 'a::m::foo' cannot recursively expand itself + · +28 │ foo!(|| 0); + │ ---------- 'a::m::foo' previously expanded here + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/recursive_macros_invalid_lambdas.move:12:12 + │ +12 │ $f(arg!($f)) + │ ^^^^^^^^ Recursive macro expansion. 'a::m::arg' cannot recursively expand itself + · +29 │ arg!(|x| x); + │ ----------- 'a::m::arg' previously expanded here + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/recursive_macros_invalid_lambdas.move:16:12 + │ +16 │ $f(arg_eta!(|x| $f(x))) + │ ^^^^^^^^^^^^^^^^^^^ Recursive macro expansion. 'a::m::arg_eta' cannot recursively expand itself + · +30 │ arg_eta!(|x| x); + │ --------------- 'a::m::arg_eta' previously expanded here + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/recursive_macros_invalid_lambdas.move:20:22 + │ +20 │ $f(apply!(|| arg_apply!($f))) + │ ----------^^^^^^^^^^^^^^- + │ │ │ + │ │ Recursive macro expansion. 'a::m::arg_apply' cannot recursively expand itself + │ From this macro expansion + · +31 │ arg_apply!(|x| x); + │ ----------------- 'a::m::arg_apply' previously expanded here diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_valid.snap new file mode 100644 index 0000000000000..70b96b5029b04 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/recursive_macros_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/recursive_macros_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/struct_match_ambiguous_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/struct_match_ambiguous_invalid.exp deleted file mode 100644 index 6c1dbc9caa5de..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/struct_match_ambiguous_invalid.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/struct_match_ambiguous_invalid.move:5:17 - │ -5 │ let s = S { x: 0 }; - │ ^^^^^^^^^^ Could not infer this type. Try adding an annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/struct_match_ambiguous_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/struct_match_ambiguous_invalid.snap new file mode 100644 index 0000000000000..be7bbafab036e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/struct_match_ambiguous_invalid.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/struct_match_ambiguous_invalid.move +--- +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/struct_match_ambiguous_invalid.move:5:17 + │ +5 │ let s = S { x: 0 }; + │ ^^^^^^^^^^ Could not infer this type. Try adding an annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/syntax_methods_args_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/syntax_methods_args_invalid.exp deleted file mode 100644 index 0479e897934e7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/syntax_methods_args_invalid.exp +++ /dev/null @@ -1,148 +0,0 @@ -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:7:39 - │ - 7 │ public fun borrow(s: &S, i: u64): &u64 { abort 0 } - │ ^^^ This parameter has type 'u64' - · -11 │ public fun borrow_mut(s: &mut S, i: T): &mut u64 { abort 0 } - │ - - │ │ - │ Expected this parameter to have type 'u64' - │ It has type 'T' - │ - = Index operation non-subject parameter types must match exactly - -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:20:16 - │ -20 │ public fun borrow(s: &S, i: U, j: V): &u64 { abort 0 } - │ ^^^^^^ This index function expects 3 type arguments - · -24 │ public fun borrow_mut(s: &mut S, i: R, j: R): &mut u64 { abort 0 } - │ ---------- This mutable index function expects 2 type arguments - │ - = Index operations on the same type must take the name number of type arguments - -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:34:39 - │ -34 │ public fun borrow(s: &S, i: u64, j: T): &T { abort 0 } - │ ^^^ This parameter has type 'u64' - · -38 │ public fun borrow_mut(s: &mut S, i: u32, j: T): &mut T { abort 0 } - │ --- - │ │ - │ Expected this parameter to have type 'u64' - │ It has type 'u32' - │ - = Index operation non-subject parameter types must match exactly - -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:48:16 - │ -48 │ public fun borrow(s: &S, i: u64, j: Q): &T { abort 0 } - │ ^^^^^^ This index function expects 2 type arguments - · -52 │ public fun borrow_mut(s: &mut S, i: u64, j: T): &mut T { abort 0 } - │ ---------- This mutable index function expects 1 type arguments - │ - = Index operations on the same type must take the name number of type arguments - -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:62:41 - │ -62 │ public fun borrow(s: &S, i: u64, j: Q): &T { abort 0 } - │ ^^^ This parameter has type 'u64' - · -66 │ public fun borrow_mut(s: &mut S, i: u32, j: T): &mut T { abort 0 } - │ --- - │ │ - │ Expected this parameter to have type 'u64' - │ It has type 'u32' - │ - = Index operation non-subject parameter types must match exactly - -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:62:49 - │ -62 │ public fun borrow(s: &S, i: u64, j: Q): &T { abort 0 } - │ ^ This parameter has type 'Q' - · -66 │ public fun borrow_mut(s: &mut S, i: u32, j: T): &mut T { abort 0 } - │ - - │ │ - │ Expected this parameter to have type 'Q' - │ It has type 'T' - │ - = Index operation non-subject parameter types must match exactly - -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:76:41 - │ -76 │ public fun borrow(s: &S, i: R, j: T): &T { abort 0 } - │ ^ This parameter has type 'R' - · -80 │ public fun borrow_mut(s: &mut S, i: T, j: T): &mut T { abort 0 } - │ - - │ │ - │ Expected this parameter to have type 'R' - │ It has type 'T' - │ - = Index operation non-subject parameter types must match exactly - -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:90:39 - │ -90 │ public fun borrow(s: &S, i: u64): &T { - │ ^^^ This parameter has type 'u64' - · -95 │ public fun borrow_mut(s: &mut S, i: u32): &mut T { - │ --- - │ │ - │ Expected this parameter to have type 'u64' - │ It has type 'u32' - │ - = Index operation non-subject parameter types must match exactly - -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:107:39 - │ -107 │ public fun borrow(s: &S, i: &u64, j: T): &T { abort 0 } - │ ^^^^ This parameter has type '&u64' - · -111 │ public fun borrow_mut(s: &mut S, i: &mut u64, j: T): &mut T { abort 0 } - │ -------- - │ │ - │ Expected this parameter to have type '&u64' - │ It has type '&mut u64' - │ - = Index operation non-subject parameter types must match exactly - -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:121:48 - │ -121 │ public fun borrow(s: &S, i: &u64, j: &T): &T { abort 0 } - │ ^^ This parameter has type '&T' - · -125 │ public fun borrow_mut(s: &mut S, i: &u64, j: &mut T): &mut T { abort 0 } - │ ------ - │ │ - │ Expected this parameter to have type '&T' - │ It has type '&mut T' - │ - = Index operation non-subject parameter types must match exactly - -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:135:48 - │ -135 │ public fun borrow(s: &S, i: &u64, j: &mut T): &T { abort 0 } - │ ^^^^^^ This parameter has type '&mut T' - · -139 │ public fun borrow_mut(s: &mut S, i: &u64, j: &T): &mut T { abort 0 } - │ -- - │ │ - │ Expected this parameter to have type '&mut T' - │ It has type '&T' - │ - = Index operation non-subject parameter types must match exactly - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/syntax_methods_args_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/syntax_methods_args_invalid.snap new file mode 100644 index 0000000000000..466dc5f62abb5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/syntax_methods_args_invalid.snap @@ -0,0 +1,155 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/syntax_methods_args_invalid.move +--- +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:7:39 + │ + 7 │ public fun borrow(s: &S, i: u64): &u64 { abort 0 } + │ ^^^ This parameter has type 'u64' + · +11 │ public fun borrow_mut(s: &mut S, i: T): &mut u64 { abort 0 } + │ - + │ │ + │ Expected this parameter to have type 'u64' + │ It has type 'T' + │ + = Index operation non-subject parameter types must match exactly + +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:20:16 + │ +20 │ public fun borrow(s: &S, i: U, j: V): &u64 { abort 0 } + │ ^^^^^^ This index function expects 3 type arguments + · +24 │ public fun borrow_mut(s: &mut S, i: R, j: R): &mut u64 { abort 0 } + │ ---------- This mutable index function expects 2 type arguments + │ + = Index operations on the same type must take the name number of type arguments + +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:34:39 + │ +34 │ public fun borrow(s: &S, i: u64, j: T): &T { abort 0 } + │ ^^^ This parameter has type 'u64' + · +38 │ public fun borrow_mut(s: &mut S, i: u32, j: T): &mut T { abort 0 } + │ --- + │ │ + │ Expected this parameter to have type 'u64' + │ It has type 'u32' + │ + = Index operation non-subject parameter types must match exactly + +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:48:16 + │ +48 │ public fun borrow(s: &S, i: u64, j: Q): &T { abort 0 } + │ ^^^^^^ This index function expects 2 type arguments + · +52 │ public fun borrow_mut(s: &mut S, i: u64, j: T): &mut T { abort 0 } + │ ---------- This mutable index function expects 1 type arguments + │ + = Index operations on the same type must take the name number of type arguments + +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:62:41 + │ +62 │ public fun borrow(s: &S, i: u64, j: Q): &T { abort 0 } + │ ^^^ This parameter has type 'u64' + · +66 │ public fun borrow_mut(s: &mut S, i: u32, j: T): &mut T { abort 0 } + │ --- + │ │ + │ Expected this parameter to have type 'u64' + │ It has type 'u32' + │ + = Index operation non-subject parameter types must match exactly + +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:62:49 + │ +62 │ public fun borrow(s: &S, i: u64, j: Q): &T { abort 0 } + │ ^ This parameter has type 'Q' + · +66 │ public fun borrow_mut(s: &mut S, i: u32, j: T): &mut T { abort 0 } + │ - + │ │ + │ Expected this parameter to have type 'Q' + │ It has type 'T' + │ + = Index operation non-subject parameter types must match exactly + +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:76:41 + │ +76 │ public fun borrow(s: &S, i: R, j: T): &T { abort 0 } + │ ^ This parameter has type 'R' + · +80 │ public fun borrow_mut(s: &mut S, i: T, j: T): &mut T { abort 0 } + │ - + │ │ + │ Expected this parameter to have type 'R' + │ It has type 'T' + │ + = Index operation non-subject parameter types must match exactly + +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:90:39 + │ +90 │ public fun borrow(s: &S, i: u64): &T { + │ ^^^ This parameter has type 'u64' + · +95 │ public fun borrow_mut(s: &mut S, i: u32): &mut T { + │ --- + │ │ + │ Expected this parameter to have type 'u64' + │ It has type 'u32' + │ + = Index operation non-subject parameter types must match exactly + +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:107:39 + │ +107 │ public fun borrow(s: &S, i: &u64, j: T): &T { abort 0 } + │ ^^^^ This parameter has type '&u64' + · +111 │ public fun borrow_mut(s: &mut S, i: &mut u64, j: T): &mut T { abort 0 } + │ -------- + │ │ + │ Expected this parameter to have type '&u64' + │ It has type '&mut u64' + │ + = Index operation non-subject parameter types must match exactly + +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:121:48 + │ +121 │ public fun borrow(s: &S, i: &u64, j: &T): &T { abort 0 } + │ ^^ This parameter has type '&T' + · +125 │ public fun borrow_mut(s: &mut S, i: &u64, j: &mut T): &mut T { abort 0 } + │ ------ + │ │ + │ Expected this parameter to have type '&T' + │ It has type '&mut T' + │ + = Index operation non-subject parameter types must match exactly + +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/syntax_methods_args_invalid.move:135:48 + │ +135 │ public fun borrow(s: &S, i: &u64, j: &mut T): &T { abort 0 } + │ ^^^^^^ This parameter has type '&mut T' + · +139 │ public fun borrow_mut(s: &mut S, i: &u64, j: &T): &mut T { abort 0 } + │ -- + │ │ + │ Expected this parameter to have type '&mut T' + │ It has type '&T' + │ + = Index operation non-subject parameter types must match exactly diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/syntax_methods_args_polymorphic_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/syntax_methods_args_polymorphic_invalid.exp deleted file mode 100644 index ba6fdc473e4dc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/syntax_methods_args_polymorphic_invalid.exp +++ /dev/null @@ -1,50 +0,0 @@ -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/syntax_methods_args_polymorphic_invalid.move:6:43 - │ -6 │ public fun borrow(_s: &S, _j: Q): &T { abort 0 } - │ ^ This parameter has type 'Q' - · -9 │ public fun borrow_mut(_s: &mut S, _j: T): &mut T { abort 0 } - │ - - │ │ - │ Expected this parameter to have type 'Q' - │ It has type 'T' - │ - = Index operation non-subject parameter types must match exactly - -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/syntax_methods_args_polymorphic_invalid.move:14:33 - │ -14 │ public fun borrowA(_s: &A, _j: T): &Q { abort 0 } - │ - ^^^^^ This index function subject has type '&a::invalid::A' - │ │ - │ Type parameter T appears in position 2 here -15 │ #[syntax(index)] -16 │ public fun borrow_muAt(_s: &mut A, _j: T): &mut T { abort 0 } - │ - --------- - │ │ │ - │ │ Expected this mutable index function subject to have type '&mut a::invalid::A' - │ │ It has type '&mut a::invalid::A' - │ Type parameter T appears in position 1 here - │ - = Type parameters must be used the same by position, not name - = These functions must take the same subject type, differing only by mutability - -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/syntax_methods_args_polymorphic_invalid.move:14:44 - │ -14 │ public fun borrowA(_s: &A, _j: T): &Q { abort 0 } - │ - ^ This parameter has type 'T' - │ │ - │ Type parameter T appears in position 2 here -15 │ #[syntax(index)] -16 │ public fun borrow_muAt(_s: &mut A, _j: T): &mut T { abort 0 } - │ - - - │ │ │ - │ │ Expected this parameter to have type 'Q' - │ │ It has type 'T' - │ Type parameter T appears in position 1 here - │ - = Type parameters must be used the same by position, not name - = Index operation non-subject parameter types must match exactly - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/syntax_methods_args_polymorphic_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/syntax_methods_args_polymorphic_invalid.snap new file mode 100644 index 0000000000000..f80a5977714e3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/syntax_methods_args_polymorphic_invalid.snap @@ -0,0 +1,57 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/syntax_methods_args_polymorphic_invalid.move +--- +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/syntax_methods_args_polymorphic_invalid.move:6:43 + │ +6 │ public fun borrow(_s: &S, _j: Q): &T { abort 0 } + │ ^ This parameter has type 'Q' + · +9 │ public fun borrow_mut(_s: &mut S, _j: T): &mut T { abort 0 } + │ - + │ │ + │ Expected this parameter to have type 'Q' + │ It has type 'T' + │ + = Index operation non-subject parameter types must match exactly + +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/syntax_methods_args_polymorphic_invalid.move:14:33 + │ +14 │ public fun borrowA(_s: &A, _j: T): &Q { abort 0 } + │ - ^^^^^ This index function subject has type '&a::invalid::A' + │ │ + │ Type parameter T appears in position 2 here +15 │ #[syntax(index)] +16 │ public fun borrow_muAt(_s: &mut A, _j: T): &mut T { abort 0 } + │ - --------- + │ │ │ + │ │ Expected this mutable index function subject to have type '&mut a::invalid::A' + │ │ It has type '&mut a::invalid::A' + │ Type parameter T appears in position 1 here + │ + = Type parameters must be used the same by position, not name + = These functions must take the same subject type, differing only by mutability + +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/syntax_methods_args_polymorphic_invalid.move:14:44 + │ +14 │ public fun borrowA(_s: &A, _j: T): &Q { abort 0 } + │ - ^ This parameter has type 'T' + │ │ + │ Type parameter T appears in position 2 here +15 │ #[syntax(index)] +16 │ public fun borrow_muAt(_s: &mut A, _j: T): &mut T { abort 0 } + │ - - + │ │ │ + │ │ Expected this parameter to have type 'Q' + │ │ It has type 'T' + │ Type parameter T appears in position 1 here + │ + = Type parameters must be used the same by position, not name + = Index operation non-subject parameter types must match exactly diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/syntax_methods_args_polymorphic_invalid_positional.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/syntax_methods_args_polymorphic_invalid_positional.exp deleted file mode 100644 index a1084211d799e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/syntax_methods_args_polymorphic_invalid_positional.exp +++ /dev/null @@ -1,54 +0,0 @@ -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/syntax_methods_args_polymorphic_invalid_positional.move:6:45 - │ -6 │ public fun borrow_a(_s: &A, _j: T): &Q { abort 0 } - │ - ^ This parameter has type 'T' - │ │ - │ Type parameter T appears in position 2 here - · -9 │ public fun borrow_mut_a(_s: &mut A, _j: T): &mut T { abort 0 } - │ - - - │ │ │ - │ │ Expected this parameter to have type 'Q' - │ │ It has type 'T' - │ Type parameter T appears in position 1 here - │ - = Type parameters must be used the same by position, not name - = Index operation non-subject parameter types must match exactly - -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/syntax_methods_args_polymorphic_invalid_positional.move:14:49 - │ -14 │ public fun borrow_b(_s: &B, _j: Q): &T { abort 0 } - │ - ^^ This index function returns type '&T' - │ │ - │ Type parameter T appears in position 2 here - · -17 │ public fun borrow_mut_b(_s: &mut B, _j: T): &mut T { abort 0 } - │ - ------ - │ │ │ - │ │ Expected this mutable index function to return type '&mut Q' - │ │ It returns type '&mut T' - │ Type parameter T appears in position 1 here - │ - = Type parameters must be used the same by position, not name - = These functions must return the same type, differing only by mutability - -error[E04034]: 'syntax' method types differ - ┌─ tests/move_2024/typing/syntax_methods_args_polymorphic_invalid_positional.move:22:34 - │ -22 │ public fun borrow_c(_s: &C, _j: Q): &Q { abort 0 } - │ - ^^^^^ This index function subject has type '&a::invalid::C' - │ │ - │ Type parameter T appears in position 2 here - · -25 │ public fun borrow_mut_c(_s: &mut C, _j: T): &mut T { abort 0 } - │ - --------- - │ │ │ - │ │ Expected this mutable index function subject to have type '&mut a::invalid::C' - │ │ It has type '&mut a::invalid::C' - │ Type parameter T appears in position 1 here - │ - = Type parameters must be used the same by position, not name - = These functions must take the same subject type, differing only by mutability - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/syntax_methods_args_polymorphic_invalid_positional.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/syntax_methods_args_polymorphic_invalid_positional.snap new file mode 100644 index 0000000000000..e206a0b9ef5fd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/syntax_methods_args_polymorphic_invalid_positional.snap @@ -0,0 +1,61 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/syntax_methods_args_polymorphic_invalid_positional.move +--- +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/syntax_methods_args_polymorphic_invalid_positional.move:6:45 + │ +6 │ public fun borrow_a(_s: &A, _j: T): &Q { abort 0 } + │ - ^ This parameter has type 'T' + │ │ + │ Type parameter T appears in position 2 here + · +9 │ public fun borrow_mut_a(_s: &mut A, _j: T): &mut T { abort 0 } + │ - - + │ │ │ + │ │ Expected this parameter to have type 'Q' + │ │ It has type 'T' + │ Type parameter T appears in position 1 here + │ + = Type parameters must be used the same by position, not name + = Index operation non-subject parameter types must match exactly + +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/syntax_methods_args_polymorphic_invalid_positional.move:14:49 + │ +14 │ public fun borrow_b(_s: &B, _j: Q): &T { abort 0 } + │ - ^^ This index function returns type '&T' + │ │ + │ Type parameter T appears in position 2 here + · +17 │ public fun borrow_mut_b(_s: &mut B, _j: T): &mut T { abort 0 } + │ - ------ + │ │ │ + │ │ Expected this mutable index function to return type '&mut Q' + │ │ It returns type '&mut T' + │ Type parameter T appears in position 1 here + │ + = Type parameters must be used the same by position, not name + = These functions must return the same type, differing only by mutability + +error[E04034]: 'syntax' method types differ + ┌─ tests/move_2024/typing/syntax_methods_args_polymorphic_invalid_positional.move:22:34 + │ +22 │ public fun borrow_c(_s: &C, _j: Q): &Q { abort 0 } + │ - ^^^^^ This index function subject has type '&a::invalid::C' + │ │ + │ Type parameter T appears in position 2 here + · +25 │ public fun borrow_mut_c(_s: &mut C, _j: T): &mut T { abort 0 } + │ - --------- + │ │ │ + │ │ Expected this mutable index function subject to have type '&mut a::invalid::C' + │ │ It has type '&mut a::invalid::C' + │ Type parameter T appears in position 1 here + │ + = Type parameters must be used the same by position, not name + = These functions must take the same subject type, differing only by mutability diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_macro.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_macro.snap new file mode 100644 index 0000000000000..e700825560f99 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_macro.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/type_hole_macro.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_macro_lambda.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_macro_lambda.snap new file mode 100644 index 0000000000000..1c5bc9b66aed0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_macro_lambda.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/type_hole_macro_lambda.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_macro_lambda_with_annotaitons.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_macro_lambda_with_annotaitons.exp deleted file mode 100644 index dcedf0cc4e93d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_macro_lambda_with_annotaitons.exp +++ /dev/null @@ -1,46 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/type_hole_macro_lambda_with_annotaitons.move:6:37 - │ - 6 │ macro fun applyu64($f: |u64| -> u64): u64 { - │ ^^^ - │ │ - │ Invalid type annotation - │ Expected: 'u64' - · -20 │ applyu64!(|_: _| -> _ { 0u8 }); - │ --- Given: 'u8' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/type_hole_macro_lambda_with_annotaitons.move:6:37 - │ - 6 │ macro fun applyu64($f: |u64| -> u64): u64 { - │ ^^^ - │ │ - │ Invalid type annotation - │ Expected: 'u64' - · -21 │ applyu64!(|_: _| -> _ { b"hello" }); - │ -------- Given: 'vector' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/type_hole_macro_lambda_with_annotaitons.move:10:46 - │ -10 │ macro fun applyvu64($f: |vector| -> vector): vector { - │ ^^^^^^^^^^^ - │ │ │ - │ │ Expected: 'u64' - │ Invalid type annotation - · -22 │ applyvu64!(|_: vector<_>| -> vector<_> { b"hello" }); - │ -------- Given: 'u8' - -error[E04007]: incompatible types - ┌─ tests/move_2024/typing/type_hole_macro_lambda_with_annotaitons.move:23:9 - │ -23 │ applyt!(0u64, |_: vector<_>| -> vector<_> { b"hello" }); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Expected: 'vector<_>' - │ │ Given: 'u64' - │ Invalid type annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_macro_lambda_with_annotaitons.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_macro_lambda_with_annotaitons.snap new file mode 100644 index 0000000000000..f2c756d7b9ddc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_macro_lambda_with_annotaitons.snap @@ -0,0 +1,53 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/type_hole_macro_lambda_with_annotaitons.move +--- +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/type_hole_macro_lambda_with_annotaitons.move:6:37 + │ + 6 │ macro fun applyu64($f: |u64| -> u64): u64 { + │ ^^^ + │ │ + │ Invalid type annotation + │ Expected: 'u64' + · +20 │ applyu64!(|_: _| -> _ { 0u8 }); + │ --- Given: 'u8' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/type_hole_macro_lambda_with_annotaitons.move:6:37 + │ + 6 │ macro fun applyu64($f: |u64| -> u64): u64 { + │ ^^^ + │ │ + │ Invalid type annotation + │ Expected: 'u64' + · +21 │ applyu64!(|_: _| -> _ { b"hello" }); + │ -------- Given: 'vector' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/type_hole_macro_lambda_with_annotaitons.move:10:46 + │ +10 │ macro fun applyvu64($f: |vector| -> vector): vector { + │ ^^^^^^^^^^^ + │ │ │ + │ │ Expected: 'u64' + │ Invalid type annotation + · +22 │ applyvu64!(|_: vector<_>| -> vector<_> { b"hello" }); + │ -------- Given: 'u8' + +error[E04007]: incompatible types + ┌─ tests/move_2024/typing/type_hole_macro_lambda_with_annotaitons.move:23:9 + │ +23 │ applyt!(0u64, |_: vector<_>| -> vector<_> { b"hello" }); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Expected: 'vector<_>' + │ │ Given: 'u64' + │ Invalid type annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_no_inferrence.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_no_inferrence.exp deleted file mode 100644 index eb933e472c733..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_no_inferrence.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/type_hole_no_inferrence.move:3:23 - │ -3 │ let _: vector<_> = vector[]; - │ ^ Could not infer this type. Try adding an annotation - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/type_hole_no_inferrence.move:3:28 - │ -3 │ let _: vector<_> = vector[]; - │ ^^^^^^^^ Could not infer this type. Try adding an annotation - -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/type_hole_no_inferrence.move:4:13 - │ -4 │ any<_>(); - │ ^ Could not infer this type. Try adding an annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_no_inferrence.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_no_inferrence.snap new file mode 100644 index 0000000000000..5ee50068fb946 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_no_inferrence.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/type_hole_no_inferrence.move +--- +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/type_hole_no_inferrence.move:3:23 + │ +3 │ let _: vector<_> = vector[]; + │ ^ Could not infer this type. Try adding an annotation + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/type_hole_no_inferrence.move:3:28 + │ +3 │ let _: vector<_> = vector[]; + │ ^^^^^^^^ Could not infer this type. Try adding an annotation + +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/type_hole_no_inferrence.move:4:13 + │ +4 │ any<_>(); + │ ^ Could not infer this type. Try adding an annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_no_inferrence_threaded.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_no_inferrence_threaded.exp deleted file mode 100644 index 3b61691fa969a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_no_inferrence_threaded.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04023]: invalid method call - ┌─ tests/move_2024/typing/type_hole_no_inferrence_threaded.move:8:13 - │ -6 │ let mut c: Cup<_> = any(); - │ - Unable to infer type for method call. Try annotating this type -7 │ loop { -8 │ c.0.x(); - │ ^^^^^^^ Invalid method call - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_no_inferrence_threaded.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_no_inferrence_threaded.snap new file mode 100644 index 0000000000000..4879c9071deb9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/type_hole_no_inferrence_threaded.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/type_hole_no_inferrence_threaded.move +--- +error[E04023]: invalid method call + ┌─ tests/move_2024/typing/type_hole_no_inferrence_threaded.move:8:13 + │ +6 │ let mut c: Cup<_> = any(); + │ - Unable to infer type for method call. Try annotating this type +7 │ loop { +8 │ c.0.x(); + │ ^^^^^^^ Invalid method call diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unknown_defines_primitive.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unknown_defines_primitive.exp deleted file mode 100644 index 7e901764c7b97..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unknown_defines_primitive.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E10004]: invalid usage of known attribute - ┌─ tests/move_2024/typing/unknown_defines_primitive.move:1:21 - │ -1 │ #[defines_primitive(X)] - │ ^ Invalid parameterization of 'defines_primitive'. Unknown primitive type 'X' - -error[E10004]: invalid usage of known attribute - ┌─ tests/move_2024/typing/unknown_defines_primitive.move:6:21 - │ -6 │ #[defines_primitive(Y)] - │ ^ Invalid parameterization of 'defines_primitive'. Unknown primitive type 'Y' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unknown_defines_primitive.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unknown_defines_primitive.snap new file mode 100644 index 0000000000000..0501d57ba1cd8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unknown_defines_primitive.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/unknown_defines_primitive.move +--- +error[E10004]: invalid usage of known attribute + ┌─ tests/move_2024/typing/unknown_defines_primitive.move:1:21 + │ +1 │ #[defines_primitive(X)] + │ ^ Invalid parameterization of 'defines_primitive'. Unknown primitive type 'X' + +error[E10004]: invalid usage of known attribute + ┌─ tests/move_2024/typing/unknown_defines_primitive.move:6:21 + │ +6 │ #[defines_primitive(Y)] + │ ^ Invalid parameterization of 'defines_primitive'. Unknown primitive type 'Y' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_let_mut.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_let_mut.exp deleted file mode 100644 index 6b67b01afa0c9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_let_mut.exp +++ /dev/null @@ -1,30 +0,0 @@ -warning[W09012]: unused 'mut' modifiers - ┌─ tests/move_2024/typing/unused_let_mut.move:4:24 - │ -4 │ public fun foo(mut x: u64, s: S): u64 { - │ --- ^ The variable 'x' is never used mutably - │ │ - │ Consider removing the 'mut' declaration here - │ - = This warning can be suppressed with '#[allow(unused_let_mut)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09012]: unused 'mut' modifiers - ┌─ tests/move_2024/typing/unused_let_mut.move:5:17 - │ -5 │ let mut y = 0; - │ --- ^ The variable 'y' is never used mutably - │ │ - │ Consider removing the 'mut' declaration here - │ - = This warning can be suppressed with '#[allow(unused_let_mut)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09012]: unused 'mut' modifiers - ┌─ tests/move_2024/typing/unused_let_mut.move:6:21 - │ -6 │ let S { mut f } = s; - │ --- ^ The variable 'f' is never used mutably - │ │ - │ Consider removing the 'mut' declaration here - │ - = This warning can be suppressed with '#[allow(unused_let_mut)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_let_mut.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_let_mut.snap new file mode 100644 index 0000000000000..a372449064ba6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_let_mut.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/unused_let_mut.move +--- +warning[W09012]: unused 'mut' modifiers + ┌─ tests/move_2024/typing/unused_let_mut.move:4:24 + │ +4 │ public fun foo(mut x: u64, s: S): u64 { + │ --- ^ The variable 'x' is never used mutably + │ │ + │ Consider removing the 'mut' declaration here + │ + = This warning can be suppressed with '#[allow(unused_let_mut)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09012]: unused 'mut' modifiers + ┌─ tests/move_2024/typing/unused_let_mut.move:5:17 + │ +5 │ let mut y = 0; + │ --- ^ The variable 'y' is never used mutably + │ │ + │ Consider removing the 'mut' declaration here + │ + = This warning can be suppressed with '#[allow(unused_let_mut)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09012]: unused 'mut' modifiers + ┌─ tests/move_2024/typing/unused_let_mut.move:6:21 + │ +6 │ let S { mut f } = s; + │ --- ^ The variable 'f' is never used mutably + │ │ + │ Consider removing the 'mut' declaration here + │ + = This warning can be suppressed with '#[allow(unused_let_mut)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_let_mut_leading_underscore.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_let_mut_leading_underscore.snap new file mode 100644 index 0000000000000..ef1f04b2f22cb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_let_mut_leading_underscore.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/unused_let_mut_leading_underscore.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg.exp deleted file mode 100644 index 66cf7d6eb8ff5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg.exp +++ /dev/null @@ -1,32 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/typing/unused_macro_arg.move:12:17 - │ -12 │ ignore!(None(), || (), None(), || ()); - │ ^^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/typing/unused_macro_arg.move:12:25 - │ -12 │ ignore!(None(), || (), None(), || ()); - │ ^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/typing/unused_macro_arg.move:12:32 - │ -12 │ ignore!(None(), || (), None(), || ()); - │ ^^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/typing/unused_macro_arg.move:12:40 - │ -12 │ ignore!(None(), || (), None(), || ()); - │ ^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg.snap new file mode 100644 index 0000000000000..69dbf7516aacb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/unused_macro_arg.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/typing/unused_macro_arg.move:12:17 + │ +12 │ ignore!(None(), || (), None(), || ()); + │ ^^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/typing/unused_macro_arg.move:12:25 + │ +12 │ ignore!(None(), || (), None(), || ()); + │ ^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/typing/unused_macro_arg.move:12:32 + │ +12 │ ignore!(None(), || (), None(), || ()); + │ ^^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/typing/unused_macro_arg.move:12:40 + │ +12 │ ignore!(None(), || (), None(), || ()); + │ ^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg_affects_inference.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg_affects_inference.exp deleted file mode 100644 index 06210a7b85891..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg_affects_inference.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E04010]: cannot infer type - ┌─ tests/move_2024/typing/unused_macro_arg_affects_inference.move:14:9 - │ -14 │ X().foo!(None()) - │ ^^^ Could not infer this type. Try adding an annotation - -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/typing/unused_macro_arg_affects_inference.move:14:18 - │ -14 │ X().foo!(None()) - │ ^^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg_affects_inference.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg_affects_inference.snap new file mode 100644 index 0000000000000..e39c055902bdd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg_affects_inference.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/unused_macro_arg_affects_inference.move +--- +error[E04010]: cannot infer type + ┌─ tests/move_2024/typing/unused_macro_arg_affects_inference.move:14:9 + │ +14 │ X().foo!(None()) + │ ^^^ Could not infer this type. Try adding an annotation + +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/typing/unused_macro_arg_affects_inference.move:14:18 + │ +14 │ X().foo!(None()) + │ ^^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg_invalid_constraint.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg_invalid_constraint.exp deleted file mode 100644 index 8e2fa596f0fed..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg_invalid_constraint.exp +++ /dev/null @@ -1,32 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/typing/unused_macro_arg_invalid_constraint.move:16:21 - │ -16 │ needs_copy!(X(), None(), X(), None()); - │ ^^^^^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/typing/unused_macro_arg_invalid_constraint.move:16:32 - │ -16 │ needs_copy!(X(), None(), X(), None()); - │ ^^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/typing/unused_macro_arg_invalid_constraint.move:16:40 - │ -16 │ needs_copy!(X(), None(), X(), None()); - │ ^^^^^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/typing/unused_macro_arg_invalid_constraint.move:16:51 - │ -16 │ needs_copy!(X(), None(), X(), None()); - │ ^^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg_invalid_constraint.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg_invalid_constraint.snap new file mode 100644 index 0000000000000..cc445ef75aaf3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg_invalid_constraint.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/unused_macro_arg_invalid_constraint.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/typing/unused_macro_arg_invalid_constraint.move:16:21 + │ +16 │ needs_copy!(X(), None(), X(), None()); + │ ^^^^^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/typing/unused_macro_arg_invalid_constraint.move:16:32 + │ +16 │ needs_copy!(X(), None(), X(), None()); + │ ^^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/typing/unused_macro_arg_invalid_constraint.move:16:40 + │ +16 │ needs_copy!(X(), None(), X(), None()); + │ ^^^^^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/typing/unused_macro_arg_invalid_constraint.move:16:51 + │ +16 │ needs_copy!(X(), None(), X(), None()); + │ ^^^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg_method_call.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg_method_call.exp deleted file mode 100644 index b8ef1fad55728..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg_method_call.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_2024/typing/unused_macro_arg_method_call.move:5:9 - │ -2 │ public struct None() - │ ---- To satisfy the constraint, the 'drop' ability would need to be added here - · -5 │ _: None, - │ ^ Cannot ignore values without the 'drop' ability. The value must be used - · -9 │ None().ignore!() - │ ------ The type 'a::m::None' does not have the ability 'drop' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg_method_call.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg_method_call.snap new file mode 100644 index 0000000000000..ef3e6ff5d0871 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_macro_arg_method_call.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/unused_macro_arg_method_call.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_2024/typing/unused_macro_arg_method_call.move:5:9 + │ +2 │ public struct None() + │ ---- To satisfy the constraint, the 'drop' ability would need to be added here + · +5 │ _: None, + │ ^ Cannot ignore values without the 'drop' ability. The value must be used + · +9 │ None().ignore!() + │ ------ The type 'a::m::None' does not have the ability 'drop' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_use_fun.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_use_fun.exp deleted file mode 100644 index e23027ddbad0f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_use_fun.exp +++ /dev/null @@ -1,35 +0,0 @@ -warning[W09001]: unused alias - ┌─ tests/move_2024/typing/unused_use_fun.move:5:5 - │ -5 │ use fun foo as u64.f; - │ ^^^^^^^^^^^^^^^^^^^^^ Unused 'use fun' of 'u64.f'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_2024/typing/unused_use_fun.move:8:26 - │ -8 │ use a::m::foo as f; - │ ^ Unused 'use' of alias 'f'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W02021]: duplicate alias - ┌─ tests/move_2024/typing/unused_use_fun.move:22:27 - │ -19 │ use a::x::drop as f; - │ - The same alias was previously declared here - · -22 │ use a::x::drop as f; - │ ^ Unnecessary alias 'f' for module member 'a::x::drop'. It was already in scope - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_2024/typing/unused_use_fun.move:22:27 - │ -22 │ use a::x::drop as f; - │ ^ Unused 'use' of alias 'f'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_use_fun.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_use_fun.snap new file mode 100644 index 0000000000000..31a3be62b37fd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_use_fun.snap @@ -0,0 +1,42 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/unused_use_fun.move +--- +warning[W09001]: unused alias + ┌─ tests/move_2024/typing/unused_use_fun.move:5:5 + │ +5 │ use fun foo as u64.f; + │ ^^^^^^^^^^^^^^^^^^^^^ Unused 'use fun' of 'u64.f'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/typing/unused_use_fun.move:8:26 + │ +8 │ use a::m::foo as f; + │ ^ Unused 'use' of alias 'f'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W02021]: duplicate alias + ┌─ tests/move_2024/typing/unused_use_fun.move:22:27 + │ +19 │ use a::x::drop as f; + │ - The same alias was previously declared here + · +22 │ use a::x::drop as f; + │ ^ Unnecessary alias 'f' for module member 'a::x::drop'. It was already in scope + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/typing/unused_use_fun.move:22:27 + │ +22 │ use a::x::drop as f; + │ ^ Unused 'use' of alias 'f'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_use_fun_silenced_by_macros.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_use_fun_silenced_by_macros.exp deleted file mode 100644 index 2bc6dd43d8173..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_use_fun_silenced_by_macros.exp +++ /dev/null @@ -1,38 +0,0 @@ -warning[W02021]: duplicate alias - ┌─ tests/move_2024/typing/unused_use_fun_silenced_by_macros.move:9:9 - │ -5 │ use fun foo as u64.f; - │ --------------------- The same alias was previously declared here - · -9 │ use fun foo as u64.f; - │ ^^^^^^^^^^^^^^^^^^^^^ Duplicate method alias 'u64.f' for 'a::m::foo' - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_2024/typing/unused_use_fun_silenced_by_macros.move:9:9 - │ -9 │ use fun foo as u64.f; - │ ^^^^^^^^^^^^^^^^^^^^^ Unused 'use fun' of 'u64.f'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W02021]: duplicate alias - ┌─ tests/move_2024/typing/unused_use_fun_silenced_by_macros.move:27:27 - │ -23 │ use a::x::drop as f; - │ - The same alias was previously declared here - · -27 │ use a::x::drop as f; - │ ^ Unnecessary alias 'f' for module member 'a::x::drop'. It was already in scope - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_2024/typing/unused_use_fun_silenced_by_macros.move:27:27 - │ -27 │ use a::x::drop as f; - │ ^ Unused 'use' of alias 'f'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_use_fun_silenced_by_macros.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_use_fun_silenced_by_macros.snap new file mode 100644 index 0000000000000..309dbe205ea89 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/unused_use_fun_silenced_by_macros.snap @@ -0,0 +1,45 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/unused_use_fun_silenced_by_macros.move +--- +warning[W02021]: duplicate alias + ┌─ tests/move_2024/typing/unused_use_fun_silenced_by_macros.move:9:9 + │ +5 │ use fun foo as u64.f; + │ --------------------- The same alias was previously declared here + · +9 │ use fun foo as u64.f; + │ ^^^^^^^^^^^^^^^^^^^^^ Duplicate method alias 'u64.f' for 'a::m::foo' + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/typing/unused_use_fun_silenced_by_macros.move:9:9 + │ +9 │ use fun foo as u64.f; + │ ^^^^^^^^^^^^^^^^^^^^^ Unused 'use fun' of 'u64.f'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W02021]: duplicate alias + ┌─ tests/move_2024/typing/unused_use_fun_silenced_by_macros.move:27:27 + │ +23 │ use a::x::drop as f; + │ - The same alias was previously declared here + · +27 │ use a::x::drop as f; + │ ^ Unnecessary alias 'f' for module member 'a::x::drop'. It was already in scope + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_2024/typing/unused_use_fun_silenced_by_macros.move:27:27 + │ +27 │ use a::x::drop as f; + │ ^ Unused 'use' of alias 'f'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/use_lambda_outside_call_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_2024/typing/use_lambda_outside_call_invalid.exp deleted file mode 100644 index 7f7bb1031686e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/typing/use_lambda_outside_call_invalid.exp +++ /dev/null @@ -1,44 +0,0 @@ -error[E04031]: invalid usage of lambda - ┌─ tests/move_2024/typing/use_lambda_outside_call_invalid.move:3:17 - │ -3 │ let x = $f; - │ ^^ Lambdas can only be used directly as arguments to 'macro' functions - -error[E04029]: invalid function call - ┌─ tests/move_2024/typing/use_lambda_outside_call_invalid.move:4:9 - │ -4 │ x(); - │ ^ Unexpected invocation of parameter or local 'x'. Non-syntax variables cannot be invoked as functions - │ - = Only macro syntax variables, e.g. '$x', may be invoked as functions. - -error[E02010]: invalid name - ┌─ tests/move_2024/typing/use_lambda_outside_call_invalid.move:7:23 - │ -7 │ macro fun bar(mut f: || -> u64) { - │ ----- ^ Invalid parameter name 'f'. 'macro' parameter names must start with '$' (or must be '_') - │ │ - │ Declared 'macro' here - │ - = 'macro' parameters start with '$' to indicate that their arguments are not evaluated before the macro is expanded, meaning the entire expression is substituted. This is different from regular function parameters that are evaluated before the function is called. - -error[E04031]: invalid usage of lambda - ┌─ tests/move_2024/typing/use_lambda_outside_call_invalid.move:8:13 - │ -8 │ f = || 0; - │ ^^^^ Lambdas can only be used directly as arguments to 'macro' functions - -warning[W09005]: dead or unreachable code - ┌─ tests/move_2024/typing/use_lambda_outside_call_invalid.move:17:14 - │ -17 │ bar!(|| 0); - │ ^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04032]: unable to expand macro function - ┌─ tests/move_2024/typing/use_lambda_outside_call_invalid.move:18:14 - │ -18 │ foo!(baz!(|| || 0)); - │ ^^^^^^^^^^^^^ Unable to bind lambda to parameter '$f'. The lambda must be passed directly - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/use_lambda_outside_call_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/use_lambda_outside_call_invalid.snap new file mode 100644 index 0000000000000..2a932b7d11ab2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/use_lambda_outside_call_invalid.snap @@ -0,0 +1,51 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/use_lambda_outside_call_invalid.move +--- +error[E04031]: invalid usage of lambda + ┌─ tests/move_2024/typing/use_lambda_outside_call_invalid.move:3:17 + │ +3 │ let x = $f; + │ ^^ Lambdas can only be used directly as arguments to 'macro' functions + +error[E04029]: invalid function call + ┌─ tests/move_2024/typing/use_lambda_outside_call_invalid.move:4:9 + │ +4 │ x(); + │ ^ Unexpected invocation of parameter or local 'x'. Non-syntax variables cannot be invoked as functions + │ + = Only macro syntax variables, e.g. '$x', may be invoked as functions. + +error[E02010]: invalid name + ┌─ tests/move_2024/typing/use_lambda_outside_call_invalid.move:7:23 + │ +7 │ macro fun bar(mut f: || -> u64) { + │ ----- ^ Invalid parameter name 'f'. 'macro' parameter names must start with '$' (or must be '_') + │ │ + │ Declared 'macro' here + │ + = 'macro' parameters start with '$' to indicate that their arguments are not evaluated before the macro is expanded, meaning the entire expression is substituted. This is different from regular function parameters that are evaluated before the function is called. + +error[E04031]: invalid usage of lambda + ┌─ tests/move_2024/typing/use_lambda_outside_call_invalid.move:8:13 + │ +8 │ f = || 0; + │ ^^^^ Lambdas can only be used directly as arguments to 'macro' functions + +warning[W09005]: dead or unreachable code + ┌─ tests/move_2024/typing/use_lambda_outside_call_invalid.move:17:14 + │ +17 │ bar!(|| 0); + │ ^^^^ Unused macro argument. Its expression will not be type checked and it will not evaluated + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04032]: unable to expand macro function + ┌─ tests/move_2024/typing/use_lambda_outside_call_invalid.move:18:14 + │ +18 │ foo!(baz!(|| || 0)); + │ ^^^^^^^^^^^^^ Unable to bind lambda to parameter '$f'. The lambda must be passed directly diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/use_lambda_outside_call_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/use_lambda_outside_call_valid.snap new file mode 100644 index 0000000000000..bca5ae96d0ddb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/use_lambda_outside_call_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/use_lambda_outside_call_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/typing/wildcard_okay_at.snap b/external-crates/move/crates/move-compiler/tests/move_2024/typing/wildcard_okay_at.snap new file mode 100644 index 0000000000000..237e27c7fbd23 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/typing/wildcard_okay_at.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/typing/wildcard_okay_at.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/cross_module_members_non_test_function.exp b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/cross_module_members_non_test_function.exp deleted file mode 100644 index 0e11bd22a243a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/cross_module_members_non_test_function.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E03004]: unbound type - ┌─ tests/move_2024/unit_test/cross_module_members_non_test_function.move:22:23 - │ -22 │ public fun bad(): Foo { - │ ^^^ Unbound type 'Foo' in current scope - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/unit_test/cross_module_members_non_test_function.move:23:9 - │ -23 │ P::build_foo() - │ ^ Could not resolve the name 'P' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/cross_module_members_non_test_function.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/cross_module_members_non_test_function.snap new file mode 100644 index 0000000000000..c4e9cf376bbc0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/cross_module_members_non_test_function.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/cross_module_members_non_test_function.move +--- +error[E03004]: unbound type + ┌─ tests/move_2024/unit_test/cross_module_members_non_test_function.move:22:23 + │ +22 │ public fun bad(): Foo { + │ ^^^ Unbound type 'Foo' in current scope + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/unit_test/cross_module_members_non_test_function.move:23:9 + │ +23 │ P::build_foo() + │ ^ Could not resolve the name 'P' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/cross_module_members_non_test_function@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/cross_module_members_non_test_function@unit_test.snap new file mode 100644 index 0000000000000..af9f83380fdcf --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/cross_module_members_non_test_function@unit_test.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/cross_module_members_non_test_function.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/cross_module_test_only_module.exp b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/cross_module_test_only_module.exp deleted file mode 100644 index ba97e758bf6f5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/cross_module_test_only_module.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/move_2024/unit_test/cross_module_test_only_module.move:9:9 - │ -9 │ use 0x1::M; - │ ^^^^^^ Invalid 'use'. Unbound module: '0x1::M' - -error[E03006]: unexpected name in this position - ┌─ tests/move_2024/unit_test/cross_module_test_only_module.move:12:9 - │ -12 │ M::foo() - │ ^^^^^^ Unexpected module identifier. A module identifier is not a valid expression - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/cross_module_test_only_module.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/cross_module_test_only_module.snap new file mode 100644 index 0000000000000..bc1f4e4a74976 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/cross_module_test_only_module.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/cross_module_test_only_module.move +--- +error[E03002]: unbound module + ┌─ tests/move_2024/unit_test/cross_module_test_only_module.move:9:9 + │ +9 │ use 0x1::M; + │ ^^^^^^ Invalid 'use'. Unbound module: '0x1::M' + +error[E03006]: unexpected name in this position + ┌─ tests/move_2024/unit_test/cross_module_test_only_module.move:12:9 + │ +12 │ M::foo() + │ ^^^^^^ Unexpected module identifier. A module identifier is not a valid expression diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/cross_module_test_only_module@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/cross_module_test_only_module@unit_test.snap new file mode 100644 index 0000000000000..538e387722551 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/cross_module_test_only_module@unit_test.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/cross_module_test_only_module.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants.snap new file mode 100644 index 0000000000000..1d375afeffd89 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants@unit_test.snap new file mode 100644 index 0000000000000..1d375afeffd89 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants@unit_test.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module.snap new file mode 100644 index 0000000000000..ec071384f3d32 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module@unit_test.snap new file mode 100644 index 0000000000000..ec071384f3d32 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module@unit_test.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module_invalid.snap new file mode 100644 index 0000000000000..5f7e06863683b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module_invalid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module_invalid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module_invalid.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module_invalid.unit_test.exp deleted file mode 100644 index b64b42eec13f3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module_invalid.unit_test.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E10003]: invalid attribute value - ┌─ tests/move_2024/unit_test/expected_failure_constants_shadowed_module_invalid.move:10:24 - │ -10 │ #[expected_failure(abort_code=a::a::C)] - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Unsupported value in this assignment - │ Invalid value in attribute assignment - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module_invalid@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module_invalid@unit_test.snap new file mode 100644 index 0000000000000..2aa24c9e2e871 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module_invalid@unit_test.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/expected_failure_constants_shadowed_module_invalid.move +--- +error[E10003]: invalid attribute value + ┌─ tests/move_2024/unit_test/expected_failure_constants_shadowed_module_invalid.move:10:24 + │ +10 │ #[expected_failure(abort_code=a::a::C)] + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Unsupported value in this assignment + │ Invalid value in attribute assignment diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/other_failures_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/other_failures_valid.snap new file mode 100644 index 0000000000000..df19094d563ee --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/other_failures_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/other_failures_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/other_failures_valid@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/other_failures_valid@unit_test.snap new file mode 100644 index 0000000000000..df19094d563ee --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/other_failures_valid@unit_test.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/other_failures_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_invalid.snap new file mode 100644 index 0000000000000..66deaced8d783 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_invalid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/random_test_invalid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_invalid.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_invalid.unit_test.exp deleted file mode 100644 index 5b3459541422d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_invalid.unit_test.exp +++ /dev/null @@ -1,66 +0,0 @@ -error[E10005]: unable to generate test - ┌─ tests/move_2024/unit_test/random_test_invalid.move:4:7 - │ -4 │ #[random_test] - │ ^^^^^^^^^^^ No parameters to generate for random test. A #[random_test] function must have at least one parameter to generate. -5 │ fun foo() { } - │ --- Error found in this test - -error[E10003]: invalid attribute value - ┌─ tests/move_2024/unit_test/random_test_invalid.move:7:23 - │ -7 │ #[random_test(b = 1)] - │ ----^ - │ │ │ - │ │ Unsupported attribute value - │ Assigned in this attribute - -error[E10004]: invalid usage of known attribute - ┌─ tests/move_2024/unit_test/random_test_invalid.move:10:7 - │ -10 │ #[random_test] - │ ^^^^^^^^^^^ Function annotated as both #[test] and #[random_test]. You need to declare it as either one or the other -11 │ #[test] - │ ---- Previously annotated here -12 │ fun qux(_c: u64, _d: bool) { } - │ --- Error found in this test - -error[E10004]: invalid usage of known attribute - ┌─ tests/move_2024/unit_test/random_test_invalid.move:14:7 - │ -14 │ #[random_test] - │ ^^^^^^^^^^^ Function annotated as both #[test] and #[random_test]. You need to declare it as either one or the other -15 │ #[test] - │ ---- Previously annotated here -16 │ fun quxz() { } - │ ---- Error found in this test - -error[E10005]: unable to generate test - ┌─ tests/move_2024/unit_test/random_test_invalid.move:18:7 - │ -18 │ #[random_test] - │ ^^^^^^^^^^^ No parameters to generate for random test. A #[random_test] function must have at least one parameter to generate. -19 │ #[test_only] -20 │ fun bar() { } - │ --- Error found in this test - -error[E10004]: invalid usage of known attribute - ┌─ tests/move_2024/unit_test/random_test_invalid.move:19:7 - │ -18 │ #[random_test] - │ ----------- Previously annotated here -19 │ #[test_only] - │ ^^^^^^^^^ Function annotated as both #[test] and #[test_only]. You need to declare it as either one or the other -20 │ fun bar() { } - │ --- Error found in this test - -error[E10005]: unable to generate test - ┌─ tests/move_2024/unit_test/random_test_invalid.move:24:16 - │ -24 │ fun baz(_: X) { } - │ --- ^ Unsupported type for generated input for test. Only built-in types are supported for generated test inputs - │ │ - │ Error found in this test - │ - = Supported builti-in types are: bool, u8, u16, u32, u64, u128, u256, address, and vector where T is a built-in type - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_invalid@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_invalid@unit_test.snap new file mode 100644 index 0000000000000..27d5665e275c0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_invalid@unit_test.snap @@ -0,0 +1,73 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/random_test_invalid.move +--- +error[E10005]: unable to generate test + ┌─ tests/move_2024/unit_test/random_test_invalid.move:4:7 + │ +4 │ #[random_test] + │ ^^^^^^^^^^^ No parameters to generate for random test. A #[random_test] function must have at least one parameter to generate. +5 │ fun foo() { } + │ --- Error found in this test + +error[E10003]: invalid attribute value + ┌─ tests/move_2024/unit_test/random_test_invalid.move:7:23 + │ +7 │ #[random_test(b = 1)] + │ ----^ + │ │ │ + │ │ Unsupported attribute value + │ Assigned in this attribute + +error[E10004]: invalid usage of known attribute + ┌─ tests/move_2024/unit_test/random_test_invalid.move:10:7 + │ +10 │ #[random_test] + │ ^^^^^^^^^^^ Function annotated as both #[test] and #[random_test]. You need to declare it as either one or the other +11 │ #[test] + │ ---- Previously annotated here +12 │ fun qux(_c: u64, _d: bool) { } + │ --- Error found in this test + +error[E10004]: invalid usage of known attribute + ┌─ tests/move_2024/unit_test/random_test_invalid.move:14:7 + │ +14 │ #[random_test] + │ ^^^^^^^^^^^ Function annotated as both #[test] and #[random_test]. You need to declare it as either one or the other +15 │ #[test] + │ ---- Previously annotated here +16 │ fun quxz() { } + │ ---- Error found in this test + +error[E10005]: unable to generate test + ┌─ tests/move_2024/unit_test/random_test_invalid.move:18:7 + │ +18 │ #[random_test] + │ ^^^^^^^^^^^ No parameters to generate for random test. A #[random_test] function must have at least one parameter to generate. +19 │ #[test_only] +20 │ fun bar() { } + │ --- Error found in this test + +error[E10004]: invalid usage of known attribute + ┌─ tests/move_2024/unit_test/random_test_invalid.move:19:7 + │ +18 │ #[random_test] + │ ----------- Previously annotated here +19 │ #[test_only] + │ ^^^^^^^^^ Function annotated as both #[test] and #[test_only]. You need to declare it as either one or the other +20 │ fun bar() { } + │ --- Error found in this test + +error[E10005]: unable to generate test + ┌─ tests/move_2024/unit_test/random_test_invalid.move:24:16 + │ +24 │ fun baz(_: X) { } + │ --- ^ Unsupported type for generated input for test. Only built-in types are supported for generated test inputs + │ │ + │ Error found in this test + │ + = Supported builti-in types are: bool, u8, u16, u32, u64, u128, u256, address, and vector where T is a built-in type diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_member_filtering.exp b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_member_filtering.exp deleted file mode 100644 index 4b8bb99bb83f9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_member_filtering.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03003]: unbound module member - ┌─ tests/move_2024/unit_test/random_test_member_filtering.move:7:22 - │ -7 │ public fun g() { 0x1::f::f(0); } - │ ^^^^^^^^^ Invalid module access. Unbound function 'f' in module '0x1::f' - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_member_filtering.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_member_filtering.snap new file mode 100644 index 0000000000000..598b028084e00 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_member_filtering.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/random_test_member_filtering.move +--- +error[E03003]: unbound module member + ┌─ tests/move_2024/unit_test/random_test_member_filtering.move:7:22 + │ +7 │ public fun g() { 0x1::f::f(0); } + │ ^^^^^^^^^ Invalid module access. Unbound function 'f' in module '0x1::f' diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_member_filtering@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_member_filtering@unit_test.snap new file mode 100644 index 0000000000000..a2600f3a74652 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_member_filtering@unit_test.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/random_test_member_filtering.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_not_rand_test_attr.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_not_rand_test_attr.snap new file mode 100644 index 0000000000000..777c433fc4f59 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_not_rand_test_attr.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/random_test_not_rand_test_attr.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_not_rand_test_attr.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_not_rand_test_attr.unit_test.exp deleted file mode 100644 index 996dc3589766a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_not_rand_test_attr.unit_test.exp +++ /dev/null @@ -1,50 +0,0 @@ -error[E10005]: unable to generate test - ┌─ tests/move_2024/unit_test/random_test_not_rand_test_attr.move:2:7 - │ -2 │ #[test] - │ ^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute -3 │ fun foo(a: u64) { - │ --- - Corresponding to this parameter - │ │ - │ Error found in this test - -error[E10005]: unable to generate test - ┌─ tests/move_2024/unit_test/random_test_not_rand_test_attr.move:7:7 - │ -7 │ #[test, expected_failure] - │ ^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute -8 │ fun go(b: u64) { - │ -- - Corresponding to this parameter - │ │ - │ Error found in this test - -error[E10005]: unable to generate test - ┌─ tests/move_2024/unit_test/random_test_not_rand_test_attr.move:12:7 - │ -12 │ #[test] - │ ^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute -13 │ fun qux(c: u64, d: bool) { - │ --- - Corresponding to this parameter - │ │ - │ Error found in this test - -error[E10005]: unable to generate test - ┌─ tests/move_2024/unit_test/random_test_not_rand_test_attr.move:12:7 - │ -12 │ #[test] - │ ^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute -13 │ fun qux(c: u64, d: bool) { - │ --- - Corresponding to this parameter - │ │ - │ Error found in this test - -error[E10005]: unable to generate test - ┌─ tests/move_2024/unit_test/random_test_not_rand_test_attr.move:18:7 - │ -18 │ #[test] - │ ^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute -19 │ fun qux_vec(c: vector) { - │ ------- - Corresponding to this parameter - │ │ - │ Error found in this test - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_not_rand_test_attr@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_not_rand_test_attr@unit_test.snap new file mode 100644 index 0000000000000..f3a541917a044 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_not_rand_test_attr@unit_test.snap @@ -0,0 +1,57 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/random_test_not_rand_test_attr.move +--- +error[E10005]: unable to generate test + ┌─ tests/move_2024/unit_test/random_test_not_rand_test_attr.move:2:7 + │ +2 │ #[test] + │ ^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute +3 │ fun foo(a: u64) { + │ --- - Corresponding to this parameter + │ │ + │ Error found in this test + +error[E10005]: unable to generate test + ┌─ tests/move_2024/unit_test/random_test_not_rand_test_attr.move:7:7 + │ +7 │ #[test, expected_failure] + │ ^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute +8 │ fun go(b: u64) { + │ -- - Corresponding to this parameter + │ │ + │ Error found in this test + +error[E10005]: unable to generate test + ┌─ tests/move_2024/unit_test/random_test_not_rand_test_attr.move:12:7 + │ +12 │ #[test] + │ ^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute +13 │ fun qux(c: u64, d: bool) { + │ --- - Corresponding to this parameter + │ │ + │ Error found in this test + +error[E10005]: unable to generate test + ┌─ tests/move_2024/unit_test/random_test_not_rand_test_attr.move:12:7 + │ +12 │ #[test] + │ ^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute +13 │ fun qux(c: u64, d: bool) { + │ --- - Corresponding to this parameter + │ │ + │ Error found in this test + +error[E10005]: unable to generate test + ┌─ tests/move_2024/unit_test/random_test_not_rand_test_attr.move:18:7 + │ +18 │ #[test] + │ ^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute +19 │ fun qux_vec(c: vector) { + │ ------- - Corresponding to this parameter + │ │ + │ Error found in this test diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_valid.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_valid.snap new file mode 100644 index 0000000000000..984a1437b6fa2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/random_test_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_valid@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_valid@unit_test.snap new file mode 100644 index 0000000000000..984a1437b6fa2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_valid@unit_test.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/random_test_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_valid@unused.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_valid@unused.snap new file mode 100644 index 0000000000000..984a1437b6fa2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/random_test_valid@unused.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/random_test_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/test_only_use_fun.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/test_only_use_fun.snap new file mode 100644 index 0000000000000..def740b690af4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/test_only_use_fun.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/test_only_use_fun.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/test_only_use_fun.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/test_only_use_fun.unit_test.exp deleted file mode 100644 index f03ead117266c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/test_only_use_fun.unit_test.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W09001]: unused alias - ┌─ tests/move_2024/unit_test/test_only_use_fun.move:6:5 - │ -6 │ use fun foo as X.f; - │ ^^^^^^^^^^^^^^^^^^^ Unused 'use fun' of 'a::m::X.f'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/test_only_use_fun@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/test_only_use_fun@unit_test.snap new file mode 100644 index 0000000000000..669b5eb37aeeb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/unit_test/test_only_use_fun@unit_test.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/unit_test/test_only_use_fun.move +--- +warning[W09001]: unused alias + ┌─ tests/move_2024/unit_test/test_only_use_fun.move:6:5 + │ +6 │ use fun foo as X.f; + │ ^^^^^^^^^^^^^^^^^^^ Unused 'use fun' of 'a::m::X.f'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/warning_suppression/allow_on_use_fun.exp b/external-crates/move/crates/move-compiler/tests/move_2024/warning_suppression/allow_on_use_fun.exp deleted file mode 100644 index 984af6db257d1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_2024/warning_suppression/allow_on_use_fun.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E02015]: invalid attribute - ┌─ tests/move_2024/warning_suppression/allow_on_use_fun.move:2:7 - │ -2 │ #[allow(unused)] - │ ^^^^^ - │ │ - │ Known attribute 'allow' is not expected with a use - │ Expected to be used with one of the following: module, constant, struct, enum, function - -error[E02017]: invalid 'use fun' declaration - ┌─ tests/move_2024/warning_suppression/allow_on_use_fun.move:3:5 - │ -3 │ use fun foo as X.f; - │ ^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::X.f'. Expected a 'a::m::X' type as the first argument (either by reference '&' '&mut' or by value) -4 │ public struct X {} -5 │ fun foo() {} - │ --- But 'a::m::foo' takes no arguments - diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/warning_suppression/allow_on_use_fun.snap b/external-crates/move/crates/move-compiler/tests/move_2024/warning_suppression/allow_on_use_fun.snap new file mode 100644 index 0000000000000..4205fbd86e3f8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/warning_suppression/allow_on_use_fun.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/warning_suppression/allow_on_use_fun.move +--- +error[E02015]: invalid attribute + ┌─ tests/move_2024/warning_suppression/allow_on_use_fun.move:2:7 + │ +2 │ #[allow(unused)] + │ ^^^^^ + │ │ + │ Known attribute 'allow' is not expected with a use + │ Expected to be used with one of the following: module, constant, struct, enum, function + +error[E02017]: invalid 'use fun' declaration + ┌─ tests/move_2024/warning_suppression/allow_on_use_fun.move:3:5 + │ +3 │ use fun foo as X.f; + │ ^^^^^^^^^^^^^^^^^^^ Invalid 'use fun' for 'a::m::X.f'. Expected a 'a::m::X' type as the first argument (either by reference '&' '&mut' or by value) +4 │ public struct X {} +5 │ fun foo() {} + │ --- But 'a::m::foo' takes no arguments diff --git a/external-crates/move/crates/move-compiler/tests/move_2024/warning_suppression/unused_use_fun.snap b/external-crates/move/crates/move-compiler/tests/move_2024/warning_suppression/unused_use_fun.snap new file mode 100644 index 0000000000000..666e70c78f8cf --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_2024/warning_suppression/unused_use_fun.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/move_2024/warning_suppression/unused_use_fun.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_combo.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_combo.snap new file mode 100644 index 0000000000000..7b463ea69e20a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_combo.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/assign_local_combo.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_combo_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_combo_invalid.exp deleted file mode 100644 index 52c98ff5454ee..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_combo_invalid.exp +++ /dev/null @@ -1,40 +0,0 @@ -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/assign_local_combo_invalid.move:14:9 - │ -13 │ if (cond) f = &s.f else f = &s.g; - │ ---- It is still being borrowed by this reference -14 │ s = S { f: 0, g: 0 }; - │ ^ Invalid assignment of variable 's' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/assign_local_combo_invalid.move:23:9 - │ -22 │ if (cond) f = &mut s.f else f = &mut other.f; - │ -------- It is still being mutably borrowed by this reference -23 │ s = S { f: 0, g: 0 }; - │ ^ Invalid assignment of variable 's' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/assign_local_combo_invalid.move:32:9 - │ -31 │ if (cond) f = &mut s else f = other; - │ ------ It is still being mutably borrowed by this reference -32 │ s = S { f: 0, g: 0 }; - │ ^ Invalid assignment of variable 's' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/assign_local_combo_invalid.move:41:9 - │ -40 │ if (cond) f = id_mut(&mut s) else f = other; - │ -------------- It is still being mutably borrowed by this reference -41 │ s = S { f: 0, g: 0 }; - │ ^ Invalid assignment of variable 's' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/assign_local_combo_invalid.move:49:19 - │ -48 │ let f = &s.f; - │ ---- It is still being borrowed by this reference -49 │ if (cond) s = S { f: 0, g: 0 }; - │ ^ Invalid assignment of variable 's' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_combo_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_combo_invalid.snap new file mode 100644 index 0000000000000..7ddd0b84a3c3e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_combo_invalid.snap @@ -0,0 +1,47 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/assign_local_combo_invalid.move +--- +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/assign_local_combo_invalid.move:14:9 + │ +13 │ if (cond) f = &s.f else f = &s.g; + │ ---- It is still being borrowed by this reference +14 │ s = S { f: 0, g: 0 }; + │ ^ Invalid assignment of variable 's' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/assign_local_combo_invalid.move:23:9 + │ +22 │ if (cond) f = &mut s.f else f = &mut other.f; + │ -------- It is still being mutably borrowed by this reference +23 │ s = S { f: 0, g: 0 }; + │ ^ Invalid assignment of variable 's' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/assign_local_combo_invalid.move:32:9 + │ +31 │ if (cond) f = &mut s else f = other; + │ ------ It is still being mutably borrowed by this reference +32 │ s = S { f: 0, g: 0 }; + │ ^ Invalid assignment of variable 's' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/assign_local_combo_invalid.move:41:9 + │ +40 │ if (cond) f = id_mut(&mut s) else f = other; + │ -------------- It is still being mutably borrowed by this reference +41 │ s = S { f: 0, g: 0 }; + │ ^ Invalid assignment of variable 's' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/assign_local_combo_invalid.move:49:19 + │ +48 │ let f = &s.f; + │ ---- It is still being borrowed by this reference +49 │ if (cond) s = S { f: 0, g: 0 }; + │ ^ Invalid assignment of variable 's' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_field.snap new file mode 100644 index 0000000000000..a961fedb0f121 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_field.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/assign_local_field.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_field_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_field_invalid.exp deleted file mode 100644 index 831c66509b2d0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_field_invalid.exp +++ /dev/null @@ -1,32 +0,0 @@ -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/assign_local_field_invalid.move:13:9 - │ -12 │ let f = &s.f; - │ ---- It is still being borrowed by this reference -13 │ s = S { f: 0, g: 0 }; - │ ^ Invalid assignment of variable 's' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/assign_local_field_invalid.move:19:9 - │ -18 │ let f = &mut s.f; - │ -------- It is still being mutably borrowed by this reference -19 │ s = S { f: 0, g: 0 }; - │ ^ Invalid assignment of variable 's' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/assign_local_field_invalid.move:25:9 - │ -24 │ let f = id(&s.f); - │ -------- It is still being borrowed by this reference -25 │ s = S { f: 0, g: 0 }; - │ ^ Invalid assignment of variable 's' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/assign_local_field_invalid.move:31:9 - │ -30 │ let f = id_mut(&mut s.f); - │ ---------------- It is still being mutably borrowed by this reference -31 │ s = S { f: 0, g: 0 }; - │ ^ Invalid assignment of variable 's' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_field_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_field_invalid.snap new file mode 100644 index 0000000000000..ae290b09105d5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_field_invalid.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/assign_local_field_invalid.move +--- +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/assign_local_field_invalid.move:13:9 + │ +12 │ let f = &s.f; + │ ---- It is still being borrowed by this reference +13 │ s = S { f: 0, g: 0 }; + │ ^ Invalid assignment of variable 's' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/assign_local_field_invalid.move:19:9 + │ +18 │ let f = &mut s.f; + │ -------- It is still being mutably borrowed by this reference +19 │ s = S { f: 0, g: 0 }; + │ ^ Invalid assignment of variable 's' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/assign_local_field_invalid.move:25:9 + │ +24 │ let f = id(&s.f); + │ -------- It is still being borrowed by this reference +25 │ s = S { f: 0, g: 0 }; + │ ^ Invalid assignment of variable 's' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/assign_local_field_invalid.move:31:9 + │ +30 │ let f = id_mut(&mut s.f); + │ ---------------- It is still being mutably borrowed by this reference +31 │ s = S { f: 0, g: 0 }; + │ ^ Invalid assignment of variable 's' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_full.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_full.snap new file mode 100644 index 0000000000000..104d96b1ea7a8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_full.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/assign_local_full.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_full_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_full_invalid.exp deleted file mode 100644 index 348b5a22f0fd7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_full_invalid.exp +++ /dev/null @@ -1,32 +0,0 @@ -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/assign_local_full_invalid.move:13:9 - │ -12 │ let f = &x; - │ -- It is still being borrowed by this reference -13 │ x = 0; - │ ^ Invalid assignment of variable 'x' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/assign_local_full_invalid.move:19:9 - │ -18 │ let f = &mut x; - │ ------ It is still being mutably borrowed by this reference -19 │ x = 0; - │ ^ Invalid assignment of variable 'x' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/assign_local_full_invalid.move:25:9 - │ -24 │ let f = id(&x); - │ ------ It is still being borrowed by this reference -25 │ x = 0; - │ ^ Invalid assignment of variable 'x' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/assign_local_full_invalid.move:31:9 - │ -30 │ let f = id_mut(&mut x); - │ -------------- It is still being mutably borrowed by this reference -31 │ x = 0; - │ ^ Invalid assignment of variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_full_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_full_invalid.snap new file mode 100644 index 0000000000000..fd8242764e881 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/assign_local_full_invalid.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/assign_local_full_invalid.move +--- +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/assign_local_full_invalid.move:13:9 + │ +12 │ let f = &x; + │ -- It is still being borrowed by this reference +13 │ x = 0; + │ ^ Invalid assignment of variable 'x' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/assign_local_full_invalid.move:19:9 + │ +18 │ let f = &mut x; + │ ------ It is still being mutably borrowed by this reference +19 │ x = 0; + │ ^ Invalid assignment of variable 'x' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/assign_local_full_invalid.move:25:9 + │ +24 │ let f = id(&x); + │ ------ It is still being borrowed by this reference +25 │ x = 0; + │ ^ Invalid assignment of variable 'x' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/assign_local_full_invalid.move:31:9 + │ +30 │ let f = id_mut(&mut x); + │ -------------- It is still being mutably borrowed by this reference +31 │ x = 0; + │ ^ Invalid assignment of variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_combo.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_combo.snap new file mode 100644 index 0000000000000..d0f3eb09ae8ec --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_combo.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/borrow_field_combo.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_combo_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_combo_invalid.exp deleted file mode 100644 index e9120d4b86d84..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_combo_invalid.exp +++ /dev/null @@ -1,48 +0,0 @@ -error[E07001]: referential transparency violated - ┌─ tests/move_check/borrows/borrow_field_combo_invalid.move:14:18 - │ -13 │ let c; if (cond) c = copy inner else c = &mut outer.s1; - │ ---------- It is still being mutably borrowed by this reference -14 │ let f1 = &inner.f1; - │ ^^^^^^^^^ Invalid immutable borrow at field 'f1'. - -error[E07001]: referential transparency violated - ┌─ tests/move_check/borrows/borrow_field_combo_invalid.move:25:18 - │ -24 │ let c; if (cond) c = id_mut(copy inner) else c = &mut outer.s1; - │ ------------------ It is still being mutably borrowed by this reference -25 │ let f1 = &inner.f1; - │ ^^^^^^^^^ Invalid immutable borrow at field 'f1'. - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/borrow_field_combo_invalid.move:36:18 - │ -35 │ let c; if (cond) c = copy inner else c = &mut outer.s1; - │ ---------- It is still being mutably borrowed by this reference -36 │ let f1 = &mut inner.f1; - │ ^^^^^^^^^^^^^ Invalid mutable borrow at field 'f1'. - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/borrow_field_combo_invalid.move:47:18 - │ -46 │ let c; if (cond) c = id_mut(copy inner) else c = &mut outer.s1; - │ ------------------ It is still being mutably borrowed by this reference -47 │ let f1 = &mut inner.f1; - │ ^^^^^^^^^^^^^ Invalid mutable borrow at field 'f1'. - -error[E07001]: referential transparency violated - ┌─ tests/move_check/borrows/borrow_field_combo_invalid.move:58:18 - │ -57 │ let c; if (cond) c = &mut inner.f1 else c = &mut inner.f2; - │ ------------- Field 'f1' is still being mutably borrowed by this reference -58 │ let f1 = &inner.f1; - │ ^^^^^^^^^ Invalid immutable borrow at field 'f1'. - -error[E07001]: referential transparency violated - ┌─ tests/move_check/borrows/borrow_field_combo_invalid.move:67:18 - │ -66 │ let c; if (cond) c = id_mut(&mut inner.f1) else c = &mut inner.f1; - │ --------------------- Field 'f1' is still being mutably borrowed by this reference -67 │ let f1 = &inner.f1; - │ ^^^^^^^^^ Invalid immutable borrow at field 'f1'. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_combo_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_combo_invalid.snap new file mode 100644 index 0000000000000..4e47c49246eb2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_combo_invalid.snap @@ -0,0 +1,55 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/borrow_field_combo_invalid.move +--- +error[E07001]: referential transparency violated + ┌─ tests/move_check/borrows/borrow_field_combo_invalid.move:14:18 + │ +13 │ let c; if (cond) c = copy inner else c = &mut outer.s1; + │ ---------- It is still being mutably borrowed by this reference +14 │ let f1 = &inner.f1; + │ ^^^^^^^^^ Invalid immutable borrow at field 'f1'. + +error[E07001]: referential transparency violated + ┌─ tests/move_check/borrows/borrow_field_combo_invalid.move:25:18 + │ +24 │ let c; if (cond) c = id_mut(copy inner) else c = &mut outer.s1; + │ ------------------ It is still being mutably borrowed by this reference +25 │ let f1 = &inner.f1; + │ ^^^^^^^^^ Invalid immutable borrow at field 'f1'. + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/borrow_field_combo_invalid.move:36:18 + │ +35 │ let c; if (cond) c = copy inner else c = &mut outer.s1; + │ ---------- It is still being mutably borrowed by this reference +36 │ let f1 = &mut inner.f1; + │ ^^^^^^^^^^^^^ Invalid mutable borrow at field 'f1'. + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/borrow_field_combo_invalid.move:47:18 + │ +46 │ let c; if (cond) c = id_mut(copy inner) else c = &mut outer.s1; + │ ------------------ It is still being mutably borrowed by this reference +47 │ let f1 = &mut inner.f1; + │ ^^^^^^^^^^^^^ Invalid mutable borrow at field 'f1'. + +error[E07001]: referential transparency violated + ┌─ tests/move_check/borrows/borrow_field_combo_invalid.move:58:18 + │ +57 │ let c; if (cond) c = &mut inner.f1 else c = &mut inner.f2; + │ ------------- Field 'f1' is still being mutably borrowed by this reference +58 │ let f1 = &inner.f1; + │ ^^^^^^^^^ Invalid immutable borrow at field 'f1'. + +error[E07001]: referential transparency violated + ┌─ tests/move_check/borrows/borrow_field_combo_invalid.move:67:18 + │ +66 │ let c; if (cond) c = id_mut(&mut inner.f1) else c = &mut inner.f1; + │ --------------------- Field 'f1' is still being mutably borrowed by this reference +67 │ let f1 = &inner.f1; + │ ^^^^^^^^^ Invalid immutable borrow at field 'f1'. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_field.snap new file mode 100644 index 0000000000000..b4857997d879c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_field.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/borrow_field_field.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_field_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_field_invalid.exp deleted file mode 100644 index 3717d1d92e08a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_field_invalid.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E07001]: referential transparency violated - ┌─ tests/move_check/borrows/borrow_field_field_invalid.move:14:18 - │ -13 │ let c = &mut inner.f1; - │ ------------- Field 'f1' is still being mutably borrowed by this reference -14 │ let f1 = &inner.f1; - │ ^^^^^^^^^ Invalid immutable borrow at field 'f1'. - -error[E07001]: referential transparency violated - ┌─ tests/move_check/borrows/borrow_field_field_invalid.move:21:18 - │ -20 │ let c = id_mut(&mut inner.f1); - │ --------------------- Field 'f1' is still being mutably borrowed by this reference -21 │ let f1 = &inner.f1; - │ ^^^^^^^^^ Invalid immutable borrow at field 'f1'. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_field_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_field_invalid.snap new file mode 100644 index 0000000000000..8cd226dff8378 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_field_invalid.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/borrow_field_field_invalid.move +--- +error[E07001]: referential transparency violated + ┌─ tests/move_check/borrows/borrow_field_field_invalid.move:14:18 + │ +13 │ let c = &mut inner.f1; + │ ------------- Field 'f1' is still being mutably borrowed by this reference +14 │ let f1 = &inner.f1; + │ ^^^^^^^^^ Invalid immutable borrow at field 'f1'. + +error[E07001]: referential transparency violated + ┌─ tests/move_check/borrows/borrow_field_field_invalid.move:21:18 + │ +20 │ let c = id_mut(&mut inner.f1); + │ --------------------- Field 'f1' is still being mutably borrowed by this reference +21 │ let f1 = &inner.f1; + │ ^^^^^^^^^ Invalid immutable borrow at field 'f1'. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_full.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_full.snap new file mode 100644 index 0000000000000..3136ac63d859b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_full.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/borrow_field_full.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_full_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_full_invalid.exp deleted file mode 100644 index 9f7a55de554a6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_full_invalid.exp +++ /dev/null @@ -1,32 +0,0 @@ -error[E07001]: referential transparency violated - ┌─ tests/move_check/borrows/borrow_field_full_invalid.move:14:18 - │ -13 │ let c = copy inner; - │ ---------- It is still being mutably borrowed by this reference -14 │ let f1 = &inner.f1; - │ ^^^^^^^^^ Invalid immutable borrow at field 'f1'. - -error[E07001]: referential transparency violated - ┌─ tests/move_check/borrows/borrow_field_full_invalid.move:23:18 - │ -22 │ let c = id_mut(copy inner); - │ ------------------ It is still being mutably borrowed by this reference -23 │ let f1 = &inner.f1; - │ ^^^^^^^^^ Invalid immutable borrow at field 'f1'. - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/borrow_field_full_invalid.move:32:18 - │ -31 │ let c = copy inner; - │ ---------- It is still being mutably borrowed by this reference -32 │ let f1 = &mut inner.f1; - │ ^^^^^^^^^^^^^ Invalid mutable borrow at field 'f1'. - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/borrow_field_full_invalid.move:41:18 - │ -40 │ let c = id_mut(copy inner); - │ ------------------ It is still being mutably borrowed by this reference -41 │ let f1 = &mut inner.f1; - │ ^^^^^^^^^^^^^ Invalid mutable borrow at field 'f1'. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_full_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_full_invalid.snap new file mode 100644 index 0000000000000..01a7018b6729b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_field_full_invalid.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/borrow_field_full_invalid.move +--- +error[E07001]: referential transparency violated + ┌─ tests/move_check/borrows/borrow_field_full_invalid.move:14:18 + │ +13 │ let c = copy inner; + │ ---------- It is still being mutably borrowed by this reference +14 │ let f1 = &inner.f1; + │ ^^^^^^^^^ Invalid immutable borrow at field 'f1'. + +error[E07001]: referential transparency violated + ┌─ tests/move_check/borrows/borrow_field_full_invalid.move:23:18 + │ +22 │ let c = id_mut(copy inner); + │ ------------------ It is still being mutably borrowed by this reference +23 │ let f1 = &inner.f1; + │ ^^^^^^^^^ Invalid immutable borrow at field 'f1'. + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/borrow_field_full_invalid.move:32:18 + │ +31 │ let c = copy inner; + │ ---------- It is still being mutably borrowed by this reference +32 │ let f1 = &mut inner.f1; + │ ^^^^^^^^^^^^^ Invalid mutable borrow at field 'f1'. + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/borrow_field_full_invalid.move:41:18 + │ +40 │ let c = id_mut(copy inner); + │ ------------------ It is still being mutably borrowed by this reference +41 │ let f1 = &mut inner.f1; + │ ^^^^^^^^^^^^^ Invalid mutable borrow at field 'f1'. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_combo.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_combo.snap new file mode 100644 index 0000000000000..8ae007cf6d16a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_combo.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/borrow_local_combo.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_combo_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_combo_invalid.exp deleted file mode 100644 index 229f9d4f7a7ca..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_combo_invalid.exp +++ /dev/null @@ -1,42 +0,0 @@ -error[E07001]: referential transparency violated - ┌─ tests/move_check/borrows/borrow_local_combo_invalid.move:13:17 - │ -12 │ if (cond) f = &mut s.f else f = &mut other.f; - │ -------- It is still being mutably borrowed by this reference -13 │ let x = &s; - │ ^^ Invalid borrow of variable 's' - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/borrow_local_combo_invalid.move:23:9 - │ -20 │ if (cond) f = &mut s.f else f = &mut other.f; - │ -------- Field 'f' is still being mutably borrowed by this reference - · -23 │ *x; - │ ^^ Invalid dereference. - -error[E07001]: referential transparency violated - ┌─ tests/move_check/borrows/borrow_local_combo_invalid.move:30:17 - │ -29 │ if (cond) f = &mut s.f else f = &mut s.g; - │ -------- It is still being mutably borrowed by this reference -30 │ let x = &s; - │ ^^ Invalid borrow of variable 's' - -error[E07001]: referential transparency violated - ┌─ tests/move_check/borrows/borrow_local_combo_invalid.move:38:17 - │ -37 │ if (cond) x = &mut s else x = other; - │ ------ It is still being mutably borrowed by this reference -38 │ let y = &s; - │ ^^ Invalid borrow of variable 's' - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/borrow_local_combo_invalid.move:48:9 - │ -46 │ if (cond) x = &mut s else x = other; - │ ------ It is still being mutably borrowed by this reference -47 │ let y = &mut s; -48 │ *y; - │ ^^ Invalid dereference. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_combo_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_combo_invalid.snap new file mode 100644 index 0000000000000..6df905c416120 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_combo_invalid.snap @@ -0,0 +1,49 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/borrow_local_combo_invalid.move +--- +error[E07001]: referential transparency violated + ┌─ tests/move_check/borrows/borrow_local_combo_invalid.move:13:17 + │ +12 │ if (cond) f = &mut s.f else f = &mut other.f; + │ -------- It is still being mutably borrowed by this reference +13 │ let x = &s; + │ ^^ Invalid borrow of variable 's' + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/borrow_local_combo_invalid.move:23:9 + │ +20 │ if (cond) f = &mut s.f else f = &mut other.f; + │ -------- Field 'f' is still being mutably borrowed by this reference + · +23 │ *x; + │ ^^ Invalid dereference. + +error[E07001]: referential transparency violated + ┌─ tests/move_check/borrows/borrow_local_combo_invalid.move:30:17 + │ +29 │ if (cond) f = &mut s.f else f = &mut s.g; + │ -------- It is still being mutably borrowed by this reference +30 │ let x = &s; + │ ^^ Invalid borrow of variable 's' + +error[E07001]: referential transparency violated + ┌─ tests/move_check/borrows/borrow_local_combo_invalid.move:38:17 + │ +37 │ if (cond) x = &mut s else x = other; + │ ------ It is still being mutably borrowed by this reference +38 │ let y = &s; + │ ^^ Invalid borrow of variable 's' + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/borrow_local_combo_invalid.move:48:9 + │ +46 │ if (cond) x = &mut s else x = other; + │ ------ It is still being mutably borrowed by this reference +47 │ let y = &mut s; +48 │ *y; + │ ^^ Invalid dereference. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_field.snap new file mode 100644 index 0000000000000..7018255203a25 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_field.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/borrow_local_field.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_field_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_field_invalid.exp deleted file mode 100644 index d813e0040c49d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_field_invalid.exp +++ /dev/null @@ -1,17 +0,0 @@ -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/borrow_local_field_invalid.move:14:9 - │ -12 │ let f = &v.f; - │ ---- Field 'f' is still being borrowed by this reference -13 │ let s = &mut v; -14 │ *s = S { f: 0, g: 0 }; - │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. - -error[E07001]: referential transparency violated - ┌─ tests/move_check/borrows/borrow_local_field_invalid.move:19:17 - │ -18 │ let f = &mut v.f; - │ -------- It is still being mutably borrowed by this reference -19 │ let s = &v; - │ ^^ Invalid borrow of variable 'v' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_field_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_field_invalid.snap new file mode 100644 index 0000000000000..a462ed74c3189 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_field_invalid.snap @@ -0,0 +1,24 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/borrow_local_field_invalid.move +--- +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/borrow_local_field_invalid.move:14:9 + │ +12 │ let f = &v.f; + │ ---- Field 'f' is still being borrowed by this reference +13 │ let s = &mut v; +14 │ *s = S { f: 0, g: 0 }; + │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. + +error[E07001]: referential transparency violated + ┌─ tests/move_check/borrows/borrow_local_field_invalid.move:19:17 + │ +18 │ let f = &mut v.f; + │ -------- It is still being mutably borrowed by this reference +19 │ let s = &v; + │ ^^ Invalid borrow of variable 'v' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_full.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_full.snap new file mode 100644 index 0000000000000..997bcf268eb33 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_full.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/borrow_local_full.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_full_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_full_invalid.exp deleted file mode 100644 index 0ffe913c22222..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_full_invalid.exp +++ /dev/null @@ -1,34 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/borrow_local_full_invalid.move:14:9 - │ -12 │ let x = &mut v; - │ ------ It is still being mutably borrowed by this reference -13 │ let y = &mut v; -14 │ *y; - │ ^^ Invalid dereference. - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/borrow_local_full_invalid.move:18:17 - │ -17 │ let x = &mut v; - │ ------ It is still being mutably borrowed by this reference -18 │ let y = id_mut(&mut v); - │ ^^^^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/borrow_local_full_invalid.move:24:9 - │ -22 │ let x = &v; - │ -- It is still being borrowed by this reference -23 │ let y = &mut v; -24 │ *y = 0; - │ ^^^^^^ Invalid mutation of reference. - -error[E07001]: referential transparency violated - ┌─ tests/move_check/borrows/borrow_local_full_invalid.move:33:17 - │ -32 │ let x = &mut v; - │ ------ It is still being mutably borrowed by this reference -33 │ let y = &v; - │ ^^ Invalid borrow of variable 'v' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_full_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_full_invalid.snap new file mode 100644 index 0000000000000..d8811bd802bce --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrow_local_full_invalid.snap @@ -0,0 +1,41 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/borrow_local_full_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/borrow_local_full_invalid.move:14:9 + │ +12 │ let x = &mut v; + │ ------ It is still being mutably borrowed by this reference +13 │ let y = &mut v; +14 │ *y; + │ ^^ Invalid dereference. + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/borrow_local_full_invalid.move:18:17 + │ +17 │ let x = &mut v; + │ ------ It is still being mutably borrowed by this reference +18 │ let y = id_mut(&mut v); + │ ^^^^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/borrow_local_full_invalid.move:24:9 + │ +22 │ let x = &v; + │ -- It is still being borrowed by this reference +23 │ let y = &mut v; +24 │ *y = 0; + │ ^^^^^^ Invalid mutation of reference. + +error[E07001]: referential transparency violated + ┌─ tests/move_check/borrows/borrow_local_full_invalid.move:33:17 + │ +32 │ let x = &mut v; + │ ------ It is still being mutably borrowed by this reference +33 │ let y = &v; + │ ^^ Invalid borrow of variable 'v' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrowed_before_last_usage.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrowed_before_last_usage.exp deleted file mode 100644 index 3bb18998e4067..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrowed_before_last_usage.exp +++ /dev/null @@ -1,13 +0,0 @@ -error[E07006]: ambiguous usage of variable - ┌─ tests/move_check/borrows/borrowed_before_last_usage.move:5:13 - │ -4 │ let r = &x; - │ -- It is still being borrowed by this reference -5 │ let y = x; - │ ^ - │ │ - │ Ambiguous usage of variable 'x' - │ Try an explicit annotation, e.g. 'move x' or 'copy x' - │ - = Ambiguous inference of 'move' or 'copy' for a borrowed variable's last usage: A 'move' would invalidate the borrowing reference, but a 'copy' might not be the expected implicit behavior since this the last direct usage of the variable. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrowed_before_last_usage.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrowed_before_last_usage.snap new file mode 100644 index 0000000000000..11c2225768376 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/borrowed_before_last_usage.snap @@ -0,0 +1,20 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/borrowed_before_last_usage.move +--- +error[E07006]: ambiguous usage of variable + ┌─ tests/move_check/borrows/borrowed_before_last_usage.move:5:13 + │ +4 │ let r = &x; + │ -- It is still being borrowed by this reference +5 │ let y = x; + │ ^ + │ │ + │ Ambiguous usage of variable 'x' + │ Try an explicit annotation, e.g. 'move x' or 'copy x' + │ + = Ambiguous inference of 'move' or 'copy' for a borrowed variable's last usage: A 'move' would invalidate the borrowing reference, but a 'copy' might not be the expected implicit behavior since this the last direct usage of the variable. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_mutual_borrows.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_mutual_borrows.snap new file mode 100644 index 0000000000000..baa0302b582cb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_mutual_borrows.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/call_mutual_borrows.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_mutual_borrows_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_mutual_borrows_invalid.exp deleted file mode 100644 index db7de6bdacbde..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_mutual_borrows_invalid.exp +++ /dev/null @@ -1,83 +0,0 @@ -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:15:9 - │ -14 │ let f = freeze(s1); - │ ---------- It is still being borrowed by this reference -15 │ mut_imm(s1, f); - │ ^^^^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:17:9 - │ -16 │ let f = &s1.f; - │ ----- Field 'f' is still being borrowed by this reference -17 │ mut_imm(s1, f); - │ ^^^^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:19:9 - │ -18 │ let f = &s1.f; - │ ----- It is still being borrowed by this reference -19 │ mut_imm(&mut s1.f, f); - │ ^^^^^^^^^^^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:21:9 - │ -20 │ let f = id(&s1.f); - │ --------- It is still being borrowed by this reference -21 │ id_mut(&mut s1.f); f; - │ ^^^^^^^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:23:9 - │ -23 │ mut_mut(s1, s1); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ It is still being mutably borrowed by this reference - │ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:25:9 - │ -24 │ let f = &mut s1.f; - │ --------- Field 'f' is still being mutably borrowed by this reference -25 │ mut_mut(s1, f); - │ ^^^^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:26:9 - │ -26 │ mut_mut(&mut s1.f, s1); - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Field 'f' is still being mutably borrowed by this reference - │ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:28:9 - │ -27 │ let s = id_mut(s1); - │ ---------- It is still being mutably borrowed by this reference -28 │ id_mut(s1); - │ ^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:31:9 - │ -30 │ let f = id_mut(&mut s1.f); - │ ----------------- Field 'f' is still being mutably borrowed by this reference -31 │ mut_mut(s1, f); - │ ^^^^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:32:9 - │ -32 │ mut_mut(id_mut(&mut s1.f), s1); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Field 'f' is still being mutably borrowed by this reference - │ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_mutual_borrows_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_mutual_borrows_invalid.snap new file mode 100644 index 0000000000000..b7c9e642f1bc2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_mutual_borrows_invalid.snap @@ -0,0 +1,90 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/call_mutual_borrows_invalid.move +--- +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:15:9 + │ +14 │ let f = freeze(s1); + │ ---------- It is still being borrowed by this reference +15 │ mut_imm(s1, f); + │ ^^^^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:17:9 + │ +16 │ let f = &s1.f; + │ ----- Field 'f' is still being borrowed by this reference +17 │ mut_imm(s1, f); + │ ^^^^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:19:9 + │ +18 │ let f = &s1.f; + │ ----- It is still being borrowed by this reference +19 │ mut_imm(&mut s1.f, f); + │ ^^^^^^^^^^^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:21:9 + │ +20 │ let f = id(&s1.f); + │ --------- It is still being borrowed by this reference +21 │ id_mut(&mut s1.f); f; + │ ^^^^^^^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:23:9 + │ +23 │ mut_mut(s1, s1); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ It is still being mutably borrowed by this reference + │ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:25:9 + │ +24 │ let f = &mut s1.f; + │ --------- Field 'f' is still being mutably borrowed by this reference +25 │ mut_mut(s1, f); + │ ^^^^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:26:9 + │ +26 │ mut_mut(&mut s1.f, s1); + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Field 'f' is still being mutably borrowed by this reference + │ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:28:9 + │ +27 │ let s = id_mut(s1); + │ ---------- It is still being mutably borrowed by this reference +28 │ id_mut(s1); + │ ^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:31:9 + │ +30 │ let f = id_mut(&mut s1.f); + │ ----------------- Field 'f' is still being mutably borrowed by this reference +31 │ mut_mut(s1, f); + │ ^^^^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/call_mutual_borrows_invalid.move:32:9 + │ +32 │ mut_mut(id_mut(&mut s1.f), s1); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Field 'f' is still being mutably borrowed by this reference + │ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_ordering.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_ordering.exp deleted file mode 100644 index 626109186a31f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_ordering.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/call_ordering.move:7:13 - │ -6 │ let f = &mut s.f; - │ -------- Field 'f' is still being mutably borrowed by this reference -7 │ foo(freeze(s), { *f = 0; 1 }) - │ ^^^^^^^^^ Invalid freeze. - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/call_ordering.move:12:25 - │ -12 │ bar(&mut s.f, { s.f = 0; 1 }) - │ -------- ^^^^^^^ Invalid mutation of reference. - │ │ - │ It is still being mutably borrowed by this reference - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_ordering.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_ordering.snap new file mode 100644 index 0000000000000..02fed362a1054 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_ordering.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/call_ordering.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/call_ordering.move:7:13 + │ +6 │ let f = &mut s.f; + │ -------- Field 'f' is still being mutably borrowed by this reference +7 │ foo(freeze(s), { *f = 0; 1 }) + │ ^^^^^^^^^ Invalid freeze. + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/call_ordering.move:12:25 + │ +12 │ bar(&mut s.f, { s.f = 0; 1 }) + │ -------- ^^^^^^^ Invalid mutation of reference. + │ │ + │ It is still being mutably borrowed by this reference diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_transfer_borrows.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_transfer_borrows.snap new file mode 100644 index 0000000000000..adc0ceec3ed76 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_transfer_borrows.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/call_transfer_borrows.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_transfer_borrows_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_transfer_borrows_invalid.exp deleted file mode 100644 index 1c89ae138322c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_transfer_borrows_invalid.exp +++ /dev/null @@ -1,25 +0,0 @@ -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/call_transfer_borrows_invalid.move:16:9 - │ -15 │ let r = take_imm_mut_give_mut(move x_ref, move y_ref); - │ --------------------------------------------- It is still being mutably borrowed by this reference -16 │ move y; - │ ^^^^^^ Invalid move of variable 'y' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/call_transfer_borrows_invalid.move:26:9 - │ -25 │ let r = take_imm_mut_give_imm(move x_ref, move y_ref); - │ --------------------------------------------- It is still being borrowed by this reference -26 │ move x; - │ ^^^^^^ Invalid move of variable 'x' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/call_transfer_borrows_invalid.move:27:9 - │ -25 │ let r = take_imm_mut_give_imm(move x_ref, move y_ref); - │ --------------------------------------------- It is still being borrowed by this reference -26 │ move x; -27 │ move y; - │ ^^^^^^ Invalid move of variable 'y' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_transfer_borrows_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_transfer_borrows_invalid.snap new file mode 100644 index 0000000000000..e8b9e865ddf7a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/call_transfer_borrows_invalid.snap @@ -0,0 +1,32 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/call_transfer_borrows_invalid.move +--- +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/call_transfer_borrows_invalid.move:16:9 + │ +15 │ let r = take_imm_mut_give_mut(move x_ref, move y_ref); + │ --------------------------------------------- It is still being mutably borrowed by this reference +16 │ move y; + │ ^^^^^^ Invalid move of variable 'y' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/call_transfer_borrows_invalid.move:26:9 + │ +25 │ let r = take_imm_mut_give_imm(move x_ref, move y_ref); + │ --------------------------------------------- It is still being borrowed by this reference +26 │ move x; + │ ^^^^^^ Invalid move of variable 'x' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/call_transfer_borrows_invalid.move:27:9 + │ +25 │ let r = take_imm_mut_give_imm(move x_ref, move y_ref); + │ --------------------------------------------- It is still being borrowed by this reference +26 │ move x; +27 │ move y; + │ ^^^^^^ Invalid move of variable 'y' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_combo.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_combo.snap new file mode 100644 index 0000000000000..2c0c6a154ef60 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_combo.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/copy_combo.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_combo_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_combo_invalid.exp deleted file mode 100644 index 145e441c22d12..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_combo_invalid.exp +++ /dev/null @@ -1,32 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/copy_combo_invalid.move:14:9 - │ -13 │ if (cond) f = &mut s.f else f = &mut other.f; - │ -------- It is still being mutably borrowed by this reference -14 │ copy s; - │ ^^^^^^ Invalid copy of variable 's' - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/copy_combo_invalid.move:23:9 - │ -22 │ if (cond) f = &mut s else f = other; - │ ------ It is still being mutably borrowed by this reference -23 │ copy s; - │ ^^^^^^ Invalid copy of variable 's' - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/copy_combo_invalid.move:32:9 - │ -31 │ if (cond) f = id_mut(&mut s) else f = other; - │ -------------- It is still being mutably borrowed by this reference -32 │ copy s; - │ ^^^^^^ Invalid copy of variable 's' - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/copy_combo_invalid.move:40:21 - │ -39 │ let f = &mut s.f; - │ -------- It is still being mutably borrowed by this reference -40 │ if (cond) { copy s; }; - │ ^^^^^^ Invalid copy of variable 's' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_combo_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_combo_invalid.snap new file mode 100644 index 0000000000000..464d36e70f97a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_combo_invalid.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/copy_combo_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/copy_combo_invalid.move:14:9 + │ +13 │ if (cond) f = &mut s.f else f = &mut other.f; + │ -------- It is still being mutably borrowed by this reference +14 │ copy s; + │ ^^^^^^ Invalid copy of variable 's' + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/copy_combo_invalid.move:23:9 + │ +22 │ if (cond) f = &mut s else f = other; + │ ------ It is still being mutably borrowed by this reference +23 │ copy s; + │ ^^^^^^ Invalid copy of variable 's' + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/copy_combo_invalid.move:32:9 + │ +31 │ if (cond) f = id_mut(&mut s) else f = other; + │ -------------- It is still being mutably borrowed by this reference +32 │ copy s; + │ ^^^^^^ Invalid copy of variable 's' + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/copy_combo_invalid.move:40:21 + │ +39 │ let f = &mut s.f; + │ -------- It is still being mutably borrowed by this reference +40 │ if (cond) { copy s; }; + │ ^^^^^^ Invalid copy of variable 's' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_field.snap new file mode 100644 index 0000000000000..7353577342727 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_field.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/copy_field.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_field_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_field_invalid.exp deleted file mode 100644 index d1108e003848f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_field_invalid.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/copy_field_invalid.move:13:9 - │ -12 │ let f = &mut s.f; - │ -------- It is still being mutably borrowed by this reference -13 │ copy s; - │ ^^^^^^ Invalid copy of variable 's' - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/copy_field_invalid.move:19:9 - │ -18 │ let f = id_mut(&mut s.f); - │ ---------------- It is still being mutably borrowed by this reference -19 │ copy s; - │ ^^^^^^ Invalid copy of variable 's' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_field_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_field_invalid.snap new file mode 100644 index 0000000000000..2b4920f954366 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_field_invalid.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/copy_field_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/copy_field_invalid.move:13:9 + │ +12 │ let f = &mut s.f; + │ -------- It is still being mutably borrowed by this reference +13 │ copy s; + │ ^^^^^^ Invalid copy of variable 's' + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/copy_field_invalid.move:19:9 + │ +18 │ let f = id_mut(&mut s.f); + │ ---------------- It is still being mutably borrowed by this reference +19 │ copy s; + │ ^^^^^^ Invalid copy of variable 's' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_full.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_full.snap new file mode 100644 index 0000000000000..fe8b85ccef059 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_full.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/copy_full.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_full_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_full_invalid.exp deleted file mode 100644 index ec27eeee2e367..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_full_invalid.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/copy_full_invalid.move:13:9 - │ -12 │ let f = &mut x; - │ ------ It is still being mutably borrowed by this reference -13 │ x; - │ ^ Invalid copy of variable 'x' - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/copy_full_invalid.move:19:9 - │ -18 │ let f = id_mut(&mut x); - │ -------------- It is still being mutably borrowed by this reference -19 │ x; - │ ^ Invalid copy of variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_full_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_full_invalid.snap new file mode 100644 index 0000000000000..ce08ec4ffcfdd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/copy_full_invalid.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/copy_full_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/copy_full_invalid.move:13:9 + │ +12 │ let f = &mut x; + │ ------ It is still being mutably borrowed by this reference +13 │ x; + │ ^ Invalid copy of variable 'x' + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/copy_full_invalid.move:19:9 + │ +18 │ let f = id_mut(&mut x); + │ -------------- It is still being mutably borrowed by this reference +19 │ x; + │ ^ Invalid copy of variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_combo.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_combo.snap new file mode 100644 index 0000000000000..1238734dd3b9a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_combo.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/dereference_combo.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_combo_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_combo_invalid.exp deleted file mode 100644 index 835c2840d35ca..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_combo_invalid.exp +++ /dev/null @@ -1,26 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/dereference_combo_invalid.move:13:9 - │ -12 │ if (cond) f = &mut s.f else f = &mut other.f; - │ -------- Field 'f' is still being mutably borrowed by this reference -13 │ *s; - │ ^^ Invalid dereference. - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/dereference_combo_invalid.move:20:9 - │ -19 │ if (cond) f = &mut s.f else f = &mut s.g; - │ -------- -------- Field 'g' is still being mutably borrowed by this reference - │ │ - │ Field 'f' is still being mutably borrowed by this reference -20 │ *s; - │ ^^ Invalid dereference. - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/dereference_combo_invalid.move:27:9 - │ -26 │ if (cond) x = copy s else x = other; - │ ------ It is still being mutably borrowed by this reference -27 │ *s; - │ ^^ Invalid dereference. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_combo_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_combo_invalid.snap new file mode 100644 index 0000000000000..bb7c92cbff795 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_combo_invalid.snap @@ -0,0 +1,33 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/dereference_combo_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/dereference_combo_invalid.move:13:9 + │ +12 │ if (cond) f = &mut s.f else f = &mut other.f; + │ -------- Field 'f' is still being mutably borrowed by this reference +13 │ *s; + │ ^^ Invalid dereference. + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/dereference_combo_invalid.move:20:9 + │ +19 │ if (cond) f = &mut s.f else f = &mut s.g; + │ -------- -------- Field 'g' is still being mutably borrowed by this reference + │ │ + │ Field 'f' is still being mutably borrowed by this reference +20 │ *s; + │ ^^ Invalid dereference. + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/dereference_combo_invalid.move:27:9 + │ +26 │ if (cond) x = copy s else x = other; + │ ------ It is still being mutably borrowed by this reference +27 │ *s; + │ ^^ Invalid dereference. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_field.snap new file mode 100644 index 0000000000000..489021b4af386 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_field.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/dereference_field.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_field_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_field_invalid.exp deleted file mode 100644 index 31f6c58c9fae6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_field_invalid.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/dereference_field_invalid.move:12:9 - │ -11 │ let f = &mut s.f; - │ -------- Field 'f' is still being mutably borrowed by this reference -12 │ *s; - │ ^^ Invalid dereference. - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/dereference_field_invalid.move:16:9 - │ -15 │ let f = id_mut(&mut s.f); - │ ---------------- Field 'f' is still being mutably borrowed by this reference -16 │ *s; - │ ^^ Invalid dereference. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_field_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_field_invalid.snap new file mode 100644 index 0000000000000..16b097233adf5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_field_invalid.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/dereference_field_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/dereference_field_invalid.move:12:9 + │ +11 │ let f = &mut s.f; + │ -------- Field 'f' is still being mutably borrowed by this reference +12 │ *s; + │ ^^ Invalid dereference. + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/dereference_field_invalid.move:16:9 + │ +15 │ let f = id_mut(&mut s.f); + │ ---------------- Field 'f' is still being mutably borrowed by this reference +16 │ *s; + │ ^^ Invalid dereference. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_full.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_full.snap new file mode 100644 index 0000000000000..cc2f608ec3d4d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_full.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/dereference_full.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_full_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_full_invalid.exp deleted file mode 100644 index 951f7e865e5b9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_full_invalid.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/dereference_full_invalid.move:13:9 - │ -12 │ let y = copy x; - │ ------ It is still being mutably borrowed by this reference -13 │ *x; - │ ^^ Invalid dereference. - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/dereference_full_invalid.move:18:9 - │ -17 │ let y = id_mut(x); - │ --------- It is still being mutably borrowed by this reference -18 │ *x; - │ ^^ Invalid dereference. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_full_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_full_invalid.snap new file mode 100644 index 0000000000000..6b3f2dae9f15e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/dereference_full_invalid.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/dereference_full_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/dereference_full_invalid.move:13:9 + │ +12 │ let y = copy x; + │ ------ It is still being mutably borrowed by this reference +13 │ *x; + │ ^^ Invalid dereference. + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/dereference_full_invalid.move:18:9 + │ +17 │ let y = id_mut(x); + │ --------- It is still being mutably borrowed by this reference +18 │ *x; + │ ^^ Invalid dereference. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/empty_struct_borrow.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/empty_struct_borrow.snap new file mode 100644 index 0000000000000..be433409b3a93 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/empty_struct_borrow.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/empty_struct_borrow.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/eq_unassigned_local.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/eq_unassigned_local.exp deleted file mode 100644 index 8286e89cf0363..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/eq_unassigned_local.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/borrows/eq_unassigned_local.move:5:9 - │ -4 │ let ref; - │ --- The variable 'ref' does not have a value. The variable must be assigned a value before being used. -5 │ ref == &x; - │ ^^^ Invalid usage of unassigned variable 'ref' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/eq_unassigned_local.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/eq_unassigned_local.snap new file mode 100644 index 0000000000000..30f1877e36780 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/eq_unassigned_local.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/eq_unassigned_local.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/borrows/eq_unassigned_local.move:5:9 + │ +4 │ let ref; + │ --- The variable 'ref' does not have a value. The variable must be assigned a value before being used. +5 │ ref == &x; + │ ^^^ Invalid usage of unassigned variable 'ref' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_combo.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_combo.snap new file mode 100644 index 0000000000000..570c5c37bd27d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_combo.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/freeze_combo.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_combo_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_combo_invalid.exp deleted file mode 100644 index 124ad01ec70b4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_combo_invalid.exp +++ /dev/null @@ -1,26 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/freeze_combo_invalid.move:13:9 - │ -12 │ if (cond) f = &mut s.f else f = &mut other.f; - │ -------- Field 'f' is still being mutably borrowed by this reference -13 │ freeze(s); - │ ^^^^^^^^^ Invalid freeze. - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/freeze_combo_invalid.move:20:9 - │ -19 │ if (cond) f = &mut s.f else f = &mut s.g; - │ -------- -------- Field 'g' is still being mutably borrowed by this reference - │ │ - │ Field 'f' is still being mutably borrowed by this reference -20 │ freeze(s); - │ ^^^^^^^^^ Invalid freeze. - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/freeze_combo_invalid.move:27:9 - │ -26 │ if (cond) x = s else x = other; - │ - It is still being mutably borrowed by this reference -27 │ freeze(s); - │ ^^^^^^^^^ Invalid freeze. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_combo_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_combo_invalid.snap new file mode 100644 index 0000000000000..abb827353d53d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_combo_invalid.snap @@ -0,0 +1,33 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/freeze_combo_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/freeze_combo_invalid.move:13:9 + │ +12 │ if (cond) f = &mut s.f else f = &mut other.f; + │ -------- Field 'f' is still being mutably borrowed by this reference +13 │ freeze(s); + │ ^^^^^^^^^ Invalid freeze. + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/freeze_combo_invalid.move:20:9 + │ +19 │ if (cond) f = &mut s.f else f = &mut s.g; + │ -------- -------- Field 'g' is still being mutably borrowed by this reference + │ │ + │ Field 'f' is still being mutably borrowed by this reference +20 │ freeze(s); + │ ^^^^^^^^^ Invalid freeze. + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/freeze_combo_invalid.move:27:9 + │ +26 │ if (cond) x = s else x = other; + │ - It is still being mutably borrowed by this reference +27 │ freeze(s); + │ ^^^^^^^^^ Invalid freeze. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_field.snap new file mode 100644 index 0000000000000..6fb2ddfb5fc71 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_field.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/freeze_field.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_field_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_field_invalid.exp deleted file mode 100644 index edfb5f1183243..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_field_invalid.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/freeze_field_invalid.move:12:9 - │ -11 │ let f = &mut s.f; - │ -------- Field 'f' is still being mutably borrowed by this reference -12 │ freeze(s); - │ ^^^^^^^^^ Invalid freeze. - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/borrows/freeze_field_invalid.move:19:9 - │ -18 │ let g = &mut s.f; - │ -------- Field 'f' is still being mutably borrowed by this reference -19 │ freeze(s); - │ ^^^^^^^^^ Invalid freeze. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_field_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_field_invalid.snap new file mode 100644 index 0000000000000..eef09143f1eeb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_field_invalid.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/freeze_field_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/freeze_field_invalid.move:12:9 + │ +11 │ let f = &mut s.f; + │ -------- Field 'f' is still being mutably borrowed by this reference +12 │ freeze(s); + │ ^^^^^^^^^ Invalid freeze. + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/borrows/freeze_field_invalid.move:19:9 + │ +18 │ let g = &mut s.f; + │ -------- Field 'f' is still being mutably borrowed by this reference +19 │ freeze(s); + │ ^^^^^^^^^ Invalid freeze. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_full.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_full.snap new file mode 100644 index 0000000000000..51ab48fc2fea8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_full.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/freeze_full.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_full_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_full_invalid.snap new file mode 100644 index 0000000000000..af9722769d0fc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/freeze_full_invalid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/freeze_full_invalid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_combo.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_combo.snap new file mode 100644 index 0000000000000..75876f8ec1f53 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_combo.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/move_combo.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_combo_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_combo_invalid.exp deleted file mode 100644 index bad725681d02c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_combo_invalid.exp +++ /dev/null @@ -1,40 +0,0 @@ -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/move_combo_invalid.move:14:9 - │ -13 │ if (cond) f = &s.f else f = &s.g; - │ ---- It is still being borrowed by this reference -14 │ move s; - │ ^^^^^^ Invalid move of variable 's' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/move_combo_invalid.move:22:9 - │ -21 │ if (cond) f = &mut s.f else f = &mut other.f; - │ -------- It is still being mutably borrowed by this reference -22 │ move s; - │ ^^^^^^ Invalid move of variable 's' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/move_combo_invalid.move:30:9 - │ -29 │ if (cond) f = &mut s else f = other; - │ ------ It is still being mutably borrowed by this reference -30 │ move s; - │ ^^^^^^ Invalid move of variable 's' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/move_combo_invalid.move:38:9 - │ -37 │ if (cond) f = id_mut(&mut s) else f = other; - │ -------------- It is still being mutably borrowed by this reference -38 │ move s; - │ ^^^^^^ Invalid move of variable 's' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/move_combo_invalid.move:45:21 - │ -44 │ let f = &s.f; - │ ---- It is still being borrowed by this reference -45 │ if (cond) { move s; }; - │ ^^^^^^ Invalid move of variable 's' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_combo_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_combo_invalid.snap new file mode 100644 index 0000000000000..c49039d9f5317 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_combo_invalid.snap @@ -0,0 +1,47 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/move_combo_invalid.move +--- +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/move_combo_invalid.move:14:9 + │ +13 │ if (cond) f = &s.f else f = &s.g; + │ ---- It is still being borrowed by this reference +14 │ move s; + │ ^^^^^^ Invalid move of variable 's' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/move_combo_invalid.move:22:9 + │ +21 │ if (cond) f = &mut s.f else f = &mut other.f; + │ -------- It is still being mutably borrowed by this reference +22 │ move s; + │ ^^^^^^ Invalid move of variable 's' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/move_combo_invalid.move:30:9 + │ +29 │ if (cond) f = &mut s else f = other; + │ ------ It is still being mutably borrowed by this reference +30 │ move s; + │ ^^^^^^ Invalid move of variable 's' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/move_combo_invalid.move:38:9 + │ +37 │ if (cond) f = id_mut(&mut s) else f = other; + │ -------------- It is still being mutably borrowed by this reference +38 │ move s; + │ ^^^^^^ Invalid move of variable 's' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/move_combo_invalid.move:45:21 + │ +44 │ let f = &s.f; + │ ---- It is still being borrowed by this reference +45 │ if (cond) { move s; }; + │ ^^^^^^ Invalid move of variable 's' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_field.snap new file mode 100644 index 0000000000000..ab14f566b4922 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_field.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/move_field.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_field_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_field_invalid.exp deleted file mode 100644 index d7d6bc3978428..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_field_invalid.exp +++ /dev/null @@ -1,32 +0,0 @@ -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/move_field_invalid.move:13:9 - │ -12 │ let f = &s.f; - │ ---- It is still being borrowed by this reference -13 │ move s; - │ ^^^^^^ Invalid move of variable 's' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/move_field_invalid.move:18:9 - │ -17 │ let f = &mut s.f; - │ -------- It is still being mutably borrowed by this reference -18 │ move s; - │ ^^^^^^ Invalid move of variable 's' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/move_field_invalid.move:23:9 - │ -22 │ let f = id(&s.f); - │ -------- It is still being borrowed by this reference -23 │ move s; - │ ^^^^^^ Invalid move of variable 's' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/move_field_invalid.move:28:9 - │ -27 │ let f = id_mut(&mut s.f); - │ ---------------- It is still being mutably borrowed by this reference -28 │ move s; - │ ^^^^^^ Invalid move of variable 's' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_field_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_field_invalid.snap new file mode 100644 index 0000000000000..747f11566c94a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_field_invalid.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/move_field_invalid.move +--- +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/move_field_invalid.move:13:9 + │ +12 │ let f = &s.f; + │ ---- It is still being borrowed by this reference +13 │ move s; + │ ^^^^^^ Invalid move of variable 's' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/move_field_invalid.move:18:9 + │ +17 │ let f = &mut s.f; + │ -------- It is still being mutably borrowed by this reference +18 │ move s; + │ ^^^^^^ Invalid move of variable 's' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/move_field_invalid.move:23:9 + │ +22 │ let f = id(&s.f); + │ -------- It is still being borrowed by this reference +23 │ move s; + │ ^^^^^^ Invalid move of variable 's' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/move_field_invalid.move:28:9 + │ +27 │ let f = id_mut(&mut s.f); + │ ---------------- It is still being mutably borrowed by this reference +28 │ move s; + │ ^^^^^^ Invalid move of variable 's' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_full.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_full.snap new file mode 100644 index 0000000000000..390d377f2f9ed --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_full.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/move_full.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_full_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_full_invalid.exp deleted file mode 100644 index 149c8287b4e62..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_full_invalid.exp +++ /dev/null @@ -1,32 +0,0 @@ -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/move_full_invalid.move:13:9 - │ -12 │ let f = &x; - │ -- It is still being borrowed by this reference -13 │ move x; - │ ^^^^^^ Invalid move of variable 'x' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/move_full_invalid.move:18:9 - │ -17 │ let f = &mut x; - │ ------ It is still being mutably borrowed by this reference -18 │ move x; - │ ^^^^^^ Invalid move of variable 'x' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/move_full_invalid.move:23:9 - │ -22 │ let f = id(&x); - │ ------ It is still being borrowed by this reference -23 │ move x; - │ ^^^^^^ Invalid move of variable 'x' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/move_full_invalid.move:28:9 - │ -27 │ let f = id_mut(&mut x); - │ -------------- It is still being mutably borrowed by this reference -28 │ move x; - │ ^^^^^^ Invalid move of variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_full_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_full_invalid.snap new file mode 100644 index 0000000000000..7b181b03897bd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/move_full_invalid.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/move_full_invalid.move +--- +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/move_full_invalid.move:13:9 + │ +12 │ let f = &x; + │ -- It is still being borrowed by this reference +13 │ move x; + │ ^^^^^^ Invalid move of variable 'x' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/move_full_invalid.move:18:9 + │ +17 │ let f = &mut x; + │ ------ It is still being mutably borrowed by this reference +18 │ move x; + │ ^^^^^^ Invalid move of variable 'x' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/move_full_invalid.move:23:9 + │ +22 │ let f = id(&x); + │ ------ It is still being borrowed by this reference +23 │ move x; + │ ^^^^^^ Invalid move of variable 'x' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/move_full_invalid.move:28:9 + │ +27 │ let f = id_mut(&mut x); + │ -------------- It is still being mutably borrowed by this reference +28 │ move x; + │ ^^^^^^ Invalid move of variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_combo.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_combo.snap new file mode 100644 index 0000000000000..b8d0fe8d075cf --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_combo.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/mutate_combo.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_combo_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_combo_invalid.exp deleted file mode 100644 index ff56d53a19770..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_combo_invalid.exp +++ /dev/null @@ -1,42 +0,0 @@ -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/mutate_combo_invalid.move:14:9 - │ -13 │ if (cond) f = &s.f else f = &s.g; - │ ---- ---- Field 'g' is still being borrowed by this reference - │ │ - │ Field 'f' is still being borrowed by this reference -14 │ *s = S { f: 0, g: 0 }; - │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/mutate_combo_invalid.move:23:9 - │ -22 │ if (cond) f = &mut s.f else f = &mut other.f; - │ -------- Field 'f' is still being mutably borrowed by this reference -23 │ *s = S { f: 0, g: 0 }; - │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/mutate_combo_invalid.move:32:9 - │ -31 │ if (cond) f = s else f = other; - │ - It is still being mutably borrowed by this reference -32 │ *s = S { f: 0, g: 0 }; - │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/mutate_combo_invalid.move:41:9 - │ -40 │ if (cond) f = id_mut(s) else f = other; - │ --------- It is still being mutably borrowed by this reference -41 │ *s = S { f: 0, g: 0 }; - │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/mutate_combo_invalid.move:49:19 - │ -48 │ let f = &s.f; - │ ---- Field 'f' is still being borrowed by this reference -49 │ if (cond) *s = S { f: 0, g: 0 }; - │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_combo_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_combo_invalid.snap new file mode 100644 index 0000000000000..9727f655cf61b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_combo_invalid.snap @@ -0,0 +1,49 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/mutate_combo_invalid.move +--- +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/mutate_combo_invalid.move:14:9 + │ +13 │ if (cond) f = &s.f else f = &s.g; + │ ---- ---- Field 'g' is still being borrowed by this reference + │ │ + │ Field 'f' is still being borrowed by this reference +14 │ *s = S { f: 0, g: 0 }; + │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/mutate_combo_invalid.move:23:9 + │ +22 │ if (cond) f = &mut s.f else f = &mut other.f; + │ -------- Field 'f' is still being mutably borrowed by this reference +23 │ *s = S { f: 0, g: 0 }; + │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/mutate_combo_invalid.move:32:9 + │ +31 │ if (cond) f = s else f = other; + │ - It is still being mutably borrowed by this reference +32 │ *s = S { f: 0, g: 0 }; + │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/mutate_combo_invalid.move:41:9 + │ +40 │ if (cond) f = id_mut(s) else f = other; + │ --------- It is still being mutably borrowed by this reference +41 │ *s = S { f: 0, g: 0 }; + │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/mutate_combo_invalid.move:49:19 + │ +48 │ let f = &s.f; + │ ---- Field 'f' is still being borrowed by this reference +49 │ if (cond) *s = S { f: 0, g: 0 }; + │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_field.snap new file mode 100644 index 0000000000000..ebbbc4c7c100e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_field.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/mutate_field.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_field_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_field_invalid.exp deleted file mode 100644 index 99a4ffc8de477..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_field_invalid.exp +++ /dev/null @@ -1,32 +0,0 @@ -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/mutate_field_invalid.move:11:9 - │ -10 │ let f = &s.f; - │ ---- Field 'f' is still being borrowed by this reference -11 │ *s = S { f: 0, g: 0 }; - │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/mutate_field_invalid.move:15:9 - │ -14 │ let f = &mut s.f; - │ -------- Field 'f' is still being mutably borrowed by this reference -15 │ *s = S { f: 0, g: 0 }; - │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/mutate_field_invalid.move:19:9 - │ -18 │ let f = id(&s.f); - │ -------- Field 'f' is still being borrowed by this reference -19 │ *s = S { f: 0, g: 0 }; - │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/mutate_field_invalid.move:23:9 - │ -22 │ let f = id_mut(&mut s.f); - │ ---------------- Field 'f' is still being mutably borrowed by this reference -23 │ *s = S { f: 0, g: 0 }; - │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_field_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_field_invalid.snap new file mode 100644 index 0000000000000..c0a5d73811996 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_field_invalid.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/mutate_field_invalid.move +--- +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/mutate_field_invalid.move:11:9 + │ +10 │ let f = &s.f; + │ ---- Field 'f' is still being borrowed by this reference +11 │ *s = S { f: 0, g: 0 }; + │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/mutate_field_invalid.move:15:9 + │ +14 │ let f = &mut s.f; + │ -------- Field 'f' is still being mutably borrowed by this reference +15 │ *s = S { f: 0, g: 0 }; + │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/mutate_field_invalid.move:19:9 + │ +18 │ let f = id(&s.f); + │ -------- Field 'f' is still being borrowed by this reference +19 │ *s = S { f: 0, g: 0 }; + │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/mutate_field_invalid.move:23:9 + │ +22 │ let f = id_mut(&mut s.f); + │ ---------------- Field 'f' is still being mutably borrowed by this reference +23 │ *s = S { f: 0, g: 0 }; + │ ^^^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_full.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_full.snap new file mode 100644 index 0000000000000..3b70d672b2d70 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_full.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/mutate_full.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_full_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_full_invalid.exp deleted file mode 100644 index c306b64436758..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_full_invalid.exp +++ /dev/null @@ -1,32 +0,0 @@ -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/mutate_full_invalid.move:13:9 - │ -12 │ let f = x; - │ - It is still being mutably borrowed by this reference -13 │ *x = 0; - │ ^^^^^^ Invalid mutation of reference. - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/mutate_full_invalid.move:18:9 - │ -17 │ let f = freeze(x); - │ --------- It is still being borrowed by this reference -18 │ *x = 0; - │ ^^^^^^ Invalid mutation of reference. - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/mutate_full_invalid.move:23:9 - │ -22 │ let f = id(x); - │ ----- It is still being borrowed by this reference -23 │ *x = 0; - │ ^^^^^^ Invalid mutation of reference. - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/borrows/mutate_full_invalid.move:28:9 - │ -27 │ let f = id_mut(x); - │ --------- It is still being mutably borrowed by this reference -28 │ *x = 0; - │ ^^^^^^ Invalid mutation of reference. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_full_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_full_invalid.snap new file mode 100644 index 0000000000000..1631d8c75f120 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/mutate_full_invalid.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/mutate_full_invalid.move +--- +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/mutate_full_invalid.move:13:9 + │ +12 │ let f = x; + │ - It is still being mutably borrowed by this reference +13 │ *x = 0; + │ ^^^^^^ Invalid mutation of reference. + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/mutate_full_invalid.move:18:9 + │ +17 │ let f = freeze(x); + │ --------- It is still being borrowed by this reference +18 │ *x = 0; + │ ^^^^^^ Invalid mutation of reference. + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/mutate_full_invalid.move:23:9 + │ +22 │ let f = id(x); + │ ----- It is still being borrowed by this reference +23 │ *x = 0; + │ ^^^^^^ Invalid mutation of reference. + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/borrows/mutate_full_invalid.move:28:9 + │ +27 │ let f = id_mut(x); + │ --------- It is still being mutably borrowed by this reference +28 │ *x = 0; + │ ^^^^^^ Invalid mutation of reference. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/release_cycle.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/release_cycle.snap new file mode 100644 index 0000000000000..a783cb1c87711 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/release_cycle.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/release_cycle.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_borrowed_local.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_borrowed_local.snap new file mode 100644 index 0000000000000..e17603078db88 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_borrowed_local.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/return_borrowed_local.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_borrowed_local_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_borrowed_local_invalid.exp deleted file mode 100644 index a4c517eb8b963..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_borrowed_local_invalid.exp +++ /dev/null @@ -1,106 +0,0 @@ -error[E07004]: invalid return of locally borrowed state - ┌─ tests/move_check/borrows/return_borrowed_local_invalid.move:19:9 - │ -19 │ ╭ (&mut v1, -20 │ │ &v2, -21 │ │ id_mut(&mut v3), -22 │ │ id(&v4), -23 │ │ &mut s1.f, - │ │ --------- It is still being mutably borrowed by this reference -24 │ │ &s2.f, -25 │ │ id_mut(&mut s3.f), -26 │ │ id(&s4.f)) - │ ╰──────────────────^ Invalid return. Local variable 's1' is still being borrowed. - -error[E07004]: invalid return of locally borrowed state - ┌─ tests/move_check/borrows/return_borrowed_local_invalid.move:19:9 - │ -19 │ ╭ (&mut v1, -20 │ │ &v2, -21 │ │ id_mut(&mut v3), -22 │ │ id(&v4), -23 │ │ &mut s1.f, -24 │ │ &s2.f, - │ │ ----- It is still being borrowed by this reference -25 │ │ id_mut(&mut s3.f), -26 │ │ id(&s4.f)) - │ ╰──────────────────^ Invalid return. Local variable 's2' is still being borrowed. - -error[E07004]: invalid return of locally borrowed state - ┌─ tests/move_check/borrows/return_borrowed_local_invalid.move:19:9 - │ -19 │ ╭ (&mut v1, -20 │ │ &v2, -21 │ │ id_mut(&mut v3), -22 │ │ id(&v4), - · │ -25 │ │ id_mut(&mut s3.f), - │ │ ----------------- It is still being mutably borrowed by this reference -26 │ │ id(&s4.f)) - │ ╰──────────────────^ Invalid return. Local variable 's3' is still being borrowed. - -error[E07004]: invalid return of locally borrowed state - ┌─ tests/move_check/borrows/return_borrowed_local_invalid.move:19:9 - │ -19 │ ╭ (&mut v1, -20 │ │ &v2, -21 │ │ id_mut(&mut v3), -22 │ │ id(&v4), - · │ -25 │ │ id_mut(&mut s3.f), -26 │ │ id(&s4.f)) - │ │ --------- It is still being borrowed by this reference - │ ╰──────────────────^ Invalid return. Local variable 's4' is still being borrowed. - -error[E07004]: invalid return of locally borrowed state - ┌─ tests/move_check/borrows/return_borrowed_local_invalid.move:19:9 - │ -19 │ ╭ (&mut v1, - │ ------- It is still being mutably borrowed by this reference -20 │ │ &v2, -21 │ │ id_mut(&mut v3), -22 │ │ id(&v4), - · │ -25 │ │ id_mut(&mut s3.f), -26 │ │ id(&s4.f)) - │ ╰──────────────────^ Invalid return. Local variable 'v1' is still being borrowed. - -error[E07004]: invalid return of locally borrowed state - ┌─ tests/move_check/borrows/return_borrowed_local_invalid.move:19:9 - │ -19 │ ╭ (&mut v1, -20 │ │ &v2, - │ │ --- It is still being borrowed by this reference -21 │ │ id_mut(&mut v3), -22 │ │ id(&v4), - · │ -25 │ │ id_mut(&mut s3.f), -26 │ │ id(&s4.f)) - │ ╰──────────────────^ Invalid return. Local variable 'v2' is still being borrowed. - -error[E07004]: invalid return of locally borrowed state - ┌─ tests/move_check/borrows/return_borrowed_local_invalid.move:19:9 - │ -19 │ ╭ (&mut v1, -20 │ │ &v2, -21 │ │ id_mut(&mut v3), - │ │ --------------- It is still being mutably borrowed by this reference -22 │ │ id(&v4), - · │ -25 │ │ id_mut(&mut s3.f), -26 │ │ id(&s4.f)) - │ ╰──────────────────^ Invalid return. Local variable 'v3' is still being borrowed. - -error[E07004]: invalid return of locally borrowed state - ┌─ tests/move_check/borrows/return_borrowed_local_invalid.move:19:9 - │ -19 │ ╭ (&mut v1, -20 │ │ &v2, -21 │ │ id_mut(&mut v3), -22 │ │ id(&v4), - │ │ ------- It is still being borrowed by this reference - · │ -25 │ │ id_mut(&mut s3.f), -26 │ │ id(&s4.f)) - │ ╰──────────────────^ Invalid return. Local variable 'v4' is still being borrowed. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_borrowed_local_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_borrowed_local_invalid.snap new file mode 100644 index 0000000000000..a90487aa57cb5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_borrowed_local_invalid.snap @@ -0,0 +1,113 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/return_borrowed_local_invalid.move +--- +error[E07004]: invalid return of locally borrowed state + ┌─ tests/move_check/borrows/return_borrowed_local_invalid.move:19:9 + │ +19 │ ╭ (&mut v1, +20 │ │ &v2, +21 │ │ id_mut(&mut v3), +22 │ │ id(&v4), +23 │ │ &mut s1.f, + │ │ --------- It is still being mutably borrowed by this reference +24 │ │ &s2.f, +25 │ │ id_mut(&mut s3.f), +26 │ │ id(&s4.f)) + │ ╰──────────────────^ Invalid return. Local variable 's1' is still being borrowed. + +error[E07004]: invalid return of locally borrowed state + ┌─ tests/move_check/borrows/return_borrowed_local_invalid.move:19:9 + │ +19 │ ╭ (&mut v1, +20 │ │ &v2, +21 │ │ id_mut(&mut v3), +22 │ │ id(&v4), +23 │ │ &mut s1.f, +24 │ │ &s2.f, + │ │ ----- It is still being borrowed by this reference +25 │ │ id_mut(&mut s3.f), +26 │ │ id(&s4.f)) + │ ╰──────────────────^ Invalid return. Local variable 's2' is still being borrowed. + +error[E07004]: invalid return of locally borrowed state + ┌─ tests/move_check/borrows/return_borrowed_local_invalid.move:19:9 + │ +19 │ ╭ (&mut v1, +20 │ │ &v2, +21 │ │ id_mut(&mut v3), +22 │ │ id(&v4), + · │ +25 │ │ id_mut(&mut s3.f), + │ │ ----------------- It is still being mutably borrowed by this reference +26 │ │ id(&s4.f)) + │ ╰──────────────────^ Invalid return. Local variable 's3' is still being borrowed. + +error[E07004]: invalid return of locally borrowed state + ┌─ tests/move_check/borrows/return_borrowed_local_invalid.move:19:9 + │ +19 │ ╭ (&mut v1, +20 │ │ &v2, +21 │ │ id_mut(&mut v3), +22 │ │ id(&v4), + · │ +25 │ │ id_mut(&mut s3.f), +26 │ │ id(&s4.f)) + │ │ --------- It is still being borrowed by this reference + │ ╰──────────────────^ Invalid return. Local variable 's4' is still being borrowed. + +error[E07004]: invalid return of locally borrowed state + ┌─ tests/move_check/borrows/return_borrowed_local_invalid.move:19:9 + │ +19 │ ╭ (&mut v1, + │ ------- It is still being mutably borrowed by this reference +20 │ │ &v2, +21 │ │ id_mut(&mut v3), +22 │ │ id(&v4), + · │ +25 │ │ id_mut(&mut s3.f), +26 │ │ id(&s4.f)) + │ ╰──────────────────^ Invalid return. Local variable 'v1' is still being borrowed. + +error[E07004]: invalid return of locally borrowed state + ┌─ tests/move_check/borrows/return_borrowed_local_invalid.move:19:9 + │ +19 │ ╭ (&mut v1, +20 │ │ &v2, + │ │ --- It is still being borrowed by this reference +21 │ │ id_mut(&mut v3), +22 │ │ id(&v4), + · │ +25 │ │ id_mut(&mut s3.f), +26 │ │ id(&s4.f)) + │ ╰──────────────────^ Invalid return. Local variable 'v2' is still being borrowed. + +error[E07004]: invalid return of locally borrowed state + ┌─ tests/move_check/borrows/return_borrowed_local_invalid.move:19:9 + │ +19 │ ╭ (&mut v1, +20 │ │ &v2, +21 │ │ id_mut(&mut v3), + │ │ --------------- It is still being mutably borrowed by this reference +22 │ │ id(&v4), + · │ +25 │ │ id_mut(&mut s3.f), +26 │ │ id(&s4.f)) + │ ╰──────────────────^ Invalid return. Local variable 'v3' is still being borrowed. + +error[E07004]: invalid return of locally borrowed state + ┌─ tests/move_check/borrows/return_borrowed_local_invalid.move:19:9 + │ +19 │ ╭ (&mut v1, +20 │ │ &v2, +21 │ │ id_mut(&mut v3), +22 │ │ id(&v4), + │ │ ------- It is still being borrowed by this reference + · │ +25 │ │ id_mut(&mut s3.f), +26 │ │ id(&s4.f)) + │ ╰──────────────────^ Invalid return. Local variable 'v4' is still being borrowed. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_mutual_borrows.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_mutual_borrows.snap new file mode 100644 index 0000000000000..2fe1d1ba99201 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_mutual_borrows.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/return_mutual_borrows.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_mutual_borrows_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_mutual_borrows_invalid.exp deleted file mode 100644 index 8c3bae8d89192..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_mutual_borrows_invalid.exp +++ /dev/null @@ -1,84 +0,0 @@ -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:15:9 - │ -14 │ let f = freeze(s1); - │ ---------- It is still being borrowed by this reference -15 │ (s1, f) - │ ^^^^^^^ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:19:9 - │ -18 │ let f = &s1.f; - │ ----- Field 'f' is still being borrowed by this reference -19 │ (s1, f) - │ ^^^^^^^ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:23:9 - │ -22 │ let f = &s1.f; - │ ----- It is still being borrowed by this reference -23 │ (&mut s1.f, f) - │ ^^^^^^^^^^^^^^ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:27:9 - │ -26 │ let f = id(&s1.f); - │ --------- It is still being borrowed by this reference -27 │ (&mut s1.f, f) - │ ^^^^^^^^^^^^^^ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:31:9 - │ -31 │ (s1, s1) - │ ^^^^^^^^ - │ ││ - │ │It is still being mutably borrowed by this reference - │ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:35:9 - │ -34 │ let f = &mut s1.f; - │ --------- Field 'f' is still being mutably borrowed by this reference -35 │ (s1, f) - │ ^^^^^^^ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:38:9 - │ -38 │ (&mut s1.f, s1) - │ ^^^^^^^^^^^^^^^ - │ ││ - │ │Field 'f' is still being mutably borrowed by this reference - │ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:41:9 - │ -41 │ (id_mut(s1), s1) - │ ^^^^^^^^^^^^^^^^ - │ ││ - │ │It is still being mutably borrowed by this reference - │ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:45:9 - │ -44 │ let f = id_mut(&mut s1.f); - │ ----------------- Field 'f' is still being mutably borrowed by this reference -45 │ (s1, f) - │ ^^^^^^^ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:48:9 - │ -48 │ (id_mut(&mut s1.f), s1) - │ ^^^^^^^^^^^^^^^^^^^^^^^ - │ ││ - │ │Field 'f' is still being mutably borrowed by this reference - │ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_mutual_borrows_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_mutual_borrows_invalid.snap new file mode 100644 index 0000000000000..2bef327f83823 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_mutual_borrows_invalid.snap @@ -0,0 +1,91 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/return_mutual_borrows_invalid.move +--- +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:15:9 + │ +14 │ let f = freeze(s1); + │ ---------- It is still being borrowed by this reference +15 │ (s1, f) + │ ^^^^^^^ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:19:9 + │ +18 │ let f = &s1.f; + │ ----- Field 'f' is still being borrowed by this reference +19 │ (s1, f) + │ ^^^^^^^ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:23:9 + │ +22 │ let f = &s1.f; + │ ----- It is still being borrowed by this reference +23 │ (&mut s1.f, f) + │ ^^^^^^^^^^^^^^ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:27:9 + │ +26 │ let f = id(&s1.f); + │ --------- It is still being borrowed by this reference +27 │ (&mut s1.f, f) + │ ^^^^^^^^^^^^^^ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:31:9 + │ +31 │ (s1, s1) + │ ^^^^^^^^ + │ ││ + │ │It is still being mutably borrowed by this reference + │ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:35:9 + │ +34 │ let f = &mut s1.f; + │ --------- Field 'f' is still being mutably borrowed by this reference +35 │ (s1, f) + │ ^^^^^^^ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:38:9 + │ +38 │ (&mut s1.f, s1) + │ ^^^^^^^^^^^^^^^ + │ ││ + │ │Field 'f' is still being mutably borrowed by this reference + │ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:41:9 + │ +41 │ (id_mut(s1), s1) + │ ^^^^^^^^^^^^^^^^ + │ ││ + │ │It is still being mutably borrowed by this reference + │ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:45:9 + │ +44 │ let f = id_mut(&mut s1.f); + │ ----------------- Field 'f' is still being mutably borrowed by this reference +45 │ (s1, f) + │ ^^^^^^^ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/borrows/return_mutual_borrows_invalid.move:48:9 + │ +48 │ (id_mut(&mut s1.f), s1) + │ ^^^^^^^^^^^^^^^^^^^^^^^ + │ ││ + │ │Field 'f' is still being mutably borrowed by this reference + │ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_values_are_not_unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_values_are_not_unused.snap new file mode 100644 index 0000000000000..2fc344d9a130b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_values_are_not_unused.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/return_values_are_not_unused.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_values_are_not_unused@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_values_are_not_unused@unused.snap new file mode 100644 index 0000000000000..2fc344d9a130b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/return_values_are_not_unused@unused.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/return_values_are_not_unused.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_branches.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_branches.snap new file mode 100644 index 0000000000000..de427feba200b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_branches.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/unused_mut_ref_branches.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_branches.unused.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_branches.unused.exp deleted file mode 100644 index fd7fd14b9eab8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_branches.unused.exp +++ /dev/null @@ -1,26 +0,0 @@ -warning[W09014]: unused mutable reference '&mut' parameter - ┌─ tests/move_check/borrows/unused_mut_ref_branches.move:3:51 - │ -3 │ public(friend) fun both_unused(cond: bool, x: &mut u64) { - │ - ^^^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead - │ │ - │ For parameters, this can be silenced by prefixing the name with an underscore, e.g. '_x' - │ - = This warning can be suppressed with '#[allow(unused_mut_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09013]: unused mutable reference '&mut' - ┌─ tests/move_check/borrows/unused_mut_ref_branches.move:5:31 - │ -5 │ if (cond) copy x else &mut i; - │ ^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead - │ - = This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09013]: unused mutable reference '&mut' - ┌─ tests/move_check/borrows/unused_mut_ref_branches.move:11:31 - │ -11 │ if (cond) copy x else &mut i; - │ ^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead - │ - = This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_branches@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_branches@unused.snap new file mode 100644 index 0000000000000..19108ab4608f5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_branches@unused.snap @@ -0,0 +1,33 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/unused_mut_ref_branches.move +--- +warning[W09014]: unused mutable reference '&mut' parameter + ┌─ tests/move_check/borrows/unused_mut_ref_branches.move:3:51 + │ +3 │ public(friend) fun both_unused(cond: bool, x: &mut u64) { + │ - ^^^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead + │ │ + │ For parameters, this can be silenced by prefixing the name with an underscore, e.g. '_x' + │ + = This warning can be suppressed with '#[allow(unused_mut_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09013]: unused mutable reference '&mut' + ┌─ tests/move_check/borrows/unused_mut_ref_branches.move:5:31 + │ +5 │ if (cond) copy x else &mut i; + │ ^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead + │ + = This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09013]: unused mutable reference '&mut' + ┌─ tests/move_check/borrows/unused_mut_ref_branches.move:11:31 + │ +11 │ if (cond) copy x else &mut i; + │ ^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead + │ + = This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_invalid.snap new file mode 100644 index 0000000000000..26db5850218e8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_invalid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_invalid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_invalid.unused.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_invalid.unused.exp deleted file mode 100644 index b9f57922e41a1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_invalid.unused.exp +++ /dev/null @@ -1,24 +0,0 @@ -warning[W09013]: unused mutable reference '&mut' - ┌─ tests/move_check/borrows/unused_mut_ref_field_invalid.move:9:23 - │ -9 │ let param_f = &mut param.f; - │ ^^^^^^^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead - │ - = This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09013]: unused mutable reference '&mut' - ┌─ tests/move_check/borrows/unused_mut_ref_field_invalid.move:10:19 - │ -10 │ let r_f = &mut r.f; - │ ^^^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead - │ - = This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09013]: unused mutable reference '&mut' - ┌─ tests/move_check/borrows/unused_mut_ref_field_invalid.move:11:9 - │ -11 │ &mut S { f: 0 }.f; - │ ^^^^^^^^^^^^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead - │ - = This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_invalid@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_invalid@unused.snap new file mode 100644 index 0000000000000..507864bff9b2c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_invalid@unused.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_invalid.move +--- +warning[W09013]: unused mutable reference '&mut' + ┌─ tests/move_check/borrows/unused_mut_ref_field_invalid.move:9:23 + │ +9 │ let param_f = &mut param.f; + │ ^^^^^^^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead + │ + = This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09013]: unused mutable reference '&mut' + ┌─ tests/move_check/borrows/unused_mut_ref_field_invalid.move:10:19 + │ +10 │ let r_f = &mut r.f; + │ ^^^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead + │ + = This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09013]: unused mutable reference '&mut' + ┌─ tests/move_check/borrows/unused_mut_ref_field_invalid.move:11:9 + │ +11 │ &mut S { f: 0 }.f; + │ ^^^^^^^^^^^^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead + │ + = This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_valid_usage.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_valid_usage.snap new file mode 100644 index 0000000000000..9fb437532742c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_valid_usage.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_valid_usage.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_valid_usage@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_valid_usage@unused.snap new file mode 100644 index 0000000000000..9fb437532742c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_valid_usage@unused.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/unused_mut_ref_field_valid_usage.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_immutable_usage.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_immutable_usage.snap new file mode 100644 index 0000000000000..99c06257bf40c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_immutable_usage.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/unused_mut_ref_immutable_usage.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_immutable_usage.unused.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_immutable_usage.unused.exp deleted file mode 100644 index 2eb85aa3e391d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_immutable_usage.unused.exp +++ /dev/null @@ -1,18 +0,0 @@ -warning[W09014]: unused mutable reference '&mut' parameter - ┌─ tests/move_check/borrows/unused_mut_ref_immutable_usage.move:5:33 - │ -5 │ public(friend) fun param(x: &mut S): &S { - │ - ^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead - │ │ - │ For parameters, this can be silenced by prefixing the name with an underscore, e.g. '_x' - │ - = This warning can be suppressed with '#[allow(unused_mut_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09013]: unused mutable reference '&mut' - ┌─ tests/move_check/borrows/unused_mut_ref_immutable_usage.move:17:17 - │ -17 │ let x = &mut s; - │ ^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead - │ - = This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_immutable_usage@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_immutable_usage@unused.snap new file mode 100644 index 0000000000000..a86498fb1af71 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_immutable_usage@unused.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/unused_mut_ref_immutable_usage.move +--- +warning[W09014]: unused mutable reference '&mut' parameter + ┌─ tests/move_check/borrows/unused_mut_ref_immutable_usage.move:5:33 + │ +5 │ public(friend) fun param(x: &mut S): &S { + │ - ^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead + │ │ + │ For parameters, this can be silenced by prefixing the name with an underscore, e.g. '_x' + │ + = This warning can be suppressed with '#[allow(unused_mut_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09013]: unused mutable reference '&mut' + ┌─ tests/move_check/borrows/unused_mut_ref_immutable_usage.move:17:17 + │ +17 │ let x = &mut s; + │ ^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead + │ + = This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_simple_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_simple_invalid.snap new file mode 100644 index 0000000000000..a41d6597b0098 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_simple_invalid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/unused_mut_ref_simple_invalid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_simple_invalid.unused.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_simple_invalid.unused.exp deleted file mode 100644 index 0a1ce9f594efc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_simple_invalid.unused.exp +++ /dev/null @@ -1,36 +0,0 @@ -warning[W09014]: unused mutable reference '&mut' parameter - ┌─ tests/move_check/borrows/unused_mut_ref_simple_invalid.move:3:34 - │ -3 │ public(friend) fun unused(x: &mut u64) { - │ - ^^^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead - │ │ - │ For parameters, this can be silenced by prefixing the name with an underscore, e.g. '_x' - │ - = This warning can be suppressed with '#[allow(unused_mut_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09013]: unused mutable reference '&mut' - ┌─ tests/move_check/borrows/unused_mut_ref_simple_invalid.move:5:17 - │ -5 │ let r = &mut i; - │ ^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead - │ - = This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09013]: unused mutable reference '&mut' - ┌─ tests/move_check/borrows/unused_mut_ref_simple_invalid.move:7:9 - │ -7 │ &mut 0; - │ ^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead - │ - = This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09014]: unused mutable reference '&mut' parameter - ┌─ tests/move_check/borrows/unused_mut_ref_simple_invalid.move:13:31 - │ -13 │ public(friend) fun ret(x: &mut u64): &u64 { - │ - ^^^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead - │ │ - │ For parameters, this can be silenced by prefixing the name with an underscore, e.g. '_x' - │ - = This warning can be suppressed with '#[allow(unused_mut_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_simple_invalid@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_simple_invalid@unused.snap new file mode 100644 index 0000000000000..30a5537a6b63d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_simple_invalid@unused.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/unused_mut_ref_simple_invalid.move +--- +warning[W09014]: unused mutable reference '&mut' parameter + ┌─ tests/move_check/borrows/unused_mut_ref_simple_invalid.move:3:34 + │ +3 │ public(friend) fun unused(x: &mut u64) { + │ - ^^^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead + │ │ + │ For parameters, this can be silenced by prefixing the name with an underscore, e.g. '_x' + │ + = This warning can be suppressed with '#[allow(unused_mut_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09013]: unused mutable reference '&mut' + ┌─ tests/move_check/borrows/unused_mut_ref_simple_invalid.move:5:17 + │ +5 │ let r = &mut i; + │ ^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead + │ + = This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09013]: unused mutable reference '&mut' + ┌─ tests/move_check/borrows/unused_mut_ref_simple_invalid.move:7:9 + │ +7 │ &mut 0; + │ ^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead + │ + = This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09014]: unused mutable reference '&mut' parameter + ┌─ tests/move_check/borrows/unused_mut_ref_simple_invalid.move:13:31 + │ +13 │ public(friend) fun ret(x: &mut u64): &u64 { + │ - ^^^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead + │ │ + │ For parameters, this can be silenced by prefixing the name with an underscore, e.g. '_x' + │ + = This warning can be suppressed with '#[allow(unused_mut_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_underscore_param.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_underscore_param.snap new file mode 100644 index 0000000000000..34e606855e311 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_underscore_param.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/unused_mut_ref_underscore_param.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_underscore_param@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_underscore_param@unused.snap new file mode 100644 index 0000000000000..34e606855e311 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_underscore_param@unused.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/unused_mut_ref_underscore_param.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_unpack.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_unpack.snap new file mode 100644 index 0000000000000..e33b67447c670 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_unpack.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/unused_mut_ref_unpack.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_unpack.unused.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_unpack.unused.exp deleted file mode 100644 index b8d6ce6732cdb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_unpack.unused.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W09013]: unused mutable reference '&mut' - ┌─ tests/move_check/borrows/unused_mut_ref_unpack.move:15:17 - │ -15 │ let f = &mut f.f; - │ ^^^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead - │ - = This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_unpack@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_unpack@unused.snap new file mode 100644 index 0000000000000..295b79dfccf54 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_unpack@unused.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/unused_mut_ref_unpack.move +--- +warning[W09013]: unused mutable reference '&mut' + ┌─ tests/move_check/borrows/unused_mut_ref_unpack.move:15:17 + │ +15 │ let f = &mut f.f; + │ ^^^^^^^^ Mutable reference is never used mutably, consider switching to an immutable reference '&' instead + │ + = This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_valid_usages.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_valid_usages.snap new file mode 100644 index 0000000000000..1ce01f5e0b7d3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_mut_ref_valid_usages.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/unused_mut_ref_valid_usages.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_ref.exp b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_ref.exp deleted file mode 100644 index eab735f329766..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_ref.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04017]: too many arguments - ┌─ tests/move_check/borrows/unused_ref.move:28:5 - │ -28 │ borrow(&mut x, 0, 0); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 3 argument(s) here - │ Invalid call of '0x42::m::borrow'. The call expected 2 argument(s) but got 3 - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_ref.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_ref.snap new file mode 100644 index 0000000000000..ac12ce58e0f7e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/unused_ref.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/unused_ref.move +--- +error[E04017]: too many arguments + ┌─ tests/move_check/borrows/unused_ref.move:28:5 + │ +28 │ borrow(&mut x, 0, 0); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 3 argument(s) here + │ Invalid call of '0x42::m::borrow'. The call expected 2 argument(s) but got 3 diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_branches.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_branches.snap new file mode 100644 index 0000000000000..6c75acab414a6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_branches.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/used_mut_ref_branches.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_branches@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_branches@unused.snap new file mode 100644 index 0000000000000..6c75acab414a6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_branches@unused.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/used_mut_ref_branches.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_branches_complicated.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_branches_complicated.snap new file mode 100644 index 0000000000000..45989daade1c0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_branches_complicated.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/used_mut_ref_branches_complicated.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_branches_complicated@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_branches_complicated@unused.snap new file mode 100644 index 0000000000000..45989daade1c0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_branches_complicated@unused.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/used_mut_ref_branches_complicated.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_in_loop.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_in_loop.snap new file mode 100644 index 0000000000000..c6d3d3326bd90 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_in_loop.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/used_mut_ref_in_loop.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_in_loop@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_in_loop@unused.snap new file mode 100644 index 0000000000000..c6d3d3326bd90 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_in_loop@unused.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/used_mut_ref_in_loop.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_unpack.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_unpack.snap new file mode 100644 index 0000000000000..c4ea06108414b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_unpack.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/used_mut_ref_unpack.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_unpack@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_unpack@unused.snap new file mode 100644 index 0000000000000..c4ea06108414b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/borrows/used_mut_ref_unpack@unused.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/borrows/used_mut_ref_unpack.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/control_flow/control_in_value_positions.snap b/external-crates/move/crates/move-compiler/tests/move_check/control_flow/control_in_value_positions.snap new file mode 100644 index 0000000000000..460f7a07c5828 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/control_flow/control_in_value_positions.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/control_flow/control_in_value_positions.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/control_flow/infinite_loop_with_dead_exits.exp b/external-crates/move/crates/move-compiler/tests/move_check/control_flow/infinite_loop_with_dead_exits.exp deleted file mode 100644 index 3f744ded80a33..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/control_flow/infinite_loop_with_dead_exits.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/control_flow/infinite_loop_with_dead_exits.move:13:17 - │ -13 │ if (return) break; - │ ^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/control_flow/infinite_loop_with_dead_exits.snap b/external-crates/move/crates/move-compiler/tests/move_check/control_flow/infinite_loop_with_dead_exits.snap new file mode 100644 index 0000000000000..1397166cbbf12 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/control_flow/infinite_loop_with_dead_exits.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/control_flow/infinite_loop_with_dead_exits.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/control_flow/infinite_loop_with_dead_exits.move:13:17 + │ +13 │ if (return) break; + │ ^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/control_flow/loop_after_loop.snap b/external-crates/move/crates/move-compiler/tests/move_check/control_flow/loop_after_loop.snap new file mode 100644 index 0000000000000..60f1410666f55 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/control_flow/loop_after_loop.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/control_flow/loop_after_loop.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/control_flow/loop_ambiguous_divergence.snap b/external-crates/move/crates/move-compiler/tests/move_check/control_flow/loop_ambiguous_divergence.snap new file mode 100644 index 0000000000000..3c27273226e79 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/control_flow/loop_ambiguous_divergence.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/control_flow/loop_ambiguous_divergence.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/control_flow/while_after_while.snap b/external-crates/move/crates/move-compiler/tests/move_check/control_flow/while_after_while.snap new file mode 100644 index 0000000000000..2532e209a47d3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/control_flow/while_after_while.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/control_flow/while_after_while.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/friend_cycle_2.exp b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/friend_cycle_2.exp deleted file mode 100644 index 93a732d617e3e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/friend_cycle_2.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E02004]: invalid 'module' declaration - ┌─ tests/move_check/dependencies/friend_cycle_2.move:8:5 - │ -4 │ friend 0x2::B; - │ -------------- '0x2::B' is a friend of '0x2::A' - · -8 │ friend 0x2::A; - │ ^^^^^^^^^^^^^^ '0x2::A' is a friend of '0x2::B'. This 'friend' relationship creates a dependency cycle. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/friend_cycle_2.snap b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/friend_cycle_2.snap new file mode 100644 index 0000000000000..62e765d184aa9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/friend_cycle_2.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/dependencies/friend_cycle_2.move +--- +error[E02004]: invalid 'module' declaration + ┌─ tests/move_check/dependencies/friend_cycle_2.move:8:5 + │ +4 │ friend 0x2::B; + │ -------------- '0x2::B' is a friend of '0x2::A' + · +8 │ friend 0x2::A; + │ ^^^^^^^^^^^^^^ '0x2::A' is a friend of '0x2::B'. This 'friend' relationship creates a dependency cycle. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/friend_cycle_3.exp b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/friend_cycle_3.exp deleted file mode 100644 index ccb850deb647c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/friend_cycle_3.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E02004]: invalid 'module' declaration - ┌─ tests/move_check/dependencies/friend_cycle_3.move:8:5 - │ - 4 │ friend 0x2::B; - │ -------------- '0x2::B' is a friend of '0x2::A' - · - 8 │ friend 0x2::C; - │ ^^^^^^^^^^^^^^ '0x2::C' is a friend of '0x2::B'. This 'friend' relationship creates a dependency cycle. - · -12 │ friend 0x2::A; - │ -------------- '0x2::A' is a friend of '0x2::C' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/friend_cycle_3.snap b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/friend_cycle_3.snap new file mode 100644 index 0000000000000..5692f8f121a81 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/friend_cycle_3.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/dependencies/friend_cycle_3.move +--- +error[E02004]: invalid 'module' declaration + ┌─ tests/move_check/dependencies/friend_cycle_3.move:8:5 + │ + 4 │ friend 0x2::B; + │ -------------- '0x2::B' is a friend of '0x2::A' + · + 8 │ friend 0x2::C; + │ ^^^^^^^^^^^^^^ '0x2::C' is a friend of '0x2::B'. This 'friend' relationship creates a dependency cycle. + · +12 │ friend 0x2::A; + │ -------------- '0x2::A' is a friend of '0x2::C' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/intersecting_friend_cycles.exp b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/intersecting_friend_cycles.exp deleted file mode 100644 index c8eda28cbf220..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/intersecting_friend_cycles.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E02004]: invalid 'module' declaration - ┌─ tests/move_check/dependencies/intersecting_friend_cycles.move:8:5 - │ - 4 │ friend 0x2::B; - │ -------------- '0x2::B' is a friend of '0x2::A' - · - 8 │ friend 0x2::C; - │ ^^^^^^^^^^^^^^ '0x2::C' is a friend of '0x2::B'. This 'friend' relationship creates a dependency cycle. - · -13 │ friend 0x2::A; - │ -------------- '0x2::A' is a friend of '0x2::C' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/intersecting_friend_cycles.snap b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/intersecting_friend_cycles.snap new file mode 100644 index 0000000000000..ed8da4babb243 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/intersecting_friend_cycles.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/dependencies/intersecting_friend_cycles.move +--- +error[E02004]: invalid 'module' declaration + ┌─ tests/move_check/dependencies/intersecting_friend_cycles.move:8:5 + │ + 4 │ friend 0x2::B; + │ -------------- '0x2::B' is a friend of '0x2::A' + · + 8 │ friend 0x2::C; + │ ^^^^^^^^^^^^^^ '0x2::C' is a friend of '0x2::B'. This 'friend' relationship creates a dependency cycle. + · +13 │ friend 0x2::A; + │ -------------- '0x2::A' is a friend of '0x2::C' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/intersecting_use_cycles.exp b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/intersecting_use_cycles.exp deleted file mode 100644 index d77a689caad2e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/intersecting_use_cycles.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E02004]: invalid 'module' declaration - ┌─ tests/move_check/dependencies/intersecting_use_cycles.move:10:14 - │ - 5 │ fun b(): 0x2::B::S { abort 0 } - │ --------- '0x2::B' uses '0x2::A' - · -10 │ fun c(): 0x2::C::S { abort 0 } - │ ^^^^^^^^^ '0x2::C' uses '0x2::B'. This 'use' relationship creates a dependency cycle. - · -17 │ fun A(): 0x2::A::S { abort 0 } - │ --------- '0x2::A' uses '0x2::C' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/intersecting_use_cycles.snap b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/intersecting_use_cycles.snap new file mode 100644 index 0000000000000..a4b281158a807 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/intersecting_use_cycles.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/dependencies/intersecting_use_cycles.move +--- +error[E02004]: invalid 'module' declaration + ┌─ tests/move_check/dependencies/intersecting_use_cycles.move:10:14 + │ + 5 │ fun b(): 0x2::B::S { abort 0 } + │ --------- '0x2::B' uses '0x2::A' + · +10 │ fun c(): 0x2::C::S { abort 0 } + │ ^^^^^^^^^ '0x2::C' uses '0x2::B'. This 'use' relationship creates a dependency cycle. + · +17 │ fun A(): 0x2::A::S { abort 0 } + │ --------- '0x2::A' uses '0x2::C' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/multiple_friend_cycles.exp b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/multiple_friend_cycles.exp deleted file mode 100644 index 1e36fe191063c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/multiple_friend_cycles.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E02004]: invalid 'module' declaration - ┌─ tests/move_check/dependencies/multiple_friend_cycles.move:8:5 - │ -4 │ friend 0x2::B; - │ -------------- '0x2::B' is a friend of '0x2::A' - · -8 │ friend 0x2::A; - │ ^^^^^^^^^^^^^^ '0x2::A' is a friend of '0x2::B'. This 'friend' relationship creates a dependency cycle. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/multiple_friend_cycles.snap b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/multiple_friend_cycles.snap new file mode 100644 index 0000000000000..66664b1add8d1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/multiple_friend_cycles.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/dependencies/multiple_friend_cycles.move +--- +error[E02004]: invalid 'module' declaration + ┌─ tests/move_check/dependencies/multiple_friend_cycles.move:8:5 + │ +4 │ friend 0x2::B; + │ -------------- '0x2::B' is a friend of '0x2::A' + · +8 │ friend 0x2::A; + │ ^^^^^^^^^^^^^^ '0x2::A' is a friend of '0x2::B'. This 'friend' relationship creates a dependency cycle. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/multiple_use_cycles.exp b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/multiple_use_cycles.exp deleted file mode 100644 index 5756c7026a251..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/multiple_use_cycles.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E02004]: invalid 'module' declaration - ┌─ tests/move_check/dependencies/multiple_use_cycles.move:25:14 - │ -25 │ fun f(): 0x2::F::S { abort 0 } - │ ^^^^^^^^^ '0x2::F' uses '0x2::D'. This 'use' relationship creates a dependency cycle. - · -35 │ fun d(): 0x2::D::S { abort 0 } - │ --------- '0x2::D' uses '0x2::F' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/multiple_use_cycles.snap b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/multiple_use_cycles.snap new file mode 100644 index 0000000000000..1b926a344eeb0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/multiple_use_cycles.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/dependencies/multiple_use_cycles.move +--- +error[E02004]: invalid 'module' declaration + ┌─ tests/move_check/dependencies/multiple_use_cycles.move:25:14 + │ +25 │ fun f(): 0x2::F::S { abort 0 } + │ ^^^^^^^^^ '0x2::F' uses '0x2::D'. This 'use' relationship creates a dependency cycle. + · +35 │ fun d(): 0x2::D::S { abort 0 } + │ --------- '0x2::D' uses '0x2::F' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_cycle_2.exp b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_cycle_2.exp deleted file mode 100644 index 0d619971ca1bf..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_cycle_2.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E02004]: invalid 'module' declaration - ┌─ tests/move_check/dependencies/use_cycle_2.move:5:9 - │ - 5 │ 0x2::B::foo() - │ ^^^^^^^^^^^^^ '0x2::B' uses '0x2::A'. This 'use' relationship creates a dependency cycle. - · -11 │ 0x2::A::foo() - │ ------------- '0x2::A' uses '0x2::B' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_cycle_2.snap b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_cycle_2.snap new file mode 100644 index 0000000000000..e5b27fc0431a5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_cycle_2.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/dependencies/use_cycle_2.move +--- +error[E02004]: invalid 'module' declaration + ┌─ tests/move_check/dependencies/use_cycle_2.move:5:9 + │ + 5 │ 0x2::B::foo() + │ ^^^^^^^^^^^^^ '0x2::B' uses '0x2::A'. This 'use' relationship creates a dependency cycle. + · +11 │ 0x2::A::foo() + │ ------------- '0x2::A' uses '0x2::B' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_cycle_3.exp b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_cycle_3.exp deleted file mode 100644 index e3fc8b2b7d2d0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_cycle_3.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E02004]: invalid 'module' declaration - ┌─ tests/move_check/dependencies/use_cycle_3.move:95:16 - │ - 85 │ fun foo(): 0x4::A::S { - │ --------- '0x4::A' uses '0x4::C' - · - 95 │ fun foo(): 0x4::C::S { - │ ^^^^^^^^^ '0x4::C' uses '0x4::B'. This 'use' relationship creates a dependency cycle. - · -106 │ fun foo(): 0x4::B::S { - │ --------- '0x4::B' uses '0x4::A' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_cycle_3.snap b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_cycle_3.snap new file mode 100644 index 0000000000000..87d3afd486864 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_cycle_3.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/dependencies/use_cycle_3.move +--- +error[E02004]: invalid 'module' declaration + ┌─ tests/move_check/dependencies/use_cycle_3.move:95:16 + │ + 85 │ fun foo(): 0x4::A::S { + │ --------- '0x4::A' uses '0x4::C' + · + 95 │ fun foo(): 0x4::C::S { + │ ^^^^^^^^^ '0x4::C' uses '0x4::B'. This 'use' relationship creates a dependency cycle. + · +106 │ fun foo(): 0x4::B::S { + │ --------- '0x4::B' uses '0x4::A' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_friend_direct.exp b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_friend_direct.exp deleted file mode 100644 index 579b59f617492..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_friend_direct.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E02004]: invalid 'module' declaration - ┌─ tests/move_check/dependencies/use_friend_direct.move:8:9 - │ -5 │ friend B; - │ --------- '0x2::B' is a friend of '0x2::A' - · -8 │ B::b() - │ ^^^^^^ '0x2::B' uses '0x2::A'. This 'use' relationship creates a dependency cycle. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_friend_direct.snap b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_friend_direct.snap new file mode 100644 index 0000000000000..88f006ae004a1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_friend_direct.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/dependencies/use_friend_direct.move +--- +error[E02004]: invalid 'module' declaration + ┌─ tests/move_check/dependencies/use_friend_direct.move:8:9 + │ +5 │ friend B; + │ --------- '0x2::B' is a friend of '0x2::A' + · +8 │ B::b() + │ ^^^^^^ '0x2::B' uses '0x2::A'. This 'use' relationship creates a dependency cycle. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_friend_transitive_by_friend.exp b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_friend_transitive_by_friend.exp deleted file mode 100644 index 480bc3d0c6f63..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_friend_transitive_by_friend.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E02004]: invalid 'module' declaration - ┌─ tests/move_check/dependencies/use_friend_transitive_by_friend.move:14:5 - │ - 6 │ friend B; - │ --------- '0x2::B' is a friend of '0x2::A' - · - 9 │ C::c() - │ ------ '0x2::C' uses '0x2::A' - · -14 │ friend 0x2::C; - │ ^^^^^^^^^^^^^^ '0x2::C' is a friend of '0x2::B'. This 'friend' relationship creates a dependency cycle. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_friend_transitive_by_friend.snap b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_friend_transitive_by_friend.snap new file mode 100644 index 0000000000000..be602b439912c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_friend_transitive_by_friend.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/dependencies/use_friend_transitive_by_friend.move +--- +error[E02004]: invalid 'module' declaration + ┌─ tests/move_check/dependencies/use_friend_transitive_by_friend.move:14:5 + │ + 6 │ friend B; + │ --------- '0x2::B' is a friend of '0x2::A' + · + 9 │ C::c() + │ ------ '0x2::C' uses '0x2::A' + · +14 │ friend 0x2::C; + │ ^^^^^^^^^^^^^^ '0x2::C' is a friend of '0x2::B'. This 'friend' relationship creates a dependency cycle. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_friend_transitive_by_use.exp b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_friend_transitive_by_use.exp deleted file mode 100644 index 0f5847436d413..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_friend_transitive_by_use.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E02004]: invalid 'module' declaration - ┌─ tests/move_check/dependencies/use_friend_transitive_by_use.move:16:9 - │ - 6 │ friend C; - │ --------- '0x2::C' is a friend of '0x2::A' - · - 9 │ B::b() - │ ------ '0x2::B' uses '0x2::A' - · -16 │ C::c() - │ ^^^^^^ '0x2::C' uses '0x2::B'. This 'use' relationship creates a dependency cycle. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_friend_transitive_by_use.snap b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_friend_transitive_by_use.snap new file mode 100644 index 0000000000000..25ede79a689b6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/dependencies/use_friend_transitive_by_use.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/dependencies/use_friend_transitive_by_use.move +--- +error[E02004]: invalid 'module' declaration + ┌─ tests/move_check/dependencies/use_friend_transitive_by_use.move:16:9 + │ + 6 │ friend C; + │ --------- '0x2::C' is a friend of '0x2::A' + · + 9 │ B::b() + │ ------ '0x2::B' uses '0x2::A' + · +16 │ C::c() + │ ^^^^^^ '0x2::C' uses '0x2::B'. This 'use' relationship creates a dependency cycle. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/deprecated/assert_function.exp b/external-crates/move/crates/move-compiler/tests/move_check/deprecated/assert_function.exp deleted file mode 100644 index 459fc6571b681..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/deprecated/assert_function.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/deprecated/assert_function.move:3:9 - │ -3 │ assert(true, 42); - │ ^^^^^^^^^^^^^^^^ 'assert' function syntax has been deprecated and will be removed - │ - = Replace with 'assert!'. 'assert' has been replaced with a 'assert!' built-in macro so that arguments are no longer eagerly evaluated - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/deprecated/assert_function.snap b/external-crates/move/crates/move-compiler/tests/move_check/deprecated/assert_function.snap new file mode 100644 index 0000000000000..0198a918f289a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/deprecated/assert_function.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/deprecated/assert_function.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/deprecated/assert_function.move:3:9 + │ +3 │ assert(true, 42); + │ ^^^^^^^^^^^^^^^^ 'assert' function syntax has been deprecated and will be removed + │ + = Replace with 'assert!'. 'assert' has been replaced with a 'assert!' built-in macro so that arguments are no longer eagerly evaluated diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/address_directives.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/address_directives.snap new file mode 100644 index 0000000000000..d96b438fcf3ee --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/address_directives.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/address_directives.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/address_directives_empty.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/address_directives_empty.snap new file mode 100644 index 0000000000000..83b21a0101acc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/address_directives_empty.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/address_directives_empty.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/almost_invalid_local_name.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/almost_invalid_local_name.snap new file mode 100644 index 0000000000000..96961ca244b49 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/almost_invalid_local_name.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/almost_invalid_local_name.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/assign_non_simple_name.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/assign_non_simple_name.exp deleted file mode 100644 index b0aab3ed851e6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/assign_non_simple_name.exp +++ /dev/null @@ -1,94 +0,0 @@ -error[E01009]: invalid assignment - ┌─ tests/move_check/expansion/assign_non_simple_name.move:16:9 - │ -16 │ X::S = (); - │ ^^^^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'X::S {}' - -error[E01009]: invalid assignment - ┌─ tests/move_check/expansion/assign_non_simple_name.move:17:9 - │ -17 │ Self::S = (); - │ ^^^^^^^^^^^^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'Self::S {}' - -error[E01009]: invalid assignment - ┌─ tests/move_check/expansion/assign_non_simple_name.move:18:9 - │ -18 │ Self::R = (); - │ ^^^^^^^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'Self::R {}' - -error[E01009]: invalid assignment - ┌─ tests/move_check/expansion/assign_non_simple_name.move:22:9 - │ -22 │ 0x42::X::S = (); - │ ^^^^^^^^^^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'0x42::X::S {}' - -error[E01009]: invalid assignment - ┌─ tests/move_check/expansion/assign_non_simple_name.move:23:9 - │ -23 │ 0x42::M::S = (); - │ ^^^^^^^^^^^^^^^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'0x42::M::S {}' - -error[E01009]: invalid assignment - ┌─ tests/move_check/expansion/assign_non_simple_name.move:24:9 - │ -24 │ 0x42::M::R = (); - │ ^^^^^^^^^^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'0x42::M::R {}' - -error[E01009]: invalid assignment - ┌─ tests/move_check/expansion/assign_non_simple_name.move:28:9 - │ -28 │ x = (); - │ ^^^^^^ Unexpected assignment of instantiated type without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'x {}' - -error[E01009]: invalid assignment - ┌─ tests/move_check/expansion/assign_non_simple_name.move:29:9 - │ -29 │ S = (); - │ ^^^^^^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'S {}' - -error[E01009]: invalid assignment - ┌─ tests/move_check/expansion/assign_non_simple_name.move:33:9 - │ -33 │ X = (); - │ ^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'X {}' - -error[E01009]: invalid assignment - ┌─ tests/move_check/expansion/assign_non_simple_name.move:34:9 - │ -34 │ S = (); - │ ^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'S {}' - -error[E01009]: invalid assignment - ┌─ tests/move_check/expansion/assign_non_simple_name.move:35:9 - │ -35 │ R = (); - │ ^ Unexpected assignment of module access without fields - │ - = If you are trying to unpack a struct, try adding fields, e.g.'R {}' - -error[E03009]: unbound variable - ┌─ tests/move_check/expansion/assign_non_simple_name.move:39:9 - │ -39 │ Y = 0; - │ ^ Invalid assignment. Unbound variable 'Y' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/assign_non_simple_name.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/assign_non_simple_name.snap new file mode 100644 index 0000000000000..2f80602811a94 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/assign_non_simple_name.snap @@ -0,0 +1,101 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/assign_non_simple_name.move +--- +error[E01009]: invalid assignment + ┌─ tests/move_check/expansion/assign_non_simple_name.move:16:9 + │ +16 │ X::S = (); + │ ^^^^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'X::S {}' + +error[E01009]: invalid assignment + ┌─ tests/move_check/expansion/assign_non_simple_name.move:17:9 + │ +17 │ Self::S = (); + │ ^^^^^^^^^^^^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'Self::S {}' + +error[E01009]: invalid assignment + ┌─ tests/move_check/expansion/assign_non_simple_name.move:18:9 + │ +18 │ Self::R = (); + │ ^^^^^^^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'Self::R {}' + +error[E01009]: invalid assignment + ┌─ tests/move_check/expansion/assign_non_simple_name.move:22:9 + │ +22 │ 0x42::X::S = (); + │ ^^^^^^^^^^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'0x42::X::S {}' + +error[E01009]: invalid assignment + ┌─ tests/move_check/expansion/assign_non_simple_name.move:23:9 + │ +23 │ 0x42::M::S = (); + │ ^^^^^^^^^^^^^^^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'0x42::M::S {}' + +error[E01009]: invalid assignment + ┌─ tests/move_check/expansion/assign_non_simple_name.move:24:9 + │ +24 │ 0x42::M::R = (); + │ ^^^^^^^^^^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'0x42::M::R {}' + +error[E01009]: invalid assignment + ┌─ tests/move_check/expansion/assign_non_simple_name.move:28:9 + │ +28 │ x = (); + │ ^^^^^^ Unexpected assignment of instantiated type without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'x {}' + +error[E01009]: invalid assignment + ┌─ tests/move_check/expansion/assign_non_simple_name.move:29:9 + │ +29 │ S = (); + │ ^^^^^^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'S {}' + +error[E01009]: invalid assignment + ┌─ tests/move_check/expansion/assign_non_simple_name.move:33:9 + │ +33 │ X = (); + │ ^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'X {}' + +error[E01009]: invalid assignment + ┌─ tests/move_check/expansion/assign_non_simple_name.move:34:9 + │ +34 │ S = (); + │ ^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'S {}' + +error[E01009]: invalid assignment + ┌─ tests/move_check/expansion/assign_non_simple_name.move:35:9 + │ +35 │ R = (); + │ ^ Unexpected assignment of module access without fields + │ + = If you are trying to unpack a struct, try adding fields, e.g.'R {}' + +error[E03009]: unbound variable + ┌─ tests/move_check/expansion/assign_non_simple_name.move:39:9 + │ +39 │ Y = 0; + │ ^ Invalid assignment. Unbound variable 'Y' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/constant_invalid_alias_names.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/constant_invalid_alias_names.exp deleted file mode 100644 index 0720620d6edac..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/constant_invalid_alias_names.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E02010]: invalid name - ┌─ tests/move_check/expansion/constant_invalid_alias_names.move:8:24 - │ -8 │ use 0x42::N::{C as c1, C as _C1, C as Self}; - │ ^^ Invalid constant alias name 'c1'. Constant alias names must start with 'A'..'Z' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/constant_invalid_alias_names.move:8:33 - │ -8 │ use 0x42::N::{C as c1, C as _C1, C as Self}; - │ ^^^ Invalid constant alias name '_C1'. Constant alias names must start with 'A'..'Z' - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/constant_invalid_alias_names.move:8:43 - │ -8 │ use 0x42::N::{C as c1, C as _C1, C as Self}; - │ ^^^^ Invalid constant alias name 'Self'. 'Self' is restricted and cannot be used to name a constant alias - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/constant_invalid_alias_names.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/constant_invalid_alias_names.snap new file mode 100644 index 0000000000000..e5d06c9a70a9f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/constant_invalid_alias_names.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/constant_invalid_alias_names.move +--- +error[E02010]: invalid name + ┌─ tests/move_check/expansion/constant_invalid_alias_names.move:8:24 + │ +8 │ use 0x42::N::{C as c1, C as _C1, C as Self}; + │ ^^ Invalid constant alias name 'c1'. Constant alias names must start with 'A'..'Z' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/constant_invalid_alias_names.move:8:33 + │ +8 │ use 0x42::N::{C as c1, C as _C1, C as Self}; + │ ^^^ Invalid constant alias name '_C1'. Constant alias names must start with 'A'..'Z' + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/constant_invalid_alias_names.move:8:43 + │ +8 │ use 0x42::N::{C as c1, C as _C1, C as Self}; + │ ^^^^ Invalid constant alias name 'Self'. 'Self' is restricted and cannot be used to name a constant alias diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/constant_invalid_names.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/constant_invalid_names.exp deleted file mode 100644 index e16fd6c2a12b0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/constant_invalid_names.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E02010]: invalid name - ┌─ tests/move_check/expansion/constant_invalid_names.move:3:11 - │ -3 │ const c1: u64 = 0; - │ ^^ Invalid constant name 'c1'. Constant names must start with 'A'..'Z' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/constant_invalid_names.move:4:11 - │ -4 │ const _C1: u64 = 0; - │ ^^^ Invalid constant name '_C1'. Constant names must start with 'A'..'Z' - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/constant_invalid_names.move:5:11 - │ -5 │ const Self: u64 = 0; - │ ^^^^ Invalid constant name 'Self'. 'Self' is restricted and cannot be used to name a constant - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/constant_invalid_names.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/constant_invalid_names.snap new file mode 100644 index 0000000000000..d3505cb24b067 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/constant_invalid_names.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/constant_invalid_names.move +--- +error[E02010]: invalid name + ┌─ tests/move_check/expansion/constant_invalid_names.move:3:11 + │ +3 │ const c1: u64 = 0; + │ ^^ Invalid constant name 'c1'. Constant names must start with 'A'..'Z' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/constant_invalid_names.move:4:11 + │ +4 │ const _C1: u64 = 0; + │ ^^^ Invalid constant name '_C1'. Constant names must start with 'A'..'Z' + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/constant_invalid_names.move:5:11 + │ +5 │ const Self: u64 = 0; + │ ^^^^ Invalid constant name 'Self'. 'Self' is restricted and cannot be used to name a constant diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/custom_attribute.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/custom_attribute.snap new file mode 100644 index 0000000000000..eec88fb5366b3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/custom_attribute.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/custom_attribute.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_abilities.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_abilities.exp deleted file mode 100644 index 30ee039aeb906..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_abilities.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/duplicate_abilities.move:4:26 - │ -4 │ struct Foo has copy, copy {} - │ ---- ^^^^ Duplicate 'copy' ability modifier - │ │ - │ Ability previously given here - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/duplicate_abilities.move:5:26 - │ -5 │ struct Bar { f: T } - │ ---- ^^^^ Duplicate 'drop' ability constraint - │ │ - │ Ability previously given here - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/duplicate_abilities.move:6:24 - │ -6 │ fun baz() {} - │ ----- ^^^^^ Duplicate 'store' ability constraint - │ │ - │ Ability previously given here - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_abilities.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_abilities.snap new file mode 100644 index 0000000000000..27cafd8aedf65 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_abilities.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/duplicate_abilities.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/duplicate_abilities.move:4:26 + │ +4 │ struct Foo has copy, copy {} + │ ---- ^^^^ Duplicate 'copy' ability modifier + │ │ + │ Ability previously given here + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/duplicate_abilities.move:5:26 + │ +5 │ struct Bar { f: T } + │ ---- ^^^^ Duplicate 'drop' ability constraint + │ │ + │ Ability previously given here + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/duplicate_abilities.move:6:24 + │ +6 │ fun baz() {} + │ ----- ^^^^^ Duplicate 'store' ability constraint + │ │ + │ Ability previously given here diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_alias.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_alias.exp deleted file mode 100644 index 2cdce394ac6f9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_alias.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[W09001]: unused alias - ┌─ tests/move_check/expansion/duplicate_alias.move:8:19 - │ -8 │ use 0x2::Y as Z; - │ ^ Unused 'use' of alias 'Z'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/duplicate_alias.move:8:19 - │ -7 │ use 0x2::X as Z; - │ - Alias previously defined here -8 │ use 0x2::Y as Z; - │ ^ Duplicate module alias 'Z'. Module aliases must be unique within a given namespace - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_alias.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_alias.snap new file mode 100644 index 0000000000000..5f96d188e967b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_alias.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/duplicate_alias.move +--- +warning[W09001]: unused alias + ┌─ tests/move_check/expansion/duplicate_alias.move:8:19 + │ +8 │ use 0x2::Y as Z; + │ ^ Unused 'use' of alias 'Z'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/duplicate_alias.move:8:19 + │ +7 │ use 0x2::X as Z; + │ - Alias previously defined here +8 │ use 0x2::Y as Z; + │ ^ Duplicate module alias 'Z'. Module aliases must be unique within a given namespace diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field.exp deleted file mode 100644 index ff609e65f0de8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/duplicate_field.move:4:9 - │ -3 │ f: u64, - │ - Field previously defined here -4 │ f: u64, - │ ^ Duplicate definition for field 'f' in struct 'S' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field.snap new file mode 100644 index 0000000000000..6047d762e1848 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/duplicate_field.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/duplicate_field.move:4:9 + │ +3 │ f: u64, + │ - Field previously defined here +4 │ f: u64, + │ ^ Duplicate definition for field 'f' in struct 'S' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field_assign.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field_assign.exp deleted file mode 100644 index 372a2af0087da..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field_assign.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/duplicate_field_assign.move:5:9 - │ -5 │ S { f, f } = S { f: 0 }; - │ ^^^^^^^^^^ - │ │ │ │ - │ │ │ Duplicate assignment binding given for field 'f' - │ │ Field previously defined here - │ Invalid deconstructing assignment - -warning[W09003]: unused assignment - ┌─ tests/move_check/expansion/duplicate_field_assign.move:5:13 - │ -5 │ S { f, f } = S { f: 0 }; - │ ^ Unused assignment for variable 'f'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_f') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field_assign.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field_assign.snap new file mode 100644 index 0000000000000..8e1d861aaba5a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field_assign.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/duplicate_field_assign.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/duplicate_field_assign.move:5:9 + │ +5 │ S { f, f } = S { f: 0 }; + │ ^^^^^^^^^^ + │ │ │ │ + │ │ │ Duplicate assignment binding given for field 'f' + │ │ Field previously defined here + │ Invalid deconstructing assignment + +warning[W09003]: unused assignment + ┌─ tests/move_check/expansion/duplicate_field_assign.move:5:13 + │ +5 │ S { f, f } = S { f: 0 }; + │ ^ Unused assignment for variable 'f'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_f') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field_pack.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field_pack.exp deleted file mode 100644 index ed46a4a297b39..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field_pack.exp +++ /dev/null @@ -1,10 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/duplicate_field_pack.move:4:9 - │ -4 │ S { f: 0, f: 0 }; - │ ^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Duplicate argument given for field 'f' - │ │ Field previously defined here - │ Invalid construction - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field_pack.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field_pack.snap new file mode 100644 index 0000000000000..c583bc012ea33 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field_pack.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/duplicate_field_pack.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/duplicate_field_pack.move:4:9 + │ +4 │ S { f: 0, f: 0 }; + │ ^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Duplicate argument given for field 'f' + │ │ Field previously defined here + │ Invalid construction diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field_unpack.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field_unpack.exp deleted file mode 100644 index 39317e0a48b3a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field_unpack.exp +++ /dev/null @@ -1,10 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/duplicate_field_unpack.move:4:13 - │ -4 │ let S { f, f } = S { f: 0 }; - │ ^^^^^^^^^^ - │ │ │ │ - │ │ │ Duplicate binding given for field 'f' - │ │ Field previously defined here - │ Invalid deconstruction binding - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field_unpack.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field_unpack.snap new file mode 100644 index 0000000000000..c16e3ce345c7d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_field_unpack.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/duplicate_field_unpack.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/duplicate_field_unpack.move:4:13 + │ +4 │ let S { f, f } = S { f: 0 }; + │ ^^^^^^^^^^ + │ │ │ │ + │ │ │ Duplicate binding given for field 'f' + │ │ Field previously defined here + │ Invalid deconstruction binding diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_function_in_module.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_function_in_module.exp deleted file mode 100644 index 7a60707cd747a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_function_in_module.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/duplicate_function_in_module.move:3:9 - │ -2 │ fun foo() { } - │ --- Alias previously defined here -3 │ fun foo() { } - │ ^^^ Duplicate module member or alias 'foo'. Top level names in a namespace must be unique - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_function_in_module.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_function_in_module.snap new file mode 100644 index 0000000000000..5f9435d84a66a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_function_in_module.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/duplicate_function_in_module.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/duplicate_function_in_module.move:3:9 + │ +2 │ fun foo() { } + │ --- Alias previously defined here +3 │ fun foo() { } + │ ^^^ Duplicate module member or alias 'foo'. Top level names in a namespace must be unique diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_module.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_module.exp deleted file mode 100644 index 9f47b19f5b83f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_module.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/duplicate_module.move:2:19 - │ -1 │ module 0x8675309::M {} - │ - Module previously defined here, with '0x8675309::M' -2 │ module 0x8675309::M {} - │ ^ Duplicate definition for module '0x8675309::M' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_module.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_module.snap new file mode 100644 index 0000000000000..a7118be21e998 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_module.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/duplicate_module.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/duplicate_module.move:2:19 + │ +1 │ module 0x8675309::M {} + │ - Module previously defined here, with '0x8675309::M' +2 │ module 0x8675309::M {} + │ ^ Duplicate definition for module '0x8675309::M' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_module_after_mapping.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_module_after_mapping.exp deleted file mode 100644 index 33a0ac290183f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_module_after_mapping.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/duplicate_module_after_mapping.move:5:11 - │ -4 │ module K::M1 {} - │ -- Module previously defined here, with '(K=0x19)::M1' -5 │ module k::M1 {} - │ ^^ Duplicate definition for module '(k=0x19)::M1' - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/duplicate_module_after_mapping.move:9:11 - │ -8 │ module 0x40::M2 {} - │ -- Module previously defined here, with '0x40::M2' -9 │ module M::M2 {} - │ ^^ Duplicate definition for module 'M::M2' - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/duplicate_module_after_mapping.move:13:14 - │ -12 │ module K::M3 {} - │ -- Module previously defined here, with '(K=0x19)::M3' -13 │ module 0x19::M3 {} - │ ^^ Duplicate definition for module '0x19::M3' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_module_after_mapping.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_module_after_mapping.snap new file mode 100644 index 0000000000000..59db51da957d6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_module_after_mapping.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/duplicate_module_after_mapping.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/duplicate_module_after_mapping.move:5:11 + │ +4 │ module K::M1 {} + │ -- Module previously defined here, with '(K=0x19)::M1' +5 │ module k::M1 {} + │ ^^ Duplicate definition for module '(k=0x19)::M1' + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/duplicate_module_after_mapping.move:9:11 + │ +8 │ module 0x40::M2 {} + │ -- Module previously defined here, with '0x40::M2' +9 │ module M::M2 {} + │ ^^ Duplicate definition for module 'M::M2' + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/duplicate_module_after_mapping.move:13:14 + │ +12 │ module K::M3 {} + │ -- Module previously defined here, with '(K=0x19)::M3' +13 │ module 0x19::M3 {} + │ ^^ Duplicate definition for module '0x19::M3' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_struct.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_struct.exp deleted file mode 100644 index b1df0baf699d4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_struct.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/duplicate_struct.move:3:12 - │ -2 │ struct S {} - │ - Alias previously defined here -3 │ struct S {} - │ ^ Duplicate module member or alias 'S'. Top level names in a namespace must be unique - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_struct.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_struct.snap new file mode 100644 index 0000000000000..da5e179d4ab62 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/duplicate_struct.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/duplicate_struct.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/duplicate_struct.move:3:12 + │ +2 │ struct S {} + │ - Alias previously defined here +3 │ struct S {} + │ ^ Duplicate module member or alias 'S'. Top level names in a namespace must be unique diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_duplicates.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_duplicates.exp deleted file mode 100644 index 3e4892e0d2f3e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_duplicates.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/friend_decl_aliased_duplicates.move:7:5 - │ -6 │ friend 0x42::A; - │ --------------- Friend previously declared here -7 │ friend AliasedA; - │ ^^^^^^^^^^^^^^^^ Duplicate friend declaration '0x42::A'. Friend declarations in a module must be unique - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_duplicates.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_duplicates.snap new file mode 100644 index 0000000000000..ad3c3416f8327 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_duplicates.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_duplicates.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/friend_decl_aliased_duplicates.move:7:5 + │ +6 │ friend 0x42::A; + │ --------------- Friend previously declared here +7 │ friend AliasedA; + │ ^^^^^^^^^^^^^^^^ Duplicate friend declaration '0x42::A'. Friend declarations in a module must be unique diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_function.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_function.exp deleted file mode 100644 index 2e290f55aafa5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_function.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/move_check/expansion/friend_decl_aliased_function.move:8:12 - │ -8 │ friend a; - │ ^ Unbound module alias 'a' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_function.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_function.snap new file mode 100644 index 0000000000000..c00838149da4e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_function.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_function.move +--- +error[E03002]: unbound module + ┌─ tests/move_check/expansion/friend_decl_aliased_function.move:8:12 + │ +8 │ friend a; + │ ^ Unbound module alias 'a' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_struct.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_struct.exp deleted file mode 100644 index d44974ffd0f42..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_struct.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/move_check/expansion/friend_decl_aliased_struct.move:8:12 - │ -8 │ friend A; - │ ^ Unbound module alias 'A' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_struct.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_struct.snap new file mode 100644 index 0000000000000..e2a74610e2412 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_struct.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/friend_decl_aliased_struct.move +--- +error[E03002]: unbound module + ┌─ tests/move_check/expansion/friend_decl_aliased_struct.move:8:12 + │ +8 │ friend A; + │ ^ Unbound module alias 'A' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_imported_duplicates.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_imported_duplicates.exp deleted file mode 100644 index 3fa44401f1b5f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_imported_duplicates.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/friend_decl_imported_duplicates.move:7:5 - │ -6 │ friend 0x42::A; - │ --------------- Friend previously declared here -7 │ friend A; - │ ^^^^^^^^^ Duplicate friend declaration '0x42::A'. Friend declarations in a module must be unique - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_imported_duplicates.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_imported_duplicates.snap new file mode 100644 index 0000000000000..7334b51013b1d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_imported_duplicates.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/friend_decl_imported_duplicates.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/friend_decl_imported_duplicates.move:7:5 + │ +6 │ friend 0x42::A; + │ --------------- Friend previously declared here +7 │ friend A; + │ ^^^^^^^^^ Duplicate friend declaration '0x42::A'. Friend declarations in a module must be unique diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_inner_scope_alias.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_inner_scope_alias.exp deleted file mode 100644 index b19219510828f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_inner_scope_alias.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/move_check/expansion/friend_decl_inner_scope_alias.move:7:12 - │ -7 │ friend A; - │ ^ Unbound module alias 'A' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_inner_scope_alias.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_inner_scope_alias.snap new file mode 100644 index 0000000000000..699200f72ed7f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_inner_scope_alias.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/friend_decl_inner_scope_alias.move +--- +error[E03002]: unbound module + ┌─ tests/move_check/expansion/friend_decl_inner_scope_alias.move:7:12 + │ +7 │ friend A; + │ ^ Unbound module alias 'A' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_inner_scope_alias_cycle.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_inner_scope_alias_cycle.exp deleted file mode 100644 index 8f9e29ca89b6d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_inner_scope_alias_cycle.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E02004]: invalid 'module' declaration - ┌─ tests/move_check/expansion/friend_decl_inner_scope_alias_cycle.move:8:5 - │ - 8 │ friend Q; - │ ^^^^^^^^^ '0x42::Q' is a friend of '0x42::R'. This 'friend' relationship creates a dependency cycle. - · -12 │ Q::q() - │ ------ '0x42::Q' uses '0x42::R' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_inner_scope_alias_cycle.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_inner_scope_alias_cycle.snap new file mode 100644 index 0000000000000..958bba6a04c13 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_inner_scope_alias_cycle.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/friend_decl_inner_scope_alias_cycle.move +--- +error[E02004]: invalid 'module' declaration + ┌─ tests/move_check/expansion/friend_decl_inner_scope_alias_cycle.move:8:5 + │ + 8 │ friend Q; + │ ^^^^^^^^^ '0x42::Q' is a friend of '0x42::R'. This 'friend' relationship creates a dependency cycle. + · +12 │ Q::q() + │ ------ '0x42::Q' uses '0x42::R' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_nonexistent_alias.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_nonexistent_alias.exp deleted file mode 100644 index c8896a42e2d9f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_nonexistent_alias.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/move_check/expansion/friend_decl_nonexistent_alias.move:3:12 - │ -3 │ friend Nonexistent; - │ ^^^^^^^^^^^ Unbound module alias 'Nonexistent' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_nonexistent_alias.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_nonexistent_alias.snap new file mode 100644 index 0000000000000..5e460d87827fa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_nonexistent_alias.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/friend_decl_nonexistent_alias.move +--- +error[E03002]: unbound module + ┌─ tests/move_check/expansion/friend_decl_nonexistent_alias.move:3:12 + │ +3 │ friend Nonexistent; + │ ^^^^^^^^^^^ Unbound module alias 'Nonexistent' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_qualified_duplicates.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_qualified_duplicates.exp deleted file mode 100644 index 2677a5d1e67c6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_qualified_duplicates.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/friend_decl_qualified_duplicates.move:6:5 - │ -5 │ friend 0x42::A; - │ --------------- Friend previously declared here -6 │ friend 0x42::A; - │ ^^^^^^^^^^^^^^^ Duplicate friend declaration '0x42::A'. Friend declarations in a module must be unique - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_qualified_duplicates.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_qualified_duplicates.snap new file mode 100644 index 0000000000000..941c7888fa72d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/friend_decl_qualified_duplicates.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/friend_decl_qualified_duplicates.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/friend_decl_qualified_duplicates.move:6:5 + │ +5 │ friend 0x42::A; + │ --------------- Friend previously declared here +6 │ friend 0x42::A; + │ ^^^^^^^^^^^^^^^ Duplicate friend declaration '0x42::A'. Friend declarations in a module must be unique diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/function_invalid_names.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/function_invalid_names.exp deleted file mode 100644 index 6014198927e51..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/function_invalid_names.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E02010]: invalid name - ┌─ tests/move_check/expansion/function_invalid_names.move:3:9 - │ -3 │ fun _foo() {} - │ ^^^^ Invalid function name '_foo'. Function names cannot start with '_' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/function_invalid_names.move:4:9 - │ -4 │ fun _() {} - │ ^ Invalid function name '_'. Function names cannot start with '_' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/function_invalid_names.move:5:9 - │ -5 │ fun ___() {} - │ ^^^ Invalid function name '___'. Function names cannot start with '_' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/function_invalid_names.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/function_invalid_names.snap new file mode 100644 index 0000000000000..5e61335b668b7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/function_invalid_names.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/function_invalid_names.move +--- +error[E02010]: invalid name + ┌─ tests/move_check/expansion/function_invalid_names.move:3:9 + │ +3 │ fun _foo() {} + │ ^^^^ Invalid function name '_foo'. Function names cannot start with '_' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/function_invalid_names.move:4:9 + │ +4 │ fun _() {} + │ ^ Invalid function name '_'. Function names cannot start with '_' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/function_invalid_names.move:5:9 + │ +5 │ fun ___() {} + │ ^^^ Invalid function name '___'. Function names cannot start with '_' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/hexstring_bad_value.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/hexstring_bad_value.exp deleted file mode 100644 index 9a94aee4c98b1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/hexstring_bad_value.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E01008]: invalid hex string - ┌─ tests/move_check/expansion/hexstring_bad_value.move:3:11 - │ -3 │ x"g0" - │ ^ Invalid hexadecimal character: 'g' - -error[E01008]: invalid hex string - ┌─ tests/move_check/expansion/hexstring_bad_value.move:6:9 - │ -6 │ x"123" - │ ^^^^^^ Odd number of characters in hex string. Expected 2 hexadecimal digits for each byte - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/hexstring_bad_value.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/hexstring_bad_value.snap new file mode 100644 index 0000000000000..c0e629d8de7a7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/hexstring_bad_value.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/hexstring_bad_value.move +--- +error[E01008]: invalid hex string + ┌─ tests/move_check/expansion/hexstring_bad_value.move:3:11 + │ +3 │ x"g0" + │ ^ Invalid hexadecimal character: 'g' + +error[E01008]: invalid hex string + ┌─ tests/move_check/expansion/hexstring_bad_value.move:6:9 + │ +6 │ x"123" + │ ^^^^^^ Odd number of characters in hex string. Expected 2 hexadecimal digits for each byte diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_local_name.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_local_name.exp deleted file mode 100644 index 3a1b0730e81ae..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_local_name.exp +++ /dev/null @@ -1,44 +0,0 @@ -error[E02010]: invalid name - ┌─ tests/move_check/expansion/invalid_local_name.move:4:11 - │ -4 │ fun t(No: u64) { - │ ^^ Invalid parameter name 'No'. Local variable names must start with 'a'..'z', '_', or be a valid name quoted with backticks (`name`) - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/expansion/invalid_local_name.move:5:9 - │ -5 │ No; - │ ^^ Unbound constant 'No' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/invalid_local_name.move:9:13 - │ -9 │ let No; - │ ^^ Invalid local name 'No'. Local variable names must start with 'a'..'z', '_', or be a valid name quoted with backticks (`name`) - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/invalid_local_name.move:14:13 - │ -14 │ let No = 100; - │ ^^ Invalid local name 'No'. Local variable names must start with 'a'..'z', '_', or be a valid name quoted with backticks (`name`) - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/expansion/invalid_local_name.move:15:13 - │ -15 │ F { No }; - │ ^^ Unbound constant 'No' - -warning[W09002]: unused variable - ┌─ tests/move_check/expansion/invalid_local_name.move:23:13 - │ -23 │ let vector; - │ ^^^^^^ Unused local variable 'vector'. Consider removing or prefixing with an underscore: '_vector' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/invalid_local_name.move:23:13 - │ -23 │ let vector; - │ ^^^^^^ Invalid variable name 'vector'. 'vector' is restricted and cannot be used to name a variable - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_local_name.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_local_name.snap new file mode 100644 index 0000000000000..d4386bb82e48e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_local_name.snap @@ -0,0 +1,51 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/invalid_local_name.move +--- +error[E02010]: invalid name + ┌─ tests/move_check/expansion/invalid_local_name.move:4:11 + │ +4 │ fun t(No: u64) { + │ ^^ Invalid parameter name 'No'. Local variable names must start with 'a'..'z', '_', or be a valid name quoted with backticks (`name`) + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/expansion/invalid_local_name.move:5:9 + │ +5 │ No; + │ ^^ Unbound constant 'No' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/invalid_local_name.move:9:13 + │ +9 │ let No; + │ ^^ Invalid local name 'No'. Local variable names must start with 'a'..'z', '_', or be a valid name quoted with backticks (`name`) + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/invalid_local_name.move:14:13 + │ +14 │ let No = 100; + │ ^^ Invalid local name 'No'. Local variable names must start with 'a'..'z', '_', or be a valid name quoted with backticks (`name`) + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/expansion/invalid_local_name.move:15:13 + │ +15 │ F { No }; + │ ^^ Unbound constant 'No' + +warning[W09002]: unused variable + ┌─ tests/move_check/expansion/invalid_local_name.move:23:13 + │ +23 │ let vector; + │ ^^^^^^ Unused local variable 'vector'. Consider removing or prefixing with an underscore: '_vector' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/invalid_local_name.move:23:13 + │ +23 │ let vector; + │ ^^^^^^ Invalid variable name 'vector'. 'vector' is restricted and cannot be used to name a variable diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_spec_schema_name.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_spec_schema_name.exp deleted file mode 100644 index a1a0c4166b51e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_spec_schema_name.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/invalid_spec_schema_name.move:2:5 - │ -2 │ ╭ spec schema foo { -3 │ │ ensures true; -4 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_spec_schema_name.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_spec_schema_name.snap new file mode 100644 index 0000000000000..05fd0581a09b1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_spec_schema_name.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/invalid_spec_schema_name.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/invalid_spec_schema_name.move:2:5 + │ +2 │ ╭ spec schema foo { +3 │ │ ensures true; +4 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_struct_name.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_struct_name.exp deleted file mode 100644 index 5ce832f5b8f85..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_struct_name.exp +++ /dev/null @@ -1,66 +0,0 @@ -error[E02010]: invalid name - ┌─ tests/move_check/expansion/invalid_struct_name.move:2:12 - │ -2 │ struct no {} - │ ^^ Invalid struct name 'no'. Struct names must start with 'A'..'Z' - -error[E03004]: unbound type - ┌─ tests/move_check/expansion/invalid_struct_name.move:3:19 - │ -3 │ struct X { f: no } - │ ^^ Unbound type 'no' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/expansion/invalid_struct_name.move:5:15 - │ -5 │ fun mk(x: no): no { x; - │ ^^ Unbound type 'no' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/expansion/invalid_struct_name.move:5:20 - │ -5 │ fun mk(x: no): no { x; - │ ^^ Unbound type 'no' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/expansion/invalid_struct_name.move:6:9 - │ -6 │ no {} - │ ^^ Unbound type 'no' in current scope - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/invalid_struct_name.move:9:12 - │ -9 │ struct no2 {} - │ ^^^ Invalid struct name 'no2'. Struct names must start with 'A'..'Z' - -error[E03004]: unbound type - ┌─ tests/move_check/expansion/invalid_struct_name.move:10:19 - │ -10 │ struct Y { f: no } - │ ^^ Unbound type 'no' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/expansion/invalid_struct_name.move:12:16 - │ -12 │ fun mk2(x: no2): no2 { - │ ^^^ Unbound type 'no2' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/expansion/invalid_struct_name.move:12:22 - │ -12 │ fun mk2(x: no2): no2 { - │ ^^^ Unbound type 'no2' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/expansion/invalid_struct_name.move:13:13 - │ -13 │ let no2 {} = x; - │ ^^^ Unbound type 'no2' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/expansion/invalid_struct_name.move:14:9 - │ -14 │ no2 {} - │ ^^^ Unbound type 'no2' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_struct_name.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_struct_name.snap new file mode 100644 index 0000000000000..fc681b99230be --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_struct_name.snap @@ -0,0 +1,73 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/invalid_struct_name.move +--- +error[E02010]: invalid name + ┌─ tests/move_check/expansion/invalid_struct_name.move:2:12 + │ +2 │ struct no {} + │ ^^ Invalid struct name 'no'. Struct names must start with 'A'..'Z' + +error[E03004]: unbound type + ┌─ tests/move_check/expansion/invalid_struct_name.move:3:19 + │ +3 │ struct X { f: no } + │ ^^ Unbound type 'no' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/expansion/invalid_struct_name.move:5:15 + │ +5 │ fun mk(x: no): no { x; + │ ^^ Unbound type 'no' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/expansion/invalid_struct_name.move:5:20 + │ +5 │ fun mk(x: no): no { x; + │ ^^ Unbound type 'no' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/expansion/invalid_struct_name.move:6:9 + │ +6 │ no {} + │ ^^ Unbound type 'no' in current scope + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/invalid_struct_name.move:9:12 + │ +9 │ struct no2 {} + │ ^^^ Invalid struct name 'no2'. Struct names must start with 'A'..'Z' + +error[E03004]: unbound type + ┌─ tests/move_check/expansion/invalid_struct_name.move:10:19 + │ +10 │ struct Y { f: no } + │ ^^ Unbound type 'no' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/expansion/invalid_struct_name.move:12:16 + │ +12 │ fun mk2(x: no2): no2 { + │ ^^^ Unbound type 'no2' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/expansion/invalid_struct_name.move:12:22 + │ +12 │ fun mk2(x: no2): no2 { + │ ^^^ Unbound type 'no2' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/expansion/invalid_struct_name.move:13:13 + │ +13 │ let no2 {} = x; + │ ^^^ Unbound type 'no2' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/expansion/invalid_struct_name.move:14:9 + │ +14 │ no2 {} + │ ^^^ Unbound type 'no2' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_lhs_not_name.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_lhs_not_name.exp deleted file mode 100644 index e6d9ace1dc146..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_lhs_not_name.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/invalid_unpack_assign_lhs_not_name.move:4:11 - │ -4 │ 0 { f } = 0; - │ ^ - │ │ - │ Unexpected '{' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_lhs_not_name.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_lhs_not_name.snap new file mode 100644 index 0000000000000..07a2e367cbd85 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_lhs_not_name.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_lhs_not_name.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/invalid_unpack_assign_lhs_not_name.move:4:11 + │ +4 │ 0 { f } = 0; + │ ^ + │ │ + │ Unexpected '{' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_lhs_other_value.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_lhs_other_value.exp deleted file mode 100644 index 7a7b36c26de25..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_lhs_other_value.exp +++ /dev/null @@ -1,29 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/invalid_unpack_assign_lhs_other_value.move:3:11 - │ -3 │ 0 {} = 0; - │ ^ - │ │ - │ Unexpected '{' - │ Expected ';' - -error[E03022]: invalid usage position - ┌─ tests/move_check/expansion/invalid_unpack_assign_lhs_other_value.move:5:9 - │ -5 │ foo() = 0; - │ ^^^ Expected a struct, but found function 'foo' in current scope - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/expansion/invalid_unpack_assign_lhs_other_value.move:5:9 - │ -5 │ foo() = 0; - │ ^^^^^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01009]: invalid assignment - ┌─ tests/move_check/expansion/invalid_unpack_assign_lhs_other_value.move:7:9 - │ -7 │ foo().bar() = 0; - │ ^^^^^^^^^^^ Invalid assignment syntax. Expected: a local, a field write, or a deconstructing assignment - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_lhs_other_value.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_lhs_other_value.snap new file mode 100644 index 0000000000000..d7e624b60d114 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_lhs_other_value.snap @@ -0,0 +1,36 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_lhs_other_value.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/invalid_unpack_assign_lhs_other_value.move:3:11 + │ +3 │ 0 {} = 0; + │ ^ + │ │ + │ Unexpected '{' + │ Expected ';' + +error[E03022]: invalid usage position + ┌─ tests/move_check/expansion/invalid_unpack_assign_lhs_other_value.move:5:9 + │ +5 │ foo() = 0; + │ ^^^ Expected a struct, but found function 'foo' in current scope + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/expansion/invalid_unpack_assign_lhs_other_value.move:5:9 + │ +5 │ foo() = 0; + │ ^^^^^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01009]: invalid assignment + ┌─ tests/move_check/expansion/invalid_unpack_assign_lhs_other_value.move:7:9 + │ +7 │ foo().bar() = 0; + │ ^^^^^^^^^^^ Invalid assignment syntax. Expected: a local, a field write, or a deconstructing assignment diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_mdot_no_struct.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_mdot_no_struct.exp deleted file mode 100644 index 5b62308ca8192..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_mdot_no_struct.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[E03003]: unbound module member - ┌─ tests/move_check/expansion/invalid_unpack_assign_mdot_no_struct.move:3:9 - │ -3 │ Self::f {} = 0; - │ ^^^^^^^ Unbound struct 'f' in current scope - -error[E03003]: unbound module member - ┌─ tests/move_check/expansion/invalid_unpack_assign_mdot_no_struct.move:4:9 - │ -4 │ Self::f() = 0; - │ ^^^^^^^ Unbound struct 'f' in current scope - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/expansion/invalid_unpack_assign_mdot_no_struct.move:4:9 - │ -4 │ Self::f() = 0; - │ ^^^^^^^^^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_mdot_no_struct.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_mdot_no_struct.snap new file mode 100644 index 0000000000000..7a78d0e9cfaf6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_mdot_no_struct.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/invalid_unpack_assign_mdot_no_struct.move +--- +error[E03003]: unbound module member + ┌─ tests/move_check/expansion/invalid_unpack_assign_mdot_no_struct.move:3:9 + │ +3 │ Self::f {} = 0; + │ ^^^^^^^ Unbound struct 'f' in current scope + +error[E03003]: unbound module member + ┌─ tests/move_check/expansion/invalid_unpack_assign_mdot_no_struct.move:4:9 + │ +4 │ Self::f() = 0; + │ ^^^^^^^ Unbound struct 'f' in current scope + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/expansion/invalid_unpack_assign_mdot_no_struct.move:4:9 + │ +4 │ Self::f() = 0; + │ ^^^^^^^^^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/mdot_with_non_address_exp.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/mdot_with_non_address_exp.exp deleted file mode 100644 index 5a4d3632028bf..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/mdot_with_non_address_exp.exp +++ /dev/null @@ -1,44 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/mdot_with_non_address_exp.move:9:13 - │ -9 │ 01u8::X::bar() - │ ^^ - │ │ - │ Unexpected '::' - │ Expected ';' - -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/mdot_with_non_address_exp.move:13:14 - │ -13 │ false::X::bar() - │ ^^ - │ │ - │ Unexpected '::' - │ Expected ';' - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/expansion/mdot_with_non_address_exp.move:17:9 - │ -17 │ foo().bar().X::bar() - │ ^^^^^^^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E04023]: invalid method call - ┌─ tests/move_check/expansion/mdot_with_non_address_exp.move:17:9 - │ - 8 │ fun foo() { - │ --- Method calls are only supported on single types. Got an expression of type: '()' - · -17 │ foo().bar().X::bar() - │ ^^^^^^^^^^^ Invalid method call - -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/mdot_with_non_address_exp.move:17:22 - │ -17 │ foo().bar().X::bar() - │ ^^ - │ │ - │ Unexpected '::' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/mdot_with_non_address_exp.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/mdot_with_non_address_exp.snap new file mode 100644 index 0000000000000..75c0f8710a8d4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/mdot_with_non_address_exp.snap @@ -0,0 +1,51 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/mdot_with_non_address_exp.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/mdot_with_non_address_exp.move:9:13 + │ +9 │ 01u8::X::bar() + │ ^^ + │ │ + │ Unexpected '::' + │ Expected ';' + +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/mdot_with_non_address_exp.move:13:14 + │ +13 │ false::X::bar() + │ ^^ + │ │ + │ Unexpected '::' + │ Expected ';' + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/expansion/mdot_with_non_address_exp.move:17:9 + │ +17 │ foo().bar().X::bar() + │ ^^^^^^^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E04023]: invalid method call + ┌─ tests/move_check/expansion/mdot_with_non_address_exp.move:17:9 + │ + 8 │ fun foo() { + │ --- Method calls are only supported on single types. Got an expression of type: '()' + · +17 │ foo().bar().X::bar() + │ ^^^^^^^^^^^ Invalid method call + +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/mdot_with_non_address_exp.move:17:22 + │ +17 │ foo().bar().X::bar() + │ ^^ + │ │ + │ Unexpected '::' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/module_alias_as_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/module_alias_as_type.exp deleted file mode 100644 index 1f599ad805dc4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/module_alias_as_type.exp +++ /dev/null @@ -1,14 +0,0 @@ -warning[W09001]: unused alias - ┌─ tests/move_check/expansion/module_alias_as_type.move:6:14 - │ -6 │ use 0x2::X; - │ ^ Unused 'use' of alias 'X'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03004]: unbound type - ┌─ tests/move_check/expansion/module_alias_as_type.move:7:16 - │ -7 │ fun foo(x: X) { x; } - │ ^ Unbound type 'X' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/module_alias_as_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/module_alias_as_type.snap new file mode 100644 index 0000000000000..4b43d652d401b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/module_alias_as_type.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/module_alias_as_type.move +--- +warning[W09001]: unused alias + ┌─ tests/move_check/expansion/module_alias_as_type.move:6:14 + │ +6 │ use 0x2::X; + │ ^ Unused 'use' of alias 'X'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03004]: unbound type + ┌─ tests/move_check/expansion/module_alias_as_type.move:7:16 + │ +7 │ fun foo(x: X) { x; } + │ ^ Unbound type 'X' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/module_invalid_names.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/module_invalid_names.exp deleted file mode 100644 index b18dbbd07623a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/module_invalid_names.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E02010]: invalid name - ┌─ tests/move_check/expansion/module_invalid_names.move:2:8 - │ -2 │ module _m { - │ ^^ Invalid module name '_m'. Module names cannot start with '_' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/module_invalid_names.move:4:8 - │ -4 │ module _ { - │ ^ Invalid module name '_'. Module names cannot start with '_' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/module_invalid_names.move:6:8 - │ -6 │ module ___ { - │ ^^^ Invalid module name '___'. Module names cannot start with '_' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/module_invalid_names.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/module_invalid_names.snap new file mode 100644 index 0000000000000..c67a764a9988f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/module_invalid_names.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/module_invalid_names.move +--- +error[E02010]: invalid name + ┌─ tests/move_check/expansion/module_invalid_names.move:2:8 + │ +2 │ module _m { + │ ^^ Invalid module name '_m'. Module names cannot start with '_' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/module_invalid_names.move:4:8 + │ +4 │ module _ { + │ ^ Invalid module name '_'. Module names cannot start with '_' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/module_invalid_names.move:6:8 + │ +6 │ module ___ { + │ ^^^ Invalid module name '___'. Module names cannot start with '_' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/multiple_alias.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/multiple_alias.snap new file mode 100644 index 0000000000000..4e1e422f2daa0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/multiple_alias.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/multiple_alias.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/no_address.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/no_address.exp deleted file mode 100644 index 705acdf353a43..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/no_address.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E02004]: invalid 'module' declaration - ┌─ tests/move_check/expansion/no_address.move:1:8 - │ -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/external-crates/move/crates/move-compiler/tests/move_check/expansion/no_address.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/no_address.snap new file mode 100644 index 0000000000000..b1c2b905199fc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/no_address.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/no_address.move +--- +error[E02004]: invalid 'module' declaration + ┌─ tests/move_check/expansion/no_address.move:1:8 + │ +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/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_long.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_long.snap new file mode 100644 index 0000000000000..2c0eb24f68314 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_long.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/number_literal_long.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long.exp deleted file mode 100644 index 8795e64f3715b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E01006]: invalid number literal - ┌─ tests/move_check/expansion/number_literal_too_long.move:3:9 - │ -3 │ 0x1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid number literal. The given literal is too large to fit into the largest possible integer type, 'u256' - -error[E01006]: invalid number literal - ┌─ tests/move_check/expansion/number_literal_too_long.move:4:9 - │ -4 │ 340282366920938463463374607431768211456340282366920938463463374607431768211456340282366920938463463374607431768211456; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid number literal. The given literal is too large to fit into the largest possible integer type, 'u256' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long.snap new file mode 100644 index 0000000000000..9bfceb64595d7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/number_literal_too_long.move +--- +error[E01006]: invalid number literal + ┌─ tests/move_check/expansion/number_literal_too_long.move:3:9 + │ +3 │ 0x1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid number literal. The given literal is too large to fit into the largest possible integer type, 'u256' + +error[E01006]: invalid number literal + ┌─ tests/move_check/expansion/number_literal_too_long.move:4:9 + │ +4 │ 340282366920938463463374607431768211456340282366920938463463374607431768211456340282366920938463463374607431768211456; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid number literal. The given literal is too large to fit into the largest possible integer type, 'u256' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u128.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u128.exp deleted file mode 100644 index 434fe318ecc7a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u128.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E01006]: invalid number literal - ┌─ tests/move_check/expansion/number_literal_too_long_u128.move:4:9 - │ -4 │ 0x1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFu128; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid number literal. The given literal is too large to fit into 'u128' - -error[E01006]: invalid number literal - ┌─ tests/move_check/expansion/number_literal_too_long_u128.move:6:9 - │ -6 │ 340282366920938463463374607431768211456u128; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid number literal. The given literal is too large to fit into 'u128' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u128.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u128.snap new file mode 100644 index 0000000000000..5e055a2aae1cd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u128.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u128.move +--- +error[E01006]: invalid number literal + ┌─ tests/move_check/expansion/number_literal_too_long_u128.move:4:9 + │ +4 │ 0x1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFu128; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid number literal. The given literal is too large to fit into 'u128' + +error[E01006]: invalid number literal + ┌─ tests/move_check/expansion/number_literal_too_long_u128.move:6:9 + │ +6 │ 340282366920938463463374607431768211456u128; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid number literal. The given literal is too large to fit into 'u128' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u64.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u64.exp deleted file mode 100644 index e789ee003f57c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u64.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E01006]: invalid number literal - ┌─ tests/move_check/expansion/number_literal_too_long_u64.move:4:9 - │ -4 │ 0x1FFFFFFFFFFFFFFFFu64; - │ ^^^^^^^^^^^^^^^^^^^^^^ Invalid number literal. The given literal is too large to fit into 'u64' - -error[E01006]: invalid number literal - ┌─ tests/move_check/expansion/number_literal_too_long_u64.move:6:9 - │ -6 │ 18446744073709551616u64; - │ ^^^^^^^^^^^^^^^^^^^^^^^ Invalid number literal. The given literal is too large to fit into 'u64' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u64.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u64.snap new file mode 100644 index 0000000000000..5f9f59b02cc42 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u64.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u64.move +--- +error[E01006]: invalid number literal + ┌─ tests/move_check/expansion/number_literal_too_long_u64.move:4:9 + │ +4 │ 0x1FFFFFFFFFFFFFFFFu64; + │ ^^^^^^^^^^^^^^^^^^^^^^ Invalid number literal. The given literal is too large to fit into 'u64' + +error[E01006]: invalid number literal + ┌─ tests/move_check/expansion/number_literal_too_long_u64.move:6:9 + │ +6 │ 18446744073709551616u64; + │ ^^^^^^^^^^^^^^^^^^^^^^^ Invalid number literal. The given literal is too large to fit into 'u64' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u8.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u8.exp deleted file mode 100644 index eb6b487e58241..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u8.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E01006]: invalid number literal - ┌─ tests/move_check/expansion/number_literal_too_long_u8.move:4:9 - │ -4 │ 0x1FFu8; - │ ^^^^^^^ Invalid number literal. The given literal is too large to fit into 'u8' - -error[E01006]: invalid number literal - ┌─ tests/move_check/expansion/number_literal_too_long_u8.move:6:9 - │ -6 │ 256u8; - │ ^^^^^ Invalid number literal. The given literal is too large to fit into 'u8' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u8.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u8.snap new file mode 100644 index 0000000000000..5e1cf95e3fe5c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u8.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/number_literal_too_long_u8.move +--- +error[E01006]: invalid number literal + ┌─ tests/move_check/expansion/number_literal_too_long_u8.move:4:9 + │ +4 │ 0x1FFu8; + │ ^^^^^^^ Invalid number literal. The given literal is too large to fit into 'u8' + +error[E01006]: invalid number literal + ┌─ tests/move_check/expansion/number_literal_too_long_u8.move:6:9 + │ +6 │ 256u8; + │ ^^^^^ Invalid number literal. The given literal is too large to fit into 'u8' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_all_field_cases.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_all_field_cases.snap new file mode 100644 index 0000000000000..26af3b58c7e17 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_all_field_cases.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/pack_all_field_cases.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_no_fields_block_expr.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_no_fields_block_expr.exp deleted file mode 100644 index 91feb1a7f8d20..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_no_fields_block_expr.exp +++ /dev/null @@ -1,29 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/pack_no_fields_block_expr.move:4:22 - │ -4 │ let _s = S { let x = 0; x }; - │ ^ Unexpected 'let'. Expected a field expression - -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/pack_no_fields_block_expr.move:4:31 - │ -4 │ let _s = S { let x = 0; x }; - │ - ^ Expected '}' - │ │ - │ To match this '{' - -error[E03009]: unbound variable - ┌─ tests/move_check/expansion/pack_no_fields_block_expr.move:4:33 - │ -4 │ let _s = S { let x = 0; x }; - │ ^ Unbound variable 'x' - -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/pack_no_fields_block_expr.move:4:36 - │ -4 │ let _s = S { let x = 0; x }; - │ ^ - │ │ - │ Unexpected ';' - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_no_fields_block_expr.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_no_fields_block_expr.snap new file mode 100644 index 0000000000000..e1230bd2eaa10 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_no_fields_block_expr.snap @@ -0,0 +1,36 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/pack_no_fields_block_expr.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/pack_no_fields_block_expr.move:4:22 + │ +4 │ let _s = S { let x = 0; x }; + │ ^ Unexpected 'let'. Expected a field expression + +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/pack_no_fields_block_expr.move:4:31 + │ +4 │ let _s = S { let x = 0; x }; + │ - ^ Expected '}' + │ │ + │ To match this '{' + +error[E03009]: unbound variable + ┌─ tests/move_check/expansion/pack_no_fields_block_expr.move:4:33 + │ +4 │ let _s = S { let x = 0; x }; + │ ^ Unbound variable 'x' + +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/pack_no_fields_block_expr.move:4:36 + │ +4 │ let _s = S { let x = 0; x }; + │ ^ + │ │ + │ Unexpected ';' + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_no_fields_single_block_expr.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_no_fields_single_block_expr.exp deleted file mode 100644 index 6ab6d6071f471..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_no_fields_single_block_expr.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E04016]: too few arguments - ┌─ tests/move_check/expansion/pack_no_fields_single_block_expr.move:4:18 - │ -4 │ let _s = S { false }; - │ ^^^^^^^^^^^ Missing argument for field 'f' in '0x42::M::S' - -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/pack_no_fields_single_block_expr.move:4:22 - │ -4 │ let _s = S { false }; - │ ^ Unexpected 'false'. Expected a field expression - -error[E04016]: too few arguments - ┌─ tests/move_check/expansion/pack_no_fields_single_block_expr.move:5:18 - │ -5 │ let _s = S { 0 }; - │ ^^^^^^^ Missing argument for field 'f' in '0x42::M::S' - -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/pack_no_fields_single_block_expr.move:5:22 - │ -5 │ let _s = S { 0 }; - │ ^ Unexpected ''. Expected a field expression - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_no_fields_single_block_expr.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_no_fields_single_block_expr.snap new file mode 100644 index 0000000000000..e80fb64f00784 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_no_fields_single_block_expr.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/pack_no_fields_single_block_expr.move +--- +error[E04016]: too few arguments + ┌─ tests/move_check/expansion/pack_no_fields_single_block_expr.move:4:18 + │ +4 │ let _s = S { false }; + │ ^^^^^^^^^^^ Missing argument for field 'f' in '0x42::M::S' + +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/pack_no_fields_single_block_expr.move:4:22 + │ +4 │ let _s = S { false }; + │ ^ Unexpected 'false'. Expected a field expression + +error[E04016]: too few arguments + ┌─ tests/move_check/expansion/pack_no_fields_single_block_expr.move:5:18 + │ +5 │ let _s = S { 0 }; + │ ^^^^^^^ Missing argument for field 'f' in '0x42::M::S' + +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/pack_no_fields_single_block_expr.move:5:22 + │ +5 │ let _s = S { 0 }; + │ ^ Unexpected ''. Expected a field expression diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_no_fields_single_block_other_expr.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_no_fields_single_block_other_expr.exp deleted file mode 100644 index 02c9e5fd4ac8c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_no_fields_single_block_other_expr.exp +++ /dev/null @@ -1,57 +0,0 @@ -error[E03022]: invalid usage position - ┌─ tests/move_check/expansion/pack_no_fields_single_block_other_expr.move:6:18 - │ -6 │ let _s = S 0; - │ ^ Expected a local or constant, but found struct 'S' in current scope - │ - = Struct with named arguments must be written as 'S { ... }' - -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/pack_no_fields_single_block_other_expr.move:6:20 - │ -6 │ let _s = S 0; - │ ^ - │ │ - │ Unexpected '0' - │ Expected ';' - -error[E03022]: invalid usage position - ┌─ tests/move_check/expansion/pack_no_fields_single_block_other_expr.move:7:18 - │ -7 │ let _s = S f; - │ ^ Expected a local or constant, but found struct 'S' in current scope - │ - = Struct with named arguments must be written as 'S { ... }' - -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/pack_no_fields_single_block_other_expr.move:7:20 - │ -7 │ let _s = S f; - │ ^ - │ │ - │ Unexpected 'f' - │ Expected ';' - -error[E03013]: positional call mismatch - ┌─ tests/move_check/expansion/pack_no_fields_single_block_other_expr.move:8:18 - │ -3 │ struct G has drop {} - │ - 'G' is declared here - · -8 │ let _g = G (); - │ ^^^^ Invalid struct instantiation. Named struct declarations require named instantiations - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/expansion/pack_no_fields_single_block_other_expr.move:8:18 - │ -8 │ let _g = G (); - │ ^^^^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/pack_no_fields_single_block_other_expr.move:9:22 - │ -9 │ let _g = G { {} }; - │ ^ Unexpected '{'. Expected a field expression - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_no_fields_single_block_other_expr.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_no_fields_single_block_other_expr.snap new file mode 100644 index 0000000000000..b218b6c6c62d6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/pack_no_fields_single_block_other_expr.snap @@ -0,0 +1,64 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/pack_no_fields_single_block_other_expr.move +--- +error[E03022]: invalid usage position + ┌─ tests/move_check/expansion/pack_no_fields_single_block_other_expr.move:6:18 + │ +6 │ let _s = S 0; + │ ^ Expected a local or constant, but found struct 'S' in current scope + │ + = Struct with named arguments must be written as 'S { ... }' + +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/pack_no_fields_single_block_other_expr.move:6:20 + │ +6 │ let _s = S 0; + │ ^ + │ │ + │ Unexpected '0' + │ Expected ';' + +error[E03022]: invalid usage position + ┌─ tests/move_check/expansion/pack_no_fields_single_block_other_expr.move:7:18 + │ +7 │ let _s = S f; + │ ^ Expected a local or constant, but found struct 'S' in current scope + │ + = Struct with named arguments must be written as 'S { ... }' + +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/pack_no_fields_single_block_other_expr.move:7:20 + │ +7 │ let _s = S f; + │ ^ + │ │ + │ Unexpected 'f' + │ Expected ';' + +error[E03013]: positional call mismatch + ┌─ tests/move_check/expansion/pack_no_fields_single_block_other_expr.move:8:18 + │ +3 │ struct G has drop {} + │ - 'G' is declared here + · +8 │ let _g = G (); + │ ^^^^ Invalid struct instantiation. Named struct declarations require named instantiations + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/expansion/pack_no_fields_single_block_other_expr.move:8:18 + │ +8 │ let _g = G (); + │ ^^^^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/pack_no_fields_single_block_other_expr.move:9:22 + │ +9 │ let _g = G { {} }; + │ ^ Unexpected '{'. Expected a field expression diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_address_names.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_address_names.exp deleted file mode 100644 index 82c9e491444b9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_address_names.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_address_names.move:1:8 - │ -1 │ module Self::A {} - │ ^^^^ Invalid address name 'Self'. 'Self' is restricted and cannot be used to name an address - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_address_names.move:2:8 - │ -2 │ module vector::A {} - │ ^^^^^^ Invalid address name 'vector'. 'vector' is restricted and cannot be used to name an address - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_address_names.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_address_names.snap new file mode 100644 index 0000000000000..c214c53393c7c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_address_names.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/restricted_address_names.move +--- +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_address_names.move:1:8 + │ +1 │ module Self::A {} + │ ^^^^ Invalid address name 'Self'. 'Self' is restricted and cannot be used to name an address + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_address_names.move:2:8 + │ +2 │ module vector::A {} + │ ^^^^^^ Invalid address name 'vector'. 'vector' is restricted and cannot be used to name an address diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_alias_names.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_alias_names.exp deleted file mode 100644 index 8efe95374d256..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_alias_names.exp +++ /dev/null @@ -1,54 +0,0 @@ -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_alias_names.move:9:16 - │ -9 │ foo as address, - │ ^^^^^^^ Invalid function alias name 'address'. 'address' is restricted and cannot be used to name a function alias - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_alias_names.move:10:16 - │ -10 │ foo as signer, - │ ^^^^^^ Invalid function alias name 'signer'. 'signer' is restricted and cannot be used to name a function alias - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_alias_names.move:11:16 - │ -11 │ foo as u8, - │ ^^ Invalid function alias name 'u8'. 'u8' is restricted and cannot be used to name a function alias - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_alias_names.move:12:16 - │ -12 │ foo as u64, - │ ^^^ Invalid function alias name 'u64'. 'u64' is restricted and cannot be used to name a function alias - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_alias_names.move:13:16 - │ -13 │ foo as u128, - │ ^^^^ Invalid function alias name 'u128'. 'u128' is restricted and cannot be used to name a function alias - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_alias_names.move:14:16 - │ -14 │ foo as vector, - │ ^^^^^^ Invalid function alias name 'vector'. 'vector' is restricted and cannot be used to name a function alias - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_alias_names.move:15:16 - │ -15 │ foo as freeze, - │ ^^^^^^ Invalid function alias name 'freeze'. 'freeze' is restricted and cannot be used to name a function alias - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_alias_names.move:16:16 - │ -16 │ foo as assert, - │ ^^^^^^ Invalid function alias name 'assert'. 'assert' is restricted and cannot be used to name a function alias - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_alias_names.move:17:16 - │ -17 │ foo as Self, - │ ^^^^ Invalid function alias name 'Self'. 'Self' is restricted and cannot be used to name a function alias - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_alias_names.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_alias_names.snap new file mode 100644 index 0000000000000..299ed08039657 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_alias_names.snap @@ -0,0 +1,61 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/restricted_alias_names.move +--- +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_alias_names.move:9:16 + │ +9 │ foo as address, + │ ^^^^^^^ Invalid function alias name 'address'. 'address' is restricted and cannot be used to name a function alias + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_alias_names.move:10:16 + │ +10 │ foo as signer, + │ ^^^^^^ Invalid function alias name 'signer'. 'signer' is restricted and cannot be used to name a function alias + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_alias_names.move:11:16 + │ +11 │ foo as u8, + │ ^^ Invalid function alias name 'u8'. 'u8' is restricted and cannot be used to name a function alias + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_alias_names.move:12:16 + │ +12 │ foo as u64, + │ ^^^ Invalid function alias name 'u64'. 'u64' is restricted and cannot be used to name a function alias + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_alias_names.move:13:16 + │ +13 │ foo as u128, + │ ^^^^ Invalid function alias name 'u128'. 'u128' is restricted and cannot be used to name a function alias + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_alias_names.move:14:16 + │ +14 │ foo as vector, + │ ^^^^^^ Invalid function alias name 'vector'. 'vector' is restricted and cannot be used to name a function alias + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_alias_names.move:15:16 + │ +15 │ foo as freeze, + │ ^^^^^^ Invalid function alias name 'freeze'. 'freeze' is restricted and cannot be used to name a function alias + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_alias_names.move:16:16 + │ +16 │ foo as assert, + │ ^^^^^^ Invalid function alias name 'assert'. 'assert' is restricted and cannot be used to name a function alias + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_alias_names.move:17:16 + │ +17 │ foo as Self, + │ ^^^^ Invalid function alias name 'Self'. 'Self' is restricted and cannot be used to name a function alias diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_constant_names.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_constant_names.exp deleted file mode 100644 index e6d4f18d5f7cc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_constant_names.exp +++ /dev/null @@ -1,54 +0,0 @@ -error[E02010]: invalid name - ┌─ tests/move_check/expansion/restricted_constant_names.move:5:11 - │ -5 │ const address: u64 = 0; - │ ^^^^^^^ Invalid constant name 'address'. Constant names must start with 'A'..'Z' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/restricted_constant_names.move:6:11 - │ -6 │ const signer: u64 = 0; - │ ^^^^^^ Invalid constant name 'signer'. Constant names must start with 'A'..'Z' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/restricted_constant_names.move:7:11 - │ -7 │ const u8: u64 = 0; - │ ^^ Invalid constant name 'u8'. Constant names must start with 'A'..'Z' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/restricted_constant_names.move:8:11 - │ -8 │ const u64: u64 = 0; - │ ^^^ Invalid constant name 'u64'. Constant names must start with 'A'..'Z' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/restricted_constant_names.move:9:11 - │ -9 │ const u128: u64 = 0; - │ ^^^^ Invalid constant name 'u128'. Constant names must start with 'A'..'Z' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/restricted_constant_names.move:10:11 - │ -10 │ const vector: u64 = 0; - │ ^^^^^^ Invalid constant name 'vector'. Constant names must start with 'A'..'Z' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/restricted_constant_names.move:11:11 - │ -11 │ const freeze: u64 = 0; - │ ^^^^^^ Invalid constant name 'freeze'. Constant names must start with 'A'..'Z' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/restricted_constant_names.move:12:11 - │ -12 │ const assert: u64 = 0; - │ ^^^^^^ Invalid constant name 'assert'. Constant names must start with 'A'..'Z' - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_constant_names.move:14:11 - │ -14 │ const Self: u64 = 0; - │ ^^^^ Invalid constant name 'Self'. 'Self' is restricted and cannot be used to name a constant - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_constant_names.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_constant_names.snap new file mode 100644 index 0000000000000..5be9a898a4318 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_constant_names.snap @@ -0,0 +1,61 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/restricted_constant_names.move +--- +error[E02010]: invalid name + ┌─ tests/move_check/expansion/restricted_constant_names.move:5:11 + │ +5 │ const address: u64 = 0; + │ ^^^^^^^ Invalid constant name 'address'. Constant names must start with 'A'..'Z' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/restricted_constant_names.move:6:11 + │ +6 │ const signer: u64 = 0; + │ ^^^^^^ Invalid constant name 'signer'. Constant names must start with 'A'..'Z' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/restricted_constant_names.move:7:11 + │ +7 │ const u8: u64 = 0; + │ ^^ Invalid constant name 'u8'. Constant names must start with 'A'..'Z' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/restricted_constant_names.move:8:11 + │ +8 │ const u64: u64 = 0; + │ ^^^ Invalid constant name 'u64'. Constant names must start with 'A'..'Z' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/restricted_constant_names.move:9:11 + │ +9 │ const u128: u64 = 0; + │ ^^^^ Invalid constant name 'u128'. Constant names must start with 'A'..'Z' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/restricted_constant_names.move:10:11 + │ +10 │ const vector: u64 = 0; + │ ^^^^^^ Invalid constant name 'vector'. Constant names must start with 'A'..'Z' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/restricted_constant_names.move:11:11 + │ +11 │ const freeze: u64 = 0; + │ ^^^^^^ Invalid constant name 'freeze'. Constant names must start with 'A'..'Z' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/restricted_constant_names.move:12:11 + │ +12 │ const assert: u64 = 0; + │ ^^^^^^ Invalid constant name 'assert'. Constant names must start with 'A'..'Z' + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_constant_names.move:14:11 + │ +14 │ const Self: u64 = 0; + │ ^^^^ Invalid constant name 'Self'. 'Self' is restricted and cannot be used to name a constant diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_function_names.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_function_names.exp deleted file mode 100644 index e61a4f1857155..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_function_names.exp +++ /dev/null @@ -1,54 +0,0 @@ -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_function_names.move:2:9 - │ -2 │ fun address() { abort 0 } - │ ^^^^^^^ Invalid function name 'address'. 'address' is restricted and cannot be used to name a function - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_function_names.move:3:9 - │ -3 │ fun signer() { abort 0 } - │ ^^^^^^ Invalid function name 'signer'. 'signer' is restricted and cannot be used to name a function - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_function_names.move:4:9 - │ -4 │ fun u8() { abort 0 } - │ ^^ Invalid function name 'u8'. 'u8' is restricted and cannot be used to name a function - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_function_names.move:5:9 - │ -5 │ fun u64() { abort 0 } - │ ^^^ Invalid function name 'u64'. 'u64' is restricted and cannot be used to name a function - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_function_names.move:6:9 - │ -6 │ fun u128() { abort 0 } - │ ^^^^ Invalid function name 'u128'. 'u128' is restricted and cannot be used to name a function - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_function_names.move:7:9 - │ -7 │ fun vector() { abort 0 } - │ ^^^^^^ Invalid function name 'vector'. 'vector' is restricted and cannot be used to name a function - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_function_names.move:8:9 - │ -8 │ fun freeze() { abort 0 } - │ ^^^^^^ Invalid function name 'freeze'. 'freeze' is restricted and cannot be used to name a function - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_function_names.move:9:9 - │ -9 │ fun assert() { abort 0 } - │ ^^^^^^ Invalid function name 'assert'. 'assert' is restricted and cannot be used to name a function - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_function_names.move:10:9 - │ -10 │ fun Self() { abort 0} - │ ^^^^ Invalid function name 'Self'. 'Self' is restricted and cannot be used to name a function - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_function_names.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_function_names.snap new file mode 100644 index 0000000000000..754f7c9871c5e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_function_names.snap @@ -0,0 +1,61 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/restricted_function_names.move +--- +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_function_names.move:2:9 + │ +2 │ fun address() { abort 0 } + │ ^^^^^^^ Invalid function name 'address'. 'address' is restricted and cannot be used to name a function + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_function_names.move:3:9 + │ +3 │ fun signer() { abort 0 } + │ ^^^^^^ Invalid function name 'signer'. 'signer' is restricted and cannot be used to name a function + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_function_names.move:4:9 + │ +4 │ fun u8() { abort 0 } + │ ^^ Invalid function name 'u8'. 'u8' is restricted and cannot be used to name a function + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_function_names.move:5:9 + │ +5 │ fun u64() { abort 0 } + │ ^^^ Invalid function name 'u64'. 'u64' is restricted and cannot be used to name a function + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_function_names.move:6:9 + │ +6 │ fun u128() { abort 0 } + │ ^^^^ Invalid function name 'u128'. 'u128' is restricted and cannot be used to name a function + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_function_names.move:7:9 + │ +7 │ fun vector() { abort 0 } + │ ^^^^^^ Invalid function name 'vector'. 'vector' is restricted and cannot be used to name a function + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_function_names.move:8:9 + │ +8 │ fun freeze() { abort 0 } + │ ^^^^^^ Invalid function name 'freeze'. 'freeze' is restricted and cannot be used to name a function + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_function_names.move:9:9 + │ +9 │ fun assert() { abort 0 } + │ ^^^^^^ Invalid function name 'assert'. 'assert' is restricted and cannot be used to name a function + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_function_names.move:10:9 + │ +10 │ fun Self() { abort 0} + │ ^^^^ Invalid function name 'Self'. 'Self' is restricted and cannot be used to name a function diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_module_alias_names.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_module_alias_names.exp deleted file mode 100644 index 376b7df42ae2b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_module_alias_names.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_module_alias_names.move:3:20 - │ -3 │ use 0x42::M as Self; - │ ^^^^ Invalid module alias name 'Self'. 'Self' is restricted and cannot be used to name a module alias - -warning[W09001]: unused alias - ┌─ tests/move_check/expansion/restricted_module_alias_names.move:5:20 - │ -5 │ use 0x42::M as vector; - │ ^^^^^^ Unused 'use' of alias 'vector'. Consider removing it - │ - = This alias does not shadow the built-in type 'vector' in type annotations. - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_module_alias_names.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_module_alias_names.snap new file mode 100644 index 0000000000000..25866e5893aeb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_module_alias_names.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/restricted_module_alias_names.move +--- +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_module_alias_names.move:3:20 + │ +3 │ use 0x42::M as Self; + │ ^^^^ Invalid module alias name 'Self'. 'Self' is restricted and cannot be used to name a module alias + +warning[W09001]: unused alias + ┌─ tests/move_check/expansion/restricted_module_alias_names.move:5:20 + │ +5 │ use 0x42::M as vector; + │ ^^^^^^ Unused 'use' of alias 'vector'. Consider removing it + │ + = This alias does not shadow the built-in type 'vector' in type annotations. + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_module_names.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_module_names.exp deleted file mode 100644 index 6cf46b670df7f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_module_names.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_module_names.move:2:14 - │ -2 │ module 0x42::Self {} - │ ^^^^ Invalid module name 'Self'. 'Self' is restricted and cannot be used to name a module - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_module_names.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_module_names.snap new file mode 100644 index 0000000000000..e1118746deb62 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_module_names.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/restricted_module_names.move +--- +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_module_names.move:2:14 + │ +2 │ module 0x42::Self {} + │ ^^^^ Invalid module name 'Self'. 'Self' is restricted and cannot be used to name a module diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_names_valid.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_names_valid.snap new file mode 100644 index 0000000000000..6b0347ec0e4cb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_names_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/restricted_names_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_struct_names.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_struct_names.exp deleted file mode 100644 index ddc9a5f959fe5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_struct_names.exp +++ /dev/null @@ -1,48 +0,0 @@ -error[E02010]: invalid name - ┌─ tests/move_check/expansion/restricted_struct_names.move:2:12 - │ -2 │ struct address {} - │ ^^^^^^^ Invalid struct name 'address'. Struct names must start with 'A'..'Z' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/restricted_struct_names.move:3:12 - │ -3 │ struct signer {} - │ ^^^^^^ Invalid struct name 'signer'. Struct names must start with 'A'..'Z' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/restricted_struct_names.move:4:12 - │ -4 │ struct u8 {} - │ ^^ Invalid struct name 'u8'. Struct names must start with 'A'..'Z' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/restricted_struct_names.move:5:12 - │ -5 │ struct u64 {} - │ ^^^ Invalid struct name 'u64'. Struct names must start with 'A'..'Z' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/restricted_struct_names.move:6:12 - │ -6 │ struct u128 {} - │ ^^^^ Invalid struct name 'u128'. Struct names must start with 'A'..'Z' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/restricted_struct_names.move:7:12 - │ -7 │ struct vector { f: T } - │ ^^^^^^ Invalid struct name 'vector'. Struct names must start with 'A'..'Z' - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/restricted_struct_names.move:9:12 - │ -9 │ struct freeze {} - │ ^^^^^^ Invalid struct name 'freeze'. Struct names must start with 'A'..'Z' - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_struct_names.move:10:12 - │ -10 │ struct Self {} - │ ^^^^ Invalid struct name 'Self'. 'Self' is restricted and cannot be used to name a struct - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_struct_names.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_struct_names.snap new file mode 100644 index 0000000000000..897185d7b7cb9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_struct_names.snap @@ -0,0 +1,55 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/restricted_struct_names.move +--- +error[E02010]: invalid name + ┌─ tests/move_check/expansion/restricted_struct_names.move:2:12 + │ +2 │ struct address {} + │ ^^^^^^^ Invalid struct name 'address'. Struct names must start with 'A'..'Z' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/restricted_struct_names.move:3:12 + │ +3 │ struct signer {} + │ ^^^^^^ Invalid struct name 'signer'. Struct names must start with 'A'..'Z' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/restricted_struct_names.move:4:12 + │ +4 │ struct u8 {} + │ ^^ Invalid struct name 'u8'. Struct names must start with 'A'..'Z' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/restricted_struct_names.move:5:12 + │ +5 │ struct u64 {} + │ ^^^ Invalid struct name 'u64'. Struct names must start with 'A'..'Z' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/restricted_struct_names.move:6:12 + │ +6 │ struct u128 {} + │ ^^^^ Invalid struct name 'u128'. Struct names must start with 'A'..'Z' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/restricted_struct_names.move:7:12 + │ +7 │ struct vector { f: T } + │ ^^^^^^ Invalid struct name 'vector'. Struct names must start with 'A'..'Z' + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/restricted_struct_names.move:9:12 + │ +9 │ struct freeze {} + │ ^^^^^^ Invalid struct name 'freeze'. Struct names must start with 'A'..'Z' + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_struct_names.move:10:12 + │ +10 │ struct Self {} + │ ^^^^ Invalid struct name 'Self'. 'Self' is restricted and cannot be used to name a struct diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_type_parameter_names.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_type_parameter_names.exp deleted file mode 100644 index 50370b7b64bdb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_type_parameter_names.exp +++ /dev/null @@ -1,156 +0,0 @@ -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:4:9 - │ -4 │ _, - │ ^ Invalid type parameter name '_'. '_' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:5:9 - │ -5 │ address, - │ ^^^^^^^ Invalid type parameter name 'address'. 'address' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:6:9 - │ -6 │ signer, - │ ^^^^^^ Invalid type parameter name 'signer'. 'signer' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:7:9 - │ -7 │ u8, - │ ^^ Invalid type parameter name 'u8'. 'u8' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:8:9 - │ -8 │ u16, - │ ^^^ Invalid type parameter name 'u16'. 'u16' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:9:9 - │ -9 │ u32, - │ ^^^ Invalid type parameter name 'u32'. 'u32' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:10:9 - │ -10 │ u64, - │ ^^^ Invalid type parameter name 'u64'. 'u64' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:11:9 - │ -11 │ u128, - │ ^^^^ Invalid type parameter name 'u128'. 'u128' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:12:9 - │ -12 │ u256, - │ ^^^^ Invalid type parameter name 'u256'. 'u256' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:13:9 - │ -13 │ vector, - │ ^^^^^^ Invalid type parameter name 'vector'. 'vector' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:14:9 - │ -14 │ freeze, - │ ^^^^^^ Invalid type parameter name 'freeze'. 'freeze' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:15:9 - │ -15 │ assert, - │ ^^^^^^ Invalid type parameter name 'assert'. 'assert' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:16:9 - │ -16 │ Self, - │ ^^^^ Invalid type parameter name 'Self'. 'Self' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:19:9 - │ -19 │ _, - │ ^ Invalid type parameter name '_'. '_' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:20:9 - │ -20 │ address, - │ ^^^^^^^ Invalid type parameter name 'address'. 'address' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:21:9 - │ -21 │ signer, - │ ^^^^^^ Invalid type parameter name 'signer'. 'signer' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:22:9 - │ -22 │ u8, - │ ^^ Invalid type parameter name 'u8'. 'u8' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:23:9 - │ -23 │ u16, - │ ^^^ Invalid type parameter name 'u16'. 'u16' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:24:9 - │ -24 │ u32, - │ ^^^ Invalid type parameter name 'u32'. 'u32' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:25:9 - │ -25 │ u64, - │ ^^^ Invalid type parameter name 'u64'. 'u64' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:26:9 - │ -26 │ u128, - │ ^^^^ Invalid type parameter name 'u128'. 'u128' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:27:9 - │ -27 │ u256, - │ ^^^^ Invalid type parameter name 'u256'. 'u256' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:28:9 - │ -28 │ vector, - │ ^^^^^^ Invalid type parameter name 'vector'. 'vector' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:29:9 - │ -29 │ freeze, - │ ^^^^^^ Invalid type parameter name 'freeze'. 'freeze' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:30:9 - │ -30 │ assert, - │ ^^^^^^ Invalid type parameter name 'assert'. 'assert' is restricted and cannot be used to name a type parameter - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:31:9 - │ -31 │ Self, - │ ^^^^ Invalid type parameter name 'Self'. 'Self' is restricted and cannot be used to name a type parameter - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_type_parameter_names.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_type_parameter_names.snap new file mode 100644 index 0000000000000..a885ce51e37f7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_type_parameter_names.snap @@ -0,0 +1,163 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/restricted_type_parameter_names.move +--- +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:4:9 + │ +4 │ _, + │ ^ Invalid type parameter name '_'. '_' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:5:9 + │ +5 │ address, + │ ^^^^^^^ Invalid type parameter name 'address'. 'address' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:6:9 + │ +6 │ signer, + │ ^^^^^^ Invalid type parameter name 'signer'. 'signer' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:7:9 + │ +7 │ u8, + │ ^^ Invalid type parameter name 'u8'. 'u8' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:8:9 + │ +8 │ u16, + │ ^^^ Invalid type parameter name 'u16'. 'u16' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:9:9 + │ +9 │ u32, + │ ^^^ Invalid type parameter name 'u32'. 'u32' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:10:9 + │ +10 │ u64, + │ ^^^ Invalid type parameter name 'u64'. 'u64' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:11:9 + │ +11 │ u128, + │ ^^^^ Invalid type parameter name 'u128'. 'u128' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:12:9 + │ +12 │ u256, + │ ^^^^ Invalid type parameter name 'u256'. 'u256' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:13:9 + │ +13 │ vector, + │ ^^^^^^ Invalid type parameter name 'vector'. 'vector' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:14:9 + │ +14 │ freeze, + │ ^^^^^^ Invalid type parameter name 'freeze'. 'freeze' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:15:9 + │ +15 │ assert, + │ ^^^^^^ Invalid type parameter name 'assert'. 'assert' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:16:9 + │ +16 │ Self, + │ ^^^^ Invalid type parameter name 'Self'. 'Self' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:19:9 + │ +19 │ _, + │ ^ Invalid type parameter name '_'. '_' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:20:9 + │ +20 │ address, + │ ^^^^^^^ Invalid type parameter name 'address'. 'address' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:21:9 + │ +21 │ signer, + │ ^^^^^^ Invalid type parameter name 'signer'. 'signer' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:22:9 + │ +22 │ u8, + │ ^^ Invalid type parameter name 'u8'. 'u8' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:23:9 + │ +23 │ u16, + │ ^^^ Invalid type parameter name 'u16'. 'u16' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:24:9 + │ +24 │ u32, + │ ^^^ Invalid type parameter name 'u32'. 'u32' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:25:9 + │ +25 │ u64, + │ ^^^ Invalid type parameter name 'u64'. 'u64' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:26:9 + │ +26 │ u128, + │ ^^^^ Invalid type parameter name 'u128'. 'u128' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:27:9 + │ +27 │ u256, + │ ^^^^ Invalid type parameter name 'u256'. 'u256' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:28:9 + │ +28 │ vector, + │ ^^^^^^ Invalid type parameter name 'vector'. 'vector' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:29:9 + │ +29 │ freeze, + │ ^^^^^^ Invalid type parameter name 'freeze'. 'freeze' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:30:9 + │ +30 │ assert, + │ ^^^^^^ Invalid type parameter name 'assert'. 'assert' is restricted and cannot be used to name a type parameter + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/restricted_type_parameter_names.move:31:9 + │ +31 │ Self, + │ ^^^^ Invalid type parameter name 'Self'. 'Self' is restricted and cannot be used to name a type parameter diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_type_parameter_names_peculiar.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_type_parameter_names_peculiar.snap new file mode 100644 index 0000000000000..544413a88c931 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/restricted_type_parameter_names_peculiar.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/restricted_type_parameter_names_peculiar.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_block_in_spec_context.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_block_in_spec_context.exp deleted file mode 100644 index 31518419cd184..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_block_in_spec_context.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/spec_block_in_spec_context.move:3:5 - │ -3 │ ╭ spec module { -4 │ │ fun S(): () { -5 │ │ spec {}; -6 │ │ } -7 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/spec_block_in_spec_context.move:10:9 - │ -10 │ spec {}; - │ ^^^^^^^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_block_in_spec_context.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_block_in_spec_context.snap new file mode 100644 index 0000000000000..95562f461cc25 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_block_in_spec_context.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/spec_block_in_spec_context.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/spec_block_in_spec_context.move:3:5 + │ +3 │ ╭ spec module { +4 │ │ fun S(): () { +5 │ │ spec {}; +6 │ │ } +7 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/spec_block_in_spec_context.move:10:9 + │ +10 │ spec {}; + │ ^^^^^^^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_block_uses.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_block_uses.exp deleted file mode 100644 index 655d134a8cd2f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_block_uses.exp +++ /dev/null @@ -1,9 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/spec_block_uses.move:10:5 - │ -10 │ ╭ spec module { -11 │ │ use 0x2::M::{S as R, R as S}; -12 │ │ ensures exists>(0x1) == exists(0x1); -13 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_block_uses.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_block_uses.snap new file mode 100644 index 0000000000000..6dfabadedc1e1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_block_uses.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/spec_block_uses.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/spec_block_uses.move:10:5 + │ +10 │ ╭ spec module { +11 │ │ use 0x2::M::{S as R, R as S}; +12 │ │ ensures exists>(0x1) == exists(0x1); +13 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_block_uses_shadows_defines.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_block_uses_shadows_defines.exp deleted file mode 100644 index 585cf1933635c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_block_uses_shadows_defines.exp +++ /dev/null @@ -1,12 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/spec_block_uses_shadows_defines.move:10:5 - │ -10 │ ╭ spec module { -11 │ │ use 0x2::M::{R1 as R, R2 as S}; -12 │ │ // TODO syntax change to move spec heleprs outside of blocks -13 │ │ fun S(): bool { false } - · │ -16 │ │ ensures exists>(0x1) == exists(0x1); -17 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_block_uses_shadows_defines.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_block_uses_shadows_defines.snap new file mode 100644 index 0000000000000..e81a7bb3cb4ee --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_block_uses_shadows_defines.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/spec_block_uses_shadows_defines.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/spec_block_uses_shadows_defines.move:10:5 + │ +10 │ ╭ spec module { +11 │ │ use 0x2::M::{R1 as R, R2 as S}; +12 │ │ // TODO syntax change to move spec heleprs outside of blocks +13 │ │ fun S(): bool { false } + · │ +16 │ │ ensures exists>(0x1) == exists(0x1); +17 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_function_member_conflicts.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_function_member_conflicts.exp deleted file mode 100644 index 2544f14ec5df8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_function_member_conflicts.exp +++ /dev/null @@ -1,56 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/spec_function_member_conflicts.move:4:5 - │ -4 │ ╭ spec module { -5 │ │ fun Foo(): bool { true } -6 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/spec_function_member_conflicts.move:11:5 - │ -11 │ ╭ spec module { -12 │ │ fun Foo(): bool { true } -13 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/spec_function_member_conflicts.move:14:5 - │ -14 │ ╭ spec schema Foo { -15 │ │ ensures true; -16 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/spec_function_member_conflicts.move:20:5 - │ -20 │ ╭ spec module { -21 │ │ fun Foo(): bool { true } -22 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/spec_function_member_conflicts.move:27:5 - │ -27 │ ╭ spec module { -28 │ │ fun foo(): bool { true } -29 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/spec_function_member_conflicts.move:34:5 - │ -34 │ ╭ spec module { -35 │ │ fun foo(): bool { true } -36 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/spec_function_member_conflicts.move:37:5 - │ -37 │ ╭ spec module { -38 │ │ fun foo(): bool { true } -39 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_function_member_conflicts.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_function_member_conflicts.snap new file mode 100644 index 0000000000000..7906b7b1e957c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_function_member_conflicts.snap @@ -0,0 +1,63 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/spec_function_member_conflicts.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/spec_function_member_conflicts.move:4:5 + │ +4 │ ╭ spec module { +5 │ │ fun Foo(): bool { true } +6 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/spec_function_member_conflicts.move:11:5 + │ +11 │ ╭ spec module { +12 │ │ fun Foo(): bool { true } +13 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/spec_function_member_conflicts.move:14:5 + │ +14 │ ╭ spec schema Foo { +15 │ │ ensures true; +16 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/spec_function_member_conflicts.move:20:5 + │ +20 │ ╭ spec module { +21 │ │ fun Foo(): bool { true } +22 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/spec_function_member_conflicts.move:27:5 + │ +27 │ ╭ spec module { +28 │ │ fun foo(): bool { true } +29 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/spec_function_member_conflicts.move:34:5 + │ +34 │ ╭ spec module { +35 │ │ fun foo(): bool { true } +36 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/spec_function_member_conflicts.move:37:5 + │ +37 │ ╭ spec module { +38 │ │ fun foo(): bool { true } +39 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_schema_member_conflicts.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_schema_member_conflicts.exp deleted file mode 100644 index 0046bf7205512..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_schema_member_conflicts.exp +++ /dev/null @@ -1,48 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/spec_schema_member_conflicts.move:4:5 - │ -4 │ ╭ spec schema Foo { -5 │ │ ensures true; -6 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/spec_schema_member_conflicts.move:11:5 - │ -11 │ ╭ spec schema Foo { -12 │ │ ensures true; -13 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/spec_schema_member_conflicts.move:14:5 - │ -14 │ ╭ spec schema Foo { -15 │ │ ensures true; -16 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/spec_schema_member_conflicts.move:20:5 - │ -20 │ ╭ spec schema Foo { -21 │ │ ensures true; -22 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/spec_schema_member_conflicts.move:27:5 - │ -27 │ ╭ spec schema Foo { -28 │ │ ensures true; -29 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/spec_schema_member_conflicts.move:30:5 - │ -30 │ ╭ spec module { -31 │ │ fun Foo(): bool { false } -32 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_schema_member_conflicts.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_schema_member_conflicts.snap new file mode 100644 index 0000000000000..4c57b3b27b046 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/spec_schema_member_conflicts.snap @@ -0,0 +1,55 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/spec_schema_member_conflicts.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/spec_schema_member_conflicts.move:4:5 + │ +4 │ ╭ spec schema Foo { +5 │ │ ensures true; +6 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/spec_schema_member_conflicts.move:11:5 + │ +11 │ ╭ spec schema Foo { +12 │ │ ensures true; +13 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/spec_schema_member_conflicts.move:14:5 + │ +14 │ ╭ spec schema Foo { +15 │ │ ensures true; +16 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/spec_schema_member_conflicts.move:20:5 + │ +20 │ ╭ spec schema Foo { +21 │ │ ensures true; +22 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/spec_schema_member_conflicts.move:27:5 + │ +27 │ ╭ spec schema Foo { +28 │ │ ensures true; +29 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/spec_schema_member_conflicts.move:30:5 + │ +30 │ ╭ spec module { +31 │ │ fun Foo(): bool { false } +32 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/standalone_fields.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/standalone_fields.exp deleted file mode 100644 index c0087c61a6da6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/standalone_fields.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E03009]: unbound variable - ┌─ tests/move_check/expansion/standalone_fields.move:3:10 - │ -3 │ {f: 1, g: 0}; - │ ^ Unbound variable 'f' - -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/standalone_fields.move:3:11 - │ -3 │ {f: 1, g: 0}; - │ ^ - │ │ - │ Unexpected ':' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/standalone_fields.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/standalone_fields.snap new file mode 100644 index 0000000000000..e755adb6423e6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/standalone_fields.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/standalone_fields.move +--- +error[E03009]: unbound variable + ┌─ tests/move_check/expansion/standalone_fields.move:3:10 + │ +3 │ {f: 1, g: 0}; + │ ^ Unbound variable 'f' + +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/standalone_fields.move:3:11 + │ +3 │ {f: 1, g: 0}; + │ ^ + │ │ + │ Unexpected ':' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/standalone_mname_with_type_args.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/standalone_mname_with_type_args.exp deleted file mode 100644 index 454f1b9be0d62..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/standalone_mname_with_type_args.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_check/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/external-crates/move/crates/move-compiler/tests/move_check/expansion/standalone_mname_with_type_args.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/standalone_mname_with_type_args.snap new file mode 100644 index 0000000000000..8e234f1ce29bc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/standalone_mname_with_type_args.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/standalone_mname_with_type_args.move +--- +error[E03006]: unexpected name in this position + ┌─ tests/move_check/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/external-crates/move/crates/move-compiler/tests/move_check/expansion/standalone_name_with_type_args.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/standalone_name_with_type_args.exp deleted file mode 100644 index 169326a8ddae1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/standalone_name_with_type_args.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_check/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/external-crates/move/crates/move-compiler/tests/move_check/expansion/standalone_name_with_type_args.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/standalone_name_with_type_args.snap new file mode 100644 index 0000000000000..1889021e55479 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/standalone_name_with_type_args.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/standalone_name_with_type_args.move +--- +error[E03006]: unexpected name in this position + ┌─ tests/move_check/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/external-crates/move/crates/move-compiler/tests/move_check/expansion/test_attribute_missspelled.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/test_attribute_missspelled.exp deleted file mode 100644 index 48e57d6ce13e1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/test_attribute_missspelled.exp +++ /dev/null @@ -1,12 +0,0 @@ -warning[W02018]: unknown attribute - ┌─ tests/move_check/expansion/test_attribute_missspelled.move:2:7 - │ -2 │ #[test__only] - │ ^^^^^^^^^^ Unknown attribute 'test__only'. Custom attributes must be wrapped in 'ext', e.g. #[ext(test__only)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/expansion/test_attribute_missspelled.move:4:7 - │ -4 │ #[testonly] - │ ^^^^^^^^ Unknown attribute 'testonly'. Custom attributes must be wrapped in 'ext', e.g. #[ext(testonly)] - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/test_attribute_missspelled.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/test_attribute_missspelled.snap new file mode 100644 index 0000000000000..65eb8599d3ef4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/test_attribute_missspelled.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/test_attribute_missspelled.move +--- +warning[W02018]: unknown attribute + ┌─ tests/move_check/expansion/test_attribute_missspelled.move:2:7 + │ +2 │ #[test__only] + │ ^^^^^^^^^^ Unknown attribute 'test__only'. Custom attributes must be wrapped in 'ext', e.g. #[ext(test__only)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/expansion/test_attribute_missspelled.move:4:7 + │ +4 │ #[testonly] + │ ^^^^^^^^ Unknown attribute 'testonly'. Custom attributes must be wrapped in 'ext', e.g. #[ext(testonly)] diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/top_level_not_named_main.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/top_level_not_named_main.snap new file mode 100644 index 0000000000000..63f0cf487ae30 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/top_level_not_named_main.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/top_level_not_named_main.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/type_arguments_on_field_access.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/type_arguments_on_field_access.exp deleted file mode 100644 index df5c5a6921a17..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/type_arguments_on_field_access.exp +++ /dev/null @@ -1,26 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/expansion/type_arguments_on_field_access.move:6:9 - │ -6 │ x.f; - │ ^^^^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E04023]: invalid method call - ┌─ tests/move_check/expansion/type_arguments_on_field_access.move:6:9 - │ -6 │ x.f; - │ ^^^^^^^^ - │ │ │ - │ │ No local 'use fun' alias was found for '0x42::M::S.f', and no function 'f' was found in the defining module '0x42::M' - │ Invalid method call. No known method 'f' on type '0x42::M::S' - -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/type_arguments_on_field_access.move:6:17 - │ -6 │ x.f; - │ ^ - │ │ - │ Unexpected ';' - │ Expected '(' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/type_arguments_on_field_access.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/type_arguments_on_field_access.snap new file mode 100644 index 0000000000000..4ea99d7f2a7a6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/type_arguments_on_field_access.snap @@ -0,0 +1,33 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/type_arguments_on_field_access.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/expansion/type_arguments_on_field_access.move:6:9 + │ +6 │ x.f; + │ ^^^^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E04023]: invalid method call + ┌─ tests/move_check/expansion/type_arguments_on_field_access.move:6:9 + │ +6 │ x.f; + │ ^^^^^^^^ + │ │ │ + │ │ No local 'use fun' alias was found for '0x42::M::S.f', and no function 'f' was found in the defining module '0x42::M' + │ Invalid method call. No known method 'f' on type '0x42::M::S' + +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/type_arguments_on_field_access.move:6:17 + │ +6 │ x.f; + │ ^ + │ │ + │ Unexpected ';' + │ Expected '(' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/type_parameter_underscore.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/type_parameter_underscore.snap new file mode 100644 index 0000000000000..42f782bd70486 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/type_parameter_underscore.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/type_parameter_underscore.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/unbound_module_alias_in_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/unbound_module_alias_in_type.exp deleted file mode 100644 index 64170c9dece2a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/unbound_module_alias_in_type.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/move_check/expansion/unbound_module_alias_in_type.move:2:16 - │ -2 │ fun foo(x: X::T) { x; } - │ ^ Unbound module alias 'X' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/unbound_module_alias_in_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/unbound_module_alias_in_type.snap new file mode 100644 index 0000000000000..68f51dbcc8207 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/unbound_module_alias_in_type.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/unbound_module_alias_in_type.move +--- +error[E03002]: unbound module + ┌─ tests/move_check/expansion/unbound_module_alias_in_type.move:2:16 + │ +2 │ fun foo(x: X::T) { x; } + │ ^ Unbound module alias 'X' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/unbound_named_address.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/unbound_named_address.exp deleted file mode 100644 index 260173bacff62..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/unbound_named_address.exp +++ /dev/null @@ -1,87 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/move_check/expansion/unbound_named_address.move:3:9 - │ -3 │ use B::X; - │ ^^^^ Invalid 'use'. Unbound module: 'B::X' - -error[E02011]: invalid 'friend' declaration - ┌─ tests/move_check/expansion/unbound_named_address.move:5:5 - │ -5 │ friend C::M; - │ ^^^^^^^^^^^^ - │ │ │ - │ │ Cannot declare modules out of the current address as a friend - │ Invalid friend declaration - -error[E03001]: address with no value - ┌─ tests/move_check/expansion/unbound_named_address.move:5:12 - │ -5 │ friend C::M; - │ ^ address 'C' is not assigned a value - -error[E03001]: address with no value - ┌─ tests/move_check/expansion/unbound_named_address.move:6:12 - │ -6 │ friend D::M::foo; - │ ^ address 'D' is not assigned a value - -error[E03006]: unexpected name in this position - ┌─ tests/move_check/expansion/unbound_named_address.move:6:18 - │ -6 │ friend D::M::foo; - │ ^^^ Unexpected module member access. Expected a module identifier only - -error[E03001]: address with no value - ┌─ tests/move_check/expansion/unbound_named_address.move:9:12 - │ -9 │ x: E::M::S, - │ ^ address 'E' is not assigned a value - -error[E03002]: unbound module - ┌─ tests/move_check/expansion/unbound_named_address.move:9:12 - │ -9 │ x: E::M::S, - │ ^^^^ Unbound module 'E::M' - -error[E03001]: address with no value - ┌─ tests/move_check/expansion/unbound_named_address.move:13:17 - │ -13 │ let x = F::M::S {}; x; - │ ^ address 'F' is not assigned a value - -error[E03002]: unbound module - ┌─ tests/move_check/expansion/unbound_named_address.move:13:17 - │ -13 │ let x = F::M::S {}; x; - │ ^^^^ Unbound module 'F::M' - -error[E03001]: address with no value - ┌─ tests/move_check/expansion/unbound_named_address.move:14:9 - │ -14 │ G::M::foo(); - │ ^ address 'G' is not assigned a value - -error[E03002]: unbound module - ┌─ tests/move_check/expansion/unbound_named_address.move:14:9 - │ -14 │ G::M::foo(); - │ ^^^^ Unbound module 'G::M' - -error[E03001]: address with no value - ┌─ tests/move_check/expansion/unbound_named_address.move:15:17 - │ -15 │ let c = H::M::C; c; - │ ^ address 'H' is not assigned a value - -error[E03002]: unbound module - ┌─ tests/move_check/expansion/unbound_named_address.move:15:17 - │ -15 │ let c = H::M::C; c; - │ ^^^^ Unbound module 'H::M' - -error[E03001]: address with no value - ┌─ tests/move_check/expansion/unbound_named_address.move:16:18 - │ -16 │ let a = @I; a; // suggests declaration - │ ^ address 'I' is not assigned a value. Try assigning it a value when calling the compiler - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/unbound_named_address.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/unbound_named_address.snap new file mode 100644 index 0000000000000..28bbdefb2db47 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/unbound_named_address.snap @@ -0,0 +1,94 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/unbound_named_address.move +--- +error[E03002]: unbound module + ┌─ tests/move_check/expansion/unbound_named_address.move:3:9 + │ +3 │ use B::X; + │ ^^^^ Invalid 'use'. Unbound module: 'B::X' + +error[E02011]: invalid 'friend' declaration + ┌─ tests/move_check/expansion/unbound_named_address.move:5:5 + │ +5 │ friend C::M; + │ ^^^^^^^^^^^^ + │ │ │ + │ │ Cannot declare modules out of the current address as a friend + │ Invalid friend declaration + +error[E03001]: address with no value + ┌─ tests/move_check/expansion/unbound_named_address.move:5:12 + │ +5 │ friend C::M; + │ ^ address 'C' is not assigned a value + +error[E03001]: address with no value + ┌─ tests/move_check/expansion/unbound_named_address.move:6:12 + │ +6 │ friend D::M::foo; + │ ^ address 'D' is not assigned a value + +error[E03006]: unexpected name in this position + ┌─ tests/move_check/expansion/unbound_named_address.move:6:18 + │ +6 │ friend D::M::foo; + │ ^^^ Unexpected module member access. Expected a module identifier only + +error[E03001]: address with no value + ┌─ tests/move_check/expansion/unbound_named_address.move:9:12 + │ +9 │ x: E::M::S, + │ ^ address 'E' is not assigned a value + +error[E03002]: unbound module + ┌─ tests/move_check/expansion/unbound_named_address.move:9:12 + │ +9 │ x: E::M::S, + │ ^^^^ Unbound module 'E::M' + +error[E03001]: address with no value + ┌─ tests/move_check/expansion/unbound_named_address.move:13:17 + │ +13 │ let x = F::M::S {}; x; + │ ^ address 'F' is not assigned a value + +error[E03002]: unbound module + ┌─ tests/move_check/expansion/unbound_named_address.move:13:17 + │ +13 │ let x = F::M::S {}; x; + │ ^^^^ Unbound module 'F::M' + +error[E03001]: address with no value + ┌─ tests/move_check/expansion/unbound_named_address.move:14:9 + │ +14 │ G::M::foo(); + │ ^ address 'G' is not assigned a value + +error[E03002]: unbound module + ┌─ tests/move_check/expansion/unbound_named_address.move:14:9 + │ +14 │ G::M::foo(); + │ ^^^^ Unbound module 'G::M' + +error[E03001]: address with no value + ┌─ tests/move_check/expansion/unbound_named_address.move:15:17 + │ +15 │ let c = H::M::C; c; + │ ^ address 'H' is not assigned a value + +error[E03002]: unbound module + ┌─ tests/move_check/expansion/unbound_named_address.move:15:17 + │ +15 │ let c = H::M::C; c; + │ ^^^^ Unbound module 'H::M' + +error[E03001]: address with no value + ┌─ tests/move_check/expansion/unbound_named_address.move:16:18 + │ +16 │ let a = @I; a; // suggests declaration + │ ^ address 'I' is not assigned a value. Try assigning it a value when calling the compiler diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_all_field_cases.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_all_field_cases.exp deleted file mode 100644 index 331a4249106d8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_all_field_cases.exp +++ /dev/null @@ -1,34 +0,0 @@ -warning[W09003]: unused assignment - ┌─ tests/move_check/expansion/unpack_all_field_cases.move:10:13 - │ -10 │ S { f, g } = copy s; - │ ^ Unused assignment for variable 'f'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_f') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09003]: unused assignment - ┌─ tests/move_check/expansion/unpack_all_field_cases.move:10:16 - │ -10 │ S { f, g } = copy s; - │ ^ Unused assignment for variable 'g'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_g') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01009]: invalid assignment - ┌─ tests/move_check/expansion/unpack_all_field_cases.move:11:16 - │ -11 │ S { f: 0, g: 0} = copy s; - │ ^ Invalid assignment syntax. Expected: a local, a field write, or a deconstructing assignment - -error[E01009]: invalid assignment - ┌─ tests/move_check/expansion/unpack_all_field_cases.move:12:16 - │ -12 │ S { g: 0, f } = copy s; - │ ^ Invalid assignment syntax. Expected: a local, a field write, or a deconstructing assignment - -error[E01009]: invalid assignment - ┌─ tests/move_check/expansion/unpack_all_field_cases.move:13:19 - │ -13 │ S { g, f: 0 } = copy s; - │ ^ Invalid assignment syntax. Expected: a local, a field write, or a deconstructing assignment - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_all_field_cases.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_all_field_cases.snap new file mode 100644 index 0000000000000..242620b2aba00 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_all_field_cases.snap @@ -0,0 +1,41 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/unpack_all_field_cases.move +--- +warning[W09003]: unused assignment + ┌─ tests/move_check/expansion/unpack_all_field_cases.move:10:13 + │ +10 │ S { f, g } = copy s; + │ ^ Unused assignment for variable 'f'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_f') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09003]: unused assignment + ┌─ tests/move_check/expansion/unpack_all_field_cases.move:10:16 + │ +10 │ S { f, g } = copy s; + │ ^ Unused assignment for variable 'g'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_g') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01009]: invalid assignment + ┌─ tests/move_check/expansion/unpack_all_field_cases.move:11:16 + │ +11 │ S { f: 0, g: 0} = copy s; + │ ^ Invalid assignment syntax. Expected: a local, a field write, or a deconstructing assignment + +error[E01009]: invalid assignment + ┌─ tests/move_check/expansion/unpack_all_field_cases.move:12:16 + │ +12 │ S { g: 0, f } = copy s; + │ ^ Invalid assignment syntax. Expected: a local, a field write, or a deconstructing assignment + +error[E01009]: invalid assignment + ┌─ tests/move_check/expansion/unpack_all_field_cases.move:13:19 + │ +13 │ S { g, f: 0 } = copy s; + │ ^ Invalid assignment syntax. Expected: a local, a field write, or a deconstructing assignment diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_assign_block_expr.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_assign_block_expr.exp deleted file mode 100644 index 848a91f99595d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_assign_block_expr.exp +++ /dev/null @@ -1,41 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/expansion/unpack_assign_block_expr.move:4:9 - │ -2 │ struct S { f: u64 } - │ - To satisfy the constraint, the 'drop' ability would need to be added here -3 │ fun foo() { -4 │ S { let f = 0; } = S { f: 0 }; - │ ^^^^^^^^^^^^^ - │ │ - │ Cannot ignore values without the 'drop' ability. The value must be used - │ The type '0x42::M::S' does not have the ability 'drop' - -error[E04016]: too few arguments - ┌─ tests/move_check/expansion/unpack_assign_block_expr.move:4:9 - │ -4 │ S { let f = 0; } = S { f: 0 }; - │ ^^^^^^^^^^^^^ Missing argument for field 'f' in '0x42::M::S' - -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/unpack_assign_block_expr.move:4:13 - │ -4 │ S { let f = 0; } = S { f: 0 }; - │ ^ Unexpected 'let'. Expected a field expression - -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/unpack_assign_block_expr.move:4:22 - │ -4 │ S { let f = 0; } = S { f: 0 }; - │ - ^ Expected '}' - │ │ - │ To match this '{' - -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/unpack_assign_block_expr.move:4:26 - │ -4 │ S { let f = 0; } = S { f: 0 }; - │ ^ - │ │ - │ Unexpected '=' - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_assign_block_expr.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_assign_block_expr.snap new file mode 100644 index 0000000000000..0a340c31c2341 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_assign_block_expr.snap @@ -0,0 +1,48 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/unpack_assign_block_expr.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/expansion/unpack_assign_block_expr.move:4:9 + │ +2 │ struct S { f: u64 } + │ - To satisfy the constraint, the 'drop' ability would need to be added here +3 │ fun foo() { +4 │ S { let f = 0; } = S { f: 0 }; + │ ^^^^^^^^^^^^^ + │ │ + │ Cannot ignore values without the 'drop' ability. The value must be used + │ The type '0x42::M::S' does not have the ability 'drop' + +error[E04016]: too few arguments + ┌─ tests/move_check/expansion/unpack_assign_block_expr.move:4:9 + │ +4 │ S { let f = 0; } = S { f: 0 }; + │ ^^^^^^^^^^^^^ Missing argument for field 'f' in '0x42::M::S' + +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/unpack_assign_block_expr.move:4:13 + │ +4 │ S { let f = 0; } = S { f: 0 }; + │ ^ Unexpected 'let'. Expected a field expression + +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/unpack_assign_block_expr.move:4:22 + │ +4 │ S { let f = 0; } = S { f: 0 }; + │ - ^ Expected '}' + │ │ + │ To match this '{' + +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/unpack_assign_block_expr.move:4:26 + │ +4 │ S { let f = 0; } = S { f: 0 }; + │ ^ + │ │ + │ Unexpected '=' + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_assign_block_single_expr.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_assign_block_single_expr.exp deleted file mode 100644 index 743f5ded11055..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_assign_block_single_expr.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E04016]: too few arguments - ┌─ tests/move_check/expansion/unpack_assign_block_single_expr.move:4:9 - │ -4 │ S { 0 } = S { f: 0 }; - │ ^^^^^^^ Missing assignment for field 'f' in '0x42::M::S' - -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/unpack_assign_block_single_expr.move:4:13 - │ -4 │ S { 0 } = S { f: 0 }; - │ ^ Unexpected ''. Expected a field expression - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_assign_block_single_expr.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_assign_block_single_expr.snap new file mode 100644 index 0000000000000..4f163f9cc892a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_assign_block_single_expr.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/unpack_assign_block_single_expr.move +--- +error[E04016]: too few arguments + ┌─ tests/move_check/expansion/unpack_assign_block_single_expr.move:4:9 + │ +4 │ S { 0 } = S { f: 0 }; + │ ^^^^^^^ Missing assignment for field 'f' in '0x42::M::S' + +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/unpack_assign_block_single_expr.move:4:13 + │ +4 │ S { 0 } = S { f: 0 }; + │ ^ Unexpected ''. Expected a field expression diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_assign_other_expr.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_assign_other_expr.exp deleted file mode 100644 index 9f8fa6ab7dbd3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_assign_other_expr.exp +++ /dev/null @@ -1,77 +0,0 @@ -error[E03013]: positional call mismatch - ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:6:9 - │ -3 │ struct S { f: u64 } - │ - 'S' is declared here - · -6 │ S ( f ) = S { f: 0 }; - │ ^^^^^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:6:9 - │ -6 │ S ( f ) = S { f: 0 }; - │ ^^^^^^^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E03010]: unbound field - ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:6:9 - │ -6 │ S ( f ) = S { f: 0 }; - │ ^^^^^^^ Unbound field '0' in '0x42::M::S' - -error[E04016]: too few arguments - ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:6:9 - │ -6 │ S ( f ) = S { f: 0 }; - │ ^^^^^^^ Missing assignment for field 'f' in '0x42::M::S' - -warning[W09002]: unused variable - ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:8:13 - │ -8 │ let f: u64; - │ ^ Unused local variable 'f'. Consider removing or prefixing with an underscore: '_f' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03022]: invalid usage position - ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:9:9 - │ -9 │ S f = S { f: 0 }; - │ ^ Expected a local or constant, but found struct 'S' in current scope - │ - = Struct with named arguments must be written as 'S { ... }' - -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:9:11 - │ -9 │ S f = S { f: 0 }; - │ ^ - │ │ - │ Unexpected 'f' - │ Expected ';' - -error[E03013]: positional call mismatch - ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:11:9 - │ - 2 │ struct G {} - │ - 'G' is declared here - · -11 │ G () = G {}; - │ ^^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:11:9 - │ -11 │ G () = G {}; - │ ^^^^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:12:12 - │ -12 │ G {{}} = G{}; - │ ^ Unexpected '{'. Expected a field expression - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_assign_other_expr.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_assign_other_expr.snap new file mode 100644 index 0000000000000..564e211f20af8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/unpack_assign_other_expr.snap @@ -0,0 +1,84 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/unpack_assign_other_expr.move +--- +error[E03013]: positional call mismatch + ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:6:9 + │ +3 │ struct S { f: u64 } + │ - 'S' is declared here + · +6 │ S ( f ) = S { f: 0 }; + │ ^^^^^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:6:9 + │ +6 │ S ( f ) = S { f: 0 }; + │ ^^^^^^^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E03010]: unbound field + ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:6:9 + │ +6 │ S ( f ) = S { f: 0 }; + │ ^^^^^^^ Unbound field '0' in '0x42::M::S' + +error[E04016]: too few arguments + ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:6:9 + │ +6 │ S ( f ) = S { f: 0 }; + │ ^^^^^^^ Missing assignment for field 'f' in '0x42::M::S' + +warning[W09002]: unused variable + ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:8:13 + │ +8 │ let f: u64; + │ ^ Unused local variable 'f'. Consider removing or prefixing with an underscore: '_f' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03022]: invalid usage position + ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:9:9 + │ +9 │ S f = S { f: 0 }; + │ ^ Expected a local or constant, but found struct 'S' in current scope + │ + = Struct with named arguments must be written as 'S { ... }' + +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:9:11 + │ +9 │ S f = S { f: 0 }; + │ ^ + │ │ + │ Unexpected 'f' + │ Expected ';' + +error[E03013]: positional call mismatch + ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:11:9 + │ + 2 │ struct G {} + │ - 'G' is declared here + · +11 │ G () = G {}; + │ ^^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:11:9 + │ +11 │ G () = G {}; + │ ^^^^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/unpack_assign_other_expr.move:12:12 + │ +12 │ G {{}} = G{}; + │ ^ Unexpected '{'. Expected a field expression diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function.snap new file mode 100644 index 0000000000000..bbcf0de531bee --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_function.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_overlap_with_module.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_overlap_with_module.snap new file mode 100644 index 0000000000000..24bb2aa885700 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_overlap_with_module.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_function_overlap_with_module.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_same_name_as_function.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_same_name_as_function.exp deleted file mode 100644 index 2611d1f02c873..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_same_name_as_function.exp +++ /dev/null @@ -1,25 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/use_function_same_name_as_function.move:10:9 - │ - 9 │ use 0x2::X::u; - │ - Alias previously defined here -10 │ fun u() { - │ ^ Duplicate module member or alias 'u'. Top level names in a namespace must be unique - -warning[W09001]: unused alias - ┌─ tests/move_check/expansion/use_function_same_name_as_function.move:17:22 - │ -17 │ use 0x2::X::u as bar; - │ ^^^ Unused 'use' of alias 'bar'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/use_function_same_name_as_function.move:17:22 - │ -15 │ fun bar() { - │ --- Alias previously defined here -16 │ } -17 │ use 0x2::X::u as bar; - │ ^^^ Duplicate module member or alias 'bar'. Top level names in a namespace must be unique - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_same_name_as_function.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_same_name_as_function.snap new file mode 100644 index 0000000000000..daf2f78e7825c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_same_name_as_function.snap @@ -0,0 +1,32 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_function_same_name_as_function.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/use_function_same_name_as_function.move:10:9 + │ + 9 │ use 0x2::X::u; + │ - Alias previously defined here +10 │ fun u() { + │ ^ Duplicate module member or alias 'u'. Top level names in a namespace must be unique + +warning[W09001]: unused alias + ┌─ tests/move_check/expansion/use_function_same_name_as_function.move:17:22 + │ +17 │ use 0x2::X::u as bar; + │ ^^^ Unused 'use' of alias 'bar'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/use_function_same_name_as_function.move:17:22 + │ +15 │ fun bar() { + │ --- Alias previously defined here +16 │ } +17 │ use 0x2::X::u as bar; + │ ^^^ Duplicate module member or alias 'bar'. Top level names in a namespace must be unique diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_same_name_as_struct.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_same_name_as_struct.exp deleted file mode 100644 index f3a1e75bb5d90..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_same_name_as_struct.exp +++ /dev/null @@ -1,30 +0,0 @@ -warning[W09001]: unused alias - ┌─ tests/move_check/expansion/use_function_same_name_as_struct.move:9:17 - │ -9 │ use 0x2::X::u; - │ ^ Unused 'use' of alias 'u'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/use_function_same_name_as_struct.move:10:12 - │ -10 │ struct u {} - │ ^ Invalid struct name 'u'. Struct names must start with 'A'..'Z' - -warning[W09001]: unused alias - ┌─ tests/move_check/expansion/use_function_same_name_as_struct.move:15:22 - │ -15 │ use 0x2::X::u as Bar; - │ ^^^ Unused 'use' of alias 'Bar'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/use_function_same_name_as_struct.move:15:22 - │ -14 │ struct Bar {} - │ --- Alias previously defined here -15 │ use 0x2::X::u as Bar; - │ ^^^ Duplicate module member or alias 'Bar'. Top level names in a namespace must be unique - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_same_name_as_struct.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_same_name_as_struct.snap new file mode 100644 index 0000000000000..5d4ea4a354fd7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_same_name_as_struct.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_function_same_name_as_struct.move +--- +warning[W09001]: unused alias + ┌─ tests/move_check/expansion/use_function_same_name_as_struct.move:9:17 + │ +9 │ use 0x2::X::u; + │ ^ Unused 'use' of alias 'u'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/use_function_same_name_as_struct.move:10:12 + │ +10 │ struct u {} + │ ^ Invalid struct name 'u'. Struct names must start with 'A'..'Z' + +warning[W09001]: unused alias + ┌─ tests/move_check/expansion/use_function_same_name_as_struct.move:15:22 + │ +15 │ use 0x2::X::u as Bar; + │ ^^^ Unused 'use' of alias 'Bar'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/use_function_same_name_as_struct.move:15:22 + │ +14 │ struct Bar {} + │ --- Alias previously defined here +15 │ use 0x2::X::u as Bar; + │ ^^^ Duplicate module member or alias 'Bar'. Top level names in a namespace must be unique diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_tparam_shadows.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_tparam_shadows.exp deleted file mode 100644 index 432aa740ffcfe..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_tparam_shadows.exp +++ /dev/null @@ -1,14 +0,0 @@ -warning[W09001]: unused alias - ┌─ tests/move_check/expansion/use_function_tparam_shadows.move:7:17 - │ -7 │ use 0x2::X::foo; - │ ^^^ Unused 'use' of alias 'foo'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/expansion/use_function_tparam_shadows.move:10:9 - │ -10 │ foo() - │ ^^^ Unbound function 'foo' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_tparam_shadows.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_tparam_shadows.snap new file mode 100644 index 0000000000000..b987d4b04826f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_tparam_shadows.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_function_tparam_shadows.move +--- +warning[W09001]: unused alias + ┌─ tests/move_check/expansion/use_function_tparam_shadows.move:7:17 + │ +7 │ use 0x2::X::foo; + │ ^^^ Unused 'use' of alias 'foo'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/expansion/use_function_tparam_shadows.move:10:9 + │ +10 │ foo() + │ ^^^ Unbound function 'foo' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_unbound.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_unbound.exp deleted file mode 100644 index 3ef303d0bf0cb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_unbound.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E03003]: unbound module member - ┌─ tests/move_check/expansion/use_function_unbound.move:6:17 - │ -2 │ module X { - │ - Module '0x2::X' declared here - · -6 │ use 0x2::X::u; - │ ^ Invalid 'use'. Unbound member 'u' in module '0x2::X' - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/expansion/use_function_unbound.move:9:9 - │ -9 │ u() - │ ^ Unbound function 'u' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_unbound.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_unbound.snap new file mode 100644 index 0000000000000..7391f07b30d55 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_function_unbound.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_function_unbound.move +--- +error[E03003]: unbound module member + ┌─ tests/move_check/expansion/use_function_unbound.move:6:17 + │ +2 │ module X { + │ - Module '0x2::X' declared here + · +6 │ use 0x2::X::u; + │ ^ Invalid 'use'. Unbound member 'u' in module '0x2::X' + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/expansion/use_function_unbound.move:9:9 + │ +9 │ u() + │ ^ Unbound function 'u' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope.snap new file mode 100644 index 0000000000000..2e9628b0fc714 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_inner_scope.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_duplicates.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_duplicates.exp deleted file mode 100644 index 8427a46e482c1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_duplicates.exp +++ /dev/null @@ -1,32 +0,0 @@ -warning[W09001]: unused alias - ┌─ tests/move_check/expansion/use_inner_scope_duplicates.move:13:43 - │ -13 │ use 0x2::M::{check as foo, num as foo}; - │ ^^^ Unused 'use' of alias 'foo'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/use_inner_scope_duplicates.move:13:43 - │ -13 │ use 0x2::M::{check as foo, num as foo}; - │ --- ^^^ Duplicate module member or alias 'foo'. Top level names in a namespace must be unique - │ │ - │ Alias previously defined here - -warning[W09001]: unused alias - ┌─ tests/move_check/expansion/use_inner_scope_duplicates.move:15:23 - │ -15 │ use 0x2::M as N; - │ ^ Unused 'use' of alias 'N'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/use_inner_scope_duplicates.move:15:23 - │ -14 │ use 0x2::M as N; - │ - Alias previously defined here -15 │ use 0x2::M as N; - │ ^ Duplicate module alias 'N'. Module aliases must be unique within a given namespace - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_duplicates.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_duplicates.snap new file mode 100644 index 0000000000000..a79ce095863a8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_duplicates.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_inner_scope_duplicates.move +--- +warning[W09001]: unused alias + ┌─ tests/move_check/expansion/use_inner_scope_duplicates.move:13:43 + │ +13 │ use 0x2::M::{check as foo, num as foo}; + │ ^^^ Unused 'use' of alias 'foo'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/use_inner_scope_duplicates.move:13:43 + │ +13 │ use 0x2::M::{check as foo, num as foo}; + │ --- ^^^ Duplicate module member or alias 'foo'. Top level names in a namespace must be unique + │ │ + │ Alias previously defined here + +warning[W09001]: unused alias + ┌─ tests/move_check/expansion/use_inner_scope_duplicates.move:15:23 + │ +15 │ use 0x2::M as N; + │ ^ Unused 'use' of alias 'N'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/use_inner_scope_duplicates.move:15:23 + │ +14 │ use 0x2::M as N; + │ - Alias previously defined here +15 │ use 0x2::M as N; + │ ^ Duplicate module alias 'N'. Module aliases must be unique within a given namespace diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_invalid.exp deleted file mode 100644 index bae2be7f2c2b9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_invalid.exp +++ /dev/null @@ -1,29 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/use_inner_scope_invalid.move:12:5 - │ -12 │ ╭ spec schema Foo { -13 │ │ ensures true; -14 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -error[E03011]: invalid use of reserved name - ┌─ tests/move_check/expansion/use_inner_scope_invalid.move:17:23 - │ -17 │ use 0x2::M as Self; - │ ^^^^ Invalid module alias name 'Self'. 'Self' is restricted and cannot be used to name a module alias - -error[E02010]: invalid name - ┌─ tests/move_check/expansion/use_inner_scope_invalid.move:18:28 - │ -18 │ use 0x2::M::{S1 as s1, Foo as foo}; - │ ^^ Invalid struct alias name 's1'. Struct alias names must start with 'A'..'Z' - -error[E03003]: unbound module member - ┌─ tests/move_check/expansion/use_inner_scope_invalid.move:18:32 - │ - 2 │ module M { - │ - Module '0x2::M' declared here - · -18 │ use 0x2::M::{S1 as s1, Foo as foo}; - │ ^^^ Invalid 'use'. Unbound member 'Foo' in module '0x2::M' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_invalid.snap new file mode 100644 index 0000000000000..6ef448dc5e846 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_invalid.snap @@ -0,0 +1,36 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_inner_scope_invalid.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/use_inner_scope_invalid.move:12:5 + │ +12 │ ╭ spec schema Foo { +13 │ │ ensures true; +14 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +error[E03011]: invalid use of reserved name + ┌─ tests/move_check/expansion/use_inner_scope_invalid.move:17:23 + │ +17 │ use 0x2::M as Self; + │ ^^^^ Invalid module alias name 'Self'. 'Self' is restricted and cannot be used to name a module alias + +error[E02010]: invalid name + ┌─ tests/move_check/expansion/use_inner_scope_invalid.move:18:28 + │ +18 │ use 0x2::M::{S1 as s1, Foo as foo}; + │ ^^ Invalid struct alias name 's1'. Struct alias names must start with 'A'..'Z' + +error[E03003]: unbound module member + ┌─ tests/move_check/expansion/use_inner_scope_invalid.move:18:32 + │ + 2 │ module M { + │ - Module '0x2::M' declared here + · +18 │ use 0x2::M::{S1 as s1, Foo as foo}; + │ ^^^ Invalid 'use'. Unbound member 'Foo' in module '0x2::M' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_shadows.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_shadows.exp deleted file mode 100644 index 0a4450467fde1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_shadows.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/use_inner_scope_shadows.move:12:5 - │ -12 │ ╭ spec schema Foo { -13 │ │ ensures true; -14 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_shadows.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_shadows.snap new file mode 100644 index 0000000000000..b2915f8487022 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_shadows.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_inner_scope_shadows.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/use_inner_scope_shadows.move:12:5 + │ +12 │ ╭ spec schema Foo { +13 │ │ ensures true; +14 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_unbound.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_unbound.exp deleted file mode 100644 index 386edab053b7c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_unbound.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/move_check/expansion/use_inner_scope_unbound.move:13:13 - │ -13 │ use 0x2::N; - │ ^^^^^^ Invalid 'use'. Unbound module: '0x2::N' - -error[E03003]: unbound module member - ┌─ tests/move_check/expansion/use_inner_scope_unbound.move:14:21 - │ - 2 │ module M { - │ - Module '0x2::M' declared here - · -14 │ use 0x2::M::foo; - │ ^^^ Invalid 'use'. Unbound member 'foo' in module '0x2::M' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_unbound.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_unbound.snap new file mode 100644 index 0000000000000..886c24f019a01 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_unbound.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_inner_scope_unbound.move +--- +error[E03002]: unbound module + ┌─ tests/move_check/expansion/use_inner_scope_unbound.move:13:13 + │ +13 │ use 0x2::N; + │ ^^^^^^ Invalid 'use'. Unbound module: '0x2::N' + +error[E03003]: unbound module member + ┌─ tests/move_check/expansion/use_inner_scope_unbound.move:14:21 + │ + 2 │ module M { + │ - Module '0x2::M' declared here + · +14 │ use 0x2::M::foo; + │ ^^^ Invalid 'use'. Unbound member 'foo' in module '0x2::M' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_unused.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_unused.exp deleted file mode 100644 index e9d2bd9bcd85e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_unused.exp +++ /dev/null @@ -1,24 +0,0 @@ -warning[W09001]: unused alias - ┌─ tests/move_check/expansion/use_inner_scope_unused.move:13:23 - │ -13 │ use 0x2::M as X; - │ ^ Unused 'use' of alias 'X'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_check/expansion/use_inner_scope_unused.move:14:31 - │ -14 │ use 0x2::M::{check as f, S1 as S8}; - │ ^ Unused 'use' of alias 'f'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_check/expansion/use_inner_scope_unused.move:14:40 - │ -14 │ use 0x2::M::{check as f, S1 as S8}; - │ ^^ Unused 'use' of alias 'S8'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_unused.snap new file mode 100644 index 0000000000000..9f4e286fbc4aa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_inner_scope_unused.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_inner_scope_unused.move +--- +warning[W09001]: unused alias + ┌─ tests/move_check/expansion/use_inner_scope_unused.move:13:23 + │ +13 │ use 0x2::M as X; + │ ^ Unused 'use' of alias 'X'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_check/expansion/use_inner_scope_unused.move:14:31 + │ +14 │ use 0x2::M::{check as f, S1 as S8}; + │ ^ Unused 'use' of alias 'f'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_check/expansion/use_inner_scope_unused.move:14:40 + │ +14 │ use 0x2::M::{check as f, S1 as S8}; + │ ^^ Unused 'use' of alias 'S8'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_nested_self.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_nested_self.snap new file mode 100644 index 0000000000000..aaf403e7119e2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_nested_self.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_nested_self.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_nested_self_as.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_nested_self_as.snap new file mode 100644 index 0000000000000..78750755a2eca --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_nested_self_as.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_nested_self_as.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_nested_self_as_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_nested_self_as_invalid.exp deleted file mode 100644 index a7f9015168df3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_nested_self_as_invalid.exp +++ /dev/null @@ -1,20 +0,0 @@ -warning[W09001]: unused alias - ┌─ tests/move_check/expansion/use_nested_self_as_invalid.move:8:26 - │ -8 │ use 0x2::X::{Self as B, foo, S}; - │ ^ Unused 'use' of alias 'B'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03002]: unbound module - ┌─ tests/move_check/expansion/use_nested_self_as_invalid.move:10:19 - │ -10 │ struct X { f: X::S, f2: S } - │ ^ Unbound module alias 'X' - -error[E03002]: unbound module - ┌─ tests/move_check/expansion/use_nested_self_as_invalid.move:12:9 - │ -12 │ X::foo(); - │ ^ Unbound module alias 'X' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_nested_self_as_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_nested_self_as_invalid.snap new file mode 100644 index 0000000000000..9a18f6fa9440f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_nested_self_as_invalid.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_nested_self_as_invalid.move +--- +warning[W09001]: unused alias + ┌─ tests/move_check/expansion/use_nested_self_as_invalid.move:8:26 + │ +8 │ use 0x2::X::{Self as B, foo, S}; + │ ^ Unused 'use' of alias 'B'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03002]: unbound module + ┌─ tests/move_check/expansion/use_nested_self_as_invalid.move:10:19 + │ +10 │ struct X { f: X::S, f2: S } + │ ^ Unbound module alias 'X' + +error[E03002]: unbound module + ┌─ tests/move_check/expansion/use_nested_self_as_invalid.move:12:9 + │ +12 │ X::foo(); + │ ^ Unbound module alias 'X' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_nested_self_duplicate.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_nested_self_duplicate.exp deleted file mode 100644 index 20d99fa3239fd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_nested_self_duplicate.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/use_nested_self_duplicate.move:9:17 - │ -8 │ use 0x2::X; - │ - Alias previously defined here -9 │ use 0x2::X::Self; - │ ^^^^ Duplicate module alias 'X'. Module aliases must be unique within a given namespace - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_nested_self_duplicate.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_nested_self_duplicate.snap new file mode 100644 index 0000000000000..fab8a14124499 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_nested_self_duplicate.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_nested_self_duplicate.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/use_nested_self_duplicate.move:9:17 + │ +8 │ use 0x2::X; + │ - Alias previously defined here +9 │ use 0x2::X::Self; + │ ^^^^ Duplicate module alias 'X'. Module aliases must be unique within a given namespace diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_function.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_function.exp deleted file mode 100644 index 33ab1a20b12c2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_function.exp +++ /dev/null @@ -1,36 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/use_spec_function.move:3:5 - │ -3 │ ╭ spec module { -4 │ │ fun foo(): bool { true } -5 │ │ fun bar(): bool { true } -6 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -error[E03003]: unbound module member - ┌─ tests/move_check/expansion/use_spec_function.move:10:18 - │ - 2 │ module X { - │ - Module '0x2::X' declared here - · -10 │ use 0x2::X::{foo, bar as baz}; - │ ^^^ Invalid 'use'. Unbound member 'foo' in module '0x2::X' - -error[E03003]: unbound module member - ┌─ tests/move_check/expansion/use_spec_function.move:10:23 - │ - 2 │ module X { - │ - Module '0x2::X' declared here - · -10 │ use 0x2::X::{foo, bar as baz}; - │ ^^^ Invalid 'use'. Unbound member 'bar' in module '0x2::X' - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/use_spec_function.move:14:5 - │ -14 │ ╭ spec t { -15 │ │ ensures foo(); -16 │ │ ensures baz(); -17 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_function.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_function.snap new file mode 100644 index 0000000000000..79ece23ed82b4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_function.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_spec_function.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/use_spec_function.move:3:5 + │ +3 │ ╭ spec module { +4 │ │ fun foo(): bool { true } +5 │ │ fun bar(): bool { true } +6 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +error[E03003]: unbound module member + ┌─ tests/move_check/expansion/use_spec_function.move:10:18 + │ + 2 │ module X { + │ - Module '0x2::X' declared here + · +10 │ use 0x2::X::{foo, bar as baz}; + │ ^^^ Invalid 'use'. Unbound member 'foo' in module '0x2::X' + +error[E03003]: unbound module member + ┌─ tests/move_check/expansion/use_spec_function.move:10:23 + │ + 2 │ module X { + │ - Module '0x2::X' declared here + · +10 │ use 0x2::X::{foo, bar as baz}; + │ ^^^ Invalid 'use'. Unbound member 'bar' in module '0x2::X' + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/use_spec_function.move:14:5 + │ +14 │ ╭ spec t { +15 │ │ ensures foo(); +16 │ │ ensures baz(); +17 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_function_as_normal_function.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_function_as_normal_function.exp deleted file mode 100644 index 6a0b35b043b33..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_function_as_normal_function.exp +++ /dev/null @@ -1,39 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/use_spec_function_as_normal_function.move:3:5 - │ -3 │ ╭ spec module { -4 │ │ define foo(): bool { true } -5 │ │ define bar(): bool { true } -6 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -error[E03003]: unbound module member - ┌─ tests/move_check/expansion/use_spec_function_as_normal_function.move:10:18 - │ - 2 │ module X { - │ - Module '0x2::X' declared here - · -10 │ use 0x2::X::{foo, bar as baz}; - │ ^^^ Invalid 'use'. Unbound member 'foo' in module '0x2::X' - -error[E03003]: unbound module member - ┌─ tests/move_check/expansion/use_spec_function_as_normal_function.move:10:23 - │ - 2 │ module X { - │ - Module '0x2::X' declared here - · -10 │ use 0x2::X::{foo, bar as baz}; - │ ^^^ Invalid 'use'. Unbound member 'bar' in module '0x2::X' - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/expansion/use_spec_function_as_normal_function.move:12:9 - │ -12 │ foo(); - │ ^^^ Unbound function 'foo' in current scope - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/expansion/use_spec_function_as_normal_function.move:13:9 - │ -13 │ baz(); - │ ^^^ Unbound function 'baz' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_function_as_normal_function.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_function_as_normal_function.snap new file mode 100644 index 0000000000000..dafedea5367d6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_function_as_normal_function.snap @@ -0,0 +1,46 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_spec_function_as_normal_function.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/use_spec_function_as_normal_function.move:3:5 + │ +3 │ ╭ spec module { +4 │ │ define foo(): bool { true } +5 │ │ define bar(): bool { true } +6 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +error[E03003]: unbound module member + ┌─ tests/move_check/expansion/use_spec_function_as_normal_function.move:10:18 + │ + 2 │ module X { + │ - Module '0x2::X' declared here + · +10 │ use 0x2::X::{foo, bar as baz}; + │ ^^^ Invalid 'use'. Unbound member 'foo' in module '0x2::X' + +error[E03003]: unbound module member + ┌─ tests/move_check/expansion/use_spec_function_as_normal_function.move:10:23 + │ + 2 │ module X { + │ - Module '0x2::X' declared here + · +10 │ use 0x2::X::{foo, bar as baz}; + │ ^^^ Invalid 'use'. Unbound member 'bar' in module '0x2::X' + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/expansion/use_spec_function_as_normal_function.move:12:9 + │ +12 │ foo(); + │ ^^^ Unbound function 'foo' in current scope + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/expansion/use_spec_function_as_normal_function.move:13:9 + │ +13 │ baz(); + │ ^^^ Unbound function 'baz' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_schema.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_schema.exp deleted file mode 100644 index 00d027a391021..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_schema.exp +++ /dev/null @@ -1,43 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/use_spec_schema.move:3:5 - │ -3 │ ╭ spec schema Foo { -4 │ │ ensures true; -5 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/use_spec_schema.move:7:5 - │ -7 │ ╭ spec schema Bar { -8 │ │ ensures true; -9 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -error[E03003]: unbound module member - ┌─ tests/move_check/expansion/use_spec_schema.move:13:18 - │ - 2 │ module X { - │ - Module '0x2::X' declared here - · -13 │ use 0x2::X::{Foo, Bar as Baz}; - │ ^^^ Invalid 'use'. Unbound member 'Foo' in module '0x2::X' - -error[E03003]: unbound module member - ┌─ tests/move_check/expansion/use_spec_schema.move:13:23 - │ - 2 │ module X { - │ - Module '0x2::X' declared here - · -13 │ use 0x2::X::{Foo, Bar as Baz}; - │ ^^^ Invalid 'use'. Unbound member 'Bar' in module '0x2::X' - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/use_spec_schema.move:18:5 - │ -18 │ ╭ spec t { -19 │ │ apply Foo to t; -20 │ │ apply Baz to t; -21 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_schema.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_schema.snap new file mode 100644 index 0000000000000..8c6510969be40 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_schema.snap @@ -0,0 +1,50 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_spec_schema.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/use_spec_schema.move:3:5 + │ +3 │ ╭ spec schema Foo { +4 │ │ ensures true; +5 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/use_spec_schema.move:7:5 + │ +7 │ ╭ spec schema Bar { +8 │ │ ensures true; +9 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +error[E03003]: unbound module member + ┌─ tests/move_check/expansion/use_spec_schema.move:13:18 + │ + 2 │ module X { + │ - Module '0x2::X' declared here + · +13 │ use 0x2::X::{Foo, Bar as Baz}; + │ ^^^ Invalid 'use'. Unbound member 'Foo' in module '0x2::X' + +error[E03003]: unbound module member + ┌─ tests/move_check/expansion/use_spec_schema.move:13:23 + │ + 2 │ module X { + │ - Module '0x2::X' declared here + · +13 │ use 0x2::X::{Foo, Bar as Baz}; + │ ^^^ Invalid 'use'. Unbound member 'Bar' in module '0x2::X' + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/use_spec_schema.move:18:5 + │ +18 │ ╭ spec t { +19 │ │ apply Foo to t; +20 │ │ apply Baz to t; +21 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_schema_as_struct.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_schema_as_struct.exp deleted file mode 100644 index 419f5b4719039..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_schema_as_struct.exp +++ /dev/null @@ -1,23 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/use_spec_schema_as_struct.move:3:5 - │ -3 │ ╭ spec schema Foo { -4 │ │ ensures true; -5 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -error[E03003]: unbound module member - ┌─ tests/move_check/expansion/use_spec_schema_as_struct.move:9:17 - │ -2 │ module X { - │ - Module '0x2::X' declared here - · -9 │ use 0x2::X::Foo; - │ ^^^ Invalid 'use'. Unbound member 'Foo' in module '0x2::X' - -error[E03004]: unbound type - ┌─ tests/move_check/expansion/use_spec_schema_as_struct.move:10:14 - │ -10 │ fun t(): Foo { - │ ^^^ Unbound type 'Foo' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_schema_as_struct.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_schema_as_struct.snap new file mode 100644 index 0000000000000..757b15b101d6b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_schema_as_struct.snap @@ -0,0 +1,30 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_spec_schema_as_struct.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/use_spec_schema_as_struct.move:3:5 + │ +3 │ ╭ spec schema Foo { +4 │ │ ensures true; +5 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +error[E03003]: unbound module member + ┌─ tests/move_check/expansion/use_spec_schema_as_struct.move:9:17 + │ +2 │ module X { + │ - Module '0x2::X' declared here + · +9 │ use 0x2::X::Foo; + │ ^^^ Invalid 'use'. Unbound member 'Foo' in module '0x2::X' + +error[E03004]: unbound type + ┌─ tests/move_check/expansion/use_spec_schema_as_struct.move:10:14 + │ +10 │ fun t(): Foo { + │ ^^^ Unbound type 'Foo' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_schema_invalid_as.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_schema_invalid_as.exp deleted file mode 100644 index 7ac4367863ebe..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_schema_invalid_as.exp +++ /dev/null @@ -1,25 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/use_spec_schema_invalid_as.move:3:5 - │ -3 │ ╭ spec schema Foo { -4 │ │ ensures true; -5 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -error[E03003]: unbound module member - ┌─ tests/move_check/expansion/use_spec_schema_invalid_as.move:9:18 - │ -2 │ module X { - │ - Module '0x2::X' declared here - · -9 │ use 0x2::X::{Foo as foo}; - │ ^^^ Invalid 'use'. Unbound member 'Foo' in module '0x2::X' - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/expansion/use_spec_schema_invalid_as.move:12:5 - │ -12 │ ╭ spec t { -13 │ │ apply foo to t; -14 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_schema_invalid_as.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_schema_invalid_as.snap new file mode 100644 index 0000000000000..abeb20f43a8ab --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_spec_schema_invalid_as.snap @@ -0,0 +1,32 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_spec_schema_invalid_as.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/use_spec_schema_invalid_as.move:3:5 + │ +3 │ ╭ spec schema Foo { +4 │ │ ensures true; +5 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +error[E03003]: unbound module member + ┌─ tests/move_check/expansion/use_spec_schema_invalid_as.move:9:18 + │ +2 │ module X { + │ - Module '0x2::X' declared here + · +9 │ use 0x2::X::{Foo as foo}; + │ ^^^ Invalid 'use'. Unbound member 'Foo' in module '0x2::X' + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/expansion/use_spec_schema_invalid_as.move:12:5 + │ +12 │ ╭ spec t { +13 │ │ apply foo to t; +14 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct.snap new file mode 100644 index 0000000000000..7319c57032fab --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_struct.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_invalid_name.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_invalid_name.exp deleted file mode 100644 index 035c871c7b1a5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_invalid_name.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E03003]: unbound module member - ┌─ tests/move_check/expansion/use_struct_invalid_name.move:7:17 - │ -2 │ module X { - │ - Module '0x2::X' declared here - · -7 │ use 0x2::X::u; - │ ^ Invalid 'use'. Unbound member 'u' in module '0x2::X' - -error[E03004]: unbound type - ┌─ tests/move_check/expansion/use_struct_invalid_name.move:8:19 - │ -8 │ struct X { f: u } - │ ^ Unbound type 'u' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_invalid_name.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_invalid_name.snap new file mode 100644 index 0000000000000..263ba619a4b4a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_invalid_name.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_struct_invalid_name.move +--- +error[E03003]: unbound module member + ┌─ tests/move_check/expansion/use_struct_invalid_name.move:7:17 + │ +2 │ module X { + │ - Module '0x2::X' declared here + · +7 │ use 0x2::X::u; + │ ^ Invalid 'use'. Unbound member 'u' in module '0x2::X' + +error[E03004]: unbound type + ┌─ tests/move_check/expansion/use_struct_invalid_name.move:8:19 + │ +8 │ struct X { f: u } + │ ^ Unbound type 'u' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_overlap_with_module.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_overlap_with_module.snap new file mode 100644 index 0000000000000..eb9dce8df150d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_overlap_with_module.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_struct_overlap_with_module.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_same_name_as_function.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_same_name_as_function.exp deleted file mode 100644 index 5c30551fa02a4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_same_name_as_function.exp +++ /dev/null @@ -1,52 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/use_struct_same_name_as_function.move:10:9 - │ - 8 │ use 0x2::X::{U, U as U2}; - │ - Alias previously defined here - 9 │ -10 │ fun U() {} - │ ^ Duplicate module member or alias 'U'. Top level names in a namespace must be unique - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/use_struct_same_name_as_function.move:11:9 - │ - 8 │ use 0x2::X::{U, U as U2}; - │ -- Alias previously defined here - · -11 │ fun U2() {} - │ ^^ Duplicate module member or alias 'U2'. Top level names in a namespace must be unique - -warning[W09001]: unused alias - ┌─ tests/move_check/expansion/use_struct_same_name_as_function.move:15:18 - │ -15 │ use 0x2::X::{R, R as R2}; - │ ^ Unused 'use' of alias 'R'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/use_struct_same_name_as_function.move:15:18 - │ -12 │ fun R() {} - │ - Alias previously defined here - · -15 │ use 0x2::X::{R, R as R2}; - │ ^ Duplicate module member or alias 'R'. Top level names in a namespace must be unique - -warning[W09001]: unused alias - ┌─ tests/move_check/expansion/use_struct_same_name_as_function.move:15:26 - │ -15 │ use 0x2::X::{R, R as R2}; - │ ^^ Unused 'use' of alias 'R2'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/use_struct_same_name_as_function.move:15:26 - │ -13 │ fun R2() {} - │ -- Alias previously defined here -14 │ -15 │ use 0x2::X::{R, R as R2}; - │ ^^ Duplicate module member or alias 'R2'. Top level names in a namespace must be unique - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_same_name_as_function.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_same_name_as_function.snap new file mode 100644 index 0000000000000..069214111a3a1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_same_name_as_function.snap @@ -0,0 +1,59 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_struct_same_name_as_function.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/use_struct_same_name_as_function.move:10:9 + │ + 8 │ use 0x2::X::{U, U as U2}; + │ - Alias previously defined here + 9 │ +10 │ fun U() {} + │ ^ Duplicate module member or alias 'U'. Top level names in a namespace must be unique + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/use_struct_same_name_as_function.move:11:9 + │ + 8 │ use 0x2::X::{U, U as U2}; + │ -- Alias previously defined here + · +11 │ fun U2() {} + │ ^^ Duplicate module member or alias 'U2'. Top level names in a namespace must be unique + +warning[W09001]: unused alias + ┌─ tests/move_check/expansion/use_struct_same_name_as_function.move:15:18 + │ +15 │ use 0x2::X::{R, R as R2}; + │ ^ Unused 'use' of alias 'R'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/use_struct_same_name_as_function.move:15:18 + │ +12 │ fun R() {} + │ - Alias previously defined here + · +15 │ use 0x2::X::{R, R as R2}; + │ ^ Duplicate module member or alias 'R'. Top level names in a namespace must be unique + +warning[W09001]: unused alias + ┌─ tests/move_check/expansion/use_struct_same_name_as_function.move:15:26 + │ +15 │ use 0x2::X::{R, R as R2}; + │ ^^ Unused 'use' of alias 'R2'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/use_struct_same_name_as_function.move:15:26 + │ +13 │ fun R2() {} + │ -- Alias previously defined here +14 │ +15 │ use 0x2::X::{R, R as R2}; + │ ^^ Duplicate module member or alias 'R2'. Top level names in a namespace must be unique diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_same_name_as_struct.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_same_name_as_struct.exp deleted file mode 100644 index 2480aa139ebf7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_same_name_as_struct.exp +++ /dev/null @@ -1,52 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/use_struct_same_name_as_struct.move:10:12 - │ - 8 │ use 0x2::X::{U, U as U2}; - │ - Alias previously defined here - 9 │ -10 │ struct U {} - │ ^ Duplicate module member or alias 'U'. Top level names in a namespace must be unique - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/use_struct_same_name_as_struct.move:11:12 - │ - 8 │ use 0x2::X::{U, U as U2}; - │ -- Alias previously defined here - · -11 │ struct U2 {} - │ ^^ Duplicate module member or alias 'U2'. Top level names in a namespace must be unique - -warning[W09001]: unused alias - ┌─ tests/move_check/expansion/use_struct_same_name_as_struct.move:15:18 - │ -15 │ use 0x2::X::{R, R as R2}; - │ ^ Unused 'use' of alias 'R'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/use_struct_same_name_as_struct.move:15:18 - │ -13 │ struct R {} - │ - Alias previously defined here -14 │ -15 │ use 0x2::X::{R, R as R2}; - │ ^ Duplicate module member or alias 'R'. Top level names in a namespace must be unique - -warning[W09001]: unused alias - ┌─ tests/move_check/expansion/use_struct_same_name_as_struct.move:15:26 - │ -15 │ use 0x2::X::{R, R as R2}; - │ ^^ Unused 'use' of alias 'R2'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/expansion/use_struct_same_name_as_struct.move:15:26 - │ -12 │ struct R2 {} - │ -- Alias previously defined here - · -15 │ use 0x2::X::{R, R as R2}; - │ ^^ Duplicate module member or alias 'R2'. Top level names in a namespace must be unique - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_same_name_as_struct.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_same_name_as_struct.snap new file mode 100644 index 0000000000000..d8d91d940b727 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_same_name_as_struct.snap @@ -0,0 +1,59 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_struct_same_name_as_struct.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/use_struct_same_name_as_struct.move:10:12 + │ + 8 │ use 0x2::X::{U, U as U2}; + │ - Alias previously defined here + 9 │ +10 │ struct U {} + │ ^ Duplicate module member or alias 'U'. Top level names in a namespace must be unique + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/use_struct_same_name_as_struct.move:11:12 + │ + 8 │ use 0x2::X::{U, U as U2}; + │ -- Alias previously defined here + · +11 │ struct U2 {} + │ ^^ Duplicate module member or alias 'U2'. Top level names in a namespace must be unique + +warning[W09001]: unused alias + ┌─ tests/move_check/expansion/use_struct_same_name_as_struct.move:15:18 + │ +15 │ use 0x2::X::{R, R as R2}; + │ ^ Unused 'use' of alias 'R'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/use_struct_same_name_as_struct.move:15:18 + │ +13 │ struct R {} + │ - Alias previously defined here +14 │ +15 │ use 0x2::X::{R, R as R2}; + │ ^ Duplicate module member or alias 'R'. Top level names in a namespace must be unique + +warning[W09001]: unused alias + ┌─ tests/move_check/expansion/use_struct_same_name_as_struct.move:15:26 + │ +15 │ use 0x2::X::{R, R as R2}; + │ ^^ Unused 'use' of alias 'R2'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/expansion/use_struct_same_name_as_struct.move:15:26 + │ +12 │ struct R2 {} + │ -- Alias previously defined here + · +15 │ use 0x2::X::{R, R as R2}; + │ ^^ Duplicate module member or alias 'R2'. Top level names in a namespace must be unique diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_tparam_shadows.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_tparam_shadows.exp deleted file mode 100644 index 8baaf8e0374e6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_tparam_shadows.exp +++ /dev/null @@ -1,10 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/expansion/use_struct_tparam_shadows.move:12:9 - │ -11 │ fun foo(x: S): 0x2::X::S { - │ - --------- Expected: '0x2::X::S' - │ │ - │ Given: 'S' -12 │ x - │ ^ Invalid return expression - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_tparam_shadows.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_tparam_shadows.snap new file mode 100644 index 0000000000000..f99d534320074 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_tparam_shadows.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_struct_tparam_shadows.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/expansion/use_struct_tparam_shadows.move:12:9 + │ +11 │ fun foo(x: S): 0x2::X::S { + │ - --------- Expected: '0x2::X::S' + │ │ + │ Given: 'S' +12 │ x + │ ^ Invalid return expression diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_unbound.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_unbound.exp deleted file mode 100644 index 20587d8bace8f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_unbound.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E03003]: unbound module member - ┌─ tests/move_check/expansion/use_struct_unbound.move:6:17 - │ -2 │ module X { - │ - Module '0x2::X' declared here - · -6 │ use 0x2::X::S; - │ ^ Invalid 'use'. Unbound member 'S' in module '0x2::X' - -error[E03004]: unbound type - ┌─ tests/move_check/expansion/use_struct_unbound.move:8:19 - │ -8 │ struct X { f: S } - │ ^ Unbound type 'S' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_unbound.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_unbound.snap new file mode 100644 index 0000000000000..8a2c39af11149 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/use_struct_unbound.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/use_struct_unbound.move +--- +error[E03003]: unbound module member + ┌─ tests/move_check/expansion/use_struct_unbound.move:6:17 + │ +2 │ module X { + │ - Module '0x2::X' declared here + · +6 │ use 0x2::X::S; + │ ^ Invalid 'use'. Unbound member 'S' in module '0x2::X' + +error[E03004]: unbound type + ┌─ tests/move_check/expansion/use_struct_unbound.move:8:19 + │ +8 │ struct X { f: S } + │ ^ Unbound type 'S' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/weird_apply_assign.exp b/external-crates/move/crates/move-compiler/tests/move_check/expansion/weird_apply_assign.exp deleted file mode 100644 index b89f482db84bc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/expansion/weird_apply_assign.exp +++ /dev/null @@ -1,23 +0,0 @@ -error[E01009]: invalid assignment - ┌─ tests/move_check/expansion/weird_apply_assign.move:5:9 - │ -5 │ { f } = S { f: 0 }; - │ ^^^^^ Invalid assignment syntax. Expected: a local, a field write, or a deconstructing assignment - -error[E03022]: invalid usage position - ┌─ tests/move_check/expansion/weird_apply_assign.move:7:9 - │ -7 │ S f = S { f: 0 }; - │ ^ Expected a local or constant, but found struct 'S' in current scope - │ - = Struct with named arguments must be written as 'S { ... }' - -error[E01002]: unexpected token - ┌─ tests/move_check/expansion/weird_apply_assign.move:7:11 - │ -7 │ S f = S { f: 0 }; - │ ^ - │ │ - │ Unexpected 'f' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/expansion/weird_apply_assign.snap b/external-crates/move/crates/move-compiler/tests/move_check/expansion/weird_apply_assign.snap new file mode 100644 index 0000000000000..3f53e497bfe91 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/expansion/weird_apply_assign.snap @@ -0,0 +1,30 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/expansion/weird_apply_assign.move +--- +error[E01009]: invalid assignment + ┌─ tests/move_check/expansion/weird_apply_assign.move:5:9 + │ +5 │ { f } = S { f: 0 }; + │ ^^^^^ Invalid assignment syntax. Expected: a local, a field write, or a deconstructing assignment + +error[E03022]: invalid usage position + ┌─ tests/move_check/expansion/weird_apply_assign.move:7:9 + │ +7 │ S f = S { f: 0 }; + │ ^ Expected a local or constant, but found struct 'S' in current scope + │ + = Struct with named arguments must be written as 'S { ... }' + +error[E01002]: unexpected token + ┌─ tests/move_check/expansion/weird_apply_assign.move:7:11 + │ +7 │ S f = S { f: 0 }; + │ ^ + │ │ + │ Unexpected 'f' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/dot_call.exp b/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/dot_call.exp deleted file mode 100644 index ed14de5c2ffc3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/dot_call.exp +++ /dev/null @@ -1,56 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/feature_gate/dot_call.move:4:5 - │ -4 │ public use fun imm as S.f; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/feature_gate/dot_call.move:13:9 - │ -13 │ use fun mut as S.g; - │ ^^^^^^^^^^^^^^^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/feature_gate/dot_call.move:14:9 - │ -14 │ s.imm(); - │ ^^^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/feature_gate/dot_call.move:15:9 - │ -15 │ s.f(); - │ ^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/feature_gate/dot_call.move:16:9 - │ -16 │ s.mut(); - │ ^^^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/feature_gate/dot_call.move:17:9 - │ -17 │ s.g(); - │ ^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/feature_gate/dot_call.move:18:9 - │ -18 │ s.val(); - │ ^^^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/dot_call.snap b/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/dot_call.snap new file mode 100644 index 0000000000000..7bee924f51448 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/dot_call.snap @@ -0,0 +1,63 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/feature_gate/dot_call.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/feature_gate/dot_call.move:4:5 + │ +4 │ public use fun imm as S.f; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/feature_gate/dot_call.move:13:9 + │ +13 │ use fun mut as S.g; + │ ^^^^^^^^^^^^^^^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/feature_gate/dot_call.move:14:9 + │ +14 │ s.imm(); + │ ^^^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/feature_gate/dot_call.move:15:9 + │ +15 │ s.f(); + │ ^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/feature_gate/dot_call.move:16:9 + │ +16 │ s.mut(); + │ ^^^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/feature_gate/dot_call.move:17:9 + │ +17 │ s.g(); + │ ^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/feature_gate/dot_call.move:18:9 + │ +18 │ s.val(); + │ ^^^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_call.exp b/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_call.exp deleted file mode 100644 index cca06c20af81c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_call.exp +++ /dev/null @@ -1,29 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/feature_gate/macro_call.move:4:9 - │ -2 │ public fun foo(_: u64) {} - │ --- Expected: 'u64' -3 │ fun bar() { -4 │ foo!(|| ()) - │ ^^^^^^^^^^^ - │ │ │ - │ │ Given: '|| -> _' - │ Invalid call of 'a::m::foo'. Invalid argument for parameter '_' - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/feature_gate/macro_call.move:4:12 - │ -4 │ foo!(|| ()) - │ ^ 'macro' functions are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E04029]: invalid function call - ┌─ tests/move_check/feature_gate/macro_call.move:4:12 - │ -2 │ public fun foo(_: u64) {} - │ --- Normal (non-'macro') function is declared here -3 │ fun bar() { -4 │ foo!(|| ()) - │ ^ 'foo' is not a macro function and cannot be called with a `!`. Try replacing with 'foo' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_call.snap b/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_call.snap new file mode 100644 index 0000000000000..b8dee4c01fcf9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_call.snap @@ -0,0 +1,36 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/feature_gate/macro_call.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/feature_gate/macro_call.move:4:9 + │ +2 │ public fun foo(_: u64) {} + │ --- Expected: 'u64' +3 │ fun bar() { +4 │ foo!(|| ()) + │ ^^^^^^^^^^^ + │ │ │ + │ │ Given: '|| -> _' + │ Invalid call of 'a::m::foo'. Invalid argument for parameter '_' + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/feature_gate/macro_call.move:4:12 + │ +4 │ foo!(|| ()) + │ ^ 'macro' functions are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E04029]: invalid function call + ┌─ tests/move_check/feature_gate/macro_call.move:4:12 + │ +2 │ public fun foo(_: u64) {} + │ --- Normal (non-'macro') function is declared here +3 │ fun bar() { +4 │ foo!(|| ()) + │ ^ 'foo' is not a macro function and cannot be called with a `!`. Try replacing with 'foo' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_definition.exp b/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_definition.exp deleted file mode 100644 index 17219b065cb39..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_definition.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/feature_gate/macro_definition.move:2:12 - │ -2 │ public macro fun do($f: || ()) { $f() } - │ ^^^^^ 'macro' functions are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/feature_gate/macro_definition.move:2:38 - │ -2 │ public macro fun do($f: || ()) { $f() } - │ ^^^^ lambda expressions are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_definition.snap b/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_definition.snap new file mode 100644 index 0000000000000..bc3181fb3aafd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_definition.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/feature_gate/macro_definition.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/feature_gate/macro_definition.move:2:12 + │ +2 │ public macro fun do($f: || ()) { $f() } + │ ^^^^^ 'macro' functions are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/feature_gate/macro_definition.move:2:38 + │ +2 │ public macro fun do($f: || ()) { $f() } + │ ^^^^ lambda expressions are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_definition_with_usage.exp b/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_definition_with_usage.exp deleted file mode 100644 index 7c953664841e1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_definition_with_usage.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/feature_gate/macro_definition_with_usage.move:2:12 - │ -2 │ public macro fun do($f: || ()) { $f() } - │ ^^^^^ 'macro' functions are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/feature_gate/macro_definition_with_usage.move:2:38 - │ -2 │ public macro fun do($f: || ()) { $f() } - │ ^^^^ lambda expressions are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/feature_gate/macro_definition_with_usage.move:4:24 - │ -4 │ public fun t() { do!(|| q() ) } - │ ^ 'macro' functions are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_definition_with_usage.snap b/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_definition_with_usage.snap new file mode 100644 index 0000000000000..e608e9cf4f65c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_definition_with_usage.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/feature_gate/macro_definition_with_usage.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/feature_gate/macro_definition_with_usage.move:2:12 + │ +2 │ public macro fun do($f: || ()) { $f() } + │ ^^^^^ 'macro' functions are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/feature_gate/macro_definition_with_usage.move:2:38 + │ +2 │ public macro fun do($f: || ()) { $f() } + │ ^^^^ lambda expressions are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/feature_gate/macro_definition_with_usage.move:4:24 + │ +4 │ public fun t() { do!(|| q() ) } + │ ^ 'macro' functions are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_lambda.exp b/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_lambda.exp deleted file mode 100644 index d37d770411e46..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_lambda.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/feature_gate/macro_lambda.move:2:17 - │ -2 │ fun tfun(_: |u64| u64) {} - │ ^^^^^^^^^ 'macro' functions are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/feature_gate/macro_lambda.move:4:17 - │ -4 │ let _ = |x| x; - │ ^^^^^ lambda expressions are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_lambda.snap b/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_lambda.snap new file mode 100644 index 0000000000000..d36ff785749bf --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/macro_lambda.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/feature_gate/macro_lambda.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/feature_gate/macro_lambda.move:2:17 + │ +2 │ fun tfun(_: |u64| u64) {} + │ ^^^^^^^^^ 'macro' functions are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/feature_gate/macro_lambda.move:4:17 + │ +4 │ let _ = |x| x; + │ ^^^^^ lambda expressions are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/public_package.exp b/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/public_package.exp deleted file mode 100644 index f09729eb5edb6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/public_package.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/feature_gate/public_package.move:2:5 - │ -2 │ public(package) fun foo(): u64 { 0 } - │ ^^^^^^^^^^^^^^^ 'public(package)' is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/public_package.snap b/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/public_package.snap new file mode 100644 index 0000000000000..ec232b04a70a5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/feature_gate/public_package.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/feature_gate/public_package.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/feature_gate/public_package.move:2:5 + │ +2 │ public(package) fun foo(): u64 { 0 } + │ ^^^^^^^^^^^^^^^ 'public(package)' is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/folding/non_constant_empty_vec.snap b/external-crates/move/crates/move-compiler/tests/move_check/folding/non_constant_empty_vec.snap new file mode 100644 index 0000000000000..fb06a056f8822 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/folding/non_constant_empty_vec.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/folding/non_constant_empty_vec.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/folding/unfoldable_constants.exp b/external-crates/move/crates/move-compiler/tests/move_check/folding/unfoldable_constants.exp deleted file mode 100644 index 44d595228447c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/folding/unfoldable_constants.exp +++ /dev/null @@ -1,234 +0,0 @@ -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:3:22 - │ -3 │ const SHL0: u8 = 1 << 8; - │ ^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:4:23 - │ -4 │ const SHL1: u64 = 1 << 64; - │ ^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:5:24 - │ -5 │ const SHL2: u128 = 1 << 128; - │ ^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:6:23 - │ -6 │ const SHL3: u16 = 1 << 16; - │ ^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:7:23 - │ -7 │ const SHL4: u32 = 1 << 32; - │ ^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:9:22 - │ -9 │ const SHR0: u8 = 0 >> 8; - │ ^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:10:23 - │ -10 │ const SHR1: u64 = 0 >> 64; - │ ^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:11:24 - │ -11 │ const SHR2: u128 = 0 >> 128; - │ ^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:12:23 - │ -12 │ const SHR3: u16 = 0 >> 16; - │ ^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:13:23 - │ -13 │ const SHR4: u32 = 0 >> 32; - │ ^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:15:22 - │ -15 │ const DIV0: u8 = 1 / 0; - │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:16:23 - │ -16 │ const DIV1: u64 = 1 / 0; - │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:17:24 - │ -17 │ const DIV2: u128 = 1 / 0; - │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:18:23 - │ -18 │ const DIV3: u16 = 1 / 0; - │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:19:23 - │ -19 │ const DIV4: u32 = 1 / 0; - │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:20:24 - │ -20 │ const DIV5: u256 = 1 / 0; - │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:22:22 - │ -22 │ const MOD0: u8 = 1 % 0; - │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:23:23 - │ -23 │ const MOD1: u64 = 1 % 0; - │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:24:24 - │ -24 │ const MOD2: u128 = 1 % 0; - │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:25:23 - │ -25 │ const MOD3: u16 = 1 % 0; - │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:26:23 - │ -26 │ const MOD4: u32 = 1 % 0; - │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:27:24 - │ -27 │ const MOD5: u256 = 1 % 0; - │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:29:22 - │ -29 │ const ADD0: u8 = 255 + 255; - │ ^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:30:23 - │ -30 │ const ADD1: u64 = 18446744073709551615 + 18446744073709551615; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:32:9 - │ -32 │ 340282366920938463463374607431768211450 + 340282366920938463463374607431768211450; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:33:23 - │ -33 │ const ADD3: u16 = 65535 + 65535; - │ ^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:34:23 - │ -34 │ const ADD4: u32 = 4294967295 + 4294967295; - │ ^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:36:9 - │ -36 │ 115792089237316195423570985008687907853269984665640564039457584007913129639935 + 115792089237316195423570985008687907853269984665640564039457584007913129639935; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:38:22 - │ -38 │ const SUB0: u8 = 0 - 1; - │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:39:23 - │ -39 │ const SUB1: u64 = 0 - 1; - │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:40:24 - │ -40 │ const SUB2: u128 = 0 - 1; - │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:41:23 - │ -41 │ const SUB3: u16 = 0 - 1; - │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:42:23 - │ -42 │ const SUB4: u32 = 0 - 1; - │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:43:24 - │ -43 │ const SUB5: u256 = 0 - 1; - │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:45:24 - │ -45 │ const CAST0: u8 = ((256: u64) as u8); - │ ^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:46:25 - │ -46 │ const CAST1: u64 = ((340282366920938463463374607431768211450: u128) as u64); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:47:26 - │ -47 │ const CAST4: u128 = ((340282366920938463463374607431768211456: u256) as u128); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:48:25 - │ -48 │ const CAST2: u16 = ((65536: u64) as u16); - │ ^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants.move:49:25 - │ -49 │ const CAST3: u32 = ((4294967296: u128) as u32); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/folding/unfoldable_constants.snap b/external-crates/move/crates/move-compiler/tests/move_check/folding/unfoldable_constants.snap new file mode 100644 index 0000000000000..a92002242881a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/folding/unfoldable_constants.snap @@ -0,0 +1,241 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/folding/unfoldable_constants.move +--- +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:3:22 + │ +3 │ const SHL0: u8 = 1 << 8; + │ ^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:4:23 + │ +4 │ const SHL1: u64 = 1 << 64; + │ ^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:5:24 + │ +5 │ const SHL2: u128 = 1 << 128; + │ ^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:6:23 + │ +6 │ const SHL3: u16 = 1 << 16; + │ ^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:7:23 + │ +7 │ const SHL4: u32 = 1 << 32; + │ ^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:9:22 + │ +9 │ const SHR0: u8 = 0 >> 8; + │ ^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:10:23 + │ +10 │ const SHR1: u64 = 0 >> 64; + │ ^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:11:24 + │ +11 │ const SHR2: u128 = 0 >> 128; + │ ^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:12:23 + │ +12 │ const SHR3: u16 = 0 >> 16; + │ ^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:13:23 + │ +13 │ const SHR4: u32 = 0 >> 32; + │ ^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:15:22 + │ +15 │ const DIV0: u8 = 1 / 0; + │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:16:23 + │ +16 │ const DIV1: u64 = 1 / 0; + │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:17:24 + │ +17 │ const DIV2: u128 = 1 / 0; + │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:18:23 + │ +18 │ const DIV3: u16 = 1 / 0; + │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:19:23 + │ +19 │ const DIV4: u32 = 1 / 0; + │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:20:24 + │ +20 │ const DIV5: u256 = 1 / 0; + │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:22:22 + │ +22 │ const MOD0: u8 = 1 % 0; + │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:23:23 + │ +23 │ const MOD1: u64 = 1 % 0; + │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:24:24 + │ +24 │ const MOD2: u128 = 1 % 0; + │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:25:23 + │ +25 │ const MOD3: u16 = 1 % 0; + │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:26:23 + │ +26 │ const MOD4: u32 = 1 % 0; + │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:27:24 + │ +27 │ const MOD5: u256 = 1 % 0; + │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:29:22 + │ +29 │ const ADD0: u8 = 255 + 255; + │ ^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:30:23 + │ +30 │ const ADD1: u64 = 18446744073709551615 + 18446744073709551615; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:32:9 + │ +32 │ 340282366920938463463374607431768211450 + 340282366920938463463374607431768211450; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:33:23 + │ +33 │ const ADD3: u16 = 65535 + 65535; + │ ^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:34:23 + │ +34 │ const ADD4: u32 = 4294967295 + 4294967295; + │ ^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:36:9 + │ +36 │ 115792089237316195423570985008687907853269984665640564039457584007913129639935 + 115792089237316195423570985008687907853269984665640564039457584007913129639935; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:38:22 + │ +38 │ const SUB0: u8 = 0 - 1; + │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:39:23 + │ +39 │ const SUB1: u64 = 0 - 1; + │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:40:24 + │ +40 │ const SUB2: u128 = 0 - 1; + │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:41:23 + │ +41 │ const SUB3: u16 = 0 - 1; + │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:42:23 + │ +42 │ const SUB4: u32 = 0 - 1; + │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:43:24 + │ +43 │ const SUB5: u256 = 0 - 1; + │ ^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:45:24 + │ +45 │ const CAST0: u8 = ((256: u64) as u8); + │ ^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:46:25 + │ +46 │ const CAST1: u64 = ((340282366920938463463374607431768211450: u128) as u64); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:47:26 + │ +47 │ const CAST4: u128 = ((340282366920938463463374607431768211456: u256) as u128); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:48:25 + │ +48 │ const CAST2: u16 = ((65536: u64) as u16); + │ ^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants.move:49:25 + │ +49 │ const CAST3: u32 = ((4294967296: u128) as u32); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value diff --git a/external-crates/move/crates/move-compiler/tests/move_check/folding/unfoldable_constants_blocks.exp b/external-crates/move/crates/move-compiler/tests/move_check/folding/unfoldable_constants_blocks.exp deleted file mode 100644 index 888f8a0a0355e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/folding/unfoldable_constants_blocks.exp +++ /dev/null @@ -1,234 +0,0 @@ -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:4:9 - │ -4 │ (1: u8) << 8; - │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:5:9 - │ -5 │ (1: u64) << 64; - │ ^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:6:9 - │ -6 │ (1: u128) << 128; - │ ^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:7:9 - │ -7 │ (1: u16) << 16; - │ ^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:8:9 - │ -8 │ (1: u32) << 32; - │ ^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:10:9 - │ -10 │ (0: u8) >> 8; - │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:11:9 - │ -11 │ (0: u64) >> 64; - │ ^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:12:9 - │ -12 │ (0: u128) >> 128; - │ ^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:13:9 - │ -13 │ (0: u16) >> 16; - │ ^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:14:9 - │ -14 │ (0: u32) >> 32; - │ ^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:16:9 - │ -16 │ (1: u8) / 0; - │ ^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:17:9 - │ -17 │ (1: u64) / 0; - │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:18:9 - │ -18 │ (1: u128) / 0; - │ ^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:19:9 - │ -19 │ (1: u16) / 0; - │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:20:9 - │ -20 │ (1: u32) / 0; - │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:21:9 - │ -21 │ (1: u256) / 0; - │ ^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:23:9 - │ -23 │ (1: u8) % 0; - │ ^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:24:9 - │ -24 │ (1: u64) % 0; - │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:25:9 - │ -25 │ (1: u128) % 0; - │ ^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:26:9 - │ -26 │ (1: u16) % 0; - │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:27:9 - │ -27 │ (1: u32) % 0; - │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:28:9 - │ -28 │ (1: u256) % 0; - │ ^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:30:9 - │ -30 │ (255: u8) + 255; - │ ^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:31:9 - │ -31 │ (18446744073709551615: u64) + 18446744073709551615; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:32:9 - │ -32 │ (340282366920938463463374607431768211450: u128) + 340282366920938463463374607431768211450; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:33:9 - │ -33 │ (65535: u16) + 65535; - │ ^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:34:9 - │ -34 │ (4294967295: u32) + 4294967295; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:35:9 - │ -35 │ (115792089237316195423570985008687907853269984665640564039457584007913129639935: u256) + 115792089237316195423570985008687907853269984665640564039457584007913129639935; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:37:9 - │ -37 │ (0: u8) - 1; - │ ^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:38:9 - │ -38 │ (0: u64) - 1; - │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:39:9 - │ -39 │ (0: u128) - 1; - │ ^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:40:9 - │ -40 │ (0: u16) - 1; - │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:41:9 - │ -41 │ (0: u32) - 1; - │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:42:9 - │ -42 │ (0: u256) - 1; - │ ^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:44:10 - │ -44 │ ((256: u64) as u8); - │ ^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:45:10 - │ -45 │ ((340282366920938463463374607431768211450: u128) as u64); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:46:10 - │ -46 │ ((340282366920938463463374607431768211456: u256) as u128); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:47:10 - │ -47 │ ((65536: u64) as u16); - │ ^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:48:10 - │ -48 │ ((4294967296: u128) as u32); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/folding/unfoldable_constants_blocks.snap b/external-crates/move/crates/move-compiler/tests/move_check/folding/unfoldable_constants_blocks.snap new file mode 100644 index 0000000000000..37d3fa6a94480 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/folding/unfoldable_constants_blocks.snap @@ -0,0 +1,241 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/folding/unfoldable_constants_blocks.move +--- +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:4:9 + │ +4 │ (1: u8) << 8; + │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:5:9 + │ +5 │ (1: u64) << 64; + │ ^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:6:9 + │ +6 │ (1: u128) << 128; + │ ^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:7:9 + │ +7 │ (1: u16) << 16; + │ ^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:8:9 + │ +8 │ (1: u32) << 32; + │ ^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:10:9 + │ +10 │ (0: u8) >> 8; + │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:11:9 + │ +11 │ (0: u64) >> 64; + │ ^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:12:9 + │ +12 │ (0: u128) >> 128; + │ ^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:13:9 + │ +13 │ (0: u16) >> 16; + │ ^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:14:9 + │ +14 │ (0: u32) >> 32; + │ ^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:16:9 + │ +16 │ (1: u8) / 0; + │ ^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:17:9 + │ +17 │ (1: u64) / 0; + │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:18:9 + │ +18 │ (1: u128) / 0; + │ ^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:19:9 + │ +19 │ (1: u16) / 0; + │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:20:9 + │ +20 │ (1: u32) / 0; + │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:21:9 + │ +21 │ (1: u256) / 0; + │ ^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:23:9 + │ +23 │ (1: u8) % 0; + │ ^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:24:9 + │ +24 │ (1: u64) % 0; + │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:25:9 + │ +25 │ (1: u128) % 0; + │ ^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:26:9 + │ +26 │ (1: u16) % 0; + │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:27:9 + │ +27 │ (1: u32) % 0; + │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:28:9 + │ +28 │ (1: u256) % 0; + │ ^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:30:9 + │ +30 │ (255: u8) + 255; + │ ^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:31:9 + │ +31 │ (18446744073709551615: u64) + 18446744073709551615; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:32:9 + │ +32 │ (340282366920938463463374607431768211450: u128) + 340282366920938463463374607431768211450; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:33:9 + │ +33 │ (65535: u16) + 65535; + │ ^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:34:9 + │ +34 │ (4294967295: u32) + 4294967295; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:35:9 + │ +35 │ (115792089237316195423570985008687907853269984665640564039457584007913129639935: u256) + 115792089237316195423570985008687907853269984665640564039457584007913129639935; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:37:9 + │ +37 │ (0: u8) - 1; + │ ^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:38:9 + │ +38 │ (0: u64) - 1; + │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:39:9 + │ +39 │ (0: u128) - 1; + │ ^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:40:9 + │ +40 │ (0: u16) - 1; + │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:41:9 + │ +41 │ (0: u32) - 1; + │ ^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:42:9 + │ +42 │ (0: u256) - 1; + │ ^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:44:10 + │ +44 │ ((256: u64) as u8); + │ ^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:45:10 + │ +45 │ ((340282366920938463463374607431768211450: u128) as u64); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:46:10 + │ +46 │ ((340282366920938463463374607431768211456: u256) as u128); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:47:10 + │ +47 │ ((65536: u64) as u16); + │ ^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/folding/unfoldable_constants_blocks.move:48:10 + │ +48 │ ((4294967296: u128) as u32); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid expression in 'const'. This expression could not be evaluated to a value diff --git a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/dot_incomplete.exp b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/dot_incomplete.exp deleted file mode 100644 index 46f9d796222c8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/dot_incomplete.exp +++ /dev/null @@ -1,36 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/ide_mode/dot_incomplete.move:13:23 - │ -13 │ let _tmp1 = s.; // incomplete with `;` (next line should parse) - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - -error[E01002]: unexpected token - ┌─ tests/move_check/ide_mode/dot_incomplete.move:14:37 - │ -14 │ let _tmp2 = s.another_field.; // incomplete with `;` (next line should parse) - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - -error[E01002]: unexpected token - ┌─ tests/move_check/ide_mode/dot_incomplete.move:16:9 - │ -16 │ let _tmp4 = s; - │ ^^^ - │ │ - │ Unexpected 'let' - │ Expected an identifier or a decimal number - -error[E01002]: unexpected token - ┌─ tests/move_check/ide_mode/dot_incomplete.move:18:5 - │ -18 │ } - │ ^ - │ │ - │ Unexpected '}' - │ Expected an identifier or a decimal number - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/dot_incomplete.snap b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/dot_incomplete.snap new file mode 100644 index 0000000000000..9e50b9597cfb7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/dot_incomplete.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/ide_mode/dot_incomplete.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/ide_mode/dot_incomplete.move:13:23 + │ +13 │ let _tmp1 = s.; // incomplete with `;` (next line should parse) + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +error[E01002]: unexpected token + ┌─ tests/move_check/ide_mode/dot_incomplete.move:14:37 + │ +14 │ let _tmp2 = s.another_field.; // incomplete with `;` (next line should parse) + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +error[E01002]: unexpected token + ┌─ tests/move_check/ide_mode/dot_incomplete.move:16:9 + │ +16 │ let _tmp4 = s; + │ ^^^ + │ │ + │ Unexpected 'let' + │ Expected an identifier or a decimal number + +error[E01002]: unexpected token + ┌─ tests/move_check/ide_mode/dot_incomplete.move:18:5 + │ +18 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected an identifier or a decimal number diff --git a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.exp b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.exp deleted file mode 100644 index 2e92c1dc8adfc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:13:24 - │ -13 │ let _tmp1 = _s.; - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - -error[E01002]: unexpected token - ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:14:26 - │ -14 │ let _tmp2 = _s.a.; - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.ide.exp b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.ide.exp deleted file mode 100644 index 71fb04dbe0674..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.ide.exp +++ /dev/null @@ -1,125 +0,0 @@ -note[I15006]: IDE path autocomplete - ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:1:1 - │ - 1 │ ╭ module a::m { - 2 │ │ - 3 │ │ struct A has copy, drop { - 4 │ │ x: u64 - · │ -15 │ │ } -16 │ │ } - │ ╰─^ Possible in-scope names - │ - = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' - = modules: 'Self -> a::m' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -note[I15006]: IDE path autocomplete - ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:4:12 - │ -4 │ x: u64 - │ ^^^ Possible in-scope names - │ - = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' - = modules: 'Self -> a::m' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -note[I15006]: IDE path autocomplete - ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:8:12 - │ -8 │ a: A - │ ^ Possible in-scope names - │ - = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' - = modules: 'Self -> a::m' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -note[I15006]: IDE path autocomplete - ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:12:18 - │ -12 │ let _s = B { a: A { x: 0 } }; - │ ^ Possible in-scope names - │ - = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' - = modules: 'Self -> a::m' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -note[I15006]: IDE path autocomplete - ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:12:25 - │ -12 │ let _s = B { a: A { x: 0 } }; - │ ^ Possible in-scope names - │ - = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' - = modules: 'Self -> a::m' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -note[I15006]: IDE path autocomplete - ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:13:21 - │ -13 │ let _tmp1 = _s.; - │ ^^ Possible in-scope names - │ - = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' - = modules: 'Self -> a::m' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:13:23 - │ -13 │ let _tmp1 = _s.; - │ ^ Possible dot names: 'a' - -error[E01002]: unexpected token - ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:13:24 - │ -13 │ let _tmp1 = _s.; - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - -note[I15006]: IDE path autocomplete - ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:14:21 - │ -14 │ let _tmp2 = _s.a.; - │ ^^ Possible in-scope names - │ - = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' - = modules: 'Self -> a::m' - = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' - = type params: - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:14:23 - │ -14 │ let _tmp2 = _s.a.; - │ ^ Possible dot names: 'a' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:14:24 - │ -14 │ let _tmp2 = _s.a.; - │ ^ Possible dot names: 'a' - -note[I15001]: IDE dot autocomplete - ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:14:25 - │ -14 │ let _tmp2 = _s.a.; - │ ^ Possible dot names: 'x' - -error[E01002]: unexpected token - ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:14:26 - │ -14 │ let _tmp2 = _s.a.; - │ ^ - │ │ - │ Unexpected ';' - │ Expected an identifier or a decimal number - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.snap b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.snap new file mode 100644 index 0000000000000..e142145db57a6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:13:24 + │ +13 │ let _tmp1 = _s.; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +error[E01002]: unexpected token + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:14:26 + │ +14 │ let _tmp2 = _s.a.; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number diff --git a/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete@ide.snap b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete@ide.snap new file mode 100644 index 0000000000000..d0659587c8623 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete@ide.snap @@ -0,0 +1,132 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/ide_mode/named_struct_autocomplete.move +--- +note[I15006]: IDE path autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:1:1 + │ + 1 │ ╭ module a::m { + 2 │ │ + 3 │ │ struct A has copy, drop { + 4 │ │ x: u64 + · │ +15 │ │ } +16 │ │ } + │ ╰─^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + = modules: 'Self -> a::m' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +note[I15006]: IDE path autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:4:12 + │ +4 │ x: u64 + │ ^^^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + = modules: 'Self -> a::m' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +note[I15006]: IDE path autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:8:12 + │ +8 │ a: A + │ ^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + = modules: 'Self -> a::m' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +note[I15006]: IDE path autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:12:18 + │ +12 │ let _s = B { a: A { x: 0 } }; + │ ^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + = modules: 'Self -> a::m' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +note[I15006]: IDE path autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:12:25 + │ +12 │ let _s = B { a: A { x: 0 } }; + │ ^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + = modules: 'Self -> a::m' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +note[I15006]: IDE path autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:13:21 + │ +13 │ let _tmp1 = _s.; + │ ^^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + = modules: 'Self -> a::m' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:13:23 + │ +13 │ let _tmp1 = _s.; + │ ^ Possible dot names: 'a' + +error[E01002]: unexpected token + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:13:24 + │ +13 │ let _tmp1 = _s.; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number + +note[I15006]: IDE path autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:14:21 + │ +14 │ let _tmp2 = _s.a.; + │ ^^ Possible in-scope names + │ + = members: 'A -> a::m::A', 'B -> a::m::B', 'foo -> a::m::foo', or 'unit_test_poison -> a::m::unit_test_poison' + = modules: 'Self -> a::m' + = addresses: 'A -> 0x41', 'B -> 0x42', 'K -> 0x19', 'M -> 0x40', 'a -> 0x44', 'b -> 0x45', 'k -> 0x19', 'std -> 0x1', or 'sui -> 0x2' + = type params: + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:14:23 + │ +14 │ let _tmp2 = _s.a.; + │ ^ Possible dot names: 'a' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:14:24 + │ +14 │ let _tmp2 = _s.a.; + │ ^ Possible dot names: 'a' + +note[I15001]: IDE dot autocomplete + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:14:25 + │ +14 │ let _tmp2 = _s.a.; + │ ^ Possible dot names: 'x' + +error[E01002]: unexpected token + ┌─ tests/move_check/ide_mode/named_struct_autocomplete.move:14:26 + │ +14 │ let _tmp2 = _s.a.; + │ ^ + │ │ + │ Unexpected ';' + │ Expected an identifier or a decimal number diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/copy_after_move.exp b/external-crates/move/crates/move-compiler/tests/move_check/liveness/copy_after_move.exp deleted file mode 100644 index d2c6d3bb315e9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/liveness/copy_after_move.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/liveness/copy_after_move.move:5:9 - │ -4 │ move x; - │ ------ - │ │ - │ The value of 'x' was previously moved here. - │ Suggestion: use 'copy x' to avoid the move. -5 │ copy x; - │ ^^^^^^ Invalid usage of previously moved variable 'x'. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/copy_after_move.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/copy_after_move.snap new file mode 100644 index 0000000000000..aca8e61ce31e5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/copy_after_move.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/copy_after_move.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/liveness/copy_after_move.move:5:9 + │ +4 │ move x; + │ ------ + │ │ + │ The value of 'x' was previously moved here. + │ Suggestion: use 'copy x' to avoid the move. +5 │ copy x; + │ ^^^^^^ Invalid usage of previously moved variable 'x'. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_if.exp b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_if.exp deleted file mode 100644 index fbe7188407eee..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_if.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/liveness/dead_if.move:4:23 - │ -4 │ let () = (if (cond) { break } else { continue } : ()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_if.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_if.snap new file mode 100644 index 0000000000000..0c0b22775fbfe --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_if.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/dead_if.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/liveness/dead_if.move:4:23 + │ +4 │ let () = (if (cond) { break } else { continue } : ()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_branch.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_branch.snap new file mode 100644 index 0000000000000..084e7361ada69 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_branch.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/dead_refs_branch.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_branch_both.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_branch_both.snap new file mode 100644 index 0000000000000..07c5662dfcb30 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_branch_both.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/dead_refs_branch_both.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_branch_both_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_branch_both_invalid.exp deleted file mode 100644 index fc7b548b44958..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_branch_both_invalid.exp +++ /dev/null @@ -1,36 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/liveness/dead_refs_branch_both_invalid.move:10:13 - │ - 4 │ let x_ref = &mut x; - │ ------ It is still being mutably borrowed by this reference - · -10 │ _ = x; - │ ^ Invalid copy of variable 'x' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/liveness/dead_refs_branch_both_invalid.move:11:13 - │ - 4 │ let x_ref = &mut x; - │ ------ It is still being mutably borrowed by this reference - · -11 │ _ = move x; - │ ^^^^^^ Invalid move of variable 'x' - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/liveness/dead_refs_branch_both_invalid.move:23:13 - │ -17 │ let x_ref = &mut x; - │ ------ It is still being mutably borrowed by this reference - · -23 │ _ = x; - │ ^ Invalid copy of variable 'x' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/liveness/dead_refs_branch_both_invalid.move:24:13 - │ -17 │ let x_ref = &mut x; - │ ------ It is still being mutably borrowed by this reference - · -24 │ _ = move x; - │ ^^^^^^ Invalid move of variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_branch_both_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_branch_both_invalid.snap new file mode 100644 index 0000000000000..3ff8ccc00db85 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_branch_both_invalid.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/dead_refs_branch_both_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/liveness/dead_refs_branch_both_invalid.move:10:13 + │ + 4 │ let x_ref = &mut x; + │ ------ It is still being mutably borrowed by this reference + · +10 │ _ = x; + │ ^ Invalid copy of variable 'x' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/liveness/dead_refs_branch_both_invalid.move:11:13 + │ + 4 │ let x_ref = &mut x; + │ ------ It is still being mutably borrowed by this reference + · +11 │ _ = move x; + │ ^^^^^^ Invalid move of variable 'x' + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/liveness/dead_refs_branch_both_invalid.move:23:13 + │ +17 │ let x_ref = &mut x; + │ ------ It is still being mutably borrowed by this reference + · +23 │ _ = x; + │ ^ Invalid copy of variable 'x' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/liveness/dead_refs_branch_both_invalid.move:24:13 + │ +17 │ let x_ref = &mut x; + │ ------ It is still being mutably borrowed by this reference + · +24 │ _ = move x; + │ ^^^^^^ Invalid move of variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_branch_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_branch_invalid.exp deleted file mode 100644 index 937899e797b5b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_branch_invalid.exp +++ /dev/null @@ -1,36 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/liveness/dead_refs_branch_invalid.move:8:13 - │ -4 │ let x_ref = &mut x; - │ ------ It is still being mutably borrowed by this reference - · -8 │ _ = x; - │ ^ Invalid copy of variable 'x' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/liveness/dead_refs_branch_invalid.move:9:13 - │ -4 │ let x_ref = &mut x; - │ ------ It is still being mutably borrowed by this reference - · -9 │ _ = move x; - │ ^^^^^^ Invalid move of variable 'x' - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/liveness/dead_refs_branch_invalid.move:20:13 - │ -15 │ let x_ref = &mut x; - │ ------ It is still being mutably borrowed by this reference - · -20 │ _ = x; - │ ^ Invalid copy of variable 'x' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/liveness/dead_refs_branch_invalid.move:21:13 - │ -15 │ let x_ref = &mut x; - │ ------ It is still being mutably borrowed by this reference - · -21 │ _ = move x; - │ ^^^^^^ Invalid move of variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_branch_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_branch_invalid.snap new file mode 100644 index 0000000000000..b2a076c1398bf --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_branch_invalid.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/dead_refs_branch_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/liveness/dead_refs_branch_invalid.move:8:13 + │ +4 │ let x_ref = &mut x; + │ ------ It is still being mutably borrowed by this reference + · +8 │ _ = x; + │ ^ Invalid copy of variable 'x' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/liveness/dead_refs_branch_invalid.move:9:13 + │ +4 │ let x_ref = &mut x; + │ ------ It is still being mutably borrowed by this reference + · +9 │ _ = move x; + │ ^^^^^^ Invalid move of variable 'x' + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/liveness/dead_refs_branch_invalid.move:20:13 + │ +15 │ let x_ref = &mut x; + │ ------ It is still being mutably borrowed by this reference + · +20 │ _ = x; + │ ^ Invalid copy of variable 'x' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/liveness/dead_refs_branch_invalid.move:21:13 + │ +15 │ let x_ref = &mut x; + │ ------ It is still being mutably borrowed by this reference + · +21 │ _ = move x; + │ ^^^^^^ Invalid move of variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_loop.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_loop.snap new file mode 100644 index 0000000000000..60fba512359fa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_loop.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/dead_refs_loop.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_loop_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_loop_invalid.exp deleted file mode 100644 index 3c01d675ce0e7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_loop_invalid.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/liveness/dead_refs_loop_invalid.move:6:17 - │ -4 │ let x_ref = &mut x; - │ ------ It is still being mutably borrowed by this reference -5 │ while (cond) { -6 │ _ = x; - │ ^ Invalid copy of variable 'x' - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/liveness/dead_refs_loop_invalid.move:16:16 - │ -13 │ let x_ref = &mut x; - │ ------ It is still being mutably borrowed by this reference - · -16 │ _ = x; - │ ^ Invalid copy of variable 'x' - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/liveness/dead_refs_loop_invalid.move:25:17 - │ -22 │ let x_ref = &mut x; - │ ------ It is still being mutably borrowed by this reference - · -25 │ _ = x; - │ ^ Invalid copy of variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_loop_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_loop_invalid.snap new file mode 100644 index 0000000000000..260085c25b67b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_loop_invalid.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/dead_refs_loop_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/liveness/dead_refs_loop_invalid.move:6:17 + │ +4 │ let x_ref = &mut x; + │ ------ It is still being mutably borrowed by this reference +5 │ while (cond) { +6 │ _ = x; + │ ^ Invalid copy of variable 'x' + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/liveness/dead_refs_loop_invalid.move:16:16 + │ +13 │ let x_ref = &mut x; + │ ------ It is still being mutably borrowed by this reference + · +16 │ _ = x; + │ ^ Invalid copy of variable 'x' + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/liveness/dead_refs_loop_invalid.move:25:17 + │ +22 │ let x_ref = &mut x; + │ ------ It is still being mutably borrowed by this reference + · +25 │ _ = x; + │ ^ Invalid copy of variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_nested.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_nested.snap new file mode 100644 index 0000000000000..67b54c112f688 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_nested.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/dead_refs_nested.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_nested_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_nested_invalid.exp deleted file mode 100644 index ac916732d7153..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_nested_invalid.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/liveness/dead_refs_nested_invalid.move:9:17 - │ -4 │ let x_ref = &mut x; - │ ------ It is still being mutably borrowed by this reference - · -9 │ _ = x; - │ ^ Invalid copy of variable 'x' - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/liveness/dead_refs_nested_invalid.move:19:20 - │ -15 │ let x_ref = &mut x; - │ ------ It is still being mutably borrowed by this reference - · -19 │ _ = x; - │ ^ Invalid copy of variable 'x' - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/liveness/dead_refs_nested_invalid.move:29:71 - │ -27 │ let x_ref = &mut x; - │ ------ It is still being mutably borrowed by this reference -28 │ loop { -29 │ if (cond) { _ = x_ref; break } else { while (!cond) { _ = x } } - │ ^ Invalid copy of variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_nested_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_nested_invalid.snap new file mode 100644 index 0000000000000..68f5d13d83586 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_nested_invalid.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/dead_refs_nested_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/liveness/dead_refs_nested_invalid.move:9:17 + │ +4 │ let x_ref = &mut x; + │ ------ It is still being mutably borrowed by this reference + · +9 │ _ = x; + │ ^ Invalid copy of variable 'x' + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/liveness/dead_refs_nested_invalid.move:19:20 + │ +15 │ let x_ref = &mut x; + │ ------ It is still being mutably borrowed by this reference + · +19 │ _ = x; + │ ^ Invalid copy of variable 'x' + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/liveness/dead_refs_nested_invalid.move:29:71 + │ +27 │ let x_ref = &mut x; + │ ------ It is still being mutably borrowed by this reference +28 │ loop { +29 │ if (cond) { _ = x_ref; break } else { while (!cond) { _ = x } } + │ ^ Invalid copy of variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_simple.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_simple.snap new file mode 100644 index 0000000000000..f61d4aefbf9db --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_simple.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/dead_refs_simple.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_simple_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_simple_invalid.exp deleted file mode 100644 index 07fa9c254d4df..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_simple_invalid.exp +++ /dev/null @@ -1,34 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/liveness/dead_refs_simple_invalid.move:5:13 - │ -4 │ let x_ref = &mut x; - │ ------ It is still being mutably borrowed by this reference -5 │ _ = x; - │ ^ Invalid copy of variable 'x' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/liveness/dead_refs_simple_invalid.move:6:13 - │ -4 │ let x_ref = &mut x; - │ ------ It is still being mutably borrowed by this reference -5 │ _ = x; -6 │ _ = move x; - │ ^^^^^^ Invalid move of variable 'x' - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/liveness/dead_refs_simple_invalid.move:13:13 - │ -12 │ let x_ref = &mut x; - │ ------ It is still being mutably borrowed by this reference -13 │ _ = x; - │ ^ Invalid copy of variable 'x' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/liveness/dead_refs_simple_invalid.move:14:13 - │ -12 │ let x_ref = &mut x; - │ ------ It is still being mutably borrowed by this reference -13 │ _ = x; -14 │ _ = move x; - │ ^^^^^^ Invalid move of variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_simple_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_simple_invalid.snap new file mode 100644 index 0000000000000..ca154dde15fc0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/dead_refs_simple_invalid.snap @@ -0,0 +1,41 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/dead_refs_simple_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/liveness/dead_refs_simple_invalid.move:5:13 + │ +4 │ let x_ref = &mut x; + │ ------ It is still being mutably borrowed by this reference +5 │ _ = x; + │ ^ Invalid copy of variable 'x' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/liveness/dead_refs_simple_invalid.move:6:13 + │ +4 │ let x_ref = &mut x; + │ ------ It is still being mutably borrowed by this reference +5 │ _ = x; +6 │ _ = move x; + │ ^^^^^^ Invalid move of variable 'x' + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/liveness/dead_refs_simple_invalid.move:13:13 + │ +12 │ let x_ref = &mut x; + │ ------ It is still being mutably borrowed by this reference +13 │ _ = x; + │ ^ Invalid copy of variable 'x' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/liveness/dead_refs_simple_invalid.move:14:13 + │ +12 │ let x_ref = &mut x; + │ ------ It is still being mutably borrowed by this reference +13 │ _ = x; +14 │ _ = move x; + │ ^^^^^^ Invalid move of variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/explicit_last_copy.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/explicit_last_copy.snap new file mode 100644 index 0000000000000..6b180e01200ec --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/explicit_last_copy.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/explicit_last_copy.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/implicit_copy_with_continue.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/implicit_copy_with_continue.snap new file mode 100644 index 0000000000000..22c8c006adeb1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/implicit_copy_with_continue.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/implicit_copy_with_continue.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/loop_weirdness.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/loop_weirdness.snap new file mode 100644 index 0000000000000..0afad50bc83ad --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/loop_weirdness.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/loop_weirdness.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/move_in_infinite_loop_branched.exp b/external-crates/move/crates/move-compiler/tests/move_check/liveness/move_in_infinite_loop_branched.exp deleted file mode 100644 index 4f45e29d6a856..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/liveness/move_in_infinite_loop_branched.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/liveness/move_in_infinite_loop_branched.move:5:28 - │ -5 │ loop { let y = move x; y / y; } - │ ^^^^^^ - │ │ - │ Invalid usage of previously moved variable 'x'. - │ Suggestion: use 'copy x' to avoid the move. - │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/liveness/move_in_infinite_loop_branched.move:7:28 - │ -7 │ loop { let y = move x; y % y; } - │ ^^^^^^ - │ │ - │ Invalid usage of previously moved variable 'x'. - │ Suggestion: use 'copy x' to avoid the move. - │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/move_in_infinite_loop_branched.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/move_in_infinite_loop_branched.snap new file mode 100644 index 0000000000000..a8f437d58a749 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/move_in_infinite_loop_branched.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/move_in_infinite_loop_branched.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/liveness/move_in_infinite_loop_branched.move:5:28 + │ +5 │ loop { let y = move x; y / y; } + │ ^^^^^^ + │ │ + │ Invalid usage of previously moved variable 'x'. + │ Suggestion: use 'copy x' to avoid the move. + │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/liveness/move_in_infinite_loop_branched.move:7:28 + │ +7 │ loop { let y = move x; y % y; } + │ ^^^^^^ + │ │ + │ Invalid usage of previously moved variable 'x'. + │ Suggestion: use 'copy x' to avoid the move. + │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/nested_dead.exp b/external-crates/move/crates/move-compiler/tests/move_check/liveness/nested_dead.exp deleted file mode 100644 index b652e5c9f89ce..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/liveness/nested_dead.exp +++ /dev/null @@ -1,56 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/liveness/nested_dead.move:3:16 - │ -3 │ return return 0 - │ ^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/liveness/nested_dead.move:7:28 - │ -7 │ if (true) { return abort 0 } else { abort 0 }; - │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/liveness/nested_dead.move:12:23 - │ -12 │ loop { return abort 0 } - │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/liveness/nested_dead.move:16:28 - │ -16 │ if (true) { return abort 0 } else { return abort 0 } - │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/liveness/nested_dead.move:16:52 - │ -16 │ if (true) { return abort 0 } else { return abort 0 } - │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/liveness/nested_dead.move:20:21 - │ -20 │ let x = if (return 1) { 0 } else { 1 }; - │ ^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/liveness/nested_dead.move:25:16 - │ -25 │ while (return 0) { - │ ^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/nested_dead.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/nested_dead.snap new file mode 100644 index 0000000000000..1aa89a8a14ebd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/nested_dead.snap @@ -0,0 +1,63 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/nested_dead.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/liveness/nested_dead.move:3:16 + │ +3 │ return return 0 + │ ^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/liveness/nested_dead.move:7:28 + │ +7 │ if (true) { return abort 0 } else { abort 0 }; + │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/liveness/nested_dead.move:12:23 + │ +12 │ loop { return abort 0 } + │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/liveness/nested_dead.move:16:28 + │ +16 │ if (true) { return abort 0 } else { return abort 0 } + │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/liveness/nested_dead.move:16:52 + │ +16 │ if (true) { return abort 0 } else { return abort 0 } + │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/liveness/nested_dead.move:20:21 + │ +20 │ let x = if (return 1) { 0 } else { 1 }; + │ ^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/liveness/nested_dead.move:25:16 + │ +25 │ while (return 0) { + │ ^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/nested_dead_single.exp b/external-crates/move/crates/move-compiler/tests/move_check/liveness/nested_dead_single.exp deleted file mode 100644 index 1fa168625ea5c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/liveness/nested_dead_single.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/liveness/nested_dead_single.move:3:23 - │ -3 │ loop { return abort 0 } - │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/nested_dead_single.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/nested_dead_single.snap new file mode 100644 index 0000000000000..aca1a733a6caa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/nested_dead_single.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/nested_dead_single.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/liveness/nested_dead_single.move:3:23 + │ +3 │ loop { return abort 0 } + │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/trailing_semi.exp b/external-crates/move/crates/move-compiler/tests/move_check/liveness/trailing_semi.exp deleted file mode 100644 index 44295e1a85741..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/liveness/trailing_semi.exp +++ /dev/null @@ -1,100 +0,0 @@ -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi.move:3:15 - │ -3 │ return; - │ ------^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi.move:9:16 - │ -9 │ abort 0; - │ -------^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi.move:15:19 - │ -15 │ { return }; - │ ------ ^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi.move:21:20 - │ -21 │ { abort 0 }; - │ ------- ^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi.move:29:19 - │ -29 │ return; - │ ------^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi.move:43:14 - │ -39 │ ╭ if (cond) { -40 │ │ return -41 │ │ } else { -42 │ │ abort 0 -43 │ │ }; - │ │ ^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ ╰─────────────' Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi.move:52:24 - │ -52 │ abort 0; - │ -------^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi.move:54:23 - │ -54 │ return; - │ ------^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/trailing_semi.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/trailing_semi.snap new file mode 100644 index 0000000000000..7f271fc5863e8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/trailing_semi.snap @@ -0,0 +1,107 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/trailing_semi.move +--- +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi.move:3:15 + │ +3 │ return; + │ ------^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi.move:9:16 + │ +9 │ abort 0; + │ -------^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi.move:15:19 + │ +15 │ { return }; + │ ------ ^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi.move:21:20 + │ +21 │ { abort 0 }; + │ ------- ^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi.move:29:19 + │ +29 │ return; + │ ------^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi.move:43:14 + │ +39 │ ╭ if (cond) { +40 │ │ return +41 │ │ } else { +42 │ │ abort 0 +43 │ │ }; + │ │ ^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ ╰─────────────' Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi.move:52:24 + │ +52 │ abort 0; + │ -------^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi.move:54:23 + │ +54 │ return; + │ ------^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/trailing_semi_loops.exp b/external-crates/move/crates/move-compiler/tests/move_check/liveness/trailing_semi_loops.exp deleted file mode 100644 index 6b1b524de50fa..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/liveness/trailing_semi_loops.exp +++ /dev/null @@ -1,165 +0,0 @@ -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi_loops.move:3:16 - │ -3 │ loop (); - │ -------^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/liveness/trailing_semi_loops.move:7:12 - │ -7 │ { (loop (): ()) }; - │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi_loops.move:14:10 - │ -11 │ ╭ loop { -12 │ │ let x = 0; -13 │ │ 0 + x + 0; -14 │ │ }; - │ │ ^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ ╰─────────' Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/liveness/trailing_semi_loops.move:21:26 - │ -21 │ let _: u64 = if (true) break else break; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi_loops.move:27:18 - │ -27 │ break; - │ -----^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi_loops.move:34:22 - │ -34 │ break; - │ -----^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi_loops.move:43:42 - │ -43 │ if (cond) continue else break; - │ -----------------------------^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi_loops.move:49:42 - │ -49 │ if (cond) abort 0 else return; - │ -----------------------------^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09003]: unused assignment - ┌─ tests/move_check/liveness/trailing_semi_loops.move:60:17 - │ -60 │ x = 2; - │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi_loops.move:62:14 - │ -56 │ ╭ if (cond) { -57 │ │ x = 1; -58 │ │ break -59 │ │ } else { -60 │ │ x = 2; -61 │ │ continue -62 │ │ }; - │ │ ^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ ╰─────────────' Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi_loops.move:70:22 - │ -70 │ break; - │ -----^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi_loops.move:72:25 - │ -72 │ continue; - │ --------^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi_loops.move:80:23 - │ -80 │ return; - │ ------^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi_loops.move:82:24 - │ -82 │ abort 0; - │ -------^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/trailing_semi_loops.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/trailing_semi_loops.snap new file mode 100644 index 0000000000000..e63abed9606a4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/trailing_semi_loops.snap @@ -0,0 +1,172 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/trailing_semi_loops.move +--- +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi_loops.move:3:16 + │ +3 │ loop (); + │ -------^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/liveness/trailing_semi_loops.move:7:12 + │ +7 │ { (loop (): ()) }; + │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi_loops.move:14:10 + │ +11 │ ╭ loop { +12 │ │ let x = 0; +13 │ │ 0 + x + 0; +14 │ │ }; + │ │ ^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ ╰─────────' Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/liveness/trailing_semi_loops.move:21:26 + │ +21 │ let _: u64 = if (true) break else break; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi_loops.move:27:18 + │ +27 │ break; + │ -----^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi_loops.move:34:22 + │ +34 │ break; + │ -----^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi_loops.move:43:42 + │ +43 │ if (cond) continue else break; + │ -----------------------------^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi_loops.move:49:42 + │ +49 │ if (cond) abort 0 else return; + │ -----------------------------^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09003]: unused assignment + ┌─ tests/move_check/liveness/trailing_semi_loops.move:60:17 + │ +60 │ x = 2; + │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi_loops.move:62:14 + │ +56 │ ╭ if (cond) { +57 │ │ x = 1; +58 │ │ break +59 │ │ } else { +60 │ │ x = 2; +61 │ │ continue +62 │ │ }; + │ │ ^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ ╰─────────────' Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi_loops.move:70:22 + │ +70 │ break; + │ -----^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi_loops.move:72:25 + │ +72 │ continue; + │ --------^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi_loops.move:80:23 + │ +80 │ return; + │ ------^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi_loops.move:82:24 + │ +82 │ abort 0; + │ -------^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/trailing_semi_single.exp b/external-crates/move/crates/move-compiler/tests/move_check/liveness/trailing_semi_single.exp deleted file mode 100644 index c3b84db79560f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/liveness/trailing_semi_single.exp +++ /dev/null @@ -1,12 +0,0 @@ -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/move_check/liveness/trailing_semi_single.move:3:15 - │ -3 │ return; - │ ------^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/trailing_semi_single.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/trailing_semi_single.snap new file mode 100644 index 0000000000000..d6f7e6dd262e5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/trailing_semi_single.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/trailing_semi_single.move +--- +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/move_check/liveness/trailing_semi_single.move:3:15 + │ +3 │ return; + │ ------^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/unused_assignment.exp b/external-crates/move/crates/move-compiler/tests/move_check/liveness/unused_assignment.exp deleted file mode 100644 index 79790fd0b0ea7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/liveness/unused_assignment.exp +++ /dev/null @@ -1,72 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/liveness/unused_assignment.move:3:13 - │ -3 │ let x = 0; - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09003]: unused assignment - ┌─ tests/move_check/liveness/unused_assignment.move:7:13 - │ -7 │ let x = 0; - │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09003]: unused assignment - ┌─ tests/move_check/liveness/unused_assignment.move:8:9 - │ -8 │ x = 0; - │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/liveness/unused_assignment.move:13:17 - │ -13 │ let x = 0; - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09003]: unused assignment - ┌─ tests/move_check/liveness/unused_assignment.move:21:13 - │ -21 │ x = 0; - │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09003]: unused assignment - ┌─ tests/move_check/liveness/unused_assignment.move:26:13 - │ -26 │ let x = 0; - │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09003]: unused assignment - ┌─ tests/move_check/liveness/unused_assignment.move:28:13 - │ -28 │ x = 1; - │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09003]: unused assignment - ┌─ tests/move_check/liveness/unused_assignment.move:30:13 - │ -30 │ x = 2; - │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09003]: unused assignment - ┌─ tests/move_check/liveness/unused_assignment.move:41:13 - │ -41 │ x = 1; - │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/unused_assignment.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/unused_assignment.snap new file mode 100644 index 0000000000000..6a5466ea0b897 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/unused_assignment.snap @@ -0,0 +1,79 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/unused_assignment.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/liveness/unused_assignment.move:3:13 + │ +3 │ let x = 0; + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09003]: unused assignment + ┌─ tests/move_check/liveness/unused_assignment.move:7:13 + │ +7 │ let x = 0; + │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09003]: unused assignment + ┌─ tests/move_check/liveness/unused_assignment.move:8:9 + │ +8 │ x = 0; + │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/liveness/unused_assignment.move:13:17 + │ +13 │ let x = 0; + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09003]: unused assignment + ┌─ tests/move_check/liveness/unused_assignment.move:21:13 + │ +21 │ x = 0; + │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09003]: unused assignment + ┌─ tests/move_check/liveness/unused_assignment.move:26:13 + │ +26 │ let x = 0; + │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09003]: unused assignment + ┌─ tests/move_check/liveness/unused_assignment.move:28:13 + │ +28 │ x = 1; + │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09003]: unused assignment + ┌─ tests/move_check/liveness/unused_assignment.move:30:13 + │ +30 │ x = 2; + │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09003]: unused assignment + ┌─ tests/move_check/liveness/unused_assignment.move:41:13 + │ +41 │ x = 1; + │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/vector_loop.exp b/external-crates/move/crates/move-compiler/tests/move_check/liveness/vector_loop.exp deleted file mode 100644 index b79a9e7366a23..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/liveness/vector_loop.exp +++ /dev/null @@ -1,43 +0,0 @@ -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/liveness/vector_loop.move:23:60 - │ -14 │ struct User has key, store { id: ID } - │ ---- To satisfy the constraint, the 'drop' ability would need to be added here - · -23 │ user_delete(table::remove(&mut table, user_id(&vector::pop_back(users)))); - │ ^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid usage of undroppable value - │ The type 'a::m::User' does not have the ability 'drop' - │ This expression without the 'drop' ability must be used - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/liveness/vector_loop.move:25:9 - │ -14 │ struct User has key, store { id: ID } - │ ---- To satisfy the constraint, the 'drop' ability would need to be added here - · -23 │ user_delete(table::remove(&mut table, user_id(&vector::pop_back(users)))); - │ ----------------------- - │ │ - │ The value is created but not used. The value does not have the 'drop' ability and must be consumed before the function returns - │ The type 'a::m::User' does not have the ability 'drop' -24 │ }; -25 │ table::destroy(table) - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/liveness/vector_loop.move:28:41 - │ -14 │ struct User has key, store { id: ID } - │ ---- To satisfy the constraint, the 'drop' ability would need to be added here - · -28 │ public fun user_delete(_user: User) { - │ ----- ---- The type 'a::m::User' does not have the ability 'drop' - │ │ - │ The parameter '_user' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns - │ ╭─────────────────────────────────────────^ -29 │ │ -30 │ │ } - │ ╰─────^ Invalid return - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/liveness/vector_loop.snap b/external-crates/move/crates/move-compiler/tests/move_check/liveness/vector_loop.snap new file mode 100644 index 0000000000000..2a1f9056727ca --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/liveness/vector_loop.snap @@ -0,0 +1,50 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/liveness/vector_loop.move +--- +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/liveness/vector_loop.move:23:60 + │ +14 │ struct User has key, store { id: ID } + │ ---- To satisfy the constraint, the 'drop' ability would need to be added here + · +23 │ user_delete(table::remove(&mut table, user_id(&vector::pop_back(users)))); + │ ^^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid usage of undroppable value + │ The type 'a::m::User' does not have the ability 'drop' + │ This expression without the 'drop' ability must be used + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/liveness/vector_loop.move:25:9 + │ +14 │ struct User has key, store { id: ID } + │ ---- To satisfy the constraint, the 'drop' ability would need to be added here + · +23 │ user_delete(table::remove(&mut table, user_id(&vector::pop_back(users)))); + │ ----------------------- + │ │ + │ The value is created but not used. The value does not have the 'drop' ability and must be consumed before the function returns + │ The type 'a::m::User' does not have the ability 'drop' +24 │ }; +25 │ table::destroy(table) + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/liveness/vector_loop.move:28:41 + │ +14 │ struct User has key, store { id: ID } + │ ---- To satisfy the constraint, the 'drop' ability would need to be added here + · +28 │ public fun user_delete(_user: User) { + │ ----- ---- The type 'a::m::User' does not have the ability 'drop' + │ │ + │ The parameter '_user' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns + │ ╭─────────────────────────────────────────^ +29 │ │ +30 │ │ } + │ ╰─────^ Invalid return diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/assign_partial_resource.exp b/external-crates/move/crates/move-compiler/tests/move_check/locals/assign_partial_resource.exp deleted file mode 100644 index 58628f147ac28..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/locals/assign_partial_resource.exp +++ /dev/null @@ -1,121 +0,0 @@ -warning[W09003]: unused assignment - ┌─ tests/move_check/locals/assign_partial_resource.move:6:21 - │ -6 │ if (cond) { r = R{}; }; - │ ^ Unused assignment for variable 'r'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_r') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/assign_partial_resource.move:7:9 - │ -2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -5 │ let r: R; - │ - The type '0x8675309::M::R' does not have the ability 'drop' -6 │ if (cond) { r = R{}; }; - │ - The variable might contain a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again -7 │ r = R{}; - │ ^ Invalid assignment to variable 'r' - -warning[W09003]: unused assignment - ┌─ tests/move_check/locals/assign_partial_resource.move:13:29 - │ -13 │ if (cond) {} else { r = R{}; }; - │ ^ Unused assignment for variable 'r'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_r') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/assign_partial_resource.move:14:9 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -12 │ let r: R; - │ - The type '0x8675309::M::R' does not have the ability 'drop' -13 │ if (cond) {} else { r = R{}; }; - │ - The variable might contain a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again -14 │ r = R{}; - │ ^ Invalid assignment to variable 'r' - -warning[W09003]: unused assignment - ┌─ tests/move_check/locals/assign_partial_resource.move:20:24 - │ -20 │ while (cond) { r = R{} }; - │ ^ Unused assignment for variable 'r'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_r') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/assign_partial_resource.move:20:24 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -19 │ let r: R; - │ - The type '0x8675309::M::R' does not have the ability 'drop' -20 │ while (cond) { r = R{} }; - │ ^ - │ │ - │ Invalid assignment to variable 'r' - │ The variable might contain a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/assign_partial_resource.move:21:9 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -19 │ let r: R; - │ - The type '0x8675309::M::R' does not have the ability 'drop' -20 │ while (cond) { r = R{} }; - │ - The variable might contain a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again -21 │ r = R{}; - │ ^ Invalid assignment to variable 'r' - -warning[W09003]: unused assignment - ┌─ tests/move_check/locals/assign_partial_resource.move:27:16 - │ -27 │ loop { r = R{} } - │ ^ Unused assignment for variable 'r'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_r') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/assign_partial_resource.move:27:16 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -26 │ let r: R; - │ - The type '0x8675309::M::R' does not have the ability 'drop' -27 │ loop { r = R{} } - │ ^ - │ │ - │ Invalid assignment to variable 'r' - │ The variable might contain a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/assign_partial_resource.move:31:21 - │ -30 │ fun t5(cond: bool, x: T, y: T): (T, T) { - │ - - - The type 'T' does not have the ability 'drop' - │ │ │ - │ │ The variable contains a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again - │ To satisfy the constraint, the 'drop' ability would need to be added here -31 │ if (cond) { x = y }; - │ ^ Invalid assignment to variable 'x' - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/assign_partial_resource.move:32:13 - │ -31 │ if (cond) { x = y }; - │ - - │ │ - │ The value of 'y' might have been previously moved here. - │ Suggestion: use 'copy y' to avoid the move. -32 │ (x, y) - │ ^ Invalid usage of previously moved variable 'y'. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/assign_partial_resource.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/assign_partial_resource.snap new file mode 100644 index 0000000000000..29314d2bfcea2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/assign_partial_resource.snap @@ -0,0 +1,128 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/assign_partial_resource.move +--- +warning[W09003]: unused assignment + ┌─ tests/move_check/locals/assign_partial_resource.move:6:21 + │ +6 │ if (cond) { r = R{}; }; + │ ^ Unused assignment for variable 'r'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_r') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/assign_partial_resource.move:7:9 + │ +2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +5 │ let r: R; + │ - The type '0x8675309::M::R' does not have the ability 'drop' +6 │ if (cond) { r = R{}; }; + │ - The variable might contain a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again +7 │ r = R{}; + │ ^ Invalid assignment to variable 'r' + +warning[W09003]: unused assignment + ┌─ tests/move_check/locals/assign_partial_resource.move:13:29 + │ +13 │ if (cond) {} else { r = R{}; }; + │ ^ Unused assignment for variable 'r'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_r') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/assign_partial_resource.move:14:9 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +12 │ let r: R; + │ - The type '0x8675309::M::R' does not have the ability 'drop' +13 │ if (cond) {} else { r = R{}; }; + │ - The variable might contain a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again +14 │ r = R{}; + │ ^ Invalid assignment to variable 'r' + +warning[W09003]: unused assignment + ┌─ tests/move_check/locals/assign_partial_resource.move:20:24 + │ +20 │ while (cond) { r = R{} }; + │ ^ Unused assignment for variable 'r'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_r') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/assign_partial_resource.move:20:24 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +19 │ let r: R; + │ - The type '0x8675309::M::R' does not have the ability 'drop' +20 │ while (cond) { r = R{} }; + │ ^ + │ │ + │ Invalid assignment to variable 'r' + │ The variable might contain a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/assign_partial_resource.move:21:9 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +19 │ let r: R; + │ - The type '0x8675309::M::R' does not have the ability 'drop' +20 │ while (cond) { r = R{} }; + │ - The variable might contain a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again +21 │ r = R{}; + │ ^ Invalid assignment to variable 'r' + +warning[W09003]: unused assignment + ┌─ tests/move_check/locals/assign_partial_resource.move:27:16 + │ +27 │ loop { r = R{} } + │ ^ Unused assignment for variable 'r'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_r') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/assign_partial_resource.move:27:16 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +26 │ let r: R; + │ - The type '0x8675309::M::R' does not have the ability 'drop' +27 │ loop { r = R{} } + │ ^ + │ │ + │ Invalid assignment to variable 'r' + │ The variable might contain a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/assign_partial_resource.move:31:21 + │ +30 │ fun t5(cond: bool, x: T, y: T): (T, T) { + │ - - - The type 'T' does not have the ability 'drop' + │ │ │ + │ │ The variable contains a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again + │ To satisfy the constraint, the 'drop' ability would need to be added here +31 │ if (cond) { x = y }; + │ ^ Invalid assignment to variable 'x' + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/assign_partial_resource.move:32:13 + │ +31 │ if (cond) { x = y }; + │ - + │ │ + │ The value of 'y' might have been previously moved here. + │ Suggestion: use 'copy y' to avoid the move. +32 │ (x, y) + │ ^ Invalid usage of previously moved variable 'y'. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/assign_resource.exp b/external-crates/move/crates/move-compiler/tests/move_check/locals/assign_resource.exp deleted file mode 100644 index 352f676131d3d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/locals/assign_resource.exp +++ /dev/null @@ -1,92 +0,0 @@ -warning[W09003]: unused assignment - ┌─ tests/move_check/locals/assign_resource.move:5:13 - │ -5 │ let r = R{}; - │ ^ Unused assignment for variable 'r'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_r') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/assign_resource.move:6:9 - │ -2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -5 │ let r = R{}; - │ - --- The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ The variable contains a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again -6 │ r = R{}; - │ ^ Invalid assignment to variable 'r' - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/assign_resource.move:12:21 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -11 │ let r = R{}; - │ - --- The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ The variable contains a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again -12 │ if (cond) { r = R{}; }; - │ ^ Invalid assignment to variable 'r' - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/assign_resource.move:18:29 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -17 │ let r = R{}; - │ - --- The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ The variable contains a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again -18 │ if (cond) {} else { r = R{}; }; - │ ^ Invalid assignment to variable 'r' - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/assign_resource.move:24:24 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -23 │ let r = R{}; - │ - --- The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ The variable contains a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again -24 │ while (cond) { r = R{} }; - │ ^ Invalid assignment to variable 'r' - -warning[W09003]: unused assignment - ┌─ tests/move_check/locals/assign_resource.move:29:13 - │ -29 │ let r = R{}; - │ ^ Unused assignment for variable 'r'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_r') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/assign_resource.move:30:16 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -29 │ let r = R{}; - │ - --- The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ The variable might contain a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again -30 │ loop { r = R{}; R {} = r } - │ ^ Invalid assignment to variable 'r' - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/assign_resource.move:34:9 - │ -33 │ fun t5(x: T, y: T): T { - │ - - - The type 'T' does not have the ability 'drop' - │ │ │ - │ │ The variable contains a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again - │ To satisfy the constraint, the 'drop' ability would need to be added here -34 │ x = y; - │ ^ Invalid assignment to variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/assign_resource.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/assign_resource.snap new file mode 100644 index 0000000000000..ffe7abc7791d7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/assign_resource.snap @@ -0,0 +1,99 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/assign_resource.move +--- +warning[W09003]: unused assignment + ┌─ tests/move_check/locals/assign_resource.move:5:13 + │ +5 │ let r = R{}; + │ ^ Unused assignment for variable 'r'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_r') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/assign_resource.move:6:9 + │ +2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +5 │ let r = R{}; + │ - --- The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ The variable contains a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again +6 │ r = R{}; + │ ^ Invalid assignment to variable 'r' + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/assign_resource.move:12:21 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +11 │ let r = R{}; + │ - --- The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ The variable contains a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again +12 │ if (cond) { r = R{}; }; + │ ^ Invalid assignment to variable 'r' + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/assign_resource.move:18:29 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +17 │ let r = R{}; + │ - --- The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ The variable contains a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again +18 │ if (cond) {} else { r = R{}; }; + │ ^ Invalid assignment to variable 'r' + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/assign_resource.move:24:24 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +23 │ let r = R{}; + │ - --- The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ The variable contains a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again +24 │ while (cond) { r = R{} }; + │ ^ Invalid assignment to variable 'r' + +warning[W09003]: unused assignment + ┌─ tests/move_check/locals/assign_resource.move:29:13 + │ +29 │ let r = R{}; + │ ^ Unused assignment for variable 'r'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_r') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/assign_resource.move:30:16 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +29 │ let r = R{}; + │ - --- The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ The variable might contain a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again +30 │ loop { r = R{}; R {} = r } + │ ^ Invalid assignment to variable 'r' + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/assign_resource.move:34:9 + │ +33 │ fun t5(x: T, y: T): T { + │ - - - The type 'T' does not have the ability 'drop' + │ │ │ + │ │ The variable contains a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again + │ To satisfy the constraint, the 'drop' ability would need to be added here +34 │ x = y; + │ ^ Invalid assignment to variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/drop_conditional.exp b/external-crates/move/crates/move-compiler/tests/move_check/locals/drop_conditional.exp deleted file mode 100644 index 423a30e702529..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/locals/drop_conditional.exp +++ /dev/null @@ -1,25 +0,0 @@ -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/drop_conditional.move:14:11 - │ -11 │ let x = Cup { f: R{} }; - │ - ----------------- - │ │ │ │ - │ │ │ The type '0x42::M::Cup<0x42::M::R>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' - │ │ The type '0x42::M::Cup<0x42::M::R>' does not have the ability 'drop' - │ The local variable 'x' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns - · -14 │ &x; - │ ^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/drop_conditional.move:14:11 - │ -13 │ let x = Pair { f1: S{}, f2: R{} }; - │ - ------------------------------- - │ │ │ │ - │ │ │ The type '0x42::M::Pair<0x42::M::S, 0x42::M::R>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' - │ │ The type '0x42::M::Pair<0x42::M::S, 0x42::M::R>' does not have the ability 'drop' - │ The local variable 'x' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -14 │ &x; - │ ^ Invalid return - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/drop_conditional.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/drop_conditional.snap new file mode 100644 index 0000000000000..0888373dba68e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/drop_conditional.snap @@ -0,0 +1,32 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/drop_conditional.move +--- +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/drop_conditional.move:14:11 + │ +11 │ let x = Cup { f: R{} }; + │ - ----------------- + │ │ │ │ + │ │ │ The type '0x42::M::Cup<0x42::M::R>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' + │ │ The type '0x42::M::Cup<0x42::M::R>' does not have the ability 'drop' + │ The local variable 'x' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns + · +14 │ &x; + │ ^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/drop_conditional.move:14:11 + │ +13 │ let x = Pair { f1: S{}, f2: R{} }; + │ - ------------------------------- + │ │ │ │ + │ │ │ The type '0x42::M::Pair<0x42::M::S, 0x42::M::R>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' + │ │ The type '0x42::M::Pair<0x42::M::S, 0x42::M::R>' does not have the ability 'drop' + │ The local variable 'x' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +14 │ &x; + │ ^ Invalid return diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/eliminate_temps.exp b/external-crates/move/crates/move-compiler/tests/move_check/locals/eliminate_temps.exp deleted file mode 100644 index 3199c2d616528..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/locals/eliminate_temps.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/locals/eliminate_temps.move:7:47 - │ -7 │ let (boom, u): (&u64, u64) = (&mut x, x); - │ ------ ^ Invalid copy of variable 'x' - │ │ - │ It is still being mutably borrowed by this reference - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/locals/eliminate_temps.move:14:39 - │ -14 │ let (f, u): (&u64, u64) = (r, *r); - │ - ^^ Invalid dereference. - │ │ - │ It is still being mutably borrowed by this reference - -error[E07001]: referential transparency violated - ┌─ tests/move_check/locals/eliminate_temps.move:20:46 - │ -20 │ let (f, u): (&u64, u64) = (&mut s.f, s.f); - │ -------- ^^^ Invalid immutable borrow at field 'f'. - │ │ - │ Field 'f' is still being mutably borrowed by this reference - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/eliminate_temps.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/eliminate_temps.snap new file mode 100644 index 0000000000000..f9df0bf08b9e8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/eliminate_temps.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/eliminate_temps.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/locals/eliminate_temps.move:7:47 + │ +7 │ let (boom, u): (&u64, u64) = (&mut x, x); + │ ------ ^ Invalid copy of variable 'x' + │ │ + │ It is still being mutably borrowed by this reference + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/locals/eliminate_temps.move:14:39 + │ +14 │ let (f, u): (&u64, u64) = (r, *r); + │ - ^^ Invalid dereference. + │ │ + │ It is still being mutably borrowed by this reference + +error[E07001]: referential transparency violated + ┌─ tests/move_check/locals/eliminate_temps.move:20:46 + │ +20 │ let (f, u): (&u64, u64) = (&mut s.f, s.f); + │ -------- ^^^ Invalid immutable borrow at field 'f'. + │ │ + │ Field 'f' is still being mutably borrowed by this reference diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/reassign_parameter.exp b/external-crates/move/crates/move-compiler/tests/move_check/locals/reassign_parameter.exp deleted file mode 100644 index 472e0630995fe..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/locals/reassign_parameter.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/reassign_parameter.move:7:9 - │ -2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here -3 │ -4 │ public fun reassign_parameter(r: R) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' -5 │ let R { } = r; -6 │ r = R {}; - │ - The parameter 'r' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns -7 │ ╭ if (true) { -8 │ │ let R { } = r; -9 │ │ } - │ ╰─────────^ Invalid return - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/reassign_parameter.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/reassign_parameter.snap new file mode 100644 index 0000000000000..bc0ec849b5c40 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/reassign_parameter.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/reassign_parameter.move +--- +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/reassign_parameter.move:7:9 + │ +2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here +3 │ +4 │ public fun reassign_parameter(r: R) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' +5 │ let R { } = r; +6 │ r = R {}; + │ - The parameter 'r' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns +7 │ ╭ if (true) { +8 │ │ let R { } = r; +9 │ │ } + │ ╰─────────^ Invalid return diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_assignment_without_drop.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_assignment_without_drop.snap new file mode 100644 index 0000000000000..c8ae0112b319c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_assignment_without_drop.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/unused_assignment_without_drop.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_copyable.exp b/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_copyable.exp deleted file mode 100644 index a5f973143921b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_copyable.exp +++ /dev/null @@ -1,24 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/locals/unused_copyable.move:5:12 - │ -5 │ fun t0(i: u64, s: S) { - │ ^ Unused parameter 'i'. Consider removing or prefixing with an underscore: '_i' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/locals/unused_copyable.move:5:20 - │ -5 │ fun t0(i: u64, s: S) { - │ ^ Unused parameter 's'. Consider removing or prefixing with an underscore: '_s' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/locals/unused_copyable.move:9:13 - │ -9 │ let s = S{}; - │ ^ Unused local variable 's'. Consider removing or prefixing with an underscore: '_s' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_copyable.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_copyable.snap new file mode 100644 index 0000000000000..2ce3f0ee942c5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_copyable.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/unused_copyable.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/locals/unused_copyable.move:5:12 + │ +5 │ fun t0(i: u64, s: S) { + │ ^ Unused parameter 'i'. Consider removing or prefixing with an underscore: '_i' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/locals/unused_copyable.move:5:20 + │ +5 │ fun t0(i: u64, s: S) { + │ ^ Unused parameter 's'. Consider removing or prefixing with an underscore: '_s' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/locals/unused_copyable.move:9:13 + │ +9 │ let s = S{}; + │ ^ Unused local variable 's'. Consider removing or prefixing with an underscore: '_s' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_resource.exp b/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_resource.exp deleted file mode 100644 index 2da155eb672f0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_resource.exp +++ /dev/null @@ -1,150 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/locals/unused_resource.move:5:13 - │ -5 │ let r = R{}; - │ ^ Unused local variable 'r'. Consider removing or prefixing with an underscore: '_r' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/unused_resource.move:5:20 - │ -2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -5 │ let r = R{}; - │ - ---^ Invalid return - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'drop' - │ The local variable 'r' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/unused_resource.move:10:21 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -10 │ let _r = R{}; - │ -- ---^ Invalid return - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'drop' - │ The local variable '_r' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns - -warning[W09003]: unused assignment - ┌─ tests/move_check/locals/unused_resource.move:15:21 - │ -15 │ if (cond) { r = R{}; }; - │ ^ Unused assignment for variable 'r'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_r') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/unused_resource.move:15:31 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -15 │ if (cond) { r = R{}; }; - │ - --- ^ Invalid return - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'drop' - │ The local variable 'r' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns - -warning[W09003]: unused assignment - ┌─ tests/move_check/locals/unused_resource.move:20:29 - │ -20 │ if (cond) {} else { r = R{}; }; - │ ^ Unused assignment for variable 'r'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_r') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/unused_resource.move:20:39 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -20 │ if (cond) {} else { r = R{}; }; - │ - --- ^ Invalid return - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'drop' - │ The local variable 'r' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns - -warning[W09003]: unused assignment - ┌─ tests/move_check/locals/unused_resource.move:25:24 - │ -25 │ while (cond) { r = R{} }; - │ ^ Unused assignment for variable 'r'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_r') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/unused_resource.move:25:24 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -25 │ while (cond) { r = R{} }; - │ ^ --- The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ Invalid assignment to variable 'r' - │ The variable might contain a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/unused_resource.move:25:33 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -25 │ while (cond) { r = R{} }; - │ - --- ^ Invalid return - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'drop' - │ The local variable 'r' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns - -warning[W09002]: unused variable - ┌─ tests/move_check/locals/unused_resource.move:29:20 - │ -29 │ loop { let r = R{}; } - │ ^ Unused local variable 'r'. Consider removing or prefixing with an underscore: '_r' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/unused_resource.move:29:20 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -29 │ loop { let r = R{}; } - │ ^ --- The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ Invalid assignment to variable 'r' - │ The variable might contain a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/unused_resource.move:33:21 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -33 │ let _ = &R{}; - │ ---^ Invalid return - │ │ - │ The value is created but not used. The value does not have the 'drop' ability and must be consumed before the function returns - │ The type '0x8675309::M::R' does not have the ability 'drop' - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/unused_resource.move:36:22 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -36 │ fun t7(_x: R) { - │ -- - The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ The parameter '_x' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns - │ ╭──────────────────────^ -37 │ │ } - │ ╰─────^ Invalid return - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_resource.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_resource.snap new file mode 100644 index 0000000000000..e58cd1a4d533f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_resource.snap @@ -0,0 +1,157 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/unused_resource.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/locals/unused_resource.move:5:13 + │ +5 │ let r = R{}; + │ ^ Unused local variable 'r'. Consider removing or prefixing with an underscore: '_r' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/unused_resource.move:5:20 + │ +2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +5 │ let r = R{}; + │ - ---^ Invalid return + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'drop' + │ The local variable 'r' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/unused_resource.move:10:21 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +10 │ let _r = R{}; + │ -- ---^ Invalid return + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'drop' + │ The local variable '_r' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns + +warning[W09003]: unused assignment + ┌─ tests/move_check/locals/unused_resource.move:15:21 + │ +15 │ if (cond) { r = R{}; }; + │ ^ Unused assignment for variable 'r'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_r') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/unused_resource.move:15:31 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +15 │ if (cond) { r = R{}; }; + │ - --- ^ Invalid return + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'drop' + │ The local variable 'r' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns + +warning[W09003]: unused assignment + ┌─ tests/move_check/locals/unused_resource.move:20:29 + │ +20 │ if (cond) {} else { r = R{}; }; + │ ^ Unused assignment for variable 'r'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_r') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/unused_resource.move:20:39 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +20 │ if (cond) {} else { r = R{}; }; + │ - --- ^ Invalid return + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'drop' + │ The local variable 'r' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns + +warning[W09003]: unused assignment + ┌─ tests/move_check/locals/unused_resource.move:25:24 + │ +25 │ while (cond) { r = R{} }; + │ ^ Unused assignment for variable 'r'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_r') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/unused_resource.move:25:24 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +25 │ while (cond) { r = R{} }; + │ ^ --- The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ Invalid assignment to variable 'r' + │ The variable might contain a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/unused_resource.move:25:33 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +25 │ while (cond) { r = R{} }; + │ - --- ^ Invalid return + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'drop' + │ The local variable 'r' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns + +warning[W09002]: unused variable + ┌─ tests/move_check/locals/unused_resource.move:29:20 + │ +29 │ loop { let r = R{}; } + │ ^ Unused local variable 'r'. Consider removing or prefixing with an underscore: '_r' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/unused_resource.move:29:20 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +29 │ loop { let r = R{}; } + │ ^ --- The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ Invalid assignment to variable 'r' + │ The variable might contain a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/unused_resource.move:33:21 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +33 │ let _ = &R{}; + │ ---^ Invalid return + │ │ + │ The value is created but not used. The value does not have the 'drop' ability and must be consumed before the function returns + │ The type '0x8675309::M::R' does not have the ability 'drop' + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/unused_resource.move:36:22 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +36 │ fun t7(_x: R) { + │ -- - The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ The parameter '_x' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns + │ ╭──────────────────────^ +37 │ │ } + │ ╰─────^ Invalid return diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_resource_explicit_return.exp b/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_resource_explicit_return.exp deleted file mode 100644 index b0bb82d79c457..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_resource_explicit_return.exp +++ /dev/null @@ -1,88 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/locals/unused_resource_explicit_return.move:5:13 - │ -2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -5 │ let _ = R{}; - │ ^ --- The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ Cannot ignore values without the 'drop' ability. The value must be used - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/unused_resource_explicit_return.move:11:21 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -10 │ let r = R {}; - │ - ---- The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ The local variable 'r' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -11 │ if (cond) { return () }; - │ ^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/unused_resource_explicit_return.move:17:29 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -16 │ let r = R{}; - │ - --- The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ The local variable 'r' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -17 │ if (cond) {} else { return () }; - │ ^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/unused_resource_explicit_return.move:23:24 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -22 │ let r = R {}; - │ - ---- The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ The local variable 'r' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -23 │ while (cond) { return () }; - │ ^^^^^^^^^ Invalid return - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/locals/unused_resource_explicit_return.move:28:13 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -28 │ let _ = R{}; - │ ^ --- The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ Cannot ignore values without the 'drop' ability. The value must be used - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/unused_resource_explicit_return.move:34:9 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -33 │ let _ = &R{}; - │ --- - │ │ - │ The value is created but not used. The value does not have the 'drop' ability and must be consumed before the function returns - │ The type '0x8675309::M::R' does not have the ability 'drop' -34 │ return () - │ ^^^^^^^^^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/locals/unused_resource_explicit_return.move:38:9 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -37 │ fun t6(_x: R) { - │ -- - The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ The parameter '_x' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -38 │ return () - │ ^^^^^^^^^ Invalid return - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_resource_explicit_return.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_resource_explicit_return.snap new file mode 100644 index 0000000000000..051659a88745a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/unused_resource_explicit_return.snap @@ -0,0 +1,95 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/unused_resource_explicit_return.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/locals/unused_resource_explicit_return.move:5:13 + │ +2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +5 │ let _ = R{}; + │ ^ --- The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ Cannot ignore values without the 'drop' ability. The value must be used + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/unused_resource_explicit_return.move:11:21 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +10 │ let r = R {}; + │ - ---- The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ The local variable 'r' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +11 │ if (cond) { return () }; + │ ^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/unused_resource_explicit_return.move:17:29 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +16 │ let r = R{}; + │ - --- The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ The local variable 'r' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +17 │ if (cond) {} else { return () }; + │ ^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/unused_resource_explicit_return.move:23:24 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +22 │ let r = R {}; + │ - ---- The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ The local variable 'r' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +23 │ while (cond) { return () }; + │ ^^^^^^^^^ Invalid return + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/locals/unused_resource_explicit_return.move:28:13 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +28 │ let _ = R{}; + │ ^ --- The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ Cannot ignore values without the 'drop' ability. The value must be used + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/unused_resource_explicit_return.move:34:9 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +33 │ let _ = &R{}; + │ --- + │ │ + │ The value is created but not used. The value does not have the 'drop' ability and must be consumed before the function returns + │ The type '0x8675309::M::R' does not have the ability 'drop' +34 │ return () + │ ^^^^^^^^^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/locals/unused_resource_explicit_return.move:38:9 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +37 │ fun t6(_x: R) { + │ -- - The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ The parameter '_x' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +38 │ return () + │ ^^^^^^^^^ Invalid return diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_if.exp b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_if.exp deleted file mode 100644 index 7b0e8c7f866a2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_if.exp +++ /dev/null @@ -1,33 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_if.move:5:17 - │ -4 │ if (cond) { _ = move x }; - │ ------ - │ │ - │ The value of 'x' might have been previously moved here. - │ Suggestion: use 'copy x' to avoid the move. -5 │ let _ = move x + 1; - │ ^^^^^^ Invalid usage of previously moved variable 'x'. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_if.move:11:17 - │ -10 │ if (cond) { _ = move x }; - │ ------ - │ │ - │ The value of 'x' might have been previously moved here. - │ Suggestion: use 'copy x' to avoid the move. -11 │ let _ = x + 1; - │ ^ Invalid usage of previously moved variable 'x'. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_if.move:17:17 - │ -16 │ if (cond) { _ = move x }; - │ ------ - │ │ - │ The value of 'x' might have been previously moved here. - │ Suggestion: use 'copy x' to avoid the move. -17 │ let _ = &x; - │ ^^ Invalid usage of previously moved variable 'x'. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_if.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_if.snap new file mode 100644 index 0000000000000..0ba51cf675cc1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_if.snap @@ -0,0 +1,40 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/use_after_move_if.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_if.move:5:17 + │ +4 │ if (cond) { _ = move x }; + │ ------ + │ │ + │ The value of 'x' might have been previously moved here. + │ Suggestion: use 'copy x' to avoid the move. +5 │ let _ = move x + 1; + │ ^^^^^^ Invalid usage of previously moved variable 'x'. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_if.move:11:17 + │ +10 │ if (cond) { _ = move x }; + │ ------ + │ │ + │ The value of 'x' might have been previously moved here. + │ Suggestion: use 'copy x' to avoid the move. +11 │ let _ = x + 1; + │ ^ Invalid usage of previously moved variable 'x'. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_if.move:17:17 + │ +16 │ if (cond) { _ = move x }; + │ ------ + │ │ + │ The value of 'x' might have been previously moved here. + │ Suggestion: use 'copy x' to avoid the move. +17 │ let _ = &x; + │ ^^ Invalid usage of previously moved variable 'x'. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_if_else.exp b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_if_else.exp deleted file mode 100644 index f6dd5b611bd71..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_if_else.exp +++ /dev/null @@ -1,66 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_if_else.move:5:17 - │ -4 │ if (cond) { _ = move x } else { _ = move x }; - │ ------ - │ │ - │ The value of 'x' was previously moved here. - │ Suggestion: use 'copy x' to avoid the move. -5 │ let _ = move x + 1; - │ ^^^^^^ Invalid usage of previously moved variable 'x'. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_if_else.move:11:17 - │ -10 │ if (cond) { _ = move x } else { _ = x }; - │ ------ - │ │ - │ The value of 'x' might have been previously moved here. - │ Suggestion: use 'copy x' to avoid the move. -11 │ let _ = move x + 1; - │ ^^^^^^ Invalid usage of previously moved variable 'x'. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_if_else.move:17:17 - │ -16 │ if (cond) { _ = move x } else { _ = move x }; - │ ------ - │ │ - │ The value of 'x' was previously moved here. - │ Suggestion: use 'copy x' to avoid the move. -17 │ let _ = x + 1; - │ ^ Invalid usage of previously moved variable 'x'. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_if_else.move:24:17 - │ -23 │ if (cond) { _ = move x } else { _ = x }; - │ ------ - │ │ - │ The value of 'x' might have been previously moved here. - │ Suggestion: use 'copy x' to avoid the move. -24 │ let _ = x + 1; - │ ^ Invalid usage of previously moved variable 'x'. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_if_else.move:30:17 - │ -29 │ if (cond) { _ = move x } else { _ = move x }; - │ ------ - │ │ - │ The value of 'x' was previously moved here. - │ Suggestion: use 'copy x' to avoid the move. -30 │ let _ = &x; - │ ^^ Invalid usage of previously moved variable 'x'. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_if_else.move:36:17 - │ -35 │ if (cond) { _ = move x } else { _ = x }; - │ ------ - │ │ - │ The value of 'x' might have been previously moved here. - │ Suggestion: use 'copy x' to avoid the move. -36 │ let _ = &x; - │ ^^ Invalid usage of previously moved variable 'x'. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_if_else.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_if_else.snap new file mode 100644 index 0000000000000..5604be9ddf5f3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_if_else.snap @@ -0,0 +1,73 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/use_after_move_if_else.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_if_else.move:5:17 + │ +4 │ if (cond) { _ = move x } else { _ = move x }; + │ ------ + │ │ + │ The value of 'x' was previously moved here. + │ Suggestion: use 'copy x' to avoid the move. +5 │ let _ = move x + 1; + │ ^^^^^^ Invalid usage of previously moved variable 'x'. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_if_else.move:11:17 + │ +10 │ if (cond) { _ = move x } else { _ = x }; + │ ------ + │ │ + │ The value of 'x' might have been previously moved here. + │ Suggestion: use 'copy x' to avoid the move. +11 │ let _ = move x + 1; + │ ^^^^^^ Invalid usage of previously moved variable 'x'. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_if_else.move:17:17 + │ +16 │ if (cond) { _ = move x } else { _ = move x }; + │ ------ + │ │ + │ The value of 'x' was previously moved here. + │ Suggestion: use 'copy x' to avoid the move. +17 │ let _ = x + 1; + │ ^ Invalid usage of previously moved variable 'x'. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_if_else.move:24:17 + │ +23 │ if (cond) { _ = move x } else { _ = x }; + │ ------ + │ │ + │ The value of 'x' might have been previously moved here. + │ Suggestion: use 'copy x' to avoid the move. +24 │ let _ = x + 1; + │ ^ Invalid usage of previously moved variable 'x'. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_if_else.move:30:17 + │ +29 │ if (cond) { _ = move x } else { _ = move x }; + │ ------ + │ │ + │ The value of 'x' was previously moved here. + │ Suggestion: use 'copy x' to avoid the move. +30 │ let _ = &x; + │ ^^ Invalid usage of previously moved variable 'x'. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_if_else.move:36:17 + │ +35 │ if (cond) { _ = move x } else { _ = x }; + │ ------ + │ │ + │ The value of 'x' might have been previously moved here. + │ Suggestion: use 'copy x' to avoid the move. +36 │ let _ = &x; + │ ^^ Invalid usage of previously moved variable 'x'. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_loop.exp b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_loop.exp deleted file mode 100644 index 7f21aa6431283..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_loop.exp +++ /dev/null @@ -1,80 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_loop.move:4:20 - │ -4 │ loop { _ = move x } - │ ^^^^^^ - │ │ - │ Invalid usage of previously moved variable 'x'. - │ Suggestion: use 'copy x' to avoid the move. - │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_loop.move:9:37 - │ -9 │ loop { if (cond) break; _ = move x } - │ ^^^^^^ - │ │ - │ Invalid usage of previously moved variable 'x'. - │ Suggestion: use 'copy x' to avoid the move. - │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_loop.move:14:24 - │ -14 │ loop { let y = x; _ = move x; y; } - │ ^ ------ - │ │ │ - │ │ The value of 'x' might have been previously moved here. - │ │ Suggestion: use 'copy x' to avoid the move. - │ Invalid usage of previously moved variable 'x'. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_loop.move:14:31 - │ -14 │ loop { let y = x; _ = move x; y; } - │ ^^^^^^ - │ │ - │ Invalid usage of previously moved variable 'x'. - │ Suggestion: use 'copy x' to avoid the move. - │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_loop.move:19:24 - │ -19 │ loop { let y = x; if (cond) continue; _ = move x; y; } - │ ^ ------ - │ │ │ - │ │ The value of 'x' might have been previously moved here. - │ │ Suggestion: use 'copy x' to avoid the move. - │ Invalid usage of previously moved variable 'x'. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_loop.move:19:51 - │ -19 │ loop { let y = x; if (cond) continue; _ = move x; y; } - │ ^^^^^^ - │ │ - │ Invalid usage of previously moved variable 'x'. - │ Suggestion: use 'copy x' to avoid the move. - │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_loop.move:24:24 - │ -24 │ loop { let y = &x; _ = move y; _ = move x } - │ ^^ ------ - │ │ │ - │ │ The value of 'x' might have been previously moved here. - │ │ Suggestion: use 'copy x' to avoid the move. - │ Invalid usage of previously moved variable 'x'. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_loop.move:24:44 - │ -24 │ loop { let y = &x; _ = move y; _ = move x } - │ ^^^^^^ - │ │ - │ Invalid usage of previously moved variable 'x'. - │ Suggestion: use 'copy x' to avoid the move. - │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_loop.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_loop.snap new file mode 100644 index 0000000000000..595aa72819d86 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_loop.snap @@ -0,0 +1,87 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/use_after_move_loop.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_loop.move:4:20 + │ +4 │ loop { _ = move x } + │ ^^^^^^ + │ │ + │ Invalid usage of previously moved variable 'x'. + │ Suggestion: use 'copy x' to avoid the move. + │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_loop.move:9:37 + │ +9 │ loop { if (cond) break; _ = move x } + │ ^^^^^^ + │ │ + │ Invalid usage of previously moved variable 'x'. + │ Suggestion: use 'copy x' to avoid the move. + │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_loop.move:14:24 + │ +14 │ loop { let y = x; _ = move x; y; } + │ ^ ------ + │ │ │ + │ │ The value of 'x' might have been previously moved here. + │ │ Suggestion: use 'copy x' to avoid the move. + │ Invalid usage of previously moved variable 'x'. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_loop.move:14:31 + │ +14 │ loop { let y = x; _ = move x; y; } + │ ^^^^^^ + │ │ + │ Invalid usage of previously moved variable 'x'. + │ Suggestion: use 'copy x' to avoid the move. + │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_loop.move:19:24 + │ +19 │ loop { let y = x; if (cond) continue; _ = move x; y; } + │ ^ ------ + │ │ │ + │ │ The value of 'x' might have been previously moved here. + │ │ Suggestion: use 'copy x' to avoid the move. + │ Invalid usage of previously moved variable 'x'. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_loop.move:19:51 + │ +19 │ loop { let y = x; if (cond) continue; _ = move x; y; } + │ ^^^^^^ + │ │ + │ Invalid usage of previously moved variable 'x'. + │ Suggestion: use 'copy x' to avoid the move. + │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_loop.move:24:24 + │ +24 │ loop { let y = &x; _ = move y; _ = move x } + │ ^^ ------ + │ │ │ + │ │ The value of 'x' might have been previously moved here. + │ │ Suggestion: use 'copy x' to avoid the move. + │ Invalid usage of previously moved variable 'x'. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_loop.move:24:44 + │ +24 │ loop { let y = &x; _ = move y; _ = move x } + │ ^^^^^^ + │ │ + │ Invalid usage of previously moved variable 'x'. + │ Suggestion: use 'copy x' to avoid the move. + │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_simple.exp b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_simple.exp deleted file mode 100644 index 53d07b25f2871..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_simple.exp +++ /dev/null @@ -1,33 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_simple.move:7:17 - │ -6 │ move x; - │ ------ - │ │ - │ The value of 'x' was previously moved here. - │ Suggestion: use 'copy x' to avoid the move. -7 │ let _ = move x + 1; - │ ^^^^^^ Invalid usage of previously moved variable 'x'. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_simple.move:17:17 - │ -16 │ move x; - │ ------ - │ │ - │ The value of 'x' was previously moved here. - │ Suggestion: use 'copy x' to avoid the move. -17 │ let _ = x + 1; - │ ^ Invalid usage of previously moved variable 'x'. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_simple.move:27:17 - │ -26 │ move x; - │ ------ - │ │ - │ The value of 'x' was previously moved here. - │ Suggestion: use 'copy x' to avoid the move. -27 │ let _ = &x; - │ ^^ Invalid usage of previously moved variable 'x'. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_simple.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_simple.snap new file mode 100644 index 0000000000000..dcc86571405d6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_simple.snap @@ -0,0 +1,40 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/use_after_move_simple.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_simple.move:7:17 + │ +6 │ move x; + │ ------ + │ │ + │ The value of 'x' was previously moved here. + │ Suggestion: use 'copy x' to avoid the move. +7 │ let _ = move x + 1; + │ ^^^^^^ Invalid usage of previously moved variable 'x'. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_simple.move:17:17 + │ +16 │ move x; + │ ------ + │ │ + │ The value of 'x' was previously moved here. + │ Suggestion: use 'copy x' to avoid the move. +17 │ let _ = x + 1; + │ ^ Invalid usage of previously moved variable 'x'. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_simple.move:27:17 + │ +26 │ move x; + │ ------ + │ │ + │ The value of 'x' was previously moved here. + │ Suggestion: use 'copy x' to avoid the move. +27 │ let _ = &x; + │ ^^ Invalid usage of previously moved variable 'x'. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_while.exp b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_while.exp deleted file mode 100644 index f0c950d97b467..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_while.exp +++ /dev/null @@ -1,80 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_while.move:4:28 - │ -4 │ while (cond) { _ = move x }; - │ ^^^^^^ - │ │ - │ Invalid usage of previously moved variable 'x'. - │ Suggestion: use 'copy x' to avoid the move. - │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_while.move:9:45 - │ -9 │ while (cond) { if (cond) break; _ = move x }; - │ ^^^^^^ - │ │ - │ Invalid usage of previously moved variable 'x'. - │ Suggestion: use 'copy x' to avoid the move. - │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_while.move:14:32 - │ -14 │ while (cond) { let y = x; _ = move x; y; }; - │ ^ ------ - │ │ │ - │ │ The value of 'x' might have been previously moved here. - │ │ Suggestion: use 'copy x' to avoid the move. - │ Invalid usage of previously moved variable 'x'. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_while.move:14:39 - │ -14 │ while (cond) { let y = x; _ = move x; y; }; - │ ^^^^^^ - │ │ - │ Invalid usage of previously moved variable 'x'. - │ Suggestion: use 'copy x' to avoid the move. - │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_while.move:19:32 - │ -19 │ while (cond) { let y = x; if (cond) continue; _ = move x; y; }; - │ ^ ------ - │ │ │ - │ │ The value of 'x' might have been previously moved here. - │ │ Suggestion: use 'copy x' to avoid the move. - │ Invalid usage of previously moved variable 'x'. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_while.move:19:59 - │ -19 │ while (cond) { let y = x; if (cond) continue; _ = move x; y; }; - │ ^^^^^^ - │ │ - │ Invalid usage of previously moved variable 'x'. - │ Suggestion: use 'copy x' to avoid the move. - │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_while.move:24:32 - │ -24 │ while (cond) { let y = &x; _ = move y; _ = move x }; - │ ^^ ------ - │ │ │ - │ │ The value of 'x' might have been previously moved here. - │ │ Suggestion: use 'copy x' to avoid the move. - │ Invalid usage of previously moved variable 'x'. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_after_move_while.move:24:52 - │ -24 │ while (cond) { let y = &x; _ = move y; _ = move x }; - │ ^^^^^^ - │ │ - │ Invalid usage of previously moved variable 'x'. - │ Suggestion: use 'copy x' to avoid the move. - │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_while.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_while.snap new file mode 100644 index 0000000000000..3cd39e2c31cc8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_after_move_while.snap @@ -0,0 +1,87 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/use_after_move_while.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_while.move:4:28 + │ +4 │ while (cond) { _ = move x }; + │ ^^^^^^ + │ │ + │ Invalid usage of previously moved variable 'x'. + │ Suggestion: use 'copy x' to avoid the move. + │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_while.move:9:45 + │ +9 │ while (cond) { if (cond) break; _ = move x }; + │ ^^^^^^ + │ │ + │ Invalid usage of previously moved variable 'x'. + │ Suggestion: use 'copy x' to avoid the move. + │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_while.move:14:32 + │ +14 │ while (cond) { let y = x; _ = move x; y; }; + │ ^ ------ + │ │ │ + │ │ The value of 'x' might have been previously moved here. + │ │ Suggestion: use 'copy x' to avoid the move. + │ Invalid usage of previously moved variable 'x'. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_while.move:14:39 + │ +14 │ while (cond) { let y = x; _ = move x; y; }; + │ ^^^^^^ + │ │ + │ Invalid usage of previously moved variable 'x'. + │ Suggestion: use 'copy x' to avoid the move. + │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_while.move:19:32 + │ +19 │ while (cond) { let y = x; if (cond) continue; _ = move x; y; }; + │ ^ ------ + │ │ │ + │ │ The value of 'x' might have been previously moved here. + │ │ Suggestion: use 'copy x' to avoid the move. + │ Invalid usage of previously moved variable 'x'. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_while.move:19:59 + │ +19 │ while (cond) { let y = x; if (cond) continue; _ = move x; y; }; + │ ^^^^^^ + │ │ + │ Invalid usage of previously moved variable 'x'. + │ Suggestion: use 'copy x' to avoid the move. + │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_while.move:24:32 + │ +24 │ while (cond) { let y = &x; _ = move y; _ = move x }; + │ ^^ ------ + │ │ │ + │ │ The value of 'x' might have been previously moved here. + │ │ Suggestion: use 'copy x' to avoid the move. + │ Invalid usage of previously moved variable 'x'. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_after_move_while.move:24:52 + │ +24 │ while (cond) { let y = &x; _ = move y; _ = move x }; + │ ^^^^^^ + │ │ + │ Invalid usage of previously moved variable 'x'. + │ Suggestion: use 'copy x' to avoid the move. + │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_if.exp b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_if.exp deleted file mode 100644 index d43ffe9d665d4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_if.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_if.move:5:17 - │ -3 │ let x: u64; - │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. -4 │ if (cond) { x = 0 }; -5 │ let _ = move x + 1; - │ ^^^^^^ Invalid usage of unassigned variable 'x' - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_if.move:11:17 - │ - 9 │ let x: u64; - │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. -10 │ if (cond) { x = 0 }; -11 │ let _ = x + 1; - │ ^ Invalid usage of unassigned variable 'x' - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_if.move:17:17 - │ -15 │ let x: u64; - │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. -16 │ if (cond) { x = 0 }; -17 │ let _ = &x; - │ ^^ Invalid usage of unassigned variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_if.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_if.snap new file mode 100644 index 0000000000000..43a41b2b48e1f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_if.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/use_before_assign_if.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_if.move:5:17 + │ +3 │ let x: u64; + │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. +4 │ if (cond) { x = 0 }; +5 │ let _ = move x + 1; + │ ^^^^^^ Invalid usage of unassigned variable 'x' + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_if.move:11:17 + │ + 9 │ let x: u64; + │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. +10 │ if (cond) { x = 0 }; +11 │ let _ = x + 1; + │ ^ Invalid usage of unassigned variable 'x' + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_if.move:17:17 + │ +15 │ let x: u64; + │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. +16 │ if (cond) { x = 0 }; +17 │ let _ = &x; + │ ^^ Invalid usage of unassigned variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_if_else.exp b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_if_else.exp deleted file mode 100644 index 03c0d416d19ef..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_if_else.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_if_else.move:5:17 - │ -3 │ let x: u64; - │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. -4 │ if (cond) { } else { x = 0 }; -5 │ let _ = move x + 1; - │ ^^^^^^ Invalid usage of unassigned variable 'x' - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_if_else.move:11:17 - │ - 9 │ let x: u64; - │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. -10 │ if (cond) { } else { x = 0 }; -11 │ let _ = move x + 1; - │ ^^^^^^ Invalid usage of unassigned variable 'x' - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_if_else.move:17:17 - │ -15 │ let x: u64; - │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. -16 │ if (cond) { } else { x = 0 }; -17 │ let _ = move x + 1; - │ ^^^^^^ Invalid usage of unassigned variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_if_else.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_if_else.snap new file mode 100644 index 0000000000000..4eb18da98f59a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_if_else.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/use_before_assign_if_else.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_if_else.move:5:17 + │ +3 │ let x: u64; + │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. +4 │ if (cond) { } else { x = 0 }; +5 │ let _ = move x + 1; + │ ^^^^^^ Invalid usage of unassigned variable 'x' + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_if_else.move:11:17 + │ + 9 │ let x: u64; + │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. +10 │ if (cond) { } else { x = 0 }; +11 │ let _ = move x + 1; + │ ^^^^^^ Invalid usage of unassigned variable 'x' + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_if_else.move:17:17 + │ +15 │ let x: u64; + │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. +16 │ if (cond) { } else { x = 0 }; +17 │ let _ = move x + 1; + │ ^^^^^^ Invalid usage of unassigned variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_loop.exp b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_loop.exp deleted file mode 100644 index 50f347b0159db..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_loop.exp +++ /dev/null @@ -1,41 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_loop.move:4:24 - │ -3 │ let x: u64; - │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. -4 │ loop { let y = move x + 1; x = 0; y; } - │ ^^^^^^ Invalid usage of unassigned variable 'x' - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_loop.move:9:24 - │ -8 │ let x: u64; - │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. -9 │ loop { let y = x + 1; if (cond) { continue }; x = 0; y; } - │ ^ Invalid usage of unassigned variable 'x' - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_loop.move:14:24 - │ -13 │ let x: u64; - │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. -14 │ loop { let y = &x; _ = move y; x = 0 } - │ ^^ Invalid usage of unassigned variable 'x' - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_loop.move:19:24 - │ -18 │ let x: u64; - │ - The variable 'x' does not have a value. The variable must be assigned a value before being used. -19 │ loop { let y = &x; _ = move y; if (cond) { x = 0 }; break }; - │ ^^ Invalid usage of unassigned variable 'x' - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_loop.move:20:9 - │ -18 │ let x: u64; - │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. -19 │ loop { let y = &x; _ = move y; if (cond) { x = 0 }; break }; -20 │ x; - │ ^ Invalid usage of unassigned variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_loop.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_loop.snap new file mode 100644 index 0000000000000..33a71b793a081 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_loop.snap @@ -0,0 +1,48 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/use_before_assign_loop.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_loop.move:4:24 + │ +3 │ let x: u64; + │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. +4 │ loop { let y = move x + 1; x = 0; y; } + │ ^^^^^^ Invalid usage of unassigned variable 'x' + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_loop.move:9:24 + │ +8 │ let x: u64; + │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. +9 │ loop { let y = x + 1; if (cond) { continue }; x = 0; y; } + │ ^ Invalid usage of unassigned variable 'x' + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_loop.move:14:24 + │ +13 │ let x: u64; + │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. +14 │ loop { let y = &x; _ = move y; x = 0 } + │ ^^ Invalid usage of unassigned variable 'x' + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_loop.move:19:24 + │ +18 │ let x: u64; + │ - The variable 'x' does not have a value. The variable must be assigned a value before being used. +19 │ loop { let y = &x; _ = move y; if (cond) { x = 0 }; break }; + │ ^^ Invalid usage of unassigned variable 'x' + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_loop.move:20:9 + │ +18 │ let x: u64; + │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. +19 │ loop { let y = &x; _ = move y; if (cond) { x = 0 }; break }; +20 │ x; + │ ^ Invalid usage of unassigned variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_simple.exp b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_simple.exp deleted file mode 100644 index 9fa8f9b7ac5bf..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_simple.exp +++ /dev/null @@ -1,48 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_simple.move:6:17 - │ -5 │ let x: u64; - │ - The variable 'x' does not have a value. The variable must be assigned a value before being used. -6 │ let _ = move x + 1; - │ ^^^^^^ Invalid usage of unassigned variable 'x' - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_simple.move:9:19 - │ -8 │ let s: S; - │ - The variable 's' does not have a value. The variable must be assigned a value before being used. -9 │ let _s2 = s; - │ ^ Invalid usage of unassigned variable 's' - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_simple.move:14:17 - │ -13 │ let x: u64; - │ - The variable 'x' does not have a value. The variable must be assigned a value before being used. -14 │ let _ = x + 1; - │ ^ Invalid usage of unassigned variable 'x' - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_simple.move:17:19 - │ -16 │ let s: S; - │ - The variable 's' does not have a value. The variable must be assigned a value before being used. -17 │ let _s3 = copy s; - │ ^^^^^^ Invalid usage of unassigned variable 's' - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_simple.move:22:17 - │ -21 │ let x: u64; - │ - The variable 'x' does not have a value. The variable must be assigned a value before being used. -22 │ let _ = &x; - │ ^^ Invalid usage of unassigned variable 'x' - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_simple.move:25:19 - │ -24 │ let s: S; - │ - The variable 's' does not have a value. The variable must be assigned a value before being used. -25 │ let _s2 = &s; - │ ^^ Invalid usage of unassigned variable 's' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_simple.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_simple.snap new file mode 100644 index 0000000000000..8a39227fded00 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_simple.snap @@ -0,0 +1,55 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/use_before_assign_simple.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_simple.move:6:17 + │ +5 │ let x: u64; + │ - The variable 'x' does not have a value. The variable must be assigned a value before being used. +6 │ let _ = move x + 1; + │ ^^^^^^ Invalid usage of unassigned variable 'x' + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_simple.move:9:19 + │ +8 │ let s: S; + │ - The variable 's' does not have a value. The variable must be assigned a value before being used. +9 │ let _s2 = s; + │ ^ Invalid usage of unassigned variable 's' + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_simple.move:14:17 + │ +13 │ let x: u64; + │ - The variable 'x' does not have a value. The variable must be assigned a value before being used. +14 │ let _ = x + 1; + │ ^ Invalid usage of unassigned variable 'x' + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_simple.move:17:19 + │ +16 │ let s: S; + │ - The variable 's' does not have a value. The variable must be assigned a value before being used. +17 │ let _s3 = copy s; + │ ^^^^^^ Invalid usage of unassigned variable 's' + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_simple.move:22:17 + │ +21 │ let x: u64; + │ - The variable 'x' does not have a value. The variable must be assigned a value before being used. +22 │ let _ = &x; + │ ^^ Invalid usage of unassigned variable 'x' + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_simple.move:25:19 + │ +24 │ let s: S; + │ - The variable 's' does not have a value. The variable must be assigned a value before being used. +25 │ let _s2 = &s; + │ ^^ Invalid usage of unassigned variable 's' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_while.exp b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_while.exp deleted file mode 100644 index e2cc76a3784d2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_while.exp +++ /dev/null @@ -1,40 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_while.move:4:32 - │ -3 │ let x: u64; - │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. -4 │ while (cond) { let y = move x + 1; x = 0; y; } - │ ^^^^^^ Invalid usage of unassigned variable 'x' - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_while.move:9:32 - │ -8 │ let x: u64; - │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. -9 │ while (cond) { let y = move x + 1; if (cond) { continue }; x = 0; y; } - │ ^^^^^^ Invalid usage of unassigned variable 'x' - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_while.move:14:32 - │ -13 │ let x: u64; - │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. -14 │ while (cond) { let y = &x; _ = move y; x = 0 } - │ ^^ Invalid usage of unassigned variable 'x' - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/locals/use_before_assign_while.move:19:32 - │ -18 │ let x: u64; - │ - The variable 'x' does not have a value. The variable must be assigned a value before being used. -19 │ while (cond) { let y = &x; _ = move y; if (cond) { x = 0 }; break } - │ ^^ Invalid usage of unassigned variable 'x' - -warning[W09003]: unused assignment - ┌─ tests/move_check/locals/use_before_assign_while.move:19:60 - │ -19 │ while (cond) { let y = &x; _ = move y; if (cond) { x = 0 }; break } - │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_while.snap b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_while.snap new file mode 100644 index 0000000000000..fde69219bec32 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/locals/use_before_assign_while.snap @@ -0,0 +1,47 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/locals/use_before_assign_while.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_while.move:4:32 + │ +3 │ let x: u64; + │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. +4 │ while (cond) { let y = move x + 1; x = 0; y; } + │ ^^^^^^ Invalid usage of unassigned variable 'x' + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_while.move:9:32 + │ +8 │ let x: u64; + │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. +9 │ while (cond) { let y = move x + 1; if (cond) { continue }; x = 0; y; } + │ ^^^^^^ Invalid usage of unassigned variable 'x' + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_while.move:14:32 + │ +13 │ let x: u64; + │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. +14 │ while (cond) { let y = &x; _ = move y; x = 0 } + │ ^^ Invalid usage of unassigned variable 'x' + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/locals/use_before_assign_while.move:19:32 + │ +18 │ let x: u64; + │ - The variable 'x' does not have a value. The variable must be assigned a value before being used. +19 │ while (cond) { let y = &x; _ = move y; if (cond) { x = 0 }; break } + │ ^^ Invalid usage of unassigned variable 'x' + +warning[W09003]: unused assignment + ┌─ tests/move_check/locals/use_before_assign_while.move:19:60 + │ +19 │ while (cond) { let y = &x; _ = move y; if (cond) { x = 0 }; break } + │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/assert_one_arg.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/assert_one_arg.exp deleted file mode 100644 index ed3a328682e07..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/assert_one_arg.exp +++ /dev/null @@ -1,30 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/assert_one_arg.move:3:9 - │ -3 │ assert!(false); - │ ^^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/assert_one_arg.move:4:9 - │ -4 │ assert!(0 != 1); - │ ^^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/assert_one_arg.move:5:9 - │ -5 │ assert!(x != y); - │ ^^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E03009]: unbound variable - ┌─ tests/move_check/naming/assert_one_arg.move:5:22 - │ -5 │ assert!(x != y); - │ ^ Unbound variable 'y' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/assert_one_arg.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/assert_one_arg.snap new file mode 100644 index 0000000000000..1758a5d6272f8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/assert_one_arg.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/assert_one_arg.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/assert_one_arg.move:3:9 + │ +3 │ assert!(false); + │ ^^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/assert_one_arg.move:4:9 + │ +4 │ assert!(0 != 1); + │ ^^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/assert_one_arg.move:5:9 + │ +5 │ assert!(x != y); + │ ^^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E03009]: unbound variable + ┌─ tests/move_check/naming/assert_one_arg.move:5:22 + │ +5 │ assert!(x != y); + │ ^ Unbound variable 'y' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/duplicate_type_parameter_function.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/duplicate_type_parameter_function.exp deleted file mode 100644 index 8deabf5819ccd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/duplicate_type_parameter_function.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/naming/duplicate_type_parameter_function.move:2:16 - │ -2 │ fun foo() {} - │ - ^ Duplicate type parameter declared with name 'T' - │ │ - │ Type parameter previously defined here - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/naming/duplicate_type_parameter_function.move:3:23 - │ -3 │ fun foo2() {} - │ - ^ Duplicate type parameter declared with name 'T' - │ │ - │ Type parameter previously defined here - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/naming/duplicate_type_parameter_function.move:3:31 - │ -3 │ fun foo2() {} - │ - ^ Duplicate type parameter declared with name 'T' - │ │ - │ Type parameter previously defined here - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/duplicate_type_parameter_function.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/duplicate_type_parameter_function.snap new file mode 100644 index 0000000000000..3ce2c947ee0e2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/duplicate_type_parameter_function.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/duplicate_type_parameter_function.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/naming/duplicate_type_parameter_function.move:2:16 + │ +2 │ fun foo() {} + │ - ^ Duplicate type parameter declared with name 'T' + │ │ + │ Type parameter previously defined here + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/naming/duplicate_type_parameter_function.move:3:23 + │ +3 │ fun foo2() {} + │ - ^ Duplicate type parameter declared with name 'T' + │ │ + │ Type parameter previously defined here + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/naming/duplicate_type_parameter_function.move:3:31 + │ +3 │ fun foo2() {} + │ - ^ Duplicate type parameter declared with name 'T' + │ │ + │ Type parameter previously defined here diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/duplicate_type_parameter_struct.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/duplicate_type_parameter_struct.exp deleted file mode 100644 index 699caeb56ebe6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/duplicate_type_parameter_struct.exp +++ /dev/null @@ -1,96 +0,0 @@ -warning[W09006]: unused struct type parameter - ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:2:14 - │ -2 │ struct S { f: T } - │ ^ Unused type parameter 'T'. Consider declaring it as phantom - │ - = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:2:17 - │ -2 │ struct S { f: T } - │ - ^ Duplicate type parameter declared with name 'T' - │ │ - │ Type parameter previously defined here - -warning[W09006]: unused struct type parameter - ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:3:15 - │ -3 │ struct S2 { f: T } - │ ^ Unused type parameter 'T'. Consider declaring it as phantom - │ - = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09006]: unused struct type parameter - ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:3:24 - │ -3 │ struct S2 { f: T } - │ ^ Unused type parameter 'T'. Consider declaring it as phantom - │ - = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:3:24 - │ -3 │ struct S2 { f: T } - │ - ^ Duplicate type parameter declared with name 'T' - │ │ - │ Type parameter previously defined here - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:3:32 - │ -3 │ struct S2 { f: T } - │ - ^ Duplicate type parameter declared with name 'T' - │ │ - │ Type parameter previously defined here - -warning[W09006]: unused struct type parameter - ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:4:14 - │ -4 │ struct R { f: T } - │ ^ Unused type parameter 'T'. Consider declaring it as phantom - │ - = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:4:17 - │ -4 │ struct R { f: T } - │ - ^ Duplicate type parameter declared with name 'T' - │ │ - │ Type parameter previously defined here - -warning[W09006]: unused struct type parameter - ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:5:15 - │ -5 │ struct R2 { f: T } - │ ^ Unused type parameter 'T'. Consider declaring it as phantom - │ - = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09006]: unused struct type parameter - ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:5:24 - │ -5 │ struct R2 { f: T } - │ ^ Unused type parameter 'T'. Consider declaring it as phantom - │ - = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:5:24 - │ -5 │ struct R2 { f: T } - │ - ^ Duplicate type parameter declared with name 'T' - │ │ - │ Type parameter previously defined here - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:5:32 - │ -5 │ struct R2 { f: T } - │ - ^ Duplicate type parameter declared with name 'T' - │ │ - │ Type parameter previously defined here - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/duplicate_type_parameter_struct.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/duplicate_type_parameter_struct.snap new file mode 100644 index 0000000000000..1f2ba6b279df7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/duplicate_type_parameter_struct.snap @@ -0,0 +1,103 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/duplicate_type_parameter_struct.move +--- +warning[W09006]: unused struct type parameter + ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:2:14 + │ +2 │ struct S { f: T } + │ ^ Unused type parameter 'T'. Consider declaring it as phantom + │ + = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:2:17 + │ +2 │ struct S { f: T } + │ - ^ Duplicate type parameter declared with name 'T' + │ │ + │ Type parameter previously defined here + +warning[W09006]: unused struct type parameter + ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:3:15 + │ +3 │ struct S2 { f: T } + │ ^ Unused type parameter 'T'. Consider declaring it as phantom + │ + = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09006]: unused struct type parameter + ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:3:24 + │ +3 │ struct S2 { f: T } + │ ^ Unused type parameter 'T'. Consider declaring it as phantom + │ + = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:3:24 + │ +3 │ struct S2 { f: T } + │ - ^ Duplicate type parameter declared with name 'T' + │ │ + │ Type parameter previously defined here + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:3:32 + │ +3 │ struct S2 { f: T } + │ - ^ Duplicate type parameter declared with name 'T' + │ │ + │ Type parameter previously defined here + +warning[W09006]: unused struct type parameter + ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:4:14 + │ +4 │ struct R { f: T } + │ ^ Unused type parameter 'T'. Consider declaring it as phantom + │ + = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:4:17 + │ +4 │ struct R { f: T } + │ - ^ Duplicate type parameter declared with name 'T' + │ │ + │ Type parameter previously defined here + +warning[W09006]: unused struct type parameter + ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:5:15 + │ +5 │ struct R2 { f: T } + │ ^ Unused type parameter 'T'. Consider declaring it as phantom + │ + = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09006]: unused struct type parameter + ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:5:24 + │ +5 │ struct R2 { f: T } + │ ^ Unused type parameter 'T'. Consider declaring it as phantom + │ + = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:5:24 + │ +5 │ struct R2 { f: T } + │ - ^ Duplicate type parameter declared with name 'T' + │ │ + │ Type parameter previously defined here + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/naming/duplicate_type_parameter_struct.move:5:32 + │ +5 │ struct R2 { f: T } + │ - ^ Duplicate type parameter declared with name 'T' + │ │ + │ Type parameter previously defined here diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/friend_decl_out_of_account_addr.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/friend_decl_out_of_account_addr.exp deleted file mode 100644 index 173d0a9861713..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/friend_decl_out_of_account_addr.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E02011]: invalid 'friend' declaration - ┌─ tests/move_check/naming/friend_decl_out_of_account_addr.move:7:5 - │ -7 │ friend 0x2::M; - │ ^^^^^^^^^^^^^^ - │ │ │ - │ │ Cannot declare modules out of the current address as a friend - │ Invalid friend declaration - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/friend_decl_out_of_account_addr.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/friend_decl_out_of_account_addr.snap new file mode 100644 index 0000000000000..4f1a8d9c41beb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/friend_decl_out_of_account_addr.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/friend_decl_out_of_account_addr.move +--- +error[E02011]: invalid 'friend' declaration + ┌─ tests/move_check/naming/friend_decl_out_of_account_addr.move:7:5 + │ +7 │ friend 0x2::M; + │ ^^^^^^^^^^^^^^ + │ │ │ + │ │ Cannot declare modules out of the current address as a friend + │ Invalid friend declaration diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/friend_decl_self.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/friend_decl_self.exp deleted file mode 100644 index 0bee6380bfaf7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/friend_decl_self.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E02011]: invalid 'friend' declaration - ┌─ tests/move_check/naming/friend_decl_self.move:3:5 - │ -3 │ friend Self; - │ ^^^^^^^^^^^^ - │ │ │ - │ │ Cannot declare the module itself as a friend - │ Invalid friend declaration - -error[E02011]: invalid 'friend' declaration - ┌─ tests/move_check/naming/friend_decl_self.move:9:5 - │ -9 │ friend 0x43::M; - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ Cannot declare the module itself as a friend - │ Invalid friend declaration - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/friend_decl_self.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/friend_decl_self.snap new file mode 100644 index 0000000000000..bb1e00de38363 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/friend_decl_self.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/friend_decl_self.move +--- +error[E02011]: invalid 'friend' declaration + ┌─ tests/move_check/naming/friend_decl_self.move:3:5 + │ +3 │ friend Self; + │ ^^^^^^^^^^^^ + │ │ │ + │ │ Cannot declare the module itself as a friend + │ Invalid friend declaration + +error[E02011]: invalid 'friend' declaration + ┌─ tests/move_check/naming/friend_decl_self.move:9:5 + │ +9 │ friend 0x43::M; + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ Cannot declare the module itself as a friend + │ Invalid friend declaration diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/friend_decl_unbound_module.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/friend_decl_unbound_module.exp deleted file mode 100644 index 10b5f7bb382fa..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/friend_decl_unbound_module.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/move_check/naming/friend_decl_unbound_module.move:3:12 - │ -3 │ friend 0x42::Nonexistent; - │ ^^^^^^^^^^^^^^^^^ Unbound module '0x42::Nonexistent' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/friend_decl_unbound_module.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/friend_decl_unbound_module.snap new file mode 100644 index 0000000000000..fdc8734792b9b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/friend_decl_unbound_module.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/friend_decl_unbound_module.move +--- +error[E03002]: unbound module + ┌─ tests/move_check/naming/friend_decl_unbound_module.move:3:12 + │ +3 │ friend 0x42::Nonexistent; + │ ^^^^^^^^^^^^^^^^^ Unbound module '0x42::Nonexistent' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/generics_shadowing.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/generics_shadowing.snap new file mode 100644 index 0000000000000..571854afa5432 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/generics_shadowing.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/generics_shadowing.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/generics_shadowing_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/generics_shadowing_invalid.exp deleted file mode 100644 index 6ba73e157b772..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/generics_shadowing_invalid.exp +++ /dev/null @@ -1,41 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/naming/generics_shadowing_invalid.move:7:14 - │ -6 │ fun foo(s1: S, _: S): S { - │ - Given: 'S' -7 │ (s1: Self::S); - │ ^^^^^^^ - │ │ - │ Invalid type annotation - │ Expected: '0x2::M::S' - -error[E03006]: unexpected name in this position - ┌─ tests/move_check/naming/generics_shadowing_invalid.move:8:20 - │ -6 │ fun foo(s1: S, _: S): S { - │ - But 'S' was declared as a type parameter here -7 │ (s1: Self::S); -8 │ let _: S = S {}; // TODO error? should this try to construct the generic ? - │ ^ Invalid construction. Expected a struct name - -error[E04007]: incompatible types - ┌─ tests/move_check/naming/generics_shadowing_invalid.move:9:9 - │ - 6 │ fun foo(s1: S, _: S): S { - │ - Given: 'S' - · - 9 │ bar(s1); - │ ^^^^^^^ Invalid call of '0x2::M::bar'. Invalid argument for parameter '_' - · -13 │ fun bar(_: S) {} - │ - Expected: '0x2::M::S' - -error[E03006]: unexpected name in this position - ┌─ tests/move_check/naming/generics_shadowing_invalid.move:10:9 - │ - 6 │ fun foo(s1: S, _: S): S { - │ - But 'S' was declared as a type parameter here - · -10 │ S {} - │ ^ Invalid construction. Expected a struct name - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/generics_shadowing_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/generics_shadowing_invalid.snap new file mode 100644 index 0000000000000..7206d7da38f3b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/generics_shadowing_invalid.snap @@ -0,0 +1,48 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/generics_shadowing_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/naming/generics_shadowing_invalid.move:7:14 + │ +6 │ fun foo(s1: S, _: S): S { + │ - Given: 'S' +7 │ (s1: Self::S); + │ ^^^^^^^ + │ │ + │ Invalid type annotation + │ Expected: '0x2::M::S' + +error[E03006]: unexpected name in this position + ┌─ tests/move_check/naming/generics_shadowing_invalid.move:8:20 + │ +6 │ fun foo(s1: S, _: S): S { + │ - But 'S' was declared as a type parameter here +7 │ (s1: Self::S); +8 │ let _: S = S {}; // TODO error? should this try to construct the generic ? + │ ^ Invalid construction. Expected a struct name + +error[E04007]: incompatible types + ┌─ tests/move_check/naming/generics_shadowing_invalid.move:9:9 + │ + 6 │ fun foo(s1: S, _: S): S { + │ - Given: 'S' + · + 9 │ bar(s1); + │ ^^^^^^^ Invalid call of '0x2::M::bar'. Invalid argument for parameter '_' + · +13 │ fun bar(_: S) {} + │ - Expected: '0x2::M::S' + +error[E03006]: unexpected name in this position + ┌─ tests/move_check/naming/generics_shadowing_invalid.move:10:9 + │ + 6 │ fun foo(s1: S, _: S): S { + │ - But 'S' was declared as a type parameter here + · +10 │ S {} + │ ^ Invalid construction. Expected a struct name diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/generics_with_type_parameters.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/generics_with_type_parameters.exp deleted file mode 100644 index a068d8f2548c4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/generics_with_type_parameters.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_check/naming/generics_with_type_parameters.move:2:22 - │ -2 │ struct S { f: T } - │ ^^^^^^ Generic type parameters cannot take type arguments - -error[E03006]: unexpected name in this position - ┌─ tests/move_check/naming/generics_with_type_parameters.move:3:19 - │ -3 │ fun foo(_: T): T {} - │ ^^^^^^^ Generic type parameters cannot take type arguments - -error[E03006]: unexpected name in this position - ┌─ tests/move_check/naming/generics_with_type_parameters.move:3:29 - │ -3 │ fun foo(_: T): T {} - │ ^^^^^^ Generic type parameters cannot take type arguments - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/generics_with_type_parameters.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/generics_with_type_parameters.snap new file mode 100644 index 0000000000000..70c1ddc5d0ba7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/generics_with_type_parameters.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/generics_with_type_parameters.move +--- +error[E03006]: unexpected name in this position + ┌─ tests/move_check/naming/generics_with_type_parameters.move:2:22 + │ +2 │ struct S { f: T } + │ ^^^^^^ Generic type parameters cannot take type arguments + +error[E03006]: unexpected name in this position + ┌─ tests/move_check/naming/generics_with_type_parameters.move:3:19 + │ +3 │ fun foo(_: T): T {} + │ ^^^^^^^ Generic type parameters cannot take type arguments + +error[E03006]: unexpected name in this position + ┌─ tests/move_check/naming/generics_with_type_parameters.move:3:29 + │ +3 │ fun foo(_: T): T {} + │ ^^^^^^ Generic type parameters cannot take type arguments diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/named_address_distinct_from_each_others_value.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/named_address_distinct_from_each_others_value.exp deleted file mode 100644 index 8941d902fe2d7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/named_address_distinct_from_each_others_value.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_check/naming/named_address_distinct_from_each_others_value.move:18:9 - │ - 6 │ const C: u64 = 0; - │ - Constants are internal to their module, and cannot can be accessed outside of their module - · -18 │ k::M::C; - │ ^^^^^^^ Invalid access of '(k=0x19)::M::C' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/named_address_distinct_from_each_others_value.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/named_address_distinct_from_each_others_value.snap new file mode 100644 index 0000000000000..0e93ffb873292 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/named_address_distinct_from_each_others_value.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/named_address_distinct_from_each_others_value.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_check/naming/named_address_distinct_from_each_others_value.move:18:9 + │ + 6 │ const C: u64 = 0; + │ - Constants are internal to their module, and cannot can be accessed outside of their module + · +18 │ k::M::C; + │ ^^^^^^^ Invalid access of '(k=0x19)::M::C' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/named_address_not_distinct_from_value.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/named_address_not_distinct_from_value.exp deleted file mode 100644 index 93039985a8cb3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/named_address_not_distinct_from_value.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_check/naming/named_address_not_distinct_from_value.move:18:9 - │ - 6 │ const C: u64 = 0; - │ - Constants are internal to their module, and cannot can be accessed outside of their module - · -18 │ 0x41::M::C; - │ ^^^^^^^^^^ Invalid access of '0x41::M::C' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/named_address_not_distinct_from_value.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/named_address_not_distinct_from_value.snap new file mode 100644 index 0000000000000..737c1c46efc37 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/named_address_not_distinct_from_value.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/named_address_not_distinct_from_value.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_check/naming/named_address_not_distinct_from_value.move:18:9 + │ + 6 │ const C: u64 = 0; + │ - Constants are internal to their module, and cannot can be accessed outside of their module + · +18 │ 0x41::M::C; + │ ^^^^^^^^^^ Invalid access of '0x41::M::C' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/named_blocks_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/named_blocks_invalid.exp deleted file mode 100644 index 82e8512409d2d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/named_blocks_invalid.exp +++ /dev/null @@ -1,252 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/named_blocks_invalid.move:3:9 - │ -3 │ 'name: { - │ ^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01001]: invalid character - ┌─ tests/move_check/naming/named_blocks_invalid.move:4:31 - │ -4 │ if (cond) { break 'name 10 }; - │ ^^^^^ Unexpected character (') - -error[E01001]: invalid character - ┌─ tests/move_check/naming/named_blocks_invalid.move:5:34 - │ -5 │ if (cond) { continue 'name }; - │ ^^^^^ Unexpected character (') - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/named_blocks_invalid.move:11:14 - │ -11 │ loop 'name: { - │ ^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01001]: invalid character - ┌─ tests/move_check/naming/named_blocks_invalid.move:12:32 - │ -12 │ if (cond) { return 'name 10 }; - │ ^^^^^ Unexpected character (') - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/named_blocks_invalid.move:17:14 - │ -17 │ loop 'outer: { - │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/named_blocks_invalid.move:18:18 - │ -18 │ loop 'inner: { - │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01001]: invalid character - ┌─ tests/move_check/naming/named_blocks_invalid.move:19:36 - │ -19 │ if (cond) { return 'outer 10 }; - │ ^^^^^^ Unexpected character (') - -error[E01001]: invalid character - ┌─ tests/move_check/naming/named_blocks_invalid.move:20:36 - │ -20 │ if (cond) { return 'inner 20 }; - │ ^^^^^^ Unexpected character (') - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/named_blocks_invalid.move:26:22 - │ -26 │ while (cond) 'outer: { - │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/named_blocks_invalid.move:27:26 - │ -27 │ while (cond) 'inner: { - │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01001]: invalid character - ┌─ tests/move_check/naming/named_blocks_invalid.move:28:36 - │ -28 │ if (cond) { return 'outer }; - │ ^^^^^^ Unexpected character (') - -error[E01001]: invalid character - ┌─ tests/move_check/naming/named_blocks_invalid.move:29:36 - │ -29 │ if (cond) { return 'inner }; - │ ^^^^^^ Unexpected character (') - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/named_blocks_invalid.move:35:22 - │ -35 │ while (cond) 'outer: { - │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/named_blocks_invalid.move:36:22 - │ -36 │ let _x = 'inner: { - │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01001]: invalid character - ┌─ tests/move_check/naming/named_blocks_invalid.move:37:36 - │ -37 │ if (cond) { return 'outer }; - │ ^^^^^^ Unexpected character (') - -error[E01001]: invalid character - ┌─ tests/move_check/naming/named_blocks_invalid.move:38:35 - │ -38 │ if (cond) { break 'inner 10 }; - │ ^^^^^^ Unexpected character (') - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/named_blocks_invalid.move:45:14 - │ -45 │ loop 'l: { - │ ^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/named_blocks_invalid.move:46:18 - │ -46 │ loop 'l: { - │ ^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01001]: invalid character - ┌─ tests/move_check/naming/named_blocks_invalid.move:47:24 - │ -47 │ return 'l - │ ^^ Unexpected character (') - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/named_blocks_invalid.move:53:9 - │ -53 │ 'name: { - │ ^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01001]: invalid character - ┌─ tests/move_check/naming/named_blocks_invalid.move:54:32 - │ -54 │ if (cond) { return 'name2 10 }; - │ ^^^^^^ Unexpected character (') - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/named_blocks_invalid.move:60:14 - │ -60 │ loop 'name: { - │ ^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01001]: invalid character - ┌─ tests/move_check/naming/named_blocks_invalid.move:61:34 - │ -61 │ if (cond) { continue 'name2 }; - │ ^^^^^^ Unexpected character (') - -error[E01001]: invalid character - ┌─ tests/move_check/naming/named_blocks_invalid.move:62:31 - │ -62 │ if (cond) { break 'name2 10 }; - │ ^^^^^^ Unexpected character (') - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/named_blocks_invalid.move:67:14 - │ -67 │ loop 'outer2: { - │ ^^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/named_blocks_invalid.move:68:18 - │ -68 │ loop 'inner2: { - │ ^^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01001]: invalid character - ┌─ tests/move_check/naming/named_blocks_invalid.move:69:35 - │ -69 │ if (cond) { break 'outer 10 }; - │ ^^^^^^ Unexpected character (') - -error[E01001]: invalid character - ┌─ tests/move_check/naming/named_blocks_invalid.move:70:35 - │ -70 │ if (cond) { break 'inner 20 }; - │ ^^^^^^ Unexpected character (') - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/named_blocks_invalid.move:76:22 - │ -76 │ while (cond) 'outer: { - │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/named_blocks_invalid.move:77:26 - │ -77 │ while (cond) 'inner: { - │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01001]: invalid character - ┌─ tests/move_check/naming/named_blocks_invalid.move:78:38 - │ -78 │ if (cond) { continue 'outer2 }; - │ ^^^^^^^ Unexpected character (') - -error[E01001]: invalid character - ┌─ tests/move_check/naming/named_blocks_invalid.move:79:35 - │ -79 │ if (cond) { break 'inner2 }; - │ ^^^^^^^ Unexpected character (') - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/named_blocks_invalid.move:85:14 - │ -85 │ loop 'l: { - │ ^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/named_blocks_invalid.move:86:18 - │ -86 │ loop 'l: { - │ ^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01001]: invalid character - ┌─ tests/move_check/naming/named_blocks_invalid.move:87:23 - │ -87 │ break 'l2 - │ ^^^ Unexpected character (') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/named_blocks_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/named_blocks_invalid.snap new file mode 100644 index 0000000000000..ced16ab565db2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/named_blocks_invalid.snap @@ -0,0 +1,259 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/named_blocks_invalid.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/named_blocks_invalid.move:3:9 + │ +3 │ 'name: { + │ ^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01001]: invalid character + ┌─ tests/move_check/naming/named_blocks_invalid.move:4:31 + │ +4 │ if (cond) { break 'name 10 }; + │ ^^^^^ Unexpected character (') + +error[E01001]: invalid character + ┌─ tests/move_check/naming/named_blocks_invalid.move:5:34 + │ +5 │ if (cond) { continue 'name }; + │ ^^^^^ Unexpected character (') + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/named_blocks_invalid.move:11:14 + │ +11 │ loop 'name: { + │ ^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01001]: invalid character + ┌─ tests/move_check/naming/named_blocks_invalid.move:12:32 + │ +12 │ if (cond) { return 'name 10 }; + │ ^^^^^ Unexpected character (') + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/named_blocks_invalid.move:17:14 + │ +17 │ loop 'outer: { + │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/named_blocks_invalid.move:18:18 + │ +18 │ loop 'inner: { + │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01001]: invalid character + ┌─ tests/move_check/naming/named_blocks_invalid.move:19:36 + │ +19 │ if (cond) { return 'outer 10 }; + │ ^^^^^^ Unexpected character (') + +error[E01001]: invalid character + ┌─ tests/move_check/naming/named_blocks_invalid.move:20:36 + │ +20 │ if (cond) { return 'inner 20 }; + │ ^^^^^^ Unexpected character (') + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/named_blocks_invalid.move:26:22 + │ +26 │ while (cond) 'outer: { + │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/named_blocks_invalid.move:27:26 + │ +27 │ while (cond) 'inner: { + │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01001]: invalid character + ┌─ tests/move_check/naming/named_blocks_invalid.move:28:36 + │ +28 │ if (cond) { return 'outer }; + │ ^^^^^^ Unexpected character (') + +error[E01001]: invalid character + ┌─ tests/move_check/naming/named_blocks_invalid.move:29:36 + │ +29 │ if (cond) { return 'inner }; + │ ^^^^^^ Unexpected character (') + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/named_blocks_invalid.move:35:22 + │ +35 │ while (cond) 'outer: { + │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/named_blocks_invalid.move:36:22 + │ +36 │ let _x = 'inner: { + │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01001]: invalid character + ┌─ tests/move_check/naming/named_blocks_invalid.move:37:36 + │ +37 │ if (cond) { return 'outer }; + │ ^^^^^^ Unexpected character (') + +error[E01001]: invalid character + ┌─ tests/move_check/naming/named_blocks_invalid.move:38:35 + │ +38 │ if (cond) { break 'inner 10 }; + │ ^^^^^^ Unexpected character (') + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/named_blocks_invalid.move:45:14 + │ +45 │ loop 'l: { + │ ^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/named_blocks_invalid.move:46:18 + │ +46 │ loop 'l: { + │ ^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01001]: invalid character + ┌─ tests/move_check/naming/named_blocks_invalid.move:47:24 + │ +47 │ return 'l + │ ^^ Unexpected character (') + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/named_blocks_invalid.move:53:9 + │ +53 │ 'name: { + │ ^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01001]: invalid character + ┌─ tests/move_check/naming/named_blocks_invalid.move:54:32 + │ +54 │ if (cond) { return 'name2 10 }; + │ ^^^^^^ Unexpected character (') + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/named_blocks_invalid.move:60:14 + │ +60 │ loop 'name: { + │ ^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01001]: invalid character + ┌─ tests/move_check/naming/named_blocks_invalid.move:61:34 + │ +61 │ if (cond) { continue 'name2 }; + │ ^^^^^^ Unexpected character (') + +error[E01001]: invalid character + ┌─ tests/move_check/naming/named_blocks_invalid.move:62:31 + │ +62 │ if (cond) { break 'name2 10 }; + │ ^^^^^^ Unexpected character (') + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/named_blocks_invalid.move:67:14 + │ +67 │ loop 'outer2: { + │ ^^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/named_blocks_invalid.move:68:18 + │ +68 │ loop 'inner2: { + │ ^^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01001]: invalid character + ┌─ tests/move_check/naming/named_blocks_invalid.move:69:35 + │ +69 │ if (cond) { break 'outer 10 }; + │ ^^^^^^ Unexpected character (') + +error[E01001]: invalid character + ┌─ tests/move_check/naming/named_blocks_invalid.move:70:35 + │ +70 │ if (cond) { break 'inner 20 }; + │ ^^^^^^ Unexpected character (') + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/named_blocks_invalid.move:76:22 + │ +76 │ while (cond) 'outer: { + │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/named_blocks_invalid.move:77:26 + │ +77 │ while (cond) 'inner: { + │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01001]: invalid character + ┌─ tests/move_check/naming/named_blocks_invalid.move:78:38 + │ +78 │ if (cond) { continue 'outer2 }; + │ ^^^^^^^ Unexpected character (') + +error[E01001]: invalid character + ┌─ tests/move_check/naming/named_blocks_invalid.move:79:35 + │ +79 │ if (cond) { break 'inner2 }; + │ ^^^^^^^ Unexpected character (') + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/named_blocks_invalid.move:85:14 + │ +85 │ loop 'l: { + │ ^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/named_blocks_invalid.move:86:18 + │ +86 │ loop 'l: { + │ ^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01001]: invalid character + ┌─ tests/move_check/naming/named_blocks_invalid.move:87:23 + │ +87 │ break 'l2 + │ ^^^ Unexpected character (') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/other_builtins_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/other_builtins_invalid.exp deleted file mode 100644 index a0d57cef627a8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/other_builtins_invalid.exp +++ /dev/null @@ -1,43 +0,0 @@ -error[E03007]: too many type arguments - ┌─ tests/move_check/naming/other_builtins_invalid.move:3:9 - │ -3 │ freeze(x); - │ ^^^^^^-------------- - │ │ - │ Expected 1 type argument(s) but got 2 - │ Invalid call to builtin function: 'freeze' - -error[E03008]: too few type arguments - ┌─ tests/move_check/naming/other_builtins_invalid.move:4:9 - │ -4 │ freeze<>(x); - │ ^^^^^^----- - │ │ - │ Expected 1 type argument(s) but got 0 - │ Invalid call to builtin function: 'freeze' - -error[E04016]: too few arguments - ┌─ tests/move_check/naming/other_builtins_invalid.move:5:9 - │ -5 │ assert!(); - │ ^^^^^^^^^ - │ │ │ - │ │ Found 0 argument(s) here - │ Invalid call of 'assert'. The call expected 2 argument(s) but got 0 - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/other_builtins_invalid.move:6:9 - │ -6 │ assert!(false); - │ ^^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/other_builtins_invalid.move:7:9 - │ -7 │ assert!(0 != 1); - │ ^^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/other_builtins_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/other_builtins_invalid.snap new file mode 100644 index 0000000000000..3af4cf568e7b2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/other_builtins_invalid.snap @@ -0,0 +1,50 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/other_builtins_invalid.move +--- +error[E03007]: too many type arguments + ┌─ tests/move_check/naming/other_builtins_invalid.move:3:9 + │ +3 │ freeze(x); + │ ^^^^^^-------------- + │ │ + │ Expected 1 type argument(s) but got 2 + │ Invalid call to builtin function: 'freeze' + +error[E03008]: too few type arguments + ┌─ tests/move_check/naming/other_builtins_invalid.move:4:9 + │ +4 │ freeze<>(x); + │ ^^^^^^----- + │ │ + │ Expected 1 type argument(s) but got 0 + │ Invalid call to builtin function: 'freeze' + +error[E04016]: too few arguments + ┌─ tests/move_check/naming/other_builtins_invalid.move:5:9 + │ +5 │ assert!(); + │ ^^^^^^^^^ + │ │ │ + │ │ Found 0 argument(s) here + │ Invalid call of 'assert'. The call expected 2 argument(s) but got 0 + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/other_builtins_invalid.move:6:9 + │ +6 │ assert!(false); + │ ^^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/other_builtins_invalid.move:7:9 + │ +7 │ assert!(0 != 1); + │ ^^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/partially_invalid_binding_with_usage.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/partially_invalid_binding_with_usage.exp deleted file mode 100644 index 07ac8ad40ee0c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/partially_invalid_binding_with_usage.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/naming/partially_invalid_binding_with_usage.move:3:13 - │ -3 │ let (b, R{f}): (); b; - │ ^^^^^^^^^ -- Given: '()' - │ │ - │ Invalid value for binding - │ Expected: '(_, _)' - -error[E03004]: unbound type - ┌─ tests/move_check/naming/partially_invalid_binding_with_usage.move:3:17 - │ -3 │ let (b, R{f}): (); b; - │ ^ Unbound type 'R' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/partially_invalid_binding_with_usage.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/partially_invalid_binding_with_usage.snap new file mode 100644 index 0000000000000..7e16731139c44 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/partially_invalid_binding_with_usage.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/partially_invalid_binding_with_usage.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/naming/partially_invalid_binding_with_usage.move:3:13 + │ +3 │ let (b, R{f}): (); b; + │ ^^^^^^^^^ -- Given: '()' + │ │ + │ Invalid value for binding + │ Expected: '(_, _)' + +error[E03004]: unbound type + ┌─ tests/move_check/naming/partially_invalid_binding_with_usage.move:3:17 + │ +3 │ let (b, R{f}): (); b; + │ ^ Unbound type 'R' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/standalone_mname.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/standalone_mname.exp deleted file mode 100644 index 7583764334cc6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/standalone_mname.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03005]: unbound unscoped name - ┌─ tests/move_check/naming/standalone_mname.move:3:17 - │ -3 │ let m = M; m; - │ ^ Unbound constant 'M' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/standalone_mname.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/standalone_mname.snap new file mode 100644 index 0000000000000..2fee40abc2b7b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/standalone_mname.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/standalone_mname.move +--- +error[E03005]: unbound unscoped name + ┌─ tests/move_check/naming/standalone_mname.move:3:17 + │ +3 │ let m = M; m; + │ ^ Unbound constant 'M' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/standalone_module_ident.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/standalone_module_ident.exp deleted file mode 100644 index b13eb9a0fc5d5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/standalone_module_ident.exp +++ /dev/null @@ -1,32 +0,0 @@ -warning[W09001]: unused alias - ┌─ tests/move_check/naming/standalone_module_ident.move:6:14 - │ -6 │ use 0x2::X; - │ ^ Unused 'use' of alias 'X'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/naming/standalone_module_ident.move:8:17 - │ -8 │ let x = X; x; - │ ^ Unbound constant 'X' - -error[E03006]: unexpected name in this position - ┌─ tests/move_check/naming/standalone_module_ident.move:9:17 - │ -9 │ let x = 0x2::X; x; - │ ^^^^^^ - │ │ - │ Unexpected module identifier. A module identifier is not a valid expression - │ Expected a module name - -error[E03006]: unexpected name in this position - ┌─ tests/move_check/naming/standalone_module_ident.move:10:17 - │ -10 │ let y = 0x2::Y; y; - │ ^^^^^^ - │ │ - │ Unexpected module identifier. A module identifier is not a valid expression - │ Expected a module name - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/standalone_module_ident.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/standalone_module_ident.snap new file mode 100644 index 0000000000000..572f533a6c5e1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/standalone_module_ident.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/standalone_module_ident.move +--- +warning[W09001]: unused alias + ┌─ tests/move_check/naming/standalone_module_ident.move:6:14 + │ +6 │ use 0x2::X; + │ ^ Unused 'use' of alias 'X'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/naming/standalone_module_ident.move:8:17 + │ +8 │ let x = X; x; + │ ^ Unbound constant 'X' + +error[E03006]: unexpected name in this position + ┌─ tests/move_check/naming/standalone_module_ident.move:9:17 + │ +9 │ let x = 0x2::X; x; + │ ^^^^^^ + │ │ + │ Unexpected module identifier. A module identifier is not a valid expression + │ Expected a module name + +error[E03006]: unexpected name in this position + ┌─ tests/move_check/naming/standalone_module_ident.move:10:17 + │ +10 │ let y = 0x2::Y; y; + │ ^^^^^^ + │ │ + │ Unexpected module identifier. A module identifier is not a valid expression + │ Expected a module name diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/struct_in_current_module.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/struct_in_current_module.snap new file mode 100644 index 0000000000000..eb5d9619bd6b1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/struct_in_current_module.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/struct_in_current_module.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/syntax_annotations_unsupported.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/syntax_annotations_unsupported.exp deleted file mode 100644 index 6237eb07ceebf..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/syntax_annotations_unsupported.exp +++ /dev/null @@ -1,55 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/syntax_annotations_unsupported.move:6:7 - │ -6 │ #[syntax(index)] - │ ^^^^^^^^^^^^^ 'syntax' methods are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/syntax_annotations_unsupported.move:10:7 - │ -10 │ #[syntax(index)] - │ ^^^^^^^^^^^^^ 'syntax' methods are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E02015]: invalid attribute - ┌─ tests/move_check/naming/syntax_annotations_unsupported.move:17:7 - │ -17 │ #[syntax(index)] - │ ^^^^^^ - │ │ - │ Known attribute 'syntax' is not expected with a struct - │ Expected to be used with one of the following: function - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/syntax_annotations_unsupported.move:21:7 - │ -21 │ #[syntax(for)] - │ ^^^^^^^^^^^ 'syntax' methods are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/syntax_annotations_unsupported.move:25:7 - │ -25 │ #[syntax(assign)] - │ ^^^^^^^^^^^^^^ 'syntax' methods are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/syntax_annotations_unsupported.move:29:7 - │ -29 │ #[syntax(nonsense)] - │ ^^^^^^^^^^^^^^^^ 'syntax' methods are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E02015]: invalid attribute - ┌─ tests/move_check/naming/syntax_annotations_unsupported.move:29:14 - │ -29 │ #[syntax(nonsense)] - │ ^^^^^^^^ Invalid syntax method identifier 'nonsense' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/syntax_annotations_unsupported.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/syntax_annotations_unsupported.snap new file mode 100644 index 0000000000000..84208592422ae --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/syntax_annotations_unsupported.snap @@ -0,0 +1,62 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/syntax_annotations_unsupported.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/syntax_annotations_unsupported.move:6:7 + │ +6 │ #[syntax(index)] + │ ^^^^^^^^^^^^^ 'syntax' methods are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/syntax_annotations_unsupported.move:10:7 + │ +10 │ #[syntax(index)] + │ ^^^^^^^^^^^^^ 'syntax' methods are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E02015]: invalid attribute + ┌─ tests/move_check/naming/syntax_annotations_unsupported.move:17:7 + │ +17 │ #[syntax(index)] + │ ^^^^^^ + │ │ + │ Known attribute 'syntax' is not expected with a struct + │ Expected to be used with one of the following: function + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/syntax_annotations_unsupported.move:21:7 + │ +21 │ #[syntax(for)] + │ ^^^^^^^^^^^ 'syntax' methods are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/syntax_annotations_unsupported.move:25:7 + │ +25 │ #[syntax(assign)] + │ ^^^^^^^^^^^^^^ 'syntax' methods are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/syntax_annotations_unsupported.move:29:7 + │ +29 │ #[syntax(nonsense)] + │ ^^^^^^^^^^^^^^^^ 'syntax' methods are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E02015]: invalid attribute + ┌─ tests/move_check/naming/syntax_annotations_unsupported.move:29:14 + │ +29 │ #[syntax(nonsense)] + │ ^^^^^^^^ Invalid syntax method identifier 'nonsense' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/type_hole_gated_invalid_usage.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/type_hole_gated_invalid_usage.exp deleted file mode 100644 index da6d9df6753be..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/type_hole_gated_invalid_usage.exp +++ /dev/null @@ -1,30 +0,0 @@ -error[E03021]: invalid type annotation - ┌─ tests/move_check/naming/type_hole_gated_invalid_usage.move:2:22 - │ -2 │ struct S { f: _ } - │ ^ Invalid usage of a placeholder for type inference '_'. Struct fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/type_hole_gated_invalid_usage.move:2:22 - │ -2 │ struct S { f: _ } - │ ^ '_' placeholders for type inference are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E03021]: invalid type annotation - ┌─ tests/move_check/naming/type_hole_gated_invalid_usage.move:3:16 - │ -3 │ fun foo(_: _) {} - │ ^ Invalid usage of a placeholder for type inference '_'. Functions require fully specified types. Replace '_' with a specific type or consider adding a new type parameter - │ - = Only 'macro' functions can use '_' in their signatures - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/type_hole_gated_invalid_usage.move:3:16 - │ -3 │ fun foo(_: _) {} - │ ^ '_' placeholders for type inference are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/type_hole_gated_invalid_usage.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/type_hole_gated_invalid_usage.snap new file mode 100644 index 0000000000000..9f3873ad032fa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/type_hole_gated_invalid_usage.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/type_hole_gated_invalid_usage.move +--- +error[E03021]: invalid type annotation + ┌─ tests/move_check/naming/type_hole_gated_invalid_usage.move:2:22 + │ +2 │ struct S { f: _ } + │ ^ Invalid usage of a placeholder for type inference '_'. Struct fields require fully specified types. Replace '_' with a specific type or consider adding a new type parameter + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/type_hole_gated_invalid_usage.move:2:22 + │ +2 │ struct S { f: _ } + │ ^ '_' placeholders for type inference are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E03021]: invalid type annotation + ┌─ tests/move_check/naming/type_hole_gated_invalid_usage.move:3:16 + │ +3 │ fun foo(_: _) {} + │ ^ Invalid usage of a placeholder for type inference '_'. Functions require fully specified types. Replace '_' with a specific type or consider adding a new type parameter + │ + = Only 'macro' functions can use '_' in their signatures + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/type_hole_gated_invalid_usage.move:3:16 + │ +3 │ fun foo(_: _) {} + │ ^ '_' placeholders for type inference are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/type_hole_gated_valid_usage.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/type_hole_gated_valid_usage.exp deleted file mode 100644 index afc0bbf38cfd6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/type_hole_gated_valid_usage.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/type_hole_gated_valid_usage.move:3:23 - │ -3 │ let v: vector<_> = vector[0]; - │ ^ '_' placeholders for type inference are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/type_hole_gated_valid_usage.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/type_hole_gated_valid_usage.snap new file mode 100644 index 0000000000000..bac717fd07a8d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/type_hole_gated_valid_usage.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/type_hole_gated_valid_usage.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/type_hole_gated_valid_usage.move:3:23 + │ +3 │ let v: vector<_> = vector[0]; + │ ^ '_' placeholders for type inference are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_builtin.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_builtin.exp deleted file mode 100644 index fa12ca73cf639..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_builtin.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E03005]: unbound unscoped name - ┌─ tests/move_check/naming/unbound_builtin.move:3:9 - │ -3 │ global_borrow(); - │ ^^^^^^^^^^^^^ Unbound function 'global_borrow' in current scope - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/naming/unbound_builtin.move:4:9 - │ -4 │ release(); - │ ^^^^^^^ Unbound function 'release' in current scope - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/naming/unbound_builtin.move:5:9 - │ -5 │ sudo(false); - │ ^^^^ Unbound function 'sudo' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_builtin.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_builtin.snap new file mode 100644 index 0000000000000..58297ac04fa01 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_builtin.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/unbound_builtin.move +--- +error[E03005]: unbound unscoped name + ┌─ tests/move_check/naming/unbound_builtin.move:3:9 + │ +3 │ global_borrow(); + │ ^^^^^^^^^^^^^ Unbound function 'global_borrow' in current scope + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/naming/unbound_builtin.move:4:9 + │ +4 │ release(); + │ ^^^^^^^ Unbound function 'release' in current scope + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/naming/unbound_builtin.move:5:9 + │ +5 │ sudo(false); + │ ^^^^ Unbound function 'sudo' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_constant.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_constant.exp deleted file mode 100644 index abf248976c9a5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_constant.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E03005]: unbound unscoped name - ┌─ tests/move_check/naming/unbound_constant.move:4:17 - │ -4 │ let x = CONSTANT; x; - │ ^^^^^^^^ Unbound constant 'CONSTANT' - -error[E03003]: unbound module member - ┌─ tests/move_check/naming/unbound_constant.move:5:17 - │ -5 │ let y = Self::CONSTANT; y; - │ ^^^^^^^^^^^^^^ Unbound module member 'CONSTANT' in current scope - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/naming/unbound_constant.move:6:13 - │ -6 │ 0 + CONSTANT + Self::CONSTANT; - │ ^^^^^^^^ Unbound constant 'CONSTANT' - -error[E03003]: unbound module member - ┌─ tests/move_check/naming/unbound_constant.move:6:24 - │ -6 │ 0 + CONSTANT + Self::CONSTANT; - │ ^^^^^^^^^^^^^^ Unbound module member 'CONSTANT' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_constant.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_constant.snap new file mode 100644 index 0000000000000..73485688ff492 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_constant.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/unbound_constant.move +--- +error[E03005]: unbound unscoped name + ┌─ tests/move_check/naming/unbound_constant.move:4:17 + │ +4 │ let x = CONSTANT; x; + │ ^^^^^^^^ Unbound constant 'CONSTANT' + +error[E03003]: unbound module member + ┌─ tests/move_check/naming/unbound_constant.move:5:17 + │ +5 │ let y = Self::CONSTANT; y; + │ ^^^^^^^^^^^^^^ Unbound module member 'CONSTANT' in current scope + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/naming/unbound_constant.move:6:13 + │ +6 │ 0 + CONSTANT + Self::CONSTANT; + │ ^^^^^^^^ Unbound constant 'CONSTANT' + +error[E03003]: unbound module member + ┌─ tests/move_check/naming/unbound_constant.move:6:24 + │ +6 │ 0 + CONSTANT + Self::CONSTANT; + │ ^^^^^^^^^^^^^^ Unbound module member 'CONSTANT' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_module.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_module.exp deleted file mode 100644 index 094aaa515f5c1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_module.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/move_check/naming/unbound_module.move:2:9 - │ -2 │ use 0x1::X as X; - │ ^^^^^^ Invalid 'use'. Unbound module: '0x1::X' - -error[E03002]: unbound module - ┌─ tests/move_check/naming/unbound_module.move:4:9 - │ -4 │ X::foo(); - │ ^ Unbound module alias 'X' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_module.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_module.snap new file mode 100644 index 0000000000000..c2bf67794f969 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_module.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/unbound_module.move +--- +error[E03002]: unbound module + ┌─ tests/move_check/naming/unbound_module.move:2:9 + │ +2 │ use 0x1::X as X; + │ ^^^^^^ Invalid 'use'. Unbound module: '0x1::X' + +error[E03002]: unbound module + ┌─ tests/move_check/naming/unbound_module.move:4:9 + │ +4 │ X::foo(); + │ ^ Unbound module alias 'X' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_module_name.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_module_name.exp deleted file mode 100644 index 51dd497c16889..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_module_name.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E03003]: unbound module member - ┌─ tests/move_check/naming/unbound_module_name.move:7:17 - │ -7 │ let x = N::c; x; - │ ^^^^ Invalid module access. Unbound module member 'c' in module '0x42::N' - -error[E03003]: unbound module member - ┌─ tests/move_check/naming/unbound_module_name.move:8:17 - │ -8 │ let y = Self::c; y; - │ ^^^^^^^ Unbound module member 'c' in current scope - -error[E03003]: unbound module member - ┌─ tests/move_check/naming/unbound_module_name.move:9:13 - │ -9 │ 0 + N::c + Self::c; - │ ^^^^ Invalid module access. Unbound module member 'c' in module '0x42::N' - -error[E03003]: unbound module member - ┌─ tests/move_check/naming/unbound_module_name.move:9:20 - │ -9 │ 0 + N::c + Self::c; - │ ^^^^^^^ Unbound module member 'c' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_module_name.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_module_name.snap new file mode 100644 index 0000000000000..35f3c791f4046 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_module_name.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/unbound_module_name.move +--- +error[E03003]: unbound module member + ┌─ tests/move_check/naming/unbound_module_name.move:7:17 + │ +7 │ let x = N::c; x; + │ ^^^^ Invalid module access. Unbound module member 'c' in module '0x42::N' + +error[E03003]: unbound module member + ┌─ tests/move_check/naming/unbound_module_name.move:8:17 + │ +8 │ let y = Self::c; y; + │ ^^^^^^^ Unbound module member 'c' in current scope + +error[E03003]: unbound module member + ┌─ tests/move_check/naming/unbound_module_name.move:9:13 + │ +9 │ 0 + N::c + Self::c; + │ ^^^^ Invalid module access. Unbound module member 'c' in module '0x42::N' + +error[E03003]: unbound module member + ┌─ tests/move_check/naming/unbound_module_name.move:9:20 + │ +9 │ 0 + N::c + Self::c; + │ ^^^^^^^ Unbound module member 'c' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_struct_in_current.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_struct_in_current.exp deleted file mode 100644 index 0fd116fbd5248..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_struct_in_current.exp +++ /dev/null @@ -1,48 +0,0 @@ -error[E03004]: unbound type - ┌─ tests/move_check/naming/unbound_struct_in_current.move:2:16 - │ -2 │ fun foo(s: Self::S): Self::S { - │ ^^^^^^^ Unbound type 'S' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/naming/unbound_struct_in_current.move:2:26 - │ -2 │ fun foo(s: Self::S): Self::S { - │ ^^^^^^^ Unbound type 'S' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/naming/unbound_struct_in_current.move:7:16 - │ -7 │ fun bar(): Self::S { - │ ^^^^^^^ Unbound type 'S' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/naming/unbound_struct_in_current.move:8:9 - │ -8 │ S {} - │ ^ Unbound type 'S' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/naming/unbound_struct_in_current.move:12:9 - │ -12 │ S {} = bar(); - │ ^ Unbound type 'S' in current scope - -error[E03003]: unbound module member - ┌─ tests/move_check/naming/unbound_struct_in_current.move:13:9 - │ -13 │ Self::S {} = bar(); - │ ^^^^^^^ Unbound struct 'S' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/naming/unbound_struct_in_current.move:17:13 - │ -17 │ let S {} = bar(); - │ ^ Unbound type 'S' in current scope - -error[E03003]: unbound module member - ┌─ tests/move_check/naming/unbound_struct_in_current.move:18:13 - │ -18 │ let Self::S {} = bar(); - │ ^^^^^^^ Unbound struct 'S' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_struct_in_current.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_struct_in_current.snap new file mode 100644 index 0000000000000..fc96b5120d0b5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_struct_in_current.snap @@ -0,0 +1,55 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/unbound_struct_in_current.move +--- +error[E03004]: unbound type + ┌─ tests/move_check/naming/unbound_struct_in_current.move:2:16 + │ +2 │ fun foo(s: Self::S): Self::S { + │ ^^^^^^^ Unbound type 'S' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/naming/unbound_struct_in_current.move:2:26 + │ +2 │ fun foo(s: Self::S): Self::S { + │ ^^^^^^^ Unbound type 'S' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/naming/unbound_struct_in_current.move:7:16 + │ +7 │ fun bar(): Self::S { + │ ^^^^^^^ Unbound type 'S' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/naming/unbound_struct_in_current.move:8:9 + │ +8 │ S {} + │ ^ Unbound type 'S' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/naming/unbound_struct_in_current.move:12:9 + │ +12 │ S {} = bar(); + │ ^ Unbound type 'S' in current scope + +error[E03003]: unbound module member + ┌─ tests/move_check/naming/unbound_struct_in_current.move:13:9 + │ +13 │ Self::S {} = bar(); + │ ^^^^^^^ Unbound struct 'S' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/naming/unbound_struct_in_current.move:17:13 + │ +17 │ let S {} = bar(); + │ ^ Unbound type 'S' in current scope + +error[E03003]: unbound module member + ┌─ tests/move_check/naming/unbound_struct_in_current.move:18:13 + │ +18 │ let Self::S {} = bar(); + │ ^^^^^^^ Unbound struct 'S' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_struct_in_module.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_struct_in_module.exp deleted file mode 100644 index e7289a7c7319c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_struct_in_module.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E03004]: unbound type - ┌─ tests/move_check/naming/unbound_struct_in_module.move:6:16 - │ -6 │ fun foo(s: X::S): X::S { - │ ^^^^ Invalid module access. Unbound type 'S' in module '0x2::X' - -error[E03004]: unbound type - ┌─ tests/move_check/naming/unbound_struct_in_module.move:6:23 - │ -6 │ fun foo(s: X::S): X::S { - │ ^^^^ Invalid module access. Unbound type 'S' in module '0x2::X' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_struct_in_module.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_struct_in_module.snap new file mode 100644 index 0000000000000..1064859f1985e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_struct_in_module.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/unbound_struct_in_module.move +--- +error[E03004]: unbound type + ┌─ tests/move_check/naming/unbound_struct_in_module.move:6:16 + │ +6 │ fun foo(s: X::S): X::S { + │ ^^^^ Invalid module access. Unbound type 'S' in module '0x2::X' + +error[E03004]: unbound type + ┌─ tests/move_check/naming/unbound_struct_in_module.move:6:23 + │ +6 │ fun foo(s: X::S): X::S { + │ ^^^^ Invalid module access. Unbound type 'S' in module '0x2::X' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_unqualified_function.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_unqualified_function.exp deleted file mode 100644 index 72656275dab56..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_unqualified_function.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E03005]: unbound unscoped name - ┌─ tests/move_check/naming/unbound_unqualified_function.move:3:9 - │ -3 │ bar(); - │ ^^^ Unbound function 'bar' in current scope - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/naming/unbound_unqualified_function.move:4:17 - │ -4 │ let x = bar(); x; - │ ^^^ Unbound function 'bar' in current scope - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/naming/unbound_unqualified_function.move:5:10 - │ -5 │ *bar() = 0; - │ ^^^ Unbound function 'bar' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_unqualified_function.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_unqualified_function.snap new file mode 100644 index 0000000000000..a52fc94adb5f9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/unbound_unqualified_function.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/unbound_unqualified_function.move +--- +error[E03005]: unbound unscoped name + ┌─ tests/move_check/naming/unbound_unqualified_function.move:3:9 + │ +3 │ bar(); + │ ^^^ Unbound function 'bar' in current scope + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/naming/unbound_unqualified_function.move:4:17 + │ +4 │ let x = bar(); x; + │ ^^^ Unbound function 'bar' in current scope + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/naming/unbound_unqualified_function.move:5:10 + │ +5 │ *bar() = 0; + │ ^^^ Unbound function 'bar' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unknown_assertion_annotation.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/unknown_assertion_annotation.exp deleted file mode 100644 index c4b7383e0e8f8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/unknown_assertion_annotation.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/unknown_assertion_annotation.move:2:7 - │ -2 │ #[error] - │ ^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unknown_assertion_annotation.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/unknown_assertion_annotation.snap new file mode 100644 index 0000000000000..ae880c9ae1d9f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/unknown_assertion_annotation.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/unknown_assertion_annotation.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/unknown_assertion_annotation.move:2:7 + │ +2 │ #[error] + │ ^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unresolved_type_no_args.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/unresolved_type_no_args.exp deleted file mode 100644 index d146427144868..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/unresolved_type_no_args.exp +++ /dev/null @@ -1,30 +0,0 @@ -error[E03004]: unbound type - ┌─ tests/move_check/naming/unresolved_type_no_args.move:2:22 - │ -2 │ struct Mine { f: A } - │ ^ Unbound type 'A' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/naming/unresolved_type_no_args.move:3:16 - │ -3 │ fun foo(_: S): G { - │ ^ Unbound type 'S' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/naming/unresolved_type_no_args.move:3:20 - │ -3 │ fun foo(_: S): G { - │ ^ Unbound type 'G' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/naming/unresolved_type_no_args.move:4:16 - │ -4 │ let _: B = (0: P); - │ ^ Unbound type 'B' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/naming/unresolved_type_no_args.move:4:24 - │ -4 │ let _: B = (0: P); - │ ^ Unbound type 'P' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unresolved_type_no_args.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/unresolved_type_no_args.snap new file mode 100644 index 0000000000000..d4ac0d922be70 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/unresolved_type_no_args.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/unresolved_type_no_args.move +--- +error[E03004]: unbound type + ┌─ tests/move_check/naming/unresolved_type_no_args.move:2:22 + │ +2 │ struct Mine { f: A } + │ ^ Unbound type 'A' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/naming/unresolved_type_no_args.move:3:16 + │ +3 │ fun foo(_: S): G { + │ ^ Unbound type 'S' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/naming/unresolved_type_no_args.move:3:20 + │ +3 │ fun foo(_: S): G { + │ ^ Unbound type 'G' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/naming/unresolved_type_no_args.move:4:16 + │ +4 │ let _: B = (0: P); + │ ^ Unbound type 'B' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/naming/unresolved_type_no_args.move:4:24 + │ +4 │ let _: B = (0: P); + │ ^ Unbound type 'P' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unresolved_type_with_args.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/unresolved_type_with_args.exp deleted file mode 100644 index 20f7264937600..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/unresolved_type_with_args.exp +++ /dev/null @@ -1,36 +0,0 @@ -error[E03004]: unbound type - ┌─ tests/move_check/naming/unresolved_type_with_args.move:2:28 - │ -2 │ struct Mine { f: A, g: X } - │ ^ Unbound type 'A' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/naming/unresolved_type_with_args.move:2:40 - │ -2 │ struct Mine { f: A, g: X } - │ ^ Unbound type 'X' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/naming/unresolved_type_with_args.move:3:22 - │ -3 │ fun foo(_: S): G { - │ ^ Unbound type 'S' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/naming/unresolved_type_with_args.move:3:29 - │ -3 │ fun foo(_: S): G { - │ ^ Unbound type 'G' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/naming/unresolved_type_with_args.move:4:16 - │ -4 │ let _: B = (0: P); - │ ^ Unbound type 'B' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/naming/unresolved_type_with_args.move:4:27 - │ -4 │ let _: B = (0: P); - │ ^ Unbound type 'P' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unresolved_type_with_args.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/unresolved_type_with_args.snap new file mode 100644 index 0000000000000..f53c1fdf4e154 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/unresolved_type_with_args.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/unresolved_type_with_args.move +--- +error[E03004]: unbound type + ┌─ tests/move_check/naming/unresolved_type_with_args.move:2:28 + │ +2 │ struct Mine { f: A, g: X } + │ ^ Unbound type 'A' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/naming/unresolved_type_with_args.move:2:40 + │ +2 │ struct Mine { f: A, g: X } + │ ^ Unbound type 'X' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/naming/unresolved_type_with_args.move:3:22 + │ +3 │ fun foo(_: S): G { + │ ^ Unbound type 'S' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/naming/unresolved_type_with_args.move:3:29 + │ +3 │ fun foo(_: S): G { + │ ^ Unbound type 'G' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/naming/unresolved_type_with_args.move:4:16 + │ +4 │ let _: B = (0: P); + │ ^ Unbound type 'B' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/naming/unresolved_type_with_args.move:4:27 + │ +4 │ let _: B = (0: P); + │ ^ Unbound type 'P' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unused_fun_tparam.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/unused_fun_tparam.snap new file mode 100644 index 0000000000000..3b50f39b83b43 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/unused_fun_tparam.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/unused_fun_tparam.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unused_fun_tparam.unused.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/unused_fun_tparam.unused.exp deleted file mode 100644 index 8c7b6d43dd970..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/unused_fun_tparam.unused.exp +++ /dev/null @@ -1,32 +0,0 @@ -warning[W09010]: unused function type parameter - ┌─ tests/move_check/naming/unused_fun_tparam.move:3:23 - │ -3 │ public fun unused(): u64 { - │ ^ Unused type parameter 'T'. - │ - = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09010]: unused function type parameter - ┌─ tests/move_check/naming/unused_fun_tparam.move:7:31 - │ -7 │ public fun one_unused(v: T1): T1 { - │ ^^ Unused type parameter 'T2'. - │ - = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09010]: unused function type parameter - ┌─ tests/move_check/naming/unused_fun_tparam.move:11:27 - │ -11 │ public fun all_unused(): u64 { - │ ^^ Unused type parameter 'T1'. - │ - = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09010]: unused function type parameter - ┌─ tests/move_check/naming/unused_fun_tparam.move:11:31 - │ -11 │ public fun all_unused(): u64 { - │ ^^ Unused type parameter 'T2'. - │ - = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/unused_fun_tparam@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/unused_fun_tparam@unused.snap new file mode 100644 index 0000000000000..65878d485df61 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/unused_fun_tparam@unused.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/unused_fun_tparam.move +--- +warning[W09010]: unused function type parameter + ┌─ tests/move_check/naming/unused_fun_tparam.move:3:23 + │ +3 │ public fun unused(): u64 { + │ ^ Unused type parameter 'T'. + │ + = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09010]: unused function type parameter + ┌─ tests/move_check/naming/unused_fun_tparam.move:7:31 + │ +7 │ public fun one_unused(v: T1): T1 { + │ ^^ Unused type parameter 'T2'. + │ + = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09010]: unused function type parameter + ┌─ tests/move_check/naming/unused_fun_tparam.move:11:27 + │ +11 │ public fun all_unused(): u64 { + │ ^^ Unused type parameter 'T1'. + │ + = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09010]: unused function type parameter + ┌─ tests/move_check/naming/unused_fun_tparam.move:11:31 + │ +11 │ public fun all_unused(): u64 { + │ ^^ Unused type parameter 'T2'. + │ + = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/used_fun_tparam.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/used_fun_tparam.snap new file mode 100644 index 0000000000000..95a06384c5eb6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/used_fun_tparam.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/used_fun_tparam.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/used_fun_tparam@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/used_fun_tparam@unused.snap new file mode 100644 index 0000000000000..95a06384c5eb6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/used_fun_tparam@unused.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/used_fun_tparam.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/var_as_fun_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/var_as_fun_invalid.exp deleted file mode 100644 index f6016a643db29..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/var_as_fun_invalid.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E04029]: invalid function call - ┌─ tests/move_check/naming/var_as_fun_invalid.move:4:9 - │ -4 │ var(); - │ ^^^ Unexpected invocation of parameter or local 'var'. Non-syntax variables cannot be invoked as functions - │ - = Only macro syntax variables, e.g. '$var', may be invoked as functions. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/naming/var_as_fun_invalid.move:4:9 - │ -4 │ var(); - │ ^^^^^ lambda expressions are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/var_as_fun_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/var_as_fun_invalid.snap new file mode 100644 index 0000000000000..3aa5fde35ee72 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/var_as_fun_invalid.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/var_as_fun_invalid.move +--- +error[E04029]: invalid function call + ┌─ tests/move_check/naming/var_as_fun_invalid.move:4:9 + │ +4 │ var(); + │ ^^^ Unexpected invocation of parameter or local 'var'. Non-syntax variables cannot be invoked as functions + │ + = Only macro syntax variables, e.g. '$var', may be invoked as functions. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/naming/var_as_fun_invalid.move:4:9 + │ +4 │ var(); + │ ^^^^^ lambda expressions are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/vector_literal_type_arity.exp b/external-crates/move/crates/move-compiler/tests/move_check/naming/vector_literal_type_arity.exp deleted file mode 100644 index 32d1c4332cadd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/naming/vector_literal_type_arity.exp +++ /dev/null @@ -1,28 +0,0 @@ -error[E03008]: too few type arguments - ┌─ tests/move_check/naming/vector_literal_type_arity.move:4:18 - │ -4 │ let v0 = vector<>[]; v0; - │ ^^^^^^---- - │ │ - │ Expected 1 type argument(s) but got 0 - │ Invalid 'vector' instantation - -error[E03007]: too many type arguments - ┌─ tests/move_check/naming/vector_literal_type_arity.move:5:18 - │ -5 │ let v2 = vector[0, false]; v2; - │ ^^^^^^--------------------- - │ │ - │ Expected 1 type argument(s) but got 2 - │ Invalid 'vector' instantation - -error[E04007]: incompatible types - ┌─ tests/move_check/naming/vector_literal_type_arity.move:5:18 - │ -5 │ let v2 = vector[0, false]; v2; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found: 'bool'. It is not compatible with the other type. - │ │ Found: integer. It is not compatible with the other type. - │ Invalid 'vector' instantiation. Incompatible argument - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/naming/vector_literal_type_arity.snap b/external-crates/move/crates/move-compiler/tests/move_check/naming/vector_literal_type_arity.snap new file mode 100644 index 0000000000000..6a693d62d2269 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/naming/vector_literal_type_arity.snap @@ -0,0 +1,35 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/naming/vector_literal_type_arity.move +--- +error[E03008]: too few type arguments + ┌─ tests/move_check/naming/vector_literal_type_arity.move:4:18 + │ +4 │ let v0 = vector<>[]; v0; + │ ^^^^^^---- + │ │ + │ Expected 1 type argument(s) but got 0 + │ Invalid 'vector' instantation + +error[E03007]: too many type arguments + ┌─ tests/move_check/naming/vector_literal_type_arity.move:5:18 + │ +5 │ let v2 = vector[0, false]; v2; + │ ^^^^^^--------------------- + │ │ + │ Expected 1 type argument(s) but got 2 + │ Invalid 'vector' instantation + +error[E04007]: incompatible types + ┌─ tests/move_check/naming/vector_literal_type_arity.move:5:18 + │ +5 │ let v2 = vector[0, false]; v2; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found: 'bool'. It is not compatible with the other type. + │ │ Found: integer. It is not compatible with the other type. + │ Invalid 'vector' instantiation. Incompatible argument diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_constraint_trailing_plus.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_constraint_trailing_plus.exp deleted file mode 100644 index 6fd97bf519ba9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_constraint_trailing_plus.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_constraint_trailing_plus.move:4:22 - │ -4 │ fun foo() {} - │ ^ Unexpected '>'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_constraint_trailing_plus.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_constraint_trailing_plus.snap new file mode 100644 index 0000000000000..595e9f72c1735 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_constraint_trailing_plus.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/ability_constraint_trailing_plus.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_constraint_trailing_plus.move:4:22 + │ +4 │ fun foo() {} + │ ^ Unexpected '>'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_infix_and_postfix.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_infix_and_postfix.exp deleted file mode 100644 index b605a12fc7393..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_infix_and_postfix.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_check/parser/ability_modifier_infix_and_postfix.move:5:34 - │ -5 │ struct Foo has copy, drop {} has store; - │ --- ^^^ Duplicate ability declaration. Abilities can be declared before or after the field declarations, but not both. - │ │ - │ Ability declaration previously given here - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/ability_modifier_infix_and_postfix.move:5:34 - │ -5 │ struct Foo has copy, drop {} has store; - │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_infix_and_postfix.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_infix_and_postfix.snap new file mode 100644 index 0000000000000..f9f112390f5b0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_infix_and_postfix.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/ability_modifier_infix_and_postfix.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_check/parser/ability_modifier_infix_and_postfix.move:5:34 + │ +5 │ struct Foo has copy, drop {} has store; + │ --- ^^^ Duplicate ability declaration. Abilities can be declared before or after the field declarations, but not both. + │ │ + │ Ability declaration previously given here + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/ability_modifier_infix_and_postfix.move:5:34 + │ +5 │ struct Foo has copy, drop {} has store; + │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_infix_postfix_no_fields.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_infix_postfix_no_fields.exp deleted file mode 100644 index b7a905f60a1f2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_infix_postfix_no_fields.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifier_infix_postfix_no_fields.move:5:38 - │ -5 │ native struct Foo has copy, drop has store; - │ ^^^ - │ │ - │ Unexpected 'has' - │ Expected one of: ',', '{', '(', or ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_infix_postfix_no_fields.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_infix_postfix_no_fields.snap new file mode 100644 index 0000000000000..0698069aadf0b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_infix_postfix_no_fields.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/ability_modifier_infix_postfix_no_fields.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifier_infix_postfix_no_fields.move:5:38 + │ +5 │ native struct Foo has copy, drop has store; + │ ^^^ + │ │ + │ Unexpected 'has' + │ Expected one of: ',', '{', '(', or ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_infix_postfix_no_fields_with_comma_sep.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_infix_postfix_no_fields_with_comma_sep.exp deleted file mode 100644 index af6fc556496ab..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_infix_postfix_no_fields_with_comma_sep.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifier_infix_postfix_no_fields_with_comma_sep.move:5:39 - │ -5 │ native struct Foo has copy, drop, has store; - │ ^^^ Unexpected 'has'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_infix_postfix_no_fields_with_comma_sep.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_infix_postfix_no_fields_with_comma_sep.snap new file mode 100644 index 0000000000000..556c437338139 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_infix_postfix_no_fields_with_comma_sep.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/ability_modifier_infix_postfix_no_fields_with_comma_sep.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifier_infix_postfix_no_fields_with_comma_sep.move:5:39 + │ +5 │ native struct Foo has copy, drop, has store; + │ ^^^ Unexpected 'has'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_invalid_infix_with_valid_postfix.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_invalid_infix_with_valid_postfix.exp deleted file mode 100644 index ffe0610baf4d6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_invalid_infix_with_valid_postfix.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifier_invalid_infix_with_valid_postfix.move:4:20 - │ -4 │ struct Foo has {} has copy; - │ ^ Unexpected '{'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/ability_modifier_invalid_infix_with_valid_postfix.move:4:23 - │ -4 │ struct Foo has {} has copy; - │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_invalid_infix_with_valid_postfix.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_invalid_infix_with_valid_postfix.snap new file mode 100644 index 0000000000000..9f0e1a9d31945 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_invalid_infix_with_valid_postfix.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/ability_modifier_invalid_infix_with_valid_postfix.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifier_invalid_infix_with_valid_postfix.move:4:20 + │ +4 │ struct Foo has {} has copy; + │ ^ Unexpected '{'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/ability_modifier_invalid_infix_with_valid_postfix.move:4:23 + │ +4 │ struct Foo has {} has copy; + │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_no_abilities.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_no_abilities.exp deleted file mode 100644 index 006f8ae3fc544..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_no_abilities.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifier_no_abilities.move:4:20 - │ -4 │ struct Foo has {} - │ ^ Unexpected '{'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_no_abilities.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_no_abilities.snap new file mode 100644 index 0000000000000..97523439f2037 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_no_abilities.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/ability_modifier_no_abilities.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifier_no_abilities.move:4:20 + │ +4 │ struct Foo has {} + │ ^ Unexpected '{'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_missing_commas.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_missing_commas.exp deleted file mode 100644 index 227eec6393615..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_missing_commas.exp +++ /dev/null @@ -1,26 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/ability_modifier_postfix_missing_commas.move:5:19 - │ -5 │ struct Foo {} has store copy; - │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifier_postfix_missing_commas.move:5:29 - │ -5 │ struct Foo {} has store copy; - │ ^^^^ - │ │ - │ Unexpected 'copy' - │ Expected one of: ',' or ';' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifier_postfix_missing_commas.move:8:1 - │ -8 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_missing_commas.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_missing_commas.snap new file mode 100644 index 0000000000000..f9655092d064f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_missing_commas.snap @@ -0,0 +1,33 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_missing_commas.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/ability_modifier_postfix_missing_commas.move:5:19 + │ +5 │ struct Foo {} has store copy; + │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifier_postfix_missing_commas.move:5:29 + │ +5 │ struct Foo {} has store copy; + │ ^^^^ + │ │ + │ Unexpected 'copy' + │ Expected one of: ',' or ';' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifier_postfix_missing_commas.move:8:1 + │ +8 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_missing_semi_multiple_structs.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_missing_semi_multiple_structs.exp deleted file mode 100644 index ce8542bfb9355..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_missing_semi_multiple_structs.exp +++ /dev/null @@ -1,17 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/ability_modifier_postfix_missing_semi_multiple_structs.move:5:19 - │ -5 │ struct Foo {} has store - │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifier_postfix_missing_semi_multiple_structs.move:6:5 - │ -6 │ struct Bar has key {} - │ ^^^^^^ - │ │ - │ Unexpected 'struct' - │ Expected one of: ',' or ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_missing_semi_multiple_structs.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_missing_semi_multiple_structs.snap new file mode 100644 index 0000000000000..88efb4817c2c9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_missing_semi_multiple_structs.snap @@ -0,0 +1,24 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_missing_semi_multiple_structs.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/ability_modifier_postfix_missing_semi_multiple_structs.move:5:19 + │ +5 │ struct Foo {} has store + │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifier_postfix_missing_semi_multiple_structs.move:6:5 + │ +6 │ struct Bar has key {} + │ ^^^^^^ + │ │ + │ Unexpected 'struct' + │ Expected one of: ',' or ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_abilities_no_semi.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_abilities_no_semi.exp deleted file mode 100644 index da4345cb7fead..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_abilities_no_semi.exp +++ /dev/null @@ -1,23 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/ability_modifier_postfix_no_abilities_no_semi.move:5:19 - │ -5 │ struct Foo {} has - │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifier_postfix_no_abilities_no_semi.move:6:1 - │ -6 │ } - │ ^ Unexpected '}'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifier_postfix_no_abilities_no_semi.move:8:1 - │ -8 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_abilities_no_semi.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_abilities_no_semi.snap new file mode 100644 index 0000000000000..e6eb7b5a53308 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_abilities_no_semi.snap @@ -0,0 +1,30 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_abilities_no_semi.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/ability_modifier_postfix_no_abilities_no_semi.move:5:19 + │ +5 │ struct Foo {} has + │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifier_postfix_no_abilities_no_semi.move:6:1 + │ +6 │ } + │ ^ Unexpected '}'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifier_postfix_no_abilities_no_semi.move:8:1 + │ +8 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_abilities_with_semi.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_abilities_with_semi.exp deleted file mode 100644 index aea73fe2dc90f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_abilities_with_semi.exp +++ /dev/null @@ -1,23 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/ability_modifier_postfix_no_abilities_with_semi.move:5:19 - │ -5 │ struct Foo {} has; - │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifier_postfix_no_abilities_with_semi.move:5:22 - │ -5 │ struct Foo {} has; - │ ^ Unexpected ';'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifier_postfix_no_abilities_with_semi.move:8:1 - │ -8 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_abilities_with_semi.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_abilities_with_semi.snap new file mode 100644 index 0000000000000..f6197c01e1a7e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_abilities_with_semi.snap @@ -0,0 +1,30 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_abilities_with_semi.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/ability_modifier_postfix_no_abilities_with_semi.move:5:19 + │ +5 │ struct Foo {} has; + │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifier_postfix_no_abilities_with_semi.move:5:22 + │ +5 │ struct Foo {} has; + │ ^ Unexpected ';'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifier_postfix_no_abilities_with_semi.move:8:1 + │ +8 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_fields.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_fields.exp deleted file mode 100644 index 316ba20826ad6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_fields.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifier_postfix_no_fields.move:5:38 - │ -5 │ native struct Foo has copy, drop has store; - │ ^^^ - │ │ - │ Unexpected 'has' - │ Expected one of: ',', '{', '(', or ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_fields.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_fields.snap new file mode 100644 index 0000000000000..07076add61d53 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_fields.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_fields.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifier_postfix_no_fields.move:5:38 + │ +5 │ native struct Foo has copy, drop has store; + │ ^^^ + │ │ + │ Unexpected 'has' + │ Expected one of: ',', '{', '(', or ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_semi.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_semi.exp deleted file mode 100644 index d86e6e1320507..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_semi.exp +++ /dev/null @@ -1,26 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/ability_modifier_postfix_no_semi.move:5:19 - │ -5 │ struct Foo {} has store - │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifier_postfix_no_semi.move:6:1 - │ -6 │ } - │ ^ - │ │ - │ Unexpected '}' - │ Expected one of: ',' or ';' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifier_postfix_no_semi.move:8:1 - │ -8 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_semi.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_semi.snap new file mode 100644 index 0000000000000..38e91489ca345 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_semi.snap @@ -0,0 +1,33 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_no_semi.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/ability_modifier_postfix_no_semi.move:5:19 + │ +5 │ struct Foo {} has store + │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifier_postfix_no_semi.move:6:1 + │ +6 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected one of: ',' or ';' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifier_postfix_no_semi.move:8:1 + │ +8 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_with_semi.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_with_semi.exp deleted file mode 100644 index 150c6b26e0886..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_with_semi.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/ability_modifier_postfix_with_semi.move:4:19 - │ -4 │ struct Foo {} has store; - │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_with_semi.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_with_semi.snap new file mode 100644 index 0000000000000..54012f9de32d8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_with_semi.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/ability_modifier_postfix_with_semi.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/ability_modifier_postfix_with_semi.move:4:19 + │ +4 │ struct Foo {} has store; + │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_trailing_comma.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_trailing_comma.exp deleted file mode 100644 index 54573205faca1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_trailing_comma.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifier_trailing_comma.move:4:32 - │ -4 │ struct Foo has copy, drop, {} - │ ^ Unexpected '{'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_trailing_comma.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_trailing_comma.snap new file mode 100644 index 0000000000000..9e7889e04d249 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifier_trailing_comma.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/ability_modifier_trailing_comma.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifier_trailing_comma.move:4:32 + │ +4 │ struct Foo has copy, drop, {} + │ ^ Unexpected '{'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifies_infix_no_abilities_postfix.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifies_infix_no_abilities_postfix.exp deleted file mode 100644 index 35abb513bd7f1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifies_infix_no_abilities_postfix.exp +++ /dev/null @@ -1,31 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_check/parser/ability_modifies_infix_no_abilities_postfix.move:4:28 - │ -4 │ struct Foo has copy {} has; - │ --- ^^^ Duplicate ability declaration. Abilities can be declared before or after the field declarations, but not both. - │ │ - │ Ability declaration previously given here - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/ability_modifies_infix_no_abilities_postfix.move:4:28 - │ -4 │ struct Foo has copy {} has; - │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifies_infix_no_abilities_postfix.move:4:31 - │ -4 │ struct Foo has copy {} has; - │ ^ Unexpected ';'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifies_infix_no_abilities_postfix.move:7:1 - │ -7 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifies_infix_no_abilities_postfix.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifies_infix_no_abilities_postfix.snap new file mode 100644 index 0000000000000..f5e586cf1d0de --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifies_infix_no_abilities_postfix.snap @@ -0,0 +1,38 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/ability_modifies_infix_no_abilities_postfix.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_check/parser/ability_modifies_infix_no_abilities_postfix.move:4:28 + │ +4 │ struct Foo has copy {} has; + │ --- ^^^ Duplicate ability declaration. Abilities can be declared before or after the field declarations, but not both. + │ │ + │ Ability declaration previously given here + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/ability_modifies_infix_no_abilities_postfix.move:4:28 + │ +4 │ struct Foo has copy {} has; + │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifies_infix_no_abilities_postfix.move:4:31 + │ +4 │ struct Foo has copy {} has; + │ ^ Unexpected ';'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifies_infix_no_abilities_postfix.move:7:1 + │ +7 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifies_no_abilities_infix_postfix.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifies_no_abilities_infix_postfix.exp deleted file mode 100644 index f77298e9e09a3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifies_no_abilities_infix_postfix.exp +++ /dev/null @@ -1,29 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifies_no_abilities_infix_postfix.move:4:20 - │ -4 │ struct Foo has {} has; - │ ^ Unexpected '{'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/ability_modifies_no_abilities_infix_postfix.move:4:23 - │ -4 │ struct Foo has {} has; - │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifies_no_abilities_infix_postfix.move:4:26 - │ -4 │ struct Foo has {} has; - │ ^ Unexpected ';'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/ability_modifies_no_abilities_infix_postfix.move:8:1 - │ -8 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifies_no_abilities_infix_postfix.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifies_no_abilities_infix_postfix.snap new file mode 100644 index 0000000000000..8f71e42aa6c68 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/ability_modifies_no_abilities_infix_postfix.snap @@ -0,0 +1,36 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/ability_modifies_no_abilities_infix_postfix.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifies_no_abilities_infix_postfix.move:4:20 + │ +4 │ struct Foo has {} has; + │ ^ Unexpected '{'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/ability_modifies_no_abilities_infix_postfix.move:4:23 + │ +4 │ struct Foo has {} has; + │ ^^^ Postfix abilities are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifies_no_abilities_infix_postfix.move:4:26 + │ +4 │ struct Foo has {} has; + │ ^ Unexpected ';'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/ability_modifies_no_abilities_infix_postfix.move:8:1 + │ +8 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/address_misspelled.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/address_misspelled.exp deleted file mode 100644 index 8cb29c20ca4b0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/address_misspelled.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/address_misspelled.move:1:1 - │ -1 │ addrexx 0x1: - │ ^^^^^^^ Invalid code unit. Expected 'address' or 'module'. Got 'addrexx' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/address_misspelled.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/address_misspelled.snap new file mode 100644 index 0000000000000..dd3f88043c6e9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/address_misspelled.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/address_misspelled.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/address_misspelled.move:1:1 + │ +1 │ addrexx 0x1: + │ ^^^^^^^ Invalid code unit. Expected 'address' or 'module'. Got 'addrexx' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/address_not_hex.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/address_not_hex.snap new file mode 100644 index 0000000000000..ca7a716172691 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/address_not_hex.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/address_not_hex.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long.exp deleted file mode 100644 index 6e29aa1c69a78..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01005]: invalid address - ┌─ tests/move_check/parser/address_too_long.move:2:9 - │ -2 │ address 0x112233445566778899101122334455667788992011223344556677889930112233 { - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid address literal. The numeric value is too large. The maximum size is 32 bytes - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long.snap new file mode 100644 index 0000000000000..bc0a45c153490 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/address_too_long.move +--- +error[E01005]: invalid address + ┌─ tests/move_check/parser/address_too_long.move:2:9 + │ +2 │ address 0x112233445566778899101122334455667788992011223344556677889930112233 { + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid address literal. The numeric value is too large. The maximum size is 32 bytes diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long_decimal.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long_decimal.exp deleted file mode 100644 index 8f0d24db3652c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long_decimal.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01005]: invalid address - ┌─ tests/move_check/parser/address_too_long_decimal.move:1:9 - │ -1 │ address 340282366920938463463374607431768211456123451234512345123451234512345123451234576969869689 { - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid address literal. The numeric value is too large. The maximum size is 32 bytes - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long_decimal.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long_decimal.snap new file mode 100644 index 0000000000000..e5e30a60334e1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long_decimal.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/address_too_long_decimal.move +--- +error[E01005]: invalid address + ┌─ tests/move_check/parser/address_too_long_decimal.move:1:9 + │ +1 │ address 340282366920938463463374607431768211456123451234512345123451234512345123451234576969869689 { + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid address literal. The numeric value is too large. The maximum size is 32 bytes diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long_decimal_exp.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long_decimal_exp.exp deleted file mode 100644 index b21feb13ed836..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long_decimal_exp.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01005]: invalid address - ┌─ tests/move_check/parser/address_too_long_decimal_exp.move:4:18 - │ -4 │ let x = @3402823669209384634633746074317682114568097213470921387019238740912836510928347019247; x; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid address literal. The numeric value is too large. The maximum size is 32 bytes - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long_decimal_exp.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long_decimal_exp.snap new file mode 100644 index 0000000000000..132c1b72e5362 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long_decimal_exp.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/address_too_long_decimal_exp.move +--- +error[E01005]: invalid address + ┌─ tests/move_check/parser/address_too_long_decimal_exp.move:4:18 + │ +4 │ let x = @3402823669209384634633746074317682114568097213470921387019238740912836510928347019247; x; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid address literal. The numeric value is too large. The maximum size is 32 bytes diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long_exp.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long_exp.exp deleted file mode 100644 index 40b264ed8cff0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long_exp.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01005]: invalid address - ┌─ tests/move_check/parser/address_too_long_exp.move:4:18 - │ -4 │ let x = @0x112233445566778899101122334455667788992011223344556677889930112233; x; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid address literal. The numeric value is too large. The maximum size is 32 bytes - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long_exp.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long_exp.snap new file mode 100644 index 0000000000000..2a8ff691fd38d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/address_too_long_exp.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/address_too_long_exp.move +--- +error[E01005]: invalid address + ┌─ tests/move_check/parser/address_too_long_exp.move:4:18 + │ +4 │ let x = @0x112233445566778899101122334455667788992011223344556677889930112233; x; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid address literal. The numeric value is too large. The maximum size is 32 bytes diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_no_closing_bracket.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_no_closing_bracket.exp deleted file mode 100644 index 67ccfc115f03a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_no_closing_bracket.exp +++ /dev/null @@ -1,14 +0,0 @@ -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_no_closing_bracket.move:3:7 - │ -3 │ #[attr = 0 - │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/attribute_no_closing_bracket.move:4:5 - │ -3 │ #[attr = 0 - │ - To match this '[' -4 │ fun foo() {} - │ ^ Expected ']' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_no_closing_bracket.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_no_closing_bracket.snap new file mode 100644 index 0000000000000..a6ca70f08f8b4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_no_closing_bracket.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/attribute_no_closing_bracket.move +--- +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_no_closing_bracket.move:3:7 + │ +3 │ #[attr = 0 + │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/attribute_no_closing_bracket.move:4:5 + │ +3 │ #[attr = 0 + │ - To match this '[' +4 │ fun foo() {} + │ ^ Expected ']' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_num_sign_no_bracket.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_num_sign_no_bracket.exp deleted file mode 100644 index ee09f15b23647..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_num_sign_no_bracket.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/attribute_num_sign_no_bracket.move:4:5 - │ -4 │ fun foo() {} - │ ^^^ - │ │ - │ Unexpected 'fun' - │ Expected '[' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_num_sign_no_bracket.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_num_sign_no_bracket.snap new file mode 100644 index 0000000000000..6c8660581a7e0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_num_sign_no_bracket.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/attribute_num_sign_no_bracket.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/attribute_num_sign_no_bracket.move:4:5 + │ +4 │ fun foo() {} + │ ^^^ + │ │ + │ Unexpected 'fun' + │ Expected '[' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_placement.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_placement.exp deleted file mode 100644 index 4b3b1e0be6f9c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_placement.exp +++ /dev/null @@ -1,72 +0,0 @@ -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_placement.move:3:3 - │ -3 │ #[attr] - │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_placement.move:5:7 - │ -5 │ #[attr] - │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_placement.move:8:7 - │ -8 │ #[attr] - │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_placement.move:11:7 - │ -11 │ #[attr] - │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_placement.move:14:7 - │ -14 │ #[attr] - │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_placement.move:19:3 - │ -19 │ #[attr] - │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_placement.move:21:7 - │ -21 │ #[attr] - │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_placement.move:24:7 - │ -24 │ #[attr] - │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_placement.move:28:3 - │ -28 │ #[attr] - │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_placement.move:30:7 - │ -30 │ #[attr] - │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_placement.move:33:7 - │ -33 │ #[attr] - │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_placement.move:36:7 - │ -36 │ #[attr] - │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_placement.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_placement.snap new file mode 100644 index 0000000000000..8cca09fc96eed --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_placement.snap @@ -0,0 +1,79 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/attribute_placement.move +--- +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_placement.move:3:3 + │ +3 │ #[attr] + │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_placement.move:5:7 + │ +5 │ #[attr] + │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_placement.move:8:7 + │ +8 │ #[attr] + │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_placement.move:11:7 + │ +11 │ #[attr] + │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_placement.move:14:7 + │ +14 │ #[attr] + │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_placement.move:19:3 + │ +19 │ #[attr] + │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_placement.move:21:7 + │ +21 │ #[attr] + │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_placement.move:24:7 + │ +24 │ #[attr] + │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_placement.move:28:3 + │ +28 │ #[attr] + │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_placement.move:30:7 + │ +30 │ #[attr] + │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_placement.move:33:7 + │ +33 │ #[attr] + │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_placement.move:36:7 + │ +36 │ #[attr] + │ ^^^^ Unknown attribute 'attr'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr)] diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_variants.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_variants.exp deleted file mode 100644 index 225f99afc2dd9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_variants.exp +++ /dev/null @@ -1,60 +0,0 @@ -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_variants.move:2:3 - │ -2 │ #[attr0] - │ ^^^^^ Unknown attribute 'attr0'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr0)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_variants.move:3:3 - │ -3 │ #[attr1=0, attr2=b"hello", attr3=x"0f", attr4=0x42, attr5(attr0, attr1, attr2(attr0, attr1=0))] - │ ^^^^^ Unknown attribute 'attr1'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr1)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_variants.move:3:12 - │ -3 │ #[attr1=0, attr2=b"hello", attr3=x"0f", attr4=0x42, attr5(attr0, attr1, attr2(attr0, attr1=0))] - │ ^^^^^ Unknown attribute 'attr2'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr2)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_variants.move:3:28 - │ -3 │ #[attr1=0, attr2=b"hello", attr3=x"0f", attr4=0x42, attr5(attr0, attr1, attr2(attr0, attr1=0))] - │ ^^^^^ Unknown attribute 'attr3'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr3)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_variants.move:3:41 - │ -3 │ #[attr1=0, attr2=b"hello", attr3=x"0f", attr4=0x42, attr5(attr0, attr1, attr2(attr0, attr1=0))] - │ ^^^^^ Unknown attribute 'attr4'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr4)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_variants.move:3:53 - │ -3 │ #[attr1=0, attr2=b"hello", attr3=x"0f", attr4=0x42, attr5(attr0, attr1, attr2(attr0, attr1=0))] - │ ^^^^^ Unknown attribute 'attr5'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr5)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_variants.move:4:3 - │ -4 │ #[bttr0=false, bttr1=0u8, bttr2=0u64, bttr3=0u128] - │ ^^^^^ Unknown attribute 'bttr0'. Custom attributes must be wrapped in 'ext', e.g. #[ext(bttr0)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_variants.move:4:16 - │ -4 │ #[bttr0=false, bttr1=0u8, bttr2=0u64, bttr3=0u128] - │ ^^^^^ Unknown attribute 'bttr1'. Custom attributes must be wrapped in 'ext', e.g. #[ext(bttr1)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_variants.move:4:27 - │ -4 │ #[bttr0=false, bttr1=0u8, bttr2=0u64, bttr3=0u128] - │ ^^^^^ Unknown attribute 'bttr2'. Custom attributes must be wrapped in 'ext', e.g. #[ext(bttr2)] - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/attribute_variants.move:4:39 - │ -4 │ #[bttr0=false, bttr1=0u8, bttr2=0u64, bttr3=0u128] - │ ^^^^^ Unknown attribute 'bttr3'. Custom attributes must be wrapped in 'ext', e.g. #[ext(bttr3)] - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_variants.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_variants.snap new file mode 100644 index 0000000000000..492c4180b6ba2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/attribute_variants.snap @@ -0,0 +1,67 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/attribute_variants.move +--- +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_variants.move:2:3 + │ +2 │ #[attr0] + │ ^^^^^ Unknown attribute 'attr0'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr0)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_variants.move:3:3 + │ +3 │ #[attr1=0, attr2=b"hello", attr3=x"0f", attr4=0x42, attr5(attr0, attr1, attr2(attr0, attr1=0))] + │ ^^^^^ Unknown attribute 'attr1'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr1)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_variants.move:3:12 + │ +3 │ #[attr1=0, attr2=b"hello", attr3=x"0f", attr4=0x42, attr5(attr0, attr1, attr2(attr0, attr1=0))] + │ ^^^^^ Unknown attribute 'attr2'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr2)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_variants.move:3:28 + │ +3 │ #[attr1=0, attr2=b"hello", attr3=x"0f", attr4=0x42, attr5(attr0, attr1, attr2(attr0, attr1=0))] + │ ^^^^^ Unknown attribute 'attr3'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr3)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_variants.move:3:41 + │ +3 │ #[attr1=0, attr2=b"hello", attr3=x"0f", attr4=0x42, attr5(attr0, attr1, attr2(attr0, attr1=0))] + │ ^^^^^ Unknown attribute 'attr4'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr4)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_variants.move:3:53 + │ +3 │ #[attr1=0, attr2=b"hello", attr3=x"0f", attr4=0x42, attr5(attr0, attr1, attr2(attr0, attr1=0))] + │ ^^^^^ Unknown attribute 'attr5'. Custom attributes must be wrapped in 'ext', e.g. #[ext(attr5)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_variants.move:4:3 + │ +4 │ #[bttr0=false, bttr1=0u8, bttr2=0u64, bttr3=0u128] + │ ^^^^^ Unknown attribute 'bttr0'. Custom attributes must be wrapped in 'ext', e.g. #[ext(bttr0)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_variants.move:4:16 + │ +4 │ #[bttr0=false, bttr1=0u8, bttr2=0u64, bttr3=0u128] + │ ^^^^^ Unknown attribute 'bttr1'. Custom attributes must be wrapped in 'ext', e.g. #[ext(bttr1)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_variants.move:4:27 + │ +4 │ #[bttr0=false, bttr1=0u8, bttr2=0u64, bttr3=0u128] + │ ^^^^^ Unknown attribute 'bttr2'. Custom attributes must be wrapped in 'ext', e.g. #[ext(bttr2)] + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/attribute_variants.move:4:39 + │ +4 │ #[bttr0=false, bttr1=0u8, bttr2=0u64, bttr3=0u128] + │ ^^^^^ Unknown attribute 'bttr3'. Custom attributes must be wrapped in 'ext', e.g. #[ext(bttr3)] diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/block_comments_inline.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/block_comments_inline.exp deleted file mode 100644 index 341e9838953db..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/block_comments_inline.exp +++ /dev/null @@ -1,18 +0,0 @@ -warning[W01004]: invalid documentation comment - ┌─ tests/move_check/parser/block_comments_inline.move:11:61 - │ -11 │ let /*comment*/s = S { /***/w, /**/x, /*comment*/y, /** doc */z }; - │ ^^^^^^^^ Documentation comment cannot be matched to a language item - -warning[W01004]: invalid documentation comment - ┌─ tests/move_check/parser/block_comments_inline.move:12:17 - │ -12 │ let S { /****/w, /**/x, /*comment*/y, /** doc */z } = /*comment*/s; - │ ^^^^ Documentation comment cannot be matched to a language item - -warning[W01004]: invalid documentation comment - ┌─ tests/move_check/parser/block_comments_inline.move:12:47 - │ -12 │ let S { /****/w, /**/x, /*comment*/y, /** doc */z } = /*comment*/s; - │ ^^^^^^^^ Documentation comment cannot be matched to a language item - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/block_comments_inline.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/block_comments_inline.snap new file mode 100644 index 0000000000000..bf96ff3d0dbed --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/block_comments_inline.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/block_comments_inline.move +--- +warning[W01004]: invalid documentation comment + ┌─ tests/move_check/parser/block_comments_inline.move:11:61 + │ +11 │ let /*comment*/s = S { /***/w, /**/x, /*comment*/y, /** doc */z }; + │ ^^^^^^^^ Documentation comment cannot be matched to a language item + +warning[W01004]: invalid documentation comment + ┌─ tests/move_check/parser/block_comments_inline.move:12:17 + │ +12 │ let S { /****/w, /**/x, /*comment*/y, /** doc */z } = /*comment*/s; + │ ^^^^ Documentation comment cannot be matched to a language item + +warning[W01004]: invalid documentation comment + ┌─ tests/move_check/parser/block_comments_inline.move:12:47 + │ +12 │ let S { /****/w, /**/x, /*comment*/y, /** doc */z } = /*comment*/s; + │ ^^^^^^^^ Documentation comment cannot be matched to a language item diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/borrow_mut_space.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/borrow_mut_space.exp deleted file mode 100644 index 9f2312a01989e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/borrow_mut_space.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E03009]: unbound variable - ┌─ tests/move_check/parser/borrow_mut_space.move:6:11 - │ -6 │ & mut x.f - │ ^^^ Unbound variable 'mut' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/borrow_mut_space.move:6:15 - │ -6 │ & mut x.f - │ ^ - │ │ - │ Unexpected 'x' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/borrow_mut_space.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/borrow_mut_space.snap new file mode 100644 index 0000000000000..eda77385deb0e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/borrow_mut_space.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/borrow_mut_space.move +--- +error[E03009]: unbound variable + ┌─ tests/move_check/parser/borrow_mut_space.move:6:11 + │ +6 │ & mut x.f + │ ^^^ Unbound variable 'mut' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/borrow_mut_space.move:6:15 + │ +6 │ & mut x.f + │ ^ + │ │ + │ Unexpected 'x' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/break_with_value.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/break_with_value.snap new file mode 100644 index 0000000000000..aafadb0867273 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/break_with_value.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/break_with_value.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_invalid_escaped_sequence.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_invalid_escaped_sequence.exp deleted file mode 100644 index f52303046bb33..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_invalid_escaped_sequence.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01007]: invalid byte string - ┌─ tests/move_check/parser/byte_string_invalid_escaped_sequence.move:3:15 - │ -3 │ b"libr\a" - │ ^^ Invalid escape sequence: '\a' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_invalid_escaped_sequence.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_invalid_escaped_sequence.snap new file mode 100644 index 0000000000000..f47678b408d2b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_invalid_escaped_sequence.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/byte_string_invalid_escaped_sequence.move +--- +error[E01007]: invalid byte string + ┌─ tests/move_check/parser/byte_string_invalid_escaped_sequence.move:3:15 + │ +3 │ b"libr\a" + │ ^^ Invalid escape sequence: '\a' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_invalid_hex.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_invalid_hex.exp deleted file mode 100644 index f1eb560842b10..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_invalid_hex.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01007]: invalid byte string - ┌─ tests/move_check/parser/byte_string_invalid_hex.move:3:18 - │ -3 │ b"diem \xG0" - │ ^ Invalid hexadecimal character: 'G' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_invalid_hex.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_invalid_hex.snap new file mode 100644 index 0000000000000..aedb4678af61a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_invalid_hex.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/byte_string_invalid_hex.move +--- +error[E01007]: invalid byte string + ┌─ tests/move_check/parser/byte_string_invalid_hex.move:3:18 + │ +3 │ b"diem \xG0" + │ ^ Invalid hexadecimal character: 'G' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_success.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_success.snap new file mode 100644 index 0000000000000..ec2c5c60136a6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_success.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/byte_string_success.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_token_eof1.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_token_eof1.exp deleted file mode 100644 index 0b93164900195..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_token_eof1.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01007]: invalid byte string - ┌─ tests/move_check/parser/byte_string_token_eof1.move:3:9 - │ -3 │ b"diem\" - │ ^^^^^^^^ Missing closing quote (") after byte string - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_token_eof1.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_token_eof1.snap new file mode 100644 index 0000000000000..6d3616cddca6f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_token_eof1.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/byte_string_token_eof1.move +--- +error[E01007]: invalid byte string + ┌─ tests/move_check/parser/byte_string_token_eof1.move:3:9 + │ +3 │ b"diem\" + │ ^^^^^^^^ Missing closing quote (") after byte string diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_token_eof2.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_token_eof2.exp deleted file mode 100644 index 9877efef9cdee..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_token_eof2.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01007]: invalid byte string - ┌─ tests/move_check/parser/byte_string_token_eof2.move:3:9 - │ -3 │ b"Diem - │ ^^^^^^ Missing closing quote (") after byte string - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_token_eof2.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_token_eof2.snap new file mode 100644 index 0000000000000..4749ef5a8d323 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_token_eof2.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/byte_string_token_eof2.move +--- +error[E01007]: invalid byte string + ┌─ tests/move_check/parser/byte_string_token_eof2.move:3:9 + │ +3 │ b"Diem + │ ^^^^^^ Missing closing quote (") after byte string diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_token_eof3.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_token_eof3.exp deleted file mode 100644 index 8d901b3d64c2b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_token_eof3.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E01007]: invalid byte string - ┌─ tests/move_check/parser/byte_string_token_eof3.move:3:11 - │ -3 │ b"\x0"; - │ ^^^ Invalid escape: '\x0'. Hex literals are represented by two symbols: [\x00-\xFF]. - -error[E01007]: invalid byte string - ┌─ tests/move_check/parser/byte_string_token_eof3.move:4:11 - │ -4 │ b"\x" - │ ^^ Invalid escape: '\x'. Hex literals are represented by two symbols: [\x00-\xFF]. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_token_eof3.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_token_eof3.snap new file mode 100644 index 0000000000000..05dbdca047308 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/byte_string_token_eof3.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/byte_string_token_eof3.move +--- +error[E01007]: invalid byte string + ┌─ tests/move_check/parser/byte_string_token_eof3.move:3:11 + │ +3 │ b"\x0"; + │ ^^^ Invalid escape: '\x0'. Hex literals are represented by two symbols: [\x00-\xFF]. + +error[E01007]: invalid byte string + ┌─ tests/move_check/parser/byte_string_token_eof3.move:4:11 + │ +4 │ b"\x" + │ ^^ Invalid escape: '\x'. Hex literals are represented by two symbols: [\x00-\xFF]. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/cast_other_types.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/cast_other_types.exp deleted file mode 100644 index 0f01723ce745d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/cast_other_types.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_check/parser/cast_other_types.move:4:10 - │ -4 │ (0 as ()); - │ ^ -- Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ │ - │ Invalid argument to 'as' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/parser/cast_other_types.move:5:10 - │ -5 │ (0 as &u64); - │ ^ ---- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ │ - │ Invalid argument to 'as' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/cast_other_types.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/cast_other_types.snap new file mode 100644 index 0000000000000..680e9571ba8b2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/cast_other_types.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/cast_other_types.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_check/parser/cast_other_types.move:4:10 + │ +4 │ (0 as ()); + │ ^ -- Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ │ + │ Invalid argument to 'as' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/parser/cast_other_types.move:5:10 + │ +5 │ (0 as &u64); + │ ^ ---- Found: '&u64'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ │ + │ Invalid argument to 'as' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/cast_type_with_type_args.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/cast_type_with_type_args.exp deleted file mode 100644 index 7dba6937cbe01..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/cast_type_with_type_args.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/cast_type_with_type_args.move:4:23 - │ -4 │ (0 as Cup ); - │ ^ - │ │ - │ Unexpected ')' - │ Expected an expression term - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/cast_type_with_type_args.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/cast_type_with_type_args.snap new file mode 100644 index 0000000000000..63cc721530a9f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/cast_type_with_type_args.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/cast_type_with_type_args.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/cast_type_with_type_args.move:4:23 + │ +4 │ (0 as Cup ); + │ ^ + │ │ + │ Unexpected ')' + │ Expected an expression term diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/comments_nested_unbalanced.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/comments_nested_unbalanced.exp deleted file mode 100644 index 180386f798e1b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/comments_nested_unbalanced.exp +++ /dev/null @@ -1,6 +0,0 @@ -warning[W01004]: invalid documentation comment - ┌─ tests/move_check/parser/comments_nested_unbalanced.move:1:4 - │ -1 │ /* /** /** * / */ /** */ - │ ^^^ Unclosed block comment - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/comments_nested_unbalanced.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/comments_nested_unbalanced.snap new file mode 100644 index 0000000000000..2acc54035227d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/comments_nested_unbalanced.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/comments_nested_unbalanced.move +--- +warning[W01004]: invalid documentation comment + ┌─ tests/move_check/parser/comments_nested_unbalanced.move:1:4 + │ +1 │ /* /** /** * / */ /** */ + │ ^^^ Unclosed block comment diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/comments_ok.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/comments_ok.snap new file mode 100644 index 0000000000000..c8be6790f3f37 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/comments_ok.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/comments_ok.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/comments_unbalanced.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/comments_unbalanced.exp deleted file mode 100644 index 3e2c3fba1aba8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/comments_unbalanced.exp +++ /dev/null @@ -1,6 +0,0 @@ -warning[W01004]: invalid documentation comment - ┌─ tests/move_check/parser/comments_unbalanced.move:3:5 - │ -3 │ /** This comment must be closed. - │ ^^^ Unclosed block comment - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/comments_unbalanced.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/comments_unbalanced.snap new file mode 100644 index 0000000000000..9a31c70ed9f1d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/comments_unbalanced.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/comments_unbalanced.move +--- +warning[W01004]: invalid documentation comment + ┌─ tests/move_check/parser/comments_unbalanced.move:3:5 + │ +3 │ /** This comment must be closed. + │ ^^^ Unclosed block comment diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_native.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_native.exp deleted file mode 100644 index c73dc03cf9847..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_native.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_check/parser/constant_native.move:3:5 - │ -3 │ native const Foo: u64 = 0; - │ ^^^^^^ Invalid constant declaration. 'native' is used only on functions or structs - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_native.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_native.snap new file mode 100644 index 0000000000000..668de0e217cfb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_native.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/constant_native.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_check/parser/constant_native.move:3:5 + │ +3 │ native const Foo: u64 = 0; + │ ^^^^^^ Invalid constant declaration. 'native' is used only on functions or structs diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_public.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_public.exp deleted file mode 100644 index 0a1a277b8d431..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_public.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_check/parser/constant_public.move:3:5 - │ -3 │ public const Foo: u64 = 0; - │ ^^^^^^ Invalid constant declaration. Constants cannot have visibility modifiers as they are always internal - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_public.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_public.snap new file mode 100644 index 0000000000000..bbfdadcd8b7d6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_public.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/constant_public.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_check/parser/constant_public.move:3:5 + │ +3 │ public const Foo: u64 = 0; + │ ^^^^^^ Invalid constant declaration. Constants cannot have visibility modifiers as they are always internal diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_type_annotation_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_type_annotation_invalid.exp deleted file mode 100644 index 2274e5c5070dc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_type_annotation_invalid.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/constant_type_annotation_invalid.move:2:25 - │ -2 │ const EThreadMaxxed = 1; - │ ^ Expected a type annotation for this constant, e.g. 'EThreadMaxxed: ' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_type_annotation_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_type_annotation_invalid.snap new file mode 100644 index 0000000000000..c32a7d99dfa02 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_type_annotation_invalid.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/constant_type_annotation_invalid.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/constant_type_annotation_invalid.move:2:25 + │ +2 │ const EThreadMaxxed = 1; + │ ^ Expected a type annotation for this constant, e.g. 'EThreadMaxxed: ' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_values.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_values.snap new file mode 100644 index 0000000000000..28cd8ae58f3be --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/constant_values.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/constant_values.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/constants_blocks.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/constants_blocks.exp deleted file mode 100644 index 85db8c1774146..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/constants_blocks.exp +++ /dev/null @@ -1,51 +0,0 @@ -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/parser/constants_blocks.move:5:23 - │ -5 │ const C1: u64 = { u() }; - │ ^^^ Module calls are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/parser/constants_blocks.move:7:24 - │ -7 │ const C3: bool = { loop () }; - │ ^^^^^^^ 'loop' expressions are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/parser/constants_blocks.move:8:22 - │ -8 │ const C4: u8 = { if (false) 0 else 1 }; - │ ^^^^^^^^^^^^^^^^^^^ 'if' expressions are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/parser/constants_blocks.move:9:40 - │ -9 │ const C5: vector> = { abort 0 }; - │ ^^^^^^^ 'abort' expressions are not supported in constants - -error[E04012]: invalid type for constant - ┌─ tests/move_check/parser/constants_blocks.move:11:15 - │ -11 │ const C7: () = { - │ ^^ - │ │ - │ Unpermitted constant type - │ Found: '()'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/parser/constants_blocks.move:12:9 - │ -12 │ let x = 0; - │ ^^^^^^^^^ 'let' declarations are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/parser/constants_blocks.move:13:9 - │ -13 │ let y = 1; - │ ^^^^^^^^^ 'let' declarations are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/parser/constants_blocks.move:19:9 - │ -19 │ u(); - │ ^^^ Module calls are not supported in constants - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/constants_blocks.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/constants_blocks.snap new file mode 100644 index 0000000000000..ec59c630b6b98 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/constants_blocks.snap @@ -0,0 +1,58 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/constants_blocks.move +--- +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/parser/constants_blocks.move:5:23 + │ +5 │ const C1: u64 = { u() }; + │ ^^^ Module calls are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/parser/constants_blocks.move:7:24 + │ +7 │ const C3: bool = { loop () }; + │ ^^^^^^^ 'loop' expressions are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/parser/constants_blocks.move:8:22 + │ +8 │ const C4: u8 = { if (false) 0 else 1 }; + │ ^^^^^^^^^^^^^^^^^^^ 'if' expressions are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/parser/constants_blocks.move:9:40 + │ +9 │ const C5: vector> = { abort 0 }; + │ ^^^^^^^ 'abort' expressions are not supported in constants + +error[E04012]: invalid type for constant + ┌─ tests/move_check/parser/constants_blocks.move:11:15 + │ +11 │ const C7: () = { + │ ^^ + │ │ + │ Unpermitted constant type + │ Found: '()'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/parser/constants_blocks.move:12:9 + │ +12 │ let x = 0; + │ ^^^^^^^^^ 'let' declarations are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/parser/constants_blocks.move:13:9 + │ +13 │ let y = 1; + │ ^^^^^^^^^ 'let' declarations are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/parser/constants_blocks.move:19:9 + │ +19 │ u(); + │ ^^^ Module calls are not supported in constants diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/constants_simple.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/constants_simple.exp deleted file mode 100644 index 918b879b6e89b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/constants_simple.exp +++ /dev/null @@ -1,30 +0,0 @@ -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/parser/constants_simple.move:5:21 - │ -5 │ const C1: u64 = u(); - │ ^^^ Module calls are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/parser/constants_simple.move:7:22 - │ -7 │ const C3: bool = loop (); - │ ^^^^^^^ 'loop' expressions are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/parser/constants_simple.move:8:20 - │ -8 │ const C4: u8 = if (cond) 0 else 1; - │ ^^^^^^^^^^^^^^^^^^ 'if' expressions are not supported in constants - -error[E03009]: unbound variable - ┌─ tests/move_check/parser/constants_simple.move:8:24 - │ -8 │ const C4: u8 = if (cond) 0 else 1; - │ ^^^^ Unbound variable 'cond' - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/parser/constants_simple.move:9:38 - │ -9 │ const C5: vector> = abort 0; - │ ^^^^^^^ 'abort' expressions are not supported in constants - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/constants_simple.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/constants_simple.snap new file mode 100644 index 0000000000000..00131f2924c2c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/constants_simple.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/constants_simple.move +--- +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/parser/constants_simple.move:5:21 + │ +5 │ const C1: u64 = u(); + │ ^^^ Module calls are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/parser/constants_simple.move:7:22 + │ +7 │ const C3: bool = loop (); + │ ^^^^^^^ 'loop' expressions are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/parser/constants_simple.move:8:20 + │ +8 │ const C4: u8 = if (cond) 0 else 1; + │ ^^^^^^^^^^^^^^^^^^ 'if' expressions are not supported in constants + +error[E03009]: unbound variable + ┌─ tests/move_check/parser/constants_simple.move:8:24 + │ +8 │ const C4: u8 = if (cond) 0 else 1; + │ ^^^^ Unbound variable 'cond' + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/parser/constants_simple.move:9:38 + │ +9 │ const C5: vector> = abort 0; + │ ^^^^^^^ 'abort' expressions are not supported in constants diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/constants_standalone_let.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/constants_standalone_let.exp deleted file mode 100644 index 232ac333b9a2d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/constants_standalone_let.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/constants_standalone_let.move:4:21 - │ -4 │ const C1: u64 = let x = 0; - │ ^^^ - │ │ - │ Unexpected 'let' - │ Expected an expression term - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/constants_standalone_let.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/constants_standalone_let.snap new file mode 100644 index 0000000000000..2dd87150055a6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/constants_standalone_let.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/constants_standalone_let.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/constants_standalone_let.move:4:21 + │ +4 │ const C1: u64 = let x = 0; + │ ^^^ + │ │ + │ Unexpected 'let' + │ Expected an expression term diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_as_term.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_as_term.snap new file mode 100644 index 0000000000000..72a3a37a2c5f1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_as_term.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/control_exp_as_term.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity.snap new file mode 100644 index 0000000000000..944b63d26f2ac --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/control_exp_associativity.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_else_after_if_block.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_else_after_if_block.exp deleted file mode 100644 index 2a9548ff14d9d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_else_after_if_block.exp +++ /dev/null @@ -1,39 +0,0 @@ -error[E04005]: expected a single type - ┌─ tests/move_check/parser/control_exp_associativity_else_after_if_block.move:13:9 - │ -13 │ if (cond) { s1 }.f else s2.f - │ ^^^^^^^^^^^^^^^^ - │ │ - │ Invalid dot access - │ Expected a single type, but found expression list type: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/parser/control_exp_associativity_else_after_if_block.move:13:9 - │ - 7 │ fun t(cond: bool, s1: S, s2: S) { - │ - Given: '0x42::M::S' - · -13 │ if (cond) { s1 }.f else s2.f - │ ^^^^^^^^^^^^^^^^ - │ │ - │ Invalid 'if'. The body of an 'if' without an 'else' must have type '()' - │ Expected: '()' - -error[E04009]: expected specific type - ┌─ tests/move_check/parser/control_exp_associativity_else_after_if_block.move:13:9 - │ -13 │ if (cond) { s1 }.f else s2.f - │ ^^^^^^^^^^^^^^^^^^ - │ │ - │ Unbound field 'f' - │ Expected a struct type in the current module but got: '()' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/control_exp_associativity_else_after_if_block.move:13:28 - │ -13 │ if (cond) { s1 }.f else s2.f - │ ^^^^ - │ │ - │ Unexpected 'else' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_else_after_if_block.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_else_after_if_block.snap new file mode 100644 index 0000000000000..88568bf1d177f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_else_after_if_block.snap @@ -0,0 +1,46 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/control_exp_associativity_else_after_if_block.move +--- +error[E04005]: expected a single type + ┌─ tests/move_check/parser/control_exp_associativity_else_after_if_block.move:13:9 + │ +13 │ if (cond) { s1 }.f else s2.f + │ ^^^^^^^^^^^^^^^^ + │ │ + │ Invalid dot access + │ Expected a single type, but found expression list type: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/parser/control_exp_associativity_else_after_if_block.move:13:9 + │ + 7 │ fun t(cond: bool, s1: S, s2: S) { + │ - Given: '0x42::M::S' + · +13 │ if (cond) { s1 }.f else s2.f + │ ^^^^^^^^^^^^^^^^ + │ │ + │ Invalid 'if'. The body of an 'if' without an 'else' must have type '()' + │ Expected: '()' + +error[E04009]: expected specific type + ┌─ tests/move_check/parser/control_exp_associativity_else_after_if_block.move:13:9 + │ +13 │ if (cond) { s1 }.f else s2.f + │ ^^^^^^^^^^^^^^^^^^ + │ │ + │ Unbound field 'f' + │ Expected a struct type in the current module but got: '()' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/control_exp_associativity_else_after_if_block.move:13:28 + │ +13 │ if (cond) { s1 }.f else s2.f + │ ^^^^ + │ │ + │ Unexpected 'else' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_field_access.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_field_access.snap new file mode 100644 index 0000000000000..c91e779b3e66e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_field_access.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/control_exp_associativity_field_access.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_typing_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_typing_invalid.exp deleted file mode 100644 index be79cfda6a95f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_typing_invalid.exp +++ /dev/null @@ -1,88 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/parser/control_exp_associativity_typing_invalid.move:12:9 - │ - 7 │ fun bar(): u64 { 0 } - │ --- Given: 'u64' - · -12 │ if (cond) bar() + 1; - │ ^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid 'if'. The body of an 'if' without an 'else' must have type '()' - │ Expected: '()' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/parser/control_exp_associativity_typing_invalid.move:15:9 - │ -15 │ if (cond) { foo() } + 1; - │ ^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid argument to '+' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/parser/control_exp_associativity_typing_invalid.move:15:29 - │ -15 │ if (cond) { foo() } + 1; - │ ------------------- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '+' - │ Found: '()'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/parser/control_exp_associativity_typing_invalid.move:15:31 - │ -15 │ if (cond) { foo() } + 1; - │ ------------------- ^ Invalid argument to '+' - │ │ - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/parser/control_exp_associativity_typing_invalid.move:19:22 - │ - 7 │ fun bar(): u64 { 0 } - │ --- Given: 'u64' - · -19 │ while (cond) bar() + 2; - │ ^^^^^^^^^ - │ │ - │ Invalid loop body - │ Expected: '()' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/parser/control_exp_associativity_typing_invalid.move:22:9 - │ -22 │ while (cond) { foo() } + 2; - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid argument to '+' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/parser/control_exp_associativity_typing_invalid.move:22:32 - │ -22 │ while (cond) { foo() } + 2; - │ ---------------------- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '+' - │ Found: '()'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/parser/control_exp_associativity_typing_invalid.move:22:34 - │ -22 │ while (cond) { foo() } + 2; - │ ---------------------- ^ Invalid argument to '+' - │ │ - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/parser/control_exp_associativity_typing_invalid.move:26:14 - │ - 7 │ fun bar(): u64 { 0 } - │ --- Given: 'u64' - · -26 │ loop bar() + 2; - │ ^^^^^^^^^ - │ │ - │ Invalid loop body - │ Expected: '()' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_typing_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_typing_invalid.snap new file mode 100644 index 0000000000000..b810c88261497 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_typing_invalid.snap @@ -0,0 +1,95 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/control_exp_associativity_typing_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/parser/control_exp_associativity_typing_invalid.move:12:9 + │ + 7 │ fun bar(): u64 { 0 } + │ --- Given: 'u64' + · +12 │ if (cond) bar() + 1; + │ ^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid 'if'. The body of an 'if' without an 'else' must have type '()' + │ Expected: '()' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/parser/control_exp_associativity_typing_invalid.move:15:9 + │ +15 │ if (cond) { foo() } + 1; + │ ^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid argument to '+' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/parser/control_exp_associativity_typing_invalid.move:15:29 + │ +15 │ if (cond) { foo() } + 1; + │ ------------------- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '+' + │ Found: '()'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/parser/control_exp_associativity_typing_invalid.move:15:31 + │ +15 │ if (cond) { foo() } + 1; + │ ------------------- ^ Invalid argument to '+' + │ │ + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/parser/control_exp_associativity_typing_invalid.move:19:22 + │ + 7 │ fun bar(): u64 { 0 } + │ --- Given: 'u64' + · +19 │ while (cond) bar() + 2; + │ ^^^^^^^^^ + │ │ + │ Invalid loop body + │ Expected: '()' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/parser/control_exp_associativity_typing_invalid.move:22:9 + │ +22 │ while (cond) { foo() } + 2; + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid argument to '+' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/parser/control_exp_associativity_typing_invalid.move:22:32 + │ +22 │ while (cond) { foo() } + 2; + │ ---------------------- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '+' + │ Found: '()'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/parser/control_exp_associativity_typing_invalid.move:22:34 + │ +22 │ while (cond) { foo() } + 2; + │ ---------------------- ^ Invalid argument to '+' + │ │ + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/parser/control_exp_associativity_typing_invalid.move:26:14 + │ + 7 │ fun bar(): u64 { 0 } + │ --- Given: 'u64' + · +26 │ loop bar() + 2; + │ ^^^^^^^^^ + │ │ + │ Invalid loop body + │ Expected: '()' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_unreachable_code.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_unreachable_code.exp deleted file mode 100644 index 9fc61237e01c4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_unreachable_code.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/parser/control_exp_associativity_unreachable_code.move:9:11 - │ -9 │ fun t(cond: bool): u64 { - │ ^^^^ Unused parameter 'cond'. Consider removing or prefixing with an underscore: '_cond' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/parser/control_exp_associativity_unreachable_code.move:11:13 - │ -11 │ 1 + loop { foo() } + 2; - │ ^^^^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_unreachable_code.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_unreachable_code.snap new file mode 100644 index 0000000000000..e5af93bbcc671 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/control_exp_associativity_unreachable_code.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/control_exp_associativity_unreachable_code.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/parser/control_exp_associativity_unreachable_code.move:9:11 + │ +9 │ fun t(cond: bool): u64 { + │ ^^^^ Unused parameter 'cond'. Consider removing or prefixing with an underscore: '_cond' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/parser/control_exp_associativity_unreachable_code.move:11:13 + │ +11 │ 1 + loop { foo() } + 2; + │ ^^^^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/copy_move_path.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/copy_move_path.exp deleted file mode 100644 index f0f418b6b4655..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/copy_move_path.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/copy_move_path.move:12:9 - │ -12 │ copy x.y.z; - │ ^^^^ Move 2024 paths are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/copy_move_path.move:13:9 - │ -13 │ move x.y.z; - │ ^^^^ Move 2024 paths are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/copy_move_path.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/copy_move_path.snap new file mode 100644 index 0000000000000..950e0519914ad --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/copy_move_path.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/copy_move_path.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/copy_move_path.move:12:9 + │ +12 │ copy x.y.z; + │ ^^^^ Move 2024 paths are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/copy_move_path.move:13:9 + │ +13 │ move x.y.z; + │ ^^^^ Move 2024 paths are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/decimal_address.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/decimal_address.snap new file mode 100644 index 0000000000000..99e06a6317573 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/decimal_address.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/decimal_address.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_annotations.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_annotations.snap new file mode 100644 index 0000000000000..fbf10bd5e0b4d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_annotations.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/doc_comments_annotations.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_annotations_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_annotations_invalid.exp deleted file mode 100644 index a52cf92552894..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_annotations_invalid.exp +++ /dev/null @@ -1,6 +0,0 @@ -warning[W01004]: invalid documentation comment - ┌─ tests/move_check/parser/doc_comments_annotations_invalid.move:2:5 - │ -2 │ /// Can't have doc comments inside an attribute. - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Documentation comment cannot be matched to a language item - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_annotations_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_annotations_invalid.snap new file mode 100644 index 0000000000000..a86362c2f38f9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_annotations_invalid.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/doc_comments_annotations_invalid.move +--- +warning[W01004]: invalid documentation comment + ┌─ tests/move_check/parser/doc_comments_annotations_invalid.move:2:5 + │ +2 │ /// Can't have doc comments inside an attribute. + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Documentation comment cannot be matched to a language item diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_placement.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_placement.exp deleted file mode 100644 index b9b15e8a62f2e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_placement.exp +++ /dev/null @@ -1,18 +0,0 @@ -warning[W01004]: invalid documentation comment - ┌─ tests/move_check/parser/doc_comments_placement.move:16:9 - │ -16 │ /// There can be no doc comment after last field. - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Documentation comment cannot be matched to a language item - -warning[W01004]: invalid documentation comment - ┌─ tests/move_check/parser/doc_comments_placement.move:19:5 - │ -19 │ /// There can be no doc comment after last module item. - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Documentation comment cannot be matched to a language item - -warning[W01004]: invalid documentation comment - ┌─ tests/move_check/parser/doc_comments_placement.move:22:1 - │ -22 │ /// There can be no doc comment at end of file. - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Documentation comment cannot be matched to a language item - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_placement.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_placement.snap new file mode 100644 index 0000000000000..5cf95c15bd871 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_placement.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/doc_comments_placement.move +--- +warning[W01004]: invalid documentation comment + ┌─ tests/move_check/parser/doc_comments_placement.move:16:9 + │ +16 │ /// There can be no doc comment after last field. + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Documentation comment cannot be matched to a language item + +warning[W01004]: invalid documentation comment + ┌─ tests/move_check/parser/doc_comments_placement.move:19:5 + │ +19 │ /// There can be no doc comment after last module item. + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Documentation comment cannot be matched to a language item + +warning[W01004]: invalid documentation comment + ┌─ tests/move_check/parser/doc_comments_placement.move:22:1 + │ +22 │ /// There can be no doc comment at end of file. + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Documentation comment cannot be matched to a language item diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_placement_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_placement_invalid.exp deleted file mode 100644 index 71b0f976d8553..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_placement_invalid.exp +++ /dev/null @@ -1,6 +0,0 @@ -warning[W01004]: invalid documentation comment - ┌─ tests/move_check/parser/doc_comments_placement_invalid.move:4:9 - │ -4 │ /// doc not attached - │ ^^^^^^^^^^^^^^^^^^^^ Documentation comment cannot be matched to a language item - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_placement_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_placement_invalid.snap new file mode 100644 index 0000000000000..d23bfe49e30ce --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/doc_comments_placement_invalid.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/doc_comments_placement_invalid.move +--- +warning[W01004]: invalid documentation comment + ┌─ tests/move_check/parser/doc_comments_placement_invalid.move:4:9 + │ +4 │ /// doc not attached + │ ^^^^^^^^^^^^^^^^^^^^ Documentation comment cannot be matched to a language item diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/duplicate_attributes.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/duplicate_attributes.exp deleted file mode 100644 index 47ddbce6d8f7b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/duplicate_attributes.exp +++ /dev/null @@ -1,36 +0,0 @@ -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/duplicate_attributes.move:2:7 - │ -2 │ #[a, a(x = 0)] - │ ^ Unknown attribute 'a'. Custom attributes must be wrapped in 'ext', e.g. #[ext(a)] - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/parser/duplicate_attributes.move:2:10 - │ -2 │ #[a, a(x = 0)] - │ - ^^^^^^^^ Duplicate attribute 'a' attached to the same item - │ │ - │ Attribute previously given here - -warning[W02018]: unknown attribute - ┌─ tests/move_check/parser/duplicate_attributes.move:5:7 - │ -5 │ #[b(a, a = 0, a(x = 1))] - │ ^ Unknown attribute 'b'. Custom attributes must be wrapped in 'ext', e.g. #[ext(b)] - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/parser/duplicate_attributes.move:5:12 - │ -5 │ #[b(a, a = 0, a(x = 1))] - │ - ^^^^^ Duplicate attribute 'a' attached to the same item - │ │ - │ Attribute previously given here - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/parser/duplicate_attributes.move:5:19 - │ -5 │ #[b(a, a = 0, a(x = 1))] - │ - ^^^^^^^^ Duplicate attribute 'a' attached to the same item - │ │ - │ Attribute previously given here - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/duplicate_attributes.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/duplicate_attributes.snap new file mode 100644 index 0000000000000..af2bc6d15aeb8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/duplicate_attributes.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/duplicate_attributes.move +--- +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/duplicate_attributes.move:2:7 + │ +2 │ #[a, a(x = 0)] + │ ^ Unknown attribute 'a'. Custom attributes must be wrapped in 'ext', e.g. #[ext(a)] + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/parser/duplicate_attributes.move:2:10 + │ +2 │ #[a, a(x = 0)] + │ - ^^^^^^^^ Duplicate attribute 'a' attached to the same item + │ │ + │ Attribute previously given here + +warning[W02018]: unknown attribute + ┌─ tests/move_check/parser/duplicate_attributes.move:5:7 + │ +5 │ #[b(a, a = 0, a(x = 1))] + │ ^ Unknown attribute 'b'. Custom attributes must be wrapped in 'ext', e.g. #[ext(b)] + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/parser/duplicate_attributes.move:5:12 + │ +5 │ #[b(a, a = 0, a(x = 1))] + │ - ^^^^^ Duplicate attribute 'a' attached to the same item + │ │ + │ Attribute previously given here + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/parser/duplicate_attributes.move:5:19 + │ +5 │ #[b(a, a = 0, a(x = 1))] + │ - ^^^^^^^^ Duplicate attribute 'a' attached to the same item + │ │ + │ Attribute previously given here diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/duplicate_entry_modifier.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/duplicate_entry_modifier.exp deleted file mode 100644 index f35cc63902987..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/duplicate_entry_modifier.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/parser/duplicate_entry_modifier.move:2:11 - │ -2 │ entry entry fun foo() {} - │ ----- ^^^^^ Duplicate 'entry' modifier - │ │ - │ 'entry' modifier previously given here - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/duplicate_entry_modifier.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/duplicate_entry_modifier.snap new file mode 100644 index 0000000000000..0feeb855a2d11 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/duplicate_entry_modifier.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/duplicate_entry_modifier.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/parser/duplicate_entry_modifier.move:2:11 + │ +2 │ entry entry fun foo() {} + │ ----- ^^^^^ Duplicate 'entry' modifier + │ │ + │ 'entry' modifier previously given here diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/empty_doc_comment.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/empty_doc_comment.snap new file mode 100644 index 0000000000000..2d60dfa168f87 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/empty_doc_comment.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/empty_doc_comment.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/empty_file.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/empty_file.snap new file mode 100644 index 0000000000000..08c577678c93d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/empty_file.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/empty_file.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/entry_const.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/entry_const.exp deleted file mode 100644 index cfe4bcbb91089..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/entry_const.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_check/parser/entry_const.move:3:5 - │ -3 │ entry const S: u64 = 0; - │ ^^^^^ Invalid constant declaration. 'entry' is used only on functions - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/entry_const.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/entry_const.snap new file mode 100644 index 0000000000000..fdc66f80ee2e9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/entry_const.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/entry_const.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_check/parser/entry_const.move:3:5 + │ +3 │ entry const S: u64 = 0; + │ ^^^^^ Invalid constant declaration. 'entry' is used only on functions diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/entry_function.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/entry_function.snap new file mode 100644 index 0000000000000..d353576b1ea8b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/entry_function.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/entry_function.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/entry_struct.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/entry_struct.exp deleted file mode 100644 index 59d08038acdd6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/entry_struct.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_check/parser/entry_struct.move:3:5 - │ -3 │ entry struct S {} - │ ^^^^^ Invalid struct declaration. 'entry' is used only on functions - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/entry_struct.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/entry_struct.snap new file mode 100644 index 0000000000000..a515aab2f2fe7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/entry_struct.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/entry_struct.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_check/parser/entry_struct.move:3:5 + │ +3 │ entry struct S {} + │ ^^^^^ Invalid struct declaration. 'entry' is used only on functions diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_abort_braces.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_abort_braces.snap new file mode 100644 index 0000000000000..1f75c59e2764f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_abort_braces.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/expr_abort_braces.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_abort_missing_value.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_abort_missing_value.exp deleted file mode 100644 index 4180c5d03a7ef..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_abort_missing_value.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/expr_abort_missing_value.move:4:22 - │ -4 │ if (v > 100) abort - │ ^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_abort_missing_value.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_abort_missing_value.snap new file mode 100644 index 0000000000000..7c1dde74f27f6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_abort_missing_value.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/expr_abort_missing_value.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/expr_abort_missing_value.move:4:22 + │ +4 │ if (v > 100) abort + │ ^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_if_braces.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_if_braces.snap new file mode 100644 index 0000000000000..88e82c16b1dfa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_if_braces.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/expr_if_braces.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_if_missing_parens.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_if_missing_parens.exp deleted file mode 100644 index 8662ae1ed3986..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_if_missing_parens.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/expr_if_missing_parens.move:4:12 - │ -4 │ if v < 3 () - │ ^ - │ │ - │ Unexpected 'v' - │ Expected '(' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_if_missing_parens.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_if_missing_parens.snap new file mode 100644 index 0000000000000..cc347086be809 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_if_missing_parens.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/expr_if_missing_parens.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/expr_if_missing_parens.move:4:12 + │ +4 │ if v < 3 () + │ ^ + │ │ + │ Unexpected 'v' + │ Expected '(' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_loop_braces.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_loop_braces.snap new file mode 100644 index 0000000000000..51930b3137c8c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_loop_braces.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/expr_loop_braces.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_return_braces.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_return_braces.snap new file mode 100644 index 0000000000000..05522a8f08639 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_return_braces.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/expr_return_braces.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_return_missing_value.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_return_missing_value.snap new file mode 100644 index 0000000000000..2fa0b66ff050c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_return_missing_value.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/expr_return_missing_value.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_unary_negation.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_unary_negation.exp deleted file mode 100644 index f3fb8cdbb9c71..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_unary_negation.exp +++ /dev/null @@ -1,36 +0,0 @@ -error[E04016]: too few arguments - ┌─ tests/move_check/parser/expr_unary_negation.move:5:5 - │ -5 │ assert!(((1 - -2) == 3) && (-(1 - 2) == 1), 100); - │ ^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 0 argument(s) here - │ Invalid call of 'assert'. The call expected 2 argument(s) but got 0 - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/expr_unary_negation.move:5:19 - │ -5 │ assert!(((1 - -2) == 3) && (-(1 - 2) == 1), 100); - │ ^ - │ │ - │ Unexpected '-' - │ Expected an expression term - -error[E04007]: incompatible types - ┌─ tests/move_check/parser/expr_unary_negation.move:5:23 - │ -5 │ assert!(((1 - -2) == 3) && (-(1 - 2) == 1), 100); - │ ----------------- ^^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '==' - │ Found: '()'. It is not compatible with the other type. - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/expr_unary_negation.move:5:27 - │ -5 │ assert!(((1 - -2) == 3) && (-(1 - 2) == 1), 100); - │ ^ - │ │ - │ Unexpected ')' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_unary_negation.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_unary_negation.snap new file mode 100644 index 0000000000000..09b1591f7e9d6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_unary_negation.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/expr_unary_negation.move +--- +error[E04016]: too few arguments + ┌─ tests/move_check/parser/expr_unary_negation.move:5:5 + │ +5 │ assert!(((1 - -2) == 3) && (-(1 - 2) == 1), 100); + │ ^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 0 argument(s) here + │ Invalid call of 'assert'. The call expected 2 argument(s) but got 0 + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/expr_unary_negation.move:5:19 + │ +5 │ assert!(((1 - -2) == 3) && (-(1 - 2) == 1), 100); + │ ^ + │ │ + │ Unexpected '-' + │ Expected an expression term + +error[E04007]: incompatible types + ┌─ tests/move_check/parser/expr_unary_negation.move:5:23 + │ +5 │ assert!(((1 - -2) == 3) && (-(1 - 2) == 1), 100); + │ ----------------- ^^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '==' + │ Found: '()'. It is not compatible with the other type. + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/expr_unary_negation.move:5:27 + │ +5 │ assert!(((1 - -2) == 3) && (-(1 - 2) == 1), 100); + │ ^ + │ │ + │ Unexpected ')' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_unary_ops.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_unary_ops.snap new file mode 100644 index 0000000000000..b3c3741fd6d24 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_unary_ops.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/expr_unary_ops.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_while_braces.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_while_braces.snap new file mode 100644 index 0000000000000..a2c1e005e6d6a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_while_braces.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/expr_while_braces.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_while_missing_parens.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_while_missing_parens.exp deleted file mode 100644 index f98b6300a7a1b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_while_missing_parens.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/expr_while_missing_parens.move:4:15 - │ -4 │ while v < 3 { v = v + 1 } - │ ^ - │ │ - │ Unexpected 'v' - │ Expected '(' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_while_missing_parens.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_while_missing_parens.snap new file mode 100644 index 0000000000000..b4e64de196bef --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/expr_while_missing_parens.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/expr_while_missing_parens.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/expr_while_missing_parens.move:4:15 + │ +4 │ while v < 3 { v = v + 1 } + │ ^ + │ │ + │ Unexpected 'v' + │ Expected '(' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_address_only.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_address_only.exp deleted file mode 100644 index 6257e7dce82e9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_address_only.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/friend_decl_address_only.move:3:12 - │ -3 │ friend 0x42; - │ ^^^^ Expected '::' after the anonymous address in this module access chain - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_address_only.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_address_only.snap new file mode 100644 index 0000000000000..d54605d24bb82 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_address_only.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/friend_decl_address_only.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/friend_decl_address_only.move:3:12 + │ +3 │ friend 0x42; + │ ^^^^ Expected '::' after the anonymous address in this module access chain diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_inside_function.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_inside_function.exp deleted file mode 100644 index 6901c2545ea8a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_inside_function.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/friend_decl_inside_function.move:6:9 - │ -6 │ friend 0x42::A; - │ ^^^^^^ - │ │ - │ Unexpected 'friend' - │ Expected an expression term - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/friend_decl_inside_function.move:9:1 - │ -9 │ } - │ ^ Invalid code unit. Expected 'address' or 'module'. Got '}' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_inside_function.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_inside_function.snap new file mode 100644 index 0000000000000..35afec7ca3782 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_inside_function.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/friend_decl_inside_function.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/friend_decl_inside_function.move:6:9 + │ +6 │ friend 0x42::A; + │ ^^^^^^ + │ │ + │ Unexpected 'friend' + │ Expected an expression term + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/friend_decl_inside_function.move:9:1 + │ +9 │ } + │ ^ Invalid code unit. Expected 'address' or 'module'. Got '}' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_missing_semicolon.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_missing_semicolon.exp deleted file mode 100644 index 3aeda3d380b26..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_missing_semicolon.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/friend_decl_missing_semicolon.move:6:1 - │ -6 │ } - │ ^ - │ │ - │ Unexpected '}' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_missing_semicolon.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_missing_semicolon.snap new file mode 100644 index 0000000000000..ba08338e0550c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_missing_semicolon.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/friend_decl_missing_semicolon.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/friend_decl_missing_semicolon.move:6:1 + │ +6 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_more_than_one_module.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_more_than_one_module.exp deleted file mode 100644 index d41f1aeebd2ad..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_more_than_one_module.exp +++ /dev/null @@ -1,17 +0,0 @@ -warning[W09001]: unused alias - ┌─ tests/move_check/parser/friend_decl_more_than_one_module.move:6:15 - │ -6 │ use 0x42::A; - │ ^ Unused 'use' of alias 'A'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/friend_decl_more_than_one_module.move:7:14 - │ -7 │ friend A 0x42::B; - │ ^^^^ - │ │ - │ Unexpected '0x42' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_more_than_one_module.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_more_than_one_module.snap new file mode 100644 index 0000000000000..fccd9feb3c93c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_more_than_one_module.snap @@ -0,0 +1,24 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/friend_decl_more_than_one_module.move +--- +warning[W09001]: unused alias + ┌─ tests/move_check/parser/friend_decl_more_than_one_module.move:6:15 + │ +6 │ use 0x42::A; + │ ^ Unused 'use' of alias 'A'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/friend_decl_more_than_one_module.move:7:14 + │ +7 │ friend A 0x42::B; + │ ^^^^ + │ │ + │ Unexpected '0x42' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_qualified_function.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_qualified_function.exp deleted file mode 100644 index 7d3eeb9aa57ef..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_qualified_function.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_check/parser/friend_decl_qualified_function.move:7:21 - │ -7 │ friend 0x42::A::a; - │ ^ Unexpected module member access. Expected a module identifier only - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_qualified_function.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_qualified_function.snap new file mode 100644 index 0000000000000..702c4cba1029e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_qualified_function.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/friend_decl_qualified_function.move +--- +error[E03006]: unexpected name in this position + ┌─ tests/move_check/parser/friend_decl_qualified_function.move:7:21 + │ +7 │ friend 0x42::A::a; + │ ^ Unexpected module member access. Expected a module identifier only diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_qualified_struct.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_qualified_struct.exp deleted file mode 100644 index b81bd32496f67..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_qualified_struct.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03006]: unexpected name in this position - ┌─ tests/move_check/parser/friend_decl_qualified_struct.move:7:21 - │ -7 │ friend 0x42::A::A; - │ ^ Unexpected module member access. Expected a module identifier only - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_qualified_struct.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_qualified_struct.snap new file mode 100644 index 0000000000000..ad8694f74d870 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_qualified_struct.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/friend_decl_qualified_struct.move +--- +error[E03006]: unexpected name in this position + ┌─ tests/move_check/parser/friend_decl_qualified_struct.move:7:21 + │ +7 │ friend 0x42::A::A; + │ ^ Unexpected module member access. Expected a module identifier only diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_valid.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_valid.snap new file mode 100644 index 0000000000000..e5614bd8c969d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/friend_decl_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/friend_decl_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_conflicting_visibility.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_conflicting_visibility.exp deleted file mode 100644 index b8e5ce074b39c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_conflicting_visibility.exp +++ /dev/null @@ -1,148 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/parser/function_conflicting_visibility.move:2:20 - │ -2 │ public(friend) public(package) fun t0() {} - │ -------------- ^^^^^^^^^^^^^^^ Duplicate 'public' modifier - │ │ - │ 'public' modifier previously given here - -error[E02016]: invalid visibility modifier - ┌─ tests/move_check/parser/function_conflicting_visibility.move:2:20 - │ - 2 │ public(friend) public(package) fun t0() {} - │ ^^^^^^^^^^^^^^^ Cannot mix 'package' and 'friend' visibilities in the same module - · -11 │ public(friend) public(friend) fun s2() {} - │ -------------- 'friend' visibility used here - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/function_conflicting_visibility.move:2:20 - │ -2 │ public(friend) public(package) fun t0() {} - │ ^^^^^^^^^^^^^^^ 'public(package)' is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/parser/function_conflicting_visibility.move:3:21 - │ -3 │ public(package) public(friend) fun t1() {} - │ --------------- ^^^^^^^^^^^^^^ Duplicate 'public' modifier - │ │ - │ 'public' modifier previously given here - -error[E02016]: invalid visibility modifier - ┌─ tests/move_check/parser/function_conflicting_visibility.move:3:21 - │ -3 │ public(package) public(friend) fun t1() {} - │ ^^^^^^^^^^^^^^ Cannot mix 'friend' and 'package' visibilities in the same module -4 │ public public(package) fun t2() {} - │ --------------- 'public(package)' visibility used here - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/parser/function_conflicting_visibility.move:4:12 - │ -4 │ public public(package) fun t2() {} - │ ------ ^^^^^^^^^^^^^^^ Duplicate 'public' modifier - │ │ - │ 'public' modifier previously given here - -error[E02016]: invalid visibility modifier - ┌─ tests/move_check/parser/function_conflicting_visibility.move:4:12 - │ - 4 │ public public(package) fun t2() {} - │ ^^^^^^^^^^^^^^^ Cannot mix 'package' and 'friend' visibilities in the same module - · -11 │ public(friend) public(friend) fun s2() {} - │ -------------- 'friend' visibility used here - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/function_conflicting_visibility.move:4:12 - │ -4 │ public public(package) fun t2() {} - │ ^^^^^^^^^^^^^^^ 'public(package)' is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/parser/function_conflicting_visibility.move:5:21 - │ -5 │ public(package) public fun t3() {} - │ --------------- ^^^^^^ Duplicate 'public' modifier - │ │ - │ 'public' modifier previously given here - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/parser/function_conflicting_visibility.move:6:12 - │ -6 │ public public(friend) fun t4() {} - │ ------ ^^^^^^^^^^^^^^ Duplicate 'public' modifier - │ │ - │ 'public' modifier previously given here - -error[E02016]: invalid visibility modifier - ┌─ tests/move_check/parser/function_conflicting_visibility.move:6:12 - │ -4 │ public public(package) fun t2() {} - │ --------------- 'public(package)' visibility used here -5 │ public(package) public fun t3() {} -6 │ public public(friend) fun t4() {} - │ ^^^^^^^^^^^^^^ Cannot mix 'friend' and 'package' visibilities in the same module - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/parser/function_conflicting_visibility.move:7:20 - │ -7 │ public(friend) public fun t5() {} - │ -------------- ^^^^^^ Duplicate 'public' modifier - │ │ - │ 'public' modifier previously given here - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/parser/function_conflicting_visibility.move:9:12 - │ -9 │ public public fun s0() {} - │ ------ ^^^^^^ Duplicate 'public' modifier - │ │ - │ 'public' modifier previously given here - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/parser/function_conflicting_visibility.move:10:21 - │ -10 │ public(package) public(package) fun s1() {} - │ --------------- ^^^^^^^^^^^^^^^ Duplicate 'public' modifier - │ │ - │ 'public' modifier previously given here - -error[E02016]: invalid visibility modifier - ┌─ tests/move_check/parser/function_conflicting_visibility.move:10:21 - │ -10 │ public(package) public(package) fun s1() {} - │ ^^^^^^^^^^^^^^^ Cannot mix 'package' and 'friend' visibilities in the same module -11 │ public(friend) public(friend) fun s2() {} - │ -------------- 'friend' visibility used here - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/function_conflicting_visibility.move:10:21 - │ -10 │ public(package) public(package) fun s1() {} - │ ^^^^^^^^^^^^^^^ 'public(package)' is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/parser/function_conflicting_visibility.move:11:20 - │ -11 │ public(friend) public(friend) fun s2() {} - │ -------------- ^^^^^^^^^^^^^^ Duplicate 'public' modifier - │ │ - │ 'public' modifier previously given here - -error[E02016]: invalid visibility modifier - ┌─ tests/move_check/parser/function_conflicting_visibility.move:11:20 - │ - 4 │ public public(package) fun t2() {} - │ --------------- 'public(package)' visibility used here - · -11 │ public(friend) public(friend) fun s2() {} - │ ^^^^^^^^^^^^^^ Cannot mix 'friend' and 'package' visibilities in the same module - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_conflicting_visibility.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_conflicting_visibility.snap new file mode 100644 index 0000000000000..f49cbaab180c3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_conflicting_visibility.snap @@ -0,0 +1,155 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_conflicting_visibility.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/parser/function_conflicting_visibility.move:2:20 + │ +2 │ public(friend) public(package) fun t0() {} + │ -------------- ^^^^^^^^^^^^^^^ Duplicate 'public' modifier + │ │ + │ 'public' modifier previously given here + +error[E02016]: invalid visibility modifier + ┌─ tests/move_check/parser/function_conflicting_visibility.move:2:20 + │ + 2 │ public(friend) public(package) fun t0() {} + │ ^^^^^^^^^^^^^^^ Cannot mix 'package' and 'friend' visibilities in the same module + · +11 │ public(friend) public(friend) fun s2() {} + │ -------------- 'friend' visibility used here + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/function_conflicting_visibility.move:2:20 + │ +2 │ public(friend) public(package) fun t0() {} + │ ^^^^^^^^^^^^^^^ 'public(package)' is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/parser/function_conflicting_visibility.move:3:21 + │ +3 │ public(package) public(friend) fun t1() {} + │ --------------- ^^^^^^^^^^^^^^ Duplicate 'public' modifier + │ │ + │ 'public' modifier previously given here + +error[E02016]: invalid visibility modifier + ┌─ tests/move_check/parser/function_conflicting_visibility.move:3:21 + │ +3 │ public(package) public(friend) fun t1() {} + │ ^^^^^^^^^^^^^^ Cannot mix 'friend' and 'package' visibilities in the same module +4 │ public public(package) fun t2() {} + │ --------------- 'public(package)' visibility used here + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/parser/function_conflicting_visibility.move:4:12 + │ +4 │ public public(package) fun t2() {} + │ ------ ^^^^^^^^^^^^^^^ Duplicate 'public' modifier + │ │ + │ 'public' modifier previously given here + +error[E02016]: invalid visibility modifier + ┌─ tests/move_check/parser/function_conflicting_visibility.move:4:12 + │ + 4 │ public public(package) fun t2() {} + │ ^^^^^^^^^^^^^^^ Cannot mix 'package' and 'friend' visibilities in the same module + · +11 │ public(friend) public(friend) fun s2() {} + │ -------------- 'friend' visibility used here + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/function_conflicting_visibility.move:4:12 + │ +4 │ public public(package) fun t2() {} + │ ^^^^^^^^^^^^^^^ 'public(package)' is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/parser/function_conflicting_visibility.move:5:21 + │ +5 │ public(package) public fun t3() {} + │ --------------- ^^^^^^ Duplicate 'public' modifier + │ │ + │ 'public' modifier previously given here + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/parser/function_conflicting_visibility.move:6:12 + │ +6 │ public public(friend) fun t4() {} + │ ------ ^^^^^^^^^^^^^^ Duplicate 'public' modifier + │ │ + │ 'public' modifier previously given here + +error[E02016]: invalid visibility modifier + ┌─ tests/move_check/parser/function_conflicting_visibility.move:6:12 + │ +4 │ public public(package) fun t2() {} + │ --------------- 'public(package)' visibility used here +5 │ public(package) public fun t3() {} +6 │ public public(friend) fun t4() {} + │ ^^^^^^^^^^^^^^ Cannot mix 'friend' and 'package' visibilities in the same module + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/parser/function_conflicting_visibility.move:7:20 + │ +7 │ public(friend) public fun t5() {} + │ -------------- ^^^^^^ Duplicate 'public' modifier + │ │ + │ 'public' modifier previously given here + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/parser/function_conflicting_visibility.move:9:12 + │ +9 │ public public fun s0() {} + │ ------ ^^^^^^ Duplicate 'public' modifier + │ │ + │ 'public' modifier previously given here + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/parser/function_conflicting_visibility.move:10:21 + │ +10 │ public(package) public(package) fun s1() {} + │ --------------- ^^^^^^^^^^^^^^^ Duplicate 'public' modifier + │ │ + │ 'public' modifier previously given here + +error[E02016]: invalid visibility modifier + ┌─ tests/move_check/parser/function_conflicting_visibility.move:10:21 + │ +10 │ public(package) public(package) fun s1() {} + │ ^^^^^^^^^^^^^^^ Cannot mix 'package' and 'friend' visibilities in the same module +11 │ public(friend) public(friend) fun s2() {} + │ -------------- 'friend' visibility used here + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/function_conflicting_visibility.move:10:21 + │ +10 │ public(package) public(package) fun s1() {} + │ ^^^^^^^^^^^^^^^ 'public(package)' is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/parser/function_conflicting_visibility.move:11:20 + │ +11 │ public(friend) public(friend) fun s2() {} + │ -------------- ^^^^^^^^^^^^^^ Duplicate 'public' modifier + │ │ + │ 'public' modifier previously given here + +error[E02016]: invalid visibility modifier + ┌─ tests/move_check/parser/function_conflicting_visibility.move:11:20 + │ + 4 │ public public(package) fun t2() {} + │ --------------- 'public(package)' visibility used here + · +11 │ public(friend) public(friend) fun s2() {} + │ ^^^^^^^^^^^^^^ Cannot mix 'friend' and 'package' visibilities in the same module diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_incomplete.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_incomplete.exp deleted file mode 100644 index 40dc50a549852..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_incomplete.exp +++ /dev/null @@ -1,36 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/function_incomplete.move:6:5 - │ -6 │ fun just_type_args - │ ^^^ - │ │ - │ Unexpected 'fun' - │ Expected '(' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/function_incomplete.move:8:5 - │ -8 │ fun just_param(_u: u64) - │ ^^^ - │ │ - │ Unexpected 'fun' - │ Expected '(' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/function_incomplete.move:10:5 - │ -10 │ fun just_ret(_u: u64): u64 - │ ^^^ - │ │ - │ Unexpected 'fun' - │ Expected '{' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/function_incomplete.move:12:5 - │ -12 │ fun everything(u: u64): u64 { - │ ^^^ - │ │ - │ Unexpected 'fun' - │ Expected '{' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_incomplete.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_incomplete.snap new file mode 100644 index 0000000000000..905afede55dcb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_incomplete.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_incomplete.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/function_incomplete.move:6:5 + │ +6 │ fun just_type_args + │ ^^^ + │ │ + │ Unexpected 'fun' + │ Expected '(' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/function_incomplete.move:8:5 + │ +8 │ fun just_param(_u: u64) + │ ^^^ + │ │ + │ Unexpected 'fun' + │ Expected '(' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/function_incomplete.move:10:5 + │ +10 │ fun just_ret(_u: u64): u64 + │ ^^^ + │ │ + │ Unexpected 'fun' + │ Expected '{' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/function_incomplete.move:12:5 + │ +12 │ fun everything(u: u64): u64 { + │ ^^^ + │ │ + │ Unexpected 'fun' + │ Expected '{' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_native_with_body.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_native_with_body.exp deleted file mode 100644 index 4bffeb7c6f62e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_native_with_body.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/function_native_with_body.move:3:21 - │ -3 │ native fun fn() {} - │ ^ - │ │ - │ Unexpected '{' - │ Expected ';' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/function_native_with_body.move:5:1 - │ -5 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_native_with_body.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_native_with_body.snap new file mode 100644 index 0000000000000..3ebb37af731c4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_native_with_body.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_native_with_body.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/function_native_with_body.move:3:21 + │ +3 │ native fun fn() {} + │ ^ + │ │ + │ Unexpected '{' + │ Expected ';' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/function_native_with_body.move:5:1 + │ +5 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_params_commas.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_params_commas.snap new file mode 100644 index 0000000000000..a8f7bc9106962 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_params_commas.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_params_commas.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_params_missing.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_params_missing.exp deleted file mode 100644 index bdfecb2e550c9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_params_missing.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/function_params_missing.move:3:12 - │ -3 │ fun fn { } - │ ^ - │ │ - │ Unexpected '{' - │ Expected '(' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_params_missing.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_params_missing.snap new file mode 100644 index 0000000000000..4a50850e1c2ef --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_params_missing.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_params_missing.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/function_params_missing.move:3:12 + │ +3 │ fun fn { } + │ ^ + │ │ + │ Unexpected '{' + │ Expected '(' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_public_native.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_public_native.snap new file mode 100644 index 0000000000000..8ec551330e963 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_public_native.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_public_native.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_return_trailing_comma.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_return_trailing_comma.snap new file mode 100644 index 0000000000000..7ed5ed481a5ba --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_return_trailing_comma.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_return_trailing_comma.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_return_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_return_type.snap new file mode 100644 index 0000000000000..45fd7d6fe4bc0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_return_type.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_return_type.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_return_type_missing.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_return_type_missing.exp deleted file mode 100644 index 50b9d4caf7198..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_return_type_missing.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/function_return_type_missing.move:3:14 - │ -3 │ fun f(): { } - │ ^ - │ │ - │ Unexpected '{' - │ Expected a type name - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_return_type_missing.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_return_type_missing.snap new file mode 100644 index 0000000000000..966373cef55e0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_return_type_missing.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_return_type_missing.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/function_return_type_missing.move:3:14 + │ +3 │ fun f(): { } + │ ^ + │ │ + │ Unexpected '{' + │ Expected a type name diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_empty.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_empty.snap new file mode 100644 index 0000000000000..b96cf4e95e4d9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_empty.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_type_empty.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_extra_comma.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_extra_comma.exp deleted file mode 100644 index ef0327c7dece6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_extra_comma.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/function_type_extra_comma.move:2:12 - │ -2 │ fun fn<,T>() { } // Test a comma before the first type parameter - │ ^ Unexpected ','. Expected a type parameter - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_extra_comma.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_extra_comma.snap new file mode 100644 index 0000000000000..fb6547f9d757c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_extra_comma.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_type_extra_comma.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/function_type_extra_comma.move:2:12 + │ +2 │ fun fn<,T>() { } // Test a comma before the first type parameter + │ ^ Unexpected ','. Expected a type parameter diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_missing_angle.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_missing_angle.exp deleted file mode 100644 index 39804ea21f29a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_missing_angle.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/function_type_missing_angle.move:3:19 - │ -3 │ fun fn' - │ │ - │ To match this '<' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_missing_angle.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_missing_angle.snap new file mode 100644 index 0000000000000..342bf078eaf89 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_missing_angle.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_type_missing_angle.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/function_type_missing_angle.move:3:19 + │ +3 │ fun fn' + │ │ + │ To match this '<' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_nested.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_nested.snap new file mode 100644 index 0000000000000..033926eaed3e7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_nested.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_type_nested.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_trailing_comma.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_trailing_comma.snap new file mode 100644 index 0000000000000..cdebda51a667d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_type_trailing_comma.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_type_trailing_comma.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_empty.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_empty.exp deleted file mode 100644 index d508f0f6ac9c8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_empty.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/function_visibility_empty.move:2:5 - │ -2 │ public() fun f() {} - │ ^^^^^^^^ Invalid visibility modifier. Consider removing it or using 'public', 'public(friend)' or 'public(package)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_empty.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_empty.snap new file mode 100644 index 0000000000000..425b7d316a3b0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_empty.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_visibility_empty.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/function_visibility_empty.move:2:5 + │ +2 │ public() fun f() {} + │ ^^^^^^^^ Invalid visibility modifier. Consider removing it or using 'public', 'public(friend)' or 'public(package)' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_friend.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_friend.snap new file mode 100644 index 0000000000000..f543c58dfe75a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_friend.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_visibility_friend.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_invalid.exp deleted file mode 100644 index daf7792ddfc19..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_invalid.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/function_visibility_invalid.move:2:5 - │ -2 │ public(invalid_modifier) fun f() {} - │ ^^^^^^^^^^^^^^^^^^^^^^^^ Invalid visibility modifier. Consider removing it or using 'public', 'public(friend)' or 'public(package)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_invalid.snap new file mode 100644 index 0000000000000..e64fca97e8678 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_invalid.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_visibility_invalid.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/function_visibility_invalid.move:2:5 + │ +2 │ public(invalid_modifier) fun f() {} + │ ^^^^^^^^^^^^^^^^^^^^^^^^ Invalid visibility modifier. Consider removing it or using 'public', 'public(friend)' or 'public(package)' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_multiple.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_multiple.exp deleted file mode 100644 index 875cd48c4efee..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_multiple.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/function_visibility_multiple.move:2:19 - │ -2 │ public(script script) fun f() {} - │ ^^^^^^ - │ │ - │ Unexpected 'script' - │ Expected ')' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_multiple.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_multiple.snap new file mode 100644 index 0000000000000..08e928c398536 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_visibility_multiple.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_visibility_multiple.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/function_visibility_multiple.move:2:19 + │ +2 │ public(script script) fun f() {} + │ ^^^^^^ + │ │ + │ Unexpected 'script' + │ Expected ')' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_without_body.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_without_body.exp deleted file mode 100644 index 2774b3238a6de..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_without_body.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/function_without_body.move:3:13 - │ -3 │ fun fn(); - │ ^ - │ │ - │ Unexpected ';' - │ Expected '{' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/function_without_body.move:5:1 - │ -5 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/function_without_body.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_without_body.snap new file mode 100644 index 0000000000000..c58c67f77bf82 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/function_without_body.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/function_without_body.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/function_without_body.move:3:13 + │ +3 │ fun fn(); + │ ^ + │ │ + │ Unexpected ';' + │ Expected '{' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/function_without_body.move:5:1 + │ +5 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/global_access.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/global_access.exp deleted file mode 100644 index c9ccfa1801244..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/global_access.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/global_access.move:6:24 - │ -6 │ let _ : bool = ::exists(0x0); - │ ^^ - │ │ - │ Unexpected '::' - │ Expected an expression term - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/global_access.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/global_access.snap new file mode 100644 index 0000000000000..6a465605521cc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/global_access.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/global_access.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/global_access.move:6:24 + │ +6 │ let _ : bool = ::exists(0x0); + │ ^^ + │ │ + │ Unexpected '::' + │ Expected an expression term diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/global_access_pack.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/global_access_pack.exp deleted file mode 100644 index 843e3f8c68141..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/global_access_pack.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/global_access_pack.move:3:9 - │ -3 │ ::S { } - │ ^^ - │ │ - │ Unexpected '::' - │ Expected an expression term - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/global_access_pack.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/global_access_pack.snap new file mode 100644 index 0000000000000..20d3b43ca83cd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/global_access_pack.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/global_access_pack.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/global_access_pack.move:3:9 + │ +3 │ ::S { } + │ ^^ + │ │ + │ Unexpected '::' + │ Expected an expression term diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/global_access_value.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/global_access_value.exp deleted file mode 100644 index dea99379caff9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/global_access_value.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/global_access_value.move:3:13 - │ -3 │ 1 + ::global_value - │ ^^ - │ │ - │ Unexpected '::' - │ Expected an expression term - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/global_access_value.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/global_access_value.snap new file mode 100644 index 0000000000000..35a2dc8f12095 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/global_access_value.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/global_access_value.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/global_access_value.move:3:13 + │ +3 │ 1 + ::global_value + │ ^^ + │ │ + │ Unexpected '::' + │ Expected an expression term diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring.snap new file mode 100644 index 0000000000000..f8f47154569d9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/hexstring.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring_missing_quote.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring_missing_quote.exp deleted file mode 100644 index 64247938efc5e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring_missing_quote.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01008]: invalid hex string - ┌─ tests/move_check/parser/hexstring_missing_quote.move:3:9 - │ -3 │ x"abcd - │ ^^^^^^ Missing closing quote (") after byte string - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring_missing_quote.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring_missing_quote.snap new file mode 100644 index 0000000000000..ae93b6450cafc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring_missing_quote.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/hexstring_missing_quote.move +--- +error[E01008]: invalid hex string + ┌─ tests/move_check/parser/hexstring_missing_quote.move:3:9 + │ +3 │ x"abcd + │ ^^^^^^ Missing closing quote (") after byte string diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring_token_eof1.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring_token_eof1.exp deleted file mode 100644 index b07714aa816a3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring_token_eof1.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E01008]: invalid hex string - ┌─ tests/move_check/parser/hexstring_token_eof1.move:3:9 - │ -3 │ x" - │ ^^ Missing closing quote (") after byte string - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/hexstring_token_eof1.move:4:1 - │ -4 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring_token_eof1.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring_token_eof1.snap new file mode 100644 index 0000000000000..2c671931e01aa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring_token_eof1.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/hexstring_token_eof1.move +--- +error[E01008]: invalid hex string + ┌─ tests/move_check/parser/hexstring_token_eof1.move:3:9 + │ +3 │ x" + │ ^^ Missing closing quote (") after byte string + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/hexstring_token_eof1.move:4:1 + │ +4 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring_token_eof2.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring_token_eof2.exp deleted file mode 100644 index a04174259ad53..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring_token_eof2.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E01008]: invalid hex string - ┌─ tests/move_check/parser/hexstring_token_eof2.move:3:9 - │ -3 │ x"abcd - │ ^^^^^^ Missing closing quote (") after byte string - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/hexstring_token_eof2.move:4:1 - │ -4 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring_token_eof2.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring_token_eof2.snap new file mode 100644 index 0000000000000..4e376ea635038 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/hexstring_token_eof2.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/hexstring_token_eof2.move +--- +error[E01008]: invalid hex string + ┌─ tests/move_check/parser/hexstring_token_eof2.move:3:9 + │ +3 │ x"abcd + │ ^^^^^^ Missing closing quote (") after byte string + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/hexstring_token_eof2.move:4:1 + │ +4 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_complex_expression.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_complex_expression.exp deleted file mode 100644 index 0538b533cf1df..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_complex_expression.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/invalid_call_lhs_complex_expression.move:3:29 - │ -3 │ (if (true) 5 else 0)(); - │ ^ - │ │ - │ Unexpected '(' - │ Expected ';' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/invalid_call_lhs_complex_expression.move:4:27 - │ -4 │ (while (false) {})(0, 1); - │ ^ - │ │ - │ Unexpected '(' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_complex_expression.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_complex_expression.snap new file mode 100644 index 0000000000000..d3b0addc322cc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_complex_expression.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/invalid_call_lhs_complex_expression.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/invalid_call_lhs_complex_expression.move:3:29 + │ +3 │ (if (true) 5 else 0)(); + │ ^ + │ │ + │ Unexpected '(' + │ Expected ';' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/invalid_call_lhs_complex_expression.move:4:27 + │ +4 │ (while (false) {})(0, 1); + │ ^ + │ │ + │ Unexpected '(' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_parens_around_name.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_parens_around_name.exp deleted file mode 100644 index d1d281f51c188..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_parens_around_name.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E03009]: unbound variable - ┌─ tests/move_check/parser/invalid_call_lhs_parens_around_name.move:3:10 - │ -3 │ (foo)() - │ ^^^ Unbound variable 'foo' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/invalid_call_lhs_parens_around_name.move:3:14 - │ -3 │ (foo)() - │ ^ - │ │ - │ Unexpected '(' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_parens_around_name.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_parens_around_name.snap new file mode 100644 index 0000000000000..2ff349205b6c3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_parens_around_name.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/invalid_call_lhs_parens_around_name.move +--- +error[E03009]: unbound variable + ┌─ tests/move_check/parser/invalid_call_lhs_parens_around_name.move:3:10 + │ +3 │ (foo)() + │ ^^^ Unbound variable 'foo' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/invalid_call_lhs_parens_around_name.move:3:14 + │ +3 │ (foo)() + │ ^ + │ │ + │ Unexpected '(' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_return.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_return.exp deleted file mode 100644 index 89356898a0db1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_return.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/invalid_call_lhs_return.move:3:20 - │ -3 │ (return ())(0, 1); - │ ^ - │ │ - │ Unexpected '(' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_return.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_return.snap new file mode 100644 index 0000000000000..e411f3add883e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_return.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/invalid_call_lhs_return.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/invalid_call_lhs_return.move:3:20 + │ +3 │ (return ())(0, 1); + │ ^ + │ │ + │ Unexpected '(' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_value.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_value.exp deleted file mode 100644 index f6294f34718ac..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_value.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/invalid_call_lhs_value.move:3:10 - │ -3 │ 5(); - │ ^ - │ │ - │ Unexpected '(' - │ Expected ';' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/invalid_call_lhs_value.move:4:10 - │ -4 │ 5(0, 1); - │ ^ - │ │ - │ Unexpected '(' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_value.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_value.snap new file mode 100644 index 0000000000000..3dd45ed8099ad --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_call_lhs_value.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/invalid_call_lhs_value.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/invalid_call_lhs_value.move:3:10 + │ +3 │ 5(); + │ ^ + │ │ + │ Unexpected '(' + │ Expected ';' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/invalid_call_lhs_value.move:4:10 + │ +4 │ 5(0, 1); + │ ^ + │ │ + │ Unexpected '(' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_character.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_character.exp deleted file mode 100644 index ccae2a21c03c1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_character.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01001]: invalid character - ┌─ tests/move_check/parser/invalid_character.move:1:12 - │ -1 │ address 0x1~ - │ ^ Unexpected character: '~' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_character.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_character.snap new file mode 100644 index 0000000000000..490327da53445 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_character.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/invalid_character.move +--- +error[E01001]: invalid character + ┌─ tests/move_check/parser/invalid_character.move:1:12 + │ +1 │ address 0x1~ + │ ^ Unexpected character: '~' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_character_emoji.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_character_emoji.exp deleted file mode 100644 index b8aba9dd39d75..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_character_emoji.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01001]: invalid character - ┌─ tests/move_check/parser/invalid_character_emoji.move:5:4 - │ -5 │ ❤️ - │ ^ Unexpected character: '\u{2764}' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_character_emoji.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_character_emoji.snap new file mode 100644 index 0000000000000..352ac910ca6f1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_character_emoji.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/invalid_character_emoji.move +--- +error[E01001]: invalid character + ┌─ tests/move_check/parser/invalid_character_emoji.move:5:4 + │ +5 │ ❤️ + │ ^ Unexpected character: '\u{2764}' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_character_non_ascii.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_character_non_ascii.exp deleted file mode 100644 index 573f68255b7f3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_character_non_ascii.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01001]: invalid character - ┌─ tests/move_check/parser/invalid_character_non_ascii.move:5:4 - │ -5 │ ф - │ ^ Unexpected character: 'ф' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_character_non_ascii.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_character_non_ascii.snap new file mode 100644 index 0000000000000..eb28d02b6dc13 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_character_non_ascii.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/invalid_character_non_ascii.move +--- +error[E01001]: invalid character + ┌─ tests/move_check/parser/invalid_character_non_ascii.move:5:4 + │ +5 │ ф + │ ^ Unexpected character: 'ф' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_named_address_assignment.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_named_address_assignment.exp deleted file mode 100644 index 08bdff024061f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_named_address_assignment.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/invalid_named_address_assignment.move:1:14 - │ -1 │ address Addr = 0x1; // Named address assignments are not allowed - │ ^ - │ │ - │ Unexpected '=' - │ Expected '{' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_named_address_assignment.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_named_address_assignment.snap new file mode 100644 index 0000000000000..8ae669597ed54 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_named_address_assignment.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/invalid_named_address_assignment.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/invalid_named_address_assignment.move:1:14 + │ +1 │ address Addr = 0x1; // Named address assignments are not allowed + │ ^ + │ │ + │ Unexpected '=' + │ Expected '{' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_named_address_declaration.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_named_address_declaration.exp deleted file mode 100644 index 1efe90ed2f5d7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_named_address_declaration.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/invalid_named_address_declaration.move:3:13 - │ -3 │ address Addr; - │ ^ - │ │ - │ Unexpected ';' - │ Expected '{' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_named_address_declaration.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_named_address_declaration.snap new file mode 100644 index 0000000000000..1f6f3f231d1ec --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_named_address_declaration.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/invalid_named_address_declaration.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/invalid_named_address_declaration.move:3:13 + │ +3 │ address Addr; + │ ^ + │ │ + │ Unexpected ';' + │ Expected '{' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_pack_mname_non_addr.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_pack_mname_non_addr.exp deleted file mode 100644 index f42030a5befa0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_pack_mname_non_addr.exp +++ /dev/null @@ -1,36 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/invalid_pack_mname_non_addr.move:4:14 - │ -4 │ false::M::S { } - │ ^^ - │ │ - │ Unexpected '::' - │ Expected ';' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/invalid_pack_mname_non_addr.move:8:9 - │ -8 │ fun baz()::baz()::M::S { } - │ ^^^ - │ │ - │ Unexpected 'fun' - │ Expected an expression term - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/invalid_pack_mname_non_addr.move:8:18 - │ -8 │ fun baz()::baz()::M::S { } - │ ^^ - │ │ - │ Unexpected '::' - │ Expected '{' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/invalid_pack_mname_non_addr.move:11:1 - │ -11 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_pack_mname_non_addr.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_pack_mname_non_addr.snap new file mode 100644 index 0000000000000..d194f76505548 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_pack_mname_non_addr.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/invalid_pack_mname_non_addr.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/invalid_pack_mname_non_addr.move:4:14 + │ +4 │ false::M::S { } + │ ^^ + │ │ + │ Unexpected '::' + │ Expected ';' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/invalid_pack_mname_non_addr.move:8:9 + │ +8 │ fun baz()::baz()::M::S { } + │ ^^^ + │ │ + │ Unexpected 'fun' + │ Expected an expression term + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/invalid_pack_mname_non_addr.move:8:18 + │ +8 │ fun baz()::baz()::M::S { } + │ ^^ + │ │ + │ Unexpected '::' + │ Expected '{' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/invalid_pack_mname_non_addr.move:11:1 + │ +11 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_tyarg_locs.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_tyarg_locs.exp deleted file mode 100644 index 7b48b42f250fd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_tyarg_locs.exp +++ /dev/null @@ -1,60 +0,0 @@ -error[E01016]: invalid name - ┌─ tests/move_check/parser/invalid_tyarg_locs.move:6:10 - │ -6 │ a::m::S { u: 0 } - │ ^^^^^ Invalid type argument position - │ - = Type arguments may only be used with module members - -error[E01016]: invalid name - ┌─ tests/move_check/parser/invalid_tyarg_locs.move:10:13 - │ -10 │ a::m::S { u: 0 } - │ ^^^^^ Invalid type argument position - │ - = Type arguments may only be used with module members - -error[E01016]: invalid name - ┌─ tests/move_check/parser/invalid_tyarg_locs.move:14:10 - │ -14 │ a::m::S { u: 0 } - │ ^^^^^ Invalid type argument position - │ - = Type arguments may only be used with module members - -error[E01016]: invalid name - ┌─ tests/move_check/parser/invalid_tyarg_locs.move:14:18 - │ -14 │ a::m::S { u: 0 } - │ ----- ^^^^^ Paths cannot include type arguments more than once - │ │ - │ Previous type arguments appeared here - │ - = Type arguments should only appear on module members - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/invalid_tyarg_locs.move:24:18 - │ -24 │ 0x42::m::S { u: 0 } - │ ^^ - │ │ - │ Unexpected '::' - │ Expected an expression term - -error[E01016]: invalid name - ┌─ tests/move_check/parser/invalid_tyarg_locs.move:28:16 - │ -28 │ 0x42::m::S { u: 0 } - │ ^^^^^ Invalid type argument position - │ - = Type arguments may only be used with module members - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/invalid_tyarg_locs.move:32:18 - │ -32 │ 0x42::m::S { u: 0 } - │ ^^ - │ │ - │ Unexpected '::' - │ Expected an expression term - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_tyarg_locs.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_tyarg_locs.snap new file mode 100644 index 0000000000000..fbccab2cd3297 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_tyarg_locs.snap @@ -0,0 +1,67 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/invalid_tyarg_locs.move +--- +error[E01016]: invalid name + ┌─ tests/move_check/parser/invalid_tyarg_locs.move:6:10 + │ +6 │ a::m::S { u: 0 } + │ ^^^^^ Invalid type argument position + │ + = Type arguments may only be used with module members + +error[E01016]: invalid name + ┌─ tests/move_check/parser/invalid_tyarg_locs.move:10:13 + │ +10 │ a::m::S { u: 0 } + │ ^^^^^ Invalid type argument position + │ + = Type arguments may only be used with module members + +error[E01016]: invalid name + ┌─ tests/move_check/parser/invalid_tyarg_locs.move:14:10 + │ +14 │ a::m::S { u: 0 } + │ ^^^^^ Invalid type argument position + │ + = Type arguments may only be used with module members + +error[E01016]: invalid name + ┌─ tests/move_check/parser/invalid_tyarg_locs.move:14:18 + │ +14 │ a::m::S { u: 0 } + │ ----- ^^^^^ Paths cannot include type arguments more than once + │ │ + │ Previous type arguments appeared here + │ + = Type arguments should only appear on module members + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/invalid_tyarg_locs.move:24:18 + │ +24 │ 0x42::m::S { u: 0 } + │ ^^ + │ │ + │ Unexpected '::' + │ Expected an expression term + +error[E01016]: invalid name + ┌─ tests/move_check/parser/invalid_tyarg_locs.move:28:16 + │ +28 │ 0x42::m::S { u: 0 } + │ ^^^^^ Invalid type argument position + │ + = Type arguments may only be used with module members + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/invalid_tyarg_locs.move:32:18 + │ +32 │ 0x42::m::S { u: 0 } + │ ^^ + │ │ + │ Unexpected '::' + │ Expected an expression term diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_unpack_assign_lhs_mdot_no_addr.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_unpack_assign_lhs_mdot_no_addr.exp deleted file mode 100644 index 3ffde1ad4a2ea..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_unpack_assign_lhs_mdot_no_addr.exp +++ /dev/null @@ -1,45 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/invalid_unpack_assign_lhs_mdot_no_addr.move:4:14 - │ -4 │ false::M { f } = 0; - │ ^^ - │ │ - │ Unexpected '::' - │ Expected ';' - -error[E03006]: unexpected name in this position - ┌─ tests/move_check/parser/invalid_unpack_assign_lhs_mdot_no_addr.move:7:9 - │ -7 │ 0::M { f } = 0; - │ ^^^^ - │ │ - │ Unexpected module identifier. A module identifier is not a valid type - │ Expected a module name - -error[E04005]: expected a single type - ┌─ tests/move_check/parser/invalid_unpack_assign_lhs_mdot_no_addr.move:10:9 - │ - 2 │ fun foo() { - │ --- Expected a single type, but found expression list type: '()' - · -10 │ foo().M { f } = 0; - │ ^^^^^ Invalid dot access - -error[E04009]: expected specific type - ┌─ tests/move_check/parser/invalid_unpack_assign_lhs_mdot_no_addr.move:10:9 - │ - 2 │ fun foo() { - │ --- Expected a struct type in the current module but got: '()' - · -10 │ foo().M { f } = 0; - │ ^^^^^^^ Unbound field 'M' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/invalid_unpack_assign_lhs_mdot_no_addr.move:10:17 - │ -10 │ foo().M { f } = 0; - │ ^ - │ │ - │ Unexpected '{' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_unpack_assign_lhs_mdot_no_addr.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_unpack_assign_lhs_mdot_no_addr.snap new file mode 100644 index 0000000000000..256f5ed4c9191 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_unpack_assign_lhs_mdot_no_addr.snap @@ -0,0 +1,52 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/invalid_unpack_assign_lhs_mdot_no_addr.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/invalid_unpack_assign_lhs_mdot_no_addr.move:4:14 + │ +4 │ false::M { f } = 0; + │ ^^ + │ │ + │ Unexpected '::' + │ Expected ';' + +error[E03006]: unexpected name in this position + ┌─ tests/move_check/parser/invalid_unpack_assign_lhs_mdot_no_addr.move:7:9 + │ +7 │ 0::M { f } = 0; + │ ^^^^ + │ │ + │ Unexpected module identifier. A module identifier is not a valid type + │ Expected a module name + +error[E04005]: expected a single type + ┌─ tests/move_check/parser/invalid_unpack_assign_lhs_mdot_no_addr.move:10:9 + │ + 2 │ fun foo() { + │ --- Expected a single type, but found expression list type: '()' + · +10 │ foo().M { f } = 0; + │ ^^^^^ Invalid dot access + +error[E04009]: expected specific type + ┌─ tests/move_check/parser/invalid_unpack_assign_lhs_mdot_no_addr.move:10:9 + │ + 2 │ fun foo() { + │ --- Expected a struct type in the current module but got: '()' + · +10 │ foo().M { f } = 0; + │ ^^^^^^^ Unbound field 'M' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/invalid_unpack_assign_lhs_mdot_no_addr.move:10:17 + │ +10 │ foo().M { f } = 0; + │ ^ + │ │ + │ Unexpected '{' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.exp deleted file mode 100644 index e57fd92050795..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.exp +++ /dev/null @@ -1,41 +0,0 @@ -error[E03003]: unbound module member - ┌─ tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.move:9:9 - │ -9 │ X::S () = 0; - │ ^^^^ Invalid module access. Unbound struct 'S' in module '0x2::X' - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.move:9:9 - │ -9 │ X::S () = 0; - │ ^^^^^^^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E03003]: unbound module member - ┌─ tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.move:11:9 - │ -11 │ X::S 0 = 0; - │ ^^^^ Invalid module access. Unbound module member 'S' in module '0x2::X' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.move:11:14 - │ -11 │ X::S 0 = 0; - │ ^ - │ │ - │ Unexpected '0' - │ Expected ';' - -error[E03003]: unbound module member - ┌─ tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.move:13:9 - │ -13 │ X::S { 0 } = 0; - │ ^^^^ Invalid module access. Unbound struct 'S' in module '0x2::X' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.move:13:16 - │ -13 │ X::S { 0 } = 0; - │ ^ Unexpected ''. Expected a field expression - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.snap new file mode 100644 index 0000000000000..c865893ea38cc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.snap @@ -0,0 +1,48 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.move +--- +error[E03003]: unbound module member + ┌─ tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.move:9:9 + │ +9 │ X::S () = 0; + │ ^^^^ Invalid module access. Unbound struct 'S' in module '0x2::X' + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.move:9:9 + │ +9 │ X::S () = 0; + │ ^^^^^^^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E03003]: unbound module member + ┌─ tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.move:11:9 + │ +11 │ X::S 0 = 0; + │ ^^^^ Invalid module access. Unbound module member 'S' in module '0x2::X' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.move:11:14 + │ +11 │ X::S 0 = 0; + │ ^ + │ │ + │ Unexpected '0' + │ Expected ';' + +error[E03003]: unbound module member + ┌─ tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.move:13:9 + │ +13 │ X::S { 0 } = 0; + │ ^^^^ Invalid module access. Unbound struct 'S' in module '0x2::X' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/invalid_unpack_assign_rhs_not_fields.move:13:16 + │ +13 │ X::S { 0 } = 0; + │ ^ Unexpected ''. Expected a field expression diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/less_than_space.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/less_than_space.exp deleted file mode 100644 index 524f093c372b5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/less_than_space.exp +++ /dev/null @@ -1,23 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/less_than_space.move:5:16 - │ -5 │ if (v< 10) return v; - │ ^^ Expected '::' after the anonymous address in this module access chain - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/less_than_space.move:5:28 - │ -5 │ if (v< 10) return v; - │ - ^ Expected '>' - │ │ - │ To match this '<' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/less_than_space.move:5:28 - │ -5 │ if (v< 10) return v; - │ ^ - │ │ - │ Unexpected ';' - │ Expected ')' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/less_than_space.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/less_than_space.snap new file mode 100644 index 0000000000000..fe875215f2a2b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/less_than_space.snap @@ -0,0 +1,30 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/less_than_space.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/less_than_space.move:5:16 + │ +5 │ if (v< 10) return v; + │ ^^ Expected '::' after the anonymous address in this module access chain + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/less_than_space.move:5:28 + │ +5 │ if (v< 10) return v; + │ - ^ Expected '>' + │ │ + │ To match this '<' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/less_than_space.move:5:28 + │ +5 │ if (v< 10) return v; + │ ^ + │ │ + │ Unexpected ';' + │ Expected ')' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding.snap new file mode 100644 index 0000000000000..30b55d07324b0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/let_binding.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_bad_name.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_bad_name.exp deleted file mode 100644 index c318d5bd8c099..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_bad_name.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/let_binding_bad_name.move:4:13 - │ -4 │ let {}; - │ ^ - │ │ - │ Unexpected '{' - │ Expected a variable or struct name - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_bad_name.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_bad_name.snap new file mode 100644 index 0000000000000..2cd8f4fee7422 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_bad_name.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/let_binding_bad_name.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/let_binding_bad_name.move:4:13 + │ +4 │ let {}; + │ ^ + │ │ + │ Unexpected '{' + │ Expected a variable or struct name diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_fields.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_fields.exp deleted file mode 100644 index 6607552c3cce0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_fields.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E04016]: too few arguments - ┌─ tests/move_check/parser/let_binding_missing_fields.move:6:13 - │ -6 │ let Generic = g; // Test a type name with no field bindings - │ ^^^^^^^^^^^^ Missing binding for field 'g' in '0x42::M::Generic' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/let_binding_missing_fields.move:6:26 - │ -6 │ let Generic = g; // Test a type name with no field bindings - │ ^ - │ │ - │ Unexpected '=' - │ Expected '{' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_fields.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_fields.snap new file mode 100644 index 0000000000000..14ced98cc0aa0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_fields.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/let_binding_missing_fields.move +--- +error[E04016]: too few arguments + ┌─ tests/move_check/parser/let_binding_missing_fields.move:6:13 + │ +6 │ let Generic = g; // Test a type name with no field bindings + │ ^^^^^^^^^^^^ Missing binding for field 'g' in '0x42::M::Generic' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/let_binding_missing_fields.move:6:26 + │ +6 │ let Generic = g; // Test a type name with no field bindings + │ ^ + │ │ + │ Unexpected '=' + │ Expected '{' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_paren.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_paren.exp deleted file mode 100644 index d1c18c1d26b9b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_paren.exp +++ /dev/null @@ -1,17 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/let_binding_missing_paren.move:3:23 - │ -3 │ let (_x1, _x2 = (1, 2); // Test a missing right parenthesis - │ ^ - │ │ - │ Unexpected '=' - │ Expected ',' or ')' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/let_binding_missing_paren.move:3:31 - │ -3 │ let (_x1, _x2 = (1, 2); // Test a missing right parenthesis - │ - ^ Expected ')' - │ │ - │ To match this '(' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_paren.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_paren.snap new file mode 100644 index 0000000000000..4eea894c88df6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_paren.snap @@ -0,0 +1,24 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/let_binding_missing_paren.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/let_binding_missing_paren.move:3:23 + │ +3 │ let (_x1, _x2 = (1, 2); // Test a missing right parenthesis + │ ^ + │ │ + │ Unexpected '=' + │ Expected ',' or ')' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/let_binding_missing_paren.move:3:31 + │ +3 │ let (_x1, _x2 = (1, 2); // Test a missing right parenthesis + │ - ^ Expected ')' + │ │ + │ To match this '(' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_semicolon.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_semicolon.exp deleted file mode 100644 index 2ec0f5b6d2836..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_semicolon.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/let_binding_missing_semicolon.move:4:5 - │ -4 │ } - │ ^ - │ │ - │ Unexpected '}' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_semicolon.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_semicolon.snap new file mode 100644 index 0000000000000..20b24a7bee399 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_semicolon.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/let_binding_missing_semicolon.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/let_binding_missing_semicolon.move:4:5 + │ +4 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_type.exp deleted file mode 100644 index aebde0c2a7618..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_type.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/let_binding_missing_type.move:3:17 - │ -3 │ let x : = 0; // Test a missing let type (but with a colon) - │ ^ - │ │ - │ Unexpected '=' - │ Expected a type name - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_type.snap new file mode 100644 index 0000000000000..e0338b224f6c2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_missing_type.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/let_binding_missing_type.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/let_binding_missing_type.move:3:17 + │ +3 │ let x : = 0; // Test a missing let type (but with a colon) + │ ^ + │ │ + │ Unexpected '=' + │ Expected a type name diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_trailing_comma.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_trailing_comma.snap new file mode 100644 index 0000000000000..737fcfe782d97 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/let_binding_trailing_comma.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/let_binding_trailing_comma.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/long_path.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/long_path.exp deleted file mode 100644 index 9b16064872ebf..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/long_path.exp +++ /dev/null @@ -1,32 +0,0 @@ -error[E01016]: invalid name - ┌─ tests/move_check/parser/long_path.move:7:19 - │ -7 │ struct A { y: 0x42::m::X::Y } - │ ^^^^^^^^^^^^^ Too many name segments - │ - = Names may only have 0, 1, or 2 segments separated by '::' - -error[E01016]: invalid name - ┌─ tests/move_check/parser/long_path.move:8:19 - │ -8 │ struct B { x: 0x42::m::X::X } - │ ^^^^^^^^^^^^^ Too many name segments - │ - = Names may only have 0, 1, or 2 segments separated by '::' - -error[E01016]: invalid name - ┌─ tests/move_check/parser/long_path.move:10:27 - │ -10 │ fun foo(): 0x42::m::X<042::m::Y::Y> { - │ ^^^^^^^^^^^^ Too many name segments - │ - = Names may only have 0, 1, or 2 segments separated by '::' - -error[E01016]: invalid name - ┌─ tests/move_check/parser/long_path.move:11:9 - │ -11 │ 0x42::m::X::X { t: abort 0 } - │ ^^^^^^^^^^^^^^^^^^ Too many name segments - │ - = Names may only have 0, 1, or 2 segments separated by '::' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/long_path.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/long_path.snap new file mode 100644 index 0000000000000..80367130e2f66 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/long_path.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/long_path.move +--- +error[E01016]: invalid name + ┌─ tests/move_check/parser/long_path.move:7:19 + │ +7 │ struct A { y: 0x42::m::X::Y } + │ ^^^^^^^^^^^^^ Too many name segments + │ + = Names may only have 0, 1, or 2 segments separated by '::' + +error[E01016]: invalid name + ┌─ tests/move_check/parser/long_path.move:8:19 + │ +8 │ struct B { x: 0x42::m::X::X } + │ ^^^^^^^^^^^^^ Too many name segments + │ + = Names may only have 0, 1, or 2 segments separated by '::' + +error[E01016]: invalid name + ┌─ tests/move_check/parser/long_path.move:10:27 + │ +10 │ fun foo(): 0x42::m::X<042::m::Y::Y> { + │ ^^^^^^^^^^^^ Too many name segments + │ + = Names may only have 0, 1, or 2 segments separated by '::' + +error[E01016]: invalid name + ┌─ tests/move_check/parser/long_path.move:11:9 + │ +11 │ 0x42::m::X::X { t: abort 0 } + │ ^^^^^^^^^^^^^^^^^^ Too many name segments + │ + = Names may only have 0, 1, or 2 segments separated by '::' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/match_okay.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/match_okay.snap new file mode 100644 index 0000000000000..9e36c0052f606 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/match_okay.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/match_okay.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/missing_angle_brace_close.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/missing_angle_brace_close.exp deleted file mode 100644 index 5feef5f969bd2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/missing_angle_brace_close.exp +++ /dev/null @@ -1,22 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/parser/missing_angle_brace_close.move:3:13 - │ -3 │ let x = t' - │ │ - │ To match this '<' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/missing_angle_brace_close.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/missing_angle_brace_close.snap new file mode 100644 index 0000000000000..6ee03e216e1ee --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/missing_angle_brace_close.snap @@ -0,0 +1,29 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/missing_angle_brace_close.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/parser/missing_angle_brace_close.move:3:13 + │ +3 │ let x = t' + │ │ + │ To match this '<' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/module_missing_lbrace.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/module_missing_lbrace.exp deleted file mode 100644 index 76c253ea23a00..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/module_missing_lbrace.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/module_missing_lbrace.move:2:5 - │ -2 │ fun f() {} - │ ^^^ - │ │ - │ Unexpected 'fun' - │ Expected '{' or ':' after the module name - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/module_missing_lbrace.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/module_missing_lbrace.snap new file mode 100644 index 0000000000000..44e96b5a29c78 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/module_missing_lbrace.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/module_missing_lbrace.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/module_missing_lbrace.move:2:5 + │ +2 │ fun f() {} + │ ^^^ + │ │ + │ Unexpected 'fun' + │ Expected '{' or ':' after the module name diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/module_missing_rbrace.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/module_missing_rbrace.exp deleted file mode 100644 index 049ed28ca67a1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/module_missing_rbrace.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/module_missing_rbrace.move:4:1 - │ -4 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/module_missing_rbrace.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/module_missing_rbrace.snap new file mode 100644 index 0000000000000..4402e8b27272d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/module_missing_rbrace.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/module_missing_rbrace.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/module_missing_rbrace.move:4:1 + │ +4 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/module_struct_after_func.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/module_struct_after_func.snap new file mode 100644 index 0000000000000..4964b1763d196 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/module_struct_after_func.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/module_struct_after_func.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/module_use_after_func.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/module_use_after_func.snap new file mode 100644 index 0000000000000..b2850e20a4ddf --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/module_use_after_func.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/module_use_after_func.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/module_use_after_struct.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/module_use_after_struct.snap new file mode 100644 index 0000000000000..a075c3b5dcc94 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/module_use_after_struct.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/module_use_after_struct.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/named_address.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/named_address.snap new file mode 100644 index 0000000000000..b804973969144 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/named_address.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/named_address.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/named_address_value.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/named_address_value.snap new file mode 100644 index 0000000000000..1f1ee17df22eb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/named_address_value.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/named_address_value.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/named_blocks_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/named_blocks_invalid.exp deleted file mode 100644 index 5498f2024d28b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/named_blocks_invalid.exp +++ /dev/null @@ -1,21 +0,0 @@ -error[E03009]: unbound variable - ┌─ tests/move_check/parser/named_blocks_invalid.move:4:9 - │ -4 │ name: { - │ ^^^^ Unbound variable 'name' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/named_blocks_invalid.move:4:13 - │ -4 │ name: { - │ ^ - │ │ - │ Unexpected ':' - │ Expected ';' - -error[E01001]: invalid character - ┌─ tests/move_check/parser/named_blocks_invalid.move:5:32 - │ -5 │ if (cond) { return 'name 10 }; - │ ^^^^^ Unexpected character (') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/named_blocks_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/named_blocks_invalid.snap new file mode 100644 index 0000000000000..af466fdb9246e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/named_blocks_invalid.snap @@ -0,0 +1,28 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/named_blocks_invalid.move +--- +error[E03009]: unbound variable + ┌─ tests/move_check/parser/named_blocks_invalid.move:4:9 + │ +4 │ name: { + │ ^^^^ Unbound variable 'name' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/named_blocks_invalid.move:4:13 + │ +4 │ name: { + │ ^ + │ │ + │ Unexpected ':' + │ Expected ';' + +error[E01001]: invalid character + ┌─ tests/move_check/parser/named_blocks_invalid.move:5:32 + │ +5 │ if (cond) { return 'name 10 }; + │ ^^^^^ Unexpected character (') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/named_blocks_invalid_2.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/named_blocks_invalid_2.exp deleted file mode 100644 index cba54510c3960..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/named_blocks_invalid_2.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/named_blocks_invalid_2.move:4:9 - │ -4 │ 'name { - │ ^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01001]: invalid character - ┌─ tests/move_check/parser/named_blocks_invalid_2.move:5:32 - │ -5 │ if (cond) { return 'name 10 }; - │ ^^^^^ Unexpected character (') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/named_blocks_invalid_2.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/named_blocks_invalid_2.snap new file mode 100644 index 0000000000000..e04192041373f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/named_blocks_invalid_2.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/named_blocks_invalid_2.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/named_blocks_invalid_2.move:4:9 + │ +4 │ 'name { + │ ^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01001]: invalid character + ┌─ tests/move_check/parser/named_blocks_invalid_2.move:5:32 + │ +5 │ if (cond) { return 'name 10 }; + │ ^^^^^ Unexpected character (') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/named_blocks_invalid_3.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/named_blocks_invalid_3.exp deleted file mode 100644 index ed7f3f6b3441f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/named_blocks_invalid_3.exp +++ /dev/null @@ -1,134 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:4:9 - │ -4 │ 'name: { - │ ^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01001]: invalid character - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:5:32 - │ -5 │ if (cond) { return 'name 10 }; - │ ^^^^^ Unexpected character (') - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:11:14 - │ -11 │ loop 'name: { - │ ^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01001]: invalid character - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:12:31 - │ -12 │ if (cond) { break 'name 10 }; - │ ^^^^^ Unexpected character (') - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:17:14 - │ -17 │ loop 'outer: { - │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:18:18 - │ -18 │ loop 'inner: { - │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01001]: invalid character - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:19:35 - │ -19 │ if (cond) { break 'outer 10 }; - │ ^^^^^^ Unexpected character (') - -error[E01001]: invalid character - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:20:35 - │ -20 │ if (cond) { break 'inner 20 }; - │ ^^^^^^ Unexpected character (') - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:26:22 - │ -26 │ while (cond) 'outer: { - │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:27:26 - │ -27 │ while (cond) 'inner: { - │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01001]: invalid character - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:28:35 - │ -28 │ if (cond) { break 'outer }; - │ ^^^^^^ Unexpected character (') - -error[E01001]: invalid character - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:29:35 - │ -29 │ if (cond) { break 'inner }; - │ ^^^^^^ Unexpected character (') - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:35:22 - │ -35 │ while (cond) 'outer: { - │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:36:22 - │ -36 │ let _x = 'inner: { - │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01001]: invalid character - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:37:35 - │ -37 │ if (cond) { break 'outer }; - │ ^^^^^^ Unexpected character (') - -error[E01001]: invalid character - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:38:36 - │ -38 │ if (cond) { return 'inner 10 }; - │ ^^^^^^ Unexpected character (') - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:45:14 - │ -45 │ loop 'l: { - │ ^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:46:18 - │ -46 │ loop 'l: { - │ ^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01001]: invalid character - ┌─ tests/move_check/parser/named_blocks_invalid_3.move:47:23 - │ -47 │ break 'l - │ ^^ Unexpected character (') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/named_blocks_invalid_3.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/named_blocks_invalid_3.snap new file mode 100644 index 0000000000000..36a42ff3d6984 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/named_blocks_invalid_3.snap @@ -0,0 +1,141 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/named_blocks_invalid_3.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:4:9 + │ +4 │ 'name: { + │ ^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01001]: invalid character + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:5:32 + │ +5 │ if (cond) { return 'name 10 }; + │ ^^^^^ Unexpected character (') + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:11:14 + │ +11 │ loop 'name: { + │ ^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01001]: invalid character + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:12:31 + │ +12 │ if (cond) { break 'name 10 }; + │ ^^^^^ Unexpected character (') + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:17:14 + │ +17 │ loop 'outer: { + │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:18:18 + │ +18 │ loop 'inner: { + │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01001]: invalid character + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:19:35 + │ +19 │ if (cond) { break 'outer 10 }; + │ ^^^^^^ Unexpected character (') + +error[E01001]: invalid character + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:20:35 + │ +20 │ if (cond) { break 'inner 20 }; + │ ^^^^^^ Unexpected character (') + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:26:22 + │ +26 │ while (cond) 'outer: { + │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:27:26 + │ +27 │ while (cond) 'inner: { + │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01001]: invalid character + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:28:35 + │ +28 │ if (cond) { break 'outer }; + │ ^^^^^^ Unexpected character (') + +error[E01001]: invalid character + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:29:35 + │ +29 │ if (cond) { break 'inner }; + │ ^^^^^^ Unexpected character (') + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:35:22 + │ +35 │ while (cond) 'outer: { + │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:36:22 + │ +36 │ let _x = 'inner: { + │ ^^^^^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01001]: invalid character + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:37:35 + │ +37 │ if (cond) { break 'outer }; + │ ^^^^^^ Unexpected character (') + +error[E01001]: invalid character + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:38:36 + │ +38 │ if (cond) { return 'inner 10 }; + │ ^^^^^^ Unexpected character (') + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:45:14 + │ +45 │ loop 'l: { + │ ^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:46:18 + │ +46 │ loop 'l: { + │ ^^ Block labels are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01001]: invalid character + ┌─ tests/move_check/parser/named_blocks_invalid_3.move:47:23 + │ +47 │ break 'l + │ ^^ Unexpected character (') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/native_main.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/native_main.snap new file mode 100644 index 0000000000000..7ff25a602ebf1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/native_main.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/native_main.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/nested_module_use.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/nested_module_use.snap new file mode 100644 index 0000000000000..b15608163e075 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/nested_module_use.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/nested_module_use.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/nested_module_use_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/nested_module_use_invalid.exp deleted file mode 100644 index 481db0ac2637c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/nested_module_use_invalid.exp +++ /dev/null @@ -1,50 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/parser/nested_module_use_invalid.move:18:59 - │ -18 │ use 0x42::{a::{A, Self as q, foo as bar}, b::{Self as q, B, baz as bar}}; - │ - ^ Duplicate module alias 'q'. Module aliases must be unique within a given namespace - │ │ - │ Alias previously defined here - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/parser/nested_module_use_invalid.move:18:72 - │ -18 │ use 0x42::{a::{A, Self as q, foo as bar}, b::{Self as q, B, baz as bar}}; - │ --- ^^^ Duplicate module member or alias 'bar'. Top level names in a namespace must be unique - │ │ - │ Alias previously defined here - -error[E03003]: unbound module member - ┌─ tests/move_check/parser/nested_module_use_invalid.move:21:20 - │ -21 │ let x: A = q::bar(); - │ ^^^^^^ Invalid module access. Unbound function 'bar' in module '0x42::b' - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/parser/nested_module_use_invalid.move:22:18 - │ -22 │ let _y = f(x); - │ ^ Unbound function 'f' in current scope - -warning[W09001]: unused alias - ┌─ tests/move_check/parser/nested_module_use_invalid.move:30:31 - │ -30 │ use 0x42::{a::{A, Self as q, foo as f}, a as g}; - │ ^ Unused 'use' of alias 'q'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/move_check/parser/nested_module_use_invalid.move:30:41 - │ -30 │ use 0x42::{a::{A, Self as q, foo as f}, a as g}; - │ ^ Unused 'use' of alias 'f'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/parser/nested_module_use_invalid.move:34:18 - │ -34 │ let _y = bar(x); - │ ^^^ Unbound function 'bar' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/nested_module_use_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/nested_module_use_invalid.snap new file mode 100644 index 0000000000000..eb72190692098 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/nested_module_use_invalid.snap @@ -0,0 +1,57 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/nested_module_use_invalid.move +--- +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/parser/nested_module_use_invalid.move:18:59 + │ +18 │ use 0x42::{a::{A, Self as q, foo as bar}, b::{Self as q, B, baz as bar}}; + │ - ^ Duplicate module alias 'q'. Module aliases must be unique within a given namespace + │ │ + │ Alias previously defined here + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/parser/nested_module_use_invalid.move:18:72 + │ +18 │ use 0x42::{a::{A, Self as q, foo as bar}, b::{Self as q, B, baz as bar}}; + │ --- ^^^ Duplicate module member or alias 'bar'. Top level names in a namespace must be unique + │ │ + │ Alias previously defined here + +error[E03003]: unbound module member + ┌─ tests/move_check/parser/nested_module_use_invalid.move:21:20 + │ +21 │ let x: A = q::bar(); + │ ^^^^^^ Invalid module access. Unbound function 'bar' in module '0x42::b' + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/parser/nested_module_use_invalid.move:22:18 + │ +22 │ let _y = f(x); + │ ^ Unbound function 'f' in current scope + +warning[W09001]: unused alias + ┌─ tests/move_check/parser/nested_module_use_invalid.move:30:31 + │ +30 │ use 0x42::{a::{A, Self as q, foo as f}, a as g}; + │ ^ Unused 'use' of alias 'q'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/move_check/parser/nested_module_use_invalid.move:30:41 + │ +30 │ use 0x42::{a::{A, Self as q, foo as f}, a as g}; + │ ^ Unused 'use' of alias 'f'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/parser/nested_module_use_invalid.move:34:18 + │ +34 │ let _y = bar(x); + │ ^^^ Unbound function 'bar' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/newline_crlf.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/newline_crlf.snap new file mode 100644 index 0000000000000..217d95adbb160 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/newline_crlf.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/newline_crlf.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/non_ascii_character_comment.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/non_ascii_character_comment.snap new file mode 100644 index 0000000000000..ce7d3271c7d4a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/non_ascii_character_comment.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/non_ascii_character_comment.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/non_ascii_character_string.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/non_ascii_character_string.snap new file mode 100644 index 0000000000000..713c7dc0bc60d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/non_ascii_character_string.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/non_ascii_character_string.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_leading.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_leading.exp deleted file mode 100644 index 2fbe91f8e3ecf..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_leading.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03009]: unbound variable - ┌─ tests/move_check/parser/num_hex_literal_underscore_leading.move:4:17 - │ -4 │ let _ = _0x0u8; - │ ^^^^^^ Unbound variable '_0x0u8' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_leading.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_leading.snap new file mode 100644 index 0000000000000..6056110be58f3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_leading.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_leading.move +--- +error[E03009]: unbound variable + ┌─ tests/move_check/parser/num_hex_literal_underscore_leading.move:4:17 + │ +4 │ let _ = _0x0u8; + │ ^^^^^^ Unbound variable '_0x0u8' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_leading_no_type_suffix.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_leading_no_type_suffix.exp deleted file mode 100644 index ef2cbd3553e2b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_leading_no_type_suffix.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03009]: unbound variable - ┌─ tests/move_check/parser/num_hex_literal_underscore_leading_no_type_suffix.move:4:17 - │ -4 │ let _ = _0x76; - │ ^^^^^ Unbound variable '_0x76' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_leading_no_type_suffix.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_leading_no_type_suffix.snap new file mode 100644 index 0000000000000..0f4f1b22c6b5a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_leading_no_type_suffix.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_leading_no_type_suffix.move +--- +error[E03009]: unbound variable + ┌─ tests/move_check/parser/num_hex_literal_underscore_leading_no_type_suffix.move:4:17 + │ +4 │ let _ = _0x76; + │ ^^^^^ Unbound variable '_0x76' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_trailing.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_trailing.exp deleted file mode 100644 index 04b118fd53ada..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_trailing.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/num_hex_literal_underscore_trailing.move:4:22 - │ -4 │ let _ = 0x0u8_; - │ ^ - │ │ - │ Unexpected '_' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_trailing.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_trailing.snap new file mode 100644 index 0000000000000..ed4ac126d0868 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_trailing.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/num_hex_literal_underscore_trailing.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/num_hex_literal_underscore_trailing.move:4:22 + │ +4 │ let _ = 0x0u8_; + │ ^ + │ │ + │ Unexpected '_' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore.snap new file mode 100644 index 0000000000000..ed80c35441e20 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/num_literal_underscore.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore_leading.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore_leading.exp deleted file mode 100644 index b56f3dfb7dd82..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore_leading.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03009]: unbound variable - ┌─ tests/move_check/parser/num_literal_underscore_leading.move:4:17 - │ -4 │ let _ = _0u8; - │ ^^^^ Unbound variable '_0u8' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore_leading.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore_leading.snap new file mode 100644 index 0000000000000..7e9c856e5f084 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore_leading.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/num_literal_underscore_leading.move +--- +error[E03009]: unbound variable + ┌─ tests/move_check/parser/num_literal_underscore_leading.move:4:17 + │ +4 │ let _ = _0u8; + │ ^^^^ Unbound variable '_0u8' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore_leading_no_type_suffix.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore_leading_no_type_suffix.exp deleted file mode 100644 index 7bb205e082d72..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore_leading_no_type_suffix.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03009]: unbound variable - ┌─ tests/move_check/parser/num_literal_underscore_leading_no_type_suffix.move:4:17 - │ -4 │ let _ = _76; - │ ^^^ Unbound variable '_76' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore_leading_no_type_suffix.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore_leading_no_type_suffix.snap new file mode 100644 index 0000000000000..2220975eef26b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore_leading_no_type_suffix.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/num_literal_underscore_leading_no_type_suffix.move +--- +error[E03009]: unbound variable + ┌─ tests/move_check/parser/num_literal_underscore_leading_no_type_suffix.move:4:17 + │ +4 │ let _ = _76; + │ ^^^ Unbound variable '_76' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore_trailing.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore_trailing.exp deleted file mode 100644 index 9a2c332fd391f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore_trailing.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/num_literal_underscore_trailing.move:4:20 - │ -4 │ let _ = 0u8_; - │ ^ - │ │ - │ Unexpected '_' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore_trailing.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore_trailing.snap new file mode 100644 index 0000000000000..9a5c1ef4885d8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/num_literal_underscore_trailing.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/num_literal_underscore_trailing.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/num_literal_underscore_trailing.move:4:20 + │ +4 │ let _ = 0u8_; + │ ^ + │ │ + │ Unexpected '_' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/phantom_param_invalid_keyword.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/phantom_param_invalid_keyword.exp deleted file mode 100644 index 47cd292affa23..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/phantom_param_invalid_keyword.exp +++ /dev/null @@ -1,17 +0,0 @@ -warning[W09006]: unused struct type parameter - ┌─ tests/move_check/parser/phantom_param_invalid_keyword.move:2:18 - │ -2 │ struct S { - │ ^^^^^^ Unused type parameter 'phatom'. Consider declaring it as phantom - │ - = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/phantom_param_invalid_keyword.move:2:25 - │ -2 │ struct S { - │ ^^ - │ │ - │ Unexpected 'T2' - │ Expected ',' or '>' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/phantom_param_invalid_keyword.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/phantom_param_invalid_keyword.snap new file mode 100644 index 0000000000000..cc9b6d301ba50 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/phantom_param_invalid_keyword.snap @@ -0,0 +1,24 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/phantom_param_invalid_keyword.move +--- +warning[W09006]: unused struct type parameter + ┌─ tests/move_check/parser/phantom_param_invalid_keyword.move:2:18 + │ +2 │ struct S { + │ ^^^^^^ Unused type parameter 'phatom'. Consider declaring it as phantom + │ + = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/phantom_param_invalid_keyword.move:2:25 + │ +2 │ struct S { + │ ^^ + │ │ + │ Unexpected 'T2' + │ Expected ',' or '>' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/phantom_param_missing_type_var.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/phantom_param_missing_type_var.exp deleted file mode 100644 index ab8cb2f0e6d34..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/phantom_param_missing_type_var.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/phantom_param_missing_type_var.move:2:33 - │ -2 │ struct S { - │ ^ - │ │ - │ Unexpected '>' - │ Expected an identifier - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/phantom_param_missing_type_var.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/phantom_param_missing_type_var.snap new file mode 100644 index 0000000000000..c98058948e00f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/phantom_param_missing_type_var.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/phantom_param_missing_type_var.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/phantom_param_missing_type_var.move:2:33 + │ +2 │ struct S { + │ ^ + │ │ + │ Unexpected '>' + │ Expected an identifier diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_declaration.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_declaration.exp deleted file mode 100644 index 04730eb49806f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_declaration.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/positional_struct_declaration.move:4:15 - │ -4 │ struct Foo(u64) - │ ^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_declaration.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_declaration.snap new file mode 100644 index 0000000000000..2a605d6c2b498 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_declaration.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/positional_struct_declaration.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/positional_struct_declaration.move:4:15 + │ +4 │ struct Foo(u64) + │ ^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_fields_keyword_field.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_fields_keyword_field.exp deleted file mode 100644 index b97065f3d625a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_fields_keyword_field.exp +++ /dev/null @@ -1,39 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_check/parser/positional_struct_fields_keyword_field.move:4:5 - │ -4 │ public struct Foo(fun) - │ ^^^^^^ Invalid struct declaration. Structs cannot have visibility modifiers as they are always 'public' - │ - = Starting in the Move 2024 edition visibility must be annotated on struct declarations. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/positional_struct_fields_keyword_field.move:4:5 - │ -4 │ public struct Foo(fun) - │ ^^^^^^ Struct visibility modifiers are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/positional_struct_fields_keyword_field.move:4:22 - │ -4 │ public struct Foo(fun) - │ ^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/positional_struct_fields_keyword_field.move:4:23 - │ -4 │ public struct Foo(fun) - │ ^ Unexpected 'fun'. Expected a type - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/positional_struct_fields_keyword_field.move:4:26 - │ -4 │ public struct Foo(fun) - │ ^ - │ │ - │ Unexpected ')' - │ Expected an identifier - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_fields_keyword_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_fields_keyword_field.snap new file mode 100644 index 0000000000000..83bc4206adb40 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_fields_keyword_field.snap @@ -0,0 +1,46 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/positional_struct_fields_keyword_field.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_check/parser/positional_struct_fields_keyword_field.move:4:5 + │ +4 │ public struct Foo(fun) + │ ^^^^^^ Invalid struct declaration. Structs cannot have visibility modifiers as they are always 'public' + │ + = Starting in the Move 2024 edition visibility must be annotated on struct declarations. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/positional_struct_fields_keyword_field.move:4:5 + │ +4 │ public struct Foo(fun) + │ ^^^^^^ Struct visibility modifiers are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/positional_struct_fields_keyword_field.move:4:22 + │ +4 │ public struct Foo(fun) + │ ^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/positional_struct_fields_keyword_field.move:4:23 + │ +4 │ public struct Foo(fun) + │ ^ Unexpected 'fun'. Expected a type + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/positional_struct_fields_keyword_field.move:4:26 + │ +4 │ public struct Foo(fun) + │ ^ + │ │ + │ Unexpected ')' + │ Expected an identifier diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_pack.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_pack.exp deleted file mode 100644 index 1c74aef4ab523..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_pack.exp +++ /dev/null @@ -1,29 +0,0 @@ -error[E03013]: positional call mismatch - ┌─ tests/move_check/parser/positional_struct_pack.move:7:17 - │ -4 │ struct Foo has drop { x: u64 } - │ --- 'Foo' is declared here - · -7 │ let _ = Foo(0); - │ ^^^^^^ Invalid struct instantiation. Named struct declarations require named instantiations - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/positional_struct_pack.move:7:17 - │ -7 │ let _ = Foo(0); - │ ^^^^^^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E03010]: unbound field - ┌─ tests/move_check/parser/positional_struct_pack.move:7:17 - │ -7 │ let _ = Foo(0); - │ ^^^^^^ Unbound field '0' in '0x42::M::Foo' - -error[E04016]: too few arguments - ┌─ tests/move_check/parser/positional_struct_pack.move:7:17 - │ -7 │ let _ = Foo(0); - │ ^^^^^^ Missing argument for field 'x' in '0x42::M::Foo' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_pack.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_pack.snap new file mode 100644 index 0000000000000..f5d897e1e23fb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_pack.snap @@ -0,0 +1,36 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/positional_struct_pack.move +--- +error[E03013]: positional call mismatch + ┌─ tests/move_check/parser/positional_struct_pack.move:7:17 + │ +4 │ struct Foo has drop { x: u64 } + │ --- 'Foo' is declared here + · +7 │ let _ = Foo(0); + │ ^^^^^^ Invalid struct instantiation. Named struct declarations require named instantiations + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/positional_struct_pack.move:7:17 + │ +7 │ let _ = Foo(0); + │ ^^^^^^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E03010]: unbound field + ┌─ tests/move_check/parser/positional_struct_pack.move:7:17 + │ +7 │ let _ = Foo(0); + │ ^^^^^^ Unbound field '0' in '0x42::M::Foo' + +error[E04016]: too few arguments + ┌─ tests/move_check/parser/positional_struct_pack.move:7:17 + │ +7 │ let _ = Foo(0); + │ ^^^^^^ Missing argument for field 'x' in '0x42::M::Foo' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_unpack.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_unpack.exp deleted file mode 100644 index d2e089a451a57..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_unpack.exp +++ /dev/null @@ -1,29 +0,0 @@ -error[E03013]: positional call mismatch - ┌─ tests/move_check/parser/positional_struct_unpack.move:7:9 - │ -4 │ struct Foo { f: u64 } - │ --- 'Foo' is declared here - · -7 │ Foo(_) = x; - │ ^^^^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/positional_struct_unpack.move:7:9 - │ -7 │ Foo(_) = x; - │ ^^^^^^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E03010]: unbound field - ┌─ tests/move_check/parser/positional_struct_unpack.move:7:9 - │ -7 │ Foo(_) = x; - │ ^^^^^^ Unbound field '0' in '0x42::M::Foo' - -error[E04016]: too few arguments - ┌─ tests/move_check/parser/positional_struct_unpack.move:7:9 - │ -7 │ Foo(_) = x; - │ ^^^^^^ Missing assignment for field 'f' in '0x42::M::Foo' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_unpack.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_unpack.snap new file mode 100644 index 0000000000000..f3f160e047ff3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/positional_struct_unpack.snap @@ -0,0 +1,36 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/positional_struct_unpack.move +--- +error[E03013]: positional call mismatch + ┌─ tests/move_check/parser/positional_struct_unpack.move:7:9 + │ +4 │ struct Foo { f: u64 } + │ --- 'Foo' is declared here + · +7 │ Foo(_) = x; + │ ^^^^^^ Invalid struct deconstruction. Named struct declarations require named deconstructions + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/positional_struct_unpack.move:7:9 + │ +7 │ Foo(_) = x; + │ ^^^^^^ Positional fields are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E03010]: unbound field + ┌─ tests/move_check/parser/positional_struct_unpack.move:7:9 + │ +7 │ Foo(_) = x; + │ ^^^^^^ Unbound field '0' in '0x42::M::Foo' + +error[E04016]: too few arguments + ┌─ tests/move_check/parser/positional_struct_unpack.move:7:9 + │ +7 │ Foo(_) = x; + │ ^^^^^^ Missing assignment for field 'f' in '0x42::M::Foo' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/preserve_address_syntax.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/preserve_address_syntax.exp deleted file mode 100644 index d9a365d74aec0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/preserve_address_syntax.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/move_check/parser/preserve_address_syntax.move:5:9 - │ -5 │ 0x00042::M::foo(); - │ ^^^^^^^^^^ Unbound module '0x42::M' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/preserve_address_syntax.move:6:9 - │ -6 │ 000112::N::bar(); - │ ^^^^^^^^^ Unbound module '112::N' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/preserve_address_syntax.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/preserve_address_syntax.snap new file mode 100644 index 0000000000000..862aa76ff81f4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/preserve_address_syntax.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/preserve_address_syntax.move +--- +error[E03002]: unbound module + ┌─ tests/move_check/parser/preserve_address_syntax.move:5:9 + │ +5 │ 0x00042::M::foo(); + │ ^^^^^^^^^^ Unbound module '0x42::M' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/preserve_address_syntax.move:6:9 + │ +6 │ 000112::N::bar(); + │ ^^^^^^^^^ Unbound module '112::N' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_member_end_line_error.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_member_end_line_error.exp deleted file mode 100644 index 962f3e743e7be..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_member_end_line_error.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/recovery_parse_member_end_line_error.move:6:5 - │ -6 │ public fun wrong_return(): u64 { - │ ^^^^^^ - │ │ - │ Unexpected 'public' - │ Expected '(' - -error[E04007]: incompatible types - ┌─ tests/move_check/parser/recovery_parse_member_end_line_error.move:6:36 - │ -6 │ public fun wrong_return(): u64 { - │ --- Expected: 'u64' - │ ╭──────────────────────────────────────^ - │ │ ╭────────────────────────────────────' -7 │ │ │ } - │ ╰─│─────^ Invalid return expression - │ ╰─────' Given: '()' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_member_end_line_error.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_member_end_line_error.snap new file mode 100644 index 0000000000000..a3dcf240a6772 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_member_end_line_error.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/recovery_parse_member_end_line_error.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/recovery_parse_member_end_line_error.move:6:5 + │ +6 │ public fun wrong_return(): u64 { + │ ^^^^^^ + │ │ + │ Unexpected 'public' + │ Expected '(' + +error[E04007]: incompatible types + ┌─ tests/move_check/parser/recovery_parse_member_end_line_error.move:6:36 + │ +6 │ public fun wrong_return(): u64 { + │ --- Expected: 'u64' + │ ╭──────────────────────────────────────^ + │ │ ╭────────────────────────────────────' +7 │ │ │ } + │ ╰─│─────^ Invalid return expression + │ ╰─────' Given: '()' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_member_mid_line_error.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_member_mid_line_error.exp deleted file mode 100644 index 6c80dd9efcfef..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_member_mid_line_error.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/recovery_parse_member_mid_line_error.move:4:16 - │ -4 │ public fun () foo - │ ^ - │ │ - │ Unexpected '(' - │ Expected an identifier - -error[E04007]: incompatible types - ┌─ tests/move_check/parser/recovery_parse_member_mid_line_error.move:6:36 - │ -6 │ public fun wrong_return(): u64 { - │ --- Expected: 'u64' - │ ╭──────────────────────────────────────^ - │ │ ╭────────────────────────────────────' -7 │ │ │ } - │ ╰─│─────^ Invalid return expression - │ ╰─────' Given: '()' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_member_mid_line_error.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_member_mid_line_error.snap new file mode 100644 index 0000000000000..32bb47aa4a037 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_member_mid_line_error.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/recovery_parse_member_mid_line_error.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/recovery_parse_member_mid_line_error.move:4:16 + │ +4 │ public fun () foo + │ ^ + │ │ + │ Unexpected '(' + │ Expected an identifier + +error[E04007]: incompatible types + ┌─ tests/move_check/parser/recovery_parse_member_mid_line_error.move:6:36 + │ +6 │ public fun wrong_return(): u64 { + │ --- Expected: 'u64' + │ ╭──────────────────────────────────────^ + │ │ ╭────────────────────────────────────' +7 │ │ │ } + │ ╰─│─────^ Invalid return expression + │ ╰─────' Given: '()' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_member_no_token.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_member_no_token.exp deleted file mode 100644 index 07de81c5e0dca..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_member_no_token.exp +++ /dev/null @@ -1,17 +0,0 @@ -error[E01008]: invalid hex string - ┌─ tests/move_check/parser/recovery_parse_member_no_token.move:5:9 - │ -5 │ x"abcd - │ ^^^^^^ Missing closing quote (") after byte string - -error[E04007]: incompatible types - ┌─ tests/move_check/parser/recovery_parse_member_no_token.move:8:36 - │ -8 │ public fun wrong_return(): u64 { - │ --- Expected: 'u64' - │ ╭──────────────────────────────────────^ - │ │ ╭────────────────────────────────────' -9 │ │ │ } - │ ╰─│─────^ Invalid return expression - │ ╰─────' Given: '()' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_member_no_token.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_member_no_token.snap new file mode 100644 index 0000000000000..0dcac24eda1be --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_member_no_token.snap @@ -0,0 +1,24 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/recovery_parse_member_no_token.move +--- +error[E01008]: invalid hex string + ┌─ tests/move_check/parser/recovery_parse_member_no_token.move:5:9 + │ +5 │ x"abcd + │ ^^^^^^ Missing closing quote (") after byte string + +error[E04007]: incompatible types + ┌─ tests/move_check/parser/recovery_parse_member_no_token.move:8:36 + │ +8 │ public fun wrong_return(): u64 { + │ --- Expected: 'u64' + │ ╭──────────────────────────────────────^ + │ │ ╭────────────────────────────────────' +9 │ │ │ } + │ ╰─│─────^ Invalid return expression + │ ╰─────' Given: '()' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_attributes.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_attributes.exp deleted file mode 100644 index dc50593e7221f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_attributes.exp +++ /dev/null @@ -1,53 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/recovery_parse_module_attributes.move:7:1 - │ -7 │ } - │ ^ - │ │ - │ Unexpected '}' - │ Expected an identifier - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/recovery_parse_module_attributes.move:10:1 - │ -10 │ module 0x42::M2 { - │ ^^^^^^ - │ │ - │ Unexpected 'module' - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - -error[E04007]: incompatible types - ┌─ tests/move_check/parser/recovery_parse_module_attributes.move:11:36 - │ -11 │ public fun wrong_return(): u64 { - │ --- Expected: 'u64' - │ ╭──────────────────────────────────────^ - │ │ ╭────────────────────────────────────' -12 │ │ │ } - │ ╰─│─────^ Invalid return expression - │ ╰─────' Given: '()' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/recovery_parse_module_attributes.move:17:1 - │ -17 │ } - │ ^ - │ │ - │ Unexpected '}' - │ Expected an identifier - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/recovery_parse_module_attributes.move:20:1 - │ -20 │ module 0x42::M4 { - │ ^^^^^^ - │ │ - │ Unexpected 'module' - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/recovery_parse_module_attributes.move:27:9 - │ -27 │ 0x42::M4::foo() - │ ^^^^^^^^ Unbound module '0x42::M4' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_attributes.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_attributes.snap new file mode 100644 index 0000000000000..920f592b736a9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_attributes.snap @@ -0,0 +1,60 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/recovery_parse_module_attributes.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/recovery_parse_module_attributes.move:7:1 + │ +7 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected an identifier + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/recovery_parse_module_attributes.move:10:1 + │ +10 │ module 0x42::M2 { + │ ^^^^^^ + │ │ + │ Unexpected 'module' + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' + +error[E04007]: incompatible types + ┌─ tests/move_check/parser/recovery_parse_module_attributes.move:11:36 + │ +11 │ public fun wrong_return(): u64 { + │ --- Expected: 'u64' + │ ╭──────────────────────────────────────^ + │ │ ╭────────────────────────────────────' +12 │ │ │ } + │ ╰─│─────^ Invalid return expression + │ ╰─────' Given: '()' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/recovery_parse_module_attributes.move:17:1 + │ +17 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected an identifier + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/recovery_parse_module_attributes.move:20:1 + │ +20 │ module 0x42::M4 { + │ ^^^^^^ + │ │ + │ Unexpected 'module' + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/recovery_parse_module_attributes.move:27:9 + │ +27 │ 0x42::M4::foo() + │ ^^^^^^^^ Unbound module '0x42::M4' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_end_module_error.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_end_module_error.exp deleted file mode 100644 index bdc9e5ce2af8b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_end_module_error.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/recovery_parse_module_end_module_error.move:5:1 - │ -5 │ } - │ ^ - │ │ - │ Unexpected '}' - │ Expected an identifier - -error[E04007]: incompatible types - ┌─ tests/move_check/parser/recovery_parse_module_end_module_error.move:8:36 - │ -8 │ public fun wrong_return(): u64 { - │ --- Expected: 'u64' - │ ╭──────────────────────────────────────^ - │ │ ╭────────────────────────────────────' -9 │ │ │ } - │ ╰─│─────^ Invalid return expression - │ ╰─────' Given: '()' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_end_module_error.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_end_module_error.snap new file mode 100644 index 0000000000000..cdbd948092ce1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_end_module_error.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/recovery_parse_module_end_module_error.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/recovery_parse_module_end_module_error.move:5:1 + │ +5 │ } + │ ^ + │ │ + │ Unexpected '}' + │ Expected an identifier + +error[E04007]: incompatible types + ┌─ tests/move_check/parser/recovery_parse_module_end_module_error.move:8:36 + │ +8 │ public fun wrong_return(): u64 { + │ --- Expected: 'u64' + │ ╭──────────────────────────────────────^ + │ │ ╭────────────────────────────────────' +9 │ │ │ } + │ ╰─│─────^ Invalid return expression + │ ╰─────' Given: '()' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_mid_module_error.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_mid_module_error.exp deleted file mode 100644 index bdfdd6020adac..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_mid_module_error.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/recovery_parse_module_mid_module_error.move:4:16 - │ -4 │ public fun () foo - │ ^ - │ │ - │ Unexpected '(' - │ Expected an identifier - -error[E04007]: incompatible types - ┌─ tests/move_check/parser/recovery_parse_module_mid_module_error.move:11:36 - │ -11 │ public fun wrong_return(): u64 { - │ --- Expected: 'u64' - │ ╭──────────────────────────────────────^ - │ │ ╭────────────────────────────────────' -12 │ │ │ } - │ ╰─│─────^ Invalid return expression - │ ╰─────' Given: '()' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_mid_module_error.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_mid_module_error.snap new file mode 100644 index 0000000000000..12af1629e2c7e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_mid_module_error.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/recovery_parse_module_mid_module_error.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/recovery_parse_module_mid_module_error.move:4:16 + │ +4 │ public fun () foo + │ ^ + │ │ + │ Unexpected '(' + │ Expected an identifier + +error[E04007]: incompatible types + ┌─ tests/move_check/parser/recovery_parse_module_mid_module_error.move:11:36 + │ +11 │ public fun wrong_return(): u64 { + │ --- Expected: 'u64' + │ ╭──────────────────────────────────────^ + │ │ ╭────────────────────────────────────' +12 │ │ │ } + │ ╰─│─────^ Invalid return expression + │ ╰─────' Given: '()' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_unclosed_module_error.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_unclosed_module_error.exp deleted file mode 100644 index f243f5a99c910..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_unclosed_module_error.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/recovery_parse_module_unclosed_module_error.move:7:1 - │ -7 │ module 0x42::M2 { - │ ^^^^^^ - │ │ - │ Unexpected 'module' - │ Expected an identifier - -error[E04007]: incompatible types - ┌─ tests/move_check/parser/recovery_parse_module_unclosed_module_error.move:8:36 - │ -8 │ public fun wrong_return(): u64 { - │ --- Expected: 'u64' - │ ╭──────────────────────────────────────^ - │ │ ╭────────────────────────────────────' -9 │ │ │ } - │ ╰─│─────^ Invalid return expression - │ ╰─────' Given: '()' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_unclosed_module_error.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_unclosed_module_error.snap new file mode 100644 index 0000000000000..60c7dbf2bb9a9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_module_unclosed_module_error.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/recovery_parse_module_unclosed_module_error.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/recovery_parse_module_unclosed_module_error.move:7:1 + │ +7 │ module 0x42::M2 { + │ ^^^^^^ + │ │ + │ Unexpected 'module' + │ Expected an identifier + +error[E04007]: incompatible types + ┌─ tests/move_check/parser/recovery_parse_module_unclosed_module_error.move:8:36 + │ +8 │ public fun wrong_return(): u64 { + │ --- Expected: 'u64' + │ ╭──────────────────────────────────────^ + │ │ ╭────────────────────────────────────' +9 │ │ │ } + │ ╰─│─────^ Invalid return expression + │ ╰─────' Given: '()' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_past_no_token.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_past_no_token.exp deleted file mode 100644 index fade54af9f3d7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/recovery_parse_past_no_token.exp +++ /dev/null @@ -1,17 +0,0 @@ -error[E01008]: invalid hex string - ┌─ tests/move_check/parser/recovery_parse_past_no_token.move:5:9 - │ -5 │ x"abcd - │ ^^^^^^ Missing closing quote (") after byte string - -error[E04007]: incompatible types - ┌─ tests/move_check/parser/recovery_parse_past_no_token.move:8:29 - │ -8 │ fun wrong_return(): u64 { - │ --- Expected: 'u64' - │ ╭───────────────────────────────^ - │ │ ╭─────────────────────────────' -9 │ │ │ } - │ ╰─│─────^ Invalid return expression - │ ╰─────' Given: '()' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/restricted_ident_positions.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/restricted_ident_positions.snap new file mode 100644 index 0000000000000..5558ad8a3b4a5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/restricted_ident_positions.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/restricted_ident_positions.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/restricted_ident_tokens.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/restricted_ident_tokens.snap new file mode 100644 index 0000000000000..98b422e364d76 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/restricted_ident_tokens.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/restricted_ident_tokens.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/restricted_identifier_interchangeable.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/restricted_identifier_interchangeable.snap new file mode 100644 index 0000000000000..2704f8e34ff48 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/restricted_identifier_interchangeable.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/restricted_identifier_interchangeable.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/return_in_binop.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/return_in_binop.exp deleted file mode 100644 index 31abf6bb334dd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/return_in_binop.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/parser/return_in_binop.move:3:9 - │ -3 │ return >> 0; - │ ^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/return_in_binop.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/return_in_binop.snap new file mode 100644 index 0000000000000..034c967961b51 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/return_in_binop.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/return_in_binop.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/parser/return_in_binop.move:3:9 + │ +3 │ return >> 0; + │ ^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_lambda_return_missing.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_lambda_return_missing.exp deleted file mode 100644 index de9857a887a01..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_lambda_return_missing.exp +++ /dev/null @@ -1,6 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_lambda_return_missing.move:2:10 - │ -2 │ spec fun do(f: ||) { } - │ ^^^^^^^^^^^^^^^^^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_lambda_return_missing.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_lambda_return_missing.snap new file mode 100644 index 0000000000000..2f83f6238bc13 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_lambda_return_missing.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/spec_lambda_return_missing.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_lambda_return_missing.move:2:10 + │ +2 │ spec fun do(f: ||) { } + │ ^^^^^^^^^^^^^^^^^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_emits_fail.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_emits_fail.exp deleted file mode 100644 index f7545049a3833..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_emits_fail.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_emits_fail.move:2:5 - │ -2 │ ╭ spec with_emits { -3 │ │ emits _msg; -4 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_emits_fail.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_emits_fail.snap new file mode 100644 index 0000000000000..e009bfd2a2420 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_emits_fail.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/spec_parsing_emits_fail.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_emits_fail.move:2:5 + │ +2 │ ╭ spec with_emits { +3 │ │ emits _msg; +4 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_generic_condition_fail.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_generic_condition_fail.exp deleted file mode 100644 index 9dbae6bdaa631..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_generic_condition_fail.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_generic_condition_fail.move:2:5 - │ -2 │ ╭ spec schema InvalidGenericEnsures { -3 │ │ ensures exists(0x1) <==> exists(0x1); -4 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_generic_condition_fail.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_generic_condition_fail.snap new file mode 100644 index 0000000000000..d4406b27cdb4b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_generic_condition_fail.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/spec_parsing_generic_condition_fail.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_generic_condition_fail.move:2:5 + │ +2 │ ╭ spec schema InvalidGenericEnsures { +3 │ │ ensures exists(0x1) <==> exists(0x1); +4 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_implies_fail.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_implies_fail.exp deleted file mode 100644 index 58221d189fce2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_implies_fail.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E00002]: DEPRECATED. unexpected spec item - ┌─ tests/move_check/parser/spec_parsing_implies_fail.move:3:15 - │ -3 │ let _ = x ==> x; - │ ^^^^^^^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_implies_fail.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_implies_fail.snap new file mode 100644 index 0000000000000..259dd7827aed1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_implies_fail.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/spec_parsing_implies_fail.move +--- +error[E00002]: DEPRECATED. unexpected spec item + ┌─ tests/move_check/parser/spec_parsing_implies_fail.move:3:15 + │ +3 │ let _ = x ==> x; + │ ^^^^^^^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_index_fail.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_index_fail.exp deleted file mode 100644 index b80240be8f056..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_index_fail.exp +++ /dev/null @@ -1,17 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/parser/spec_parsing_index_fail.move:2:23 - │ -2 │ fun index_in_prog(x: u64) { - │ ^ Unused parameter 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E00002]: DEPRECATED. unexpected spec item - ┌─ tests/move_check/parser/spec_parsing_index_fail.move:3:15 - │ -3 │ let _ = x[1]; - │ ^^^^ Specification blocks are deprecated and are no longer used - │ - = If this was intended to be a 'syntax' index call, consider updating your Move edition to '2024.alpha, 2024.beta, 2024' - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_index_fail.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_index_fail.snap new file mode 100644 index 0000000000000..52ae6392592d0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_index_fail.snap @@ -0,0 +1,24 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/spec_parsing_index_fail.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/parser/spec_parsing_index_fail.move:2:23 + │ +2 │ fun index_in_prog(x: u64) { + │ ^ Unused parameter 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E00002]: DEPRECATED. unexpected spec item + ┌─ tests/move_check/parser/spec_parsing_index_fail.move:3:15 + │ +3 │ let _ = x[1]; + │ ^^^^ Specification blocks are deprecated and are no longer used + │ + = If this was intended to be a 'syntax' index call, consider updating your Move edition to '2024.alpha, 2024.beta, 2024' + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_inside_fun.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_inside_fun.exp deleted file mode 100644 index 52eea07807a33..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_inside_fun.exp +++ /dev/null @@ -1,126 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:2:22 - │ -2 │ fun specs_in_fun(x: u64, n: u64) { - │ ^ Unused parameter 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:4:9 - │ -4 │ ╭ spec { -5 │ │ assume x > 42; -6 │ │ }; - │ ╰─────────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:9:17 - │ -9 │ while ({spec {assert x < 42;}; n < 64}) { - │ ^^^^^^^^^^^^^^^^^^^^^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:10:13 - │ -10 │ ╭ spec { -11 │ │ assert x > 42; -12 │ │ assert 0 < x; -13 │ │ }; - │ ╰─────────────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:18:9 - │ -18 │ ╭ spec { -19 │ │ assert x > 42; -20 │ │ }; - │ ╰─────────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:24:13 - │ -24 │ ╭ spec { -25 │ │ assert x > 42; -26 │ │ assert 0 < x; -27 │ │ }; - │ ╰─────────────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:32:9 - │ -32 │ spec {} + 1; - │ ^^^^^^^ Specification blocks are deprecated and are no longer used - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:32:9 - │ -32 │ spec {} + 1; - │ ^^^^^^^ - │ │ - │ Invalid argument to '+' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:32:17 - │ -32 │ spec {} + 1; - │ ------- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '+' - │ Found: '()'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:32:19 - │ -32 │ spec {} + 1; - │ ------- ^ Invalid argument to '+' - │ │ - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:33:9 - │ -33 │ spec {} && spec {}; - │ ^^^^^^^ Specification blocks are deprecated and are no longer used - -error[E04007]: incompatible types - ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:33:9 - │ -33 │ spec {} && spec {}; - │ ^^^^^^^ -- Expected: 'bool' - │ │ - │ Invalid argument to '&&' - │ Given: '()' - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:33:20 - │ -33 │ spec {} && spec {}; - │ ^^^^^^^ Specification blocks are deprecated and are no longer used - -error[E04007]: incompatible types - ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:33:20 - │ -33 │ spec {} && spec {}; - │ -- ^^^^^^^ - │ │ │ - │ │ Invalid argument to '&&' - │ │ Given: '()' - │ Expected: 'bool' - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:34:9 - │ -34 │ &mut spec {}; - │ ^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '()' - │ Invalid borrow - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:34:14 - │ -34 │ &mut spec {}; - │ ^^^^^^^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_inside_fun.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_inside_fun.snap new file mode 100644 index 0000000000000..87231ba21189c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_inside_fun.snap @@ -0,0 +1,133 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/spec_parsing_inside_fun.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:2:22 + │ +2 │ fun specs_in_fun(x: u64, n: u64) { + │ ^ Unused parameter 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:4:9 + │ +4 │ ╭ spec { +5 │ │ assume x > 42; +6 │ │ }; + │ ╰─────────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:9:17 + │ +9 │ while ({spec {assert x < 42;}; n < 64}) { + │ ^^^^^^^^^^^^^^^^^^^^^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:10:13 + │ +10 │ ╭ spec { +11 │ │ assert x > 42; +12 │ │ assert 0 < x; +13 │ │ }; + │ ╰─────────────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:18:9 + │ +18 │ ╭ spec { +19 │ │ assert x > 42; +20 │ │ }; + │ ╰─────────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:24:13 + │ +24 │ ╭ spec { +25 │ │ assert x > 42; +26 │ │ assert 0 < x; +27 │ │ }; + │ ╰─────────────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:32:9 + │ +32 │ spec {} + 1; + │ ^^^^^^^ Specification blocks are deprecated and are no longer used + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:32:9 + │ +32 │ spec {} + 1; + │ ^^^^^^^ + │ │ + │ Invalid argument to '+' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:32:17 + │ +32 │ spec {} + 1; + │ ------- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '+' + │ Found: '()'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:32:19 + │ +32 │ spec {} + 1; + │ ------- ^ Invalid argument to '+' + │ │ + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:33:9 + │ +33 │ spec {} && spec {}; + │ ^^^^^^^ Specification blocks are deprecated and are no longer used + +error[E04007]: incompatible types + ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:33:9 + │ +33 │ spec {} && spec {}; + │ ^^^^^^^ -- Expected: 'bool' + │ │ + │ Invalid argument to '&&' + │ Given: '()' + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:33:20 + │ +33 │ spec {} && spec {}; + │ ^^^^^^^ Specification blocks are deprecated and are no longer used + +error[E04007]: incompatible types + ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:33:20 + │ +33 │ spec {} && spec {}; + │ -- ^^^^^^^ + │ │ │ + │ │ Invalid argument to '&&' + │ │ Given: '()' + │ Expected: 'bool' + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:34:9 + │ +34 │ &mut spec {}; + │ ^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '()' + │ Invalid borrow + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_inside_fun.move:34:14 + │ +34 │ &mut spec {}; + │ ^^^^^^^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_lambda_fail.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_lambda_fail.exp deleted file mode 100644 index 83c54357e98a2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_lambda_fail.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/spec_parsing_lambda_fail.move:3:15 - │ -3 │ let _ = |y| x + y; - │ ^^^^^^^^^ lambda expressions are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_lambda_fail.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_lambda_fail.snap new file mode 100644 index 0000000000000..dd1f6a4be7687 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_lambda_fail.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/spec_parsing_lambda_fail.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/spec_parsing_lambda_fail.move:3:15 + │ +3 │ let _ = |y| x + y; + │ ^^^^^^^^^ lambda expressions are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_ok.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_ok.exp deleted file mode 100644 index c1a6ade9c01fb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_ok.exp +++ /dev/null @@ -1,154 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_ok.move:11:5 - │ -11 │ ╭ spec module { -12 │ │ global expected_coin_sum: u64; -13 │ │ global other: bool; -14 │ │ - · │ -23 │ │ } -24 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_ok.move:34:5 - │ -34 │ ╭ spec SomeCoin { -35 │ │ // Data invariants -36 │ │ invariant x > 0; -37 │ │ invariant x == y; -38 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_ok.move:40:5 - │ -40 │ ╭ spec with_aborts_if { -41 │ │ aborts_if x == 0; -42 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_ok.move:47:5 - │ -47 │ ╭ spec with_ensures { -48 │ │ ensures RET == x + 1; -49 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_ok.move:54:5 - │ -54 │ ╭ spec using_block { -55 │ │ ensures RET = {let y = x; y + 1}; -56 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_ok.move:61:5 - │ -61 │ ╭ spec using_lambda -62 │ │ { -63 │ │ ensures all(x, |y, z| x + y + z); -64 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_ok.move:69:5 - │ -69 │ ╭ spec using_index_and_range { -70 │ │ ensures RET = x[1] && x[0..3]; -71 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_ok.move:76:5 - │ -76 │ ╭ spec using_implies { -77 │ │ ensures x > 0 ==> RET == x - 1; -78 │ │ ensures x == 0 ==> RET == x; -79 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_ok.move:84:5 - │ -84 │ ╭ spec with_emits { -85 │ │ emits _msg to _guid; -86 │ │ emits _msg to _guid if true; -87 │ │ emits _msg to _guid if x > 7; -88 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_ok.move:93:5 - │ - 93 │ ╭ spec module { - 94 │ │ global x: u64; - 95 │ │ local y: u64; - 96 │ │ z: u64; - · │ - 99 │ │ invariant update Self::generic = 24; -100 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_ok.move:104:5 - │ -104 │ ╭ spec some_generic { -105 │ │ ensures generic == 1; -106 │ │ ensures Self::generic == 1; -107 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_ok.move:109:5 - │ -109 │ ╭ spec schema ModuleInvariant { -110 │ │ requires global(0x0).f == global(0x1).f; -111 │ │ ensures global(0x0).f == global(0x1).f; -112 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_ok.move:114:5 - │ -114 │ ╭ spec some_generic { -115 │ │ include ModuleInvariant{foo:bar, x:y}; -116 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_ok.move:118:5 - │ -118 │ ╭ spec module { -119 │ │ apply ModuleInvariant to *foo*; -120 │ │ apply ModuleInvariant to *foo*, bar except public *, internal baz; -121 │ │ pragma do_not_verify, timeout = 60; -122 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_ok.move:124:5 - │ -124 │ ╭ spec module { -125 │ │ invariant forall x: num, y: num, z: num : x == y && y == z ==> x == z; -126 │ │ invariant forall x: num : exists y: num : y >= x; -127 │ │ invariant exists x in 1..10, y in 8..12 : x == y; -128 │ │ invariant exists(0x0) <==> exists(0x0); -129 │ │ invariant exists(0x0) && exists(0x1) <==> exists(0x1) && exists(0x0); -130 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_ok.move:132:5 - │ -132 │ ╭ spec module { -133 │ │ fun spec_fun_non_zero(): num; -134 │ │ axiom spec_fun_non_zero() > 0; -135 │ │ -136 │ │ fun spec_fun_identity(x: T): T; -137 │ │ axiom forall x: T: spec_fun_identity(x) == x; -138 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_ok.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_ok.snap new file mode 100644 index 0000000000000..29c30bf7afcae --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_ok.snap @@ -0,0 +1,161 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/spec_parsing_ok.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_ok.move:11:5 + │ +11 │ ╭ spec module { +12 │ │ global expected_coin_sum: u64; +13 │ │ global other: bool; +14 │ │ + · │ +23 │ │ } +24 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_ok.move:34:5 + │ +34 │ ╭ spec SomeCoin { +35 │ │ // Data invariants +36 │ │ invariant x > 0; +37 │ │ invariant x == y; +38 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_ok.move:40:5 + │ +40 │ ╭ spec with_aborts_if { +41 │ │ aborts_if x == 0; +42 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_ok.move:47:5 + │ +47 │ ╭ spec with_ensures { +48 │ │ ensures RET == x + 1; +49 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_ok.move:54:5 + │ +54 │ ╭ spec using_block { +55 │ │ ensures RET = {let y = x; y + 1}; +56 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_ok.move:61:5 + │ +61 │ ╭ spec using_lambda +62 │ │ { +63 │ │ ensures all(x, |y, z| x + y + z); +64 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_ok.move:69:5 + │ +69 │ ╭ spec using_index_and_range { +70 │ │ ensures RET = x[1] && x[0..3]; +71 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_ok.move:76:5 + │ +76 │ ╭ spec using_implies { +77 │ │ ensures x > 0 ==> RET == x - 1; +78 │ │ ensures x == 0 ==> RET == x; +79 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_ok.move:84:5 + │ +84 │ ╭ spec with_emits { +85 │ │ emits _msg to _guid; +86 │ │ emits _msg to _guid if true; +87 │ │ emits _msg to _guid if x > 7; +88 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_ok.move:93:5 + │ + 93 │ ╭ spec module { + 94 │ │ global x: u64; + 95 │ │ local y: u64; + 96 │ │ z: u64; + · │ + 99 │ │ invariant update Self::generic = 24; +100 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_ok.move:104:5 + │ +104 │ ╭ spec some_generic { +105 │ │ ensures generic == 1; +106 │ │ ensures Self::generic == 1; +107 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_ok.move:109:5 + │ +109 │ ╭ spec schema ModuleInvariant { +110 │ │ requires global(0x0).f == global(0x1).f; +111 │ │ ensures global(0x0).f == global(0x1).f; +112 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_ok.move:114:5 + │ +114 │ ╭ spec some_generic { +115 │ │ include ModuleInvariant{foo:bar, x:y}; +116 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_ok.move:118:5 + │ +118 │ ╭ spec module { +119 │ │ apply ModuleInvariant to *foo*; +120 │ │ apply ModuleInvariant to *foo*, bar except public *, internal baz; +121 │ │ pragma do_not_verify, timeout = 60; +122 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_ok.move:124:5 + │ +124 │ ╭ spec module { +125 │ │ invariant forall x: num, y: num, z: num : x == y && y == z ==> x == z; +126 │ │ invariant forall x: num : exists y: num : y >= x; +127 │ │ invariant exists x in 1..10, y in 8..12 : x == y; +128 │ │ invariant exists(0x0) <==> exists(0x0); +129 │ │ invariant exists(0x0) && exists(0x1) <==> exists(0x1) && exists(0x0); +130 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_ok.move:132:5 + │ +132 │ ╭ spec module { +133 │ │ fun spec_fun_non_zero(): num; +134 │ │ axiom spec_fun_non_zero() > 0; +135 │ │ +136 │ │ fun spec_fun_identity(x: T): T; +137 │ │ axiom forall x: T: spec_fun_identity(x) == x; +138 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_old_fun_fail.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_old_fun_fail.exp deleted file mode 100644 index 84f0970b2b51b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_old_fun_fail.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/spec_parsing_old_fun_fail.move:5:10 - │ -5 │ spec fun with_aborts_if { - │ ^^^ - │ │ - │ Unexpected 'fun' - │ Expected only 'spec', drop the 'fun' keyword - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_old_fun_fail.move:5:10 - │ -5 │ spec fun with_aborts_if { - │ ╭──────────^ -6 │ │ aborts_if x == 0; -7 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_old_fun_fail.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_old_fun_fail.snap new file mode 100644 index 0000000000000..364eb3d51adc7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_old_fun_fail.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/spec_parsing_old_fun_fail.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/spec_parsing_old_fun_fail.move:5:10 + │ +5 │ spec fun with_aborts_if { + │ ^^^ + │ │ + │ Unexpected 'fun' + │ Expected only 'spec', drop the 'fun' keyword + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_old_fun_fail.move:5:10 + │ +5 │ spec fun with_aborts_if { + │ ╭──────────^ +6 │ │ aborts_if x == 0; +7 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_quantifier_fail.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_quantifier_fail.exp deleted file mode 100644 index 24369644bb15a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_quantifier_fail.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/parser/spec_parsing_quantifier_fail.move:2:5 - │ -2 │ ╭ spec module { -3 │ │ invariant forall x: num y: num : x == y; -4 │ │ } - │ ╰─────^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_quantifier_fail.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_quantifier_fail.snap new file mode 100644 index 0000000000000..d5f60e0b15f8e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_quantifier_fail.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/spec_parsing_quantifier_fail.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/parser/spec_parsing_quantifier_fail.move:2:5 + │ +2 │ ╭ spec module { +3 │ │ invariant forall x: num y: num : x == y; +4 │ │ } + │ ╰─────^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_range_fail.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_range_fail.exp deleted file mode 100644 index 6a025a3b22a25..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_range_fail.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E00002]: DEPRECATED. unexpected spec item - ┌─ tests/move_check/parser/spec_parsing_range_fail.move:3:15 - │ -3 │ let _ = 1 .. 2; - │ ^^^^^^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_range_fail.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_range_fail.snap new file mode 100644 index 0000000000000..b30a4bac06656 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/spec_parsing_range_fail.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/spec_parsing_range_fail.move +--- +error[E00002]: DEPRECATED. unexpected spec item + ┌─ tests/move_check/parser/spec_parsing_range_fail.move:3:15 + │ +3 │ let _ = 1 .. 2; + │ ^^^^^^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct.snap new file mode 100644 index 0000000000000..9a007ee29097c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/struct.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_field_missing_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_field_missing_type.exp deleted file mode 100644 index ca6fb27480dbf..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_field_missing_type.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/struct_field_missing_type.move:2:18 - │ -2 │ struct S { f } // Each field must specify a type - │ ^ - │ │ - │ Unexpected '}' - │ Expected ':' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_field_missing_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_field_missing_type.snap new file mode 100644 index 0000000000000..df9b661b0b0e5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_field_missing_type.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/struct_field_missing_type.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/struct_field_missing_type.move:2:18 + │ +2 │ struct S { f } // Each field must specify a type + │ ^ + │ │ + │ Unexpected '}' + │ Expected ':' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_missing_lbrace.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_missing_lbrace.exp deleted file mode 100644 index 3e9643810959c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_missing_lbrace.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/struct_missing_lbrace.move:3:5 - │ -2 │ struct S { f: u64 // } - │ - To match this '{' -3 │ fun f() {} - │ ^ Expected '}' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_missing_lbrace.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_missing_lbrace.snap new file mode 100644 index 0000000000000..32d4e564d7fe9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_missing_lbrace.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/struct_missing_lbrace.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/struct_missing_lbrace.move:3:5 + │ +2 │ struct S { f: u64 // } + │ - To match this '{' +3 │ fun f() {} + │ ^ Expected '}' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_native_missing_semicolon.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_native_missing_semicolon.exp deleted file mode 100644 index 0d81766b4838f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_native_missing_semicolon.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/struct_native_missing_semicolon.move:3:1 - │ -3 │ } - │ ^ Unexpected '}'. Expected struct fields, 'has' to start abilities declaration, or ';' for a native struct - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/struct_native_missing_semicolon.move:4:1 - │ -4 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_native_missing_semicolon.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_native_missing_semicolon.snap new file mode 100644 index 0000000000000..efcb4cd76e72f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_native_missing_semicolon.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/struct_native_missing_semicolon.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/struct_native_missing_semicolon.move:3:1 + │ +3 │ } + │ ^ Unexpected '}'. Expected struct fields, 'has' to start abilities declaration, or ';' for a native struct + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/struct_native_missing_semicolon.move:4:1 + │ +4 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_native_with_fields.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_native_with_fields.exp deleted file mode 100644 index 1691e149ce6cf..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_native_with_fields.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/struct_native_with_fields.move:3:21 - │ -3 │ native struct S { f: u64 } - │ ^ - │ │ - │ Unexpected '{' - │ Expected ';' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/struct_native_with_fields.move:5:1 - │ -5 │ - │ ^ - │ - │ Unexpected end-of-file - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_native_with_fields.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_native_with_fields.snap new file mode 100644 index 0000000000000..047c39fda57fc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_native_with_fields.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/struct_native_with_fields.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/struct_native_with_fields.move:3:21 + │ +3 │ native struct S { f: u64 } + │ ^ + │ │ + │ Unexpected '{' + │ Expected ';' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/struct_native_with_fields.move:5:1 + │ +5 │ + │ ^ + │ + │ Unexpected end-of-file + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_public.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_public.exp deleted file mode 100644 index 8b081f5d6e703..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_public.exp +++ /dev/null @@ -1,48 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_check/parser/struct_public.move:3:5 - │ -3 │ public struct Foo {} - │ ^^^^^^ Invalid struct declaration. Structs cannot have visibility modifiers as they are always 'public' - │ - = Starting in the Move 2024 edition visibility must be annotated on struct declarations. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/struct_public.move:3:5 - │ -3 │ public struct Foo {} - │ ^^^^^^ Struct visibility modifiers are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E01003]: invalid modifier - ┌─ tests/move_check/parser/struct_public.move:4:5 - │ -4 │ public(friend) struct Foo {} - │ ^^^^^^^^^^^^^^ Invalid struct declaration. Structs cannot have visibility modifiers as they are always 'public' - │ - = Starting in the Move 2024 edition visibility must be annotated on struct declarations. - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/parser/struct_public.move:4:27 - │ -3 │ public struct Foo {} - │ --- Alias previously defined here -4 │ public(friend) struct Foo {} - │ ^^^ Duplicate module member or alias 'Foo'. Top level names in a namespace must be unique - -error[E01003]: invalid modifier - ┌─ tests/move_check/parser/struct_public.move:5:5 - │ -5 │ public(package) struct Foo {} - │ ^^^^^^^^^^^^^^^ Invalid struct declaration. Structs cannot have visibility modifiers as they are always 'public' - │ - = Starting in the Move 2024 edition visibility must be annotated on struct declarations. - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/parser/struct_public.move:5:28 - │ -4 │ public(friend) struct Foo {} - │ --- Alias previously defined here -5 │ public(package) struct Foo {} - │ ^^^ Duplicate module member or alias 'Foo'. Top level names in a namespace must be unique - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_public.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_public.snap new file mode 100644 index 0000000000000..c45a7f90edcd1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_public.snap @@ -0,0 +1,55 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/struct_public.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_check/parser/struct_public.move:3:5 + │ +3 │ public struct Foo {} + │ ^^^^^^ Invalid struct declaration. Structs cannot have visibility modifiers as they are always 'public' + │ + = Starting in the Move 2024 edition visibility must be annotated on struct declarations. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/struct_public.move:3:5 + │ +3 │ public struct Foo {} + │ ^^^^^^ Struct visibility modifiers are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E01003]: invalid modifier + ┌─ tests/move_check/parser/struct_public.move:4:5 + │ +4 │ public(friend) struct Foo {} + │ ^^^^^^^^^^^^^^ Invalid struct declaration. Structs cannot have visibility modifiers as they are always 'public' + │ + = Starting in the Move 2024 edition visibility must be annotated on struct declarations. + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/parser/struct_public.move:4:27 + │ +3 │ public struct Foo {} + │ --- Alias previously defined here +4 │ public(friend) struct Foo {} + │ ^^^ Duplicate module member or alias 'Foo'. Top level names in a namespace must be unique + +error[E01003]: invalid modifier + ┌─ tests/move_check/parser/struct_public.move:5:5 + │ +5 │ public(package) struct Foo {} + │ ^^^^^^^^^^^^^^^ Invalid struct declaration. Structs cannot have visibility modifiers as they are always 'public' + │ + = Starting in the Move 2024 edition visibility must be annotated on struct declarations. + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/parser/struct_public.move:5:28 + │ +4 │ public(friend) struct Foo {} + │ --- Alias previously defined here +5 │ public(package) struct Foo {} + │ ^^^ Duplicate module member or alias 'Foo'. Top level names in a namespace must be unique diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_trailing_comma.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_trailing_comma.snap new file mode 100644 index 0000000000000..bb69e0851813d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_trailing_comma.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/struct_trailing_comma.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_empty.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_empty.snap new file mode 100644 index 0000000000000..ca8aba29c2e01 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_empty.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/struct_type_empty.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_extra_comma.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_extra_comma.exp deleted file mode 100644 index d4e57bb8d3465..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_extra_comma.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/struct_type_extra_comma.move:2:14 - │ -2 │ struct S<,T> { f: T } // Test a comma before the first type parameter - │ ^ Unexpected ','. Expected a type parameter - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_extra_comma.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_extra_comma.snap new file mode 100644 index 0000000000000..5bcccda51e407 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_extra_comma.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/struct_type_extra_comma.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/struct_type_extra_comma.move:2:14 + │ +2 │ struct S<,T> { f: T } // Test a comma before the first type parameter + │ ^ Unexpected ','. Expected a type parameter diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_missing_angle.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_missing_angle.exp deleted file mode 100644 index c12379804e1c6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_missing_angle.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/struct_type_missing_angle.move:3:37 - │ -3 │ struct S' - │ │ - │ To match this '<' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_missing_angle.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_missing_angle.snap new file mode 100644 index 0000000000000..5edd6e8e744fb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_missing_angle.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/struct_type_missing_angle.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/struct_type_missing_angle.move:3:37 + │ +3 │ struct S' + │ │ + │ To match this '<' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_misspelled_copy_constraint.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_misspelled_copy_constraint.exp deleted file mode 100644 index 5264697fda9dc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_misspelled_copy_constraint.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/struct_type_misspelled_copy_constraint.move:3:17 - │ -3 │ struct S { } - │ ^^^^^^^^ Unexpected 'copyable'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_misspelled_copy_constraint.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_misspelled_copy_constraint.snap new file mode 100644 index 0000000000000..4bbaa9912925a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_misspelled_copy_constraint.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/struct_type_misspelled_copy_constraint.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/struct_type_misspelled_copy_constraint.move:3:17 + │ +3 │ struct S { } + │ ^^^^^^^^ Unexpected 'copyable'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_misspelled_key_constraint.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_misspelled_key_constraint.exp deleted file mode 100644 index 59ca8bb04930d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_misspelled_key_constraint.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/struct_type_misspelled_key_constraint.move:3:17 - │ -3 │ struct S { } - │ ^^ Unexpected 'ky'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_misspelled_key_constraint.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_misspelled_key_constraint.snap new file mode 100644 index 0000000000000..27e3cb45921be --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_misspelled_key_constraint.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/struct_type_misspelled_key_constraint.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/struct_type_misspelled_key_constraint.move:3:17 + │ +3 │ struct S { } + │ ^^ Unexpected 'ky'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_trailing_comma.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_trailing_comma.snap new file mode 100644 index 0000000000000..c543c5dcc2e1b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_type_trailing_comma.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/struct_type_trailing_comma.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_without_fields.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_without_fields.exp deleted file mode 100644 index eb68eb7046e6a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_without_fields.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/struct_without_fields.move:3:13 - │ -3 │ struct S; - │ ^ - │ │ - │ Unexpected ';' - │ Expected '{' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_without_fields.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_without_fields.snap new file mode 100644 index 0000000000000..7544c657ee6ba --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/struct_without_fields.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/struct_without_fields.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/struct_without_fields.move:3:13 + │ +3 │ struct S; + │ ^ + │ │ + │ Unexpected ';' + │ Expected '{' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/top_level_module.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/top_level_module.exp deleted file mode 100644 index 304ea12e7bb85..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/top_level_module.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/top_level_module.move:1:11 - │ -1 │ module a::m; - │ ^ 'module' label forms (ending with ';') are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/top_level_module.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/top_level_module.snap new file mode 100644 index 0000000000000..d609979e2f312 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/top_level_module.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/top_level_module.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/top_level_module.move:1:11 + │ +1 │ module a::m; + │ ^ 'module' label forms (ending with ';') are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/top_level_module_address_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/top_level_module_address_invalid.exp deleted file mode 100644 index 2a6e4f2efcda5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/top_level_module_address_invalid.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E02004]: invalid 'module' declaration - ┌─ tests/move_check/parser/top_level_module_address_invalid.move:2:12 - │ -2 │ module m; - │ ^ Cannot define 'module' label in address block - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/top_level_module_address_invalid.move:2:12 - │ -2 │ module m; - │ ^ 'module' label forms (ending with ';') are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/top_level_module_address_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/top_level_module_address_invalid.snap new file mode 100644 index 0000000000000..211cc549c0915 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/top_level_module_address_invalid.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/top_level_module_address_invalid.move +--- +error[E02004]: invalid 'module' declaration + ┌─ tests/move_check/parser/top_level_module_address_invalid.move:2:12 + │ +2 │ module m; + │ ^ Cannot define 'module' label in address block + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/top_level_module_address_invalid.move:2:12 + │ +2 │ module m; + │ ^ 'module' label forms (ending with ';') are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/trojan_source.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/trojan_source.exp deleted file mode 100644 index b717706baaddb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/trojan_source.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01001]: invalid character - ┌─ tests/move_check/parser/trojan_source.move:3:24 - │ -3 │ agent == b"user‮ ⁦// Check if user⁩ ⁦" - │ Invalid character '\u{202e}' found when reading file. For ASCII, only printable characters (tabs '\t', lf '\n' and crlf '\r'+'\n') are permitted. Unicode can be used in comments and string literals, excluding certain control characters. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/trojan_source.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/trojan_source.snap new file mode 100644 index 0000000000000..5a9a5f04c3173 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/trojan_source.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/trojan_source.move +--- +error[E01001]: invalid character + ┌─ tests/move_check/parser/trojan_source.move:3:24 + │ +3 │ agent == b"user‮ ⁦// Check if user⁩ ⁦" + │ Invalid character '\u{202e}' found when reading file. For ASCII, only printable characters (tabs '\t', lf '\n' and crlf '\r'+'\n') are permitted. Unicode can be used in comments and string literals, excluding certain control characters. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/type_mut_space.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/type_mut_space.exp deleted file mode 100644 index 86bf9c89dd986..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/type_mut_space.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E03004]: unbound type - ┌─ tests/move_check/parser/type_mut_space.move:5:26 - │ -5 │ public fun foo(_x: & mut S) { - │ ^^^ Unbound type 'mut' in current scope - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/type_mut_space.move:5:30 - │ -5 │ public fun foo(_x: & mut S) { - │ ^ - │ │ - │ Unexpected 'S' - │ Expected ',' or ')' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/type_mut_space.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/type_mut_space.snap new file mode 100644 index 0000000000000..5938ae07a0b98 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/type_mut_space.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/type_mut_space.move +--- +error[E03004]: unbound type + ┌─ tests/move_check/parser/type_mut_space.move:5:26 + │ +5 │ public fun foo(_x: & mut S) { + │ ^^^ Unbound type 'mut' in current scope + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/type_mut_space.move:5:30 + │ +5 │ public fun foo(_x: & mut S) { + │ ^ + │ │ + │ Unexpected 'S' + │ Expected ',' or ')' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/unexpected_token_after_ability_function_constraint.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/unexpected_token_after_ability_function_constraint.exp deleted file mode 100644 index 2482eef2ec13f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/unexpected_token_after_ability_function_constraint.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/unexpected_token_after_ability_function_constraint.move:4:21 - │ -4 │ fun foo() {} - │ ^ - │ │ - │ Unexpected '&' - │ Expected one of: '+', '>', or ',' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/unexpected_token_after_ability_function_constraint.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/unexpected_token_after_ability_function_constraint.snap new file mode 100644 index 0000000000000..fd9eacdeb7e6c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/unexpected_token_after_ability_function_constraint.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/unexpected_token_after_ability_function_constraint.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/unexpected_token_after_ability_function_constraint.move:4:21 + │ +4 │ fun foo() {} + │ ^ + │ │ + │ Unexpected '&' + │ Expected one of: '+', '>', or ',' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/unexpected_token_after_ability_modifier.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/unexpected_token_after_ability_modifier.exp deleted file mode 100644 index 07e8c52da3521..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/unexpected_token_after_ability_modifier.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/unexpected_token_after_ability_modifier.move:4:25 - │ -4 │ struct Foo has copy & drop {} - │ ^ - │ │ - │ Unexpected '&' - │ Expected one of: ',', '{', '(', or ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/unexpected_token_after_ability_modifier.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/unexpected_token_after_ability_modifier.snap new file mode 100644 index 0000000000000..d8db6187f369b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/unexpected_token_after_ability_modifier.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/unexpected_token_after_ability_modifier.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/unexpected_token_after_ability_modifier.move:4:25 + │ +4 │ struct Foo has copy & drop {} + │ ^ + │ │ + │ Unexpected '&' + │ Expected one of: ',', '{', '(', or ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/unknown_ability_name_function_constraint.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/unknown_ability_name_function_constraint.exp deleted file mode 100644 index 9e5c7d0ae0c10..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/unknown_ability_name_function_constraint.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/unknown_ability_name_function_constraint.move:4:16 - │ -4 │ fun foo() {} - │ ^^^^ Unexpected 'blah'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/unknown_ability_name_function_constraint.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/unknown_ability_name_function_constraint.snap new file mode 100644 index 0000000000000..70938e3d87d5e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/unknown_ability_name_function_constraint.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/unknown_ability_name_function_constraint.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/unknown_ability_name_function_constraint.move:4:16 + │ +4 │ fun foo() {} + │ ^^^^ Unexpected 'blah'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/unknown_ability_name_modifier.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/unknown_ability_name_modifier.exp deleted file mode 100644 index 1be24f714e391..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/unknown_ability_name_modifier.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/unknown_ability_name_modifier.move:4:20 - │ -4 │ struct Foo has blah {} - │ ^^^^ Unexpected 'blah'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/unknown_ability_name_modifier.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/unknown_ability_name_modifier.snap new file mode 100644 index 0000000000000..7ddce0deb5a10 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/unknown_ability_name_modifier.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/unknown_ability_name_modifier.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/unknown_ability_name_modifier.move:4:20 + │ +4 │ struct Foo has blah {} + │ ^^^^ Unexpected 'blah'. Expected a type ability, one of: 'copy', 'drop', 'store', or 'key' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/unmatched_restricted_identifier.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/unmatched_restricted_identifier.exp deleted file mode 100644 index 0885788b51e90..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/unmatched_restricted_identifier.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E01012]: invalid identifier escape - ┌─ tests/move_check/parser/unmatched_restricted_identifier.move:4:13 - │ -4 │ fun foo(`x: u64): u64 { `x } - │ ^^ Missing closing backtick (`) for restricted identifier escaping - -error[E01012]: invalid identifier escape - ┌─ tests/move_check/parser/unmatched_restricted_identifier.move:4:29 - │ -4 │ fun foo(`x: u64): u64 { `x } - │ ^^ Missing closing backtick (`) for restricted identifier escaping - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/unmatched_restricted_identifier.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/unmatched_restricted_identifier.snap new file mode 100644 index 0000000000000..887ab0b429123 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/unmatched_restricted_identifier.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/unmatched_restricted_identifier.move +--- +error[E01012]: invalid identifier escape + ┌─ tests/move_check/parser/unmatched_restricted_identifier.move:4:13 + │ +4 │ fun foo(`x: u64): u64 { `x } + │ ^^ Missing closing backtick (`) for restricted identifier escaping + +error[E01012]: invalid identifier escape + ┌─ tests/move_check/parser/unmatched_restricted_identifier.move:4:29 + │ +4 │ fun foo(`x: u64): u64 { `x } + │ ^^ Missing closing backtick (`) for restricted identifier escaping diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/unmatched_restricted_identifier_no_text.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/unmatched_restricted_identifier_no_text.exp deleted file mode 100644 index e73a3f774145b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/unmatched_restricted_identifier_no_text.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01012]: invalid identifier escape - ┌─ tests/move_check/parser/unmatched_restricted_identifier_no_text.move:4:9 - │ -4 │ fun ` - │ ^ Missing closing backtick (`) for restricted identifier escaping - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/unmatched_restricted_identifier_no_text.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/unmatched_restricted_identifier_no_text.snap new file mode 100644 index 0000000000000..33a638fd31184 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/unmatched_restricted_identifier_no_text.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/unmatched_restricted_identifier_no_text.move +--- +error[E01012]: invalid identifier escape + ┌─ tests/move_check/parser/unmatched_restricted_identifier_no_text.move:4:9 + │ +4 │ fun ` + │ ^ Missing closing backtick (`) for restricted identifier escaping diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_inner_scope.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_inner_scope.exp deleted file mode 100644 index 89b34a71f24fc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_inner_scope.exp +++ /dev/null @@ -1,96 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_inner_scope.move:5:13 - │ -5 │ use 0x2::Mango; - │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x2::Mango' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_inner_scope.move:6:13 - │ -6 │ use 0x2::Mango as M; - │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x2::Mango' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_inner_scope.move:7:13 - │ -7 │ use 0x2::Mango::baz; - │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x2::Mango' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_inner_scope.move:8:13 - │ -8 │ use 0x2::Salsa::{Self, foo as bar, foo}; - │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x2::Salsa' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_inner_scope.move:10:17 - │ -10 │ use 0x2::Mango; - │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x2::Mango' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_inner_scope.move:11:17 - │ -11 │ use 0x3::Mango as M; - │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x3::Mango' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_inner_scope.move:12:17 - │ -12 │ use 0x3::Mango::baz; - │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x3::Mango' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_inner_scope.move:13:17 - │ -13 │ use 0x3::Salsa::{Self, foo as bar, foo}; - │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x3::Salsa' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_inner_scope.move:27:53 - │ -27 │ use 0x2::Mango; - │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x2::Mango' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_inner_scope.move:28:53 - │ -28 │ use 0x3::Mango as M; - │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x3::Mango' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_inner_scope.move:29:53 - │ -29 │ use 0x3::Mango::baz; - │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x3::Mango' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_inner_scope.move:30:53 - │ -30 │ use 0x3::Salsa::{Self, foo as bar, foo}; - │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x3::Salsa' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_inner_scope.move:43:17 - │ -43 │ use 0x2::Mango; - │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x2::Mango' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_inner_scope.move:44:17 - │ -44 │ use 0x3::Mango as M; - │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x3::Mango' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_inner_scope.move:45:17 - │ -45 │ use 0x3::Mango::baz; - │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x3::Mango' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_inner_scope.move:46:17 - │ -46 │ use 0x3::Salsa::{Self, foo as bar, foo}; - │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x3::Salsa' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_inner_scope.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_inner_scope.snap new file mode 100644 index 0000000000000..0b98951fb4879 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_inner_scope.snap @@ -0,0 +1,103 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/use_inner_scope.move +--- +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_inner_scope.move:5:13 + │ +5 │ use 0x2::Mango; + │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x2::Mango' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_inner_scope.move:6:13 + │ +6 │ use 0x2::Mango as M; + │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x2::Mango' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_inner_scope.move:7:13 + │ +7 │ use 0x2::Mango::baz; + │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x2::Mango' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_inner_scope.move:8:13 + │ +8 │ use 0x2::Salsa::{Self, foo as bar, foo}; + │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x2::Salsa' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_inner_scope.move:10:17 + │ +10 │ use 0x2::Mango; + │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x2::Mango' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_inner_scope.move:11:17 + │ +11 │ use 0x3::Mango as M; + │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x3::Mango' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_inner_scope.move:12:17 + │ +12 │ use 0x3::Mango::baz; + │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x3::Mango' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_inner_scope.move:13:17 + │ +13 │ use 0x3::Salsa::{Self, foo as bar, foo}; + │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x3::Salsa' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_inner_scope.move:27:53 + │ +27 │ use 0x2::Mango; + │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x2::Mango' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_inner_scope.move:28:53 + │ +28 │ use 0x3::Mango as M; + │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x3::Mango' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_inner_scope.move:29:53 + │ +29 │ use 0x3::Mango::baz; + │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x3::Mango' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_inner_scope.move:30:53 + │ +30 │ use 0x3::Salsa::{Self, foo as bar, foo}; + │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x3::Salsa' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_inner_scope.move:43:17 + │ +43 │ use 0x2::Mango; + │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x2::Mango' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_inner_scope.move:44:17 + │ +44 │ use 0x3::Mango as M; + │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x3::Mango' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_inner_scope.move:45:17 + │ +45 │ use 0x3::Mango::baz; + │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x3::Mango' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_inner_scope.move:46:17 + │ +46 │ use 0x3::Salsa::{Self, foo as bar, foo}; + │ ^^^^^^^^^^ Invalid 'use'. Unbound module: '0x3::Salsa' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_inner_scope_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_inner_scope_invalid.exp deleted file mode 100644 index 3359d5f986d7f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_inner_scope_invalid.exp +++ /dev/null @@ -1,32 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/parser/use_inner_scope_invalid.move:4:13 - │ -4 │ let x = 0; - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/use_inner_scope_invalid.move:6:9 - │ -6 │ use 0x1::M::foo; - │ ^^^ - │ │ - │ Unexpected 'use' - │ Expected an expression term - -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_inner_scope_invalid.move:6:13 - │ -6 │ use 0x1::M::foo; - │ ^^^^^^ Invalid 'use'. Unbound module: '0x1::M' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/use_inner_scope_invalid.move:7:9 - │ -7 │ foo(x) - │ ^^^ - │ │ - │ Unexpected 'foo' - │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_inner_scope_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_inner_scope_invalid.snap new file mode 100644 index 0000000000000..6b2546480c252 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_inner_scope_invalid.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/use_inner_scope_invalid.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/parser/use_inner_scope_invalid.move:4:13 + │ +4 │ let x = 0; + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/use_inner_scope_invalid.move:6:9 + │ +6 │ use 0x1::M::foo; + │ ^^^ + │ │ + │ Unexpected 'use' + │ Expected an expression term + +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_inner_scope_invalid.move:6:13 + │ +6 │ use 0x1::M::foo; + │ ^^^^^^ Invalid 'use'. Unbound module: '0x1::M' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/use_inner_scope_invalid.move:7:9 + │ +7 │ foo(x) + │ ^^^ + │ │ + │ Unexpected 'foo' + │ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', or 'struct' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_inner_scope_invalid_inner.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_inner_scope_invalid_inner.exp deleted file mode 100644 index d2d829317f41c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_inner_scope_invalid_inner.exp +++ /dev/null @@ -1,17 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/use_inner_scope_invalid_inner.move:4:19 - │ -4 │ if (cond) use 0x2::M; - │ ^^^ - │ │ - │ Unexpected 'use' - │ Expected an expression term - -warning[W09001]: unused alias - ┌─ tests/move_check/parser/use_inner_scope_invalid_inner.move:4:28 - │ -4 │ if (cond) use 0x2::M; - │ ^ Unused 'use' of alias 'M'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_inner_scope_invalid_inner.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_inner_scope_invalid_inner.snap new file mode 100644 index 0000000000000..ad7e2157ac353 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_inner_scope_invalid_inner.snap @@ -0,0 +1,24 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/use_inner_scope_invalid_inner.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/use_inner_scope_invalid_inner.move:4:19 + │ +4 │ if (cond) use 0x2::M; + │ ^^^ + │ │ + │ Unexpected 'use' + │ Expected an expression term + +warning[W09001]: unused alias + ┌─ tests/move_check/parser/use_inner_scope_invalid_inner.move:4:28 + │ +4 │ if (cond) use 0x2::M; + │ ^ Unused 'use' of alias 'M'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member.snap new file mode 100644 index 0000000000000..d72f41275b094 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/use_module_member.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member_invalid_comma.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member_invalid_comma.exp deleted file mode 100644 index 335b4821393ea..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member_invalid_comma.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/use_module_member_invalid_comma.move:4:26 - │ -4 │ use 0x1::X::{S as XS,,}; - │ ^ Unexpected ','. Expected a module member alias - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member_invalid_comma.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member_invalid_comma.snap new file mode 100644 index 0000000000000..eae07207cc940 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member_invalid_comma.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/use_module_member_invalid_comma.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/use_module_member_invalid_comma.move:4:26 + │ +4 │ use 0x1::X::{S as XS,,}; + │ ^ Unexpected ','. Expected a module member alias diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member_invalid_missing_close_brace.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member_invalid_missing_close_brace.exp deleted file mode 100644 index a3c5d6ba63037..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member_invalid_missing_close_brace.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/use_module_member_invalid_missing_close_brace.move:6:5 - │ -4 │ use 0x42::M::{S as XS - │ - To match this '{' -5 │ -6 │ fun foo() {} - │ ^ Expected '}' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/use_module_member_invalid_missing_close_brace.move:6:5 - │ -6 │ fun foo() {} - │ ^^^ - │ │ - │ Unexpected 'fun' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member_invalid_missing_close_brace.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member_invalid_missing_close_brace.snap new file mode 100644 index 0000000000000..ab34b2ce53105 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member_invalid_missing_close_brace.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/use_module_member_invalid_missing_close_brace.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/use_module_member_invalid_missing_close_brace.move:6:5 + │ +4 │ use 0x42::M::{S as XS + │ - To match this '{' +5 │ +6 │ fun foo() {} + │ ^ Expected '}' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/use_module_member_invalid_missing_close_brace.move:6:5 + │ +6 │ fun foo() {} + │ ^^^ + │ │ + │ Unexpected 'fun' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member_invalid_missing_semicolon.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member_invalid_missing_semicolon.exp deleted file mode 100644 index 7cfa235226b66..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member_invalid_missing_semicolon.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/use_module_member_invalid_missing_semicolon.move:6:5 - │ -6 │ fun foo() {} - │ ^^^ - │ │ - │ Unexpected 'fun' - │ Expected ';' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member_invalid_missing_semicolon.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member_invalid_missing_semicolon.snap new file mode 100644 index 0000000000000..3cdedcd4c9a4e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_module_member_invalid_missing_semicolon.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/use_module_member_invalid_missing_semicolon.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/use_module_member_invalid_missing_semicolon.move:6:5 + │ +6 │ fun foo() {} + │ ^^^ + │ │ + │ Unexpected 'fun' + │ Expected ';' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_address.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_address.exp deleted file mode 100644 index daaf434207a9f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_address.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/use_with_address.move:2:1 - │ -2 │ use 0x1::Module; - │ ^^^ Invalid code unit. Expected 'address' or 'module'. Got 'use' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_address.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_address.snap new file mode 100644 index 0000000000000..82d66cb74a3d4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_address.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/use_with_address.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/use_with_address.move:2:1 + │ +2 │ use 0x1::Module; + │ ^^^ Invalid code unit. Expected 'address' or 'module'. Got 'use' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_main.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_main.exp deleted file mode 100644 index 0c719dd6d2f05..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_main.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_with_main.move:3:5 - │ -3 │ use 0x0::Module; - │ ^^^^^^^^^^^ Invalid 'use'. Unbound module: '0x0::Module' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_with_main.move:4:5 - │ -4 │ use 0xaBcD::Module as M; - │ ^^^^^^^^^^^^^^ Invalid 'use'. Unbound module: '0xABCD::Module' - -error[E03002]: unbound module - ┌─ tests/move_check/parser/use_with_main.move:5:5 - │ -5 │ use 0x0000::Z; - │ ^^^^^^^^^ Invalid 'use'. Unbound module: '0x0::Z' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_main.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_main.snap new file mode 100644 index 0000000000000..642e8534fb0c3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_main.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/use_with_main.move +--- +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_with_main.move:3:5 + │ +3 │ use 0x0::Module; + │ ^^^^^^^^^^^ Invalid 'use'. Unbound module: '0x0::Module' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_with_main.move:4:5 + │ +4 │ use 0xaBcD::Module as M; + │ ^^^^^^^^^^^^^^ Invalid 'use'. Unbound module: '0xABCD::Module' + +error[E03002]: unbound module + ┌─ tests/move_check/parser/use_with_main.move:5:5 + │ +5 │ use 0x0000::Z; + │ ^^^^^^^^^ Invalid 'use'. Unbound module: '0x0::Z' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_modifiers.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_modifiers.exp deleted file mode 100644 index 6ff13168c28fa..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_modifiers.exp +++ /dev/null @@ -1,42 +0,0 @@ -error[E01003]: invalid modifier - ┌─ tests/move_check/parser/use_with_modifiers.move:3:5 - │ -3 │ public use a::m as m1; - │ ^^^^^^ Invalid use declaration. Non-'use fun' declarations cannot have visibility modifiers as they are always internal - -error[E01003]: invalid modifier - ┌─ tests/move_check/parser/use_with_modifiers.move:4:5 - │ -4 │ public(friend) use a::m as m2; - │ ^^^^^^^^^^^^^^ Invalid use declaration. Non-'use fun' declarations cannot have visibility modifiers as they are always internal - -error[E01003]: invalid modifier - ┌─ tests/move_check/parser/use_with_modifiers.move:5:5 - │ -5 │ entry use a::m as m3; - │ ^^^^^ Invalid use declaration. 'entry' is used only on functions - -error[E01003]: invalid modifier - ┌─ tests/move_check/parser/use_with_modifiers.move:6:5 - │ -6 │ native use a::m as m4; - │ ^^^^^^ Invalid use declaration. 'native' is used only on functions or structs - -error[E01003]: invalid modifier - ┌─ tests/move_check/parser/use_with_modifiers.move:7:5 - │ -7 │ public native entry use a::m as m5; - │ ^^^^^^ Invalid use declaration. Non-'use fun' declarations cannot have visibility modifiers as they are always internal - -error[E01003]: invalid modifier - ┌─ tests/move_check/parser/use_with_modifiers.move:7:12 - │ -7 │ public native entry use a::m as m5; - │ ^^^^^^ Invalid use declaration. 'native' is used only on functions or structs - -error[E01003]: invalid modifier - ┌─ tests/move_check/parser/use_with_modifiers.move:7:19 - │ -7 │ public native entry use a::m as m5; - │ ^^^^^ Invalid use declaration. 'entry' is used only on functions - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_modifiers.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_modifiers.snap new file mode 100644 index 0000000000000..dc979a42dd85f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_modifiers.snap @@ -0,0 +1,49 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/use_with_modifiers.move +--- +error[E01003]: invalid modifier + ┌─ tests/move_check/parser/use_with_modifiers.move:3:5 + │ +3 │ public use a::m as m1; + │ ^^^^^^ Invalid use declaration. Non-'use fun' declarations cannot have visibility modifiers as they are always internal + +error[E01003]: invalid modifier + ┌─ tests/move_check/parser/use_with_modifiers.move:4:5 + │ +4 │ public(friend) use a::m as m2; + │ ^^^^^^^^^^^^^^ Invalid use declaration. Non-'use fun' declarations cannot have visibility modifiers as they are always internal + +error[E01003]: invalid modifier + ┌─ tests/move_check/parser/use_with_modifiers.move:5:5 + │ +5 │ entry use a::m as m3; + │ ^^^^^ Invalid use declaration. 'entry' is used only on functions + +error[E01003]: invalid modifier + ┌─ tests/move_check/parser/use_with_modifiers.move:6:5 + │ +6 │ native use a::m as m4; + │ ^^^^^^ Invalid use declaration. 'native' is used only on functions or structs + +error[E01003]: invalid modifier + ┌─ tests/move_check/parser/use_with_modifiers.move:7:5 + │ +7 │ public native entry use a::m as m5; + │ ^^^^^^ Invalid use declaration. Non-'use fun' declarations cannot have visibility modifiers as they are always internal + +error[E01003]: invalid modifier + ┌─ tests/move_check/parser/use_with_modifiers.move:7:12 + │ +7 │ public native entry use a::m as m5; + │ ^^^^^^ Invalid use declaration. 'native' is used only on functions or structs + +error[E01003]: invalid modifier + ┌─ tests/move_check/parser/use_with_modifiers.move:7:19 + │ +7 │ public native entry use a::m as m5; + │ ^^^^^ Invalid use declaration. 'entry' is used only on functions diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_modifiers_exp.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_modifiers_exp.exp deleted file mode 100644 index 45bc1d7fb87e2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_modifiers_exp.exp +++ /dev/null @@ -1,35 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/use_with_modifiers_exp.move:3:9 - │ -3 │ public use fun bar as X.baz; - │ ^^^^^^ - │ │ - │ Unexpected 'public' - │ Expected an expression term - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/parser/use_with_modifiers_exp.move:3:9 - │ -3 │ public use fun bar as X.baz; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/parser/use_with_modifiers_exp.move:3:24 - │ -3 │ public use fun bar as X.baz; - │ ^^^ Unbound function 'bar' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/parser/use_with_modifiers_exp.move:3:31 - │ -3 │ public use fun bar as X.baz; - │ ^ Unbound type 'X' in current scope - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/use_with_modifiers_exp.move:5:1 - │ -5 │ } - │ ^ Invalid code unit. Expected 'address' or 'module'. Got '}' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_modifiers_exp.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_modifiers_exp.snap new file mode 100644 index 0000000000000..b0b81e7730384 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_modifiers_exp.snap @@ -0,0 +1,42 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/use_with_modifiers_exp.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/use_with_modifiers_exp.move:3:9 + │ +3 │ public use fun bar as X.baz; + │ ^^^^^^ + │ │ + │ Unexpected 'public' + │ Expected an expression term + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/parser/use_with_modifiers_exp.move:3:9 + │ +3 │ public use fun bar as X.baz; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Method syntax is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/parser/use_with_modifiers_exp.move:3:24 + │ +3 │ public use fun bar as X.baz; + │ ^^^ Unbound function 'bar' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/parser/use_with_modifiers_exp.move:3:31 + │ +3 │ public use fun bar as X.baz; + │ ^ Unbound type 'X' in current scope + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/use_with_modifiers_exp.move:5:1 + │ +5 │ } + │ ^ Invalid code unit. Expected 'address' or 'module'. Got '}' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_module.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_module.exp deleted file mode 100644 index f75a9afd2284d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_module.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/use_with_module.move:2:1 - │ -2 │ use 0x1::Module; - │ ^^^ Invalid code unit. Expected 'address' or 'module'. Got 'use' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_module.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_module.snap new file mode 100644 index 0000000000000..2f56786f4ee37 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/use_with_module.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/use_with_module.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/use_with_module.move:2:1 + │ +2 │ use 0x1::Module; + │ ^^^ Invalid code unit. Expected 'address' or 'module'. Got 'use' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/vector_literal_unclosed_args.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/vector_literal_unclosed_args.exp deleted file mode 100644 index eb164bb74a1fa..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/vector_literal_unclosed_args.exp +++ /dev/null @@ -1,32 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/parser/vector_literal_unclosed_args.move:4:13 - │ -4 │ let v = vector[ - │ ^ Unused local variable 'v'. Consider removing or prefixing with an underscore: '_v' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04010]: cannot infer type - ┌─ tests/move_check/parser/vector_literal_unclosed_args.move:4:17 - │ -4 │ let v = vector[ - │ ╭─────────────────^ -5 │ │ } -6 │ │ } - │ ╰─^ Could not infer this type. Try adding an annotation - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/vector_literal_unclosed_args.move:5:5 - │ -5 │ } - │ ^ Unexpected '}'. Expected a vector argument expression - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/vector_literal_unclosed_args.move:7:1 - │ -4 │ let v = vector[ - │ - To match this '[' - · -7 │ - │ ^ Expected ']' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/vector_literal_unclosed_args.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/vector_literal_unclosed_args.snap new file mode 100644 index 0000000000000..47e559a152386 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/vector_literal_unclosed_args.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/vector_literal_unclosed_args.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/parser/vector_literal_unclosed_args.move:4:13 + │ +4 │ let v = vector[ + │ ^ Unused local variable 'v'. Consider removing or prefixing with an underscore: '_v' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04010]: cannot infer type + ┌─ tests/move_check/parser/vector_literal_unclosed_args.move:4:17 + │ +4 │ let v = vector[ + │ ╭─────────────────^ +5 │ │ } +6 │ │ } + │ ╰─^ Could not infer this type. Try adding an annotation + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/vector_literal_unclosed_args.move:5:5 + │ +5 │ } + │ ^ Unexpected '}'. Expected a vector argument expression + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/vector_literal_unclosed_args.move:7:1 + │ +4 │ let v = vector[ + │ - To match this '[' + · +7 │ + │ ^ Expected ']' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/vector_literal_unclosed_type_args.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/vector_literal_unclosed_type_args.exp deleted file mode 100644 index de6d991081ed2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/vector_literal_unclosed_type_args.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/parser/vector_literal_unclosed_type_args.move:4:28 - │ -4 │ let _v = vector' - │ │ - │ To match this '<' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/vector_literal_unclosed_type_args.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/vector_literal_unclosed_type_args.snap new file mode 100644 index 0000000000000..70019478fc1b7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/vector_literal_unclosed_type_args.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/vector_literal_unclosed_type_args.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/parser/vector_literal_unclosed_type_args.move:4:28 + │ +4 │ let _v = vector' + │ │ + │ To match this '<' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/vector_space_after_less.exp b/external-crates/move/crates/move-compiler/tests/move_check/parser/vector_space_after_less.exp deleted file mode 100644 index ccf588c48255d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/parser/vector_space_after_less.exp +++ /dev/null @@ -1,40 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/parser/vector_space_after_less.move:4:13 - │ -4 │ let a = vector < 100; - │ ^ Unused local variable 'a'. Consider removing or prefixing with an underscore: '_a' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E03008]: too few type arguments - ┌─ tests/move_check/parser/vector_space_after_less.move:4:17 - │ -4 │ let a = vector < 100; - │ ^^^^^^------ - │ │ - │ Expected 1 type argument(s) but got 0 - │ Invalid 'vector' instantation - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/vector_space_after_less.move:4:26 - │ -4 │ let a = vector < 100; - │ ^^^ Expected '::' after the anonymous address in this module access chain - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/vector_space_after_less.move:4:29 - │ -4 │ let a = vector < 100; - │ - ^ Expected '>' - │ │ - │ To match this '<' - -error[E01002]: unexpected token - ┌─ tests/move_check/parser/vector_space_after_less.move:4:29 - │ -4 │ let a = vector < 100; - │ ^ - │ │ - │ Unexpected ';' - │ Expected '[' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/parser/vector_space_after_less.snap b/external-crates/move/crates/move-compiler/tests/move_check/parser/vector_space_after_less.snap new file mode 100644 index 0000000000000..f2d0c69f361c4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/parser/vector_space_after_less.snap @@ -0,0 +1,47 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/parser/vector_space_after_less.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/parser/vector_space_after_less.move:4:13 + │ +4 │ let a = vector < 100; + │ ^ Unused local variable 'a'. Consider removing or prefixing with an underscore: '_a' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E03008]: too few type arguments + ┌─ tests/move_check/parser/vector_space_after_less.move:4:17 + │ +4 │ let a = vector < 100; + │ ^^^^^^------ + │ │ + │ Expected 1 type argument(s) but got 0 + │ Invalid 'vector' instantation + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/vector_space_after_less.move:4:26 + │ +4 │ let a = vector < 100; + │ ^^^ Expected '::' after the anonymous address in this module access chain + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/vector_space_after_less.move:4:29 + │ +4 │ let a = vector < 100; + │ - ^ Expected '>' + │ │ + │ To match this '<' + +error[E01002]: unexpected token + ┌─ tests/move_check/parser/vector_space_after_less.move:4:29 + │ +4 │ let a = vector < 100; + │ ^ + │ │ + │ Unexpected ';' + │ Expected '[' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/to_bytecode/unassigned_address.snap b/external-crates/move/crates/move-compiler/tests/move_check/to_bytecode/unassigned_address.snap new file mode 100644 index 0000000000000..cf7e331b23204 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/to_bytecode/unassigned_address.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/to_bytecode/unassigned_address.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/borrow_if.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/borrow_if.exp deleted file mode 100644 index 994d6986aed89..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/borrow_if.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/borrow_if.move:8:14 - │ -4 │ let ref; - │ --- The variable 'ref' might not have a value. The variable must be assigned a value before being used. - · -8 │ assert!(*move ref == 5, 42); - │ ^^^^^^^^ Invalid usage of unassigned variable 'ref' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/borrow_if.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/borrow_if.snap new file mode 100644 index 0000000000000..3e3ec205002c1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/borrow_if.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/borrow_if.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/borrow_if.move:8:14 + │ +4 │ let ref; + │ --- The variable 'ref' might not have a value. The variable must be assigned a value before being used. + · +8 │ assert!(*move ref == 5, 42); + │ ^^^^^^^^ Invalid usage of unassigned variable 'ref' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/borrow_return_mutable_borrow_bad.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/borrow_return_mutable_borrow_bad.exp deleted file mode 100644 index dee9b570957c4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/borrow_return_mutable_borrow_bad.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E07005]: invalid transfer of references - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/borrow_return_mutable_borrow_bad.move:9:9 - │ -7 │ let ref_x_f_g = &ref_x_f.g; - │ ---------- Field 'g' is still being borrowed by this reference -8 │ -9 │ (ref_x_f, ref_x_f_g) - │ ^^^^^^^^^^^^^^^^^^^^ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/borrow_return_mutable_borrow_bad.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/borrow_return_mutable_borrow_bad.snap new file mode 100644 index 0000000000000..76b07c99d5a2e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/borrow_return_mutable_borrow_bad.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/borrow_return_mutable_borrow_bad.move +--- +error[E07005]: invalid transfer of references + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/borrow_return_mutable_borrow_bad.move:9:9 + │ +7 │ let ref_x_f_g = &ref_x_f.g; + │ ---------- Field 'g' is still being borrowed by this reference +8 │ +9 │ (ref_x_f, ref_x_f_g) + │ ^^^^^^^^^^^^^^^^^^^^ Invalid return of reference. Cannot transfer a mutable reference that is being borrowed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed.snap new file mode 100644 index 0000000000000..d73d2fbf82107 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_field.snap new file mode 100644 index 0000000000000..f10677482c6d9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_field.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_field.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_field_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_field_invalid.exp deleted file mode 100644 index ddd12a3c34e39..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_field_invalid.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_field_invalid.move:7:9 - │ -6 │ let r1 = &mut x.f; - │ -------- It is still being mutably borrowed by this reference -7 │ copy x; - │ ^^^^^^ Invalid copy of variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_field_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_field_invalid.snap new file mode 100644 index 0000000000000..98931d264ceda --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_field_invalid.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_field_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_field_invalid.move:7:9 + │ +6 │ let r1 = &mut x.f; + │ -------- It is still being mutably borrowed by this reference +7 │ copy x; + │ ^^^^^^ Invalid copy of variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_indirect.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_indirect.snap new file mode 100644 index 0000000000000..758ae74838455 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_indirect.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_indirect.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_indirect_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_indirect_invalid.exp deleted file mode 100644 index 2d62539747f4c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_indirect_invalid.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_indirect_invalid.move:6:9 - │ -5 │ let r1 = foo(&mut x, &mut y); - │ ------------------- It is still being mutably borrowed by this reference -6 │ copy x; - │ ^^^^^^ Invalid copy of variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_indirect_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_indirect_invalid.snap new file mode 100644 index 0000000000000..b51fda29684d7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_indirect_invalid.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_indirect_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_indirect_invalid.move:6:9 + │ +5 │ let r1 = foo(&mut x, &mut y); + │ ------------------- It is still being mutably borrowed by this reference +6 │ copy x; + │ ^^^^^^ Invalid copy of variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_invalid.exp deleted file mode 100644 index 1420c83659031..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_invalid.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_invalid.move:5:9 - │ -4 │ let r1 = &mut x; - │ ------ It is still being mutably borrowed by this reference -5 │ copy x; - │ ^^^^^^ Invalid copy of variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_invalid.snap new file mode 100644 index 0000000000000..79ff009a806d7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_invalid.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/copy_loc_borrowed_invalid.move:5:9 + │ +4 │ let r1 = &mut x; + │ ------ It is still being mutably borrowed by this reference +5 │ copy x; + │ ^^^^^^ Invalid copy of variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/eq_bad.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/eq_bad.snap new file mode 100644 index 0000000000000..b0e6115564c1a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/eq_bad.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/eq_bad.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/eq_ok.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/eq_ok.snap new file mode 100644 index 0000000000000..f7d74618bc8d8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/eq_ok.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/eq_ok.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_1.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_1.exp deleted file mode 100644 index a0c4b4296e6b7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_1.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E07005]: invalid transfer of references - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_1.move:12:9 - │ - 9 │ let f_g = &mut f.g; - │ -------- Field 'g' is still being mutably borrowed by this reference - · -12 │ foo(f_g, f); - │ ^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_1.move:22:9 - │ -19 │ let f_g = &mut f.g; - │ -------- Field 'g' is still being mutably borrowed by this reference - · -22 │ bar(f, f_g); - │ ^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_1.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_1.snap new file mode 100644 index 0000000000000..f796b61a0a434 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_1.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_1.move +--- +error[E07005]: invalid transfer of references + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_1.move:12:9 + │ + 9 │ let f_g = &mut f.g; + │ -------- Field 'g' is still being mutably borrowed by this reference + · +12 │ foo(f_g, f); + │ ^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_1.move:22:9 + │ +19 │ let f_g = &mut f.g; + │ -------- Field 'g' is still being mutably borrowed by this reference + · +22 │ bar(f, f_g); + │ ^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_2.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_2.exp deleted file mode 100644 index e83c30a4e4af0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_2.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_2.move:8:9 - │ -6 │ let eps = if (cond) bar(root) else &x1; - │ --------- It is still being borrowed by this reference -7 │ // Error: root has weak empty borrow and hence a field cannot be borrowed mutably -8 │ &mut root.g; - │ ^^^^^^^^^^^ Invalid mutable borrow at field 'g'. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_2.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_2.snap new file mode 100644 index 0000000000000..be1e4bca61525 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_2.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_2.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/factor_invalid_2.move:8:9 + │ +6 │ let eps = if (cond) bar(root) else &x1; + │ --------- It is still being borrowed by this reference +7 │ // Error: root has weak empty borrow and hence a field cannot be borrowed mutably +8 │ &mut root.g; + │ ^^^^^^^^^^^ Invalid mutable borrow at field 'g'. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_valid_1.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_valid_1.snap new file mode 100644 index 0000000000000..22c3ae9dbdea4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_valid_1.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_valid_1.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_valid_2.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_valid_2.snap new file mode 100644 index 0000000000000..3f8647303b6f0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_valid_2.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/factor_valid_2.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_loc_trivial.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_loc_trivial.snap new file mode 100644 index 0000000000000..1bcd855716d96 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_loc_trivial.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_loc_trivial.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_loc_trivial_valid.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_loc_trivial_valid.snap new file mode 100644 index 0000000000000..a549dd29660e7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_loc_trivial_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_loc_trivial_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_on_mut_trivial.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_on_mut_trivial.snap new file mode 100644 index 0000000000000..694b40c7e22b0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_on_mut_trivial.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_on_mut_trivial.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_on_mut_trivial_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_on_mut_trivial_invalid.exp deleted file mode 100644 index 2c8874764bbfe..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_on_mut_trivial_invalid.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_on_mut_trivial_invalid.move:12:42 - │ -10 │ let returned_ref = bump_and_give(x_ref); - │ -------------------- It is still being borrowed by this reference -11 │ // ERROR Cannot mutably borrow from `x_ref` it is being borrowed by `returned_ref` -12 │ assert!(*returned_ref == *freeze(&mut x_ref.f) + 1, 42); - │ ^^^^^^^^^^^^ Invalid mutable borrow at field 'f'. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_on_mut_trivial_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_on_mut_trivial_invalid.snap new file mode 100644 index 0000000000000..78dfcd73d5930 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_on_mut_trivial_invalid.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_on_mut_trivial_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/imm_borrow_on_mut_trivial_invalid.move:12:42 + │ +10 │ let returned_ref = bump_and_give(x_ref); + │ -------------------- It is still being borrowed by this reference +11 │ // ERROR Cannot mutably borrow from `x_ref` it is being borrowed by `returned_ref` +12 │ assert!(*returned_ref == *freeze(&mut x_ref.f) + 1, 42); + │ ^^^^^^^^^^^^ Invalid mutable borrow at field 'f'. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/join_borrow_unavailable_valid.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/join_borrow_unavailable_valid.snap new file mode 100644 index 0000000000000..9634f607f2104 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/join_borrow_unavailable_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/join_borrow_unavailable_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/move_one_branch.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/move_one_branch.snap new file mode 100644 index 0000000000000..141ca2b3940da --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/move_one_branch.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/move_one_branch.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_invalid.exp deleted file mode 100644 index 0778b34ca4ab5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_invalid.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_invalid.move:9:9 - │ -6 │ let x = if (cond) &mut root.f else &mut root.g; - │ ----------- It is still being mutably borrowed by this reference - · -9 │ root.f = 1; - │ ^^^^^^^^^^ Invalid mutation of reference. - -error[E07005]: invalid transfer of references - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_invalid.move:17:9 - │ -14 │ let x = if (cond) &mut root.f else &mut root.g; - │ ----------- It is still being mutably borrowed by this reference - · -17 │ foo(x, &mut root.f); - │ ^^^^^^^^^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_invalid.snap new file mode 100644 index 0000000000000..7266b1b742114 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_invalid.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_invalid.move +--- +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_invalid.move:9:9 + │ +6 │ let x = if (cond) &mut root.f else &mut root.g; + │ ----------- It is still being mutably borrowed by this reference + · +9 │ root.f = 1; + │ ^^^^^^^^^^ Invalid mutation of reference. + +error[E07005]: invalid transfer of references + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_invalid.move:17:9 + │ +14 │ let x = if (cond) &mut root.f else &mut root.g; + │ ----------- It is still being mutably borrowed by this reference + · +17 │ foo(x, &mut root.f); + │ ^^^^^^^^^^^^^^^^^^^ Invalid usage of reference as function argument. Cannot transfer a mutable reference that is being borrowed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_local_twice.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_local_twice.snap new file mode 100644 index 0000000000000..5a297e435278f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_local_twice.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_local_twice.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_local_twice_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_local_twice_invalid.exp deleted file mode 100644 index faba5757b1064..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_local_twice_invalid.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_local_twice_invalid.move:6:9 - │ -4 │ let r1 = &mut a; - │ ------ It is still being mutably borrowed by this reference -5 │ let r2 = &mut a; -6 │ *r2 = 2; - │ ^^^^^^^ Invalid mutation of reference. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_local_twice_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_local_twice_invalid.snap new file mode 100644 index 0000000000000..8aec148c314fc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_local_twice_invalid.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_local_twice_invalid.move +--- +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/mutable_borrow_local_twice_invalid.move:6:9 + │ +4 │ let r1 = &mut a; + │ ------ It is still being mutably borrowed by this reference +5 │ let r2 = &mut a; +6 │ *r2 = 2; + │ ^^^^^^^ Invalid mutation of reference. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc.snap new file mode 100644 index 0000000000000..18155dc1cf354 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_invalid.exp deleted file mode 100644 index 481de4324d972..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_invalid.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_invalid.move:5:9 - │ -4 │ let y = &x; - │ -- It is still being borrowed by this reference -5 │ x = 0; - │ ^ Invalid assignment of variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_invalid.snap new file mode 100644 index 0000000000000..6c116c89a52e5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_invalid.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_invalid.move +--- +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_invalid.move:5:9 + │ +4 │ let y = &x; + │ -- It is still being borrowed by this reference +5 │ x = 0; + │ ^ Invalid assignment of variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_struct_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_struct_invalid.exp deleted file mode 100644 index 45edf08b5ff8a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_struct_invalid.exp +++ /dev/null @@ -1,30 +0,0 @@ -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_struct_invalid.move:7:9 - │ -2 │ struct X has key { b: bool } - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -5 │ let x = X { b: true }; - │ - ------------- The type '0x8675309::M::X' does not have the ability 'drop' - │ │ - │ The variable contains a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again -6 │ let y = &x; -7 │ x = X { b: true }; - │ ^ Invalid assignment to variable 'x' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_struct_invalid.move:7:9 - │ -6 │ let y = &x; - │ -- It is still being borrowed by this reference -7 │ x = X { b: true }; - │ ^ Invalid assignment of variable 'x' - -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_struct_invalid.move:16:9 - │ -15 │ let z = &y.z; - │ ---- It is still being borrowed by this reference -16 │ s = S { z: 7 }; - │ ^ Invalid assignment of variable 's' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_struct_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_struct_invalid.snap new file mode 100644 index 0000000000000..f2fe000c1cdba --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_struct_invalid.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_struct_invalid.move +--- +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_struct_invalid.move:7:9 + │ +2 │ struct X has key { b: bool } + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +5 │ let x = X { b: true }; + │ - ------------- The type '0x8675309::M::X' does not have the ability 'drop' + │ │ + │ The variable contains a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again +6 │ let y = &x; +7 │ x = X { b: true }; + │ ^ Invalid assignment to variable 'x' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_struct_invalid.move:7:9 + │ +6 │ let y = &x; + │ -- It is still being borrowed by this reference +7 │ x = X { b: true }; + │ ^ Invalid assignment of variable 'x' + +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/mutate_with_borrowed_loc_struct_invalid.move:16:9 + │ +15 │ let z = &y.z; + │ ---- It is still being borrowed by this reference +16 │ s = S { z: 7 }; + │ ^ Invalid assignment of variable 's' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/ref_moved_one_branch.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/ref_moved_one_branch.snap new file mode 100644 index 0000000000000..92990ddb40509 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/ref_moved_one_branch.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/ref_moved_one_branch.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/release_cycle.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/release_cycle.snap new file mode 100644 index 0000000000000..2946ee678b738 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/release_cycle.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/release_cycle.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc.snap new file mode 100644 index 0000000000000..1c1337b7c0ff9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_invalid.exp deleted file mode 100644 index 875567c7a0435..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_invalid.exp +++ /dev/null @@ -1,35 +0,0 @@ -error[E07004]: invalid return of locally borrowed state - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_invalid.move:7:9 - │ -7 │ &x - │ ^^ - │ │ - │ Invalid return. Local variable 'x' is still being borrowed. - │ It is still being borrowed by this reference - -error[E07004]: invalid return of locally borrowed state - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_invalid.move:13:9 - │ -13 │ copy y - │ ^^^^^^ - │ │ - │ Invalid return. Local variable 'x' is still being borrowed. - │ It is still being borrowed by this reference - -error[E07004]: invalid return of locally borrowed state - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_invalid.move:21:9 - │ -20 │ let u = &y.u; - │ ---- It is still being borrowed by this reference -21 │ move u - │ ^^^^^^ Invalid return. Local variable 's' is still being borrowed. - -error[E07004]: invalid return of locally borrowed state - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_invalid.move:29:9 - │ -29 │ copy u - │ ^^^^^^ - │ │ - │ Invalid return. Local variable 's' is still being borrowed. - │ It is still being borrowed by this reference - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_invalid.snap new file mode 100644 index 0000000000000..d7edcd764aeff --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_invalid.snap @@ -0,0 +1,42 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_invalid.move +--- +error[E07004]: invalid return of locally borrowed state + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_invalid.move:7:9 + │ +7 │ &x + │ ^^ + │ │ + │ Invalid return. Local variable 'x' is still being borrowed. + │ It is still being borrowed by this reference + +error[E07004]: invalid return of locally borrowed state + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_invalid.move:13:9 + │ +13 │ copy y + │ ^^^^^^ + │ │ + │ Invalid return. Local variable 'x' is still being borrowed. + │ It is still being borrowed by this reference + +error[E07004]: invalid return of locally borrowed state + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_invalid.move:21:9 + │ +20 │ let u = &y.u; + │ ---- It is still being borrowed by this reference +21 │ move u + │ ^^^^^^ Invalid return. Local variable 's' is still being borrowed. + +error[E07004]: invalid return of locally borrowed state + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_invalid.move:29:9 + │ +29 │ copy u + │ ^^^^^^ + │ │ + │ Invalid return. Local variable 's' is still being borrowed. + │ It is still being borrowed by this reference diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_resource_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_resource_invalid.exp deleted file mode 100644 index bff2086648c98..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_resource_invalid.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_resource_invalid.move:7:15 - │ -2 │ struct X has key { u: u64 } - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -5 │ let s = X { u: 0 }; - │ - ---------- The type '0x8675309::M::X' does not have the ability 'drop' - │ │ - │ The local variable 's' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -6 │ let u = &s.u; -7 │ copy u; - │ ^ Invalid return - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_resource_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_resource_invalid.snap new file mode 100644 index 0000000000000..f76d11e72090f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_resource_invalid.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_resource_invalid.move +--- +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/return_with_borrowed_loc_resource_invalid.move:7:15 + │ +2 │ struct X has key { u: u64 } + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +5 │ let s = X { u: 0 }; + │ - ---------- The type '0x8675309::M::X' does not have the ability 'drop' + │ │ + │ The local variable 's' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +6 │ let u = &s.u; +7 │ copy u; + │ ^ Invalid return diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/writeref_borrow_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/writeref_borrow_invalid.exp deleted file mode 100644 index 7593083a1be42..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/writeref_borrow_invalid.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E07003]: invalid operation, could create dangling a reference - ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/writeref_borrow_invalid.move:10:9 - │ - 6 │ let v_mut = &mut root.g.v; - │ ------------- Field 'v' is still being mutably borrowed by this reference - · -10 │ *g_mut = G { v: 0 }; - │ ^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/writeref_borrow_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/writeref_borrow_invalid.snap new file mode 100644 index 0000000000000..10598e8b29d46 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/writeref_borrow_invalid.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/writeref_borrow_invalid.move +--- +error[E07003]: invalid operation, could create dangling a reference + ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/writeref_borrow_invalid.move:10:9 + │ + 6 │ let v_mut = &mut root.g.v; + │ ------------- Field 'v' is still being mutably borrowed by this reference + · +10 │ *g_mut = G { v: 0 }; + │ ^^^^^^^^^^^^^^^^^^^ Invalid mutation of reference. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/writeref_borrow_valid1.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/writeref_borrow_valid1.snap new file mode 100644 index 0000000000000..f2c601544d778 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/writeref_borrow_valid1.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/writeref_borrow_valid1.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/writeref_borrow_valid2.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/writeref_borrow_valid2.snap new file mode 100644 index 0000000000000..8466454ffb5f8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/writeref_borrow_valid2.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/borrow_tests/writeref_borrow_valid2.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_in_one_if_branch.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_in_one_if_branch.exp deleted file mode 100644 index f198d86894c06..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_in_one_if_branch.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/translated_ir_tests/move/commands/assign_in_one_if_branch.move:7:5 - │ -3 │ let x; - │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. - · -7 │ x == y; - │ ^ Invalid usage of unassigned variable 'x' - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/translated_ir_tests/move/commands/assign_in_one_if_branch.move:7:10 - │ -4 │ let y; - │ - The variable 'y' might not have a value. The variable must be assigned a value before being used. - · -7 │ x == y; - │ ^ Invalid usage of unassigned variable 'y' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_in_one_if_branch.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_in_one_if_branch.snap new file mode 100644 index 0000000000000..2b0d535ef7718 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_in_one_if_branch.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_in_one_if_branch.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/translated_ir_tests/move/commands/assign_in_one_if_branch.move:7:5 + │ +3 │ let x; + │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. + · +7 │ x == y; + │ ^ Invalid usage of unassigned variable 'x' + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/translated_ir_tests/move/commands/assign_in_one_if_branch.move:7:10 + │ +4 │ let y; + │ - The variable 'y' might not have a value. The variable must be assigned a value before being used. + · +7 │ x == y; + │ ^ Invalid usage of unassigned variable 'y' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_resource.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_resource.exp deleted file mode 100644 index 73b641003bb6e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_resource.exp +++ /dev/null @@ -1,26 +0,0 @@ -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/translated_ir_tests/move/commands/assign_resource.move:6:9 - │ -2 │ struct T {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -5 │ let t = T{}; &t; - │ - --- The type '0x8675309::M::T' does not have the ability 'drop' - │ │ - │ The variable contains a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again -6 │ t = T {}; &t; - │ ^ Invalid assignment to variable 't' - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/translated_ir_tests/move/commands/assign_resource.move:6:21 - │ -2 │ struct T {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -5 │ let t = T{}; &t; - │ --- The type '0x8675309::M::T' does not have the ability 'drop' -6 │ t = T {}; &t; - │ - ^ Invalid return - │ │ - │ The local variable 't' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_resource.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_resource.snap new file mode 100644 index 0000000000000..94b49dd92d9c3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_resource.snap @@ -0,0 +1,33 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_resource.move +--- +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/translated_ir_tests/move/commands/assign_resource.move:6:9 + │ +2 │ struct T {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +5 │ let t = T{}; &t; + │ - --- The type '0x8675309::M::T' does not have the ability 'drop' + │ │ + │ The variable contains a value due to this assignment. The value does not have the 'drop' ability and must be used before you assign to this variable again +6 │ t = T {}; &t; + │ ^ Invalid assignment to variable 't' + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/translated_ir_tests/move/commands/assign_resource.move:6:21 + │ +2 │ struct T {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +5 │ let t = T{}; &t; + │ --- The type '0x8675309::M::T' does not have the ability 'drop' +6 │ t = T {}; &t; + │ - ^ Invalid return + │ │ + │ The local variable 't' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_if_branch.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_if_branch.exp deleted file mode 100644 index 6b26c9ffccf3e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_if_branch.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/translated_ir_tests/move/commands/assign_wrong_if_branch.move:5:13 - │ -3 │ let x: u64; - │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. -4 │ if (true) () else x = 100; -5 │ assert!(x == 100, 42); - │ ^ Invalid usage of unassigned variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_if_branch.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_if_branch.snap new file mode 100644 index 0000000000000..7e76aa0910938 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_if_branch.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_if_branch.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/translated_ir_tests/move/commands/assign_wrong_if_branch.move:5:13 + │ +3 │ let x: u64; + │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. +4 │ if (true) () else x = 100; +5 │ assert!(x == 100, 42); + │ ^ Invalid usage of unassigned variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_if_branch_no_else.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_if_branch_no_else.exp deleted file mode 100644 index 4ec5f7de1895f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_if_branch_no_else.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/translated_ir_tests/move/commands/assign_wrong_if_branch_no_else.move:5:13 - │ -3 │ let x: u64; - │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. -4 │ if (false) x = 100; -5 │ assert!(x == 100, 42); - │ ^ Invalid usage of unassigned variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_if_branch_no_else.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_if_branch_no_else.snap new file mode 100644 index 0000000000000..cd69c1ff4c898 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_if_branch_no_else.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_if_branch_no_else.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/translated_ir_tests/move/commands/assign_wrong_if_branch_no_else.move:5:13 + │ +3 │ let x: u64; + │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. +4 │ if (false) x = 100; +5 │ assert!(x == 100, 42); + │ ^ Invalid usage of unassigned variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_type.exp deleted file mode 100644 index ff015989d9cc7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_type.exp +++ /dev/null @@ -1,10 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/translated_ir_tests/move/commands/assign_wrong_type.move:6:5 - │ -5 │ let x: u64; - │ --- Expected: 'u64' -6 │ x = false - │ ^ ----- Given: 'bool' - │ │ - │ Invalid assignment to variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_type.snap new file mode 100644 index 0000000000000..be3ae71ca3158 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_type.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/assign_wrong_type.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/translated_ir_tests/move/commands/assign_wrong_type.move:6:5 + │ +5 │ let x: u64; + │ --- Expected: 'u64' +6 │ x = false + │ ^ ----- Given: 'bool' + │ │ + │ Invalid assignment to variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/branch_assigns_then_moves.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/branch_assigns_then_moves.exp deleted file mode 100644 index 663a254fcd612..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/branch_assigns_then_moves.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/translated_ir_tests/move/commands/branch_assigns_then_moves.move:12:13 - │ - 7 │ y = move x; - │ ------ - │ │ - │ The value of 'x' might have been previously moved here. - │ Suggestion: use 'copy x' to avoid the move. - · -12 │ assert!(x == 5, 42); - │ ^ Invalid usage of previously moved variable 'x'. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/branch_assigns_then_moves.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/branch_assigns_then_moves.snap new file mode 100644 index 0000000000000..1f842db9eccaa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/branch_assigns_then_moves.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/branch_assigns_then_moves.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/translated_ir_tests/move/commands/branch_assigns_then_moves.move:12:13 + │ + 7 │ y = move x; + │ ------ + │ │ + │ The value of 'x' might have been previously moved here. + │ Suggestion: use 'copy x' to avoid the move. + · +12 │ assert!(x == 5, 42); + │ ^ Invalid usage of previously moved variable 'x'. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop.exp deleted file mode 100644 index e16cac9257ded..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04014]: invalid loop control - ┌─ tests/move_check/translated_ir_tests/move/commands/break_outside_loop.move:3:5 - │ -3 │ break - │ ^^^^^ Invalid usage of 'break'. 'break' can only be used inside a loop body or lambda - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop.snap new file mode 100644 index 0000000000000..4e4be451d6039 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop.move +--- +error[E04014]: invalid loop control + ┌─ tests/move_check/translated_ir_tests/move/commands/break_outside_loop.move:3:5 + │ +3 │ break + │ ^^^^^ Invalid usage of 'break'. 'break' can only be used inside a loop body or lambda diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop_in_else.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop_in_else.exp deleted file mode 100644 index e7ee9ac50ccf5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop_in_else.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04014]: invalid loop control - ┌─ tests/move_check/translated_ir_tests/move/commands/break_outside_loop_in_else.move:3:24 - │ -3 │ if (false) () else break; - │ ^^^^^ Invalid usage of 'break'. 'break' can only be used inside a loop body or lambda - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop_in_else.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop_in_else.snap new file mode 100644 index 0000000000000..c7e7a534e9dbc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop_in_else.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop_in_else.move +--- +error[E04014]: invalid loop control + ┌─ tests/move_check/translated_ir_tests/move/commands/break_outside_loop_in_else.move:3:24 + │ +3 │ if (false) () else break; + │ ^^^^^ Invalid usage of 'break'. 'break' can only be used inside a loop body or lambda diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop_in_if.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop_in_if.exp deleted file mode 100644 index 34da87695f681..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop_in_if.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04014]: invalid loop control - ┌─ tests/move_check/translated_ir_tests/move/commands/break_outside_loop_in_if.move:3:15 - │ -3 │ if (true) break - │ ^^^^^ Invalid usage of 'break'. 'break' can only be used inside a loop body or lambda - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop_in_if.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop_in_if.snap new file mode 100644 index 0000000000000..1bd7763d7f1bf --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop_in_if.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_outside_loop_in_if.move +--- +error[E04014]: invalid loop control + ┌─ tests/move_check/translated_ir_tests/move/commands/break_outside_loop_in_if.move:3:15 + │ +3 │ if (true) break + │ ^^^^^ Invalid usage of 'break'. 'break' can only be used inside a loop body or lambda diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_unreachable.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_unreachable.exp deleted file mode 100644 index cbd96b368f5fe..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_unreachable.exp +++ /dev/null @@ -1,10 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/translated_ir_tests/move/commands/break_unreachable.move:7:9 - │ -7 │ break; - │ ^^^^^ Any code after this expression will not be reached -8 │ x = 5; - │ ----- Unreachable code. This statement (and any following statements) will not be executed. - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_unreachable.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_unreachable.snap new file mode 100644 index 0000000000000..2488c8fcf76d4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_unreachable.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/break_unreachable.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/translated_ir_tests/move/commands/break_unreachable.move:7:9 + │ +7 │ break; + │ ^^^^^ Any code after this expression will not be reached +8 │ x = 5; + │ ----- Unreachable code. This statement (and any following statements) will not be executed. + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/continue_outside_loop.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/continue_outside_loop.exp deleted file mode 100644 index 0a02ba6ed9548..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/continue_outside_loop.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04014]: invalid loop control - ┌─ tests/move_check/translated_ir_tests/move/commands/continue_outside_loop.move:3:5 - │ -3 │ continue - │ ^^^^^^^^ Invalid usage of 'continue'. 'continue' can only be used inside a loop body or lambda - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/continue_outside_loop.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/continue_outside_loop.snap new file mode 100644 index 0000000000000..fcc085dc8f0cc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/continue_outside_loop.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/continue_outside_loop.move +--- +error[E04014]: invalid loop control + ┌─ tests/move_check/translated_ir_tests/move/commands/continue_outside_loop.move:3:5 + │ +3 │ continue + │ ^^^^^^^^ Invalid usage of 'continue'. 'continue' can only be used inside a loop body or lambda diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/continue_outside_loop_in_if.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/continue_outside_loop_in_if.exp deleted file mode 100644 index 057e508598d23..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/continue_outside_loop_in_if.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04014]: invalid loop control - ┌─ tests/move_check/translated_ir_tests/move/commands/continue_outside_loop_in_if.move:3:15 - │ -3 │ if (true) continue; - │ ^^^^^^^^ Invalid usage of 'continue'. 'continue' can only be used inside a loop body or lambda - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/continue_outside_loop_in_if.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/continue_outside_loop_in_if.snap new file mode 100644 index 0000000000000..ff60bbcccd13e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/continue_outside_loop_in_if.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/continue_outside_loop_in_if.move +--- +error[E04014]: invalid loop control + ┌─ tests/move_check/translated_ir_tests/move/commands/continue_outside_loop_in_if.move:3:15 + │ +3 │ if (true) continue; + │ ^^^^^^^^ Invalid usage of 'continue'. 'continue' can only be used inside a loop body or lambda diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/dead_return.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/dead_return.exp deleted file mode 100644 index 17a7b9b942f19..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/dead_return.exp +++ /dev/null @@ -1,10 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/translated_ir_tests/move/commands/dead_return.move:3:9 - │ -3 │ return 100; - │ ^^^^^^^^^^ Any code after this expression will not be reached -4 │ return 0 - │ -------- Unreachable code. This statement (and any following statements) will not be executed. - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/dead_return.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/dead_return.snap new file mode 100644 index 0000000000000..614fc93ae6ef8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/dead_return.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/dead_return.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/translated_ir_tests/move/commands/dead_return.move:3:9 + │ +3 │ return 100; + │ ^^^^^^^^^^ Any code after this expression will not be reached +4 │ return 0 + │ -------- Unreachable code. This statement (and any following statements) will not be executed. + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/dead_return_local.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/dead_return_local.exp deleted file mode 100644 index e004b20f059a5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/dead_return_local.exp +++ /dev/null @@ -1,10 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/translated_ir_tests/move/commands/dead_return_local.move:3:5 - │ -3 │ return (); - │ ^^^^^^^^^ Any code after this expression will not be reached -4 │ assert!(false, 42); - │ ------------------ Unreachable code. This statement (and any following statements) will not be executed. - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/dead_return_local.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/dead_return_local.snap new file mode 100644 index 0000000000000..a9c0e980fc183 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/dead_return_local.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/dead_return_local.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/translated_ir_tests/move/commands/dead_return_local.move:3:5 + │ +3 │ return (); + │ ^^^^^^^^^ Any code after this expression will not be reached +4 │ assert!(false, 42); + │ ------------------ Unreachable code. This statement (and any following statements) will not be executed. + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/else_assigns_if_doesnt.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/else_assigns_if_doesnt.exp deleted file mode 100644 index f0d8c786180a2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/else_assigns_if_doesnt.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/translated_ir_tests/move/commands/else_assigns_if_doesnt.move:11:13 - │ - 4 │ let y; - │ - The variable 'y' might not have a value. The variable must be assigned a value before being used. - · -11 │ assert!(y == 0, 42); - │ ^ Invalid usage of unassigned variable 'y' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/else_assigns_if_doesnt.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/else_assigns_if_doesnt.snap new file mode 100644 index 0000000000000..5adf54bbc4cd0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/else_assigns_if_doesnt.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/else_assigns_if_doesnt.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/translated_ir_tests/move/commands/else_assigns_if_doesnt.move:11:13 + │ + 4 │ let y; + │ - The variable 'y' might not have a value. The variable must be assigned a value before being used. + · +11 │ assert!(y == 0, 42); + │ ^ Invalid usage of unassigned variable 'y' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/else_moves_if_doesnt.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/else_moves_if_doesnt.exp deleted file mode 100644 index 17d8e8d42eb4b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/else_moves_if_doesnt.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/translated_ir_tests/move/commands/else_moves_if_doesnt.move:5:13 - │ -4 │ let y = if (true) 0 else move x; y; - │ ------ - │ │ - │ The value of 'x' might have been previously moved here. - │ Suggestion: use 'copy x' to avoid the move. -5 │ assert!(x == 0, 42); - │ ^ Invalid usage of previously moved variable 'x'. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/else_moves_if_doesnt.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/else_moves_if_doesnt.snap new file mode 100644 index 0000000000000..1b974d591f96a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/else_moves_if_doesnt.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/else_moves_if_doesnt.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/translated_ir_tests/move/commands/else_moves_if_doesnt.move:5:13 + │ +4 │ let y = if (true) 0 else move x; y; + │ ------ + │ │ + │ The value of 'x' might have been previously moved here. + │ Suggestion: use 'copy x' to avoid the move. +5 │ assert!(x == 0, 42); + │ ^ Invalid usage of previously moved variable 'x'. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_assigns_else_doesnt.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_assigns_else_doesnt.exp deleted file mode 100644 index 4621d192e389f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_assigns_else_doesnt.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/translated_ir_tests/move/commands/if_assigns_else_doesnt.move:11:13 - │ - 3 │ let x; - │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. - · -11 │ assert!(x == 42, 42); - │ ^ Invalid usage of unassigned variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_assigns_else_doesnt.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_assigns_else_doesnt.snap new file mode 100644 index 0000000000000..bb693f88e30ed --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_assigns_else_doesnt.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_assigns_else_doesnt.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/translated_ir_tests/move/commands/if_assigns_else_doesnt.move:11:13 + │ + 3 │ let x; + │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. + · +11 │ assert!(x == 42, 42); + │ ^ Invalid usage of unassigned variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_assigns_no_else.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_assigns_no_else.exp deleted file mode 100644 index 54d4190ca2ac1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_assigns_no_else.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/translated_ir_tests/move/commands/if_assigns_no_else.move:5:13 - │ -3 │ let x; - │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. -4 │ if (true) x = 42; -5 │ assert!(x == 42, 42); - │ ^ Invalid usage of unassigned variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_assigns_no_else.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_assigns_no_else.snap new file mode 100644 index 0000000000000..123f6697d8707 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_assigns_no_else.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_assigns_no_else.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/translated_ir_tests/move/commands/if_assigns_no_else.move:5:13 + │ +3 │ let x; + │ - The variable 'x' might not have a value. The variable must be assigned a value before being used. +4 │ if (true) x = 42; +5 │ assert!(x == 42, 42); + │ ^ Invalid usage of unassigned variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_moves_else_doesnt.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_moves_else_doesnt.exp deleted file mode 100644 index 15ef18290d16b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_moves_else_doesnt.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/translated_ir_tests/move/commands/if_moves_else_doesnt.move:6:13 - │ -4 │ let y = if (true) move x else 0; - │ ------ - │ │ - │ The value of 'x' might have been previously moved here. - │ Suggestion: use 'copy x' to avoid the move. -5 │ y; -6 │ assert!(x == 0, 42); - │ ^ Invalid usage of previously moved variable 'x'. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_moves_else_doesnt.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_moves_else_doesnt.snap new file mode 100644 index 0000000000000..e5d478253b5ef --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_moves_else_doesnt.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_moves_else_doesnt.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/translated_ir_tests/move/commands/if_moves_else_doesnt.move:6:13 + │ +4 │ let y = if (true) move x else 0; + │ ------ + │ │ + │ The value of 'x' might have been previously moved here. + │ Suggestion: use 'copy x' to avoid the move. +5 │ y; +6 │ assert!(x == 0, 42); + │ ^ Invalid usage of previously moved variable 'x'. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_moves_no_else.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_moves_no_else.exp deleted file mode 100644 index 639f39fb82a6e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_moves_no_else.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/translated_ir_tests/move/commands/if_moves_no_else.move:8:13 - │ -5 │ let y = move x; - │ ------ - │ │ - │ The value of 'x' might have been previously moved here. - │ Suggestion: use 'copy x' to avoid the move. - · -8 │ assert!(x == 0, 42); - │ ^ Invalid usage of previously moved variable 'x'. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_moves_no_else.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_moves_no_else.snap new file mode 100644 index 0000000000000..5f365841a294f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_moves_no_else.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/if_moves_no_else.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/translated_ir_tests/move/commands/if_moves_no_else.move:8:13 + │ +5 │ let y = move x; + │ ------ + │ │ + │ The value of 'x' might have been previously moved here. + │ Suggestion: use 'copy x' to avoid the move. + · +8 │ assert!(x == 0, 42); + │ ^ Invalid usage of previously moved variable 'x'. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/invalid_fallthrough2.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/invalid_fallthrough2.exp deleted file mode 100644 index 2fbbf03754fe2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/invalid_fallthrough2.exp +++ /dev/null @@ -1,10 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/translated_ir_tests/move/commands/invalid_fallthrough2.move:4:3 - │ -4 │ return (); - │ ^^^^^^^^^ Any code after this expression will not be reached -5 │ x = 7 - │ ----- Unreachable code. This statement (and any following statements) will not be executed. - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/invalid_fallthrough2.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/invalid_fallthrough2.snap new file mode 100644 index 0000000000000..12806d6ff2e4d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/invalid_fallthrough2.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/invalid_fallthrough2.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/translated_ir_tests/move/commands/invalid_fallthrough2.move:4:3 + │ +4 │ return (); + │ ^^^^^^^^^ Any code after this expression will not be reached +5 │ x = 7 + │ ----- Unreachable code. This statement (and any following statements) will not be executed. + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/invalid_fallthrough3.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/invalid_fallthrough3.exp deleted file mode 100644 index 0ba463b93d4c6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/invalid_fallthrough3.exp +++ /dev/null @@ -1,10 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/translated_ir_tests/move/commands/invalid_fallthrough3.move:4:3 - │ -4 │ if (true) return () else return (); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Any code after this expression will not be reached -5 │ x = 7; - │ ----- Unreachable code. This statement (and any following statements) will not be executed. - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/invalid_fallthrough3.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/invalid_fallthrough3.snap new file mode 100644 index 0000000000000..ec0a5c1a65349 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/invalid_fallthrough3.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/invalid_fallthrough3.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/translated_ir_tests/move/commands/invalid_fallthrough3.move:4:3 + │ +4 │ if (true) return () else return (); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Any code after this expression will not be reached +5 │ x = 7; + │ ----- Unreachable code. This statement (and any following statements) will not be executed. + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/join_failure.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/join_failure.exp deleted file mode 100644 index 96c940fc1cdc1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/join_failure.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/translated_ir_tests/move/commands/join_failure.move:13:21 - │ - 8 │ R{ f } = move r; - │ ------ - │ │ - │ The value of 'r' might have been previously moved here. - │ Suggestion: use 'copy r' to avoid the move. - · -13 │ R{ f: _ } = move r; - │ ^^^^^^ Invalid usage of previously moved variable 'r'. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/join_failure.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/join_failure.snap new file mode 100644 index 0000000000000..8620f75cdb018 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/join_failure.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/join_failure.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/translated_ir_tests/move/commands/join_failure.move:13:21 + │ + 8 │ R{ f } = move r; + │ ------ + │ │ + │ The value of 'r' might have been previously moved here. + │ Suggestion: use 'copy r' to avoid the move. + · +13 │ R{ f: _ } = move r; + │ ^^^^^^ Invalid usage of previously moved variable 'r'. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/mixed_lvalue.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/mixed_lvalue.exp deleted file mode 100644 index 8e1267d3a653f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/mixed_lvalue.exp +++ /dev/null @@ -1,28 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/translated_ir_tests/move/commands/mixed_lvalue.move:11:13 - │ -11 │ let r_ref = &mut r; - │ ^^^^^ Unused local variable 'r_ref'. Consider removing or prefixing with an underscore: '_r_ref' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/translated_ir_tests/move/commands/mixed_lvalue.move:12:13 - │ -12 │ let s = S { f: 0 }; - │ ^ Unused local variable 's'. Consider removing or prefixing with an underscore: '_s' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01009]: invalid assignment - ┌─ tests/move_check/translated_ir_tests/move/commands/mixed_lvalue.move:14:19 - │ -14 │ (_, _, _, s.f) = four(); - │ ^^^ Invalid assignment syntax. Expected: a local, a field write, or a deconstructing assignment - -error[E01009]: invalid assignment - ┌─ tests/move_check/translated_ir_tests/move/commands/mixed_lvalue.move:15:19 - │ -15 │ (_, _, _, *r_ref) = four(); - │ ^^^^^^ Invalid assignment syntax. Expected: a local, a field write, or a deconstructing assignment - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/mixed_lvalue.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/mixed_lvalue.snap new file mode 100644 index 0000000000000..1f3451e31709f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/mixed_lvalue.snap @@ -0,0 +1,35 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/mixed_lvalue.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/translated_ir_tests/move/commands/mixed_lvalue.move:11:13 + │ +11 │ let r_ref = &mut r; + │ ^^^^^ Unused local variable 'r_ref'. Consider removing or prefixing with an underscore: '_r_ref' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/translated_ir_tests/move/commands/mixed_lvalue.move:12:13 + │ +12 │ let s = S { f: 0 }; + │ ^ Unused local variable 's'. Consider removing or prefixing with an underscore: '_s' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01009]: invalid assignment + ┌─ tests/move_check/translated_ir_tests/move/commands/mixed_lvalue.move:14:19 + │ +14 │ (_, _, _, s.f) = four(); + │ ^^^ Invalid assignment syntax. Expected: a local, a field write, or a deconstructing assignment + +error[E01009]: invalid assignment + ┌─ tests/move_check/translated_ir_tests/move/commands/mixed_lvalue.move:15:19 + │ +15 │ (_, _, _, *r_ref) = four(); + │ ^^^^^^ Invalid assignment syntax. Expected: a local, a field write, or a deconstructing assignment diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/move_before_assign.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/move_before_assign.exp deleted file mode 100644 index 6ad13ee890550..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/move_before_assign.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/translated_ir_tests/move/commands/move_before_assign.move:4:9 - │ -4 │ let y = move x; - │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/translated_ir_tests/move/commands/move_before_assign.move:4:13 - │ -3 │ let x: u64; - │ - The variable 'x' does not have a value. The variable must be assigned a value before being used. -4 │ let y = move x; - │ ^^^^^^ Invalid usage of unassigned variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/move_before_assign.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/move_before_assign.snap new file mode 100644 index 0000000000000..f04a1ff435fab --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/move_before_assign.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/move_before_assign.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/translated_ir_tests/move/commands/move_before_assign.move:4:9 + │ +4 │ let y = move x; + │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/translated_ir_tests/move/commands/move_before_assign.move:4:13 + │ +3 │ let x: u64; + │ - The variable 'x' does not have a value. The variable must be assigned a value before being used. +4 │ let y = move x; + │ ^^^^^^ Invalid usage of unassigned variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/no_let_outside_if.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/no_let_outside_if.exp deleted file mode 100644 index c98d24601d487..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/no_let_outside_if.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E03009]: unbound variable - ┌─ tests/move_check/translated_ir_tests/move/commands/no_let_outside_if.move:4:9 - │ -4 │ y = 5; - │ ^ Invalid assignment. Unbound variable 'y' - -error[E03009]: unbound variable - ┌─ tests/move_check/translated_ir_tests/move/commands/no_let_outside_if.move:6:9 - │ -6 │ y = 0; - │ ^ Invalid assignment. Unbound variable 'y' - -error[E03009]: unbound variable - ┌─ tests/move_check/translated_ir_tests/move/commands/no_let_outside_if.move:8:13 - │ -8 │ assert!(y == 5, 42); - │ ^ Unbound variable 'y' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/no_let_outside_if.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/no_let_outside_if.snap new file mode 100644 index 0000000000000..5a522d3fbc9a2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/no_let_outside_if.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/no_let_outside_if.move +--- +error[E03009]: unbound variable + ┌─ tests/move_check/translated_ir_tests/move/commands/no_let_outside_if.move:4:9 + │ +4 │ y = 5; + │ ^ Invalid assignment. Unbound variable 'y' + +error[E03009]: unbound variable + ┌─ tests/move_check/translated_ir_tests/move/commands/no_let_outside_if.move:6:9 + │ +6 │ y = 0; + │ ^ Invalid assignment. Unbound variable 'y' + +error[E03009]: unbound variable + ┌─ tests/move_check/translated_ir_tests/move/commands/no_let_outside_if.move:8:13 + │ +8 │ assert!(y == 5, 42); + │ ^ Unbound variable 'y' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_negative.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_negative.exp deleted file mode 100644 index beaf31c772c7c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_negative.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/translated_ir_tests/move/commands/pop_negative.move:7:9 - │ -2 │ fun three(): (u64, u64, u64) { - │ --------------- Given expression list of length 3: '(u64, u64, u64)' - · -7 │ (_, _, _, _) = three(); - │ ^^^^^^^^^^^^ - │ │ - │ Invalid value for assignment - │ Expected expression list of length 4: '(_, _, _, _)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_negative.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_negative.snap new file mode 100644 index 0000000000000..bfb07178cdd73 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_negative.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_negative.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/translated_ir_tests/move/commands/pop_negative.move:7:9 + │ +2 │ fun three(): (u64, u64, u64) { + │ --------------- Given expression list of length 3: '(u64, u64, u64)' + · +7 │ (_, _, _, _) = three(); + │ ^^^^^^^^^^^^ + │ │ + │ Invalid value for assignment + │ Expected expression list of length 4: '(_, _, _, _)' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_positive.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_positive.exp deleted file mode 100644 index 83b4a3abed371..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_positive.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/translated_ir_tests/move/commands/pop_positive.move:7:9 - │ -2 │ fun three(): (u64, u64, u64) { - │ --------------- Given expression list of length 3: '(u64, u64, u64)' - · -7 │ (_, _) = three(); - │ ^^^^^^ - │ │ - │ Invalid value for assignment - │ Expected expression list of length 2: '(_, _)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_positive.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_positive.snap new file mode 100644 index 0000000000000..5807ef08ae720 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_positive.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_positive.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/translated_ir_tests/move/commands/pop_positive.move:7:9 + │ +2 │ fun three(): (u64, u64, u64) { + │ --------------- Given expression list of length 3: '(u64, u64, u64)' + · +7 │ (_, _) = three(); + │ ^^^^^^ + │ │ + │ Invalid value for assignment + │ Expected expression list of length 2: '(_, _)' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_weird.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_weird.exp deleted file mode 100644 index 8d28662b802dc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_weird.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/translated_ir_tests/move/commands/pop_weird.move:13:9 - │ -13 │ (_, _) = (); - │ ^^^^^^ -- Given: '()' - │ │ - │ Invalid value for assignment - │ Expected: '(_, _)' - -error[E01009]: invalid assignment - ┌─ tests/move_check/translated_ir_tests/move/commands/pop_weird.move:14:9 - │ -14 │ (_) = (); - │ ^^^ Invalid assignment syntax. Expected: a local, a field write, or a deconstructing assignment - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_weird.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_weird.snap new file mode 100644 index 0000000000000..25acbd5ccc51c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_weird.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/pop_weird.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/translated_ir_tests/move/commands/pop_weird.move:13:9 + │ +13 │ (_, _) = (); + │ ^^^^^^ -- Given: '()' + │ │ + │ Invalid value for assignment + │ Expected: '(_, _)' + +error[E01009]: invalid assignment + ┌─ tests/move_check/translated_ir_tests/move/commands/pop_weird.move:14:9 + │ +14 │ (_) = (); + │ ^^^ Invalid assignment syntax. Expected: a local, a field write, or a deconstructing assignment diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/return_type_mismatch_and_unused_resource.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/return_type_mismatch_and_unused_resource.exp deleted file mode 100644 index 42f31954769b3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/return_type_mismatch_and_unused_resource.exp +++ /dev/null @@ -1,22 +0,0 @@ -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/translated_ir_tests/move/commands/return_type_mismatch_and_unused_resource.move:7:9 - │ -2 │ struct X {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -5 │ let x = X {}; - │ - ---- The type '0x8675309::M::X' does not have the ability 'drop' - │ │ - │ The local variable 'x' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -6 │ &x; -7 │ false - │ ^^^^^ Invalid return - -error[E07004]: invalid return of locally borrowed state - ┌─ tests/move_check/translated_ir_tests/move/commands/return_type_mismatch_and_unused_resource.move:13:9 - │ -12 │ let r = &u; - │ -- It is still being borrowed by this reference -13 │ r - │ ^ Invalid return. Local variable 'u' is still being borrowed. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/return_type_mismatch_and_unused_resource.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/return_type_mismatch_and_unused_resource.snap new file mode 100644 index 0000000000000..99a7faa0e1cc5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/return_type_mismatch_and_unused_resource.snap @@ -0,0 +1,29 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/return_type_mismatch_and_unused_resource.move +--- +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/translated_ir_tests/move/commands/return_type_mismatch_and_unused_resource.move:7:9 + │ +2 │ struct X {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +5 │ let x = X {}; + │ - ---- The type '0x8675309::M::X' does not have the ability 'drop' + │ │ + │ The local variable 'x' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +6 │ &x; +7 │ false + │ ^^^^^ Invalid return + +error[E07004]: invalid return of locally borrowed state + ┌─ tests/move_check/translated_ir_tests/move/commands/return_type_mismatch_and_unused_resource.move:13:9 + │ +12 │ let r = &u; + │ -- It is still being borrowed by this reference +13 │ r + │ ^ Invalid return. Local variable 'u' is still being borrowed. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_extra_binding.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_extra_binding.exp deleted file mode 100644 index ef8d0ef6201c3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_extra_binding.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03010]: unbound field - ┌─ tests/move_check/translated_ir_tests/move/commands/unpack_extra_binding.move:11:13 - │ -11 │ let T { i, x, b: flag } = t; - │ ^^^^^^^^^^^^^^^^^^^ Unbound field 'b' in '0x8675309::Test::T' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_extra_binding.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_extra_binding.snap new file mode 100644 index 0000000000000..3cd250dc0873a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_extra_binding.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_extra_binding.move +--- +error[E03010]: unbound field + ┌─ tests/move_check/translated_ir_tests/move/commands/unpack_extra_binding.move:11:13 + │ +11 │ let T { i, x, b: flag } = t; + │ ^^^^^^^^^^^^^^^^^^^ Unbound field 'b' in '0x8675309::Test::T' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_missing_binding.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_missing_binding.exp deleted file mode 100644 index b09e31b475f91..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_missing_binding.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04016]: too few arguments - ┌─ tests/move_check/translated_ir_tests/move/commands/unpack_missing_binding.move:11:13 - │ -11 │ let T { i, x, b: flag } = t; - │ ^^^^^^^^^^^^^^^^^^^ Missing binding for field 'y' in '0x8675309::Test::T' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_missing_binding.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_missing_binding.snap new file mode 100644 index 0000000000000..14f3fffab1c4e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_missing_binding.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_missing_binding.move +--- +error[E04016]: too few arguments + ┌─ tests/move_check/translated_ir_tests/move/commands/unpack_missing_binding.move:11:13 + │ +11 │ let T { i, x, b: flag } = t; + │ ^^^^^^^^^^^^^^^^^^^ Missing binding for field 'y' in '0x8675309::Test::T' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_wrong_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_wrong_type.exp deleted file mode 100644 index 944751884d69c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_wrong_type.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/translated_ir_tests/move/commands/unpack_wrong_type.move:6:9 - │ -5 │ public fun destroy_t(t: T) { - │ - Expected: '0x8675309::Test::T' -6 │ X { b: _ } = t; - │ ^^^^^^^^^^ - │ │ - │ Invalid deconstruction assignment - │ Given: '0x8675309::Test::X' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_wrong_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_wrong_type.snap new file mode 100644 index 0000000000000..0f40b4cee8d68 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_wrong_type.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/unpack_wrong_type.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/translated_ir_tests/move/commands/unpack_wrong_type.move:6:9 + │ +5 │ public fun destroy_t(t: T) { + │ - Expected: '0x8675309::Test::T' +6 │ X { b: _ } = t; + │ ^^^^^^^^^^ + │ │ + │ Invalid deconstruction assignment + │ Given: '0x8675309::Test::X' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/use_before_assign.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/use_before_assign.exp deleted file mode 100644 index 29fcd9059e4f6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/use_before_assign.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/translated_ir_tests/move/commands/use_before_assign.move:4:9 - │ -4 │ let y = x; - │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/translated_ir_tests/move/commands/use_before_assign.move:4:13 - │ -3 │ let x: u64; - │ - The variable 'x' does not have a value. The variable must be assigned a value before being used. -4 │ let y = x; - │ ^ Invalid usage of unassigned variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/use_before_assign.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/use_before_assign.snap new file mode 100644 index 0000000000000..24f95e8f6904f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/use_before_assign.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/use_before_assign.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/translated_ir_tests/move/commands/use_before_assign.move:4:9 + │ +4 │ let y = x; + │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/translated_ir_tests/move/commands/use_before_assign.move:4:13 + │ +3 │ let x: u64; + │ - The variable 'x' does not have a value. The variable must be assigned a value before being used. +4 │ let y = x; + │ ^ Invalid usage of unassigned variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/while_move_local.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/while_move_local.exp deleted file mode 100644 index 24917ff43ad38..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/while_move_local.exp +++ /dev/null @@ -1,10 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/translated_ir_tests/move/commands/while_move_local.move:7:13 - │ -7 │ y = move x; - │ ^^^^^^ - │ │ - │ Invalid usage of previously moved variable 'x'. - │ Suggestion: use 'copy x' to avoid the move. - │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/while_move_local.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/while_move_local.snap new file mode 100644 index 0000000000000..d254a9557f839 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/while_move_local.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/while_move_local.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/translated_ir_tests/move/commands/while_move_local.move:7:13 + │ +7 │ y = move x; + │ ^^^^^^ + │ │ + │ Invalid usage of previously moved variable 'x'. + │ Suggestion: use 'copy x' to avoid the move. + │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/while_move_local_2.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/while_move_local_2.exp deleted file mode 100644 index ed555ec52005c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/while_move_local_2.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[E06002]: use of unassigned variable - ┌─ tests/move_check/translated_ir_tests/move/commands/while_move_local_2.move:8:17 - │ -8 │ y = move x; - │ ^^^^^^ - │ │ - │ Invalid usage of previously moved variable 'x'. - │ Suggestion: use 'copy x' to avoid the move. - │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. - -error[E06002]: use of unassigned variable - ┌─ tests/move_check/translated_ir_tests/move/commands/while_move_local_2.move:10:17 - │ -10 │ x = move y; - │ ^^^^^^ - │ │ - │ Invalid usage of previously moved variable 'y'. - │ Suggestion: use 'copy y' to avoid the move. - │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/while_move_local_2.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/while_move_local_2.snap new file mode 100644 index 0000000000000..64c6f77240061 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/while_move_local_2.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/commands/while_move_local_2.move +--- +error[E06002]: use of unassigned variable + ┌─ tests/move_check/translated_ir_tests/move/commands/while_move_local_2.move:8:17 + │ +8 │ y = move x; + │ ^^^^^^ + │ │ + │ Invalid usage of previously moved variable 'x'. + │ Suggestion: use 'copy x' to avoid the move. + │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. + +error[E06002]: use of unassigned variable + ┌─ tests/move_check/translated_ir_tests/move/commands/while_move_local_2.move:10:17 + │ +10 │ x = move y; + │ ^^^^^^ + │ │ + │ Invalid usage of previously moved variable 'y'. + │ Suggestion: use 'copy y' to avoid the move. + │ In a loop, this typically means it was moved in the first iteration, and is not available by the second iteration. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/complex_1.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/complex_1.exp deleted file mode 100644 index d8433e2258b57..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/complex_1.exp +++ /dev/null @@ -1,31 +0,0 @@ -error[E04019]: cyclic type instantiation - ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/complex_1.move:10:9 - │ -10 │ c, bool>() - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type parameter 'c::T1' was instantiated with the type '0x8675309::M::S', which contains the type parameter 'c::T2'. A cycle of recursive calls causes the instantiation to recurse infinitely - │ Invalid call to '0x8675309::M::c' - │ 'b<_, c::T1>' calls 'c<0x8675309::M::S, _>' - · -14 │ c(); - │ ------------ 'c' calls 'c<_, c::T1>' -15 │ d(); - │ ------- 'c<_, c::T1>' calls 'd' - · -20 │ b() - │ ----------- 'd' calls 'b<_, c::T1>' - -error[E04019]: cyclic type instantiation - ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/complex_1.move:31:9 - │ -27 │ g() - │ ------ 'f' calls 'g' - · -31 │ f>() - │ ^^^^^^^^^ - │ │ │ - │ │ The type parameter 'g::T' was instantiated with the type '0x8675309::M::S', which contains the type parameter 'f::T'. These mutually recursive calls causes the instantiation to recurse infinitely - │ Invalid call to '0x8675309::M::f' - │ 'g' calls 'f<0x8675309::M::S>' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/complex_1.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/complex_1.snap new file mode 100644 index 0000000000000..a4b4cfbfee26d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/complex_1.snap @@ -0,0 +1,38 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/complex_1.move +--- +error[E04019]: cyclic type instantiation + ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/complex_1.move:10:9 + │ +10 │ c, bool>() + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type parameter 'c::T1' was instantiated with the type '0x8675309::M::S', which contains the type parameter 'c::T2'. A cycle of recursive calls causes the instantiation to recurse infinitely + │ Invalid call to '0x8675309::M::c' + │ 'b<_, c::T1>' calls 'c<0x8675309::M::S, _>' + · +14 │ c(); + │ ------------ 'c' calls 'c<_, c::T1>' +15 │ d(); + │ ------- 'c<_, c::T1>' calls 'd' + · +20 │ b() + │ ----------- 'd' calls 'b<_, c::T1>' + +error[E04019]: cyclic type instantiation + ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/complex_1.move:31:9 + │ +27 │ g() + │ ------ 'f' calls 'g' + · +31 │ f>() + │ ^^^^^^^^^ + │ │ │ + │ │ The type parameter 'g::T' was instantiated with the type '0x8675309::M::S', which contains the type parameter 'f::T'. These mutually recursive calls causes the instantiation to recurse infinitely + │ Invalid call to '0x8675309::M::f' + │ 'g' calls 'f<0x8675309::M::S>' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_just_type_params_ok.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_just_type_params_ok.snap new file mode 100644 index 0000000000000..d0497c9988506 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_just_type_params_ok.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_just_type_params_ok.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_non_generic_type_ok.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_non_generic_type_ok.snap new file mode 100644 index 0000000000000..4de82434e86fe --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_non_generic_type_ok.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_non_generic_type_ok.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_three_args_just_type_params_shitfing_ok.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_three_args_just_type_params_shitfing_ok.snap new file mode 100644 index 0000000000000..074fffa7b501f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_three_args_just_type_params_shitfing_ok.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_three_args_just_type_params_shitfing_ok.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_three_args_type_con_non_generic_types_ok.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_three_args_type_con_non_generic_types_ok.snap new file mode 100644 index 0000000000000..8cc26dd0c3f29 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_three_args_type_con_non_generic_types_ok.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_three_args_type_con_non_generic_types_ok.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_three_args_type_con_shifting.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_three_args_type_con_shifting.exp deleted file mode 100644 index 97e6f3490c7a9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_three_args_type_con_shifting.exp +++ /dev/null @@ -1,26 +0,0 @@ -error[E04019]: cyclic type instantiation - ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_three_args_type_con_shifting.move:9:9 - │ - 5 │ g() - │ --------------- - │ │ - │ 'f<_, _, h::T3>' calls 'g<_, h::T3, _>' - │ 'f' calls 'g<_, _, h::T3>' - │ 'f<_, h::T3, _>' calls 'g' - · - 9 │ h>() - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type parameter 'f::T3' was instantiated with the type '0x8675309::M::S', which contains the type parameter 'h::T3'. A cycle of recursive calls causes the instantiation to recurse infinitely - │ Invalid call to '0x8675309::M::h' - │ 'g<_, _, h::T3>' calls 'h<_, _, 0x8675309::M::S>' - │ 'g' calls 'h' - │ 'g<_, h::T3, _>' calls 'h<_, h::T3, _>' - · -13 │ f() - │ --------------- - │ │ - │ 'h<_, _, h::T3>' calls 'f<_, _, h::T3>' - │ 'h' calls 'f' - │ 'h<_, h::T3, _>' calls 'f<_, h::T3, _>' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_three_args_type_con_shifting.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_three_args_type_con_shifting.snap new file mode 100644 index 0000000000000..aa1297d1f484e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_three_args_type_con_shifting.snap @@ -0,0 +1,33 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_three_args_type_con_shifting.move +--- +error[E04019]: cyclic type instantiation + ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_three_args_type_con_shifting.move:9:9 + │ + 5 │ g() + │ --------------- + │ │ + │ 'f<_, _, h::T3>' calls 'g<_, h::T3, _>' + │ 'f' calls 'g<_, _, h::T3>' + │ 'f<_, h::T3, _>' calls 'g' + · + 9 │ h>() + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type parameter 'f::T3' was instantiated with the type '0x8675309::M::S', which contains the type parameter 'h::T3'. A cycle of recursive calls causes the instantiation to recurse infinitely + │ Invalid call to '0x8675309::M::h' + │ 'g<_, _, h::T3>' calls 'h<_, _, 0x8675309::M::S>' + │ 'g' calls 'h' + │ 'g<_, h::T3, _>' calls 'h<_, h::T3, _>' + · +13 │ f() + │ --------------- + │ │ + │ 'h<_, _, h::T3>' calls 'f<_, _, h::T3>' + │ 'h' calls 'f' + │ 'h<_, h::T3, _>' calls 'f<_, h::T3, _>' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_two_args_non_generic_type_and_type_param_ok.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_two_args_non_generic_type_and_type_param_ok.snap new file mode 100644 index 0000000000000..3b20ea957389c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_two_args_non_generic_type_and_type_param_ok.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_two_args_non_generic_type_and_type_param_ok.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_two_args_swapping_just_type_params_ok.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_two_args_swapping_just_type_params_ok.snap new file mode 100644 index 0000000000000..bb2a5e6a579ad --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_two_args_swapping_just_type_params_ok.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_two_args_swapping_just_type_params_ok.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_two_args_swapping_type_con.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_two_args_swapping_type_con.exp deleted file mode 100644 index 7b99fc17e8669..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_two_args_swapping_type_con.exp +++ /dev/null @@ -1,17 +0,0 @@ -error[E04019]: cyclic type instantiation - ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_two_args_swapping_type_con.move:9:9 - │ -5 │ g() - │ ----------- - │ │ - │ 'f<_, f::T2, _>' calls 'g' - │ 'f' calls 'g<_, f::T2>' - · -9 │ f, u64>() - │ ^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type parameter 'g::T2' was instantiated with the type '0x8675309::M::S', which contains the type parameter 'f::T2'. A cycle of recursive calls causes the instantiation to recurse infinitely - │ Invalid call to '0x8675309::M::f' - │ 'g<_, f::T2>' calls 'f<_, 0x8675309::M::S, _>' - │ 'g' calls 'f' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_two_args_swapping_type_con.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_two_args_swapping_type_con.snap new file mode 100644 index 0000000000000..c174ff23d9812 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_two_args_swapping_type_con.snap @@ -0,0 +1,24 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_two_args_swapping_type_con.move +--- +error[E04019]: cyclic type instantiation + ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_two_args_swapping_type_con.move:9:9 + │ +5 │ g() + │ ----------- + │ │ + │ 'f<_, f::T2, _>' calls 'g' + │ 'f' calls 'g<_, f::T2>' + · +9 │ f, u64>() + │ ^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type parameter 'g::T2' was instantiated with the type '0x8675309::M::S', which contains the type parameter 'f::T2'. A cycle of recursive calls causes the instantiation to recurse infinitely + │ Invalid call to '0x8675309::M::f' + │ 'g<_, f::T2>' calls 'f<_, 0x8675309::M::S, _>' + │ 'g' calls 'f' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_type_con.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_type_con.exp deleted file mode 100644 index 64ee00f544872..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_type_con.exp +++ /dev/null @@ -1,13 +0,0 @@ -error[E04019]: cyclic type instantiation - ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_type_con.move:8:9 - │ - 8 │ g>() - │ ^^^^^^^^^ - │ │ │ - │ │ The type parameter 'f::T' was instantiated with the type '0x8675309::M::S', which contains the type parameter 'g::T'. These mutually recursive calls causes the instantiation to recurse infinitely - │ Invalid call to '0x8675309::M::g' - │ 'f' calls 'g<0x8675309::M::S>' - · -12 │ f() - │ ------ 'g' calls 'f' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_type_con.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_type_con.snap new file mode 100644 index 0000000000000..eecebfe6f3276 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_type_con.snap @@ -0,0 +1,20 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_type_con.move +--- +error[E04019]: cyclic type instantiation + ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/mutually_recursive_type_con.move:8:9 + │ + 8 │ g>() + │ ^^^^^^^^^ + │ │ │ + │ │ The type parameter 'f::T' was instantiated with the type '0x8675309::M::S', which contains the type parameter 'g::T'. These mutually recursive calls causes the instantiation to recurse infinitely + │ Invalid call to '0x8675309::M::g' + │ 'f' calls 'g<0x8675309::M::S>' + · +12 │ f() + │ ------ 'g' calls 'f' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/nested_types_1.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/nested_types_1.exp deleted file mode 100644 index 234d68f2fe947..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/nested_types_1.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04019]: cyclic type instantiation - ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/nested_types_1.move:5:9 - │ -5 │ foo>>() - │ ^^^^^^^^^^^^^^ - │ │ │ - │ │ The type parameter 'foo::T' was instantiated with the type '0x8675309::M::S<0x8675309::M::S>', which contains the type parameter 'foo::T'. This recursive call causes the instantiation to recurse infinitely - │ Invalid call to '0x8675309::M::foo' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/nested_types_1.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/nested_types_1.snap new file mode 100644 index 0000000000000..5a1c465454ba4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/nested_types_1.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/nested_types_1.move +--- +error[E04019]: cyclic type instantiation + ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/nested_types_1.move:5:9 + │ +5 │ foo>>() + │ ^^^^^^^^^^^^^^ + │ │ │ + │ │ The type parameter 'foo::T' was instantiated with the type '0x8675309::M::S<0x8675309::M::S>', which contains the type parameter 'foo::T'. This recursive call causes the instantiation to recurse infinitely + │ Invalid call to '0x8675309::M::foo' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/nested_types_2.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/nested_types_2.exp deleted file mode 100644 index a9bb0e2f5c501..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/nested_types_2.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04019]: cyclic type instantiation - ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/nested_types_2.move:6:9 - │ -6 │ foo>>>() - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type parameter 'foo::T' was instantiated with the type '0x8675309::M::R>>', which contains the type parameter 'foo::T'. This recursive call causes the instantiation to recurse infinitely - │ Invalid call to '0x8675309::M::foo' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/nested_types_2.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/nested_types_2.snap new file mode 100644 index 0000000000000..490412ed5f825 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/nested_types_2.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/nested_types_2.move +--- +error[E04019]: cyclic type instantiation + ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/nested_types_2.move:6:9 + │ +6 │ foo>>>() + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type parameter 'foo::T' was instantiated with the type '0x8675309::M::R>>', which contains the type parameter 'foo::T'. This recursive call causes the instantiation to recurse infinitely + │ Invalid call to '0x8675309::M::foo' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_infinite_type_terminates.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_infinite_type_terminates.exp deleted file mode 100644 index 4d9f158e8b6d5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_infinite_type_terminates.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04019]: cyclic type instantiation - ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_infinite_type_terminates.move:11:18 - │ -11 │ unbox(f>(n - 1, Box { x })) - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type parameter 'f::T' was instantiated with the type '0x8675309::M::Box', which contains the type parameter 'f::T'. This recursive call causes the instantiation to recurse infinitely - │ Invalid call to '0x8675309::M::f' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_infinite_type_terminates.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_infinite_type_terminates.snap new file mode 100644 index 0000000000000..d21d6416b95e0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_infinite_type_terminates.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_infinite_type_terminates.move +--- +error[E04019]: cyclic type instantiation + ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_infinite_type_terminates.move:11:18 + │ +11 │ unbox(f>(n - 1, Box { x })) + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type parameter 'f::T' was instantiated with the type '0x8675309::M::Box', which contains the type parameter 'f::T'. This recursive call causes the instantiation to recurse infinitely + │ Invalid call to '0x8675309::M::f' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_one_arg_just_type_params_ok.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_one_arg_just_type_params_ok.snap new file mode 100644 index 0000000000000..2ecd3c8e4ad5e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_one_arg_just_type_params_ok.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_one_arg_just_type_params_ok.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_one_arg_non_generic_type_ok.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_one_arg_non_generic_type_ok.snap new file mode 100644 index 0000000000000..c4faa0145e648 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_one_arg_non_generic_type_ok.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_one_arg_non_generic_type_ok.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_one_arg_type_con.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_one_arg_type_con.exp deleted file mode 100644 index a7ef509d902cf..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_one_arg_type_con.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04019]: cyclic type instantiation - ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_one_arg_type_con.move:7:9 - │ -7 │ f>(S { f: x }) - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type parameter 'f::T' was instantiated with the type '0x8675309::M::S', which contains the type parameter 'f::T'. This recursive call causes the instantiation to recurse infinitely - │ Invalid call to '0x8675309::M::f' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_one_arg_type_con.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_one_arg_type_con.snap new file mode 100644 index 0000000000000..6bc18c59f16c4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_one_arg_type_con.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_one_arg_type_con.move +--- +error[E04019]: cyclic type instantiation + ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_one_arg_type_con.move:7:9 + │ +7 │ f>(S { f: x }) + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type parameter 'f::T' was instantiated with the type '0x8675309::M::S', which contains the type parameter 'f::T'. This recursive call causes the instantiation to recurse infinitely + │ Invalid call to '0x8675309::M::f' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_two_args_swapping_type_con.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_two_args_swapping_type_con.exp deleted file mode 100644 index 35baf378b3680..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_two_args_swapping_type_con.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[E04019]: cyclic type instantiation - ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_two_args_swapping_type_con.move:8:9 - │ -8 │ f, T1>(S { x }, a) - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type parameter 'f::T1' was instantiated with the type '0x8675309::M::S', which contains the type parameter 'f::T2'. These mutually recursive calls causes the instantiation to recurse infinitely - │ Invalid call to '0x8675309::M::f' - │ 'f<_, f::T1>' calls 'f<0x8675309::M::S, _>' - │ 'f' calls 'f<_, f::T1>' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_two_args_swapping_type_con.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_two_args_swapping_type_con.snap new file mode 100644 index 0000000000000..5ba76ea4c9ee6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_two_args_swapping_type_con.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_two_args_swapping_type_con.move +--- +error[E04019]: cyclic type instantiation + ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/recursive_two_args_swapping_type_con.move:8:9 + │ +8 │ f, T1>(S { x }, a) + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type parameter 'f::T1' was instantiated with the type '0x8675309::M::S', which contains the type parameter 'f::T2'. These mutually recursive calls causes the instantiation to recurse infinitely + │ Invalid call to '0x8675309::M::f' + │ 'f<_, f::T1>' calls 'f<0x8675309::M::S, _>' + │ 'f' calls 'f<_, f::T1>' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/two_loops.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/two_loops.exp deleted file mode 100644 index 423865ee2f6aa..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/two_loops.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E04019]: cyclic type instantiation - ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/two_loops.move:8:9 - │ -8 │ f>() - │ ^^^^^^^^^ - │ │ │ - │ │ The type parameter 'f::T' was instantiated with the type '0x8675309::M::S', which contains the type parameter 'f::T'. This recursive call causes the instantiation to recurse infinitely - │ Invalid call to '0x8675309::M::f' - -error[E04019]: cyclic type instantiation - ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/two_loops.move:12:9 - │ -12 │ g>() - │ ^^^^^^^^^ - │ │ │ - │ │ The type parameter 'g::T' was instantiated with the type '0x8675309::M::S', which contains the type parameter 'g::T'. This recursive call causes the instantiation to recurse infinitely - │ Invalid call to '0x8675309::M::g' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/two_loops.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/two_loops.snap new file mode 100644 index 0000000000000..5f88586be8fe1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/two_loops.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/generics/instantiation_loops/two_loops.move +--- +error[E04019]: cyclic type instantiation + ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/two_loops.move:8:9 + │ +8 │ f>() + │ ^^^^^^^^^ + │ │ │ + │ │ The type parameter 'f::T' was instantiated with the type '0x8675309::M::S', which contains the type parameter 'f::T'. This recursive call causes the instantiation to recurse infinitely + │ Invalid call to '0x8675309::M::f' + +error[E04019]: cyclic type instantiation + ┌─ tests/move_check/translated_ir_tests/move/generics/instantiation_loops/two_loops.move:12:9 + │ +12 │ g>() + │ ^^^^^^^^^ + │ │ │ + │ │ The type parameter 'g::T' was instantiated with the type '0x8675309::M::S', which contains the type parameter 'g::T'. This recursive call causes the instantiation to recurse infinitely + │ Invalid call to '0x8675309::M::g' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/operators/boolean_not_non_boolean.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/operators/boolean_not_non_boolean.exp deleted file mode 100644 index e9de1a9eb718e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/operators/boolean_not_non_boolean.exp +++ /dev/null @@ -1,10 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/translated_ir_tests/move/operators/boolean_not_non_boolean.move:3:6 - │ -3 │ !0; - │ ^ - │ │ - │ Invalid argument to '!' - │ Expected: 'bool' - │ Given: integer - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/operators/boolean_not_non_boolean.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/operators/boolean_not_non_boolean.snap new file mode 100644 index 0000000000000..be01b5eb57d1a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/operators/boolean_not_non_boolean.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/operators/boolean_not_non_boolean.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/translated_ir_tests/move/operators/boolean_not_non_boolean.move:3:6 + │ +3 │ !0; + │ ^ + │ │ + │ Invalid argument to '!' + │ Expected: 'bool' + │ Given: integer diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.exp deleted file mode 100644 index 6a2928ae95b00..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.exp +++ /dev/null @@ -1,72 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.move:4:10 - │ -4 │ (S { x: true } as u8); - │ ^^^^^^^^^^^^^ - │ │ - │ Invalid argument to 'as' - │ Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.move:5:10 - │ -5 │ (S { x: true } as u64); - │ ^^^^^^^^^^^^^ - │ │ - │ Invalid argument to 'as' - │ Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.move:6:10 - │ -6 │ (S { x: true } as u128); - │ ^^^^^^^^^^^^^ - │ │ - │ Invalid argument to 'as' - │ Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.move:7:10 - │ -7 │ (true as u8); - │ ^^^^ - │ │ - │ Invalid argument to 'as' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.move:8:10 - │ -8 │ (true as u64); - │ ^^^^ - │ │ - │ Invalid argument to 'as' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.move:9:10 - │ -9 │ (true as u128); - │ ^^^^ - │ │ - │ Invalid argument to 'as' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.move:10:10 - │ -10 │ (@0x0 as u64); - │ ^^^^ - │ │ - │ Invalid argument to 'as' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.move:11:10 - │ -11 │ (@0x0 as u128); - │ ^^^^ - │ │ - │ Invalid argument to 'as' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.snap new file mode 100644 index 0000000000000..dd8ccc3526567 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.snap @@ -0,0 +1,79 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.move:4:10 + │ +4 │ (S { x: true } as u8); + │ ^^^^^^^^^^^^^ + │ │ + │ Invalid argument to 'as' + │ Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.move:5:10 + │ +5 │ (S { x: true } as u64); + │ ^^^^^^^^^^^^^ + │ │ + │ Invalid argument to 'as' + │ Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.move:6:10 + │ +6 │ (S { x: true } as u128); + │ ^^^^^^^^^^^^^ + │ │ + │ Invalid argument to 'as' + │ Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.move:7:10 + │ +7 │ (true as u8); + │ ^^^^ + │ │ + │ Invalid argument to 'as' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.move:8:10 + │ +8 │ (true as u64); + │ ^^^^ + │ │ + │ Invalid argument to 'as' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.move:9:10 + │ +9 │ (true as u128); + │ ^^^^ + │ │ + │ Invalid argument to 'as' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.move:10:10 + │ +10 │ (@0x0 as u64); + │ ^^^^ + │ │ + │ Invalid argument to 'as' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/translated_ir_tests/move/operators/casting_operators_types_mismatch.move:11:10 + │ +11 │ (@0x0 as u128); + │ ^^^^ + │ │ + │ Invalid argument to 'as' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/copy_loc.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/copy_loc.exp deleted file mode 100644 index 75bc8b15b45b8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/copy_loc.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/translated_ir_tests/move/signer/copy_loc.move:3:9 - │ -2 │ fun t(s: signer): signer { - │ ------ The type 'signer' does not have the ability 'copy' -3 │ copy s - │ ^^^^^^ Invalid 'copy' of owned value without the 'copy' ability - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/copy_loc.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/copy_loc.snap new file mode 100644 index 0000000000000..3403faba3b230 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/copy_loc.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/copy_loc.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/translated_ir_tests/move/signer/copy_loc.move:3:9 + │ +2 │ fun t(s: signer): signer { + │ ------ The type 'signer' does not have the ability 'copy' +3 │ copy s + │ ^^^^^^ Invalid 'copy' of owned value without the 'copy' ability diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/copy_loc_transitive.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/copy_loc_transitive.exp deleted file mode 100644 index 161166d92eabe..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/copy_loc_transitive.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/translated_ir_tests/move/signer/copy_loc_transitive.move:5:9 - │ -4 │ let x = S { s }; - │ --------------- - │ │ │ - │ │ The type '0x8675309::M::S' can have the ability 'copy' but the type argument 'signer' does not have the required ability 'copy' - │ The type '0x8675309::M::S' does not have the ability 'copy' -5 │ copy x - │ ^^^^^^ Invalid 'copy' of owned value without the 'copy' ability - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/copy_loc_transitive.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/copy_loc_transitive.snap new file mode 100644 index 0000000000000..6188fbd97a03b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/copy_loc_transitive.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/copy_loc_transitive.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/translated_ir_tests/move/signer/copy_loc_transitive.move:5:9 + │ +4 │ let x = S { s }; + │ --------------- + │ │ │ + │ │ The type '0x8675309::M::S' can have the ability 'copy' but the type argument 'signer' does not have the required ability 'copy' + │ The type '0x8675309::M::S' does not have the ability 'copy' +5 │ copy x + │ ^^^^^^ Invalid 'copy' of owned value without the 'copy' ability diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/keyword.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/keyword.snap new file mode 100644 index 0000000000000..8b3978720ff70 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/keyword.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/keyword.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/move_to_sender.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/move_to_sender.snap new file mode 100644 index 0000000000000..9da1fcdbe81fa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/move_to_sender.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/move_to_sender.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/read_ref.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/read_ref.exp deleted file mode 100644 index 7b1aa51b70b4e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/read_ref.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/translated_ir_tests/move/signer/read_ref.move:3:9 - │ -2 │ fun t(s: &signer): signer { - │ ------ The type 'signer' does not have the ability 'copy' -3 │ *s - │ ^^ Invalid dereference. Dereference requires the 'copy' ability - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/read_ref.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/read_ref.snap new file mode 100644 index 0000000000000..62c3cc4e4e106 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/read_ref.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/read_ref.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/translated_ir_tests/move/signer/read_ref.move:3:9 + │ +2 │ fun t(s: &signer): signer { + │ ------ The type 'signer' does not have the ability 'copy' +3 │ *s + │ ^^ Invalid dereference. Dereference requires the 'copy' ability diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/read_ref_transitive.exp b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/read_ref_transitive.exp deleted file mode 100644 index 5f08417e72592..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/read_ref_transitive.exp +++ /dev/null @@ -1,19 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/translated_ir_tests/move/signer/read_ref_transitive.move:5:9 - │ -4 │ let x = S { s }; - │ --------------- - │ │ │ - │ │ The type '0x8675309::M::S' can have the ability 'copy' but the type argument 'signer' does not have the required ability 'copy' - │ The type '0x8675309::M::S' does not have the ability 'copy' -5 │ *&x - │ ^^^ Invalid dereference. Dereference requires the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/translated_ir_tests/move/signer/read_ref_transitive.move:15:9 - │ -14 │ let x = S { s }; - │ ------ The type 'signer' does not have the ability 'copy' -15 │ x.s - │ ^^^ Invalid implicit copy of field 's' without the 'copy' ability - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/read_ref_transitive.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/read_ref_transitive.snap new file mode 100644 index 0000000000000..28f5e54ce384d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/read_ref_transitive.snap @@ -0,0 +1,26 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/read_ref_transitive.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/translated_ir_tests/move/signer/read_ref_transitive.move:5:9 + │ +4 │ let x = S { s }; + │ --------------- + │ │ │ + │ │ The type '0x8675309::M::S' can have the ability 'copy' but the type argument 'signer' does not have the required ability 'copy' + │ The type '0x8675309::M::S' does not have the ability 'copy' +5 │ *&x + │ ^^^ Invalid dereference. Dereference requires the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/translated_ir_tests/move/signer/read_ref_transitive.move:15:9 + │ +14 │ let x = S { s }; + │ ------ The type 'signer' does not have the ability 'copy' +15 │ x.s + │ ^^^ Invalid implicit copy of field 's' without the 'copy' ability diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/st_loc.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/st_loc.snap new file mode 100644 index 0000000000000..d3ba4f0189957 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/st_loc.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/st_loc.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/st_loc_partial.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/st_loc_partial.snap new file mode 100644 index 0000000000000..58e32b1383ab8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/st_loc_partial.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/st_loc_partial.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/transitive.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/transitive.snap new file mode 100644 index 0000000000000..d3f5e47145d48 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/transitive.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/transitive.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/unused.snap new file mode 100644 index 0000000000000..945d74b090a7e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/unused.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/unused.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/unused_partial.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/unused_partial.snap new file mode 100644 index 0000000000000..a1c24d6e66b5a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/unused_partial.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/unused_partial.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/write_ref.snap b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/write_ref.snap new file mode 100644 index 0000000000000..fba546bc8b09c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/write_ref.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/translated_ir_tests/move/signer/write_ref.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_generic_in_field.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_generic_in_field.exp deleted file mode 100644 index 28ae29e45e5fd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_generic_in_field.exp +++ /dev/null @@ -1,26 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_generic_in_field.move:3:22 - │ -2 │ struct S { v: T } - │ ---- 'copy' constraint declared here -3 │ struct B { v: S } - │ - ^^^^ - │ │ │ │ - │ │ │ The type 'T' does not have the ability 'copy' - │ │ 'copy' constraint not satisifed - │ To satisfy the constraint, the 'copy' ability would need to be added here - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_generic_in_field.move:10:22 - │ - 7 │ struct A has copy { a: T } - │ ---- 'copy' constraint declared here - 8 │ - 9 │ struct B has copy { - │ - To satisfy the constraint, the 'copy' ability would need to be added here -10 │ data: vector> - │ ^^^^ - │ │ │ - │ │ The type 'T' does not have the ability 'copy' - │ 'copy' constraint not satisifed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_generic_in_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_generic_in_field.snap new file mode 100644 index 0000000000000..93a44faa2ceb1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_generic_in_field.snap @@ -0,0 +1,33 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/ability_constraint_generic_in_field.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_generic_in_field.move:3:22 + │ +2 │ struct S { v: T } + │ ---- 'copy' constraint declared here +3 │ struct B { v: S } + │ - ^^^^ + │ │ │ │ + │ │ │ The type 'T' does not have the ability 'copy' + │ │ 'copy' constraint not satisifed + │ To satisfy the constraint, the 'copy' ability would need to be added here + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_generic_in_field.move:10:22 + │ + 7 │ struct A has copy { a: T } + │ ---- 'copy' constraint declared here + 8 │ + 9 │ struct B has copy { + │ - To satisfy the constraint, the 'copy' ability would need to be added here +10 │ data: vector> + │ ^^^^ + │ │ │ + │ │ The type 'T' does not have the ability 'copy' + │ 'copy' constraint not satisifed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_prims_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_prims_invalid.exp deleted file mode 100644 index 152e2bda505e0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_prims_invalid.exp +++ /dev/null @@ -1,479 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:20:9 - │ - 9 │ fun c() {} - │ ---- 'copy' constraint declared here - · -20 │ c(); - │ ^^^^^^^^^^^ - │ │ │ - │ │ The type 'signer' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:21:9 - │ - 9 │ fun c() {} - │ ---- 'copy' constraint declared here - · -21 │ c>(); - │ ^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type 'vector' can have the ability 'copy' but the type argument 'signer' does not have the required ability 'copy' - │ │ The type 'vector' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:22:9 - │ - 9 │ fun c() {} - │ ---- 'copy' constraint declared here - · -22 │ c>(); - │ ^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type 'vector<0x42::M::NoC>' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' - │ │ The type 'vector<0x42::M::NoC>' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:23:9 - │ -10 │ fun k() {} - │ --- 'key' constraint declared here - · -23 │ k(); - │ ^^^^^^^^ - │ │ │ - │ │ The type 'u64' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:24:9 - │ -10 │ fun k() {} - │ --- 'key' constraint declared here - · -24 │ k(); - │ ^^^^^^^^^^^ - │ │ │ - │ │ The type 'signer' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:25:9 - │ -10 │ fun k() {} - │ --- 'key' constraint declared here - · -25 │ k>(); - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type 'vector<0x42::M::NoC>' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:26:9 - │ -10 │ fun k() {} - │ --- 'key' constraint declared here - · -26 │ k>(); - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type 'vector<0x42::M::NoK>' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:27:9 - │ -11 │ fun cds() {} - │ ---- 'copy' constraint declared here - · -27 │ cds(); - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ The type 'signer' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:27:9 - │ -11 │ fun cds() {} - │ ----- 'store' constraint declared here - · -27 │ cds(); - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ The type 'signer' does not have the ability 'store' - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:28:9 - │ -11 │ fun cds() {} - │ ---- 'copy' constraint declared here - · -28 │ cds>(); - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type 'vector<0x42::M::NoC>' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' - │ │ The type 'vector<0x42::M::NoC>' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:29:9 - │ -11 │ fun cds() {} - │ ---- 'copy' constraint declared here - · -29 │ cds>>(); - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type 'vector<0x42::M::Cup>' can have the ability 'copy' but the type argument '0x42::M::Cup' does not have the required ability 'copy' - │ │ The type 'vector<0x42::M::Cup>' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:29:9 - │ -11 │ fun cds() {} - │ ---- 'drop' constraint declared here - · -29 │ cds>>(); - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type 'vector<0x42::M::Cup>' can have the ability 'drop' but the type argument '0x42::M::Cup' does not have the required ability 'drop' - │ │ The type 'vector<0x42::M::Cup>' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:29:9 - │ -11 │ fun cds() {} - │ ----- 'store' constraint declared here - · -29 │ cds>>(); - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type 'vector<0x42::M::Cup>' can have the ability 'store' but the type argument '0x42::M::Cup' does not have the required ability 'store' - │ │ The type 'vector<0x42::M::Cup>' does not have the ability 'store' - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:30:13 - │ -13 │ struct Sc {} - │ ---- 'copy' constraint declared here - · -30 │ let Sc {} = Sc {}; - │ ^^^^^ ------ The type 'signer' does not have the ability 'copy' - │ │ - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:30:21 - │ -13 │ struct Sc {} - │ ---- 'copy' constraint declared here - · -30 │ let Sc {} = Sc {}; - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ The type 'signer' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:31:13 - │ -13 │ struct Sc {} - │ ---- 'copy' constraint declared here - · -31 │ let Sc {} = Sc> {}; - │ ^^^^^ -------------- - │ │ │ │ - │ │ │ The type 'vector' can have the ability 'copy' but the type argument 'signer' does not have the required ability 'copy' - │ │ The type 'vector' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:31:21 - │ -13 │ struct Sc {} - │ ---- 'copy' constraint declared here - · -31 │ let Sc {} = Sc> {}; - │ ^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type 'vector' can have the ability 'copy' but the type argument 'signer' does not have the required ability 'copy' - │ │ The type 'vector' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:32:13 - │ -13 │ struct Sc {} - │ ---- 'copy' constraint declared here - · -32 │ let Sc {} = Sc> {}; - │ ^^^^^ ----------- - │ │ │ │ - │ │ │ The type 'vector<0x42::M::NoC>' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' - │ │ The type 'vector<0x42::M::NoC>' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:32:21 - │ -13 │ struct Sc {} - │ ---- 'copy' constraint declared here - · -32 │ let Sc {} = Sc> {}; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type 'vector<0x42::M::NoC>' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' - │ │ The type 'vector<0x42::M::NoC>' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:33:13 - │ -14 │ struct Sk {} - │ --- 'key' constraint declared here - · -33 │ let Sk {} = Sk {}; - │ ^^^^^ --- The type 'u64' does not have the ability 'key' - │ │ - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:33:21 - │ -14 │ struct Sk {} - │ --- 'key' constraint declared here - · -33 │ let Sk {} = Sk {}; - │ ^^^^^^^^^^ - │ │ │ - │ │ The type 'u64' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:34:13 - │ -14 │ struct Sk {} - │ --- 'key' constraint declared here - · -34 │ let Sk {} = Sk {}; - │ ^^^^^ ------ The type 'signer' does not have the ability 'key' - │ │ - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:34:21 - │ -14 │ struct Sk {} - │ --- 'key' constraint declared here - · -34 │ let Sk {} = Sk {}; - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ The type 'signer' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:35:13 - │ -14 │ struct Sk {} - │ --- 'key' constraint declared here - · -35 │ let Sk {} = Sk> {}; - │ ^^^^^ ----------- The type 'vector<0x42::M::NoC>' does not have the ability 'key' - │ │ - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:35:21 - │ -14 │ struct Sk {} - │ --- 'key' constraint declared here - · -35 │ let Sk {} = Sk> {}; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type 'vector<0x42::M::NoC>' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:36:13 - │ -14 │ struct Sk {} - │ --- 'key' constraint declared here - · -36 │ let Sk {} = Sk> {}; - │ ^^^^^ ----------- The type 'vector<0x42::M::NoK>' does not have the ability 'key' - │ │ - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:36:21 - │ -14 │ struct Sk {} - │ --- 'key' constraint declared here - · -36 │ let Sk {} = Sk> {}; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type 'vector<0x42::M::NoK>' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:37:13 - │ -15 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -37 │ let Scds {} = Scds {}; - │ ^^^^^^^ ------ The type 'signer' does not have the ability 'copy' - │ │ - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:37:13 - │ -15 │ struct Scds {} - │ ----- 'store' constraint declared here - · -37 │ let Scds {} = Scds {}; - │ ^^^^^^^ ------ The type 'signer' does not have the ability 'store' - │ │ - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:37:23 - │ -15 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -37 │ let Scds {} = Scds {}; - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type 'signer' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:37:23 - │ -15 │ struct Scds {} - │ ----- 'store' constraint declared here - · -37 │ let Scds {} = Scds {}; - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type 'signer' does not have the ability 'store' - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:38:13 - │ -15 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -38 │ let Scds {} = Scds> {}; - │ ^^^^^^^ ----------- - │ │ │ │ - │ │ │ The type 'vector<0x42::M::NoC>' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' - │ │ The type 'vector<0x42::M::NoC>' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:38:23 - │ -15 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -38 │ let Scds {} = Scds> {}; - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type 'vector<0x42::M::NoC>' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' - │ │ The type 'vector<0x42::M::NoC>' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:39:13 - │ -15 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -39 │ let Scds {} = Scds>> {}; - │ ^^^^^^^ --------------- - │ │ │ │ - │ │ │ The type 'vector<0x42::M::Cup>' can have the ability 'copy' but the type argument '0x42::M::Cup' does not have the required ability 'copy' - │ │ The type 'vector<0x42::M::Cup>' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:39:13 - │ -15 │ struct Scds {} - │ ---- 'drop' constraint declared here - · -39 │ let Scds {} = Scds>> {}; - │ ^^^^^^^ --------------- - │ │ │ │ - │ │ │ The type 'vector<0x42::M::Cup>' can have the ability 'drop' but the type argument '0x42::M::Cup' does not have the required ability 'drop' - │ │ The type 'vector<0x42::M::Cup>' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:39:13 - │ -15 │ struct Scds {} - │ ----- 'store' constraint declared here - · -39 │ let Scds {} = Scds>> {}; - │ ^^^^^^^ --------------- - │ │ │ │ - │ │ │ The type 'vector<0x42::M::Cup>' can have the ability 'store' but the type argument '0x42::M::Cup' does not have the required ability 'store' - │ │ The type 'vector<0x42::M::Cup>' does not have the ability 'store' - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:39:23 - │ -15 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -39 │ let Scds {} = Scds>> {}; - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type 'vector<0x42::M::Cup>' can have the ability 'copy' but the type argument '0x42::M::Cup' does not have the required ability 'copy' - │ │ The type 'vector<0x42::M::Cup>' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:39:23 - │ -15 │ struct Scds {} - │ ---- 'drop' constraint declared here - · -39 │ let Scds {} = Scds>> {}; - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type 'vector<0x42::M::Cup>' can have the ability 'drop' but the type argument '0x42::M::Cup' does not have the required ability 'drop' - │ │ The type 'vector<0x42::M::Cup>' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:39:23 - │ -15 │ struct Scds {} - │ ----- 'store' constraint declared here - · -39 │ let Scds {} = Scds>> {}; - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type 'vector<0x42::M::Cup>' can have the ability 'store' but the type argument '0x42::M::Cup' does not have the required ability 'store' - │ │ The type 'vector<0x42::M::Cup>' does not have the ability 'store' - │ 'store' constraint not satisifed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_prims_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_prims_invalid.snap new file mode 100644 index 0000000000000..95d82c83c39bb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_prims_invalid.snap @@ -0,0 +1,486 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/ability_constraint_prims_invalid.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:20:9 + │ + 9 │ fun c() {} + │ ---- 'copy' constraint declared here + · +20 │ c(); + │ ^^^^^^^^^^^ + │ │ │ + │ │ The type 'signer' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:21:9 + │ + 9 │ fun c() {} + │ ---- 'copy' constraint declared here + · +21 │ c>(); + │ ^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type 'vector' can have the ability 'copy' but the type argument 'signer' does not have the required ability 'copy' + │ │ The type 'vector' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:22:9 + │ + 9 │ fun c() {} + │ ---- 'copy' constraint declared here + · +22 │ c>(); + │ ^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type 'vector<0x42::M::NoC>' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' + │ │ The type 'vector<0x42::M::NoC>' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:23:9 + │ +10 │ fun k() {} + │ --- 'key' constraint declared here + · +23 │ k(); + │ ^^^^^^^^ + │ │ │ + │ │ The type 'u64' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:24:9 + │ +10 │ fun k() {} + │ --- 'key' constraint declared here + · +24 │ k(); + │ ^^^^^^^^^^^ + │ │ │ + │ │ The type 'signer' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:25:9 + │ +10 │ fun k() {} + │ --- 'key' constraint declared here + · +25 │ k>(); + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type 'vector<0x42::M::NoC>' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:26:9 + │ +10 │ fun k() {} + │ --- 'key' constraint declared here + · +26 │ k>(); + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type 'vector<0x42::M::NoK>' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:27:9 + │ +11 │ fun cds() {} + │ ---- 'copy' constraint declared here + · +27 │ cds(); + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ The type 'signer' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:27:9 + │ +11 │ fun cds() {} + │ ----- 'store' constraint declared here + · +27 │ cds(); + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ The type 'signer' does not have the ability 'store' + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:28:9 + │ +11 │ fun cds() {} + │ ---- 'copy' constraint declared here + · +28 │ cds>(); + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type 'vector<0x42::M::NoC>' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' + │ │ The type 'vector<0x42::M::NoC>' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:29:9 + │ +11 │ fun cds() {} + │ ---- 'copy' constraint declared here + · +29 │ cds>>(); + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type 'vector<0x42::M::Cup>' can have the ability 'copy' but the type argument '0x42::M::Cup' does not have the required ability 'copy' + │ │ The type 'vector<0x42::M::Cup>' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:29:9 + │ +11 │ fun cds() {} + │ ---- 'drop' constraint declared here + · +29 │ cds>>(); + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type 'vector<0x42::M::Cup>' can have the ability 'drop' but the type argument '0x42::M::Cup' does not have the required ability 'drop' + │ │ The type 'vector<0x42::M::Cup>' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:29:9 + │ +11 │ fun cds() {} + │ ----- 'store' constraint declared here + · +29 │ cds>>(); + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type 'vector<0x42::M::Cup>' can have the ability 'store' but the type argument '0x42::M::Cup' does not have the required ability 'store' + │ │ The type 'vector<0x42::M::Cup>' does not have the ability 'store' + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:30:13 + │ +13 │ struct Sc {} + │ ---- 'copy' constraint declared here + · +30 │ let Sc {} = Sc {}; + │ ^^^^^ ------ The type 'signer' does not have the ability 'copy' + │ │ + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:30:21 + │ +13 │ struct Sc {} + │ ---- 'copy' constraint declared here + · +30 │ let Sc {} = Sc {}; + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ The type 'signer' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:31:13 + │ +13 │ struct Sc {} + │ ---- 'copy' constraint declared here + · +31 │ let Sc {} = Sc> {}; + │ ^^^^^ -------------- + │ │ │ │ + │ │ │ The type 'vector' can have the ability 'copy' but the type argument 'signer' does not have the required ability 'copy' + │ │ The type 'vector' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:31:21 + │ +13 │ struct Sc {} + │ ---- 'copy' constraint declared here + · +31 │ let Sc {} = Sc> {}; + │ ^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type 'vector' can have the ability 'copy' but the type argument 'signer' does not have the required ability 'copy' + │ │ The type 'vector' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:32:13 + │ +13 │ struct Sc {} + │ ---- 'copy' constraint declared here + · +32 │ let Sc {} = Sc> {}; + │ ^^^^^ ----------- + │ │ │ │ + │ │ │ The type 'vector<0x42::M::NoC>' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' + │ │ The type 'vector<0x42::M::NoC>' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:32:21 + │ +13 │ struct Sc {} + │ ---- 'copy' constraint declared here + · +32 │ let Sc {} = Sc> {}; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type 'vector<0x42::M::NoC>' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' + │ │ The type 'vector<0x42::M::NoC>' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:33:13 + │ +14 │ struct Sk {} + │ --- 'key' constraint declared here + · +33 │ let Sk {} = Sk {}; + │ ^^^^^ --- The type 'u64' does not have the ability 'key' + │ │ + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:33:21 + │ +14 │ struct Sk {} + │ --- 'key' constraint declared here + · +33 │ let Sk {} = Sk {}; + │ ^^^^^^^^^^ + │ │ │ + │ │ The type 'u64' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:34:13 + │ +14 │ struct Sk {} + │ --- 'key' constraint declared here + · +34 │ let Sk {} = Sk {}; + │ ^^^^^ ------ The type 'signer' does not have the ability 'key' + │ │ + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:34:21 + │ +14 │ struct Sk {} + │ --- 'key' constraint declared here + · +34 │ let Sk {} = Sk {}; + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ The type 'signer' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:35:13 + │ +14 │ struct Sk {} + │ --- 'key' constraint declared here + · +35 │ let Sk {} = Sk> {}; + │ ^^^^^ ----------- The type 'vector<0x42::M::NoC>' does not have the ability 'key' + │ │ + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:35:21 + │ +14 │ struct Sk {} + │ --- 'key' constraint declared here + · +35 │ let Sk {} = Sk> {}; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type 'vector<0x42::M::NoC>' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:36:13 + │ +14 │ struct Sk {} + │ --- 'key' constraint declared here + · +36 │ let Sk {} = Sk> {}; + │ ^^^^^ ----------- The type 'vector<0x42::M::NoK>' does not have the ability 'key' + │ │ + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:36:21 + │ +14 │ struct Sk {} + │ --- 'key' constraint declared here + · +36 │ let Sk {} = Sk> {}; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type 'vector<0x42::M::NoK>' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:37:13 + │ +15 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +37 │ let Scds {} = Scds {}; + │ ^^^^^^^ ------ The type 'signer' does not have the ability 'copy' + │ │ + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:37:13 + │ +15 │ struct Scds {} + │ ----- 'store' constraint declared here + · +37 │ let Scds {} = Scds {}; + │ ^^^^^^^ ------ The type 'signer' does not have the ability 'store' + │ │ + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:37:23 + │ +15 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +37 │ let Scds {} = Scds {}; + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type 'signer' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:37:23 + │ +15 │ struct Scds {} + │ ----- 'store' constraint declared here + · +37 │ let Scds {} = Scds {}; + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type 'signer' does not have the ability 'store' + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:38:13 + │ +15 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +38 │ let Scds {} = Scds> {}; + │ ^^^^^^^ ----------- + │ │ │ │ + │ │ │ The type 'vector<0x42::M::NoC>' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' + │ │ The type 'vector<0x42::M::NoC>' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:38:23 + │ +15 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +38 │ let Scds {} = Scds> {}; + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type 'vector<0x42::M::NoC>' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' + │ │ The type 'vector<0x42::M::NoC>' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:39:13 + │ +15 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +39 │ let Scds {} = Scds>> {}; + │ ^^^^^^^ --------------- + │ │ │ │ + │ │ │ The type 'vector<0x42::M::Cup>' can have the ability 'copy' but the type argument '0x42::M::Cup' does not have the required ability 'copy' + │ │ The type 'vector<0x42::M::Cup>' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:39:13 + │ +15 │ struct Scds {} + │ ---- 'drop' constraint declared here + · +39 │ let Scds {} = Scds>> {}; + │ ^^^^^^^ --------------- + │ │ │ │ + │ │ │ The type 'vector<0x42::M::Cup>' can have the ability 'drop' but the type argument '0x42::M::Cup' does not have the required ability 'drop' + │ │ The type 'vector<0x42::M::Cup>' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:39:13 + │ +15 │ struct Scds {} + │ ----- 'store' constraint declared here + · +39 │ let Scds {} = Scds>> {}; + │ ^^^^^^^ --------------- + │ │ │ │ + │ │ │ The type 'vector<0x42::M::Cup>' can have the ability 'store' but the type argument '0x42::M::Cup' does not have the required ability 'store' + │ │ The type 'vector<0x42::M::Cup>' does not have the ability 'store' + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:39:23 + │ +15 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +39 │ let Scds {} = Scds>> {}; + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type 'vector<0x42::M::Cup>' can have the ability 'copy' but the type argument '0x42::M::Cup' does not have the required ability 'copy' + │ │ The type 'vector<0x42::M::Cup>' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:39:23 + │ +15 │ struct Scds {} + │ ---- 'drop' constraint declared here + · +39 │ let Scds {} = Scds>> {}; + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type 'vector<0x42::M::Cup>' can have the ability 'drop' but the type argument '0x42::M::Cup' does not have the required ability 'drop' + │ │ The type 'vector<0x42::M::Cup>' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_prims_invalid.move:39:23 + │ +15 │ struct Scds {} + │ ----- 'store' constraint declared here + · +39 │ let Scds {} = Scds>> {}; + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type 'vector<0x42::M::Cup>' can have the ability 'store' but the type argument '0x42::M::Cup' does not have the required ability 'store' + │ │ The type 'vector<0x42::M::Cup>' does not have the ability 'store' + │ 'store' constraint not satisifed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_structs_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_structs_invalid.exp deleted file mode 100644 index 7d71e664c68b4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_structs_invalid.exp +++ /dev/null @@ -1,601 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:19:9 - │ - 3 │ struct NoC has drop, store, key {} - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · - 9 │ fun c() {} - │ ---- 'copy' constraint declared here - · -19 │ c(); - │ ^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::NoC' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:20:9 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · - 9 │ fun c() {} - │ ---- 'copy' constraint declared here - · -20 │ c>(); - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:21:9 - │ - 9 │ fun c() {} - │ ---- 'copy' constraint declared here - · -21 │ c>(); - │ ^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::Box<0x42::M::NoC>' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' - │ │ The type '0x42::M::Box<0x42::M::NoC>' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:22:9 - │ - 4 │ struct NoK has copy, drop, store {} - │ --- To satisfy the constraint, the 'key' ability would need to be added here - · -10 │ fun k() {} - │ --- 'key' constraint declared here - · -22 │ k(); - │ ^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::NoK' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:23:9 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'key' ability would need to be added here - · -10 │ fun k() {} - │ --- 'key' constraint declared here - · -23 │ k>(); - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:24:9 - │ -10 │ fun k() {} - │ --- 'key' constraint declared here - · -24 │ k>>(); - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::Box<0x42::M::Cup>' can have the ability 'key' but the type argument '0x42::M::Cup' does not have the required ability 'store' - │ │ The type '0x42::M::Box<0x42::M::Cup>' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:25:9 - │ - 3 │ struct NoC has drop, store, key {} - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -11 │ fun cds() {} - │ ---- 'copy' constraint declared here - · -25 │ cds(); - │ ^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::NoC' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:26:9 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -11 │ fun cds() {} - │ ---- 'copy' constraint declared here - · -26 │ cds>(); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:26:9 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - · -11 │ fun cds() {} - │ ---- 'drop' constraint declared here - · -26 │ cds>(); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:26:9 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'store' ability would need to be added here - · -11 │ fun cds() {} - │ ----- 'store' constraint declared here - · -26 │ cds>(); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'store' - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:27:9 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -11 │ fun cds() {} - │ ---- 'copy' constraint declared here - · -27 │ cds>(); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup<0x42::M::NoC>' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:27:9 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - · -11 │ fun cds() {} - │ ---- 'drop' constraint declared here - · -27 │ cds>(); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup<0x42::M::NoC>' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:27:9 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'store' ability would need to be added here - · -11 │ fun cds() {} - │ ----- 'store' constraint declared here - · -27 │ cds>(); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup<0x42::M::NoC>' does not have the ability 'store' - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:28:9 - │ -11 │ fun cds() {} - │ ---- 'copy' constraint declared here - · -28 │ cds>(); - │ ^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::Pair' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' - │ │ The type '0x42::M::Pair' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:29:13 - │ - 3 │ struct NoC has drop, store, key {} - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -13 │ struct Sc {} - │ ---- 'copy' constraint declared here - · -29 │ let Sc {} = Sc {}; - │ ^^^^^ --- The type '0x42::M::NoC' does not have the ability 'copy' - │ │ - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:29:21 - │ - 3 │ struct NoC has drop, store, key {} - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -13 │ struct Sc {} - │ ---- 'copy' constraint declared here - · -29 │ let Sc {} = Sc {}; - │ ^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::NoC' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:30:13 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -13 │ struct Sc {} - │ ---- 'copy' constraint declared here - · -30 │ let Sc {} = Sc> {}; - │ ^^^^^ -------- The type '0x42::M::Cup' does not have the ability 'copy' - │ │ - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:30:21 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -13 │ struct Sc {} - │ ---- 'copy' constraint declared here - · -30 │ let Sc {} = Sc> {}; - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:31:13 - │ -13 │ struct Sc {} - │ ---- 'copy' constraint declared here - · -31 │ let Sc {} = Sc> {}; - │ ^^^^^ -------- - │ │ │ │ - │ │ │ The type '0x42::M::Box<0x42::M::NoC>' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' - │ │ The type '0x42::M::Box<0x42::M::NoC>' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:31:21 - │ -13 │ struct Sc {} - │ ---- 'copy' constraint declared here - · -31 │ let Sc {} = Sc> {}; - │ ^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::Box<0x42::M::NoC>' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' - │ │ The type '0x42::M::Box<0x42::M::NoC>' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:32:13 - │ - 4 │ struct NoK has copy, drop, store {} - │ --- To satisfy the constraint, the 'key' ability would need to be added here - · -14 │ struct Sk {} - │ --- 'key' constraint declared here - · -32 │ let Sk {} = Sk {}; - │ ^^^^^ --- The type '0x42::M::NoK' does not have the ability 'key' - │ │ - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:32:21 - │ - 4 │ struct NoK has copy, drop, store {} - │ --- To satisfy the constraint, the 'key' ability would need to be added here - · -14 │ struct Sk {} - │ --- 'key' constraint declared here - · -32 │ let Sk {} = Sk {}; - │ ^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::NoK' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:33:13 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'key' ability would need to be added here - · -14 │ struct Sk {} - │ --- 'key' constraint declared here - · -33 │ let Sk {} = Sk> {}; - │ ^^^^^ -------- The type '0x42::M::Cup' does not have the ability 'key' - │ │ - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:33:21 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'key' ability would need to be added here - · -14 │ struct Sk {} - │ --- 'key' constraint declared here - · -33 │ let Sk {} = Sk> {}; - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:34:13 - │ -14 │ struct Sk {} - │ --- 'key' constraint declared here - · -34 │ let Sk {} = Sk>> {}; - │ ^^^^^ ------------- - │ │ │ │ - │ │ │ The type '0x42::M::Box<0x42::M::Cup>' can have the ability 'key' but the type argument '0x42::M::Cup' does not have the required ability 'store' - │ │ The type '0x42::M::Box<0x42::M::Cup>' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:34:21 - │ -14 │ struct Sk {} - │ --- 'key' constraint declared here - · -34 │ let Sk {} = Sk>> {}; - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::Box<0x42::M::Cup>' can have the ability 'key' but the type argument '0x42::M::Cup' does not have the required ability 'store' - │ │ The type '0x42::M::Box<0x42::M::Cup>' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:35:13 - │ - 3 │ struct NoC has drop, store, key {} - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -15 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -35 │ let Scds {} = Scds {}; - │ ^^^^^^^ --- The type '0x42::M::NoC' does not have the ability 'copy' - │ │ - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:35:23 - │ - 3 │ struct NoC has drop, store, key {} - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -15 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -35 │ let Scds {} = Scds {}; - │ ^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::NoC' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:36:13 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -15 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -36 │ let Scds {} = Scds> {}; - │ ^^^^^^^ -------- The type '0x42::M::Cup' does not have the ability 'copy' - │ │ - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:36:13 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - · -15 │ struct Scds {} - │ ---- 'drop' constraint declared here - · -36 │ let Scds {} = Scds> {}; - │ ^^^^^^^ -------- The type '0x42::M::Cup' does not have the ability 'drop' - │ │ - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:36:13 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'store' ability would need to be added here - · -15 │ struct Scds {} - │ ----- 'store' constraint declared here - · -36 │ let Scds {} = Scds> {}; - │ ^^^^^^^ -------- The type '0x42::M::Cup' does not have the ability 'store' - │ │ - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:36:23 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -15 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -36 │ let Scds {} = Scds> {}; - │ ^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:36:23 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - · -15 │ struct Scds {} - │ ---- 'drop' constraint declared here - · -36 │ let Scds {} = Scds> {}; - │ ^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:36:23 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'store' ability would need to be added here - · -15 │ struct Scds {} - │ ----- 'store' constraint declared here - · -36 │ let Scds {} = Scds> {}; - │ ^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'store' - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:37:13 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -15 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -37 │ let Scds {} = Scds> {}; - │ ^^^^^^^ -------- The type '0x42::M::Cup<0x42::M::NoC>' does not have the ability 'copy' - │ │ - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:37:13 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - · -15 │ struct Scds {} - │ ---- 'drop' constraint declared here - · -37 │ let Scds {} = Scds> {}; - │ ^^^^^^^ -------- The type '0x42::M::Cup<0x42::M::NoC>' does not have the ability 'drop' - │ │ - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:37:13 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'store' ability would need to be added here - · -15 │ struct Scds {} - │ ----- 'store' constraint declared here - · -37 │ let Scds {} = Scds> {}; - │ ^^^^^^^ -------- The type '0x42::M::Cup<0x42::M::NoC>' does not have the ability 'store' - │ │ - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:37:23 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -15 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -37 │ let Scds {} = Scds> {}; - │ ^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup<0x42::M::NoC>' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:37:23 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - · -15 │ struct Scds {} - │ ---- 'drop' constraint declared here - · -37 │ let Scds {} = Scds> {}; - │ ^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup<0x42::M::NoC>' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:37:23 - │ - 5 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'store' ability would need to be added here - · -15 │ struct Scds {} - │ ----- 'store' constraint declared here - · -37 │ let Scds {} = Scds> {}; - │ ^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup<0x42::M::NoC>' does not have the ability 'store' - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:38:13 - │ -15 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -38 │ let Scds {} = Scds> {}; - │ ^^^^^^^ -------------- - │ │ │ │ - │ │ │ The type '0x42::M::Pair' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' - │ │ The type '0x42::M::Pair' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:38:23 - │ -15 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -38 │ let Scds {} = Scds> {}; - │ ^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::Pair' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' - │ │ The type '0x42::M::Pair' does not have the ability 'copy' - │ 'copy' constraint not satisifed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_structs_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_structs_invalid.snap new file mode 100644 index 0000000000000..32f3ec4840642 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_structs_invalid.snap @@ -0,0 +1,608 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/ability_constraint_structs_invalid.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:19:9 + │ + 3 │ struct NoC has drop, store, key {} + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · + 9 │ fun c() {} + │ ---- 'copy' constraint declared here + · +19 │ c(); + │ ^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::NoC' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:20:9 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · + 9 │ fun c() {} + │ ---- 'copy' constraint declared here + · +20 │ c>(); + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:21:9 + │ + 9 │ fun c() {} + │ ---- 'copy' constraint declared here + · +21 │ c>(); + │ ^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::Box<0x42::M::NoC>' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' + │ │ The type '0x42::M::Box<0x42::M::NoC>' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:22:9 + │ + 4 │ struct NoK has copy, drop, store {} + │ --- To satisfy the constraint, the 'key' ability would need to be added here + · +10 │ fun k() {} + │ --- 'key' constraint declared here + · +22 │ k(); + │ ^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::NoK' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:23:9 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'key' ability would need to be added here + · +10 │ fun k() {} + │ --- 'key' constraint declared here + · +23 │ k>(); + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:24:9 + │ +10 │ fun k() {} + │ --- 'key' constraint declared here + · +24 │ k>>(); + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::Box<0x42::M::Cup>' can have the ability 'key' but the type argument '0x42::M::Cup' does not have the required ability 'store' + │ │ The type '0x42::M::Box<0x42::M::Cup>' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:25:9 + │ + 3 │ struct NoC has drop, store, key {} + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +11 │ fun cds() {} + │ ---- 'copy' constraint declared here + · +25 │ cds(); + │ ^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::NoC' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:26:9 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +11 │ fun cds() {} + │ ---- 'copy' constraint declared here + · +26 │ cds>(); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:26:9 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + · +11 │ fun cds() {} + │ ---- 'drop' constraint declared here + · +26 │ cds>(); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:26:9 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'store' ability would need to be added here + · +11 │ fun cds() {} + │ ----- 'store' constraint declared here + · +26 │ cds>(); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'store' + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:27:9 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +11 │ fun cds() {} + │ ---- 'copy' constraint declared here + · +27 │ cds>(); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup<0x42::M::NoC>' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:27:9 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + · +11 │ fun cds() {} + │ ---- 'drop' constraint declared here + · +27 │ cds>(); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup<0x42::M::NoC>' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:27:9 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'store' ability would need to be added here + · +11 │ fun cds() {} + │ ----- 'store' constraint declared here + · +27 │ cds>(); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup<0x42::M::NoC>' does not have the ability 'store' + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:28:9 + │ +11 │ fun cds() {} + │ ---- 'copy' constraint declared here + · +28 │ cds>(); + │ ^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::Pair' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' + │ │ The type '0x42::M::Pair' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:29:13 + │ + 3 │ struct NoC has drop, store, key {} + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +13 │ struct Sc {} + │ ---- 'copy' constraint declared here + · +29 │ let Sc {} = Sc {}; + │ ^^^^^ --- The type '0x42::M::NoC' does not have the ability 'copy' + │ │ + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:29:21 + │ + 3 │ struct NoC has drop, store, key {} + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +13 │ struct Sc {} + │ ---- 'copy' constraint declared here + · +29 │ let Sc {} = Sc {}; + │ ^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::NoC' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:30:13 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +13 │ struct Sc {} + │ ---- 'copy' constraint declared here + · +30 │ let Sc {} = Sc> {}; + │ ^^^^^ -------- The type '0x42::M::Cup' does not have the ability 'copy' + │ │ + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:30:21 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +13 │ struct Sc {} + │ ---- 'copy' constraint declared here + · +30 │ let Sc {} = Sc> {}; + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:31:13 + │ +13 │ struct Sc {} + │ ---- 'copy' constraint declared here + · +31 │ let Sc {} = Sc> {}; + │ ^^^^^ -------- + │ │ │ │ + │ │ │ The type '0x42::M::Box<0x42::M::NoC>' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' + │ │ The type '0x42::M::Box<0x42::M::NoC>' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:31:21 + │ +13 │ struct Sc {} + │ ---- 'copy' constraint declared here + · +31 │ let Sc {} = Sc> {}; + │ ^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::Box<0x42::M::NoC>' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' + │ │ The type '0x42::M::Box<0x42::M::NoC>' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:32:13 + │ + 4 │ struct NoK has copy, drop, store {} + │ --- To satisfy the constraint, the 'key' ability would need to be added here + · +14 │ struct Sk {} + │ --- 'key' constraint declared here + · +32 │ let Sk {} = Sk {}; + │ ^^^^^ --- The type '0x42::M::NoK' does not have the ability 'key' + │ │ + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:32:21 + │ + 4 │ struct NoK has copy, drop, store {} + │ --- To satisfy the constraint, the 'key' ability would need to be added here + · +14 │ struct Sk {} + │ --- 'key' constraint declared here + · +32 │ let Sk {} = Sk {}; + │ ^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::NoK' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:33:13 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'key' ability would need to be added here + · +14 │ struct Sk {} + │ --- 'key' constraint declared here + · +33 │ let Sk {} = Sk> {}; + │ ^^^^^ -------- The type '0x42::M::Cup' does not have the ability 'key' + │ │ + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:33:21 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'key' ability would need to be added here + · +14 │ struct Sk {} + │ --- 'key' constraint declared here + · +33 │ let Sk {} = Sk> {}; + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:34:13 + │ +14 │ struct Sk {} + │ --- 'key' constraint declared here + · +34 │ let Sk {} = Sk>> {}; + │ ^^^^^ ------------- + │ │ │ │ + │ │ │ The type '0x42::M::Box<0x42::M::Cup>' can have the ability 'key' but the type argument '0x42::M::Cup' does not have the required ability 'store' + │ │ The type '0x42::M::Box<0x42::M::Cup>' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:34:21 + │ +14 │ struct Sk {} + │ --- 'key' constraint declared here + · +34 │ let Sk {} = Sk>> {}; + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::Box<0x42::M::Cup>' can have the ability 'key' but the type argument '0x42::M::Cup' does not have the required ability 'store' + │ │ The type '0x42::M::Box<0x42::M::Cup>' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:35:13 + │ + 3 │ struct NoC has drop, store, key {} + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +15 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +35 │ let Scds {} = Scds {}; + │ ^^^^^^^ --- The type '0x42::M::NoC' does not have the ability 'copy' + │ │ + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:35:23 + │ + 3 │ struct NoC has drop, store, key {} + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +15 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +35 │ let Scds {} = Scds {}; + │ ^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::NoC' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:36:13 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +15 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +36 │ let Scds {} = Scds> {}; + │ ^^^^^^^ -------- The type '0x42::M::Cup' does not have the ability 'copy' + │ │ + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:36:13 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + · +15 │ struct Scds {} + │ ---- 'drop' constraint declared here + · +36 │ let Scds {} = Scds> {}; + │ ^^^^^^^ -------- The type '0x42::M::Cup' does not have the ability 'drop' + │ │ + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:36:13 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'store' ability would need to be added here + · +15 │ struct Scds {} + │ ----- 'store' constraint declared here + · +36 │ let Scds {} = Scds> {}; + │ ^^^^^^^ -------- The type '0x42::M::Cup' does not have the ability 'store' + │ │ + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:36:23 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +15 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +36 │ let Scds {} = Scds> {}; + │ ^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:36:23 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + · +15 │ struct Scds {} + │ ---- 'drop' constraint declared here + · +36 │ let Scds {} = Scds> {}; + │ ^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:36:23 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'store' ability would need to be added here + · +15 │ struct Scds {} + │ ----- 'store' constraint declared here + · +36 │ let Scds {} = Scds> {}; + │ ^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'store' + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:37:13 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +15 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +37 │ let Scds {} = Scds> {}; + │ ^^^^^^^ -------- The type '0x42::M::Cup<0x42::M::NoC>' does not have the ability 'copy' + │ │ + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:37:13 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + · +15 │ struct Scds {} + │ ---- 'drop' constraint declared here + · +37 │ let Scds {} = Scds> {}; + │ ^^^^^^^ -------- The type '0x42::M::Cup<0x42::M::NoC>' does not have the ability 'drop' + │ │ + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:37:13 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'store' ability would need to be added here + · +15 │ struct Scds {} + │ ----- 'store' constraint declared here + · +37 │ let Scds {} = Scds> {}; + │ ^^^^^^^ -------- The type '0x42::M::Cup<0x42::M::NoC>' does not have the ability 'store' + │ │ + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:37:23 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +15 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +37 │ let Scds {} = Scds> {}; + │ ^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup<0x42::M::NoC>' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:37:23 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + · +15 │ struct Scds {} + │ ---- 'drop' constraint declared here + · +37 │ let Scds {} = Scds> {}; + │ ^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup<0x42::M::NoC>' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:37:23 + │ + 5 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'store' ability would need to be added here + · +15 │ struct Scds {} + │ ----- 'store' constraint declared here + · +37 │ let Scds {} = Scds> {}; + │ ^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup<0x42::M::NoC>' does not have the ability 'store' + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:38:13 + │ +15 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +38 │ let Scds {} = Scds> {}; + │ ^^^^^^^ -------------- + │ │ │ │ + │ │ │ The type '0x42::M::Pair' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' + │ │ The type '0x42::M::Pair' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_structs_invalid.move:38:23 + │ +15 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +38 │ let Scds {} = Scds> {}; + │ ^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::Pair' can have the ability 'copy' but the type argument '0x42::M::NoC' does not have the required ability 'copy' + │ │ The type '0x42::M::Pair' does not have the ability 'copy' + │ 'copy' constraint not satisifed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_tparams_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_tparams_invalid.exp deleted file mode 100644 index 3060f5e037ece..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_tparams_invalid.exp +++ /dev/null @@ -1,601 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:21:9 - │ - 7 │ fun c() {} - │ ---- 'copy' constraint declared here - · -17 │ TnoC: drop + store + key, - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - · -21 │ c(); - │ ^^^^^^^^^ - │ │ │ - │ │ The type 'TnoC' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:22:9 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · - 7 │ fun c() {} - │ ---- 'copy' constraint declared here - · -22 │ c>(); - │ ^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:23:9 - │ - 7 │ fun c() {} - │ ---- 'copy' constraint declared here - · -23 │ c>(); - │ ^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::Box' can have the ability 'copy' but the type argument 'TnoC' does not have the required ability 'copy' - │ │ The type '0x42::M::Box' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:24:9 - │ - 8 │ fun k() {} - │ --- 'key' constraint declared here - · -18 │ TnoK: copy + drop + store, - │ ---- To satisfy the constraint, the 'key' ability would need to be added here - · -24 │ k(); - │ ^^^^^^^^^ - │ │ │ - │ │ The type 'TnoK' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:25:9 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'key' ability would need to be added here - · - 8 │ fun k() {} - │ --- 'key' constraint declared here - · -25 │ k>(); - │ ^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:26:9 - │ - 8 │ fun k() {} - │ --- 'key' constraint declared here - · -26 │ k>>(); - │ ^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::Box<0x42::M::Cup>' can have the ability 'key' but the type argument '0x42::M::Cup' does not have the required ability 'store' - │ │ The type '0x42::M::Box<0x42::M::Cup>' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:27:9 - │ - 9 │ fun cds() {} - │ ---- 'copy' constraint declared here - · -17 │ TnoC: drop + store + key, - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - · -27 │ cds(); - │ ^^^^^^^^^^^ - │ │ │ - │ │ The type 'TnoC' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:28:9 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · - 9 │ fun cds() {} - │ ---- 'copy' constraint declared here - · -28 │ cds>(); - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:28:9 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - · - 9 │ fun cds() {} - │ ---- 'drop' constraint declared here - · -28 │ cds>(); - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:28:9 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'store' ability would need to be added here - · - 9 │ fun cds() {} - │ ----- 'store' constraint declared here - · -28 │ cds>(); - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'store' - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:29:9 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · - 9 │ fun cds() {} - │ ---- 'copy' constraint declared here - · -29 │ cds>(); - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:29:9 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - · - 9 │ fun cds() {} - │ ---- 'drop' constraint declared here - · -29 │ cds>(); - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:29:9 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'store' ability would need to be added here - · - 9 │ fun cds() {} - │ ----- 'store' constraint declared here - · -29 │ cds>(); - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'store' - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:30:9 - │ - 9 │ fun cds() {} - │ ---- 'copy' constraint declared here - · -30 │ cds>(); - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::Pair' can have the ability 'copy' but the type argument 'TnoC' does not have the required ability 'copy' - │ │ The type '0x42::M::Pair' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:31:13 - │ -11 │ struct Sc {} - │ ---- 'copy' constraint declared here - · -17 │ TnoC: drop + store + key, - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - · -31 │ let Sc {} = Sc {}; - │ ^^^^^ ---- The type 'TnoC' does not have the ability 'copy' - │ │ - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:31:21 - │ -11 │ struct Sc {} - │ ---- 'copy' constraint declared here - · -17 │ TnoC: drop + store + key, - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - · -31 │ let Sc {} = Sc {}; - │ ^^^^^^^^^^^ - │ │ │ - │ │ The type 'TnoC' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:32:13 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -11 │ struct Sc {} - │ ---- 'copy' constraint declared here - · -32 │ let Sc {} = Sc> {}; - │ ^^^^^ --------- The type '0x42::M::Cup' does not have the ability 'copy' - │ │ - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:32:21 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -11 │ struct Sc {} - │ ---- 'copy' constraint declared here - · -32 │ let Sc {} = Sc> {}; - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:33:13 - │ -11 │ struct Sc {} - │ ---- 'copy' constraint declared here - · -33 │ let Sc {} = Sc> {}; - │ ^^^^^ --------- - │ │ │ │ - │ │ │ The type '0x42::M::Box' can have the ability 'copy' but the type argument 'TnoC' does not have the required ability 'copy' - │ │ The type '0x42::M::Box' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:33:21 - │ -11 │ struct Sc {} - │ ---- 'copy' constraint declared here - · -33 │ let Sc {} = Sc> {}; - │ ^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::Box' can have the ability 'copy' but the type argument 'TnoC' does not have the required ability 'copy' - │ │ The type '0x42::M::Box' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:34:13 - │ -12 │ struct Sk {} - │ --- 'key' constraint declared here - · -18 │ TnoK: copy + drop + store, - │ ---- To satisfy the constraint, the 'key' ability would need to be added here - · -34 │ let Sk {} = Sk {}; - │ ^^^^^ ---- The type 'TnoK' does not have the ability 'key' - │ │ - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:34:21 - │ -12 │ struct Sk {} - │ --- 'key' constraint declared here - · -18 │ TnoK: copy + drop + store, - │ ---- To satisfy the constraint, the 'key' ability would need to be added here - · -34 │ let Sk {} = Sk {}; - │ ^^^^^^^^^^^ - │ │ │ - │ │ The type 'TnoK' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:35:13 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'key' ability would need to be added here - · -12 │ struct Sk {} - │ --- 'key' constraint declared here - · -35 │ let Sk {} = Sk> {}; - │ ^^^^^ --------- The type '0x42::M::Cup' does not have the ability 'key' - │ │ - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:35:21 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'key' ability would need to be added here - · -12 │ struct Sk {} - │ --- 'key' constraint declared here - · -35 │ let Sk {} = Sk> {}; - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:36:13 - │ -12 │ struct Sk {} - │ --- 'key' constraint declared here - · -36 │ let Sk {} = Sk>> {}; - │ ^^^^^ -------------- - │ │ │ │ - │ │ │ The type '0x42::M::Box<0x42::M::Cup>' can have the ability 'key' but the type argument '0x42::M::Cup' does not have the required ability 'store' - │ │ The type '0x42::M::Box<0x42::M::Cup>' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:36:21 - │ -12 │ struct Sk {} - │ --- 'key' constraint declared here - · -36 │ let Sk {} = Sk>> {}; - │ ^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::Box<0x42::M::Cup>' can have the ability 'key' but the type argument '0x42::M::Cup' does not have the required ability 'store' - │ │ The type '0x42::M::Box<0x42::M::Cup>' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:37:13 - │ -13 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -17 │ TnoC: drop + store + key, - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - · -37 │ let Scds {} = Scds {}; - │ ^^^^^^^ ---- The type 'TnoC' does not have the ability 'copy' - │ │ - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:37:23 - │ -13 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -17 │ TnoC: drop + store + key, - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - · -37 │ let Scds {} = Scds {}; - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ The type 'TnoC' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:38:13 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -13 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -38 │ let Scds {} = Scds> {}; - │ ^^^^^^^ --------- The type '0x42::M::Cup' does not have the ability 'copy' - │ │ - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:38:13 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - · -13 │ struct Scds {} - │ ---- 'drop' constraint declared here - · -38 │ let Scds {} = Scds> {}; - │ ^^^^^^^ --------- The type '0x42::M::Cup' does not have the ability 'drop' - │ │ - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:38:13 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'store' ability would need to be added here - · -13 │ struct Scds {} - │ ----- 'store' constraint declared here - · -38 │ let Scds {} = Scds> {}; - │ ^^^^^^^ --------- The type '0x42::M::Cup' does not have the ability 'store' - │ │ - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:38:23 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -13 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -38 │ let Scds {} = Scds> {}; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:38:23 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - · -13 │ struct Scds {} - │ ---- 'drop' constraint declared here - · -38 │ let Scds {} = Scds> {}; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:38:23 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'store' ability would need to be added here - · -13 │ struct Scds {} - │ ----- 'store' constraint declared here - · -38 │ let Scds {} = Scds> {}; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'store' - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:39:13 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -13 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -39 │ let Scds {} = Scds> {}; - │ ^^^^^^^ --------- The type '0x42::M::Cup' does not have the ability 'copy' - │ │ - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:39:13 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - · -13 │ struct Scds {} - │ ---- 'drop' constraint declared here - · -39 │ let Scds {} = Scds> {}; - │ ^^^^^^^ --------- The type '0x42::M::Cup' does not have the ability 'drop' - │ │ - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:39:13 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'store' ability would need to be added here - · -13 │ struct Scds {} - │ ----- 'store' constraint declared here - · -39 │ let Scds {} = Scds> {}; - │ ^^^^^^^ --------- The type '0x42::M::Cup' does not have the ability 'store' - │ │ - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:39:23 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -13 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -39 │ let Scds {} = Scds> {}; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:39:23 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - · -13 │ struct Scds {} - │ ---- 'drop' constraint declared here - · -39 │ let Scds {} = Scds> {}; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:39:23 - │ - 3 │ struct Cup { f: T } - │ --- To satisfy the constraint, the 'store' ability would need to be added here - · -13 │ struct Scds {} - │ ----- 'store' constraint declared here - · -39 │ let Scds {} = Scds> {}; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Cup' does not have the ability 'store' - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:40:13 - │ -13 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -40 │ let Scds {} = Scds> {}; - │ ^^^^^^^ --------------- - │ │ │ │ - │ │ │ The type '0x42::M::Pair' can have the ability 'copy' but the type argument 'TnoC' does not have the required ability 'copy' - │ │ The type '0x42::M::Pair' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:40:23 - │ -13 │ struct Scds {} - │ ---- 'copy' constraint declared here - · -40 │ let Scds {} = Scds> {}; - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::Pair' can have the ability 'copy' but the type argument 'TnoC' does not have the required ability 'copy' - │ │ The type '0x42::M::Pair' does not have the ability 'copy' - │ 'copy' constraint not satisifed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_tparams_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_tparams_invalid.snap new file mode 100644 index 0000000000000..ecdf5174f574f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraint_tparams_invalid.snap @@ -0,0 +1,608 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/ability_constraint_tparams_invalid.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:21:9 + │ + 7 │ fun c() {} + │ ---- 'copy' constraint declared here + · +17 │ TnoC: drop + store + key, + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + · +21 │ c(); + │ ^^^^^^^^^ + │ │ │ + │ │ The type 'TnoC' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:22:9 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · + 7 │ fun c() {} + │ ---- 'copy' constraint declared here + · +22 │ c>(); + │ ^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:23:9 + │ + 7 │ fun c() {} + │ ---- 'copy' constraint declared here + · +23 │ c>(); + │ ^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::Box' can have the ability 'copy' but the type argument 'TnoC' does not have the required ability 'copy' + │ │ The type '0x42::M::Box' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:24:9 + │ + 8 │ fun k() {} + │ --- 'key' constraint declared here + · +18 │ TnoK: copy + drop + store, + │ ---- To satisfy the constraint, the 'key' ability would need to be added here + · +24 │ k(); + │ ^^^^^^^^^ + │ │ │ + │ │ The type 'TnoK' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:25:9 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'key' ability would need to be added here + · + 8 │ fun k() {} + │ --- 'key' constraint declared here + · +25 │ k>(); + │ ^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:26:9 + │ + 8 │ fun k() {} + │ --- 'key' constraint declared here + · +26 │ k>>(); + │ ^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::Box<0x42::M::Cup>' can have the ability 'key' but the type argument '0x42::M::Cup' does not have the required ability 'store' + │ │ The type '0x42::M::Box<0x42::M::Cup>' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:27:9 + │ + 9 │ fun cds() {} + │ ---- 'copy' constraint declared here + · +17 │ TnoC: drop + store + key, + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + · +27 │ cds(); + │ ^^^^^^^^^^^ + │ │ │ + │ │ The type 'TnoC' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:28:9 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · + 9 │ fun cds() {} + │ ---- 'copy' constraint declared here + · +28 │ cds>(); + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:28:9 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + · + 9 │ fun cds() {} + │ ---- 'drop' constraint declared here + · +28 │ cds>(); + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:28:9 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'store' ability would need to be added here + · + 9 │ fun cds() {} + │ ----- 'store' constraint declared here + · +28 │ cds>(); + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'store' + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:29:9 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · + 9 │ fun cds() {} + │ ---- 'copy' constraint declared here + · +29 │ cds>(); + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:29:9 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + · + 9 │ fun cds() {} + │ ---- 'drop' constraint declared here + · +29 │ cds>(); + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:29:9 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'store' ability would need to be added here + · + 9 │ fun cds() {} + │ ----- 'store' constraint declared here + · +29 │ cds>(); + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'store' + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:30:9 + │ + 9 │ fun cds() {} + │ ---- 'copy' constraint declared here + · +30 │ cds>(); + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::Pair' can have the ability 'copy' but the type argument 'TnoC' does not have the required ability 'copy' + │ │ The type '0x42::M::Pair' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:31:13 + │ +11 │ struct Sc {} + │ ---- 'copy' constraint declared here + · +17 │ TnoC: drop + store + key, + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + · +31 │ let Sc {} = Sc {}; + │ ^^^^^ ---- The type 'TnoC' does not have the ability 'copy' + │ │ + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:31:21 + │ +11 │ struct Sc {} + │ ---- 'copy' constraint declared here + · +17 │ TnoC: drop + store + key, + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + · +31 │ let Sc {} = Sc {}; + │ ^^^^^^^^^^^ + │ │ │ + │ │ The type 'TnoC' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:32:13 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +11 │ struct Sc {} + │ ---- 'copy' constraint declared here + · +32 │ let Sc {} = Sc> {}; + │ ^^^^^ --------- The type '0x42::M::Cup' does not have the ability 'copy' + │ │ + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:32:21 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +11 │ struct Sc {} + │ ---- 'copy' constraint declared here + · +32 │ let Sc {} = Sc> {}; + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:33:13 + │ +11 │ struct Sc {} + │ ---- 'copy' constraint declared here + · +33 │ let Sc {} = Sc> {}; + │ ^^^^^ --------- + │ │ │ │ + │ │ │ The type '0x42::M::Box' can have the ability 'copy' but the type argument 'TnoC' does not have the required ability 'copy' + │ │ The type '0x42::M::Box' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:33:21 + │ +11 │ struct Sc {} + │ ---- 'copy' constraint declared here + · +33 │ let Sc {} = Sc> {}; + │ ^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::Box' can have the ability 'copy' but the type argument 'TnoC' does not have the required ability 'copy' + │ │ The type '0x42::M::Box' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:34:13 + │ +12 │ struct Sk {} + │ --- 'key' constraint declared here + · +18 │ TnoK: copy + drop + store, + │ ---- To satisfy the constraint, the 'key' ability would need to be added here + · +34 │ let Sk {} = Sk {}; + │ ^^^^^ ---- The type 'TnoK' does not have the ability 'key' + │ │ + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:34:21 + │ +12 │ struct Sk {} + │ --- 'key' constraint declared here + · +18 │ TnoK: copy + drop + store, + │ ---- To satisfy the constraint, the 'key' ability would need to be added here + · +34 │ let Sk {} = Sk {}; + │ ^^^^^^^^^^^ + │ │ │ + │ │ The type 'TnoK' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:35:13 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'key' ability would need to be added here + · +12 │ struct Sk {} + │ --- 'key' constraint declared here + · +35 │ let Sk {} = Sk> {}; + │ ^^^^^ --------- The type '0x42::M::Cup' does not have the ability 'key' + │ │ + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:35:21 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'key' ability would need to be added here + · +12 │ struct Sk {} + │ --- 'key' constraint declared here + · +35 │ let Sk {} = Sk> {}; + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:36:13 + │ +12 │ struct Sk {} + │ --- 'key' constraint declared here + · +36 │ let Sk {} = Sk>> {}; + │ ^^^^^ -------------- + │ │ │ │ + │ │ │ The type '0x42::M::Box<0x42::M::Cup>' can have the ability 'key' but the type argument '0x42::M::Cup' does not have the required ability 'store' + │ │ The type '0x42::M::Box<0x42::M::Cup>' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:36:21 + │ +12 │ struct Sk {} + │ --- 'key' constraint declared here + · +36 │ let Sk {} = Sk>> {}; + │ ^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::Box<0x42::M::Cup>' can have the ability 'key' but the type argument '0x42::M::Cup' does not have the required ability 'store' + │ │ The type '0x42::M::Box<0x42::M::Cup>' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:37:13 + │ +13 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +17 │ TnoC: drop + store + key, + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + · +37 │ let Scds {} = Scds {}; + │ ^^^^^^^ ---- The type 'TnoC' does not have the ability 'copy' + │ │ + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:37:23 + │ +13 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +17 │ TnoC: drop + store + key, + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + · +37 │ let Scds {} = Scds {}; + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ The type 'TnoC' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:38:13 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +13 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +38 │ let Scds {} = Scds> {}; + │ ^^^^^^^ --------- The type '0x42::M::Cup' does not have the ability 'copy' + │ │ + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:38:13 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + · +13 │ struct Scds {} + │ ---- 'drop' constraint declared here + · +38 │ let Scds {} = Scds> {}; + │ ^^^^^^^ --------- The type '0x42::M::Cup' does not have the ability 'drop' + │ │ + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:38:13 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'store' ability would need to be added here + · +13 │ struct Scds {} + │ ----- 'store' constraint declared here + · +38 │ let Scds {} = Scds> {}; + │ ^^^^^^^ --------- The type '0x42::M::Cup' does not have the ability 'store' + │ │ + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:38:23 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +13 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +38 │ let Scds {} = Scds> {}; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:38:23 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + · +13 │ struct Scds {} + │ ---- 'drop' constraint declared here + · +38 │ let Scds {} = Scds> {}; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:38:23 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'store' ability would need to be added here + · +13 │ struct Scds {} + │ ----- 'store' constraint declared here + · +38 │ let Scds {} = Scds> {}; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'store' + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:39:13 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +13 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +39 │ let Scds {} = Scds> {}; + │ ^^^^^^^ --------- The type '0x42::M::Cup' does not have the ability 'copy' + │ │ + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:39:13 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + · +13 │ struct Scds {} + │ ---- 'drop' constraint declared here + · +39 │ let Scds {} = Scds> {}; + │ ^^^^^^^ --------- The type '0x42::M::Cup' does not have the ability 'drop' + │ │ + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:39:13 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'store' ability would need to be added here + · +13 │ struct Scds {} + │ ----- 'store' constraint declared here + · +39 │ let Scds {} = Scds> {}; + │ ^^^^^^^ --------- The type '0x42::M::Cup' does not have the ability 'store' + │ │ + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:39:23 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +13 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +39 │ let Scds {} = Scds> {}; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:39:23 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + · +13 │ struct Scds {} + │ ---- 'drop' constraint declared here + · +39 │ let Scds {} = Scds> {}; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:39:23 + │ + 3 │ struct Cup { f: T } + │ --- To satisfy the constraint, the 'store' ability would need to be added here + · +13 │ struct Scds {} + │ ----- 'store' constraint declared here + · +39 │ let Scds {} = Scds> {}; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Cup' does not have the ability 'store' + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:40:13 + │ +13 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +40 │ let Scds {} = Scds> {}; + │ ^^^^^^^ --------------- + │ │ │ │ + │ │ │ The type '0x42::M::Pair' can have the ability 'copy' but the type argument 'TnoC' does not have the required ability 'copy' + │ │ The type '0x42::M::Pair' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ability_constraint_tparams_invalid.move:40:23 + │ +13 │ struct Scds {} + │ ---- 'copy' constraint declared here + · +40 │ let Scds {} = Scds> {}; + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::Pair' can have the ability 'copy' but the type argument 'TnoC' does not have the required ability 'copy' + │ │ The type '0x42::M::Pair' does not have the ability 'copy' + │ 'copy' constraint not satisifed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraints.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraints.snap new file mode 100644 index 0000000000000..20b73d97b651d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/ability_constraints.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/ability_constraints.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/abort_any_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/abort_any_type.exp deleted file mode 100644 index ad0553de7a35e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/abort_any_type.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/typing/abort_any_type.move:5:14 - │ -5 │ 0 + (abort 0); - │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/typing/abort_any_type.move:9:13 - │ -9 │ foo(abort 0); - │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/abort_any_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/abort_any_type.snap new file mode 100644 index 0000000000000..b47cb57e37323 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/abort_any_type.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/abort_any_type.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/typing/abort_any_type.move:5:14 + │ +5 │ 0 + (abort 0); + │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/typing/abort_any_type.move:9:13 + │ +9 │ foo(abort 0); + │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/annotated_types.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/annotated_types.snap new file mode 100644 index 0000000000000..e8bec1c9b1935 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/annotated_types.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/annotated_types.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/assert_invalid_cond_and_code_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/assert_invalid_cond_and_code_type.exp deleted file mode 100644 index bdd4ee7f90148..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/assert_invalid_cond_and_code_type.exp +++ /dev/null @@ -1,21 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/assert_invalid_cond_and_code_type.move:3:9 - │ -3 │ assert!(42, false); - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: integer - │ Invalid call of 'assert'. Invalid argument for parameter '0' - │ Expected: 'bool' - -error[E04035]: invalid constant usage in error context - ┌─ tests/move_check/typing/assert_invalid_cond_and_code_type.move:3:21 - │ -3 │ assert!(42, false); - │ ^^^^^ - │ │ - │ Invalid error code for assertion, expected a u64 or constant declared with '#[error]' annotation - │ If you want to use a non-u64 as an abort code, you must use a '#[error]' attribute on a constant - │ - = Non-u64 constants can only be used as error codes if the '#[error]' attribute is added to them. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/assert_invalid_cond_and_code_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/assert_invalid_cond_and_code_type.snap new file mode 100644 index 0000000000000..ad2186f31585a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/assert_invalid_cond_and_code_type.snap @@ -0,0 +1,28 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/assert_invalid_cond_and_code_type.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/assert_invalid_cond_and_code_type.move:3:9 + │ +3 │ assert!(42, false); + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: integer + │ Invalid call of 'assert'. Invalid argument for parameter '0' + │ Expected: 'bool' + +error[E04035]: invalid constant usage in error context + ┌─ tests/move_check/typing/assert_invalid_cond_and_code_type.move:3:21 + │ +3 │ assert!(42, false); + │ ^^^^^ + │ │ + │ Invalid error code for assertion, expected a u64 or constant declared with '#[error]' annotation + │ If you want to use a non-u64 as an abort code, you must use a '#[error]' attribute on a constant + │ + = Non-u64 constants can only be used as error codes if the '#[error]' attribute is added to them. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_duplicate_assigning.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_duplicate_assigning.exp deleted file mode 100644 index 5a627a8201874..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_duplicate_assigning.exp +++ /dev/null @@ -1,64 +0,0 @@ -warning[W09003]: unused assignment - ┌─ tests/move_check/typing/assign_duplicate_assigning.move:6:10 - │ -6 │ (x, x) = (0, 0); - │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09003]: unused assignment - ┌─ tests/move_check/typing/assign_duplicate_assigning.move:6:13 - │ -6 │ (x, x) = (0, 0); - │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/typing/assign_duplicate_assigning.move:6:13 - │ -6 │ (x, x) = (0, 0); - │ - ^ Duplicate usage of local 'x' in a given assignment - │ │ - │ Previously assigned here - -warning[W09003]: unused assignment - ┌─ tests/move_check/typing/assign_duplicate_assigning.move:8:10 - │ -8 │ (f, R{f}, f) = (0, R { f: 0 }, 0); - │ ^ Unused assignment for variable 'f'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_f') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09003]: unused assignment - ┌─ tests/move_check/typing/assign_duplicate_assigning.move:8:15 - │ -8 │ (f, R{f}, f) = (0, R { f: 0 }, 0); - │ ^ Unused assignment for variable 'f'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_f') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/typing/assign_duplicate_assigning.move:8:15 - │ -8 │ (f, R{f}, f) = (0, R { f: 0 }, 0); - │ - ^ Duplicate usage of local 'f' in a given assignment - │ │ - │ Previously assigned here - -warning[W09003]: unused assignment - ┌─ tests/move_check/typing/assign_duplicate_assigning.move:8:19 - │ -8 │ (f, R{f}, f) = (0, R { f: 0 }, 0); - │ ^ Unused assignment for variable 'f'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_f') - │ - = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/typing/assign_duplicate_assigning.move:8:19 - │ -8 │ (f, R{f}, f) = (0, R { f: 0 }, 0); - │ - ^ Duplicate usage of local 'f' in a given assignment - │ │ - │ Previously assigned here - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_duplicate_assigning.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_duplicate_assigning.snap new file mode 100644 index 0000000000000..900056ca03b26 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_duplicate_assigning.snap @@ -0,0 +1,71 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/assign_duplicate_assigning.move +--- +warning[W09003]: unused assignment + ┌─ tests/move_check/typing/assign_duplicate_assigning.move:6:10 + │ +6 │ (x, x) = (0, 0); + │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09003]: unused assignment + ┌─ tests/move_check/typing/assign_duplicate_assigning.move:6:13 + │ +6 │ (x, x) = (0, 0); + │ ^ Unused assignment for variable 'x'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_x') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/typing/assign_duplicate_assigning.move:6:13 + │ +6 │ (x, x) = (0, 0); + │ - ^ Duplicate usage of local 'x' in a given assignment + │ │ + │ Previously assigned here + +warning[W09003]: unused assignment + ┌─ tests/move_check/typing/assign_duplicate_assigning.move:8:10 + │ +8 │ (f, R{f}, f) = (0, R { f: 0 }, 0); + │ ^ Unused assignment for variable 'f'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_f') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09003]: unused assignment + ┌─ tests/move_check/typing/assign_duplicate_assigning.move:8:15 + │ +8 │ (f, R{f}, f) = (0, R { f: 0 }, 0); + │ ^ Unused assignment for variable 'f'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_f') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/typing/assign_duplicate_assigning.move:8:15 + │ +8 │ (f, R{f}, f) = (0, R { f: 0 }, 0); + │ - ^ Duplicate usage of local 'f' in a given assignment + │ │ + │ Previously assigned here + +warning[W09003]: unused assignment + ┌─ tests/move_check/typing/assign_duplicate_assigning.move:8:19 + │ +8 │ (f, R{f}, f) = (0, R { f: 0 }, 0); + │ ^ Unused assignment for variable 'f'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_f') + │ + = This warning can be suppressed with '#[allow(unused_assignment)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/typing/assign_duplicate_assigning.move:8:19 + │ +8 │ (f, R{f}, f) = (0, R { f: 0 }, 0); + │ - ^ Duplicate usage of local 'f' in a given assignment + │ │ + │ Previously assigned here diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_nested.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_nested.exp deleted file mode 100644 index d0adf9c28a8b0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_nested.exp +++ /dev/null @@ -1,14 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/typing/assign_nested.move:10:13 - │ -10 │ let x: u64; - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E01009]: invalid assignment - ┌─ tests/move_check/typing/assign_nested.move:14:19 - │ -14 │ (_, x, _, s.f) = four(); - │ ^^^ Invalid assignment syntax. Expected: a local, a field write, or a deconstructing assignment - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_nested.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_nested.snap new file mode 100644 index 0000000000000..9ef0a1c1597c3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_nested.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/assign_nested.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/typing/assign_nested.move:10:13 + │ +10 │ let x: u64; + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E01009]: invalid assignment + ┌─ tests/move_check/typing/assign_nested.move:14:19 + │ +14 │ (_, x, _, s.f) = four(); + │ ^^^ Invalid assignment syntax. Expected: a local, a field write, or a deconstructing assignment diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_pop_resource.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_pop_resource.exp deleted file mode 100644 index 9df5cfa180d18..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_pop_resource.exp +++ /dev/null @@ -1,33 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/assign_pop_resource.move:5:9 - │ -2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -5 │ _ = R{}; - │ ^ --- The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ Cannot ignore values without the 'drop' ability. The value must be used - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/assign_pop_resource.move:6:10 - │ -2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -6 │ (_, _) = (R{}, R{}); - │ ^ --- The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ Cannot ignore values without the 'drop' ability. The value must be used - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/assign_pop_resource.move:6:13 - │ -2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -6 │ (_, _) = (R{}, R{}); - │ ^ --- The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ Cannot ignore values without the 'drop' ability. The value must be used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_pop_resource.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_pop_resource.snap new file mode 100644 index 0000000000000..f8b6f492158c6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_pop_resource.snap @@ -0,0 +1,40 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/assign_pop_resource.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/assign_pop_resource.move:5:9 + │ +2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +5 │ _ = R{}; + │ ^ --- The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ Cannot ignore values without the 'drop' ability. The value must be used + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/assign_pop_resource.move:6:10 + │ +2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +6 │ (_, _) = (R{}, R{}); + │ ^ --- The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ Cannot ignore values without the 'drop' ability. The value must be used + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/assign_pop_resource.move:6:13 + │ +2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +6 │ (_, _) = (R{}, R{}); + │ ^ --- The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ Cannot ignore values without the 'drop' ability. The value must be used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_unpack_references.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_unpack_references.exp deleted file mode 100644 index 42eaf280d5e29..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_unpack_references.exp +++ /dev/null @@ -1,30 +0,0 @@ -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/typing/assign_unpack_references.move:20:14 - │ - 3 │ struct R { s1: S, s2: S } - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -17 │ R { s1: S { f }, s2 } = &R { s1: S{f: 0}, s2: S{f: 1} }; f; s2; - │ ------------------------------ - │ │ - │ The value is created but not used. The value does not have the 'drop' ability and must be consumed before the function returns - │ The type '0x8675309::M::R' does not have the ability 'drop' - · -20 │ f; s2; - │ ^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/typing/assign_unpack_references.move:30:14 - │ - 3 │ struct R { s1: S, s2: S } - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -27 │ R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; f; s2; - │ ------------------------------ - │ │ - │ The value is created but not used. The value does not have the 'drop' ability and must be consumed before the function returns - │ The type '0x8675309::M::R' does not have the ability 'drop' - · -30 │ f; s2; - │ ^ Invalid return - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_unpack_references.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_unpack_references.snap new file mode 100644 index 0000000000000..108f4c2f3acdd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_unpack_references.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/assign_unpack_references.move +--- +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/typing/assign_unpack_references.move:20:14 + │ + 3 │ struct R { s1: S, s2: S } + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +17 │ R { s1: S { f }, s2 } = &R { s1: S{f: 0}, s2: S{f: 1} }; f; s2; + │ ------------------------------ + │ │ + │ The value is created but not used. The value does not have the 'drop' ability and must be consumed before the function returns + │ The type '0x8675309::M::R' does not have the ability 'drop' + · +20 │ f; s2; + │ ^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/typing/assign_unpack_references.move:30:14 + │ + 3 │ struct R { s1: S, s2: S } + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +27 │ R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; f; s2; + │ ------------------------------ + │ │ + │ The value is created but not used. The value does not have the 'drop' ability and must be consumed before the function returns + │ The type '0x8675309::M::R' does not have the ability 'drop' + · +30 │ f; s2; + │ ^ Invalid return diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_unpack_references_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_unpack_references_invalid.exp deleted file mode 100644 index c95a571944301..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_unpack_references_invalid.exp +++ /dev/null @@ -1,65 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/assign_unpack_references_invalid.move:9:9 - │ -8 │ R { s1: S { f }, s2 } = &R { s1: S{f: 0}, s2: S{f: 1} }; - │ - Expected: '&u64' -9 │ f = 0; - │ ^ - │ │ - │ Invalid assignment to variable 'f' - │ Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/assign_unpack_references_invalid.move:10:9 - │ - 8 │ R { s1: S { f }, s2 } = &R { s1: S{f: 0}, s2: S{f: 1} }; - │ -- Expected: '&0x8675309::M::S' - 9 │ f = 0; -10 │ s2 = S { f: 0 } - │ ^^ ---------- Given: '0x8675309::M::S' - │ │ - │ Invalid assignment to variable 's2' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/assign_unpack_references_invalid.move:17:9 - │ -16 │ R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; - │ - Expected: '&mut u64' -17 │ f = 0; - │ ^ - │ │ - │ Invalid assignment to variable 'f' - │ Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/assign_unpack_references_invalid.move:18:9 - │ -16 │ R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; - │ -- Expected: '&mut 0x8675309::M::S' -17 │ f = 0; -18 │ s2 = S { f: 0 } - │ ^^ ---------- Given: '0x8675309::M::S' - │ │ - │ Invalid assignment to variable 's2' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/assign_unpack_references_invalid.move:26:9 - │ -25 │ R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; - │ - Expected: '&mut u64' -26 │ f = &0; - │ ^ -- Given: '&{integer}' - │ │ - │ Invalid assignment to variable 'f' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/assign_unpack_references_invalid.move:27:9 - │ -25 │ R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; - │ -- Expected: '&mut 0x8675309::M::S' -26 │ f = &0; -27 │ s2 = &S { f: 0 } - │ ^^ ----------- Given: '&0x8675309::M::S' - │ │ - │ Invalid assignment to variable 's2' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_unpack_references_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_unpack_references_invalid.snap new file mode 100644 index 0000000000000..eff1e13b8808f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_unpack_references_invalid.snap @@ -0,0 +1,72 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/assign_unpack_references_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/assign_unpack_references_invalid.move:9:9 + │ +8 │ R { s1: S { f }, s2 } = &R { s1: S{f: 0}, s2: S{f: 1} }; + │ - Expected: '&u64' +9 │ f = 0; + │ ^ + │ │ + │ Invalid assignment to variable 'f' + │ Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/assign_unpack_references_invalid.move:10:9 + │ + 8 │ R { s1: S { f }, s2 } = &R { s1: S{f: 0}, s2: S{f: 1} }; + │ -- Expected: '&0x8675309::M::S' + 9 │ f = 0; +10 │ s2 = S { f: 0 } + │ ^^ ---------- Given: '0x8675309::M::S' + │ │ + │ Invalid assignment to variable 's2' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/assign_unpack_references_invalid.move:17:9 + │ +16 │ R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; + │ - Expected: '&mut u64' +17 │ f = 0; + │ ^ + │ │ + │ Invalid assignment to variable 'f' + │ Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/assign_unpack_references_invalid.move:18:9 + │ +16 │ R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; + │ -- Expected: '&mut 0x8675309::M::S' +17 │ f = 0; +18 │ s2 = S { f: 0 } + │ ^^ ---------- Given: '0x8675309::M::S' + │ │ + │ Invalid assignment to variable 's2' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/assign_unpack_references_invalid.move:26:9 + │ +25 │ R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; + │ - Expected: '&mut u64' +26 │ f = &0; + │ ^ -- Given: '&{integer}' + │ │ + │ Invalid assignment to variable 'f' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/assign_unpack_references_invalid.move:27:9 + │ +25 │ R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; + │ -- Expected: '&mut 0x8675309::M::S' +26 │ f = &0; +27 │ s2 = &S { f: 0 } + │ ^^ ----------- Given: '&0x8675309::M::S' + │ │ + │ Invalid assignment to variable 's2' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_wrong_arity.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_wrong_arity.exp deleted file mode 100644 index a21b7b984c121..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_wrong_arity.exp +++ /dev/null @@ -1,61 +0,0 @@ -error[E04005]: expected a single type - ┌─ tests/move_check/typing/assign_wrong_arity.move:5:13 - │ -5 │ let x; - │ ^ Invalid type for local -6 │ x = (); - │ -- Expected a single type, but found expression list type: '()' - -error[E04005]: expected a single type - ┌─ tests/move_check/typing/assign_wrong_arity.move:6:9 - │ -6 │ x = (); - │ ^ -- Expected a single type, but found expression list type: '()' - │ │ - │ Invalid type for local - -error[E04005]: expected a single type - ┌─ tests/move_check/typing/assign_wrong_arity.move:7:9 - │ -7 │ x = (0, 1, 2); - │ ^ --------- Expected a single type, but found expression list type: '(u64, u64, u64)' - │ │ - │ Invalid type for local - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/assign_wrong_arity.move:7:9 - │ -6 │ x = (); - │ -- Expected: '()' -7 │ x = (0, 1, 2); - │ ^ --------- Given: '({integer}, {integer}, {integer})' - │ │ - │ Invalid assignment to variable 'x' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/assign_wrong_arity.move:8:9 - │ -8 │ () = 0; - │ ^^ - Given: integer - │ │ - │ Invalid value for assignment - │ Expected: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/assign_wrong_arity.move:11:9 - │ -11 │ (x, b, R{f}) = (0, false, R{f: 0}, R{f: 0}); - │ ^^^^^^^^^^^^ ---------------------------- Given expression list of length 4: '({integer}, bool, 0x8675309::M::R, 0x8675309::M::R)' - │ │ - │ Invalid value for assignment - │ Expected expression list of length 3: '(_, _, _)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/assign_wrong_arity.move:12:9 - │ -12 │ (x, b, R{f}) = (0, false); - │ ^^^^^^^^^^^^ ---------- Given expression list of length 2: '({integer}, bool)' - │ │ - │ Invalid value for assignment - │ Expected expression list of length 3: '(_, _, _)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_wrong_arity.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_wrong_arity.snap new file mode 100644 index 0000000000000..b6322cefed338 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_wrong_arity.snap @@ -0,0 +1,68 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/assign_wrong_arity.move +--- +error[E04005]: expected a single type + ┌─ tests/move_check/typing/assign_wrong_arity.move:5:13 + │ +5 │ let x; + │ ^ Invalid type for local +6 │ x = (); + │ -- Expected a single type, but found expression list type: '()' + +error[E04005]: expected a single type + ┌─ tests/move_check/typing/assign_wrong_arity.move:6:9 + │ +6 │ x = (); + │ ^ -- Expected a single type, but found expression list type: '()' + │ │ + │ Invalid type for local + +error[E04005]: expected a single type + ┌─ tests/move_check/typing/assign_wrong_arity.move:7:9 + │ +7 │ x = (0, 1, 2); + │ ^ --------- Expected a single type, but found expression list type: '(u64, u64, u64)' + │ │ + │ Invalid type for local + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/assign_wrong_arity.move:7:9 + │ +6 │ x = (); + │ -- Expected: '()' +7 │ x = (0, 1, 2); + │ ^ --------- Given: '({integer}, {integer}, {integer})' + │ │ + │ Invalid assignment to variable 'x' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/assign_wrong_arity.move:8:9 + │ +8 │ () = 0; + │ ^^ - Given: integer + │ │ + │ Invalid value for assignment + │ Expected: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/assign_wrong_arity.move:11:9 + │ +11 │ (x, b, R{f}) = (0, false, R{f: 0}, R{f: 0}); + │ ^^^^^^^^^^^^ ---------------------------- Given expression list of length 4: '({integer}, bool, 0x8675309::M::R, 0x8675309::M::R)' + │ │ + │ Invalid value for assignment + │ Expected expression list of length 3: '(_, _, _)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/assign_wrong_arity.move:12:9 + │ +12 │ (x, b, R{f}) = (0, false); + │ ^^^^^^^^^^^^ ---------- Given expression list of length 2: '({integer}, bool)' + │ │ + │ Invalid value for assignment + │ Expected expression list of length 3: '(_, _, _)' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_wrong_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_wrong_type.exp deleted file mode 100644 index e4bf98556dd18..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_wrong_type.exp +++ /dev/null @@ -1,107 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/assign_wrong_type.move:8:9 - │ -8 │ S { g } = R {f :0}; - │ ^^^^^^^ -------- Expected: '0x8675309::M::R' - │ │ - │ Invalid deconstruction assignment - │ Given: '0x8675309::M::S' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/assign_wrong_type.move:9:10 - │ -9 │ (S { g }, R { f }) = (R{ f: 0 }, R{ f: 1 }); - │ ^^^^^^^ --------- Expected: '0x8675309::M::R' - │ │ - │ Invalid deconstruction assignment - │ Given: '0x8675309::M::S' - -error[E04005]: expected a single type - ┌─ tests/move_check/typing/assign_wrong_type.move:13:13 - │ -13 │ let x; - │ ^ Invalid type for local - · -16 │ x = (); - │ -- Expected a single type, but found expression list type: '()' - -error[E04005]: expected a single type - ┌─ tests/move_check/typing/assign_wrong_type.move:16:9 - │ -16 │ x = (); - │ ^ -- Expected a single type, but found expression list type: '()' - │ │ - │ Invalid type for local - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/assign_wrong_type.move:17:9 - │ -17 │ () = 0; - │ ^^ - Given: integer - │ │ - │ Invalid value for assignment - │ Expected: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/assign_wrong_type.move:18:9 - │ -18 │ (x, b, R{f}) = (0, false, R{f: 0}, R{f: 0}); - │ ^^^^^^^^^^^^ ---------------------------- Given expression list of length 4: '({integer}, bool, 0x8675309::M::R, 0x8675309::M::R)' - │ │ - │ Invalid value for assignment - │ Expected expression list of length 3: '(_, _, _)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/assign_wrong_type.move:19:9 - │ -19 │ (x, b, R{f}) = (0, false); - │ ^^^^^^^^^^^^ ---------- Given expression list of length 2: '({integer}, bool)' - │ │ - │ Invalid value for assignment - │ Expected expression list of length 3: '(_, _, _)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/assign_wrong_type.move:27:10 - │ -23 │ let x = false; - │ ----- Expected: 'bool' - · -27 │ (x, b, R{f}, r) = (0, false, R{f: 0}, R{f: 0}); - │ ^ - │ │ - │ Invalid assignment to variable 'x' - │ Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/assign_wrong_type.move:27:13 - │ -24 │ let b = 0; - │ - Expected: integer - · -27 │ (x, b, R{f}, r) = (0, false, R{f: 0}, R{f: 0}); - │ ^ ----- Given: 'bool' - │ │ - │ Invalid assignment to variable 'b' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/assign_wrong_type.move:27:18 - │ - 2 │ struct R {f: u64} - │ --- Given: 'u64' - · -25 │ let f = @0x0; - │ ---- Expected: 'address' -26 │ let r = S{ g: 0 }; -27 │ (x, b, R{f}, r) = (0, false, R{f: 0}, R{f: 0}); - │ ^ Invalid assignment to variable 'f' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/assign_wrong_type.move:27:22 - │ -26 │ let r = S{ g: 0 }; - │ --------- Expected: '0x8675309::M::S' -27 │ (x, b, R{f}, r) = (0, false, R{f: 0}, R{f: 0}); - │ ^ ------- Given: '0x8675309::M::R' - │ │ - │ Invalid assignment to variable 'r' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_wrong_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_wrong_type.snap new file mode 100644 index 0000000000000..30a4e017e85ea --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/assign_wrong_type.snap @@ -0,0 +1,114 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/assign_wrong_type.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/assign_wrong_type.move:8:9 + │ +8 │ S { g } = R {f :0}; + │ ^^^^^^^ -------- Expected: '0x8675309::M::R' + │ │ + │ Invalid deconstruction assignment + │ Given: '0x8675309::M::S' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/assign_wrong_type.move:9:10 + │ +9 │ (S { g }, R { f }) = (R{ f: 0 }, R{ f: 1 }); + │ ^^^^^^^ --------- Expected: '0x8675309::M::R' + │ │ + │ Invalid deconstruction assignment + │ Given: '0x8675309::M::S' + +error[E04005]: expected a single type + ┌─ tests/move_check/typing/assign_wrong_type.move:13:13 + │ +13 │ let x; + │ ^ Invalid type for local + · +16 │ x = (); + │ -- Expected a single type, but found expression list type: '()' + +error[E04005]: expected a single type + ┌─ tests/move_check/typing/assign_wrong_type.move:16:9 + │ +16 │ x = (); + │ ^ -- Expected a single type, but found expression list type: '()' + │ │ + │ Invalid type for local + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/assign_wrong_type.move:17:9 + │ +17 │ () = 0; + │ ^^ - Given: integer + │ │ + │ Invalid value for assignment + │ Expected: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/assign_wrong_type.move:18:9 + │ +18 │ (x, b, R{f}) = (0, false, R{f: 0}, R{f: 0}); + │ ^^^^^^^^^^^^ ---------------------------- Given expression list of length 4: '({integer}, bool, 0x8675309::M::R, 0x8675309::M::R)' + │ │ + │ Invalid value for assignment + │ Expected expression list of length 3: '(_, _, _)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/assign_wrong_type.move:19:9 + │ +19 │ (x, b, R{f}) = (0, false); + │ ^^^^^^^^^^^^ ---------- Given expression list of length 2: '({integer}, bool)' + │ │ + │ Invalid value for assignment + │ Expected expression list of length 3: '(_, _, _)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/assign_wrong_type.move:27:10 + │ +23 │ let x = false; + │ ----- Expected: 'bool' + · +27 │ (x, b, R{f}, r) = (0, false, R{f: 0}, R{f: 0}); + │ ^ + │ │ + │ Invalid assignment to variable 'x' + │ Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/assign_wrong_type.move:27:13 + │ +24 │ let b = 0; + │ - Expected: integer + · +27 │ (x, b, R{f}, r) = (0, false, R{f: 0}, R{f: 0}); + │ ^ ----- Given: 'bool' + │ │ + │ Invalid assignment to variable 'b' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/assign_wrong_type.move:27:18 + │ + 2 │ struct R {f: u64} + │ --- Given: 'u64' + · +25 │ let f = @0x0; + │ ---- Expected: 'address' +26 │ let r = S{ g: 0 }; +27 │ (x, b, R{f}, r) = (0, false, R{f: 0}, R{f: 0}); + │ ^ Invalid assignment to variable 'f' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/assign_wrong_type.move:27:22 + │ +26 │ let r = S{ g: 0 }; + │ --------- Expected: '0x8675309::M::S' +27 │ (x, b, R{f}, r) = (0, false, R{f: 0}, R{f: 0}); + │ ^ ------- Given: '0x8675309::M::R' + │ │ + │ Invalid assignment to variable 'r' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_const.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_const.exp deleted file mode 100644 index 3f5bf93e5819c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_const.exp +++ /dev/null @@ -1,90 +0,0 @@ -error[E03008]: too few type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:6:15 - │ -6 │ const S1: S = S { f: 0 }; - │ ^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 - -error[E04012]: invalid type for constant - ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:6:15 - │ -6 │ const S1: S = S { f: 0 }; - │ ^ - │ │ - │ Unpermitted constant type - │ Found: '0x42::M::S<_>'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:6:19 - │ -6 │ const S1: S = S { f: 0 }; - │ ^^^^^^^^^^ Structs are not supported in constants - -error[E03008]: too few type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:7:15 - │ -7 │ const S2: S<> = S { f: 0 }; - │ ^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 - -error[E04012]: invalid type for constant - ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:7:15 - │ -7 │ const S2: S<> = S { f: 0 }; - │ ^^^ - │ │ - │ Unpermitted constant type - │ Found: '0x42::M::S<_>'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:7:21 - │ -7 │ const S2: S<> = S { f: 0 }; - │ ^^^^^^^^^^ Structs are not supported in constants - -error[E03007]: too many type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:8:15 - │ -8 │ const S3: S = S { f: 0 }; - │ ^^^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 2 - -error[E04012]: invalid type for constant - ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:8:15 - │ -8 │ const S3: S = S { f: 0 }; - │ ^^^^^^^^^^^^ - │ │ - │ Unpermitted constant type - │ Found: '0x42::M::S<_>'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:8:30 - │ -8 │ const S3: S = S { f: 0 }; - │ ^^^^^^^^^^ Structs are not supported in constants - -error[E04012]: invalid type for constant - ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:9:15 - │ -9 │ const S4: S> = S { f: S { f: 0 } }; - │ ^^^^^^^^^^^^^^^ - │ │ - │ Unpermitted constant type - │ Found: '0x42::M::S<_>'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - -error[E03007]: too many type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:9:17 - │ -9 │ const S4: S> = S { f: S { f: 0 } }; - │ ^^^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 2 - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:9:33 - │ -9 │ const S4: S> = S { f: S { f: 0 } }; - │ ^^^^^^^^^^^^^^^^^^^ Structs are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:9:40 - │ -9 │ const S4: S> = S { f: S { f: 0 } }; - │ ^^^^^^^^^^ Structs are not supported in constants - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_const.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_const.snap new file mode 100644 index 0000000000000..741d345da7df6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_const.snap @@ -0,0 +1,97 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_const.move +--- +error[E03008]: too few type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:6:15 + │ +6 │ const S1: S = S { f: 0 }; + │ ^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 + +error[E04012]: invalid type for constant + ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:6:15 + │ +6 │ const S1: S = S { f: 0 }; + │ ^ + │ │ + │ Unpermitted constant type + │ Found: '0x42::M::S<_>'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:6:19 + │ +6 │ const S1: S = S { f: 0 }; + │ ^^^^^^^^^^ Structs are not supported in constants + +error[E03008]: too few type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:7:15 + │ +7 │ const S2: S<> = S { f: 0 }; + │ ^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 + +error[E04012]: invalid type for constant + ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:7:15 + │ +7 │ const S2: S<> = S { f: 0 }; + │ ^^^ + │ │ + │ Unpermitted constant type + │ Found: '0x42::M::S<_>'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:7:21 + │ +7 │ const S2: S<> = S { f: 0 }; + │ ^^^^^^^^^^ Structs are not supported in constants + +error[E03007]: too many type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:8:15 + │ +8 │ const S3: S = S { f: 0 }; + │ ^^^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 2 + +error[E04012]: invalid type for constant + ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:8:15 + │ +8 │ const S3: S = S { f: 0 }; + │ ^^^^^^^^^^^^ + │ │ + │ Unpermitted constant type + │ Found: '0x42::M::S<_>'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:8:30 + │ +8 │ const S3: S = S { f: 0 }; + │ ^^^^^^^^^^ Structs are not supported in constants + +error[E04012]: invalid type for constant + ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:9:15 + │ +9 │ const S4: S> = S { f: S { f: 0 } }; + │ ^^^^^^^^^^^^^^^ + │ │ + │ Unpermitted constant type + │ Found: '0x42::M::S<_>'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' + +error[E03007]: too many type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:9:17 + │ +9 │ const S4: S> = S { f: S { f: 0 } }; + │ ^^^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 2 + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:9:33 + │ +9 │ const S4: S> = S { f: S { f: 0 } }; + │ ^^^^^^^^^^^^^^^^^^^ Structs are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/bad_type_argument_arity_const.move:9:40 + │ +9 │ const S4: S> = S { f: S { f: 0 } }; + │ ^^^^^^^^^^ Structs are not supported in constants diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_fun.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_fun.exp deleted file mode 100644 index 1e99fa4e22abc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_fun.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E03008]: too few type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_fun.move:11:17 - │ -11 │ let x = foo<>(0); x; - │ ^^^^^^^^ Invalid instantiation of '0x42::M::foo'. Expected 1 type argument(s) but got 0 - -error[E03007]: too many type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_fun.move:12:17 - │ -12 │ let b = foo(false); - │ ^^^^^^^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::M::foo'. Expected 1 type argument(s) but got 2 - -error[E03007]: too many type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_fun.move:14:17 - │ -14 │ let r = foo<&mut u64, bool>(&mut 0); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::M::foo'. Expected 1 type argument(s) but got 2 - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/bad_type_argument_arity_fun.move:14:17 - │ -14 │ let r = foo<&mut u64, bool>(&mut 0); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&mut u64' - │ Invalid type argument - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_fun.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_fun.snap new file mode 100644 index 0000000000000..b82f89471d0a2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_fun.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_fun.move +--- +error[E03008]: too few type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_fun.move:11:17 + │ +11 │ let x = foo<>(0); x; + │ ^^^^^^^^ Invalid instantiation of '0x42::M::foo'. Expected 1 type argument(s) but got 0 + +error[E03007]: too many type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_fun.move:12:17 + │ +12 │ let b = foo(false); + │ ^^^^^^^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::M::foo'. Expected 1 type argument(s) but got 2 + +error[E03007]: too many type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_fun.move:14:17 + │ +14 │ let r = foo<&mut u64, bool>(&mut 0); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::M::foo'. Expected 1 type argument(s) but got 2 + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/bad_type_argument_arity_fun.move:14:17 + │ +14 │ let r = foo<&mut u64, bool>(&mut 0); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&mut u64' + │ Invalid type argument diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct.exp deleted file mode 100644 index 17c688af9e0e8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct.exp +++ /dev/null @@ -1,72 +0,0 @@ -error[E03008]: too few type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:7:13 - │ -7 │ s1: S, - │ ^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 - -error[E03008]: too few type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:8:13 - │ -8 │ s2: S<>, - │ ^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 - -error[E03007]: too many type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:9:13 - │ -9 │ s3: S, - │ ^^^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 2 - -error[E03008]: too few type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:13:13 - │ -13 │ s1: S, - │ ^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 - -error[E03008]: too few type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:14:13 - │ -14 │ s2: S<>, - │ ^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 - -error[E03007]: too many type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:15:13 - │ -15 │ s3: S, - │ ^^^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 2 - -error[E03007]: too many type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:16:15 - │ -16 │ s4: S> - │ ^^^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 2 - -error[E03008]: too few type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:17:9 - │ -17 │ ): (S, S<>, S, S>) { - │ ^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 - -error[E03008]: too few type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:17:12 - │ -17 │ ): (S, S<>, S, S>) { - │ ^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 - -error[E03007]: too many type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:17:17 - │ -17 │ ): (S, S<>, S, S>) { - │ ^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 2 - -error[E03007]: too many type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:17:36 - │ -17 │ ): (S, S<>, S, S>) { - │ ^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 2 - -error[E03008]: too few type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:27:21 - │ -27 │ fun s(f: T): S { - │ ^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct.snap new file mode 100644 index 0000000000000..de5d139b9f664 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct.snap @@ -0,0 +1,79 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct.move +--- +error[E03008]: too few type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:7:13 + │ +7 │ s1: S, + │ ^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 + +error[E03008]: too few type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:8:13 + │ +8 │ s2: S<>, + │ ^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 + +error[E03007]: too many type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:9:13 + │ +9 │ s3: S, + │ ^^^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 2 + +error[E03008]: too few type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:13:13 + │ +13 │ s1: S, + │ ^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 + +error[E03008]: too few type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:14:13 + │ +14 │ s2: S<>, + │ ^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 + +error[E03007]: too many type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:15:13 + │ +15 │ s3: S, + │ ^^^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 2 + +error[E03007]: too many type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:16:15 + │ +16 │ s4: S> + │ ^^^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 2 + +error[E03008]: too few type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:17:9 + │ +17 │ ): (S, S<>, S, S>) { + │ ^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 + +error[E03008]: too few type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:17:12 + │ +17 │ ): (S, S<>, S, S>) { + │ ^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 + +error[E03007]: too many type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:17:17 + │ +17 │ ): (S, S<>, S, S>) { + │ ^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 2 + +error[E03007]: too many type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:17:36 + │ +17 │ ): (S, S<>, S, S>) { + │ ^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 2 + +error[E03008]: too few type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_struct.move:27:21 + │ +27 │ fun s(f: T): S { + │ ^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct_pack.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct_pack.exp deleted file mode 100644 index cbc2d0ffca1dc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct_pack.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E03008]: too few type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_struct_pack.move:7:9 - │ -7 │ S<> { f: 0 }; - │ ^^^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 - -error[E03007]: too many type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_struct_pack.move:8:9 - │ -8 │ S { f: 0 }; - │ ^^^^^^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 2 - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct_pack.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct_pack.snap new file mode 100644 index 0000000000000..dd6c348778b1d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct_pack.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct_pack.move +--- +error[E03008]: too few type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_struct_pack.move:7:9 + │ +7 │ S<> { f: 0 }; + │ ^^^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 + +error[E03007]: too many type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_struct_pack.move:8:9 + │ +8 │ S { f: 0 }; + │ ^^^^^^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 2 diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct_unpack.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct_unpack.exp deleted file mode 100644 index 3cdf7b8bc54f5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct_unpack.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E03008]: too few type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_struct_unpack.move:7:13 - │ -7 │ let S<> { f } = copy s; - │ ^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 - -error[E03007]: too many type arguments - ┌─ tests/move_check/typing/bad_type_argument_arity_struct_unpack.move:9:13 - │ -9 │ let S { f } = copy s; - │ ^^^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 2 - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct_unpack.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct_unpack.snap new file mode 100644 index 0000000000000..20f2feaadb4fb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct_unpack.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/bad_type_argument_arity_struct_unpack.move +--- +error[E03008]: too few type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_struct_unpack.move:7:13 + │ +7 │ let S<> { f } = copy s; + │ ^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 0 + +error[E03007]: too many type arguments + ┌─ tests/move_check/typing/bad_type_argument_arity_struct_unpack.move:9:13 + │ +9 │ let S { f } = copy s; + │ ^^^^^^^^^^^^^^^^^ Invalid instantiation of '0x42::M::S'. Expected 1 type argument(s) but got 2 diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_add.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_add.snap new file mode 100644 index 0000000000000..254064b17eac2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_add.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_add.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_add_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_add_invalid.exp deleted file mode 100644 index 8eabd8dfe611c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_add_invalid.exp +++ /dev/null @@ -1,230 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_add_invalid.move:8:9 - │ -8 │ false + true; - │ ^^^^^ - │ │ - │ Invalid argument to '+' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_add_invalid.move:8:17 - │ -8 │ false + true; - │ ----- ^^^^ Invalid argument to '+' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_add_invalid.move:9:11 - │ -9 │ 1 + false; - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '+' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_add_invalid.move:10:9 - │ -10 │ false + 1; - │ ^^^^^ - │ │ - │ Invalid argument to '+' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_add_invalid.move:10:15 - │ -10 │ false + 1; - │ ----- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '+' - │ Found: 'bool'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_add_invalid.move:10:17 - │ -10 │ false + 1; - │ ----- ^ Invalid argument to '+' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_add_invalid.move:11:9 - │ -11 │ @0x0 + @0x1; - │ ^^^^ - │ │ - │ Invalid argument to '+' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_add_invalid.move:11:16 - │ -11 │ @0x0 + @0x1; - │ ---- ^^^^ Invalid argument to '+' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_add_invalid.move:12:17 - │ -12 │ (0: u8) + (1: u128); - │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '+' - │ Found: 'u8'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_add_invalid.move:13:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r + r; - │ ^ Invalid argument to '+' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/binary_add_invalid.move:13:9 - │ - 3 │ struct R { - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · - 7 │ fun t0(r: R, s: S) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' - · -13 │ r + r; - │ ^^^^^ Cannot ignore values without the 'drop' ability. The value must be used - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_add_invalid.move:13:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r + r; - │ ^ Invalid argument to '+' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_add_invalid.move:14:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s + s; - │ ^ Invalid argument to '+' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_add_invalid.move:14:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s + s; - │ ^ Invalid argument to '+' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_add_invalid.move:15:9 - │ -15 │ 1 + false + @0x0 + 0; - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ Invalid argument to '+' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_add_invalid.move:15:11 - │ -15 │ 1 + false + @0x0 + 0; - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '+' - │ Found: integer. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_add_invalid.move:15:26 - │ -15 │ 1 + false + @0x0 + 0; - │ ---- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '+' - │ Found: 'address'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_add_invalid.move:15:28 - │ -15 │ 1 + false + @0x0 + 0; - │ ---- ^ Invalid argument to '+' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_add_invalid.move:16:9 - │ -16 │ () + (); - │ ^^ - │ │ - │ Invalid argument to '+' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_add_invalid.move:16:14 - │ -16 │ () + (); - │ -- ^^ Invalid argument to '+' - │ │ - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_add_invalid.move:17:11 - │ -17 │ 1 + (); - │ - ^ -- Found: '()'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '+' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_add_invalid.move:18:9 - │ -18 │ (0, 1) + (0, 1, 2); - │ ^^^^^^ - │ │ - │ Invalid argument to '+' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_add_invalid.move:18:16 - │ -18 │ (0, 1) + (0, 1, 2); - │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - │ │ │ - │ │ Incompatible arguments to '+' - │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_add_invalid.move:18:18 - │ -18 │ (0, 1) + (0, 1, 2); - │ ------ ^^^^^^^^^ Invalid argument to '+' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_add_invalid.move:19:9 - │ -19 │ (1, 2) + (0, 1); - │ ^^^^^^ - │ │ - │ Invalid argument to '+' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_add_invalid.move:19:18 - │ -19 │ (1, 2) + (0, 1); - │ ------ ^^^^^^ Invalid argument to '+' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_add_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_add_invalid.snap new file mode 100644 index 0000000000000..d98c6edbad577 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_add_invalid.snap @@ -0,0 +1,237 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_add_invalid.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_add_invalid.move:8:9 + │ +8 │ false + true; + │ ^^^^^ + │ │ + │ Invalid argument to '+' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_add_invalid.move:8:17 + │ +8 │ false + true; + │ ----- ^^^^ Invalid argument to '+' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_add_invalid.move:9:11 + │ +9 │ 1 + false; + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '+' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_add_invalid.move:10:9 + │ +10 │ false + 1; + │ ^^^^^ + │ │ + │ Invalid argument to '+' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_add_invalid.move:10:15 + │ +10 │ false + 1; + │ ----- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '+' + │ Found: 'bool'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_add_invalid.move:10:17 + │ +10 │ false + 1; + │ ----- ^ Invalid argument to '+' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_add_invalid.move:11:9 + │ +11 │ @0x0 + @0x1; + │ ^^^^ + │ │ + │ Invalid argument to '+' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_add_invalid.move:11:16 + │ +11 │ @0x0 + @0x1; + │ ---- ^^^^ Invalid argument to '+' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_add_invalid.move:12:17 + │ +12 │ (0: u8) + (1: u128); + │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '+' + │ Found: 'u8'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_add_invalid.move:13:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r + r; + │ ^ Invalid argument to '+' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/binary_add_invalid.move:13:9 + │ + 3 │ struct R { + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · + 7 │ fun t0(r: R, s: S) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' + · +13 │ r + r; + │ ^^^^^ Cannot ignore values without the 'drop' ability. The value must be used + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_add_invalid.move:13:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r + r; + │ ^ Invalid argument to '+' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_add_invalid.move:14:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s + s; + │ ^ Invalid argument to '+' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_add_invalid.move:14:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s + s; + │ ^ Invalid argument to '+' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_add_invalid.move:15:9 + │ +15 │ 1 + false + @0x0 + 0; + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ Invalid argument to '+' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_add_invalid.move:15:11 + │ +15 │ 1 + false + @0x0 + 0; + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '+' + │ Found: integer. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_add_invalid.move:15:26 + │ +15 │ 1 + false + @0x0 + 0; + │ ---- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '+' + │ Found: 'address'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_add_invalid.move:15:28 + │ +15 │ 1 + false + @0x0 + 0; + │ ---- ^ Invalid argument to '+' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_add_invalid.move:16:9 + │ +16 │ () + (); + │ ^^ + │ │ + │ Invalid argument to '+' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_add_invalid.move:16:14 + │ +16 │ () + (); + │ -- ^^ Invalid argument to '+' + │ │ + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_add_invalid.move:17:11 + │ +17 │ 1 + (); + │ - ^ -- Found: '()'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '+' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_add_invalid.move:18:9 + │ +18 │ (0, 1) + (0, 1, 2); + │ ^^^^^^ + │ │ + │ Invalid argument to '+' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_add_invalid.move:18:16 + │ +18 │ (0, 1) + (0, 1, 2); + │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + │ │ │ + │ │ Incompatible arguments to '+' + │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_add_invalid.move:18:18 + │ +18 │ (0, 1) + (0, 1, 2); + │ ------ ^^^^^^^^^ Invalid argument to '+' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_add_invalid.move:19:9 + │ +19 │ (1, 2) + (0, 1); + │ ^^^^^^ + │ │ + │ Invalid argument to '+' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_add_invalid.move:19:18 + │ +19 │ (1, 2) + (0, 1); + │ ------ ^^^^^^ Invalid argument to '+' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_and.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_and.snap new file mode 100644 index 0000000000000..894aa4fedb133 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_and.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_and.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_and_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_and_invalid.exp deleted file mode 100644 index 602a00fa3f548..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_and_invalid.exp +++ /dev/null @@ -1,187 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:8:9 - │ -8 │ 0 && 1; - │ ^ -- Expected: 'bool' - │ │ - │ Invalid argument to '&&' - │ Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:8:14 - │ -8 │ 0 && 1; - │ -- ^ - │ │ │ - │ │ Invalid argument to '&&' - │ │ Given: integer - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:9:9 - │ -9 │ 1 && false; - │ ^ -- Expected: 'bool' - │ │ - │ Invalid argument to '&&' - │ Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:10:18 - │ -10 │ false && 1; - │ -- ^ - │ │ │ - │ │ Invalid argument to '&&' - │ │ Given: integer - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:11:9 - │ -11 │ @0x0 && @0x1; - │ ^^^^ -- Expected: 'bool' - │ │ - │ Invalid argument to '&&' - │ Given: 'address' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:11:17 - │ -11 │ @0x0 && @0x1; - │ -- ^^^^ - │ │ │ - │ │ Invalid argument to '&&' - │ │ Given: 'address' - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:12:9 - │ -12 │ (0: u8) && (1: u128); - │ ^^^^^^^ -- Expected: 'bool' - │ │ │ - │ │ Given: 'u8' - │ Invalid argument to '&&' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:12:20 - │ -12 │ (0: u8) && (1: u128); - │ -- ^^^^^^^^^ - │ │ │ │ - │ │ │ Given: 'u128' - │ │ Invalid argument to '&&' - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:13:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Given: '0x8675309::M::R' - · -13 │ r && r; - │ ^ -- Expected: 'bool' - │ │ - │ Invalid argument to '&&' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:13:14 - │ - 7 │ fun t0(r: R, s: S) { - │ - Given: '0x8675309::M::R' - · -13 │ r && r; - │ -- ^ Invalid argument to '&&' - │ │ - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:14:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Given: '0x8675309::M::S' - · -14 │ s && s; - │ ^ -- Expected: 'bool' - │ │ - │ Invalid argument to '&&' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:14:14 - │ - 7 │ fun t0(r: R, s: S) { - │ - Given: '0x8675309::M::S' - · -14 │ s && s; - │ -- ^ Invalid argument to '&&' - │ │ - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:15:9 - │ -15 │ () && (); - │ ^^ -- Expected: 'bool' - │ │ - │ Invalid argument to '&&' - │ Given: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:15:15 - │ -15 │ () && (); - │ -- ^^ - │ │ │ - │ │ Invalid argument to '&&' - │ │ Given: '()' - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:16:17 - │ -16 │ true && (); - │ -- ^^ - │ │ │ - │ │ Invalid argument to '&&' - │ │ Given: '()' - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:17:9 - │ -17 │ (true, false) && (true, false, true); - │ ^^^^^^^^^^^^^ -- Expected: 'bool' - │ │ - │ Invalid argument to '&&' - │ Given: '(bool, bool)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:17:26 - │ -17 │ (true, false) && (true, false, true); - │ -- ^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Invalid argument to '&&' - │ │ Given: '(bool, bool, bool)' - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:18:9 - │ -18 │ (true, true) && (false, false); - │ ^^^^^^^^^^^^ -- Expected: 'bool' - │ │ - │ Invalid argument to '&&' - │ Given: '(bool, bool)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_and_invalid.move:18:25 - │ -18 │ (true, true) && (false, false); - │ -- ^^^^^^^^^^^^^^ - │ │ │ - │ │ Invalid argument to '&&' - │ │ Given: '(bool, bool)' - │ Expected: 'bool' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_and_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_and_invalid.snap new file mode 100644 index 0000000000000..944d0c959bf01 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_and_invalid.snap @@ -0,0 +1,194 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_and_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:8:9 + │ +8 │ 0 && 1; + │ ^ -- Expected: 'bool' + │ │ + │ Invalid argument to '&&' + │ Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:8:14 + │ +8 │ 0 && 1; + │ -- ^ + │ │ │ + │ │ Invalid argument to '&&' + │ │ Given: integer + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:9:9 + │ +9 │ 1 && false; + │ ^ -- Expected: 'bool' + │ │ + │ Invalid argument to '&&' + │ Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:10:18 + │ +10 │ false && 1; + │ -- ^ + │ │ │ + │ │ Invalid argument to '&&' + │ │ Given: integer + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:11:9 + │ +11 │ @0x0 && @0x1; + │ ^^^^ -- Expected: 'bool' + │ │ + │ Invalid argument to '&&' + │ Given: 'address' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:11:17 + │ +11 │ @0x0 && @0x1; + │ -- ^^^^ + │ │ │ + │ │ Invalid argument to '&&' + │ │ Given: 'address' + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:12:9 + │ +12 │ (0: u8) && (1: u128); + │ ^^^^^^^ -- Expected: 'bool' + │ │ │ + │ │ Given: 'u8' + │ Invalid argument to '&&' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:12:20 + │ +12 │ (0: u8) && (1: u128); + │ -- ^^^^^^^^^ + │ │ │ │ + │ │ │ Given: 'u128' + │ │ Invalid argument to '&&' + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:13:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Given: '0x8675309::M::R' + · +13 │ r && r; + │ ^ -- Expected: 'bool' + │ │ + │ Invalid argument to '&&' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:13:14 + │ + 7 │ fun t0(r: R, s: S) { + │ - Given: '0x8675309::M::R' + · +13 │ r && r; + │ -- ^ Invalid argument to '&&' + │ │ + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:14:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Given: '0x8675309::M::S' + · +14 │ s && s; + │ ^ -- Expected: 'bool' + │ │ + │ Invalid argument to '&&' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:14:14 + │ + 7 │ fun t0(r: R, s: S) { + │ - Given: '0x8675309::M::S' + · +14 │ s && s; + │ -- ^ Invalid argument to '&&' + │ │ + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:15:9 + │ +15 │ () && (); + │ ^^ -- Expected: 'bool' + │ │ + │ Invalid argument to '&&' + │ Given: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:15:15 + │ +15 │ () && (); + │ -- ^^ + │ │ │ + │ │ Invalid argument to '&&' + │ │ Given: '()' + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:16:17 + │ +16 │ true && (); + │ -- ^^ + │ │ │ + │ │ Invalid argument to '&&' + │ │ Given: '()' + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:17:9 + │ +17 │ (true, false) && (true, false, true); + │ ^^^^^^^^^^^^^ -- Expected: 'bool' + │ │ + │ Invalid argument to '&&' + │ Given: '(bool, bool)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:17:26 + │ +17 │ (true, false) && (true, false, true); + │ -- ^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Invalid argument to '&&' + │ │ Given: '(bool, bool, bool)' + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:18:9 + │ +18 │ (true, true) && (false, false); + │ ^^^^^^^^^^^^ -- Expected: 'bool' + │ │ + │ Invalid argument to '&&' + │ Given: '(bool, bool)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_and_invalid.move:18:25 + │ +18 │ (true, true) && (false, false); + │ -- ^^^^^^^^^^^^^^ + │ │ │ + │ │ Invalid argument to '&&' + │ │ Given: '(bool, bool)' + │ Expected: 'bool' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_and.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_and.snap new file mode 100644 index 0000000000000..12b7b8879232e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_and.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_bit_and.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_and_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_and_invalid.exp deleted file mode 100644 index 3db8b345e544e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_and_invalid.exp +++ /dev/null @@ -1,230 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:8:9 - │ -8 │ false & true; - │ ^^^^^ - │ │ - │ Invalid argument to '&' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:8:17 - │ -8 │ false & true; - │ ----- ^^^^ Invalid argument to '&' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:9:11 - │ -9 │ 1 & false; - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '&' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:10:9 - │ -10 │ false & 1; - │ ^^^^^ - │ │ - │ Invalid argument to '&' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:10:15 - │ -10 │ false & 1; - │ ----- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '&' - │ Found: 'bool'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:10:17 - │ -10 │ false & 1; - │ ----- ^ Invalid argument to '&' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:11:9 - │ -11 │ @0x0 & @0x1; - │ ^^^^ - │ │ - │ Invalid argument to '&' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:11:16 - │ -11 │ @0x0 & @0x1; - │ ---- ^^^^ Invalid argument to '&' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:12:17 - │ -12 │ (0: u8) & (1: u128); - │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '&' - │ Found: 'u8'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:13:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r & r; - │ ^ Invalid argument to '&' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:13:9 - │ - 3 │ struct R { - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · - 7 │ fun t0(r: R, s: S) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' - · -13 │ r & r; - │ ^^^^^ Cannot ignore values without the 'drop' ability. The value must be used - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:13:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r & r; - │ ^ Invalid argument to '&' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:14:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s & s; - │ ^ Invalid argument to '&' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:14:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s & s; - │ ^ Invalid argument to '&' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:15:9 - │ -15 │ 1 & false & @0x0 & 0; - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ Invalid argument to '&' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:15:11 - │ -15 │ 1 & false & @0x0 & 0; - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '&' - │ Found: integer. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:15:26 - │ -15 │ 1 & false & @0x0 & 0; - │ ---- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '&' - │ Found: 'address'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:15:28 - │ -15 │ 1 & false & @0x0 & 0; - │ ---- ^ Invalid argument to '&' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:16:9 - │ -16 │ () & (); - │ ^^ - │ │ - │ Invalid argument to '&' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:16:14 - │ -16 │ () & (); - │ -- ^^ Invalid argument to '&' - │ │ - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:17:11 - │ -17 │ 1 & (); - │ - ^ -- Found: '()'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '&' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:18:9 - │ -18 │ (0, 1) & (0, 1, 2); - │ ^^^^^^ - │ │ - │ Invalid argument to '&' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:18:16 - │ -18 │ (0, 1) & (0, 1, 2); - │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - │ │ │ - │ │ Incompatible arguments to '&' - │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:18:18 - │ -18 │ (0, 1) & (0, 1, 2); - │ ------ ^^^^^^^^^ Invalid argument to '&' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:19:9 - │ -19 │ (1, 2) & (0, 1); - │ ^^^^^^ - │ │ - │ Invalid argument to '&' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_and_invalid.move:19:18 - │ -19 │ (1, 2) & (0, 1); - │ ------ ^^^^^^ Invalid argument to '&' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_and_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_and_invalid.snap new file mode 100644 index 0000000000000..e0fff3b0510c6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_and_invalid.snap @@ -0,0 +1,237 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_bit_and_invalid.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:8:9 + │ +8 │ false & true; + │ ^^^^^ + │ │ + │ Invalid argument to '&' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:8:17 + │ +8 │ false & true; + │ ----- ^^^^ Invalid argument to '&' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:9:11 + │ +9 │ 1 & false; + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '&' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:10:9 + │ +10 │ false & 1; + │ ^^^^^ + │ │ + │ Invalid argument to '&' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:10:15 + │ +10 │ false & 1; + │ ----- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '&' + │ Found: 'bool'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:10:17 + │ +10 │ false & 1; + │ ----- ^ Invalid argument to '&' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:11:9 + │ +11 │ @0x0 & @0x1; + │ ^^^^ + │ │ + │ Invalid argument to '&' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:11:16 + │ +11 │ @0x0 & @0x1; + │ ---- ^^^^ Invalid argument to '&' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:12:17 + │ +12 │ (0: u8) & (1: u128); + │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '&' + │ Found: 'u8'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:13:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r & r; + │ ^ Invalid argument to '&' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:13:9 + │ + 3 │ struct R { + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · + 7 │ fun t0(r: R, s: S) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' + · +13 │ r & r; + │ ^^^^^ Cannot ignore values without the 'drop' ability. The value must be used + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:13:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r & r; + │ ^ Invalid argument to '&' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:14:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s & s; + │ ^ Invalid argument to '&' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:14:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s & s; + │ ^ Invalid argument to '&' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:15:9 + │ +15 │ 1 & false & @0x0 & 0; + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ Invalid argument to '&' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:15:11 + │ +15 │ 1 & false & @0x0 & 0; + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '&' + │ Found: integer. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:15:26 + │ +15 │ 1 & false & @0x0 & 0; + │ ---- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '&' + │ Found: 'address'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:15:28 + │ +15 │ 1 & false & @0x0 & 0; + │ ---- ^ Invalid argument to '&' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:16:9 + │ +16 │ () & (); + │ ^^ + │ │ + │ Invalid argument to '&' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:16:14 + │ +16 │ () & (); + │ -- ^^ Invalid argument to '&' + │ │ + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:17:11 + │ +17 │ 1 & (); + │ - ^ -- Found: '()'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '&' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:18:9 + │ +18 │ (0, 1) & (0, 1, 2); + │ ^^^^^^ + │ │ + │ Invalid argument to '&' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:18:16 + │ +18 │ (0, 1) & (0, 1, 2); + │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + │ │ │ + │ │ Incompatible arguments to '&' + │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:18:18 + │ +18 │ (0, 1) & (0, 1, 2); + │ ------ ^^^^^^^^^ Invalid argument to '&' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:19:9 + │ +19 │ (1, 2) & (0, 1); + │ ^^^^^^ + │ │ + │ Invalid argument to '&' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_and_invalid.move:19:18 + │ +19 │ (1, 2) & (0, 1); + │ ------ ^^^^^^ Invalid argument to '&' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_or.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_or.snap new file mode 100644 index 0000000000000..e42e3a69435ff --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_or.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_bit_or.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_or_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_or_invalid.exp deleted file mode 100644 index 3a6f833149fef..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_or_invalid.exp +++ /dev/null @@ -1,230 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:8:9 - │ -8 │ false | true; - │ ^^^^^ - │ │ - │ Invalid argument to '|' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:8:17 - │ -8 │ false | true; - │ ----- ^^^^ Invalid argument to '|' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:9:11 - │ -9 │ 1 | false; - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '|' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:10:9 - │ -10 │ false | 1; - │ ^^^^^ - │ │ - │ Invalid argument to '|' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:10:15 - │ -10 │ false | 1; - │ ----- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '|' - │ Found: 'bool'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:10:17 - │ -10 │ false | 1; - │ ----- ^ Invalid argument to '|' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:11:9 - │ -11 │ @0x0 | @0x1; - │ ^^^^ - │ │ - │ Invalid argument to '|' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:11:16 - │ -11 │ @0x0 | @0x1; - │ ---- ^^^^ Invalid argument to '|' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:12:17 - │ -12 │ (0: u8) | (1: u128); - │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '|' - │ Found: 'u8'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:13:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r | r; - │ ^ Invalid argument to '|' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:13:9 - │ - 3 │ struct R { - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · - 7 │ fun t0(r: R, s: S) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' - · -13 │ r | r; - │ ^^^^^ Cannot ignore values without the 'drop' ability. The value must be used - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:13:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r | r; - │ ^ Invalid argument to '|' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:14:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s | s; - │ ^ Invalid argument to '|' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:14:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s | s; - │ ^ Invalid argument to '|' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:15:9 - │ -15 │ 1 | false | @0x0 | 0; - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ Invalid argument to '|' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:15:11 - │ -15 │ 1 | false | @0x0 | 0; - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '|' - │ Found: integer. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:15:26 - │ -15 │ 1 | false | @0x0 | 0; - │ ---- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '|' - │ Found: 'address'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:15:28 - │ -15 │ 1 | false | @0x0 | 0; - │ ---- ^ Invalid argument to '|' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:16:9 - │ -16 │ () | (); - │ ^^ - │ │ - │ Invalid argument to '|' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:16:14 - │ -16 │ () | (); - │ -- ^^ Invalid argument to '|' - │ │ - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:17:11 - │ -17 │ 1 | (); - │ - ^ -- Found: '()'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '|' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:18:9 - │ -18 │ (0, 1) | (0, 1, 2); - │ ^^^^^^ - │ │ - │ Invalid argument to '|' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:18:16 - │ -18 │ (0, 1) | (0, 1, 2); - │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - │ │ │ - │ │ Incompatible arguments to '|' - │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:18:18 - │ -18 │ (0, 1) | (0, 1, 2); - │ ------ ^^^^^^^^^ Invalid argument to '|' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:19:9 - │ -19 │ (1, 2) | (0, 1); - │ ^^^^^^ - │ │ - │ Invalid argument to '|' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_or_invalid.move:19:18 - │ -19 │ (1, 2) | (0, 1); - │ ------ ^^^^^^ Invalid argument to '|' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_or_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_or_invalid.snap new file mode 100644 index 0000000000000..68c6a00c95591 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_or_invalid.snap @@ -0,0 +1,237 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_bit_or_invalid.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:8:9 + │ +8 │ false | true; + │ ^^^^^ + │ │ + │ Invalid argument to '|' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:8:17 + │ +8 │ false | true; + │ ----- ^^^^ Invalid argument to '|' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:9:11 + │ +9 │ 1 | false; + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '|' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:10:9 + │ +10 │ false | 1; + │ ^^^^^ + │ │ + │ Invalid argument to '|' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:10:15 + │ +10 │ false | 1; + │ ----- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '|' + │ Found: 'bool'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:10:17 + │ +10 │ false | 1; + │ ----- ^ Invalid argument to '|' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:11:9 + │ +11 │ @0x0 | @0x1; + │ ^^^^ + │ │ + │ Invalid argument to '|' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:11:16 + │ +11 │ @0x0 | @0x1; + │ ---- ^^^^ Invalid argument to '|' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:12:17 + │ +12 │ (0: u8) | (1: u128); + │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '|' + │ Found: 'u8'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:13:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r | r; + │ ^ Invalid argument to '|' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:13:9 + │ + 3 │ struct R { + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · + 7 │ fun t0(r: R, s: S) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' + · +13 │ r | r; + │ ^^^^^ Cannot ignore values without the 'drop' ability. The value must be used + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:13:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r | r; + │ ^ Invalid argument to '|' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:14:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s | s; + │ ^ Invalid argument to '|' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:14:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s | s; + │ ^ Invalid argument to '|' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:15:9 + │ +15 │ 1 | false | @0x0 | 0; + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ Invalid argument to '|' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:15:11 + │ +15 │ 1 | false | @0x0 | 0; + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '|' + │ Found: integer. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:15:26 + │ +15 │ 1 | false | @0x0 | 0; + │ ---- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '|' + │ Found: 'address'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:15:28 + │ +15 │ 1 | false | @0x0 | 0; + │ ---- ^ Invalid argument to '|' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:16:9 + │ +16 │ () | (); + │ ^^ + │ │ + │ Invalid argument to '|' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:16:14 + │ +16 │ () | (); + │ -- ^^ Invalid argument to '|' + │ │ + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:17:11 + │ +17 │ 1 | (); + │ - ^ -- Found: '()'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '|' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:18:9 + │ +18 │ (0, 1) | (0, 1, 2); + │ ^^^^^^ + │ │ + │ Invalid argument to '|' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:18:16 + │ +18 │ (0, 1) | (0, 1, 2); + │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + │ │ │ + │ │ Incompatible arguments to '|' + │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:18:18 + │ +18 │ (0, 1) | (0, 1, 2); + │ ------ ^^^^^^^^^ Invalid argument to '|' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:19:9 + │ +19 │ (1, 2) | (0, 1); + │ ^^^^^^ + │ │ + │ Invalid argument to '|' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_or_invalid.move:19:18 + │ +19 │ (1, 2) | (0, 1); + │ ------ ^^^^^^ Invalid argument to '|' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_xor_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_xor_invalid.exp deleted file mode 100644 index 4b2cc79919b70..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_xor_invalid.exp +++ /dev/null @@ -1,230 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:8:9 - │ -8 │ false ^ true; - │ ^^^^^ - │ │ - │ Invalid argument to '^' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:8:17 - │ -8 │ false ^ true; - │ ----- ^^^^ Invalid argument to '^' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:9:11 - │ -9 │ 1 ^ false; - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '^' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:10:9 - │ -10 │ false ^ 1; - │ ^^^^^ - │ │ - │ Invalid argument to '^' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:10:15 - │ -10 │ false ^ 1; - │ ----- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '^' - │ Found: 'bool'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:10:17 - │ -10 │ false ^ 1; - │ ----- ^ Invalid argument to '^' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:11:9 - │ -11 │ @0x0 ^ @0x1; - │ ^^^^ - │ │ - │ Invalid argument to '^' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:11:16 - │ -11 │ @0x0 ^ @0x1; - │ ---- ^^^^ Invalid argument to '^' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:12:17 - │ -12 │ (0: u8) ^ (1: u128); - │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '^' - │ Found: 'u8'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:13:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r ^ r; - │ ^ Invalid argument to '^' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:13:9 - │ - 3 │ struct R { - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · - 7 │ fun t0(r: R, s: S) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' - · -13 │ r ^ r; - │ ^^^^^ Cannot ignore values without the 'drop' ability. The value must be used - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:13:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r ^ r; - │ ^ Invalid argument to '^' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:14:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s ^ s; - │ ^ Invalid argument to '^' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:14:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s ^ s; - │ ^ Invalid argument to '^' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:15:9 - │ -15 │ 1 ^ false ^ @0x0 ^ 0; - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ Invalid argument to '^' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:15:11 - │ -15 │ 1 ^ false ^ @0x0 ^ 0; - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '^' - │ Found: integer. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:15:26 - │ -15 │ 1 ^ false ^ @0x0 ^ 0; - │ ---- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '^' - │ Found: 'address'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:15:28 - │ -15 │ 1 ^ false ^ @0x0 ^ 0; - │ ---- ^ Invalid argument to '^' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:16:9 - │ -16 │ () ^ (); - │ ^^ - │ │ - │ Invalid argument to '^' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:16:14 - │ -16 │ () ^ (); - │ -- ^^ Invalid argument to '^' - │ │ - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:17:11 - │ -17 │ 1 ^ (); - │ - ^ -- Found: '()'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '^' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:18:9 - │ -18 │ (0, 1) ^ (0, 1, 2); - │ ^^^^^^ - │ │ - │ Invalid argument to '^' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:18:16 - │ -18 │ (0, 1) ^ (0, 1, 2); - │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - │ │ │ - │ │ Incompatible arguments to '^' - │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:18:18 - │ -18 │ (0, 1) ^ (0, 1, 2); - │ ------ ^^^^^^^^^ Invalid argument to '^' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:19:9 - │ -19 │ (1, 2) ^ (0, 1); - │ ^^^^^^ - │ │ - │ Invalid argument to '^' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:19:18 - │ -19 │ (1, 2) ^ (0, 1); - │ ------ ^^^^^^ Invalid argument to '^' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_xor_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_xor_invalid.snap new file mode 100644 index 0000000000000..1e71ede589961 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_bit_xor_invalid.snap @@ -0,0 +1,237 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_bit_xor_invalid.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:8:9 + │ +8 │ false ^ true; + │ ^^^^^ + │ │ + │ Invalid argument to '^' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:8:17 + │ +8 │ false ^ true; + │ ----- ^^^^ Invalid argument to '^' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:9:11 + │ +9 │ 1 ^ false; + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '^' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:10:9 + │ +10 │ false ^ 1; + │ ^^^^^ + │ │ + │ Invalid argument to '^' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:10:15 + │ +10 │ false ^ 1; + │ ----- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '^' + │ Found: 'bool'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:10:17 + │ +10 │ false ^ 1; + │ ----- ^ Invalid argument to '^' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:11:9 + │ +11 │ @0x0 ^ @0x1; + │ ^^^^ + │ │ + │ Invalid argument to '^' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:11:16 + │ +11 │ @0x0 ^ @0x1; + │ ---- ^^^^ Invalid argument to '^' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:12:17 + │ +12 │ (0: u8) ^ (1: u128); + │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '^' + │ Found: 'u8'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:13:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r ^ r; + │ ^ Invalid argument to '^' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:13:9 + │ + 3 │ struct R { + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · + 7 │ fun t0(r: R, s: S) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' + · +13 │ r ^ r; + │ ^^^^^ Cannot ignore values without the 'drop' ability. The value must be used + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:13:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r ^ r; + │ ^ Invalid argument to '^' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:14:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s ^ s; + │ ^ Invalid argument to '^' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:14:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s ^ s; + │ ^ Invalid argument to '^' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:15:9 + │ +15 │ 1 ^ false ^ @0x0 ^ 0; + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ Invalid argument to '^' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:15:11 + │ +15 │ 1 ^ false ^ @0x0 ^ 0; + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '^' + │ Found: integer. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:15:26 + │ +15 │ 1 ^ false ^ @0x0 ^ 0; + │ ---- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '^' + │ Found: 'address'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:15:28 + │ +15 │ 1 ^ false ^ @0x0 ^ 0; + │ ---- ^ Invalid argument to '^' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:16:9 + │ +16 │ () ^ (); + │ ^^ + │ │ + │ Invalid argument to '^' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:16:14 + │ +16 │ () ^ (); + │ -- ^^ Invalid argument to '^' + │ │ + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:17:11 + │ +17 │ 1 ^ (); + │ - ^ -- Found: '()'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '^' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:18:9 + │ +18 │ (0, 1) ^ (0, 1, 2); + │ ^^^^^^ + │ │ + │ Invalid argument to '^' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:18:16 + │ +18 │ (0, 1) ^ (0, 1, 2); + │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + │ │ │ + │ │ Incompatible arguments to '^' + │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:18:18 + │ +18 │ (0, 1) ^ (0, 1, 2); + │ ------ ^^^^^^^^^ Invalid argument to '^' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:19:9 + │ +19 │ (1, 2) ^ (0, 1); + │ ^^^^^^ + │ │ + │ Invalid argument to '^' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_bit_xor_invalid.move:19:18 + │ +19 │ (1, 2) ^ (0, 1); + │ ------ ^^^^^^ Invalid argument to '^' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_div.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_div.snap new file mode 100644 index 0000000000000..54a0d77e0eb1a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_div.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_div.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_div_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_div_invalid.exp deleted file mode 100644 index ac4bf6d559f59..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_div_invalid.exp +++ /dev/null @@ -1,230 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_div_invalid.move:8:9 - │ -8 │ false / true; - │ ^^^^^ - │ │ - │ Invalid argument to '/' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_div_invalid.move:8:17 - │ -8 │ false / true; - │ ----- ^^^^ Invalid argument to '/' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_div_invalid.move:9:11 - │ -9 │ 1 / false; - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '/' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_div_invalid.move:10:9 - │ -10 │ false / 1; - │ ^^^^^ - │ │ - │ Invalid argument to '/' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_div_invalid.move:10:15 - │ -10 │ false / 1; - │ ----- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '/' - │ Found: 'bool'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_div_invalid.move:10:17 - │ -10 │ false / 1; - │ ----- ^ Invalid argument to '/' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_div_invalid.move:11:9 - │ -11 │ @0x0 / @0x1; - │ ^^^^ - │ │ - │ Invalid argument to '/' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_div_invalid.move:11:16 - │ -11 │ @0x0 / @0x1; - │ ---- ^^^^ Invalid argument to '/' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_div_invalid.move:12:17 - │ -12 │ (0: u8) / (1: u128); - │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '/' - │ Found: 'u8'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_div_invalid.move:13:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r / r; - │ ^ Invalid argument to '/' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/binary_div_invalid.move:13:9 - │ - 3 │ struct R { - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · - 7 │ fun t0(r: R, s: S) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' - · -13 │ r / r; - │ ^^^^^ Cannot ignore values without the 'drop' ability. The value must be used - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_div_invalid.move:13:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r / r; - │ ^ Invalid argument to '/' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_div_invalid.move:14:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s / s; - │ ^ Invalid argument to '/' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_div_invalid.move:14:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s / s; - │ ^ Invalid argument to '/' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_div_invalid.move:15:9 - │ -15 │ 1 / false / @0x0 / 0; - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ Invalid argument to '/' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_div_invalid.move:15:11 - │ -15 │ 1 / false / @0x0 / 0; - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '/' - │ Found: integer. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_div_invalid.move:15:26 - │ -15 │ 1 / false / @0x0 / 0; - │ ---- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '/' - │ Found: 'address'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_div_invalid.move:15:28 - │ -15 │ 1 / false / @0x0 / 0; - │ ---- ^ Invalid argument to '/' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_div_invalid.move:16:9 - │ -16 │ () / (); - │ ^^ - │ │ - │ Invalid argument to '/' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_div_invalid.move:16:14 - │ -16 │ () / (); - │ -- ^^ Invalid argument to '/' - │ │ - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_div_invalid.move:17:11 - │ -17 │ 1 / (); - │ - ^ -- Found: '()'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '/' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_div_invalid.move:18:9 - │ -18 │ (0, 1) / (0, 1, 2); - │ ^^^^^^ - │ │ - │ Invalid argument to '/' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_div_invalid.move:18:16 - │ -18 │ (0, 1) / (0, 1, 2); - │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - │ │ │ - │ │ Incompatible arguments to '/' - │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_div_invalid.move:18:18 - │ -18 │ (0, 1) / (0, 1, 2); - │ ------ ^^^^^^^^^ Invalid argument to '/' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_div_invalid.move:19:9 - │ -19 │ (1, 2) / (0, 1); - │ ^^^^^^ - │ │ - │ Invalid argument to '/' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_div_invalid.move:19:18 - │ -19 │ (1, 2) / (0, 1); - │ ------ ^^^^^^ Invalid argument to '/' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_div_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_div_invalid.snap new file mode 100644 index 0000000000000..913938ac8a8f5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_div_invalid.snap @@ -0,0 +1,237 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_div_invalid.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_div_invalid.move:8:9 + │ +8 │ false / true; + │ ^^^^^ + │ │ + │ Invalid argument to '/' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_div_invalid.move:8:17 + │ +8 │ false / true; + │ ----- ^^^^ Invalid argument to '/' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_div_invalid.move:9:11 + │ +9 │ 1 / false; + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '/' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_div_invalid.move:10:9 + │ +10 │ false / 1; + │ ^^^^^ + │ │ + │ Invalid argument to '/' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_div_invalid.move:10:15 + │ +10 │ false / 1; + │ ----- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '/' + │ Found: 'bool'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_div_invalid.move:10:17 + │ +10 │ false / 1; + │ ----- ^ Invalid argument to '/' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_div_invalid.move:11:9 + │ +11 │ @0x0 / @0x1; + │ ^^^^ + │ │ + │ Invalid argument to '/' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_div_invalid.move:11:16 + │ +11 │ @0x0 / @0x1; + │ ---- ^^^^ Invalid argument to '/' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_div_invalid.move:12:17 + │ +12 │ (0: u8) / (1: u128); + │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '/' + │ Found: 'u8'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_div_invalid.move:13:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r / r; + │ ^ Invalid argument to '/' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/binary_div_invalid.move:13:9 + │ + 3 │ struct R { + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · + 7 │ fun t0(r: R, s: S) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' + · +13 │ r / r; + │ ^^^^^ Cannot ignore values without the 'drop' ability. The value must be used + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_div_invalid.move:13:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r / r; + │ ^ Invalid argument to '/' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_div_invalid.move:14:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s / s; + │ ^ Invalid argument to '/' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_div_invalid.move:14:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s / s; + │ ^ Invalid argument to '/' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_div_invalid.move:15:9 + │ +15 │ 1 / false / @0x0 / 0; + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ Invalid argument to '/' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_div_invalid.move:15:11 + │ +15 │ 1 / false / @0x0 / 0; + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '/' + │ Found: integer. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_div_invalid.move:15:26 + │ +15 │ 1 / false / @0x0 / 0; + │ ---- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '/' + │ Found: 'address'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_div_invalid.move:15:28 + │ +15 │ 1 / false / @0x0 / 0; + │ ---- ^ Invalid argument to '/' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_div_invalid.move:16:9 + │ +16 │ () / (); + │ ^^ + │ │ + │ Invalid argument to '/' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_div_invalid.move:16:14 + │ +16 │ () / (); + │ -- ^^ Invalid argument to '/' + │ │ + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_div_invalid.move:17:11 + │ +17 │ 1 / (); + │ - ^ -- Found: '()'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '/' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_div_invalid.move:18:9 + │ +18 │ (0, 1) / (0, 1, 2); + │ ^^^^^^ + │ │ + │ Invalid argument to '/' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_div_invalid.move:18:16 + │ +18 │ (0, 1) / (0, 1, 2); + │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + │ │ │ + │ │ Incompatible arguments to '/' + │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_div_invalid.move:18:18 + │ +18 │ (0, 1) / (0, 1, 2); + │ ------ ^^^^^^^^^ Invalid argument to '/' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_div_invalid.move:19:9 + │ +19 │ (1, 2) / (0, 1); + │ ^^^^^^ + │ │ + │ Invalid argument to '/' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_div_invalid.move:19:18 + │ +19 │ (1, 2) / (0, 1); + │ ------ ^^^^^^ Invalid argument to '/' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_geq.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_geq.snap new file mode 100644 index 0000000000000..d7e86056d10cc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_geq.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_geq.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_geq_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_geq_invalid.exp deleted file mode 100644 index add1044056ab8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_geq_invalid.exp +++ /dev/null @@ -1,244 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:8:9 - │ -8 │ false >= true; - │ ^^^^^ - │ │ - │ Invalid argument to '>=' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:8:18 - │ -8 │ false >= true; - │ ----- ^^^^ Invalid argument to '>=' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_geq_invalid.move:9:11 - │ -9 │ 1 >= false; - │ - ^^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '>=' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:10:9 - │ -10 │ false >= 1; - │ ^^^^^ - │ │ - │ Invalid argument to '>=' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_geq_invalid.move:10:15 - │ -10 │ false >= 1; - │ ----- ^^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '>=' - │ Found: 'bool'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:10:18 - │ -10 │ false >= 1; - │ ----- ^ Invalid argument to '>=' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:11:9 - │ -11 │ @0x0 >= @0x1; - │ ^^^^ - │ │ - │ Invalid argument to '>=' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:11:17 - │ -11 │ @0x0 >= @0x1; - │ ---- ^^^^ Invalid argument to '>=' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_geq_invalid.move:12:17 - │ -12 │ (0: u8) >= (1: u128); - │ -- ^^ ---- Found: 'u128'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '>=' - │ Found: 'u8'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:13:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r >= r; - │ ^ Invalid argument to '>=' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:13:14 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r >= r; - │ ^ Invalid argument to '>=' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:14:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s >= s; - │ ^ Invalid argument to '>=' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:14:14 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s >= s; - │ ^ Invalid argument to '>=' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:15:9 - │ -15 │ 0 >= 1 >= 2; - │ ^^^^^^ - │ │ - │ Invalid argument to '>=' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_geq_invalid.move:15:16 - │ -15 │ 0 >= 1 >= 2; - │ ------ ^^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '>=' - │ Found: 'bool'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:15:19 - │ -15 │ 0 >= 1 >= 2; - │ ------ ^ Invalid argument to '>=' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_geq_invalid.move:16:12 - │ -16 │ (1 >= false) && (@0x0 >= 0); - │ - ^^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '>=' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:16:26 - │ -16 │ (1 >= false) && (@0x0 >= 0); - │ ^^^^ - │ │ - │ Invalid argument to '>=' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_geq_invalid.move:16:31 - │ -16 │ (1 >= false) && (@0x0 >= 0); - │ ---- ^^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '>=' - │ Found: 'address'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:16:34 - │ -16 │ (1 >= false) && (@0x0 >= 0); - │ ---- ^ Invalid argument to '>=' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:17:9 - │ -17 │ () >= (); - │ ^^ - │ │ - │ Invalid argument to '>=' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:17:15 - │ -17 │ () >= (); - │ -- ^^ Invalid argument to '>=' - │ │ - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_geq_invalid.move:18:11 - │ -18 │ 1 >= (); - │ - ^^ -- Found: '()'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '>=' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:19:9 - │ -19 │ (0, 1) >= (0, 1, 2); - │ ^^^^^^ - │ │ - │ Invalid argument to '>=' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_geq_invalid.move:19:16 - │ -19 │ (0, 1) >= (0, 1, 2); - │ ------ ^^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - │ │ │ - │ │ Incompatible arguments to '>=' - │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:19:19 - │ -19 │ (0, 1) >= (0, 1, 2); - │ ------ ^^^^^^^^^ Invalid argument to '>=' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:20:9 - │ -20 │ (1, 2) >= (0, 1); - │ ^^^^^^ - │ │ - │ Invalid argument to '>=' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_geq_invalid.move:20:19 - │ -20 │ (1, 2) >= (0, 1); - │ ------ ^^^^^^ Invalid argument to '>=' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_geq_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_geq_invalid.snap new file mode 100644 index 0000000000000..ef50520263cdb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_geq_invalid.snap @@ -0,0 +1,251 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_geq_invalid.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:8:9 + │ +8 │ false >= true; + │ ^^^^^ + │ │ + │ Invalid argument to '>=' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:8:18 + │ +8 │ false >= true; + │ ----- ^^^^ Invalid argument to '>=' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_geq_invalid.move:9:11 + │ +9 │ 1 >= false; + │ - ^^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '>=' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:10:9 + │ +10 │ false >= 1; + │ ^^^^^ + │ │ + │ Invalid argument to '>=' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_geq_invalid.move:10:15 + │ +10 │ false >= 1; + │ ----- ^^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '>=' + │ Found: 'bool'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:10:18 + │ +10 │ false >= 1; + │ ----- ^ Invalid argument to '>=' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:11:9 + │ +11 │ @0x0 >= @0x1; + │ ^^^^ + │ │ + │ Invalid argument to '>=' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:11:17 + │ +11 │ @0x0 >= @0x1; + │ ---- ^^^^ Invalid argument to '>=' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_geq_invalid.move:12:17 + │ +12 │ (0: u8) >= (1: u128); + │ -- ^^ ---- Found: 'u128'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '>=' + │ Found: 'u8'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:13:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r >= r; + │ ^ Invalid argument to '>=' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:13:14 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r >= r; + │ ^ Invalid argument to '>=' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:14:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s >= s; + │ ^ Invalid argument to '>=' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:14:14 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s >= s; + │ ^ Invalid argument to '>=' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:15:9 + │ +15 │ 0 >= 1 >= 2; + │ ^^^^^^ + │ │ + │ Invalid argument to '>=' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_geq_invalid.move:15:16 + │ +15 │ 0 >= 1 >= 2; + │ ------ ^^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '>=' + │ Found: 'bool'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:15:19 + │ +15 │ 0 >= 1 >= 2; + │ ------ ^ Invalid argument to '>=' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_geq_invalid.move:16:12 + │ +16 │ (1 >= false) && (@0x0 >= 0); + │ - ^^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '>=' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:16:26 + │ +16 │ (1 >= false) && (@0x0 >= 0); + │ ^^^^ + │ │ + │ Invalid argument to '>=' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_geq_invalid.move:16:31 + │ +16 │ (1 >= false) && (@0x0 >= 0); + │ ---- ^^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '>=' + │ Found: 'address'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:16:34 + │ +16 │ (1 >= false) && (@0x0 >= 0); + │ ---- ^ Invalid argument to '>=' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:17:9 + │ +17 │ () >= (); + │ ^^ + │ │ + │ Invalid argument to '>=' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:17:15 + │ +17 │ () >= (); + │ -- ^^ Invalid argument to '>=' + │ │ + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_geq_invalid.move:18:11 + │ +18 │ 1 >= (); + │ - ^^ -- Found: '()'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '>=' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:19:9 + │ +19 │ (0, 1) >= (0, 1, 2); + │ ^^^^^^ + │ │ + │ Invalid argument to '>=' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_geq_invalid.move:19:16 + │ +19 │ (0, 1) >= (0, 1, 2); + │ ------ ^^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + │ │ │ + │ │ Incompatible arguments to '>=' + │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:19:19 + │ +19 │ (0, 1) >= (0, 1, 2); + │ ------ ^^^^^^^^^ Invalid argument to '>=' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:20:9 + │ +20 │ (1, 2) >= (0, 1); + │ ^^^^^^ + │ │ + │ Invalid argument to '>=' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_geq_invalid.move:20:19 + │ +20 │ (1, 2) >= (0, 1); + │ ------ ^^^^^^ Invalid argument to '>=' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_gt.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_gt.snap new file mode 100644 index 0000000000000..9e1c7da1cfd47 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_gt.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_gt.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_gt_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_gt_invalid.exp deleted file mode 100644 index cb623d10bf2ae..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_gt_invalid.exp +++ /dev/null @@ -1,244 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:8:9 - │ -8 │ false > true; - │ ^^^^^ - │ │ - │ Invalid argument to '>' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:8:17 - │ -8 │ false > true; - │ ----- ^^^^ Invalid argument to '>' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_gt_invalid.move:9:11 - │ -9 │ 1 > false; - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '>' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:10:9 - │ -10 │ false > 1; - │ ^^^^^ - │ │ - │ Invalid argument to '>' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_gt_invalid.move:10:15 - │ -10 │ false > 1; - │ ----- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '>' - │ Found: 'bool'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:10:17 - │ -10 │ false > 1; - │ ----- ^ Invalid argument to '>' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:11:9 - │ -11 │ @0x0 > @0x1; - │ ^^^^ - │ │ - │ Invalid argument to '>' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:11:16 - │ -11 │ @0x0 > @0x1; - │ ---- ^^^^ Invalid argument to '>' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_gt_invalid.move:12:17 - │ -12 │ (0: u8) > (1: u128); - │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '>' - │ Found: 'u8'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:13:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r > r; - │ ^ Invalid argument to '>' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:13:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r > r; - │ ^ Invalid argument to '>' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:14:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s > s; - │ ^ Invalid argument to '>' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:14:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s > s; - │ ^ Invalid argument to '>' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:15:9 - │ -15 │ 0 > 1 > 2; - │ ^^^^^ - │ │ - │ Invalid argument to '>' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_gt_invalid.move:15:15 - │ -15 │ 0 > 1 > 2; - │ ----- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '>' - │ Found: 'bool'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:15:17 - │ -15 │ 0 > 1 > 2; - │ ----- ^ Invalid argument to '>' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_gt_invalid.move:16:12 - │ -16 │ (1 > false) && (@0x0 > 0); - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '>' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:16:25 - │ -16 │ (1 > false) && (@0x0 > 0); - │ ^^^^ - │ │ - │ Invalid argument to '>' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_gt_invalid.move:16:30 - │ -16 │ (1 > false) && (@0x0 > 0); - │ ---- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '>' - │ Found: 'address'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:16:32 - │ -16 │ (1 > false) && (@0x0 > 0); - │ ---- ^ Invalid argument to '>' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:17:9 - │ -17 │ () > (); - │ ^^ - │ │ - │ Invalid argument to '>' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:17:14 - │ -17 │ () > (); - │ -- ^^ Invalid argument to '>' - │ │ - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_gt_invalid.move:18:11 - │ -18 │ 1 > (); - │ - ^ -- Found: '()'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '>' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:19:9 - │ -19 │ (0, 1) > (0, 1, 2); - │ ^^^^^^ - │ │ - │ Invalid argument to '>' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_gt_invalid.move:19:16 - │ -19 │ (0, 1) > (0, 1, 2); - │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - │ │ │ - │ │ Incompatible arguments to '>' - │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:19:18 - │ -19 │ (0, 1) > (0, 1, 2); - │ ------ ^^^^^^^^^ Invalid argument to '>' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:20:9 - │ -20 │ (1, 2) > (0, 1); - │ ^^^^^^ - │ │ - │ Invalid argument to '>' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_gt_invalid.move:20:18 - │ -20 │ (1, 2) > (0, 1); - │ ------ ^^^^^^ Invalid argument to '>' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_gt_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_gt_invalid.snap new file mode 100644 index 0000000000000..742673a77318d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_gt_invalid.snap @@ -0,0 +1,251 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_gt_invalid.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:8:9 + │ +8 │ false > true; + │ ^^^^^ + │ │ + │ Invalid argument to '>' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:8:17 + │ +8 │ false > true; + │ ----- ^^^^ Invalid argument to '>' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_gt_invalid.move:9:11 + │ +9 │ 1 > false; + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '>' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:10:9 + │ +10 │ false > 1; + │ ^^^^^ + │ │ + │ Invalid argument to '>' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_gt_invalid.move:10:15 + │ +10 │ false > 1; + │ ----- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '>' + │ Found: 'bool'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:10:17 + │ +10 │ false > 1; + │ ----- ^ Invalid argument to '>' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:11:9 + │ +11 │ @0x0 > @0x1; + │ ^^^^ + │ │ + │ Invalid argument to '>' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:11:16 + │ +11 │ @0x0 > @0x1; + │ ---- ^^^^ Invalid argument to '>' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_gt_invalid.move:12:17 + │ +12 │ (0: u8) > (1: u128); + │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '>' + │ Found: 'u8'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:13:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r > r; + │ ^ Invalid argument to '>' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:13:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r > r; + │ ^ Invalid argument to '>' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:14:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s > s; + │ ^ Invalid argument to '>' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:14:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s > s; + │ ^ Invalid argument to '>' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:15:9 + │ +15 │ 0 > 1 > 2; + │ ^^^^^ + │ │ + │ Invalid argument to '>' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_gt_invalid.move:15:15 + │ +15 │ 0 > 1 > 2; + │ ----- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '>' + │ Found: 'bool'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:15:17 + │ +15 │ 0 > 1 > 2; + │ ----- ^ Invalid argument to '>' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_gt_invalid.move:16:12 + │ +16 │ (1 > false) && (@0x0 > 0); + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '>' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:16:25 + │ +16 │ (1 > false) && (@0x0 > 0); + │ ^^^^ + │ │ + │ Invalid argument to '>' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_gt_invalid.move:16:30 + │ +16 │ (1 > false) && (@0x0 > 0); + │ ---- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '>' + │ Found: 'address'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:16:32 + │ +16 │ (1 > false) && (@0x0 > 0); + │ ---- ^ Invalid argument to '>' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:17:9 + │ +17 │ () > (); + │ ^^ + │ │ + │ Invalid argument to '>' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:17:14 + │ +17 │ () > (); + │ -- ^^ Invalid argument to '>' + │ │ + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_gt_invalid.move:18:11 + │ +18 │ 1 > (); + │ - ^ -- Found: '()'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '>' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:19:9 + │ +19 │ (0, 1) > (0, 1, 2); + │ ^^^^^^ + │ │ + │ Invalid argument to '>' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_gt_invalid.move:19:16 + │ +19 │ (0, 1) > (0, 1, 2); + │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + │ │ │ + │ │ Incompatible arguments to '>' + │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:19:18 + │ +19 │ (0, 1) > (0, 1, 2); + │ ------ ^^^^^^^^^ Invalid argument to '>' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:20:9 + │ +20 │ (1, 2) > (0, 1); + │ ^^^^^^ + │ │ + │ Invalid argument to '>' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_gt_invalid.move:20:18 + │ +20 │ (1, 2) > (0, 1); + │ ------ ^^^^^^ Invalid argument to '>' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_leq.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_leq.snap new file mode 100644 index 0000000000000..e59397c034502 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_leq.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_leq.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_leq_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_leq_invalid.exp deleted file mode 100644 index 1296f90f8a1e6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_leq_invalid.exp +++ /dev/null @@ -1,244 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:8:9 - │ -8 │ false <= true; - │ ^^^^^ - │ │ - │ Invalid argument to '<=' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:8:18 - │ -8 │ false <= true; - │ ----- ^^^^ Invalid argument to '<=' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_leq_invalid.move:9:11 - │ -9 │ 1 <= false; - │ - ^^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '<=' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:10:9 - │ -10 │ false <= 1; - │ ^^^^^ - │ │ - │ Invalid argument to '<=' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_leq_invalid.move:10:15 - │ -10 │ false <= 1; - │ ----- ^^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '<=' - │ Found: 'bool'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:10:18 - │ -10 │ false <= 1; - │ ----- ^ Invalid argument to '<=' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:11:9 - │ -11 │ @0x0 <= @0x1; - │ ^^^^ - │ │ - │ Invalid argument to '<=' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:11:17 - │ -11 │ @0x0 <= @0x1; - │ ---- ^^^^ Invalid argument to '<=' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_leq_invalid.move:12:17 - │ -12 │ (0: u8) <= (1: u128); - │ -- ^^ ---- Found: 'u128'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '<=' - │ Found: 'u8'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:13:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r <= r; - │ ^ Invalid argument to '<=' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:13:14 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r <= r; - │ ^ Invalid argument to '<=' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:14:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s <= s; - │ ^ Invalid argument to '<=' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:14:14 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s <= s; - │ ^ Invalid argument to '<=' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:15:9 - │ -15 │ 0 <= 1 <= 2; - │ ^^^^^^ - │ │ - │ Invalid argument to '<=' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_leq_invalid.move:15:16 - │ -15 │ 0 <= 1 <= 2; - │ ------ ^^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '<=' - │ Found: 'bool'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:15:19 - │ -15 │ 0 <= 1 <= 2; - │ ------ ^ Invalid argument to '<=' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_leq_invalid.move:16:12 - │ -16 │ (1 <= false) && (@0x0 <= 0); - │ - ^^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '<=' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:16:26 - │ -16 │ (1 <= false) && (@0x0 <= 0); - │ ^^^^ - │ │ - │ Invalid argument to '<=' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_leq_invalid.move:16:31 - │ -16 │ (1 <= false) && (@0x0 <= 0); - │ ---- ^^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '<=' - │ Found: 'address'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:16:34 - │ -16 │ (1 <= false) && (@0x0 <= 0); - │ ---- ^ Invalid argument to '<=' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:17:9 - │ -17 │ () <= (); - │ ^^ - │ │ - │ Invalid argument to '<=' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:17:15 - │ -17 │ () <= (); - │ -- ^^ Invalid argument to '<=' - │ │ - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_leq_invalid.move:18:11 - │ -18 │ 1 <= (); - │ - ^^ -- Found: '()'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '<=' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:19:9 - │ -19 │ (0, 1) <= (0, 1, 2); - │ ^^^^^^ - │ │ - │ Invalid argument to '<=' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_leq_invalid.move:19:16 - │ -19 │ (0, 1) <= (0, 1, 2); - │ ------ ^^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - │ │ │ - │ │ Incompatible arguments to '<=' - │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:19:19 - │ -19 │ (0, 1) <= (0, 1, 2); - │ ------ ^^^^^^^^^ Invalid argument to '<=' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:20:9 - │ -20 │ (1, 2) <= (0, 1); - │ ^^^^^^ - │ │ - │ Invalid argument to '<=' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_leq_invalid.move:20:19 - │ -20 │ (1, 2) <= (0, 1); - │ ------ ^^^^^^ Invalid argument to '<=' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_leq_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_leq_invalid.snap new file mode 100644 index 0000000000000..d43e7b22e27f7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_leq_invalid.snap @@ -0,0 +1,251 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_leq_invalid.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:8:9 + │ +8 │ false <= true; + │ ^^^^^ + │ │ + │ Invalid argument to '<=' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:8:18 + │ +8 │ false <= true; + │ ----- ^^^^ Invalid argument to '<=' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_leq_invalid.move:9:11 + │ +9 │ 1 <= false; + │ - ^^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '<=' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:10:9 + │ +10 │ false <= 1; + │ ^^^^^ + │ │ + │ Invalid argument to '<=' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_leq_invalid.move:10:15 + │ +10 │ false <= 1; + │ ----- ^^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '<=' + │ Found: 'bool'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:10:18 + │ +10 │ false <= 1; + │ ----- ^ Invalid argument to '<=' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:11:9 + │ +11 │ @0x0 <= @0x1; + │ ^^^^ + │ │ + │ Invalid argument to '<=' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:11:17 + │ +11 │ @0x0 <= @0x1; + │ ---- ^^^^ Invalid argument to '<=' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_leq_invalid.move:12:17 + │ +12 │ (0: u8) <= (1: u128); + │ -- ^^ ---- Found: 'u128'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '<=' + │ Found: 'u8'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:13:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r <= r; + │ ^ Invalid argument to '<=' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:13:14 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r <= r; + │ ^ Invalid argument to '<=' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:14:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s <= s; + │ ^ Invalid argument to '<=' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:14:14 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s <= s; + │ ^ Invalid argument to '<=' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:15:9 + │ +15 │ 0 <= 1 <= 2; + │ ^^^^^^ + │ │ + │ Invalid argument to '<=' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_leq_invalid.move:15:16 + │ +15 │ 0 <= 1 <= 2; + │ ------ ^^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '<=' + │ Found: 'bool'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:15:19 + │ +15 │ 0 <= 1 <= 2; + │ ------ ^ Invalid argument to '<=' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_leq_invalid.move:16:12 + │ +16 │ (1 <= false) && (@0x0 <= 0); + │ - ^^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '<=' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:16:26 + │ +16 │ (1 <= false) && (@0x0 <= 0); + │ ^^^^ + │ │ + │ Invalid argument to '<=' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_leq_invalid.move:16:31 + │ +16 │ (1 <= false) && (@0x0 <= 0); + │ ---- ^^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '<=' + │ Found: 'address'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:16:34 + │ +16 │ (1 <= false) && (@0x0 <= 0); + │ ---- ^ Invalid argument to '<=' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:17:9 + │ +17 │ () <= (); + │ ^^ + │ │ + │ Invalid argument to '<=' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:17:15 + │ +17 │ () <= (); + │ -- ^^ Invalid argument to '<=' + │ │ + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_leq_invalid.move:18:11 + │ +18 │ 1 <= (); + │ - ^^ -- Found: '()'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '<=' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:19:9 + │ +19 │ (0, 1) <= (0, 1, 2); + │ ^^^^^^ + │ │ + │ Invalid argument to '<=' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_leq_invalid.move:19:16 + │ +19 │ (0, 1) <= (0, 1, 2); + │ ------ ^^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + │ │ │ + │ │ Incompatible arguments to '<=' + │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:19:19 + │ +19 │ (0, 1) <= (0, 1, 2); + │ ------ ^^^^^^^^^ Invalid argument to '<=' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:20:9 + │ +20 │ (1, 2) <= (0, 1); + │ ^^^^^^ + │ │ + │ Invalid argument to '<=' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_leq_invalid.move:20:19 + │ +20 │ (1, 2) <= (0, 1); + │ ------ ^^^^^^ Invalid argument to '<=' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_lt.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_lt.snap new file mode 100644 index 0000000000000..274b62643f9e0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_lt.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_lt.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_lt_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_lt_invalid.exp deleted file mode 100644 index 9d8432a5c34f7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_lt_invalid.exp +++ /dev/null @@ -1,244 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:8:9 - │ -8 │ false < true; - │ ^^^^^ - │ │ - │ Invalid argument to '<' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:8:17 - │ -8 │ false < true; - │ ----- ^^^^ Invalid argument to '<' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_lt_invalid.move:9:11 - │ -9 │ 1 < false; - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '<' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:10:9 - │ -10 │ false < 1; - │ ^^^^^ - │ │ - │ Invalid argument to '<' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_lt_invalid.move:10:15 - │ -10 │ false < 1; - │ ----- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '<' - │ Found: 'bool'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:10:17 - │ -10 │ false < 1; - │ ----- ^ Invalid argument to '<' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:11:9 - │ -11 │ @0x0 < @0x1; - │ ^^^^ - │ │ - │ Invalid argument to '<' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:11:16 - │ -11 │ @0x0 < @0x1; - │ ---- ^^^^ Invalid argument to '<' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_lt_invalid.move:12:17 - │ -12 │ (0: u8) < (1: u128); - │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '<' - │ Found: 'u8'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:13:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r < r; - │ ^ Invalid argument to '<' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:13:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r < r; - │ ^ Invalid argument to '<' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:14:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s < s; - │ ^ Invalid argument to '<' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:14:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s < s; - │ ^ Invalid argument to '<' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:15:9 - │ -15 │ 0 < 1 < 2; - │ ^^^^^ - │ │ - │ Invalid argument to '<' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_lt_invalid.move:15:15 - │ -15 │ 0 < 1 < 2; - │ ----- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '<' - │ Found: 'bool'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:15:17 - │ -15 │ 0 < 1 < 2; - │ ----- ^ Invalid argument to '<' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_lt_invalid.move:16:12 - │ -16 │ (1 < false) && (@0x0 < 0); - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '<' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:16:25 - │ -16 │ (1 < false) && (@0x0 < 0); - │ ^^^^ - │ │ - │ Invalid argument to '<' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_lt_invalid.move:16:30 - │ -16 │ (1 < false) && (@0x0 < 0); - │ ---- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '<' - │ Found: 'address'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:16:32 - │ -16 │ (1 < false) && (@0x0 < 0); - │ ---- ^ Invalid argument to '<' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:17:9 - │ -17 │ () < (); - │ ^^ - │ │ - │ Invalid argument to '<' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:17:14 - │ -17 │ () < (); - │ -- ^^ Invalid argument to '<' - │ │ - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_lt_invalid.move:18:11 - │ -18 │ 1 < (); - │ - ^ -- Found: '()'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '<' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:19:9 - │ -19 │ (0, 1) < (0, 1, 2); - │ ^^^^^^ - │ │ - │ Invalid argument to '<' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_lt_invalid.move:19:16 - │ -19 │ (0, 1) < (0, 1, 2); - │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - │ │ │ - │ │ Incompatible arguments to '<' - │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:19:18 - │ -19 │ (0, 1) < (0, 1, 2); - │ ------ ^^^^^^^^^ Invalid argument to '<' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:20:9 - │ -20 │ (1, 2) < (0, 1); - │ ^^^^^^ - │ │ - │ Invalid argument to '<' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_lt_invalid.move:20:18 - │ -20 │ (1, 2) < (0, 1); - │ ------ ^^^^^^ Invalid argument to '<' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_lt_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_lt_invalid.snap new file mode 100644 index 0000000000000..5f0714869af93 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_lt_invalid.snap @@ -0,0 +1,251 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_lt_invalid.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:8:9 + │ +8 │ false < true; + │ ^^^^^ + │ │ + │ Invalid argument to '<' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:8:17 + │ +8 │ false < true; + │ ----- ^^^^ Invalid argument to '<' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_lt_invalid.move:9:11 + │ +9 │ 1 < false; + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '<' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:10:9 + │ +10 │ false < 1; + │ ^^^^^ + │ │ + │ Invalid argument to '<' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_lt_invalid.move:10:15 + │ +10 │ false < 1; + │ ----- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '<' + │ Found: 'bool'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:10:17 + │ +10 │ false < 1; + │ ----- ^ Invalid argument to '<' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:11:9 + │ +11 │ @0x0 < @0x1; + │ ^^^^ + │ │ + │ Invalid argument to '<' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:11:16 + │ +11 │ @0x0 < @0x1; + │ ---- ^^^^ Invalid argument to '<' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_lt_invalid.move:12:17 + │ +12 │ (0: u8) < (1: u128); + │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '<' + │ Found: 'u8'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:13:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r < r; + │ ^ Invalid argument to '<' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:13:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r < r; + │ ^ Invalid argument to '<' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:14:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s < s; + │ ^ Invalid argument to '<' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:14:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s < s; + │ ^ Invalid argument to '<' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:15:9 + │ +15 │ 0 < 1 < 2; + │ ^^^^^ + │ │ + │ Invalid argument to '<' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_lt_invalid.move:15:15 + │ +15 │ 0 < 1 < 2; + │ ----- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '<' + │ Found: 'bool'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:15:17 + │ +15 │ 0 < 1 < 2; + │ ----- ^ Invalid argument to '<' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_lt_invalid.move:16:12 + │ +16 │ (1 < false) && (@0x0 < 0); + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '<' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:16:25 + │ +16 │ (1 < false) && (@0x0 < 0); + │ ^^^^ + │ │ + │ Invalid argument to '<' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_lt_invalid.move:16:30 + │ +16 │ (1 < false) && (@0x0 < 0); + │ ---- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '<' + │ Found: 'address'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:16:32 + │ +16 │ (1 < false) && (@0x0 < 0); + │ ---- ^ Invalid argument to '<' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:17:9 + │ +17 │ () < (); + │ ^^ + │ │ + │ Invalid argument to '<' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:17:14 + │ +17 │ () < (); + │ -- ^^ Invalid argument to '<' + │ │ + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_lt_invalid.move:18:11 + │ +18 │ 1 < (); + │ - ^ -- Found: '()'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '<' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:19:9 + │ +19 │ (0, 1) < (0, 1, 2); + │ ^^^^^^ + │ │ + │ Invalid argument to '<' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_lt_invalid.move:19:16 + │ +19 │ (0, 1) < (0, 1, 2); + │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + │ │ │ + │ │ Incompatible arguments to '<' + │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:19:18 + │ +19 │ (0, 1) < (0, 1, 2); + │ ------ ^^^^^^^^^ Invalid argument to '<' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:20:9 + │ +20 │ (1, 2) < (0, 1); + │ ^^^^^^ + │ │ + │ Invalid argument to '<' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_lt_invalid.move:20:18 + │ +20 │ (1, 2) < (0, 1); + │ ------ ^^^^^^ Invalid argument to '<' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_mod.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_mod.snap new file mode 100644 index 0000000000000..aff8e0bfcf3ca --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_mod.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_mod.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_mod_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_mod_invalid.exp deleted file mode 100644 index 0007a84f22d69..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_mod_invalid.exp +++ /dev/null @@ -1,230 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mod_invalid.move:8:9 - │ -8 │ false % true; - │ ^^^^^ - │ │ - │ Invalid argument to '%' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mod_invalid.move:8:17 - │ -8 │ false % true; - │ ----- ^^^^ Invalid argument to '%' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_mod_invalid.move:9:11 - │ -9 │ 1 % false; - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '%' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mod_invalid.move:10:9 - │ -10 │ false % 1; - │ ^^^^^ - │ │ - │ Invalid argument to '%' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_mod_invalid.move:10:15 - │ -10 │ false % 1; - │ ----- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '%' - │ Found: 'bool'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mod_invalid.move:10:17 - │ -10 │ false % 1; - │ ----- ^ Invalid argument to '%' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mod_invalid.move:11:9 - │ -11 │ @0x0 % @0x1; - │ ^^^^ - │ │ - │ Invalid argument to '%' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mod_invalid.move:11:16 - │ -11 │ @0x0 % @0x1; - │ ---- ^^^^ Invalid argument to '%' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_mod_invalid.move:12:17 - │ -12 │ (0: u8) % (1: u128); - │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '%' - │ Found: 'u8'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mod_invalid.move:13:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r % r; - │ ^ Invalid argument to '%' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/binary_mod_invalid.move:13:9 - │ - 3 │ struct R { - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · - 7 │ fun t0(r: R, s: S) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' - · -13 │ r % r; - │ ^^^^^ Cannot ignore values without the 'drop' ability. The value must be used - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mod_invalid.move:13:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r % r; - │ ^ Invalid argument to '%' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mod_invalid.move:14:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s % s; - │ ^ Invalid argument to '%' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mod_invalid.move:14:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s % s; - │ ^ Invalid argument to '%' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mod_invalid.move:15:9 - │ -15 │ 1 % false % @0x0 % 0; - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ Invalid argument to '%' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_mod_invalid.move:15:11 - │ -15 │ 1 % false % @0x0 % 0; - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '%' - │ Found: integer. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_mod_invalid.move:15:26 - │ -15 │ 1 % false % @0x0 % 0; - │ ---- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '%' - │ Found: 'address'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mod_invalid.move:15:28 - │ -15 │ 1 % false % @0x0 % 0; - │ ---- ^ Invalid argument to '%' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mod_invalid.move:16:9 - │ -16 │ () % (); - │ ^^ - │ │ - │ Invalid argument to '%' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mod_invalid.move:16:14 - │ -16 │ () % (); - │ -- ^^ Invalid argument to '%' - │ │ - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_mod_invalid.move:17:11 - │ -17 │ 1 % (); - │ - ^ -- Found: '()'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '%' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mod_invalid.move:18:9 - │ -18 │ (0, 1) % (0, 1, 2); - │ ^^^^^^ - │ │ - │ Invalid argument to '%' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_mod_invalid.move:18:16 - │ -18 │ (0, 1) % (0, 1, 2); - │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - │ │ │ - │ │ Incompatible arguments to '%' - │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mod_invalid.move:18:18 - │ -18 │ (0, 1) % (0, 1, 2); - │ ------ ^^^^^^^^^ Invalid argument to '%' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mod_invalid.move:19:9 - │ -19 │ (1, 2) % (0, 1); - │ ^^^^^^ - │ │ - │ Invalid argument to '%' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mod_invalid.move:19:18 - │ -19 │ (1, 2) % (0, 1); - │ ------ ^^^^^^ Invalid argument to '%' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_mod_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_mod_invalid.snap new file mode 100644 index 0000000000000..a510fb8868612 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_mod_invalid.snap @@ -0,0 +1,237 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_mod_invalid.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mod_invalid.move:8:9 + │ +8 │ false % true; + │ ^^^^^ + │ │ + │ Invalid argument to '%' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mod_invalid.move:8:17 + │ +8 │ false % true; + │ ----- ^^^^ Invalid argument to '%' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_mod_invalid.move:9:11 + │ +9 │ 1 % false; + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '%' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mod_invalid.move:10:9 + │ +10 │ false % 1; + │ ^^^^^ + │ │ + │ Invalid argument to '%' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_mod_invalid.move:10:15 + │ +10 │ false % 1; + │ ----- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '%' + │ Found: 'bool'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mod_invalid.move:10:17 + │ +10 │ false % 1; + │ ----- ^ Invalid argument to '%' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mod_invalid.move:11:9 + │ +11 │ @0x0 % @0x1; + │ ^^^^ + │ │ + │ Invalid argument to '%' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mod_invalid.move:11:16 + │ +11 │ @0x0 % @0x1; + │ ---- ^^^^ Invalid argument to '%' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_mod_invalid.move:12:17 + │ +12 │ (0: u8) % (1: u128); + │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '%' + │ Found: 'u8'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mod_invalid.move:13:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r % r; + │ ^ Invalid argument to '%' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/binary_mod_invalid.move:13:9 + │ + 3 │ struct R { + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · + 7 │ fun t0(r: R, s: S) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' + · +13 │ r % r; + │ ^^^^^ Cannot ignore values without the 'drop' ability. The value must be used + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mod_invalid.move:13:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r % r; + │ ^ Invalid argument to '%' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mod_invalid.move:14:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s % s; + │ ^ Invalid argument to '%' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mod_invalid.move:14:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s % s; + │ ^ Invalid argument to '%' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mod_invalid.move:15:9 + │ +15 │ 1 % false % @0x0 % 0; + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ Invalid argument to '%' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_mod_invalid.move:15:11 + │ +15 │ 1 % false % @0x0 % 0; + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '%' + │ Found: integer. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_mod_invalid.move:15:26 + │ +15 │ 1 % false % @0x0 % 0; + │ ---- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '%' + │ Found: 'address'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mod_invalid.move:15:28 + │ +15 │ 1 % false % @0x0 % 0; + │ ---- ^ Invalid argument to '%' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mod_invalid.move:16:9 + │ +16 │ () % (); + │ ^^ + │ │ + │ Invalid argument to '%' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mod_invalid.move:16:14 + │ +16 │ () % (); + │ -- ^^ Invalid argument to '%' + │ │ + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_mod_invalid.move:17:11 + │ +17 │ 1 % (); + │ - ^ -- Found: '()'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '%' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mod_invalid.move:18:9 + │ +18 │ (0, 1) % (0, 1, 2); + │ ^^^^^^ + │ │ + │ Invalid argument to '%' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_mod_invalid.move:18:16 + │ +18 │ (0, 1) % (0, 1, 2); + │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + │ │ │ + │ │ Incompatible arguments to '%' + │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mod_invalid.move:18:18 + │ +18 │ (0, 1) % (0, 1, 2); + │ ------ ^^^^^^^^^ Invalid argument to '%' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mod_invalid.move:19:9 + │ +19 │ (1, 2) % (0, 1); + │ ^^^^^^ + │ │ + │ Invalid argument to '%' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mod_invalid.move:19:18 + │ +19 │ (1, 2) % (0, 1); + │ ------ ^^^^^^ Invalid argument to '%' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_mul.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_mul.snap new file mode 100644 index 0000000000000..805b3b7fbe0d1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_mul.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_mul.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_mul_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_mul_invalid.exp deleted file mode 100644 index 7fa50b7575f48..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_mul_invalid.exp +++ /dev/null @@ -1,230 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mul_invalid.move:8:9 - │ -8 │ false * true; - │ ^^^^^ - │ │ - │ Invalid argument to '*' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mul_invalid.move:8:17 - │ -8 │ false * true; - │ ----- ^^^^ Invalid argument to '*' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_mul_invalid.move:9:11 - │ -9 │ 1 * false; - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '*' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mul_invalid.move:10:9 - │ -10 │ false * 1; - │ ^^^^^ - │ │ - │ Invalid argument to '*' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_mul_invalid.move:10:15 - │ -10 │ false * 1; - │ ----- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '*' - │ Found: 'bool'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mul_invalid.move:10:17 - │ -10 │ false * 1; - │ ----- ^ Invalid argument to '*' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mul_invalid.move:11:9 - │ -11 │ @0x0 * @0x1; - │ ^^^^ - │ │ - │ Invalid argument to '*' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mul_invalid.move:11:16 - │ -11 │ @0x0 * @0x1; - │ ---- ^^^^ Invalid argument to '*' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_mul_invalid.move:12:17 - │ -12 │ (0: u8) * (1: u128); - │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '*' - │ Found: 'u8'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mul_invalid.move:13:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r * r; - │ ^ Invalid argument to '*' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/binary_mul_invalid.move:13:9 - │ - 3 │ struct R { - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · - 7 │ fun t0(r: R, s: S) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' - · -13 │ r * r; - │ ^^^^^ Cannot ignore values without the 'drop' ability. The value must be used - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mul_invalid.move:13:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r * r; - │ ^ Invalid argument to '*' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mul_invalid.move:14:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s * s; - │ ^ Invalid argument to '*' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mul_invalid.move:14:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s * s; - │ ^ Invalid argument to '*' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mul_invalid.move:15:9 - │ -15 │ 1 * false * @0x0 * 0; - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ Invalid argument to '*' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_mul_invalid.move:15:11 - │ -15 │ 1 * false * @0x0 * 0; - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '*' - │ Found: integer. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_mul_invalid.move:15:26 - │ -15 │ 1 * false * @0x0 * 0; - │ ---- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '*' - │ Found: 'address'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mul_invalid.move:15:28 - │ -15 │ 1 * false * @0x0 * 0; - │ ---- ^ Invalid argument to '*' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mul_invalid.move:16:9 - │ -16 │ () * (); - │ ^^ - │ │ - │ Invalid argument to '*' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mul_invalid.move:16:14 - │ -16 │ () * (); - │ -- ^^ Invalid argument to '*' - │ │ - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_mul_invalid.move:17:11 - │ -17 │ 1 * (); - │ - ^ -- Found: '()'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '*' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mul_invalid.move:18:9 - │ -18 │ (0, 1) * (0, 1, 2); - │ ^^^^^^ - │ │ - │ Invalid argument to '*' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_mul_invalid.move:18:16 - │ -18 │ (0, 1) * (0, 1, 2); - │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - │ │ │ - │ │ Incompatible arguments to '*' - │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mul_invalid.move:18:18 - │ -18 │ (0, 1) * (0, 1, 2); - │ ------ ^^^^^^^^^ Invalid argument to '*' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mul_invalid.move:19:9 - │ -19 │ (1, 2) * (0, 1); - │ ^^^^^^ - │ │ - │ Invalid argument to '*' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_mul_invalid.move:19:18 - │ -19 │ (1, 2) * (0, 1); - │ ------ ^^^^^^ Invalid argument to '*' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_mul_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_mul_invalid.snap new file mode 100644 index 0000000000000..0afd4e636bcef --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_mul_invalid.snap @@ -0,0 +1,237 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_mul_invalid.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mul_invalid.move:8:9 + │ +8 │ false * true; + │ ^^^^^ + │ │ + │ Invalid argument to '*' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mul_invalid.move:8:17 + │ +8 │ false * true; + │ ----- ^^^^ Invalid argument to '*' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_mul_invalid.move:9:11 + │ +9 │ 1 * false; + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '*' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mul_invalid.move:10:9 + │ +10 │ false * 1; + │ ^^^^^ + │ │ + │ Invalid argument to '*' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_mul_invalid.move:10:15 + │ +10 │ false * 1; + │ ----- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '*' + │ Found: 'bool'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mul_invalid.move:10:17 + │ +10 │ false * 1; + │ ----- ^ Invalid argument to '*' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mul_invalid.move:11:9 + │ +11 │ @0x0 * @0x1; + │ ^^^^ + │ │ + │ Invalid argument to '*' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mul_invalid.move:11:16 + │ +11 │ @0x0 * @0x1; + │ ---- ^^^^ Invalid argument to '*' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_mul_invalid.move:12:17 + │ +12 │ (0: u8) * (1: u128); + │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '*' + │ Found: 'u8'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mul_invalid.move:13:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r * r; + │ ^ Invalid argument to '*' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/binary_mul_invalid.move:13:9 + │ + 3 │ struct R { + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · + 7 │ fun t0(r: R, s: S) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' + · +13 │ r * r; + │ ^^^^^ Cannot ignore values without the 'drop' ability. The value must be used + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mul_invalid.move:13:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r * r; + │ ^ Invalid argument to '*' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mul_invalid.move:14:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s * s; + │ ^ Invalid argument to '*' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mul_invalid.move:14:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s * s; + │ ^ Invalid argument to '*' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mul_invalid.move:15:9 + │ +15 │ 1 * false * @0x0 * 0; + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ Invalid argument to '*' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_mul_invalid.move:15:11 + │ +15 │ 1 * false * @0x0 * 0; + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '*' + │ Found: integer. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_mul_invalid.move:15:26 + │ +15 │ 1 * false * @0x0 * 0; + │ ---- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '*' + │ Found: 'address'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mul_invalid.move:15:28 + │ +15 │ 1 * false * @0x0 * 0; + │ ---- ^ Invalid argument to '*' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mul_invalid.move:16:9 + │ +16 │ () * (); + │ ^^ + │ │ + │ Invalid argument to '*' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mul_invalid.move:16:14 + │ +16 │ () * (); + │ -- ^^ Invalid argument to '*' + │ │ + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_mul_invalid.move:17:11 + │ +17 │ 1 * (); + │ - ^ -- Found: '()'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '*' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mul_invalid.move:18:9 + │ +18 │ (0, 1) * (0, 1, 2); + │ ^^^^^^ + │ │ + │ Invalid argument to '*' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_mul_invalid.move:18:16 + │ +18 │ (0, 1) * (0, 1, 2); + │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + │ │ │ + │ │ Incompatible arguments to '*' + │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mul_invalid.move:18:18 + │ +18 │ (0, 1) * (0, 1, 2); + │ ------ ^^^^^^^^^ Invalid argument to '*' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mul_invalid.move:19:9 + │ +19 │ (1, 2) * (0, 1); + │ ^^^^^^ + │ │ + │ Invalid argument to '*' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_mul_invalid.move:19:18 + │ +19 │ (1, 2) * (0, 1); + │ ------ ^^^^^^ Invalid argument to '*' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_or.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_or.snap new file mode 100644 index 0000000000000..7e58896e9adb7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_or.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_or.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_or_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_or_invalid.exp deleted file mode 100644 index b0fb8d1b81f5f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_or_invalid.exp +++ /dev/null @@ -1,187 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:8:9 - │ -8 │ 0 || 1; - │ ^ -- Expected: 'bool' - │ │ - │ Invalid argument to '||' - │ Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:8:14 - │ -8 │ 0 || 1; - │ -- ^ - │ │ │ - │ │ Invalid argument to '||' - │ │ Given: integer - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:9:9 - │ -9 │ 1 || false; - │ ^ -- Expected: 'bool' - │ │ - │ Invalid argument to '||' - │ Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:10:18 - │ -10 │ false || 1; - │ -- ^ - │ │ │ - │ │ Invalid argument to '||' - │ │ Given: integer - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:11:9 - │ -11 │ @0x0 || @0x1; - │ ^^^^ -- Expected: 'bool' - │ │ - │ Invalid argument to '||' - │ Given: 'address' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:11:17 - │ -11 │ @0x0 || @0x1; - │ -- ^^^^ - │ │ │ - │ │ Invalid argument to '||' - │ │ Given: 'address' - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:12:9 - │ -12 │ (0: u8) || (1: u128); - │ ^^^^^^^ -- Expected: 'bool' - │ │ │ - │ │ Given: 'u8' - │ Invalid argument to '||' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:12:20 - │ -12 │ (0: u8) || (1: u128); - │ -- ^^^^^^^^^ - │ │ │ │ - │ │ │ Given: 'u128' - │ │ Invalid argument to '||' - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:13:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Given: '0x8675309::M::R' - · -13 │ r || r; - │ ^ -- Expected: 'bool' - │ │ - │ Invalid argument to '||' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:13:14 - │ - 7 │ fun t0(r: R, s: S) { - │ - Given: '0x8675309::M::R' - · -13 │ r || r; - │ -- ^ Invalid argument to '||' - │ │ - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:14:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Given: '0x8675309::M::S' - · -14 │ s || s; - │ ^ -- Expected: 'bool' - │ │ - │ Invalid argument to '||' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:14:14 - │ - 7 │ fun t0(r: R, s: S) { - │ - Given: '0x8675309::M::S' - · -14 │ s || s; - │ -- ^ Invalid argument to '||' - │ │ - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:15:9 - │ -15 │ () || (); - │ ^^ -- Expected: 'bool' - │ │ - │ Invalid argument to '||' - │ Given: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:15:15 - │ -15 │ () || (); - │ -- ^^ - │ │ │ - │ │ Invalid argument to '||' - │ │ Given: '()' - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:16:17 - │ -16 │ true || (); - │ -- ^^ - │ │ │ - │ │ Invalid argument to '||' - │ │ Given: '()' - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:17:9 - │ -17 │ (true, false) || (true, false, true); - │ ^^^^^^^^^^^^^ -- Expected: 'bool' - │ │ - │ Invalid argument to '||' - │ Given: '(bool, bool)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:17:26 - │ -17 │ (true, false) || (true, false, true); - │ -- ^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Invalid argument to '||' - │ │ Given: '(bool, bool, bool)' - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:18:9 - │ -18 │ (true, true) || (false, false); - │ ^^^^^^^^^^^^ -- Expected: 'bool' - │ │ - │ Invalid argument to '||' - │ Given: '(bool, bool)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_or_invalid.move:18:25 - │ -18 │ (true, true) || (false, false); - │ -- ^^^^^^^^^^^^^^ - │ │ │ - │ │ Invalid argument to '||' - │ │ Given: '(bool, bool)' - │ Expected: 'bool' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_or_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_or_invalid.snap new file mode 100644 index 0000000000000..92bdcdc6677c0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_or_invalid.snap @@ -0,0 +1,194 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_or_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:8:9 + │ +8 │ 0 || 1; + │ ^ -- Expected: 'bool' + │ │ + │ Invalid argument to '||' + │ Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:8:14 + │ +8 │ 0 || 1; + │ -- ^ + │ │ │ + │ │ Invalid argument to '||' + │ │ Given: integer + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:9:9 + │ +9 │ 1 || false; + │ ^ -- Expected: 'bool' + │ │ + │ Invalid argument to '||' + │ Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:10:18 + │ +10 │ false || 1; + │ -- ^ + │ │ │ + │ │ Invalid argument to '||' + │ │ Given: integer + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:11:9 + │ +11 │ @0x0 || @0x1; + │ ^^^^ -- Expected: 'bool' + │ │ + │ Invalid argument to '||' + │ Given: 'address' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:11:17 + │ +11 │ @0x0 || @0x1; + │ -- ^^^^ + │ │ │ + │ │ Invalid argument to '||' + │ │ Given: 'address' + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:12:9 + │ +12 │ (0: u8) || (1: u128); + │ ^^^^^^^ -- Expected: 'bool' + │ │ │ + │ │ Given: 'u8' + │ Invalid argument to '||' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:12:20 + │ +12 │ (0: u8) || (1: u128); + │ -- ^^^^^^^^^ + │ │ │ │ + │ │ │ Given: 'u128' + │ │ Invalid argument to '||' + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:13:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Given: '0x8675309::M::R' + · +13 │ r || r; + │ ^ -- Expected: 'bool' + │ │ + │ Invalid argument to '||' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:13:14 + │ + 7 │ fun t0(r: R, s: S) { + │ - Given: '0x8675309::M::R' + · +13 │ r || r; + │ -- ^ Invalid argument to '||' + │ │ + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:14:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Given: '0x8675309::M::S' + · +14 │ s || s; + │ ^ -- Expected: 'bool' + │ │ + │ Invalid argument to '||' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:14:14 + │ + 7 │ fun t0(r: R, s: S) { + │ - Given: '0x8675309::M::S' + · +14 │ s || s; + │ -- ^ Invalid argument to '||' + │ │ + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:15:9 + │ +15 │ () || (); + │ ^^ -- Expected: 'bool' + │ │ + │ Invalid argument to '||' + │ Given: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:15:15 + │ +15 │ () || (); + │ -- ^^ + │ │ │ + │ │ Invalid argument to '||' + │ │ Given: '()' + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:16:17 + │ +16 │ true || (); + │ -- ^^ + │ │ │ + │ │ Invalid argument to '||' + │ │ Given: '()' + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:17:9 + │ +17 │ (true, false) || (true, false, true); + │ ^^^^^^^^^^^^^ -- Expected: 'bool' + │ │ + │ Invalid argument to '||' + │ Given: '(bool, bool)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:17:26 + │ +17 │ (true, false) || (true, false, true); + │ -- ^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Invalid argument to '||' + │ │ Given: '(bool, bool, bool)' + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:18:9 + │ +18 │ (true, true) || (false, false); + │ ^^^^^^^^^^^^ -- Expected: 'bool' + │ │ + │ Invalid argument to '||' + │ Given: '(bool, bool)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_or_invalid.move:18:25 + │ +18 │ (true, true) || (false, false); + │ -- ^^^^^^^^^^^^^^ + │ │ │ + │ │ Invalid argument to '||' + │ │ Given: '(bool, bool)' + │ Expected: 'bool' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_shl.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_shl.snap new file mode 100644 index 0000000000000..66e3869b9c086 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_shl.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_shl.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_shl_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_shl_invalid.exp deleted file mode 100644 index da57b1e6a8d12..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_shl_invalid.exp +++ /dev/null @@ -1,208 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_shl_invalid.move:8:9 - │ -8 │ false << true; - │ ^^^^^ - │ │ - │ Invalid argument to '<<' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shl_invalid.move:8:18 - │ -8 │ false << true; - │ ^^^^ - │ │ - │ Invalid argument to '<<' - │ Expected: 'u8' - │ Given: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shl_invalid.move:9:14 - │ -9 │ 1 << false; - │ ^^^^^ - │ │ - │ Invalid argument to '<<' - │ Expected: 'u8' - │ Given: 'bool' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_shl_invalid.move:10:9 - │ -10 │ false << 1; - │ ^^^^^ - │ │ - │ Invalid argument to '<<' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_shl_invalid.move:11:9 - │ -11 │ @0x0 << @0x1; - │ ^^^^ - │ │ - │ Invalid argument to '<<' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shl_invalid.move:11:17 - │ -11 │ @0x0 << @0x1; - │ ^^^^ - │ │ - │ Invalid argument to '<<' - │ Expected: 'u8' - │ Given: 'address' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shl_invalid.move:12:20 - │ -12 │ (0: u8) << (1: u128); - │ ^^^^^^^^^ - │ │ │ - │ │ Given: 'u128' - │ Invalid argument to '<<' - │ Expected: 'u8' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_shl_invalid.move:13:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r << r; - │ ^ Invalid argument to '<<' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/binary_shl_invalid.move:13:9 - │ - 3 │ struct R { - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · - 7 │ fun t0(r: R, s: S) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' - · -13 │ r << r; - │ ^^^^^^ Cannot ignore values without the 'drop' ability. The value must be used - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shl_invalid.move:13:14 - │ - 7 │ fun t0(r: R, s: S) { - │ - Given: '0x8675309::M::R' - · -13 │ r << r; - │ ^ - │ │ - │ Invalid argument to '<<' - │ Expected: 'u8' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_shl_invalid.move:14:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s << s; - │ ^ Invalid argument to '<<' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shl_invalid.move:14:14 - │ - 7 │ fun t0(r: R, s: S) { - │ - Given: '0x8675309::M::S' - · -14 │ s << s; - │ ^ - │ │ - │ Invalid argument to '<<' - │ Expected: 'u8' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shl_invalid.move:15:14 - │ -15 │ 1 << false << @0x0 << 0; - │ ^^^^^ - │ │ - │ Invalid argument to '<<' - │ Expected: 'u8' - │ Given: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shl_invalid.move:15:23 - │ -15 │ 1 << false << @0x0 << 0; - │ ^^^^ - │ │ - │ Invalid argument to '<<' - │ Expected: 'u8' - │ Given: 'address' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_shl_invalid.move:16:9 - │ -16 │ () << (); - │ ^^ - │ │ - │ Invalid argument to '<<' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shl_invalid.move:16:15 - │ -16 │ () << (); - │ ^^ - │ │ - │ Invalid argument to '<<' - │ Expected: 'u8' - │ Given: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shl_invalid.move:17:14 - │ -17 │ 1 << (); - │ ^^ - │ │ - │ Invalid argument to '<<' - │ Expected: 'u8' - │ Given: '()' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_shl_invalid.move:18:9 - │ -18 │ (0, 1) << (0, 1, 2); - │ ^^^^^^ - │ │ - │ Invalid argument to '<<' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shl_invalid.move:18:19 - │ -18 │ (0, 1) << (0, 1, 2); - │ ^^^^^^^^^ - │ │ - │ Invalid argument to '<<' - │ Expected: 'u8' - │ Given: '({integer}, {integer}, {integer})' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_shl_invalid.move:19:9 - │ -19 │ (1, 2) << (0, 1); - │ ^^^^^^ - │ │ - │ Invalid argument to '<<' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shl_invalid.move:19:19 - │ -19 │ (1, 2) << (0, 1); - │ ^^^^^^ - │ │ - │ Invalid argument to '<<' - │ Expected: 'u8' - │ Given: '({integer}, {integer})' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_shl_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_shl_invalid.snap new file mode 100644 index 0000000000000..1d9e5bb63460c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_shl_invalid.snap @@ -0,0 +1,215 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_shl_invalid.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_shl_invalid.move:8:9 + │ +8 │ false << true; + │ ^^^^^ + │ │ + │ Invalid argument to '<<' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shl_invalid.move:8:18 + │ +8 │ false << true; + │ ^^^^ + │ │ + │ Invalid argument to '<<' + │ Expected: 'u8' + │ Given: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shl_invalid.move:9:14 + │ +9 │ 1 << false; + │ ^^^^^ + │ │ + │ Invalid argument to '<<' + │ Expected: 'u8' + │ Given: 'bool' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_shl_invalid.move:10:9 + │ +10 │ false << 1; + │ ^^^^^ + │ │ + │ Invalid argument to '<<' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_shl_invalid.move:11:9 + │ +11 │ @0x0 << @0x1; + │ ^^^^ + │ │ + │ Invalid argument to '<<' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shl_invalid.move:11:17 + │ +11 │ @0x0 << @0x1; + │ ^^^^ + │ │ + │ Invalid argument to '<<' + │ Expected: 'u8' + │ Given: 'address' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shl_invalid.move:12:20 + │ +12 │ (0: u8) << (1: u128); + │ ^^^^^^^^^ + │ │ │ + │ │ Given: 'u128' + │ Invalid argument to '<<' + │ Expected: 'u8' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_shl_invalid.move:13:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r << r; + │ ^ Invalid argument to '<<' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/binary_shl_invalid.move:13:9 + │ + 3 │ struct R { + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · + 7 │ fun t0(r: R, s: S) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' + · +13 │ r << r; + │ ^^^^^^ Cannot ignore values without the 'drop' ability. The value must be used + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shl_invalid.move:13:14 + │ + 7 │ fun t0(r: R, s: S) { + │ - Given: '0x8675309::M::R' + · +13 │ r << r; + │ ^ + │ │ + │ Invalid argument to '<<' + │ Expected: 'u8' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_shl_invalid.move:14:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s << s; + │ ^ Invalid argument to '<<' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shl_invalid.move:14:14 + │ + 7 │ fun t0(r: R, s: S) { + │ - Given: '0x8675309::M::S' + · +14 │ s << s; + │ ^ + │ │ + │ Invalid argument to '<<' + │ Expected: 'u8' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shl_invalid.move:15:14 + │ +15 │ 1 << false << @0x0 << 0; + │ ^^^^^ + │ │ + │ Invalid argument to '<<' + │ Expected: 'u8' + │ Given: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shl_invalid.move:15:23 + │ +15 │ 1 << false << @0x0 << 0; + │ ^^^^ + │ │ + │ Invalid argument to '<<' + │ Expected: 'u8' + │ Given: 'address' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_shl_invalid.move:16:9 + │ +16 │ () << (); + │ ^^ + │ │ + │ Invalid argument to '<<' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shl_invalid.move:16:15 + │ +16 │ () << (); + │ ^^ + │ │ + │ Invalid argument to '<<' + │ Expected: 'u8' + │ Given: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shl_invalid.move:17:14 + │ +17 │ 1 << (); + │ ^^ + │ │ + │ Invalid argument to '<<' + │ Expected: 'u8' + │ Given: '()' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_shl_invalid.move:18:9 + │ +18 │ (0, 1) << (0, 1, 2); + │ ^^^^^^ + │ │ + │ Invalid argument to '<<' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shl_invalid.move:18:19 + │ +18 │ (0, 1) << (0, 1, 2); + │ ^^^^^^^^^ + │ │ + │ Invalid argument to '<<' + │ Expected: 'u8' + │ Given: '({integer}, {integer}, {integer})' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_shl_invalid.move:19:9 + │ +19 │ (1, 2) << (0, 1); + │ ^^^^^^ + │ │ + │ Invalid argument to '<<' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shl_invalid.move:19:19 + │ +19 │ (1, 2) << (0, 1); + │ ^^^^^^ + │ │ + │ Invalid argument to '<<' + │ Expected: 'u8' + │ Given: '({integer}, {integer})' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_shr.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_shr.snap new file mode 100644 index 0000000000000..078a93a15aa32 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_shr.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_shr.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_shr_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_shr_invalid.exp deleted file mode 100644 index 78bda44e850b3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_shr_invalid.exp +++ /dev/null @@ -1,208 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_shr_invalid.move:8:9 - │ -8 │ false >> true; - │ ^^^^^ - │ │ - │ Invalid argument to '>>' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shr_invalid.move:8:18 - │ -8 │ false >> true; - │ ^^^^ - │ │ - │ Invalid argument to '>>' - │ Expected: 'u8' - │ Given: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shr_invalid.move:9:14 - │ -9 │ 1 >> false; - │ ^^^^^ - │ │ - │ Invalid argument to '>>' - │ Expected: 'u8' - │ Given: 'bool' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_shr_invalid.move:10:9 - │ -10 │ false >> 1; - │ ^^^^^ - │ │ - │ Invalid argument to '>>' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_shr_invalid.move:11:9 - │ -11 │ @0x0 >> @0x1; - │ ^^^^ - │ │ - │ Invalid argument to '>>' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shr_invalid.move:11:17 - │ -11 │ @0x0 >> @0x1; - │ ^^^^ - │ │ - │ Invalid argument to '>>' - │ Expected: 'u8' - │ Given: 'address' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shr_invalid.move:12:20 - │ -12 │ (0: u8) >> (1: u128); - │ ^^^^^^^^^ - │ │ │ - │ │ Given: 'u128' - │ Invalid argument to '>>' - │ Expected: 'u8' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_shr_invalid.move:13:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r >> r; - │ ^ Invalid argument to '>>' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/binary_shr_invalid.move:13:9 - │ - 3 │ struct R { - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · - 7 │ fun t0(r: R, s: S) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' - · -13 │ r >> r; - │ ^^^^^^ Cannot ignore values without the 'drop' ability. The value must be used - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shr_invalid.move:13:14 - │ - 7 │ fun t0(r: R, s: S) { - │ - Given: '0x8675309::M::R' - · -13 │ r >> r; - │ ^ - │ │ - │ Invalid argument to '>>' - │ Expected: 'u8' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_shr_invalid.move:14:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s >> s; - │ ^ Invalid argument to '>>' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shr_invalid.move:14:14 - │ - 7 │ fun t0(r: R, s: S) { - │ - Given: '0x8675309::M::S' - · -14 │ s >> s; - │ ^ - │ │ - │ Invalid argument to '>>' - │ Expected: 'u8' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shr_invalid.move:15:14 - │ -15 │ 1 >> false >> @0x0 >> 0; - │ ^^^^^ - │ │ - │ Invalid argument to '>>' - │ Expected: 'u8' - │ Given: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shr_invalid.move:15:23 - │ -15 │ 1 >> false >> @0x0 >> 0; - │ ^^^^ - │ │ - │ Invalid argument to '>>' - │ Expected: 'u8' - │ Given: 'address' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_shr_invalid.move:16:9 - │ -16 │ () >> (); - │ ^^ - │ │ - │ Invalid argument to '>>' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shr_invalid.move:16:15 - │ -16 │ () >> (); - │ ^^ - │ │ - │ Invalid argument to '>>' - │ Expected: 'u8' - │ Given: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shr_invalid.move:17:14 - │ -17 │ 1 >> (); - │ ^^ - │ │ - │ Invalid argument to '>>' - │ Expected: 'u8' - │ Given: '()' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_shr_invalid.move:18:9 - │ -18 │ (0, 1) >> (0, 1, 2); - │ ^^^^^^ - │ │ - │ Invalid argument to '>>' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shr_invalid.move:18:19 - │ -18 │ (0, 1) >> (0, 1, 2); - │ ^^^^^^^^^ - │ │ - │ Invalid argument to '>>' - │ Expected: 'u8' - │ Given: '({integer}, {integer}, {integer})' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_shr_invalid.move:19:9 - │ -19 │ (1, 2) >> (0, 1); - │ ^^^^^^ - │ │ - │ Invalid argument to '>>' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_shr_invalid.move:19:19 - │ -19 │ (1, 2) >> (0, 1); - │ ^^^^^^ - │ │ - │ Invalid argument to '>>' - │ Expected: 'u8' - │ Given: '({integer}, {integer})' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_shr_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_shr_invalid.snap new file mode 100644 index 0000000000000..bf8084ae7598f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_shr_invalid.snap @@ -0,0 +1,215 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_shr_invalid.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_shr_invalid.move:8:9 + │ +8 │ false >> true; + │ ^^^^^ + │ │ + │ Invalid argument to '>>' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shr_invalid.move:8:18 + │ +8 │ false >> true; + │ ^^^^ + │ │ + │ Invalid argument to '>>' + │ Expected: 'u8' + │ Given: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shr_invalid.move:9:14 + │ +9 │ 1 >> false; + │ ^^^^^ + │ │ + │ Invalid argument to '>>' + │ Expected: 'u8' + │ Given: 'bool' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_shr_invalid.move:10:9 + │ +10 │ false >> 1; + │ ^^^^^ + │ │ + │ Invalid argument to '>>' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_shr_invalid.move:11:9 + │ +11 │ @0x0 >> @0x1; + │ ^^^^ + │ │ + │ Invalid argument to '>>' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shr_invalid.move:11:17 + │ +11 │ @0x0 >> @0x1; + │ ^^^^ + │ │ + │ Invalid argument to '>>' + │ Expected: 'u8' + │ Given: 'address' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shr_invalid.move:12:20 + │ +12 │ (0: u8) >> (1: u128); + │ ^^^^^^^^^ + │ │ │ + │ │ Given: 'u128' + │ Invalid argument to '>>' + │ Expected: 'u8' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_shr_invalid.move:13:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r >> r; + │ ^ Invalid argument to '>>' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/binary_shr_invalid.move:13:9 + │ + 3 │ struct R { + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · + 7 │ fun t0(r: R, s: S) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' + · +13 │ r >> r; + │ ^^^^^^ Cannot ignore values without the 'drop' ability. The value must be used + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shr_invalid.move:13:14 + │ + 7 │ fun t0(r: R, s: S) { + │ - Given: '0x8675309::M::R' + · +13 │ r >> r; + │ ^ + │ │ + │ Invalid argument to '>>' + │ Expected: 'u8' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_shr_invalid.move:14:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s >> s; + │ ^ Invalid argument to '>>' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shr_invalid.move:14:14 + │ + 7 │ fun t0(r: R, s: S) { + │ - Given: '0x8675309::M::S' + · +14 │ s >> s; + │ ^ + │ │ + │ Invalid argument to '>>' + │ Expected: 'u8' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shr_invalid.move:15:14 + │ +15 │ 1 >> false >> @0x0 >> 0; + │ ^^^^^ + │ │ + │ Invalid argument to '>>' + │ Expected: 'u8' + │ Given: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shr_invalid.move:15:23 + │ +15 │ 1 >> false >> @0x0 >> 0; + │ ^^^^ + │ │ + │ Invalid argument to '>>' + │ Expected: 'u8' + │ Given: 'address' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_shr_invalid.move:16:9 + │ +16 │ () >> (); + │ ^^ + │ │ + │ Invalid argument to '>>' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shr_invalid.move:16:15 + │ +16 │ () >> (); + │ ^^ + │ │ + │ Invalid argument to '>>' + │ Expected: 'u8' + │ Given: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shr_invalid.move:17:14 + │ +17 │ 1 >> (); + │ ^^ + │ │ + │ Invalid argument to '>>' + │ Expected: 'u8' + │ Given: '()' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_shr_invalid.move:18:9 + │ +18 │ (0, 1) >> (0, 1, 2); + │ ^^^^^^ + │ │ + │ Invalid argument to '>>' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shr_invalid.move:18:19 + │ +18 │ (0, 1) >> (0, 1, 2); + │ ^^^^^^^^^ + │ │ + │ Invalid argument to '>>' + │ Expected: 'u8' + │ Given: '({integer}, {integer}, {integer})' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_shr_invalid.move:19:9 + │ +19 │ (1, 2) >> (0, 1); + │ ^^^^^^ + │ │ + │ Invalid argument to '>>' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_shr_invalid.move:19:19 + │ +19 │ (1, 2) >> (0, 1); + │ ^^^^^^ + │ │ + │ Invalid argument to '>>' + │ Expected: 'u8' + │ Given: '({integer}, {integer})' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_sub.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_sub.snap new file mode 100644 index 0000000000000..38594bb2cc291 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_sub.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_sub.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_sub_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_sub_invalid.exp deleted file mode 100644 index 1bf9c0b1ba667..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_sub_invalid.exp +++ /dev/null @@ -1,230 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_sub_invalid.move:8:9 - │ -8 │ false - true; - │ ^^^^^ - │ │ - │ Invalid argument to '-' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_sub_invalid.move:8:17 - │ -8 │ false - true; - │ ----- ^^^^ Invalid argument to '-' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_sub_invalid.move:9:11 - │ -9 │ 1 - false; - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '-' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_sub_invalid.move:10:9 - │ -10 │ false - 1; - │ ^^^^^ - │ │ - │ Invalid argument to '-' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_sub_invalid.move:10:15 - │ -10 │ false - 1; - │ ----- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '-' - │ Found: 'bool'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_sub_invalid.move:10:17 - │ -10 │ false - 1; - │ ----- ^ Invalid argument to '-' - │ │ - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_sub_invalid.move:11:9 - │ -11 │ @0x0 - @0x1; - │ ^^^^ - │ │ - │ Invalid argument to '-' - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_sub_invalid.move:11:16 - │ -11 │ @0x0 - @0x1; - │ ---- ^^^^ Invalid argument to '-' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_sub_invalid.move:12:17 - │ -12 │ (0: u8) - (1: u128); - │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '-' - │ Found: 'u8'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_sub_invalid.move:13:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r - r; - │ ^ Invalid argument to '-' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/binary_sub_invalid.move:13:9 - │ - 3 │ struct R { - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · - 7 │ fun t0(r: R, s: S) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' - · -13 │ r - r; - │ ^^^^^ Cannot ignore values without the 'drop' ability. The value must be used - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_sub_invalid.move:13:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -13 │ r - r; - │ ^ Invalid argument to '-' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_sub_invalid.move:14:9 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s - s; - │ ^ Invalid argument to '-' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_sub_invalid.move:14:13 - │ - 7 │ fun t0(r: R, s: S) { - │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - · -14 │ s - s; - │ ^ Invalid argument to '-' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_sub_invalid.move:15:9 - │ -15 │ 1 - false - @0x0 - 0; - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ Invalid argument to '-' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_sub_invalid.move:15:11 - │ -15 │ 1 - false - @0x0 - 0; - │ - ^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '-' - │ Found: integer. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_sub_invalid.move:15:26 - │ -15 │ 1 - false - @0x0 - 0; - │ ---- ^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '-' - │ Found: 'address'. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_sub_invalid.move:15:28 - │ -15 │ 1 - false - @0x0 - 0; - │ ---- ^ Invalid argument to '-' - │ │ - │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_sub_invalid.move:16:9 - │ -16 │ () - (); - │ ^^ - │ │ - │ Invalid argument to '-' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_sub_invalid.move:16:14 - │ -16 │ () - (); - │ -- ^^ Invalid argument to '-' - │ │ - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_sub_invalid.move:17:11 - │ -17 │ 1 - (); - │ - ^ -- Found: '()'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '-' - │ Found: integer. It is not compatible with the other type. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_sub_invalid.move:18:9 - │ -18 │ (0, 1) - (0, 1, 2); - │ ^^^^^^ - │ │ - │ Invalid argument to '-' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/binary_sub_invalid.move:18:16 - │ -18 │ (0, 1) - (0, 1, 2); - │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - │ │ │ - │ │ Incompatible arguments to '-' - │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_sub_invalid.move:18:18 - │ -18 │ (0, 1) - (0, 1, 2); - │ ------ ^^^^^^^^^ Invalid argument to '-' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_sub_invalid.move:19:9 - │ -19 │ (1, 2) - (0, 1); - │ ^^^^^^ - │ │ - │ Invalid argument to '-' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/binary_sub_invalid.move:19:18 - │ -19 │ (1, 2) - (0, 1); - │ ------ ^^^^^^ Invalid argument to '-' - │ │ - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_sub_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_sub_invalid.snap new file mode 100644 index 0000000000000..192d67c107e96 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_sub_invalid.snap @@ -0,0 +1,237 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_sub_invalid.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_sub_invalid.move:8:9 + │ +8 │ false - true; + │ ^^^^^ + │ │ + │ Invalid argument to '-' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_sub_invalid.move:8:17 + │ +8 │ false - true; + │ ----- ^^^^ Invalid argument to '-' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_sub_invalid.move:9:11 + │ +9 │ 1 - false; + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '-' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_sub_invalid.move:10:9 + │ +10 │ false - 1; + │ ^^^^^ + │ │ + │ Invalid argument to '-' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_sub_invalid.move:10:15 + │ +10 │ false - 1; + │ ----- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '-' + │ Found: 'bool'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_sub_invalid.move:10:17 + │ +10 │ false - 1; + │ ----- ^ Invalid argument to '-' + │ │ + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_sub_invalid.move:11:9 + │ +11 │ @0x0 - @0x1; + │ ^^^^ + │ │ + │ Invalid argument to '-' + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_sub_invalid.move:11:16 + │ +11 │ @0x0 - @0x1; + │ ---- ^^^^ Invalid argument to '-' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_sub_invalid.move:12:17 + │ +12 │ (0: u8) - (1: u128); + │ -- ^ ---- Found: 'u128'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '-' + │ Found: 'u8'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_sub_invalid.move:13:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r - r; + │ ^ Invalid argument to '-' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/binary_sub_invalid.move:13:9 + │ + 3 │ struct R { + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · + 7 │ fun t0(r: R, s: S) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' + · +13 │ r - r; + │ ^^^^^ Cannot ignore values without the 'drop' ability. The value must be used + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_sub_invalid.move:13:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +13 │ r - r; + │ ^ Invalid argument to '-' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_sub_invalid.move:14:9 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s - s; + │ ^ Invalid argument to '-' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_sub_invalid.move:14:13 + │ + 7 │ fun t0(r: R, s: S) { + │ - Found: '0x8675309::M::S'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + · +14 │ s - s; + │ ^ Invalid argument to '-' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_sub_invalid.move:15:9 + │ +15 │ 1 - false - @0x0 - 0; + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ Invalid argument to '-' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_sub_invalid.move:15:11 + │ +15 │ 1 - false - @0x0 - 0; + │ - ^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '-' + │ Found: integer. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_sub_invalid.move:15:26 + │ +15 │ 1 - false - @0x0 - 0; + │ ---- ^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '-' + │ Found: 'address'. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_sub_invalid.move:15:28 + │ +15 │ 1 - false - @0x0 - 0; + │ ---- ^ Invalid argument to '-' + │ │ + │ Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_sub_invalid.move:16:9 + │ +16 │ () - (); + │ ^^ + │ │ + │ Invalid argument to '-' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_sub_invalid.move:16:14 + │ +16 │ () - (); + │ -- ^^ Invalid argument to '-' + │ │ + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_sub_invalid.move:17:11 + │ +17 │ 1 - (); + │ - ^ -- Found: '()'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '-' + │ Found: integer. It is not compatible with the other type. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_sub_invalid.move:18:9 + │ +18 │ (0, 1) - (0, 1, 2); + │ ^^^^^^ + │ │ + │ Invalid argument to '-' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/binary_sub_invalid.move:18:16 + │ +18 │ (0, 1) - (0, 1, 2); + │ ------ ^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + │ │ │ + │ │ Incompatible arguments to '-' + │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_sub_invalid.move:18:18 + │ +18 │ (0, 1) - (0, 1, 2); + │ ------ ^^^^^^^^^ Invalid argument to '-' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_sub_invalid.move:19:9 + │ +19 │ (1, 2) - (0, 1); + │ ^^^^^^ + │ │ + │ Invalid argument to '-' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/binary_sub_invalid.move:19:18 + │ +19 │ (1, 2) - (0, 1); + │ ------ ^^^^^^ Invalid argument to '-' + │ │ + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_xor.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_xor.snap new file mode 100644 index 0000000000000..047883be6548f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/binary_xor.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/binary_xor.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_duplicate_binding.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_duplicate_binding.exp deleted file mode 100644 index c75c6a67e051f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_duplicate_binding.exp +++ /dev/null @@ -1,48 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/typing/bind_duplicate_binding.move:5:14 - │ -5 │ let (x, x) = (0, 0); x; - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/typing/bind_duplicate_binding.move:5:17 - │ -5 │ let (x, x) = (0, 0); x; - │ - ^ Duplicate declaration for local 'x' in a given 'let' - │ │ - │ Previously declared here - -warning[W09002]: unused variable - ┌─ tests/move_check/typing/bind_duplicate_binding.move:6:14 - │ -6 │ let (f, R{f}, f) = (0, R { f: 0 }, 0); f; - │ ^ Unused local variable 'f'. Consider removing or prefixing with an underscore: '_f' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/typing/bind_duplicate_binding.move:6:19 - │ -6 │ let (f, R{f}, f) = (0, R { f: 0 }, 0); f; - │ ^ Unused local variable 'f'. Consider removing or prefixing with an underscore: '_f' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/typing/bind_duplicate_binding.move:6:19 - │ -6 │ let (f, R{f}, f) = (0, R { f: 0 }, 0); f; - │ - ^ Duplicate declaration for local 'f' in a given 'let' - │ │ - │ Previously declared here - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/typing/bind_duplicate_binding.move:6:23 - │ -6 │ let (f, R{f}, f) = (0, R { f: 0 }, 0); f; - │ - ^ Duplicate declaration for local 'f' in a given 'let' - │ │ - │ Previously declared here - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_duplicate_binding.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_duplicate_binding.snap new file mode 100644 index 0000000000000..1df835be484cd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_duplicate_binding.snap @@ -0,0 +1,55 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/bind_duplicate_binding.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/typing/bind_duplicate_binding.move:5:14 + │ +5 │ let (x, x) = (0, 0); x; + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/typing/bind_duplicate_binding.move:5:17 + │ +5 │ let (x, x) = (0, 0); x; + │ - ^ Duplicate declaration for local 'x' in a given 'let' + │ │ + │ Previously declared here + +warning[W09002]: unused variable + ┌─ tests/move_check/typing/bind_duplicate_binding.move:6:14 + │ +6 │ let (f, R{f}, f) = (0, R { f: 0 }, 0); f; + │ ^ Unused local variable 'f'. Consider removing or prefixing with an underscore: '_f' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/typing/bind_duplicate_binding.move:6:19 + │ +6 │ let (f, R{f}, f) = (0, R { f: 0 }, 0); f; + │ ^ Unused local variable 'f'. Consider removing or prefixing with an underscore: '_f' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/typing/bind_duplicate_binding.move:6:19 + │ +6 │ let (f, R{f}, f) = (0, R { f: 0 }, 0); f; + │ - ^ Duplicate declaration for local 'f' in a given 'let' + │ │ + │ Previously declared here + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/typing/bind_duplicate_binding.move:6:23 + │ +6 │ let (f, R{f}, f) = (0, R { f: 0 }, 0); f; + │ - ^ Duplicate declaration for local 'f' in a given 'let' + │ │ + │ Previously declared here diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_pop_resource.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_pop_resource.exp deleted file mode 100644 index 359defa773683..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_pop_resource.exp +++ /dev/null @@ -1,46 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/bind_pop_resource.move:5:13 - │ -2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -5 │ let _: R = R{}; - │ ^ - The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ Cannot ignore values without the 'drop' ability. The value must be used - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/bind_pop_resource.move:9:14 - │ -2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -9 │ let (_, _):(R, R) = (R{}, R{}); - │ ^ - The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ Cannot ignore values without the 'drop' ability. The value must be used - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/bind_pop_resource.move:9:17 - │ -2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -9 │ let (_, _):(R, R) = (R{}, R{}); - │ ^ - The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ Cannot ignore values without the 'drop' ability. The value must be used - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/typing/bind_pop_resource.move:9:39 - │ -2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -8 │ let _r: R = R{}; - │ -- - The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ The local variable '_r' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns -9 │ let (_, _):(R, R) = (R{}, R{}); - │ ^ Invalid return - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_pop_resource.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_pop_resource.snap new file mode 100644 index 0000000000000..b7d5d314f63a7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_pop_resource.snap @@ -0,0 +1,53 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/bind_pop_resource.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/bind_pop_resource.move:5:13 + │ +2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +5 │ let _: R = R{}; + │ ^ - The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ Cannot ignore values without the 'drop' ability. The value must be used + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/bind_pop_resource.move:9:14 + │ +2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +9 │ let (_, _):(R, R) = (R{}, R{}); + │ ^ - The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ Cannot ignore values without the 'drop' ability. The value must be used + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/bind_pop_resource.move:9:17 + │ +2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +9 │ let (_, _):(R, R) = (R{}, R{}); + │ ^ - The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ Cannot ignore values without the 'drop' ability. The value must be used + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/typing/bind_pop_resource.move:9:39 + │ +2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +8 │ let _r: R = R{}; + │ -- - The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ The local variable '_r' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns +9 │ let (_, _):(R, R) = (R{}, R{}); + │ ^ Invalid return diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_unpack_references.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_unpack_references.exp deleted file mode 100644 index ae04983b28f17..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_unpack_references.exp +++ /dev/null @@ -1,30 +0,0 @@ -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/typing/bind_unpack_references.move:16:14 - │ - 3 │ struct R { s1: S, s2: S } - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -13 │ let R { s1: S { f }, s2 }: &R = &R { s1: S{f: 0}, s2: S{f: 1} }; f; s2; - │ ------------------------------ - │ │ - │ The value is created but not used. The value does not have the 'drop' ability and must be consumed before the function returns - │ The type '0x8675309::M::R' does not have the ability 'drop' - · -16 │ f; s2; - │ ^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/typing/bind_unpack_references.move:23:14 - │ - 3 │ struct R { s1: S, s2: S } - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -20 │ let R { s1: S { f }, s2 }: &mut R = &mut R { s1: S{f: 0}, s2: S{f: 1} }; f; s2; - │ ------------------------------ - │ │ - │ The value is created but not used. The value does not have the 'drop' ability and must be consumed before the function returns - │ The type '0x8675309::M::R' does not have the ability 'drop' - · -23 │ f; s2; - │ ^ Invalid return - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_unpack_references.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_unpack_references.snap new file mode 100644 index 0000000000000..913ad747f718c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_unpack_references.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/bind_unpack_references.move +--- +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/typing/bind_unpack_references.move:16:14 + │ + 3 │ struct R { s1: S, s2: S } + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +13 │ let R { s1: S { f }, s2 }: &R = &R { s1: S{f: 0}, s2: S{f: 1} }; f; s2; + │ ------------------------------ + │ │ + │ The value is created but not used. The value does not have the 'drop' ability and must be consumed before the function returns + │ The type '0x8675309::M::R' does not have the ability 'drop' + · +16 │ f; s2; + │ ^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/typing/bind_unpack_references.move:23:14 + │ + 3 │ struct R { s1: S, s2: S } + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +20 │ let R { s1: S { f }, s2 }: &mut R = &mut R { s1: S{f: 0}, s2: S{f: 1} }; f; s2; + │ ------------------------------ + │ │ + │ The value is created but not used. The value does not have the 'drop' ability and must be consumed before the function returns + │ The type '0x8675309::M::R' does not have the ability 'drop' + · +23 │ f; s2; + │ ^ Invalid return diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_unpack_references_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_unpack_references_invalid.exp deleted file mode 100644 index bbc0de5a4c14d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_unpack_references_invalid.exp +++ /dev/null @@ -1,65 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_unpack_references_invalid.move:7:9 - │ -6 │ let R { s1: S { f }, s2 } = &R { s1: S{f: 0}, s2: S{f: 1} }; - │ - Expected: '&u64' -7 │ f = 0; - │ ^ - │ │ - │ Invalid assignment to variable 'f' - │ Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_unpack_references_invalid.move:8:9 - │ -6 │ let R { s1: S { f }, s2 } = &R { s1: S{f: 0}, s2: S{f: 1} }; - │ -- Expected: '&0x8675309::M::S' -7 │ f = 0; -8 │ s2 = S { f: 0 } - │ ^^ ---------- Given: '0x8675309::M::S' - │ │ - │ Invalid assignment to variable 's2' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_unpack_references_invalid.move:13:9 - │ -12 │ let R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; - │ - Expected: '&mut u64' -13 │ f = 0; - │ ^ - │ │ - │ Invalid assignment to variable 'f' - │ Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_unpack_references_invalid.move:14:9 - │ -12 │ let R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; - │ -- Expected: '&mut 0x8675309::M::S' -13 │ f = 0; -14 │ s2 = S { f: 0 } - │ ^^ ---------- Given: '0x8675309::M::S' - │ │ - │ Invalid assignment to variable 's2' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/bind_unpack_references_invalid.move:20:9 - │ -19 │ let R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; - │ - Expected: '&mut u64' -20 │ f = &0; - │ ^ -- Given: '&{integer}' - │ │ - │ Invalid assignment to variable 'f' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/bind_unpack_references_invalid.move:21:9 - │ -19 │ let R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; - │ -- Expected: '&mut 0x8675309::M::S' -20 │ f = &0; -21 │ s2 = &S { f: 0 } - │ ^^ ----------- Given: '&0x8675309::M::S' - │ │ - │ Invalid assignment to variable 's2' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_unpack_references_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_unpack_references_invalid.snap new file mode 100644 index 0000000000000..89bff0dbd256d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_unpack_references_invalid.snap @@ -0,0 +1,72 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/bind_unpack_references_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_unpack_references_invalid.move:7:9 + │ +6 │ let R { s1: S { f }, s2 } = &R { s1: S{f: 0}, s2: S{f: 1} }; + │ - Expected: '&u64' +7 │ f = 0; + │ ^ + │ │ + │ Invalid assignment to variable 'f' + │ Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_unpack_references_invalid.move:8:9 + │ +6 │ let R { s1: S { f }, s2 } = &R { s1: S{f: 0}, s2: S{f: 1} }; + │ -- Expected: '&0x8675309::M::S' +7 │ f = 0; +8 │ s2 = S { f: 0 } + │ ^^ ---------- Given: '0x8675309::M::S' + │ │ + │ Invalid assignment to variable 's2' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_unpack_references_invalid.move:13:9 + │ +12 │ let R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; + │ - Expected: '&mut u64' +13 │ f = 0; + │ ^ + │ │ + │ Invalid assignment to variable 'f' + │ Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_unpack_references_invalid.move:14:9 + │ +12 │ let R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; + │ -- Expected: '&mut 0x8675309::M::S' +13 │ f = 0; +14 │ s2 = S { f: 0 } + │ ^^ ---------- Given: '0x8675309::M::S' + │ │ + │ Invalid assignment to variable 's2' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/bind_unpack_references_invalid.move:20:9 + │ +19 │ let R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; + │ - Expected: '&mut u64' +20 │ f = &0; + │ ^ -- Given: '&{integer}' + │ │ + │ Invalid assignment to variable 'f' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/bind_unpack_references_invalid.move:21:9 + │ +19 │ let R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; + │ -- Expected: '&mut 0x8675309::M::S' +20 │ f = &0; +21 │ s2 = &S { f: 0 } + │ ^^ ----------- Given: '&0x8675309::M::S' + │ │ + │ Invalid assignment to variable 's2' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_with_type_annot.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_with_type_annot.snap new file mode 100644 index 0000000000000..e91fe9550971e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_with_type_annot.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/bind_with_type_annot.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_wrong_arity.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_wrong_arity.exp deleted file mode 100644 index 8f7052bdb8735..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_wrong_arity.exp +++ /dev/null @@ -1,35 +0,0 @@ -error[E04005]: expected a single type - ┌─ tests/move_check/typing/bind_wrong_arity.move:5:13 - │ -5 │ let x: () = (); x; - │ ^ -- Expected a single type, but found expression list type: '()' - │ │ - │ Invalid type for local - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_wrong_arity.move:6:13 - │ -6 │ let (): u64 = 0; - │ ^^ --- Given: 'u64' - │ │ - │ Invalid value for binding - │ Expected: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_wrong_arity.move:7:13 - │ -7 │ let (x, b, R{f}): (u64, bool, R, R) = (0, false, R{f: 0}, R{f: 0}); x; b; f; - │ ^^^^^^^^^^^^ ----------------- Given expression list of length 4: '(u64, bool, 0x8675309::M::R, 0x8675309::M::R)' - │ │ - │ Invalid value for binding - │ Expected expression list of length 3: '(_, _, _)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_wrong_arity.move:8:13 - │ -8 │ let (x, b, R{f}): (u64, bool) = (0, false); x; b; f; - │ ^^^^^^^^^^^^ ----------- Given expression list of length 2: '(u64, bool)' - │ │ - │ Invalid value for binding - │ Expected expression list of length 3: '(_, _, _)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_wrong_arity.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_wrong_arity.snap new file mode 100644 index 0000000000000..eca8cf7332e67 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_wrong_arity.snap @@ -0,0 +1,42 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/bind_wrong_arity.move +--- +error[E04005]: expected a single type + ┌─ tests/move_check/typing/bind_wrong_arity.move:5:13 + │ +5 │ let x: () = (); x; + │ ^ -- Expected a single type, but found expression list type: '()' + │ │ + │ Invalid type for local + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_wrong_arity.move:6:13 + │ +6 │ let (): u64 = 0; + │ ^^ --- Given: 'u64' + │ │ + │ Invalid value for binding + │ Expected: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_wrong_arity.move:7:13 + │ +7 │ let (x, b, R{f}): (u64, bool, R, R) = (0, false, R{f: 0}, R{f: 0}); x; b; f; + │ ^^^^^^^^^^^^ ----------------- Given expression list of length 4: '(u64, bool, 0x8675309::M::R, 0x8675309::M::R)' + │ │ + │ Invalid value for binding + │ Expected expression list of length 3: '(_, _, _)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_wrong_arity.move:8:13 + │ +8 │ let (x, b, R{f}): (u64, bool) = (0, false); x; b; f; + │ ^^^^^^^^^^^^ ----------- Given expression list of length 2: '(u64, bool)' + │ │ + │ Invalid value for binding + │ Expected expression list of length 3: '(_, _, _)' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_wrong_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_wrong_type.exp deleted file mode 100644 index c6cd1d923c5dc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_wrong_type.exp +++ /dev/null @@ -1,124 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_wrong_type.move:6:13 - │ -6 │ let S { g } = R {f :0}; g; - │ ^^^^^^^ -------- Expected: '0x8675309::M::R' - │ │ - │ Invalid deconstruction binding - │ Given: '0x8675309::M::S' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_wrong_type.move:7:14 - │ -7 │ let (S { g }, R { f }) = (R{ f: 0 }, R{ f: 1 }); g; f; - │ ^^^^^^^ --------- Expected: '0x8675309::M::R' - │ │ - │ Invalid deconstruction binding - │ Given: '0x8675309::M::S' - -error[E04005]: expected a single type - ┌─ tests/move_check/typing/bind_wrong_type.move:11:13 - │ -11 │ let x = (); x; - │ ^ -- Expected a single type, but found expression list type: '()' - │ │ - │ Invalid type for local - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_wrong_type.move:12:13 - │ -12 │ let () = 0; - │ ^^ - Given: integer - │ │ - │ Invalid value for binding - │ Expected: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_wrong_type.move:13:13 - │ -13 │ let (x, b, R{f}) = (0, false, R{f: 0}, R{f: 0}); x; b; f; - │ ^^^^^^^^^^^^ ---------------------------- Given expression list of length 4: '({integer}, bool, 0x8675309::M::R, 0x8675309::M::R)' - │ │ - │ Invalid value for binding - │ Expected expression list of length 3: '(_, _, _)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_wrong_type.move:14:13 - │ -14 │ let (x, b, R{f}) = (0, false); x; b; f; - │ ^^^^^^^^^^^^ ---------- Given expression list of length 2: '({integer}, bool)' - │ │ - │ Invalid value for binding - │ Expected expression list of length 3: '(_, _, _)' - -error[E04005]: expected a single type - ┌─ tests/move_check/typing/bind_wrong_type.move:18:13 - │ -18 │ let x: () = 0; x; - │ ^ -- Expected a single type, but found expression list type: '()' - │ │ - │ Invalid type for local - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_wrong_type.move:18:16 - │ -18 │ let x: () = 0; x; - │ ^^ - Given: integer - │ │ - │ Invalid type annotation - │ Expected: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_wrong_type.move:19:13 - │ -19 │ let (): u64 = (); - │ ^^ --- Given: 'u64' - │ │ - │ Invalid value for binding - │ Expected: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_wrong_type.move:19:17 - │ -19 │ let (): u64 = (); - │ ^^^ -- Given: '()' - │ │ - │ Invalid type annotation - │ Expected: 'u64' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_wrong_type.move:20:13 - │ -20 │ let (x, b, R{f}): (u64, bool, R, R) = (0, false, R{f: 0}); x; b; f; - │ ^^^^^^^^^^^^ ----------------- Given expression list of length 4: '(u64, bool, 0x8675309::M::R, 0x8675309::M::R)' - │ │ - │ Invalid value for binding - │ Expected expression list of length 3: '(_, _, _)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_wrong_type.move:20:27 - │ -20 │ let (x, b, R{f}): (u64, bool, R, R) = (0, false, R{f: 0}); x; b; f; - │ ^^^^^^^^^^^^^^^^^ ------------------- Given expression list of length 3: '({integer}, bool, 0x8675309::M::R)' - │ │ - │ Invalid type annotation - │ Expected expression list of length 4: '(u64, bool, 0x8675309::M::R, 0x8675309::M::R)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_wrong_type.move:21:13 - │ -21 │ let (x, b, R{f}): (u64, bool) = (0, false, R{f: 0}); x; b; f; - │ ^^^^^^^^^^^^ ----------- Given expression list of length 2: '(u64, bool)' - │ │ - │ Invalid value for binding - │ Expected expression list of length 3: '(_, _, _)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/bind_wrong_type.move:21:27 - │ -21 │ let (x, b, R{f}): (u64, bool) = (0, false, R{f: 0}); x; b; f; - │ ^^^^^^^^^^^ ------------------- Given expression list of length 3: '({integer}, bool, 0x8675309::M::R)' - │ │ - │ Invalid type annotation - │ Expected expression list of length 2: '(u64, bool)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_wrong_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_wrong_type.snap new file mode 100644 index 0000000000000..186e71d4cec70 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/bind_wrong_type.snap @@ -0,0 +1,131 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/bind_wrong_type.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_wrong_type.move:6:13 + │ +6 │ let S { g } = R {f :0}; g; + │ ^^^^^^^ -------- Expected: '0x8675309::M::R' + │ │ + │ Invalid deconstruction binding + │ Given: '0x8675309::M::S' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_wrong_type.move:7:14 + │ +7 │ let (S { g }, R { f }) = (R{ f: 0 }, R{ f: 1 }); g; f; + │ ^^^^^^^ --------- Expected: '0x8675309::M::R' + │ │ + │ Invalid deconstruction binding + │ Given: '0x8675309::M::S' + +error[E04005]: expected a single type + ┌─ tests/move_check/typing/bind_wrong_type.move:11:13 + │ +11 │ let x = (); x; + │ ^ -- Expected a single type, but found expression list type: '()' + │ │ + │ Invalid type for local + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_wrong_type.move:12:13 + │ +12 │ let () = 0; + │ ^^ - Given: integer + │ │ + │ Invalid value for binding + │ Expected: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_wrong_type.move:13:13 + │ +13 │ let (x, b, R{f}) = (0, false, R{f: 0}, R{f: 0}); x; b; f; + │ ^^^^^^^^^^^^ ---------------------------- Given expression list of length 4: '({integer}, bool, 0x8675309::M::R, 0x8675309::M::R)' + │ │ + │ Invalid value for binding + │ Expected expression list of length 3: '(_, _, _)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_wrong_type.move:14:13 + │ +14 │ let (x, b, R{f}) = (0, false); x; b; f; + │ ^^^^^^^^^^^^ ---------- Given expression list of length 2: '({integer}, bool)' + │ │ + │ Invalid value for binding + │ Expected expression list of length 3: '(_, _, _)' + +error[E04005]: expected a single type + ┌─ tests/move_check/typing/bind_wrong_type.move:18:13 + │ +18 │ let x: () = 0; x; + │ ^ -- Expected a single type, but found expression list type: '()' + │ │ + │ Invalid type for local + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_wrong_type.move:18:16 + │ +18 │ let x: () = 0; x; + │ ^^ - Given: integer + │ │ + │ Invalid type annotation + │ Expected: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_wrong_type.move:19:13 + │ +19 │ let (): u64 = (); + │ ^^ --- Given: 'u64' + │ │ + │ Invalid value for binding + │ Expected: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_wrong_type.move:19:17 + │ +19 │ let (): u64 = (); + │ ^^^ -- Given: '()' + │ │ + │ Invalid type annotation + │ Expected: 'u64' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_wrong_type.move:20:13 + │ +20 │ let (x, b, R{f}): (u64, bool, R, R) = (0, false, R{f: 0}); x; b; f; + │ ^^^^^^^^^^^^ ----------------- Given expression list of length 4: '(u64, bool, 0x8675309::M::R, 0x8675309::M::R)' + │ │ + │ Invalid value for binding + │ Expected expression list of length 3: '(_, _, _)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_wrong_type.move:20:27 + │ +20 │ let (x, b, R{f}): (u64, bool, R, R) = (0, false, R{f: 0}); x; b; f; + │ ^^^^^^^^^^^^^^^^^ ------------------- Given expression list of length 3: '({integer}, bool, 0x8675309::M::R)' + │ │ + │ Invalid type annotation + │ Expected expression list of length 4: '(u64, bool, 0x8675309::M::R, 0x8675309::M::R)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_wrong_type.move:21:13 + │ +21 │ let (x, b, R{f}): (u64, bool) = (0, false, R{f: 0}); x; b; f; + │ ^^^^^^^^^^^^ ----------- Given expression list of length 2: '(u64, bool)' + │ │ + │ Invalid value for binding + │ Expected expression list of length 3: '(_, _, _)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/bind_wrong_type.move:21:27 + │ +21 │ let (x, b, R{f}): (u64, bool) = (0, false, R{f: 0}); x; b; f; + │ ^^^^^^^^^^^ ------------------- Given expression list of length 3: '({integer}, bool, 0x8675309::M::R)' + │ │ + │ Invalid type annotation + │ Expected expression list of length 2: '(u64, bool)' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/block_empty.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/block_empty.snap new file mode 100644 index 0000000000000..3f20d48c079fe --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/block_empty.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/block_empty.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/block_empty_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/block_empty_invalid.exp deleted file mode 100644 index 1759e4d367281..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/block_empty_invalid.exp +++ /dev/null @@ -1,30 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/block_empty_invalid.move:3:14 - │ -3 │ ({}: u64); - │ -- ^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: 'u64' - │ Given: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/block_empty_invalid.move:4:14 - │ -4 │ ({}: &u64); - │ -- ^^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: '&u64' - │ Given: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/block_empty_invalid.move:5:14 - │ -5 │ ({}: (u64, bool)); - │ -- ^^^^^^^^^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: '(u64, bool)' - │ Given: '()' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/block_empty_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/block_empty_invalid.snap new file mode 100644 index 0000000000000..8cd4fafb72b93 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/block_empty_invalid.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/block_empty_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/block_empty_invalid.move:3:14 + │ +3 │ ({}: u64); + │ -- ^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: 'u64' + │ Given: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/block_empty_invalid.move:4:14 + │ +4 │ ({}: &u64); + │ -- ^^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: '&u64' + │ Given: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/block_empty_invalid.move:5:14 + │ +5 │ ({}: (u64, bool)); + │ -- ^^^^^^^^^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: '(u64, bool)' + │ Given: '()' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/block_single_expr.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/block_single_expr.snap new file mode 100644 index 0000000000000..c4a8694744818 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/block_single_expr.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/block_single_expr.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/block_single_expr_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/block_single_expr_invalid.exp deleted file mode 100644 index 15173b93d439a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/block_single_expr_invalid.exp +++ /dev/null @@ -1,52 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/block_single_expr_invalid.move:4:18 - │ -4 │ ({ 0 } : bool); - │ - ^^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: 'bool' - │ Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/block_single_expr_invalid.move:5:19 - │ -5 │ ({ &0 } : u64); - │ -- ^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: 'u64' - │ Given: '&{integer}' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/block_single_expr_invalid.move:6:23 - │ -6 │ ({ &mut 0 } : ()); - │ ------ ^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: '()' - │ Given: '&mut {integer}' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/block_single_expr_invalid.move:7:9 - │ -2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -7 │ ({ R {} } : R); - │ ^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/block_single_expr_invalid.move:8:34 - │ -8 │ ({ (0, false, false) } : (u64, bool)); - │ ----------------- ^^^^^^^^^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected expression list of length 2: '(u64, bool)' - │ Given expression list of length 3: '({integer}, bool, bool)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/block_single_expr_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/block_single_expr_invalid.snap new file mode 100644 index 0000000000000..98fc29b96b4e0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/block_single_expr_invalid.snap @@ -0,0 +1,59 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/block_single_expr_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/block_single_expr_invalid.move:4:18 + │ +4 │ ({ 0 } : bool); + │ - ^^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: 'bool' + │ Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/block_single_expr_invalid.move:5:19 + │ +5 │ ({ &0 } : u64); + │ -- ^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: 'u64' + │ Given: '&{integer}' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/block_single_expr_invalid.move:6:23 + │ +6 │ ({ &mut 0 } : ()); + │ ------ ^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: '()' + │ Given: '&mut {integer}' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/block_single_expr_invalid.move:7:9 + │ +2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +7 │ ({ R {} } : R); + │ ^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/block_single_expr_invalid.move:8:34 + │ +8 │ ({ (0, false, false) } : (u64, bool)); + │ ----------------- ^^^^^^^^^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected expression list of length 2: '(u64, bool)' + │ Given expression list of length 3: '({integer}, bool, bool)' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/block_with_statements.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/block_with_statements.snap new file mode 100644 index 0000000000000..fbd57b012854d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/block_with_statements.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/block_with_statements.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/block_with_statements_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/block_with_statements_invalid.exp deleted file mode 100644 index f1d9b5f3ae7e5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/block_with_statements_invalid.exp +++ /dev/null @@ -1,52 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/block_with_statements_invalid.move:4:29 - │ -4 │ ({ let x = 0; x } : bool); - │ - ^^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: 'bool' - │ Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/block_with_statements_invalid.move:5:30 - │ -5 │ ({ let x = 0; &x } : u64); - │ -- ^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: 'u64' - │ Given: '&{integer}' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/block_with_statements_invalid.move:6:40 - │ -6 │ ({ let y = 0; &mut (y + 1) } : ()); - │ ------------ ^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: '()' - │ Given: '&mut {integer}' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/block_with_statements_invalid.move:7:9 - │ -2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -7 │ ({ let r = { let r = R {}; r }; r } : R); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/block_with_statements_invalid.move:8:45 - │ -8 │ ({ let x = 0; (x, false, false) } : (u64, bool)); - │ ----------------- ^^^^^^^^^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected expression list of length 2: '(u64, bool)' - │ Given expression list of length 3: '({integer}, bool, bool)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/block_with_statements_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/block_with_statements_invalid.snap new file mode 100644 index 0000000000000..9af2faa1a54ee --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/block_with_statements_invalid.snap @@ -0,0 +1,59 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/block_with_statements_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/block_with_statements_invalid.move:4:29 + │ +4 │ ({ let x = 0; x } : bool); + │ - ^^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: 'bool' + │ Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/block_with_statements_invalid.move:5:30 + │ +5 │ ({ let x = 0; &x } : u64); + │ -- ^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: 'u64' + │ Given: '&{integer}' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/block_with_statements_invalid.move:6:40 + │ +6 │ ({ let y = 0; &mut (y + 1) } : ()); + │ ------------ ^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: '()' + │ Given: '&mut {integer}' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/block_with_statements_invalid.move:7:9 + │ +2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +7 │ ({ let r = { let r = R {}; r }; r } : R); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/block_with_statements_invalid.move:8:45 + │ +8 │ ({ let x = 0; (x, false, false) } : (u64, bool)); + │ ----------------- ^^^^^^^^^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected expression list of length 2: '(u64, bool)' + │ Given expression list of length 3: '({integer}, bool, bool)' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_divergent.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_divergent.exp deleted file mode 100644 index 941e9c0834b13..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_divergent.exp +++ /dev/null @@ -1,24 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/typing/borrow_divergent.move:4:13 - │ -4 │ &break; - │ ^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/typing/borrow_divergent.move:9:12 - │ -9 │ &{ return }; - │ ^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/typing/borrow_divergent.move:13:11 - │ -13 │ &(if (cond) return else return); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_divergent.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_divergent.snap new file mode 100644 index 0000000000000..ddb84d8e21d6c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_divergent.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/borrow_divergent.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/typing/borrow_divergent.move:4:13 + │ +4 │ &break; + │ ^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/typing/borrow_divergent.move:9:12 + │ +9 │ &{ return }; + │ ^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/typing/borrow_divergent.move:13:11 + │ +13 │ &(if (cond) return else return); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field.snap new file mode 100644 index 0000000000000..33072d43b7665 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/borrow_field.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_chain.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_chain.snap new file mode 100644 index 0000000000000..851e40c33f45c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_chain.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/borrow_field_chain.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_chain_missing.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_chain_missing.exp deleted file mode 100644 index 1f2762725408b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_chain_missing.exp +++ /dev/null @@ -1,54 +0,0 @@ -error[E03010]: unbound field - ┌─ tests/move_check/typing/borrow_field_chain_missing.move:7:10 - │ -7 │ &x1.f; - │ ^^^^ Unbound field 'f' in '0x8675309::M::X1' - -error[E03010]: unbound field - ┌─ tests/move_check/typing/borrow_field_chain_missing.move:8:10 - │ -8 │ &x1.x2.f; - │ ^^^^^^^ Unbound field 'f' in '0x8675309::M::X2' - -error[E03010]: unbound field - ┌─ tests/move_check/typing/borrow_field_chain_missing.move:9:10 - │ -9 │ &x1.x2.x3.g; - │ ^^^^^^^^^^ Unbound field 'g' in '0x8675309::M::X3' - -error[E03010]: unbound field - ┌─ tests/move_check/typing/borrow_field_chain_missing.move:11:10 - │ -11 │ &x1_mut.f; - │ ^^^^^^^^ Unbound field 'f' in '0x8675309::M::X1' - -error[E03010]: unbound field - ┌─ tests/move_check/typing/borrow_field_chain_missing.move:12:10 - │ -12 │ &x1_mut.x2.f; - │ ^^^^^^^^^^^ Unbound field 'f' in '0x8675309::M::X2' - -error[E03010]: unbound field - ┌─ tests/move_check/typing/borrow_field_chain_missing.move:13:10 - │ -13 │ &x1_mut.x2.x3.g; - │ ^^^^^^^^^^^^^^ Unbound field 'g' in '0x8675309::M::X3' - -error[E03010]: unbound field - ┌─ tests/move_check/typing/borrow_field_chain_missing.move:15:14 - │ -15 │ &mut x1_mut.f; - │ ^^^^^^^^ Unbound field 'f' in '0x8675309::M::X1' - -error[E03010]: unbound field - ┌─ tests/move_check/typing/borrow_field_chain_missing.move:16:14 - │ -16 │ &mut x1_mut.x2.f; - │ ^^^^^^^^^^^ Unbound field 'f' in '0x8675309::M::X2' - -error[E03010]: unbound field - ┌─ tests/move_check/typing/borrow_field_chain_missing.move:17:14 - │ -17 │ &mut x1_mut.x2.x3.g; - │ ^^^^^^^^^^^^^^ Unbound field 'g' in '0x8675309::M::X3' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_chain_missing.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_chain_missing.snap new file mode 100644 index 0000000000000..72aa18aa7bba4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_chain_missing.snap @@ -0,0 +1,61 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/borrow_field_chain_missing.move +--- +error[E03010]: unbound field + ┌─ tests/move_check/typing/borrow_field_chain_missing.move:7:10 + │ +7 │ &x1.f; + │ ^^^^ Unbound field 'f' in '0x8675309::M::X1' + +error[E03010]: unbound field + ┌─ tests/move_check/typing/borrow_field_chain_missing.move:8:10 + │ +8 │ &x1.x2.f; + │ ^^^^^^^ Unbound field 'f' in '0x8675309::M::X2' + +error[E03010]: unbound field + ┌─ tests/move_check/typing/borrow_field_chain_missing.move:9:10 + │ +9 │ &x1.x2.x3.g; + │ ^^^^^^^^^^ Unbound field 'g' in '0x8675309::M::X3' + +error[E03010]: unbound field + ┌─ tests/move_check/typing/borrow_field_chain_missing.move:11:10 + │ +11 │ &x1_mut.f; + │ ^^^^^^^^ Unbound field 'f' in '0x8675309::M::X1' + +error[E03010]: unbound field + ┌─ tests/move_check/typing/borrow_field_chain_missing.move:12:10 + │ +12 │ &x1_mut.x2.f; + │ ^^^^^^^^^^^ Unbound field 'f' in '0x8675309::M::X2' + +error[E03010]: unbound field + ┌─ tests/move_check/typing/borrow_field_chain_missing.move:13:10 + │ +13 │ &x1_mut.x2.x3.g; + │ ^^^^^^^^^^^^^^ Unbound field 'g' in '0x8675309::M::X3' + +error[E03010]: unbound field + ┌─ tests/move_check/typing/borrow_field_chain_missing.move:15:14 + │ +15 │ &mut x1_mut.f; + │ ^^^^^^^^ Unbound field 'f' in '0x8675309::M::X1' + +error[E03010]: unbound field + ┌─ tests/move_check/typing/borrow_field_chain_missing.move:16:14 + │ +16 │ &mut x1_mut.x2.f; + │ ^^^^^^^^^^^ Unbound field 'f' in '0x8675309::M::X2' + +error[E03010]: unbound field + ┌─ tests/move_check/typing/borrow_field_chain_missing.move:17:14 + │ +17 │ &mut x1_mut.x2.x3.g; + │ ^^^^^^^^^^^^^^ Unbound field 'g' in '0x8675309::M::X3' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_complex_root_expr.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_complex_root_expr.snap new file mode 100644 index 0000000000000..097f0e109a44d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_complex_root_expr.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/borrow_field_complex_root_expr.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_from_non_struct.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_from_non_struct.exp deleted file mode 100644 index 6e21652c62a2d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_from_non_struct.exp +++ /dev/null @@ -1,90 +0,0 @@ -error[E04009]: expected specific type - ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:6:10 - │ -6 │ &0.f; - │ ^^^ - │ │ - │ Unbound field 'f' - │ Expected a struct type in the current module but got: integer - -error[E04009]: expected specific type - ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:7:10 - │ -7 │ &0.g; - │ ^^^ - │ │ - │ Unbound field 'g' - │ Expected a struct type in the current module but got: integer - -error[E04009]: expected specific type - ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:8:10 - │ -5 │ fun t0(u: u64, cond: bool, addr: address) { - │ --- Expected a struct type in the current module but got: 'u64' - · -8 │ &u.value; - │ ^^^^^^^ Unbound field 'value' - -error[E04009]: expected specific type - ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:9:10 - │ -5 │ fun t0(u: u64, cond: bool, addr: address) { - │ ---- Expected a struct type in the current module but got: 'bool' - · -9 │ &cond.value; - │ ^^^^^^^^^^ Unbound field 'value' - -error[E04009]: expected specific type - ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:10:10 - │ - 5 │ fun t0(u: u64, cond: bool, addr: address) { - │ ------- Expected a struct type in the current module but got: 'address' - · -10 │ &addr.R; - │ ^^^^^^ Unbound field 'R' - -error[E04009]: expected specific type - ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:11:10 - │ - 5 │ fun t0(u: u64, cond: bool, addr: address) { - │ ------- Expected a struct type in the current module but got: 'address' - · -11 │ &addr.f; - │ ^^^^^^ Unbound field 'f' - -error[E04005]: expected a single type - ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:12:10 - │ -12 │ &().R; - │ ^^ - │ │ - │ Invalid dot access - │ Expected a single type, but found expression list type: '()' - -error[E04009]: expected specific type - ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:12:10 - │ -12 │ &().R; - │ ^^^^ - │ │ - │ Unbound field 'R' - │ Expected a struct type in the current module but got: '()' - -error[E04005]: expected a single type - ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:13:10 - │ -13 │ &(&S{f: 0}, &S{f:0}).f; - │ ^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid dot access - │ Expected a single type, but found expression list type: '(&0x8675309::M::S, &0x8675309::M::S)' - -error[E04009]: expected specific type - ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:13:10 - │ -13 │ &(&S{f: 0}, &S{f:0}).f; - │ ^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Unbound field 'f' - │ Expected a struct type in the current module but got: '(&0x8675309::M::S, &0x8675309::M::S)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_from_non_struct.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_from_non_struct.snap new file mode 100644 index 0000000000000..4e8798d5973c7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_from_non_struct.snap @@ -0,0 +1,97 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/borrow_field_from_non_struct.move +--- +error[E04009]: expected specific type + ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:6:10 + │ +6 │ &0.f; + │ ^^^ + │ │ + │ Unbound field 'f' + │ Expected a struct type in the current module but got: integer + +error[E04009]: expected specific type + ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:7:10 + │ +7 │ &0.g; + │ ^^^ + │ │ + │ Unbound field 'g' + │ Expected a struct type in the current module but got: integer + +error[E04009]: expected specific type + ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:8:10 + │ +5 │ fun t0(u: u64, cond: bool, addr: address) { + │ --- Expected a struct type in the current module but got: 'u64' + · +8 │ &u.value; + │ ^^^^^^^ Unbound field 'value' + +error[E04009]: expected specific type + ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:9:10 + │ +5 │ fun t0(u: u64, cond: bool, addr: address) { + │ ---- Expected a struct type in the current module but got: 'bool' + · +9 │ &cond.value; + │ ^^^^^^^^^^ Unbound field 'value' + +error[E04009]: expected specific type + ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:10:10 + │ + 5 │ fun t0(u: u64, cond: bool, addr: address) { + │ ------- Expected a struct type in the current module but got: 'address' + · +10 │ &addr.R; + │ ^^^^^^ Unbound field 'R' + +error[E04009]: expected specific type + ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:11:10 + │ + 5 │ fun t0(u: u64, cond: bool, addr: address) { + │ ------- Expected a struct type in the current module but got: 'address' + · +11 │ &addr.f; + │ ^^^^^^ Unbound field 'f' + +error[E04005]: expected a single type + ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:12:10 + │ +12 │ &().R; + │ ^^ + │ │ + │ Invalid dot access + │ Expected a single type, but found expression list type: '()' + +error[E04009]: expected specific type + ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:12:10 + │ +12 │ &().R; + │ ^^^^ + │ │ + │ Unbound field 'R' + │ Expected a struct type in the current module but got: '()' + +error[E04005]: expected a single type + ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:13:10 + │ +13 │ &(&S{f: 0}, &S{f:0}).f; + │ ^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid dot access + │ Expected a single type, but found expression list type: '(&0x8675309::M::S, &0x8675309::M::S)' + +error[E04009]: expected specific type + ┌─ tests/move_check/typing/borrow_field_from_non_struct.move:13:10 + │ +13 │ &(&S{f: 0}, &S{f:0}).f; + │ ^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Unbound field 'f' + │ Expected a struct type in the current module but got: '(&0x8675309::M::S, &0x8675309::M::S)' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_internal.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_internal.exp deleted file mode 100644 index b9713b42f99f9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_internal.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/borrow_field_internal.move:13:11 - │ -13 │ (&X::s().f: &u64); - │ ^^^^^^^^ Invalid access of field 'f' on the struct '0x2::X::S'. The field 'f' can only be accessed within the module '0x2::X' since it defines 'S' - -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/borrow_field_internal.move:15:11 - │ -15 │ (&s.f: &u64); - │ ^^^ Invalid access of field 'f' on the struct '0x2::X::S'. The field 'f' can only be accessed within the module '0x2::X' since it defines 'S' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_internal.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_internal.snap new file mode 100644 index 0000000000000..ece41b25a2a27 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_internal.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/borrow_field_internal.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/borrow_field_internal.move:13:11 + │ +13 │ (&X::s().f: &u64); + │ ^^^^^^^^ Invalid access of field 'f' on the struct '0x2::X::S'. The field 'f' can only be accessed within the module '0x2::X' since it defines 'S' + +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/borrow_field_internal.move:15:11 + │ +15 │ (&s.f: &u64); + │ ^^^ Invalid access of field 'f' on the struct '0x2::X::S'. The field 'f' can only be accessed within the module '0x2::X' since it defines 'S' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_missing.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_missing.exp deleted file mode 100644 index 596f162555d66..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_missing.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E03010]: unbound field - ┌─ tests/move_check/typing/borrow_field_missing.move:5:10 - │ -5 │ &s.g; - │ ^^^ Unbound field 'g' in '0x8675309::M::S' - -error[E03010]: unbound field - ┌─ tests/move_check/typing/borrow_field_missing.move:6:10 - │ -6 │ &s_mut.h; - │ ^^^^^^^ Unbound field 'h' in '0x8675309::M::S' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_missing.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_missing.snap new file mode 100644 index 0000000000000..9f3a57c3c03fb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_missing.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/borrow_field_missing.move +--- +error[E03010]: unbound field + ┌─ tests/move_check/typing/borrow_field_missing.move:5:10 + │ +5 │ &s.g; + │ ^^^ Unbound field 'g' in '0x8675309::M::S' + +error[E03010]: unbound field + ┌─ tests/move_check/typing/borrow_field_missing.move:6:10 + │ +6 │ &s_mut.h; + │ ^^^^^^^ Unbound field 'h' in '0x8675309::M::S' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_non_ref_non_local_root.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_non_ref_non_local_root.exp deleted file mode 100644 index 719d6d6a4b1ee..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_non_ref_non_local_root.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/borrow_field_non_ref_non_local_root.move:9:22 - │ - 2 │ struct S has drop { f: u64 } - │ - To satisfy the constraint, the 'copy' ability would need to be added here - · - 9 │ (&(if (cond) *foo() else bar()).f : &u64); - │ ^^^^^^ Invalid dereference. Dereference requires the 'copy' ability - · -12 │ fun foo(): &S { - │ - The type '0x8675309::M::S' does not have the ability 'copy' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_non_ref_non_local_root.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_non_ref_non_local_root.snap new file mode 100644 index 0000000000000..9e1334dbd5cfc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_non_ref_non_local_root.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/borrow_field_non_ref_non_local_root.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/borrow_field_non_ref_non_local_root.move:9:22 + │ + 2 │ struct S has drop { f: u64 } + │ - To satisfy the constraint, the 'copy' ability would need to be added here + · + 9 │ (&(if (cond) *foo() else bar()).f : &u64); + │ ^^^^^^ Invalid dereference. Dereference requires the 'copy' ability + · +12 │ fun foo(): &S { + │ - The type '0x8675309::M::S' does not have the ability 'copy' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_non_ref_root.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_non_ref_root.snap new file mode 100644 index 0000000000000..aa9fd6f1a5253 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_field_non_ref_root.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/borrow_field_non_ref_root.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local.snap new file mode 100644 index 0000000000000..5b0e873f9b9c2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/borrow_local.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_invalid.exp deleted file mode 100644 index ad4064fda876a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_invalid.exp +++ /dev/null @@ -1,35 +0,0 @@ -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/borrow_local_invalid.move:3:9 - │ -2 │ fun t0(r: &u64, r_mut: &mut u64) { - │ ---- Expected a single non-reference type, but found: '&u64' -3 │ &r; - │ ^^ Invalid borrow - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/borrow_local_invalid.move:4:9 - │ -2 │ fun t0(r: &u64, r_mut: &mut u64) { - │ -------- Expected a single non-reference type, but found: '&mut u64' -3 │ &r; -4 │ &r_mut; - │ ^^^^^^ Invalid borrow - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/borrow_local_invalid.move:5:9 - │ -2 │ fun t0(r: &u64, r_mut: &mut u64) { - │ ---- Expected a single non-reference type, but found: '&u64' - · -5 │ &mut r; - │ ^^^^^^ Invalid borrow - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/borrow_local_invalid.move:6:9 - │ -2 │ fun t0(r: &u64, r_mut: &mut u64) { - │ -------- Expected a single non-reference type, but found: '&mut u64' - · -6 │ &mut r_mut; - │ ^^^^^^^^^^ Invalid borrow - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_invalid.snap new file mode 100644 index 0000000000000..4d2357ab89b81 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_invalid.snap @@ -0,0 +1,42 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/borrow_local_invalid.move +--- +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/borrow_local_invalid.move:3:9 + │ +2 │ fun t0(r: &u64, r_mut: &mut u64) { + │ ---- Expected a single non-reference type, but found: '&u64' +3 │ &r; + │ ^^ Invalid borrow + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/borrow_local_invalid.move:4:9 + │ +2 │ fun t0(r: &u64, r_mut: &mut u64) { + │ -------- Expected a single non-reference type, but found: '&mut u64' +3 │ &r; +4 │ &r_mut; + │ ^^^^^^ Invalid borrow + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/borrow_local_invalid.move:5:9 + │ +2 │ fun t0(r: &u64, r_mut: &mut u64) { + │ ---- Expected a single non-reference type, but found: '&u64' + · +5 │ &mut r; + │ ^^^^^^ Invalid borrow + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/borrow_local_invalid.move:6:9 + │ +2 │ fun t0(r: &u64, r_mut: &mut u64) { + │ -------- Expected a single non-reference type, but found: '&mut u64' + · +6 │ &mut r_mut; + │ ^^^^^^^^^^ Invalid borrow diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_temp.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_temp.snap new file mode 100644 index 0000000000000..62b91d8e25795 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_temp.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/borrow_local_temp.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_temp_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_temp_invalid.exp deleted file mode 100644 index d0c8638236490..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_temp_invalid.exp +++ /dev/null @@ -1,63 +0,0 @@ -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/borrow_local_temp_invalid.move:3:9 - │ -3 │ &(); - │ ^^^ - │ ││ - │ │Expected a single non-reference type, but found: '()' - │ Invalid borrow - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/borrow_local_temp_invalid.move:4:9 - │ -4 │ &(0, 1); - │ ^^^^^^^ - │ ││ - │ │Expected a single non-reference type, but found: '(u64, u64)' - │ Invalid borrow - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/borrow_local_temp_invalid.move:5:9 - │ -5 │ &(0, 1, true, @0x0); - │ ^^^^^^^^^^^^^^^^^^^ - │ ││ - │ │Expected a single non-reference type, but found: '(u64, u64, bool, address)' - │ Invalid borrow - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/borrow_local_temp_invalid.move:9:9 - │ -9 │ &(&0); - │ ^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&u64' - │ Invalid borrow - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/borrow_local_temp_invalid.move:10:9 - │ -10 │ &(&mut 1); - │ ^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&mut u64' - │ Invalid borrow - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/borrow_local_temp_invalid.move:11:9 - │ -11 │ &mut &2; - │ ^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&u64' - │ Invalid borrow - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/borrow_local_temp_invalid.move:12:9 - │ -12 │ &mut &mut 3; - │ ^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&mut u64' - │ Invalid borrow - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_temp_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_temp_invalid.snap new file mode 100644 index 0000000000000..f5461e014d328 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_temp_invalid.snap @@ -0,0 +1,70 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/borrow_local_temp_invalid.move +--- +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/borrow_local_temp_invalid.move:3:9 + │ +3 │ &(); + │ ^^^ + │ ││ + │ │Expected a single non-reference type, but found: '()' + │ Invalid borrow + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/borrow_local_temp_invalid.move:4:9 + │ +4 │ &(0, 1); + │ ^^^^^^^ + │ ││ + │ │Expected a single non-reference type, but found: '(u64, u64)' + │ Invalid borrow + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/borrow_local_temp_invalid.move:5:9 + │ +5 │ &(0, 1, true, @0x0); + │ ^^^^^^^^^^^^^^^^^^^ + │ ││ + │ │Expected a single non-reference type, but found: '(u64, u64, bool, address)' + │ Invalid borrow + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/borrow_local_temp_invalid.move:9:9 + │ +9 │ &(&0); + │ ^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&u64' + │ Invalid borrow + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/borrow_local_temp_invalid.move:10:9 + │ +10 │ &(&mut 1); + │ ^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&mut u64' + │ Invalid borrow + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/borrow_local_temp_invalid.move:11:9 + │ +11 │ &mut &2; + │ ^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&u64' + │ Invalid borrow + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/borrow_local_temp_invalid.move:12:9 + │ +12 │ &mut &mut 3; + │ ^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&mut u64' + │ Invalid borrow diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_temp_resource.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_temp_resource.exp deleted file mode 100644 index 4634b047a00c5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_temp_resource.exp +++ /dev/null @@ -1,26 +0,0 @@ -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/typing/borrow_local_temp_resource.move:7:17 - │ -3 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -6 │ &R{}; - │ --- - │ │ - │ The value is created but not used. The value does not have the 'drop' ability and must be consumed before the function returns - │ The type '0x8675309::M::R' does not have the ability 'drop' -7 │ &mut R{}; - │ ^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/typing/borrow_local_temp_resource.move:7:17 - │ -3 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -7 │ &mut R{}; - │ ---^ Invalid return - │ │ - │ The value is created but not used. The value does not have the 'drop' ability and must be consumed before the function returns - │ The type '0x8675309::M::R' does not have the ability 'drop' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_temp_resource.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_temp_resource.snap new file mode 100644 index 0000000000000..20bc127095350 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/borrow_local_temp_resource.snap @@ -0,0 +1,33 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/borrow_local_temp_resource.move +--- +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/typing/borrow_local_temp_resource.move:7:17 + │ +3 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +6 │ &R{}; + │ --- + │ │ + │ The value is created but not used. The value does not have the 'drop' ability and must be consumed before the function returns + │ The type '0x8675309::M::R' does not have the ability 'drop' +7 │ &mut R{}; + │ ^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/typing/borrow_local_temp_resource.move:7:17 + │ +3 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +7 │ &mut R{}; + │ ---^ Invalid return + │ │ + │ The value is created but not used. The value does not have the 'drop' ability and must be consumed before the function returns + │ The type '0x8675309::M::R' does not have the ability 'drop' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/break_any_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/break_any_type.exp deleted file mode 100644 index 46a6c8fb14503..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/break_any_type.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/typing/break_any_type.move:6:17 - │ -6 │ 0 + break; - │ ^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/typing/break_any_type.move:12:17 - │ -12 │ foo(break) - │ ^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/break_any_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/break_any_type.snap new file mode 100644 index 0000000000000..e8753e13d072b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/break_any_type.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/break_any_type.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/typing/break_any_type.move:6:17 + │ +6 │ 0 + break; + │ ^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/typing/break_any_type.move:12:17 + │ +12 │ foo(break) + │ ^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/break_outside_loop.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/break_outside_loop.exp deleted file mode 100644 index 3aea67b73d791..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/break_outside_loop.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E04014]: invalid loop control - ┌─ tests/move_check/typing/break_outside_loop.move:6:9 - │ -6 │ break - │ ^^^^^ Invalid usage of 'break'. 'break' can only be used inside a loop body or lambda - -error[E04014]: invalid loop control - ┌─ tests/move_check/typing/break_outside_loop.move:10:9 - │ -10 │ break; - │ ^^^^^ Invalid usage of 'break'. 'break' can only be used inside a loop body or lambda - -error[E04014]: invalid loop control - ┌─ tests/move_check/typing/break_outside_loop.move:14:21 - │ -14 │ if (x >= 5) break; - │ ^^^^^ Invalid usage of 'break'. 'break' can only be used inside a loop body or lambda - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/break_outside_loop.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/break_outside_loop.snap new file mode 100644 index 0000000000000..06da5b7b064ee --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/break_outside_loop.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/break_outside_loop.move +--- +error[E04014]: invalid loop control + ┌─ tests/move_check/typing/break_outside_loop.move:6:9 + │ +6 │ break + │ ^^^^^ Invalid usage of 'break'. 'break' can only be used inside a loop body or lambda + +error[E04014]: invalid loop control + ┌─ tests/move_check/typing/break_outside_loop.move:10:9 + │ +10 │ break; + │ ^^^^^ Invalid usage of 'break'. 'break' can only be used inside a loop body or lambda + +error[E04014]: invalid loop control + ┌─ tests/move_check/typing/break_outside_loop.move:14:21 + │ +14 │ if (x >= 5) break; + │ ^^^^^ Invalid usage of 'break'. 'break' can only be used inside a loop body or lambda diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/break_with_value.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/break_with_value.snap new file mode 100644 index 0000000000000..7104e3f7b0ff6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/break_with_value.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/break_with_value.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/break_with_value_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/break_with_value_invalid.exp deleted file mode 100644 index 027489cfc401e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/break_with_value_invalid.exp +++ /dev/null @@ -1,123 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/break_with_value_invalid.move:3:25 - │ -2 │ fun t0(): bool { - │ ---- Expected: 'bool' -3 │ loop { break 0 }; - │ ^ - │ │ - │ Invalid return expression - │ Given: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/break_with_value_invalid.move:7:9 - │ -6 │ fun t1(): u64 { - │ --- Expected: 'u64' -7 │ loop { break true } - │ ^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid return expression - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/break_with_value_invalid.move:11:9 - │ -11 │ ╭ if (cond) { -12 │ │ loop { break 0 } - │ │ ---------------- Found: integer. It is not compatible with the other type. -13 │ │ } else { -14 │ │ loop { break false } - │ │ ----- Found: 'bool'. It is not compatible with the other type. -15 │ │ } - │ ╰─────────^ Incompatible branches - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/break_with_value_invalid.move:19:9 - │ -18 │ fun t3(cond: bool): bool { - │ ---- Expected: 'bool' -19 │ while (cond) { break true } - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid return expression - │ Given: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/break_with_value_invalid.move:19:24 - │ -19 │ while (cond) { break true } - │ ---------------^^^^^^^^^^-- - │ │ │ │ - │ │ │ Given: 'bool' - │ │ Invalid break - │ Expected: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/break_with_value_invalid.move:23:24 - │ -23 │ while (cond) { break true }; - │ ---------------^^^^^^^^^^-- - │ │ │ │ - │ │ │ Given: 'bool' - │ │ Invalid break - │ Expected: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/break_with_value_invalid.move:23:36 - │ -22 │ fun t4(cond: bool): bool { - │ ---- Expected: 'bool' -23 │ while (cond) { break true }; - │ ^ - │ │ - │ Invalid return expression - │ Given: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/break_with_value_invalid.move:28:9 - │ -26 │ fun t5(cond: bool): u64 { - │ --- Expected: 'u64' -27 │ let x = 0; -28 │ ╭ loop { -29 │ │ if (cond) { -30 │ │ break true - │ │ ---- Given: 'bool' -31 │ │ } else { -32 │ │ x = x + 1; -33 │ │ } -34 │ │ } - │ ╰─────────^ Invalid return expression - -error[E04005]: expected a single type - ┌─ tests/move_check/typing/break_with_value_invalid.move:38:13 - │ -38 │ let x = while (cond) { }; - │ ^ ---------------- Expected a single type, but found expression list type: '()' - │ │ - │ Invalid type for local - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/break_with_value_invalid.move:50:11 - │ -46 │ break true - │ ---- Found: 'bool'. It is not compatible with the other type. - · -50 │ } == 0) { - │ ^^ - Found: integer. It is not compatible with the other type. - │ │ - │ Incompatible arguments to '==' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/break_with_value_invalid.move:67:9 - │ -64 │ struct R {f: u64} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -67 │ ╭ loop { -68 │ │ break R { f: 0 } - │ │ ---------- The type '0x42::m::R' does not have the ability 'drop' -69 │ │ }; - │ ╰─────────^ Cannot ignore values without the 'drop' ability. The value must be used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/break_with_value_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/break_with_value_invalid.snap new file mode 100644 index 0000000000000..41b7e3672628f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/break_with_value_invalid.snap @@ -0,0 +1,130 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/break_with_value_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/break_with_value_invalid.move:3:25 + │ +2 │ fun t0(): bool { + │ ---- Expected: 'bool' +3 │ loop { break 0 }; + │ ^ + │ │ + │ Invalid return expression + │ Given: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/break_with_value_invalid.move:7:9 + │ +6 │ fun t1(): u64 { + │ --- Expected: 'u64' +7 │ loop { break true } + │ ^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid return expression + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/break_with_value_invalid.move:11:9 + │ +11 │ ╭ if (cond) { +12 │ │ loop { break 0 } + │ │ ---------------- Found: integer. It is not compatible with the other type. +13 │ │ } else { +14 │ │ loop { break false } + │ │ ----- Found: 'bool'. It is not compatible with the other type. +15 │ │ } + │ ╰─────────^ Incompatible branches + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/break_with_value_invalid.move:19:9 + │ +18 │ fun t3(cond: bool): bool { + │ ---- Expected: 'bool' +19 │ while (cond) { break true } + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid return expression + │ Given: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/break_with_value_invalid.move:19:24 + │ +19 │ while (cond) { break true } + │ ---------------^^^^^^^^^^-- + │ │ │ │ + │ │ │ Given: 'bool' + │ │ Invalid break + │ Expected: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/break_with_value_invalid.move:23:24 + │ +23 │ while (cond) { break true }; + │ ---------------^^^^^^^^^^-- + │ │ │ │ + │ │ │ Given: 'bool' + │ │ Invalid break + │ Expected: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/break_with_value_invalid.move:23:36 + │ +22 │ fun t4(cond: bool): bool { + │ ---- Expected: 'bool' +23 │ while (cond) { break true }; + │ ^ + │ │ + │ Invalid return expression + │ Given: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/break_with_value_invalid.move:28:9 + │ +26 │ fun t5(cond: bool): u64 { + │ --- Expected: 'u64' +27 │ let x = 0; +28 │ ╭ loop { +29 │ │ if (cond) { +30 │ │ break true + │ │ ---- Given: 'bool' +31 │ │ } else { +32 │ │ x = x + 1; +33 │ │ } +34 │ │ } + │ ╰─────────^ Invalid return expression + +error[E04005]: expected a single type + ┌─ tests/move_check/typing/break_with_value_invalid.move:38:13 + │ +38 │ let x = while (cond) { }; + │ ^ ---------------- Expected a single type, but found expression list type: '()' + │ │ + │ Invalid type for local + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/break_with_value_invalid.move:50:11 + │ +46 │ break true + │ ---- Found: 'bool'. It is not compatible with the other type. + · +50 │ } == 0) { + │ ^^ - Found: integer. It is not compatible with the other type. + │ │ + │ Incompatible arguments to '==' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/break_with_value_invalid.move:67:9 + │ +64 │ struct R {f: u64} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +67 │ ╭ loop { +68 │ │ break R { f: 0 } + │ │ ---------- The type '0x42::m::R' does not have the ability 'drop' +69 │ │ }; + │ ╰─────────^ Cannot ignore values without the 'drop' ability. The value must be used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/cast.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/cast.snap new file mode 100644 index 0000000000000..d1cf8b073f791 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/cast.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/cast.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/cast_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/cast_invalid.exp deleted file mode 100644 index 16d9e2e33f1e1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/cast_invalid.exp +++ /dev/null @@ -1,274 +0,0 @@ -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:6:10 - │ -6 │ (false as u8); - │ ^^^^^ - │ │ - │ Invalid argument to 'as' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:7:10 - │ -7 │ (true as u128); - │ ^^^^ - │ │ - │ Invalid argument to 'as' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:9:10 - │ -9 │ (() as u64); - │ ^^ - │ │ - │ Invalid argument to 'as' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:10:10 - │ -10 │ ((0, 1) as u8); - │ ^^^^^^ - │ │ - │ Invalid argument to 'as' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:12:10 - │ -12 │ (0 as bool); - │ ^ ---- Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ │ - │ Invalid argument to 'as' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:13:10 - │ -13 │ (0 as address); - │ ^ ------- Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ │ - │ Invalid argument to 'as' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:14:16 - │ -14 │ R{} = (0 as R); - │ ^ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ │ - │ Invalid argument to 'as' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:15:10 - │ -15 │ (0 as Cup); - │ ^ ------- Found: '0x8675309::M::Cup'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ │ - │ Invalid argument to 'as' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:16:10 - │ -16 │ (0 as ()); - │ ^ -- Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ │ - │ Invalid argument to 'as' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:17:10 - │ -17 │ (0 as (u64, u8)); - │ ^ --------- Found: '(u64, u8)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ │ - │ Invalid argument to 'as' - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:19:10 - │ -19 │ (x"1234" as u64); - │ ^^^^^^^ - │ │ - │ Invalid argument to 'as' - │ Found: 'vector'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/typing/cast_invalid.move:23:9 - │ -23 │ false as u8; - │ ^^^^^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:23:9 - │ -23 │ false as u8; - │ ^^^^^ - │ │ - │ Invalid argument to 'as' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/typing/cast_invalid.move:24:9 - │ -24 │ true as u128; - │ ^^^^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:24:9 - │ -24 │ true as u128; - │ ^^^^ - │ │ - │ Invalid argument to 'as' - │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/typing/cast_invalid.move:26:9 - │ -26 │ () as u64; - │ ^^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:26:9 - │ -26 │ () as u64; - │ ^^ - │ │ - │ Invalid argument to 'as' - │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/typing/cast_invalid.move:27:9 - │ -27 │ (0, 1) as u8; - │ ^^^^^^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:27:9 - │ -27 │ (0, 1) as u8; - │ ^^^^^^ - │ │ - │ Invalid argument to 'as' - │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/typing/cast_invalid.move:29:9 - │ -29 │ 0 as bool; - │ ^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:29:9 - │ -29 │ 0 as bool; - │ ^ ---- Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ │ - │ Invalid argument to 'as' - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/typing/cast_invalid.move:30:9 - │ -30 │ 0 as address; - │ ^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:30:9 - │ -30 │ 0 as address; - │ ^ ------- Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ │ - │ Invalid argument to 'as' - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/typing/cast_invalid.move:31:15 - │ -31 │ R{} = 0 as R; - │ ^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:31:15 - │ -31 │ R{} = 0 as R; - │ ^ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ │ - │ Invalid argument to 'as' - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/typing/cast_invalid.move:32:9 - │ -32 │ 0 as Cup; - │ ^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:32:9 - │ -32 │ 0 as Cup; - │ ^ ------- Found: '0x8675309::M::Cup'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ │ - │ Invalid argument to 'as' - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/typing/cast_invalid.move:33:9 - │ -33 │ 0 as (); - │ ^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:33:9 - │ -33 │ 0 as (); - │ ^ -- Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ │ - │ Invalid argument to 'as' - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/typing/cast_invalid.move:34:9 - │ -34 │ 0 as (u64, u8); - │ ^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:34:9 - │ -34 │ 0 as (u64, u8); - │ ^ --------- Found: '(u64, u8)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - │ │ - │ Invalid argument to 'as' - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/typing/cast_invalid.move:36:9 - │ -36 │ x"1234" as u64; - │ ^^^^^^^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E04003]: built-in operation not supported - ┌─ tests/move_check/typing/cast_invalid.move:36:9 - │ -36 │ x"1234" as u64; - │ ^^^^^^^ - │ │ - │ Invalid argument to 'as' - │ Found: 'vector'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/cast_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/cast_invalid.snap new file mode 100644 index 0000000000000..48a1820f2d1ee --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/cast_invalid.snap @@ -0,0 +1,281 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/cast_invalid.move +--- +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:6:10 + │ +6 │ (false as u8); + │ ^^^^^ + │ │ + │ Invalid argument to 'as' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:7:10 + │ +7 │ (true as u128); + │ ^^^^ + │ │ + │ Invalid argument to 'as' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:9:10 + │ +9 │ (() as u64); + │ ^^ + │ │ + │ Invalid argument to 'as' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:10:10 + │ +10 │ ((0, 1) as u8); + │ ^^^^^^ + │ │ + │ Invalid argument to 'as' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:12:10 + │ +12 │ (0 as bool); + │ ^ ---- Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ │ + │ Invalid argument to 'as' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:13:10 + │ +13 │ (0 as address); + │ ^ ------- Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ │ + │ Invalid argument to 'as' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:14:16 + │ +14 │ R{} = (0 as R); + │ ^ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ │ + │ Invalid argument to 'as' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:15:10 + │ +15 │ (0 as Cup); + │ ^ ------- Found: '0x8675309::M::Cup'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ │ + │ Invalid argument to 'as' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:16:10 + │ +16 │ (0 as ()); + │ ^ -- Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ │ + │ Invalid argument to 'as' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:17:10 + │ +17 │ (0 as (u64, u8)); + │ ^ --------- Found: '(u64, u8)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ │ + │ Invalid argument to 'as' + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:19:10 + │ +19 │ (x"1234" as u64); + │ ^^^^^^^ + │ │ + │ Invalid argument to 'as' + │ Found: 'vector'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/typing/cast_invalid.move:23:9 + │ +23 │ false as u8; + │ ^^^^^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:23:9 + │ +23 │ false as u8; + │ ^^^^^ + │ │ + │ Invalid argument to 'as' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/typing/cast_invalid.move:24:9 + │ +24 │ true as u128; + │ ^^^^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:24:9 + │ +24 │ true as u128; + │ ^^^^ + │ │ + │ Invalid argument to 'as' + │ Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/typing/cast_invalid.move:26:9 + │ +26 │ () as u64; + │ ^^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:26:9 + │ +26 │ () as u64; + │ ^^ + │ │ + │ Invalid argument to 'as' + │ Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/typing/cast_invalid.move:27:9 + │ +27 │ (0, 1) as u8; + │ ^^^^^^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:27:9 + │ +27 │ (0, 1) as u8; + │ ^^^^^^ + │ │ + │ Invalid argument to 'as' + │ Found: '(u64, u64)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/typing/cast_invalid.move:29:9 + │ +29 │ 0 as bool; + │ ^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:29:9 + │ +29 │ 0 as bool; + │ ^ ---- Found: 'bool'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ │ + │ Invalid argument to 'as' + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/typing/cast_invalid.move:30:9 + │ +30 │ 0 as address; + │ ^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:30:9 + │ +30 │ 0 as address; + │ ^ ------- Found: 'address'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ │ + │ Invalid argument to 'as' + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/typing/cast_invalid.move:31:15 + │ +31 │ R{} = 0 as R; + │ ^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:31:15 + │ +31 │ R{} = 0 as R; + │ ^ - Found: '0x8675309::M::R'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ │ + │ Invalid argument to 'as' + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/typing/cast_invalid.move:32:9 + │ +32 │ 0 as Cup; + │ ^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:32:9 + │ +32 │ 0 as Cup; + │ ^ ------- Found: '0x8675309::M::Cup'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ │ + │ Invalid argument to 'as' + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/typing/cast_invalid.move:33:9 + │ +33 │ 0 as (); + │ ^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:33:9 + │ +33 │ 0 as (); + │ ^ -- Found: '()'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ │ + │ Invalid argument to 'as' + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/typing/cast_invalid.move:34:9 + │ +34 │ 0 as (u64, u8); + │ ^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:34:9 + │ +34 │ 0 as (u64, u8); + │ ^ --------- Found: '(u64, u8)'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' + │ │ + │ Invalid argument to 'as' + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/typing/cast_invalid.move:36:9 + │ +36 │ x"1234" as u64; + │ ^^^^^^^ 'as' without parentheses is not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E04003]: built-in operation not supported + ┌─ tests/move_check/typing/cast_invalid.move:36:9 + │ +36 │ x"1234" as u64; + │ ^^^^^^^ + │ │ + │ Invalid argument to 'as' + │ Found: 'vector'. But expected: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/clever_assertions.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/clever_assertions.exp deleted file mode 100644 index fd2dd6769a8ee..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/clever_assertions.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/typing/clever_assertions.move:4:7 - │ -4 │ #[error] - │ ^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/typing/clever_assertions.move:7:7 - │ -7 │ #[error] - │ ^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - -error[E13001]: feature is not supported in specified edition - ┌─ tests/move_check/typing/clever_assertions.move:23:9 - │ -23 │ assert!(false); - │ ^^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature - │ - = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/clever_assertions.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/clever_assertions.snap new file mode 100644 index 0000000000000..5b7af09f5997c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/clever_assertions.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/clever_assertions.move +--- +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/typing/clever_assertions.move:4:7 + │ +4 │ #[error] + │ ^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/typing/clever_assertions.move:7:7 + │ +7 │ #[error] + │ ^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. + +error[E13001]: feature is not supported in specified edition + ┌─ tests/move_check/typing/clever_assertions.move:23:9 + │ +23 │ assert!(false); + │ ^^^^^^ Clever `assert!`, `abort`, and `#[error]` are not supported by current edition 'legacy'; the '2024' edition supports this feature + │ + = You can update the edition in the 'Move.toml', or via command line flag if invoking the compiler directly. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/conditional_copy_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/conditional_copy_invalid.exp deleted file mode 100644 index f7b6edadc6608..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/conditional_copy_invalid.exp +++ /dev/null @@ -1,110 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_copy_invalid.move:15:16 - │ -14 │ let x = Box { f: R{} }; - │ ----------------- - │ │ │ - │ │ The type '0x42::M::Box<0x42::M::R>' can have the ability 'copy' but the type argument '0x42::M::R' does not have the required ability 'copy' - │ The type '0x42::M::Box<0x42::M::R>' does not have the ability 'copy' -15 │ ignore(copy x); - │ ^^^^^^ Invalid 'copy' of owned value without the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_copy_invalid.move:17:16 - │ -16 │ let x = Box> { f: Box { f: R{} } }; - │ --------------------------------- - │ │ │ - │ │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' can have the ability 'copy' but the type argument '0x42::M::Box<0x42::M::R>' does not have the required ability 'copy' - │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' does not have the ability 'copy' -17 │ ignore(copy x); - │ ^^^^^^ Invalid 'copy' of owned value without the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_copy_invalid.move:19:16 - │ -18 │ let x = Box { f: t1 }; - │ ---------------- - │ │ │ - │ │ The type '0x42::M::Box' can have the ability 'copy' but the type argument 'T' does not have the required ability 'copy' - │ The type '0x42::M::Box' does not have the ability 'copy' -19 │ ignore(copy x); - │ ^^^^^^ Invalid 'copy' of owned value without the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_copy_invalid.move:21:16 - │ -20 │ let x = Box> { f: Box { f: t2 } }; - │ -------------------------------- - │ │ │ - │ │ The type '0x42::M::Box<0x42::M::Box>' can have the ability 'copy' but the type argument '0x42::M::Box' does not have the required ability 'copy' - │ The type '0x42::M::Box<0x42::M::Box>' does not have the ability 'copy' -21 │ ignore(copy x); - │ ^^^^^^ Invalid 'copy' of owned value without the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_copy_invalid.move:23:16 - │ -22 │ let x = Pair { f1: S{}, f2: R{} }; - │ ------------------------------- - │ │ │ - │ │ The type '0x42::M::Pair<0x42::M::S, 0x42::M::R>' can have the ability 'copy' but the type argument '0x42::M::R' does not have the required ability 'copy' - │ The type '0x42::M::Pair<0x42::M::S, 0x42::M::R>' does not have the ability 'copy' -23 │ ignore(copy x); - │ ^^^^^^ Invalid 'copy' of owned value without the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_copy_invalid.move:27:16 - │ -26 │ let x = &Box { f: R{} }; - │ ----------------- - │ │ │ - │ │ The type '0x42::M::Box<0x42::M::R>' can have the ability 'copy' but the type argument '0x42::M::R' does not have the required ability 'copy' - │ The type '0x42::M::Box<0x42::M::R>' does not have the ability 'copy' -27 │ ignore(*x); - │ ^^ Invalid dereference. Dereference requires the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_copy_invalid.move:29:16 - │ -28 │ let x = &Box> { f: Box { f: R{} } }; - │ --------------------------------- - │ │ │ - │ │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' can have the ability 'copy' but the type argument '0x42::M::Box<0x42::M::R>' does not have the required ability 'copy' - │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' does not have the ability 'copy' -29 │ ignore(*x); - │ ^^ Invalid dereference. Dereference requires the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_copy_invalid.move:31:16 - │ -30 │ let x = &Box { f: t3 }; - │ ---------------- - │ │ │ - │ │ The type '0x42::M::Box' can have the ability 'copy' but the type argument 'T' does not have the required ability 'copy' - │ The type '0x42::M::Box' does not have the ability 'copy' -31 │ ignore(*x); - │ ^^ Invalid dereference. Dereference requires the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_copy_invalid.move:33:16 - │ -32 │ let x = &Box> { f: Box { f: t4 } }; - │ -------------------------------- - │ │ │ - │ │ The type '0x42::M::Box<0x42::M::Box>' can have the ability 'copy' but the type argument '0x42::M::Box' does not have the required ability 'copy' - │ The type '0x42::M::Box<0x42::M::Box>' does not have the ability 'copy' -33 │ ignore(*x); - │ ^^ Invalid dereference. Dereference requires the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_copy_invalid.move:35:16 - │ -34 │ let x = &Pair { f1: R{}, f2: S{} }; - │ ------------------------------- - │ │ │ - │ │ The type '0x42::M::Pair<0x42::M::R, 0x42::M::S>' can have the ability 'copy' but the type argument '0x42::M::R' does not have the required ability 'copy' - │ The type '0x42::M::Pair<0x42::M::R, 0x42::M::S>' does not have the ability 'copy' -35 │ ignore(*x); - │ ^^ Invalid dereference. Dereference requires the 'copy' ability - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/conditional_copy_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/conditional_copy_invalid.snap new file mode 100644 index 0000000000000..cc4ae6ee25fed --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/conditional_copy_invalid.snap @@ -0,0 +1,117 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/conditional_copy_invalid.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_copy_invalid.move:15:16 + │ +14 │ let x = Box { f: R{} }; + │ ----------------- + │ │ │ + │ │ The type '0x42::M::Box<0x42::M::R>' can have the ability 'copy' but the type argument '0x42::M::R' does not have the required ability 'copy' + │ The type '0x42::M::Box<0x42::M::R>' does not have the ability 'copy' +15 │ ignore(copy x); + │ ^^^^^^ Invalid 'copy' of owned value without the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_copy_invalid.move:17:16 + │ +16 │ let x = Box> { f: Box { f: R{} } }; + │ --------------------------------- + │ │ │ + │ │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' can have the ability 'copy' but the type argument '0x42::M::Box<0x42::M::R>' does not have the required ability 'copy' + │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' does not have the ability 'copy' +17 │ ignore(copy x); + │ ^^^^^^ Invalid 'copy' of owned value without the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_copy_invalid.move:19:16 + │ +18 │ let x = Box { f: t1 }; + │ ---------------- + │ │ │ + │ │ The type '0x42::M::Box' can have the ability 'copy' but the type argument 'T' does not have the required ability 'copy' + │ The type '0x42::M::Box' does not have the ability 'copy' +19 │ ignore(copy x); + │ ^^^^^^ Invalid 'copy' of owned value without the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_copy_invalid.move:21:16 + │ +20 │ let x = Box> { f: Box { f: t2 } }; + │ -------------------------------- + │ │ │ + │ │ The type '0x42::M::Box<0x42::M::Box>' can have the ability 'copy' but the type argument '0x42::M::Box' does not have the required ability 'copy' + │ The type '0x42::M::Box<0x42::M::Box>' does not have the ability 'copy' +21 │ ignore(copy x); + │ ^^^^^^ Invalid 'copy' of owned value without the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_copy_invalid.move:23:16 + │ +22 │ let x = Pair { f1: S{}, f2: R{} }; + │ ------------------------------- + │ │ │ + │ │ The type '0x42::M::Pair<0x42::M::S, 0x42::M::R>' can have the ability 'copy' but the type argument '0x42::M::R' does not have the required ability 'copy' + │ The type '0x42::M::Pair<0x42::M::S, 0x42::M::R>' does not have the ability 'copy' +23 │ ignore(copy x); + │ ^^^^^^ Invalid 'copy' of owned value without the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_copy_invalid.move:27:16 + │ +26 │ let x = &Box { f: R{} }; + │ ----------------- + │ │ │ + │ │ The type '0x42::M::Box<0x42::M::R>' can have the ability 'copy' but the type argument '0x42::M::R' does not have the required ability 'copy' + │ The type '0x42::M::Box<0x42::M::R>' does not have the ability 'copy' +27 │ ignore(*x); + │ ^^ Invalid dereference. Dereference requires the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_copy_invalid.move:29:16 + │ +28 │ let x = &Box> { f: Box { f: R{} } }; + │ --------------------------------- + │ │ │ + │ │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' can have the ability 'copy' but the type argument '0x42::M::Box<0x42::M::R>' does not have the required ability 'copy' + │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' does not have the ability 'copy' +29 │ ignore(*x); + │ ^^ Invalid dereference. Dereference requires the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_copy_invalid.move:31:16 + │ +30 │ let x = &Box { f: t3 }; + │ ---------------- + │ │ │ + │ │ The type '0x42::M::Box' can have the ability 'copy' but the type argument 'T' does not have the required ability 'copy' + │ The type '0x42::M::Box' does not have the ability 'copy' +31 │ ignore(*x); + │ ^^ Invalid dereference. Dereference requires the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_copy_invalid.move:33:16 + │ +32 │ let x = &Box> { f: Box { f: t4 } }; + │ -------------------------------- + │ │ │ + │ │ The type '0x42::M::Box<0x42::M::Box>' can have the ability 'copy' but the type argument '0x42::M::Box' does not have the required ability 'copy' + │ The type '0x42::M::Box<0x42::M::Box>' does not have the ability 'copy' +33 │ ignore(*x); + │ ^^ Invalid dereference. Dereference requires the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_copy_invalid.move:35:16 + │ +34 │ let x = &Pair { f1: R{}, f2: S{} }; + │ ------------------------------- + │ │ │ + │ │ The type '0x42::M::Pair<0x42::M::R, 0x42::M::S>' can have the ability 'copy' but the type argument '0x42::M::R' does not have the required ability 'copy' + │ The type '0x42::M::Pair<0x42::M::R, 0x42::M::S>' does not have the ability 'copy' +35 │ ignore(*x); + │ ^^ Invalid dereference. Dereference requires the 'copy' ability diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/conditional_drop_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/conditional_drop_invalid.exp deleted file mode 100644 index 19bb6bd677f2f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/conditional_drop_invalid.exp +++ /dev/null @@ -1,160 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_drop_invalid.move:10:9 - │ -10 │ Box { f: R{} }; - │ ^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Box<0x42::M::R>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - │ The type '0x42::M::Box<0x42::M::R>' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_drop_invalid.move:11:9 - │ -11 │ Box> { f: Box { f: R{} } }; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' can have the ability 'drop' but the type argument '0x42::M::Box<0x42::M::R>' does not have the required ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_drop_invalid.move:12:9 - │ -12 │ Box { f: t }; - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Box' can have the ability 'drop' but the type argument 'T' does not have the required ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - │ The type '0x42::M::Box' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_drop_invalid.move:13:9 - │ -13 │ Box> { f: Box { f: t } }; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Box<0x42::M::Box>' can have the ability 'drop' but the type argument '0x42::M::Box' does not have the required ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - │ The type '0x42::M::Box<0x42::M::Box>' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_drop_invalid.move:14:9 - │ -14 │ Pair { f1: S{}, f2: R{} }; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Pair<0x42::M::S, 0x42::M::R>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - │ The type '0x42::M::Pair<0x42::M::S, 0x42::M::R>' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_drop_invalid.move:15:9 - │ -15 │ (Pair { f1: S{}, f2: R{} }, 0, @0x1); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ ││ - │ │The type '(0x42::M::Pair<0x42::M::S, 0x42::M::R>, u64, address)' can have the ability 'drop' but the type argument '0x42::M::Pair<0x42::M::S, 0x42::M::R>' does not have the required ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - │ The type '(0x42::M::Pair<0x42::M::S, 0x42::M::R>, u64, address)' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_drop_invalid.move:17:9 - │ -17 │ Box { f: R {} } == Box { f: R {} }; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Box<0x42::M::R>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' - │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x42::M::Box<0x42::M::R>' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_drop_invalid.move:17:31 - │ -17 │ Box { f: R {} } == Box { f: R {} }; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Box<0x42::M::R>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' - │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x42::M::Box<0x42::M::R>' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_drop_invalid.move:18:9 - │ -18 │ Box> { f: Box { f: R {} } } == Box> { f: Box { f: R {} }}; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' can have the ability 'drop' but the type argument '0x42::M::Box<0x42::M::R>' does not have the required ability 'drop' - │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_drop_invalid.move:18:47 - │ -18 │ Box> { f: Box { f: R {} } } == Box> { f: Box { f: R {} }}; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' can have the ability 'drop' but the type argument '0x42::M::Box<0x42::M::R>' does not have the required ability 'drop' - │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_drop_invalid.move:19:9 - │ -19 │ Box { f: t } == Box { f: t }; - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Box' can have the ability 'drop' but the type argument 'T' does not have the required ability 'drop' - │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x42::M::Box' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_drop_invalid.move:19:28 - │ -19 │ Box { f: t } == Box { f: t }; - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Box' can have the ability 'drop' but the type argument 'T' does not have the required ability 'drop' - │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x42::M::Box' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_drop_invalid.move:20:9 - │ -20 │ Box> { f: Box { f: t } } == Box> { f: Box { f: t} }; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Box<0x42::M::Box>' can have the ability 'drop' but the type argument '0x42::M::Box' does not have the required ability 'drop' - │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x42::M::Box<0x42::M::Box>' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_drop_invalid.move:20:44 - │ -20 │ Box> { f: Box { f: t } } == Box> { f: Box { f: t} }; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Box<0x42::M::Box>' can have the ability 'drop' but the type argument '0x42::M::Box' does not have the required ability 'drop' - │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x42::M::Box<0x42::M::Box>' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_drop_invalid.move:21:9 - │ -21 │ Pair { f1: R{}, f2: S{} } == Pair { f1: R{}, f2: S{} }; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Pair<0x42::M::R, 0x42::M::S>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' - │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x42::M::Pair<0x42::M::R, 0x42::M::S>' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/conditional_drop_invalid.move:21:44 - │ -21 │ Pair { f1: R{}, f2: S{} } == Pair { f1: R{}, f2: S{} }; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Pair<0x42::M::R, 0x42::M::S>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' - │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x42::M::Pair<0x42::M::R, 0x42::M::S>' does not have the ability 'drop' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/conditional_drop_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/conditional_drop_invalid.snap new file mode 100644 index 0000000000000..4f8ef37f78335 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/conditional_drop_invalid.snap @@ -0,0 +1,167 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/conditional_drop_invalid.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_drop_invalid.move:10:9 + │ +10 │ Box { f: R{} }; + │ ^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Box<0x42::M::R>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + │ The type '0x42::M::Box<0x42::M::R>' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_drop_invalid.move:11:9 + │ +11 │ Box> { f: Box { f: R{} } }; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' can have the ability 'drop' but the type argument '0x42::M::Box<0x42::M::R>' does not have the required ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_drop_invalid.move:12:9 + │ +12 │ Box { f: t }; + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Box' can have the ability 'drop' but the type argument 'T' does not have the required ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + │ The type '0x42::M::Box' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_drop_invalid.move:13:9 + │ +13 │ Box> { f: Box { f: t } }; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Box<0x42::M::Box>' can have the ability 'drop' but the type argument '0x42::M::Box' does not have the required ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + │ The type '0x42::M::Box<0x42::M::Box>' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_drop_invalid.move:14:9 + │ +14 │ Pair { f1: S{}, f2: R{} }; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Pair<0x42::M::S, 0x42::M::R>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + │ The type '0x42::M::Pair<0x42::M::S, 0x42::M::R>' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_drop_invalid.move:15:9 + │ +15 │ (Pair { f1: S{}, f2: R{} }, 0, @0x1); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ ││ + │ │The type '(0x42::M::Pair<0x42::M::S, 0x42::M::R>, u64, address)' can have the ability 'drop' but the type argument '0x42::M::Pair<0x42::M::S, 0x42::M::R>' does not have the required ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + │ The type '(0x42::M::Pair<0x42::M::S, 0x42::M::R>, u64, address)' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_drop_invalid.move:17:9 + │ +17 │ Box { f: R {} } == Box { f: R {} }; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Box<0x42::M::R>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' + │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x42::M::Box<0x42::M::R>' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_drop_invalid.move:17:31 + │ +17 │ Box { f: R {} } == Box { f: R {} }; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Box<0x42::M::R>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' + │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x42::M::Box<0x42::M::R>' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_drop_invalid.move:18:9 + │ +18 │ Box> { f: Box { f: R {} } } == Box> { f: Box { f: R {} }}; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' can have the ability 'drop' but the type argument '0x42::M::Box<0x42::M::R>' does not have the required ability 'drop' + │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_drop_invalid.move:18:47 + │ +18 │ Box> { f: Box { f: R {} } } == Box> { f: Box { f: R {} }}; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' can have the ability 'drop' but the type argument '0x42::M::Box<0x42::M::R>' does not have the required ability 'drop' + │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x42::M::Box<0x42::M::Box<0x42::M::R>>' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_drop_invalid.move:19:9 + │ +19 │ Box { f: t } == Box { f: t }; + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Box' can have the ability 'drop' but the type argument 'T' does not have the required ability 'drop' + │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x42::M::Box' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_drop_invalid.move:19:28 + │ +19 │ Box { f: t } == Box { f: t }; + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Box' can have the ability 'drop' but the type argument 'T' does not have the required ability 'drop' + │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x42::M::Box' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_drop_invalid.move:20:9 + │ +20 │ Box> { f: Box { f: t } } == Box> { f: Box { f: t} }; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Box<0x42::M::Box>' can have the ability 'drop' but the type argument '0x42::M::Box' does not have the required ability 'drop' + │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x42::M::Box<0x42::M::Box>' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_drop_invalid.move:20:44 + │ +20 │ Box> { f: Box { f: t } } == Box> { f: Box { f: t} }; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Box<0x42::M::Box>' can have the ability 'drop' but the type argument '0x42::M::Box' does not have the required ability 'drop' + │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x42::M::Box<0x42::M::Box>' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_drop_invalid.move:21:9 + │ +21 │ Pair { f1: R{}, f2: S{} } == Pair { f1: R{}, f2: S{} }; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Pair<0x42::M::R, 0x42::M::S>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' + │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x42::M::Pair<0x42::M::R, 0x42::M::S>' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/conditional_drop_invalid.move:21:44 + │ +21 │ Pair { f1: R{}, f2: S{} } == Pair { f1: R{}, f2: S{} }; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Pair<0x42::M::R, 0x42::M::S>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' + │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x42::M::Pair<0x42::M::R, 0x42::M::S>' does not have the ability 'drop' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/const_in_const.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/const_in_const.snap new file mode 100644 index 0000000000000..660b5e2648343 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/const_in_const.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/const_in_const.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/const_in_const_circular.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/const_in_const_circular.exp deleted file mode 100644 index b921c3f6d7eb0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/const_in_const_circular.exp +++ /dev/null @@ -1,42 +0,0 @@ -error[E08001]: cannot compute constant value - ┌─ tests/move_check/typing/const_in_const_circular.move:5:11 - │ -3 │ const C0: u64 = C1 + 1; - │ -- Cyclic constant defined here -4 │ -5 │ const C1: u64 = C2 + 1; - │ ^^ Constant definitions form a circular dependency: C1, C0, C2 -6 │ -7 │ const C2: u64 = C0 + 1; - │ -- Cyclic constant defined here - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/typing/const_in_const_circular.move:9:11 - │ -9 │ const C3: u64 = C1 + 1; - │ ^^ Constant uses constant C1, which has a circular dependency - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/typing/const_in_const_circular.move:13:11 - │ -13 │ const C5: u64 = C1 + C4; - │ ^^ Constant uses constant C1, which has a circular dependency - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/typing/const_in_const_circular.move:15:11 - │ -15 │ const C6: u64 = C7 + 1; - │ ^^ Constant definitions form a circular dependency: C6, C9, C7 -16 │ -17 │ const C7: u64 = C9 + 1; - │ -- Cyclic constant defined here - · -21 │ const C9: u64 = C6 + C6; - │ -- Cyclic constant defined here - -error[E08001]: cannot compute constant value - ┌─ tests/move_check/typing/const_in_const_circular.move:23:11 - │ -23 │ const C10: u64 = C0 + C6; - │ ^^^ Constant uses constant C0, which has a circular dependency - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/const_in_const_circular.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/const_in_const_circular.snap new file mode 100644 index 0000000000000..8b95f38abde77 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/const_in_const_circular.snap @@ -0,0 +1,49 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/const_in_const_circular.move +--- +error[E08001]: cannot compute constant value + ┌─ tests/move_check/typing/const_in_const_circular.move:5:11 + │ +3 │ const C0: u64 = C1 + 1; + │ -- Cyclic constant defined here +4 │ +5 │ const C1: u64 = C2 + 1; + │ ^^ Constant definitions form a circular dependency: C1, C0, C2 +6 │ +7 │ const C2: u64 = C0 + 1; + │ -- Cyclic constant defined here + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/typing/const_in_const_circular.move:9:11 + │ +9 │ const C3: u64 = C1 + 1; + │ ^^ Constant uses constant C1, which has a circular dependency + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/typing/const_in_const_circular.move:13:11 + │ +13 │ const C5: u64 = C1 + C4; + │ ^^ Constant uses constant C1, which has a circular dependency + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/typing/const_in_const_circular.move:15:11 + │ +15 │ const C6: u64 = C7 + 1; + │ ^^ Constant definitions form a circular dependency: C6, C9, C7 +16 │ +17 │ const C7: u64 = C9 + 1; + │ -- Cyclic constant defined here + · +21 │ const C9: u64 = C6 + C6; + │ -- Cyclic constant defined here + +error[E08001]: cannot compute constant value + ┌─ tests/move_check/typing/const_in_const_circular.move:23:11 + │ +23 │ const C10: u64 = C0 + C6; + │ ^^^ Constant uses constant C0, which has a circular dependency diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/const_in_const_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/const_in_const_invalid.exp deleted file mode 100644 index 7731ee0c750b1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/const_in_const_invalid.exp +++ /dev/null @@ -1,30 +0,0 @@ -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/const_in_const_invalid.move:4:20 - │ -4 │ const C_ONE: u64 = if (C_ZERO == 0) { 1 } else { 2 }; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 'if' expressions are not supported in constants - -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/const_in_const_invalid.move:13:20 - │ - 3 │ const C_ZERO: u64 = 0; - │ ------ Constants are internal to their module, and cannot can be accessed outside of their module - · -13 │ const C_ONE: u64 = C_ZERO + 1; - │ ^^^^^^ Invalid access of '0x42::t::C_ZERO' - -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/const_in_const_invalid.move:14:34 - │ - 3 │ const C_ZERO: u64 = 0; - │ ------ Constants are internal to their module, and cannot can be accessed outside of their module - · -14 │ const C_V2: vector = vector[C_ZERO, C_FIVE]; - │ ^^^^^^ Invalid access of '0x42::t::C_ZERO' - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/typing/const_in_const_invalid.move:14:42 - │ -14 │ const C_V2: vector = vector[C_ZERO, C_FIVE]; - │ ^^^^^^ Unbound constant 'C_FIVE' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/const_in_const_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/const_in_const_invalid.snap new file mode 100644 index 0000000000000..9a0bdd87b588d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/const_in_const_invalid.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/const_in_const_invalid.move +--- +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/const_in_const_invalid.move:4:20 + │ +4 │ const C_ONE: u64 = if (C_ZERO == 0) { 1 } else { 2 }; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 'if' expressions are not supported in constants + +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/const_in_const_invalid.move:13:20 + │ + 3 │ const C_ZERO: u64 = 0; + │ ------ Constants are internal to their module, and cannot can be accessed outside of their module + · +13 │ const C_ONE: u64 = C_ZERO + 1; + │ ^^^^^^ Invalid access of '0x42::t::C_ZERO' + +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/const_in_const_invalid.move:14:34 + │ + 3 │ const C_ZERO: u64 = 0; + │ ------ Constants are internal to their module, and cannot can be accessed outside of their module + · +14 │ const C_V2: vector = vector[C_ZERO, C_FIVE]; + │ ^^^^^^ Invalid access of '0x42::t::C_ZERO' + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/typing/const_in_const_invalid.move:14:42 + │ +14 │ const C_V2: vector = vector[C_ZERO, C_FIVE]; + │ ^^^^^^ Unbound constant 'C_FIVE' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_all_valid_types.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_all_valid_types.snap new file mode 100644 index 0000000000000..5db18f9aac054 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_all_valid_types.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/constant_all_valid_types.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_allowed_but_not_supported.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_allowed_but_not_supported.exp deleted file mode 100644 index ddb5a3061885e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_allowed_but_not_supported.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E03009]: unbound variable - ┌─ tests/move_check/typing/constant_allowed_but_not_supported.move:4:14 - │ -4 │ move x; - │ ^ Unbound variable 'x' - -error[E03009]: unbound variable - ┌─ tests/move_check/typing/constant_allowed_but_not_supported.move:5:14 - │ -5 │ copy y; - │ ^ Unbound variable 'y' - -error[E03009]: unbound variable - ┌─ tests/move_check/typing/constant_allowed_but_not_supported.move:6:9 - │ -6 │ z; - │ ^ Unbound variable 'z' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_allowed_but_not_supported.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_allowed_but_not_supported.snap new file mode 100644 index 0000000000000..64790ac81a8b2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_allowed_but_not_supported.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/constant_allowed_but_not_supported.move +--- +error[E03009]: unbound variable + ┌─ tests/move_check/typing/constant_allowed_but_not_supported.move:4:14 + │ +4 │ move x; + │ ^ Unbound variable 'x' + +error[E03009]: unbound variable + ┌─ tests/move_check/typing/constant_allowed_but_not_supported.move:5:14 + │ +5 │ copy y; + │ ^ Unbound variable 'y' + +error[E03009]: unbound variable + ┌─ tests/move_check/typing/constant_allowed_but_not_supported.move:6:9 + │ +6 │ z; + │ ^ Unbound variable 'z' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_internal.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_internal.exp deleted file mode 100644 index cbafab5dd6c05..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_internal.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/constant_internal.move:10:9 - │ - 4 │ const C: u64 = 0; - │ - Constants are internal to their module, and cannot can be accessed outside of their module - · -10 │ X::C; - │ ^^^^ Invalid access of '0x2::X::C' - -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/constant_internal.move:11:9 - │ - 4 │ const C: u64 = 0; - │ - Constants are internal to their module, and cannot can be accessed outside of their module - · -11 │ C; - │ ^ Invalid access of '0x2::X::C' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_internal.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_internal.snap new file mode 100644 index 0000000000000..6b9a3da181fd3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_internal.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/constant_internal.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/constant_internal.move:10:9 + │ + 4 │ const C: u64 = 0; + │ - Constants are internal to their module, and cannot can be accessed outside of their module + · +10 │ X::C; + │ ^^^^ Invalid access of '0x2::X::C' + +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/constant_internal.move:11:9 + │ + 4 │ const C: u64 = 0; + │ - Constants are internal to their module, and cannot can be accessed outside of their module + · +11 │ C; + │ ^ Invalid access of '0x2::X::C' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_invalid_base_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_invalid_base_type.exp deleted file mode 100644 index 399e471cd6ded..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_invalid_base_type.exp +++ /dev/null @@ -1,105 +0,0 @@ -error[E04012]: invalid type for constant - ┌─ tests/move_check/typing/constant_invalid_base_type.move:6:15 - │ -6 │ const C1: signer = abort 0; - │ ^^^^^^ - │ │ - │ Unpermitted constant type - │ Found: 'signer'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_invalid_base_type.move:6:24 - │ -6 │ const C1: signer = abort 0; - │ ^^^^^^^ 'abort' expressions are not supported in constants - -error[E04012]: invalid type for constant - ┌─ tests/move_check/typing/constant_invalid_base_type.move:7:15 - │ -7 │ const C2: S = S{}; - │ ^ - │ │ - │ Unpermitted constant type - │ Found: '0x42::M::S'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_invalid_base_type.move:7:19 - │ -7 │ const C2: S = S{}; - │ ^^^ Structs are not supported in constants - -error[E04012]: invalid type for constant - ┌─ tests/move_check/typing/constant_invalid_base_type.move:8:15 - │ -8 │ const C3: R = R{}; - │ ^ - │ │ - │ Unpermitted constant type - │ Found: '0x42::M::R'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_invalid_base_type.move:8:19 - │ -8 │ const C3: R = R{}; - │ ^^^ Structs are not supported in constants - -error[E04012]: invalid type for constant - ┌─ tests/move_check/typing/constant_invalid_base_type.move:9:15 - │ -9 │ const C4: vector = abort 0; - │ ^^^^^^^^^ - │ │ │ - │ │ Found: '0x42::M::S'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - │ Unpermitted constant type - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_invalid_base_type.move:9:27 - │ -9 │ const C4: vector = abort 0; - │ ^^^^^^^ 'abort' expressions are not supported in constants - -error[E04012]: invalid type for constant - ┌─ tests/move_check/typing/constant_invalid_base_type.move:10:15 - │ -10 │ const C5: vector = abort 0; - │ ^^^^^^^^^ - │ │ │ - │ │ Found: '0x42::M::R'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - │ Unpermitted constant type - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_invalid_base_type.move:10:27 - │ -10 │ const C5: vector = abort 0; - │ ^^^^^^^ 'abort' expressions are not supported in constants - -error[E04012]: invalid type for constant - ┌─ tests/move_check/typing/constant_invalid_base_type.move:11:15 - │ -11 │ const C6: vector> = abort 0; - │ ^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found: '0x42::M::S'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - │ Unpermitted constant type - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_invalid_base_type.move:11:35 - │ -11 │ const C6: vector> = abort 0; - │ ^^^^^^^ 'abort' expressions are not supported in constants - -error[E04012]: invalid type for constant - ┌─ tests/move_check/typing/constant_invalid_base_type.move:12:15 - │ -12 │ const C7: vector> = abort 0; - │ ^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found: '0x42::M::R'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - │ Unpermitted constant type - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_invalid_base_type.move:12:35 - │ -12 │ const C7: vector> = abort 0; - │ ^^^^^^^ 'abort' expressions are not supported in constants - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_invalid_base_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_invalid_base_type.snap new file mode 100644 index 0000000000000..6872330eec3e5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_invalid_base_type.snap @@ -0,0 +1,112 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/constant_invalid_base_type.move +--- +error[E04012]: invalid type for constant + ┌─ tests/move_check/typing/constant_invalid_base_type.move:6:15 + │ +6 │ const C1: signer = abort 0; + │ ^^^^^^ + │ │ + │ Unpermitted constant type + │ Found: 'signer'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_invalid_base_type.move:6:24 + │ +6 │ const C1: signer = abort 0; + │ ^^^^^^^ 'abort' expressions are not supported in constants + +error[E04012]: invalid type for constant + ┌─ tests/move_check/typing/constant_invalid_base_type.move:7:15 + │ +7 │ const C2: S = S{}; + │ ^ + │ │ + │ Unpermitted constant type + │ Found: '0x42::M::S'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_invalid_base_type.move:7:19 + │ +7 │ const C2: S = S{}; + │ ^^^ Structs are not supported in constants + +error[E04012]: invalid type for constant + ┌─ tests/move_check/typing/constant_invalid_base_type.move:8:15 + │ +8 │ const C3: R = R{}; + │ ^ + │ │ + │ Unpermitted constant type + │ Found: '0x42::M::R'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_invalid_base_type.move:8:19 + │ +8 │ const C3: R = R{}; + │ ^^^ Structs are not supported in constants + +error[E04012]: invalid type for constant + ┌─ tests/move_check/typing/constant_invalid_base_type.move:9:15 + │ +9 │ const C4: vector = abort 0; + │ ^^^^^^^^^ + │ │ │ + │ │ Found: '0x42::M::S'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' + │ Unpermitted constant type + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_invalid_base_type.move:9:27 + │ +9 │ const C4: vector = abort 0; + │ ^^^^^^^ 'abort' expressions are not supported in constants + +error[E04012]: invalid type for constant + ┌─ tests/move_check/typing/constant_invalid_base_type.move:10:15 + │ +10 │ const C5: vector = abort 0; + │ ^^^^^^^^^ + │ │ │ + │ │ Found: '0x42::M::R'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' + │ Unpermitted constant type + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_invalid_base_type.move:10:27 + │ +10 │ const C5: vector = abort 0; + │ ^^^^^^^ 'abort' expressions are not supported in constants + +error[E04012]: invalid type for constant + ┌─ tests/move_check/typing/constant_invalid_base_type.move:11:15 + │ +11 │ const C6: vector> = abort 0; + │ ^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found: '0x42::M::S'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' + │ Unpermitted constant type + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_invalid_base_type.move:11:35 + │ +11 │ const C6: vector> = abort 0; + │ ^^^^^^^ 'abort' expressions are not supported in constants + +error[E04012]: invalid type for constant + ┌─ tests/move_check/typing/constant_invalid_base_type.move:12:15 + │ +12 │ const C7: vector> = abort 0; + │ ^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found: '0x42::M::R'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' + │ Unpermitted constant type + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_invalid_base_type.move:12:35 + │ +12 │ const C7: vector> = abort 0; + │ ^^^^^^^ 'abort' expressions are not supported in constants diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_invalid_usage.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_invalid_usage.exp deleted file mode 100644 index 3bfb1416dd53e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_invalid_usage.exp +++ /dev/null @@ -1,77 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/constant_invalid_usage.move:11:20 - │ - 8 │ const C6: vector = x"0123"; - │ ---------- Given: 'vector' - · -11 │ fun t1(): u8 { C6 } - │ -- ^^ Invalid return expression - │ │ - │ Expected: 'u8' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/constant_invalid_usage.move:12:21 - │ - 9 │ const C7: vector = b"abcd"; - │ ---------- Given: 'vector' - · -12 │ fun t2(): u64 { C7 } - │ --- ^^ Invalid return expression - │ │ - │ Expected: 'u64' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/constant_invalid_usage.move:13:22 - │ - 3 │ const C1: u8 = 0; - │ -- Given: 'u8' - · -13 │ fun t3(): u128 { C1 } - │ ---- ^^ Invalid return expression - │ │ - │ Expected: 'u128' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/constant_invalid_usage.move:14:22 - │ - 4 │ const C2: u64 = 0; - │ --- Given: 'u64' - · -14 │ fun t4(): bool { C2 } - │ ---- ^^ Invalid return expression - │ │ - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/constant_invalid_usage.move:15:25 - │ - 5 │ const C3: u128 = 0; - │ ---- Given: 'u128' - · -15 │ fun t5(): address { C3 } - │ ------- ^^ Invalid return expression - │ │ - │ Expected: 'address' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/constant_invalid_usage.move:16:28 - │ - 6 │ const C4: bool = false; - │ ---- Given: 'bool' - · -16 │ fun t6(): vector { C4 } - │ ---------- ^^ Invalid return expression - │ │ - │ Expected: 'vector' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/constant_invalid_usage.move:17:28 - │ - 7 │ const C5: address = @0x0; - │ ------- Given: 'address' - · -17 │ fun t7(): vector { C5 } - │ ---------- ^^ Invalid return expression - │ │ - │ Expected: 'vector' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_invalid_usage.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_invalid_usage.snap new file mode 100644 index 0000000000000..cbe7efa86988e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_invalid_usage.snap @@ -0,0 +1,84 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/constant_invalid_usage.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/constant_invalid_usage.move:11:20 + │ + 8 │ const C6: vector = x"0123"; + │ ---------- Given: 'vector' + · +11 │ fun t1(): u8 { C6 } + │ -- ^^ Invalid return expression + │ │ + │ Expected: 'u8' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/constant_invalid_usage.move:12:21 + │ + 9 │ const C7: vector = b"abcd"; + │ ---------- Given: 'vector' + · +12 │ fun t2(): u64 { C7 } + │ --- ^^ Invalid return expression + │ │ + │ Expected: 'u64' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/constant_invalid_usage.move:13:22 + │ + 3 │ const C1: u8 = 0; + │ -- Given: 'u8' + · +13 │ fun t3(): u128 { C1 } + │ ---- ^^ Invalid return expression + │ │ + │ Expected: 'u128' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/constant_invalid_usage.move:14:22 + │ + 4 │ const C2: u64 = 0; + │ --- Given: 'u64' + · +14 │ fun t4(): bool { C2 } + │ ---- ^^ Invalid return expression + │ │ + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/constant_invalid_usage.move:15:25 + │ + 5 │ const C3: u128 = 0; + │ ---- Given: 'u128' + · +15 │ fun t5(): address { C3 } + │ ------- ^^ Invalid return expression + │ │ + │ Expected: 'address' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/constant_invalid_usage.move:16:28 + │ + 6 │ const C4: bool = false; + │ ---- Given: 'bool' + · +16 │ fun t6(): vector { C4 } + │ ---------- ^^ Invalid return expression + │ │ + │ Expected: 'vector' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/constant_invalid_usage.move:17:28 + │ + 7 │ const C5: address = @0x0; + │ ------- Given: 'address' + · +17 │ fun t7(): vector { C5 } + │ ---------- ^^ Invalid return expression + │ │ + │ Expected: 'vector' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_non_base_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_non_base_type.exp deleted file mode 100644 index d7d407c2d5c27..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_non_base_type.exp +++ /dev/null @@ -1,57 +0,0 @@ -error[E04012]: invalid type for constant - ┌─ tests/move_check/typing/constant_non_base_type.move:3:15 - │ -3 │ const C1: &u64 = &0; - │ ^^^^ - │ │ - │ Unpermitted constant type - │ Found: '&u64'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_non_base_type.move:3:22 - │ -3 │ const C1: &u64 = &0; - │ ^^ References (and reference operations) are not supported in constants - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/constant_non_base_type.move:4:15 - │ -4 │ const C2: &mut u64 = &0; - │ ^^^^^^^^ -- Given: '&{integer}' - │ │ - │ Invalid constant signature - │ Expected: '&mut u64' - -error[E04012]: invalid type for constant - ┌─ tests/move_check/typing/constant_non_base_type.move:4:15 - │ -4 │ const C2: &mut u64 = &0; - │ ^^^^^^^^ - │ │ - │ Unpermitted constant type - │ Found: '&mut u64'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_non_base_type.move:4:26 - │ -4 │ const C2: &mut u64 = &0; - │ ^^ References (and reference operations) are not supported in constants - -error[E04012]: invalid type for constant - ┌─ tests/move_check/typing/constant_non_base_type.move:5:15 - │ -5 │ const C3: () = (); - │ ^^ - │ │ - │ Unpermitted constant type - │ Found: '()'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - -error[E04012]: invalid type for constant - ┌─ tests/move_check/typing/constant_non_base_type.move:6:15 - │ -6 │ const C4: (address, bool) = (@0x0, false); - │ ^^^^^^^^^^^^^^^ - │ │ - │ Unpermitted constant type - │ Found: '(_, _)'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_non_base_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_non_base_type.snap new file mode 100644 index 0000000000000..f4dee1c74872b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_non_base_type.snap @@ -0,0 +1,64 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/constant_non_base_type.move +--- +error[E04012]: invalid type for constant + ┌─ tests/move_check/typing/constant_non_base_type.move:3:15 + │ +3 │ const C1: &u64 = &0; + │ ^^^^ + │ │ + │ Unpermitted constant type + │ Found: '&u64'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_non_base_type.move:3:22 + │ +3 │ const C1: &u64 = &0; + │ ^^ References (and reference operations) are not supported in constants + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/constant_non_base_type.move:4:15 + │ +4 │ const C2: &mut u64 = &0; + │ ^^^^^^^^ -- Given: '&{integer}' + │ │ + │ Invalid constant signature + │ Expected: '&mut u64' + +error[E04012]: invalid type for constant + ┌─ tests/move_check/typing/constant_non_base_type.move:4:15 + │ +4 │ const C2: &mut u64 = &0; + │ ^^^^^^^^ + │ │ + │ Unpermitted constant type + │ Found: '&mut u64'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_non_base_type.move:4:26 + │ +4 │ const C2: &mut u64 = &0; + │ ^^ References (and reference operations) are not supported in constants + +error[E04012]: invalid type for constant + ┌─ tests/move_check/typing/constant_non_base_type.move:5:15 + │ +5 │ const C3: () = (); + │ ^^ + │ │ + │ Unpermitted constant type + │ Found: '()'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' + +error[E04012]: invalid type for constant + ┌─ tests/move_check/typing/constant_non_base_type.move:6:15 + │ +6 │ const C4: (address, bool) = (@0x0, false); + │ ^^^^^^^^^^^^^^^ + │ │ + │ Unpermitted constant type + │ Found: '(_, _)'. But expected one of: 'u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'bool', 'address', 'vector<_>' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_supported_exps.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_supported_exps.snap new file mode 100644 index 0000000000000..966a6625a48d6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_supported_exps.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/constant_supported_exps.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_unsupported_exps.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_unsupported_exps.exp deleted file mode 100644 index df33c4621c100..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_unsupported_exps.exp +++ /dev/null @@ -1,216 +0,0 @@ -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:14:9 - │ -14 │ let x = 0; - │ ^^^^^^^^^ 'let' declarations are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:15:9 - │ -15 │ let s: signer = abort 0; - │ ^^^^^^^^^^^^^^^^^^^^^^^ 'let' declarations are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:15:25 - │ -15 │ let s: signer = abort 0; - │ ^^^^^^^ 'abort' expressions are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:16:9 - │ -16 │ let b = B { f: 0 }; - │ ^^^^^^^^^^^^^^^^^^ 'let' declarations are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:16:17 - │ -16 │ let b = B { f: 0 }; - │ ^^^^^^^^^^ Structs are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:17:9 - │ -17 │ &x; - │ ^^ References (and reference operations) are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:18:9 - │ -18 │ &mut x; - │ ^^^^^^ References (and reference operations) are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:19:9 - │ -19 │ f_public(); - │ ^^^^^^^^^^ Module calls are not supported in constants - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/typing/constant_unsupported_exps.move:20:9 - │ -20 │ f_script(); - │ ^^^^^^^^ Unbound function 'f_script' in current scope - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:21:9 - │ -21 │ f_friend(); - │ ^^^^^^^^^^ Module calls are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:22:9 - │ -22 │ f_private(); - │ ^^^^^^^^^^^ Module calls are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:23:9 - │ -23 │ 0x42::X::f_public(); - │ ^^^^^^^^^^^^^^^^^^^ Module calls are not supported in constants - -error[E03003]: unbound module member - ┌─ tests/move_check/typing/constant_unsupported_exps.move:24:9 - │ -24 │ 0x42::X::f_script(); - │ ^^^^^^^^^^^^^^^^^ Invalid module access. Unbound function 'f_script' in module '0x42::X' - -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/constant_unsupported_exps.move:25:9 - │ - 4 │ public(friend) fun f_friend() {} - │ -------------- This function can only be called from a 'friend' of module '0x42::X' - · -25 │ 0x42::X::f_friend(); - │ ^^^^^^^^^^^^^^^^^^^ Invalid call to 'public(friend)' visible function '0x42::X::f_friend' - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:25:9 - │ -25 │ 0x42::X::f_friend(); - │ ^^^^^^^^^^^^^^^^^^^ Module calls are not supported in constants - -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/constant_unsupported_exps.move:26:9 - │ - 5 │ fun f_private() {} - │ --------- This function is internal to its module. Only 'public' and 'public(friend)' functions can be called outside of their module - · -26 │ 0x42::X::f_private(); - │ ^^^^^^^^^^^^^^^^^^^^ Invalid call to internal function '0x42::X::f_private' - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:26:9 - │ -26 │ 0x42::X::f_private(); - │ ^^^^^^^^^^^^^^^^^^^^ Module calls are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:27:9 - │ -27 │ freeze(&mut x); - │ ^^^^^^^^^^^^^^ 'freeze' is not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:27:16 - │ -27 │ freeze(&mut x); - │ ^^^^^^ References (and reference operations) are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:28:9 - │ -28 │ assert!(true, 42); - │ ^^^^^^^^^^^^^^^^^ 'assert' is not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:29:9 - │ -29 │ if (true) 0 else 1; - │ ^^^^^^^^^^^^^^^^^^ 'if' expressions are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:30:9 - │ -30 │ loop (); - │ ^^^^^^^ 'loop' expressions are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:31:9 - │ -31 │ loop { break; continue; }; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ 'loop' expressions are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:32:9 - │ -32 │ while (true) (); - │ ^^^^^^^^^^^^^^^ 'while' expressions are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:33:9 - │ -33 │ x = 1; - │ ^^^^^ Assignments are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:34:9 - │ -34 │ return 0; - │ ^^^^^^^^ 'return' expressions are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:35:9 - │ -35 │ abort 0; - │ ^^^^^^^ 'abort' expressions are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:36:9 - │ -36 │ *(&mut 0) = 0; - │ ^^^^^^^^^^^^^ References (and reference operations) are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:36:11 - │ -36 │ *(&mut 0) = 0; - │ ^^^^^^ References (and reference operations) are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:37:9 - │ -37 │ b.f = 0; - │ ^^^ References (and reference operations) are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:37:9 - │ -37 │ b.f = 0; - │ ^^^^^^^ References (and reference operations) are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:38:9 - │ -38 │ b.f; - │ ^^^ References (and reference operations) are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:39:9 - │ -39 │ *&b.f; - │ ^^^^^ References (and reference operations) are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:39:10 - │ -39 │ *&b.f; - │ ^^^^ References (and reference operations) are not supported in constants - -error[E04013]: invalid statement or expression in constant - ┌─ tests/move_check/typing/constant_unsupported_exps.move:39:11 - │ -39 │ *&b.f; - │ ^^^ References (and reference operations) are not supported in constants - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_unsupported_exps.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_unsupported_exps.snap new file mode 100644 index 0000000000000..5722ecbb48423 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/constant_unsupported_exps.snap @@ -0,0 +1,223 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/constant_unsupported_exps.move +--- +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:14:9 + │ +14 │ let x = 0; + │ ^^^^^^^^^ 'let' declarations are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:15:9 + │ +15 │ let s: signer = abort 0; + │ ^^^^^^^^^^^^^^^^^^^^^^^ 'let' declarations are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:15:25 + │ +15 │ let s: signer = abort 0; + │ ^^^^^^^ 'abort' expressions are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:16:9 + │ +16 │ let b = B { f: 0 }; + │ ^^^^^^^^^^^^^^^^^^ 'let' declarations are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:16:17 + │ +16 │ let b = B { f: 0 }; + │ ^^^^^^^^^^ Structs are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:17:9 + │ +17 │ &x; + │ ^^ References (and reference operations) are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:18:9 + │ +18 │ &mut x; + │ ^^^^^^ References (and reference operations) are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:19:9 + │ +19 │ f_public(); + │ ^^^^^^^^^^ Module calls are not supported in constants + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/typing/constant_unsupported_exps.move:20:9 + │ +20 │ f_script(); + │ ^^^^^^^^ Unbound function 'f_script' in current scope + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:21:9 + │ +21 │ f_friend(); + │ ^^^^^^^^^^ Module calls are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:22:9 + │ +22 │ f_private(); + │ ^^^^^^^^^^^ Module calls are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:23:9 + │ +23 │ 0x42::X::f_public(); + │ ^^^^^^^^^^^^^^^^^^^ Module calls are not supported in constants + +error[E03003]: unbound module member + ┌─ tests/move_check/typing/constant_unsupported_exps.move:24:9 + │ +24 │ 0x42::X::f_script(); + │ ^^^^^^^^^^^^^^^^^ Invalid module access. Unbound function 'f_script' in module '0x42::X' + +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/constant_unsupported_exps.move:25:9 + │ + 4 │ public(friend) fun f_friend() {} + │ -------------- This function can only be called from a 'friend' of module '0x42::X' + · +25 │ 0x42::X::f_friend(); + │ ^^^^^^^^^^^^^^^^^^^ Invalid call to 'public(friend)' visible function '0x42::X::f_friend' + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:25:9 + │ +25 │ 0x42::X::f_friend(); + │ ^^^^^^^^^^^^^^^^^^^ Module calls are not supported in constants + +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/constant_unsupported_exps.move:26:9 + │ + 5 │ fun f_private() {} + │ --------- This function is internal to its module. Only 'public' and 'public(friend)' functions can be called outside of their module + · +26 │ 0x42::X::f_private(); + │ ^^^^^^^^^^^^^^^^^^^^ Invalid call to internal function '0x42::X::f_private' + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:26:9 + │ +26 │ 0x42::X::f_private(); + │ ^^^^^^^^^^^^^^^^^^^^ Module calls are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:27:9 + │ +27 │ freeze(&mut x); + │ ^^^^^^^^^^^^^^ 'freeze' is not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:27:16 + │ +27 │ freeze(&mut x); + │ ^^^^^^ References (and reference operations) are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:28:9 + │ +28 │ assert!(true, 42); + │ ^^^^^^^^^^^^^^^^^ 'assert' is not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:29:9 + │ +29 │ if (true) 0 else 1; + │ ^^^^^^^^^^^^^^^^^^ 'if' expressions are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:30:9 + │ +30 │ loop (); + │ ^^^^^^^ 'loop' expressions are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:31:9 + │ +31 │ loop { break; continue; }; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ 'loop' expressions are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:32:9 + │ +32 │ while (true) (); + │ ^^^^^^^^^^^^^^^ 'while' expressions are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:33:9 + │ +33 │ x = 1; + │ ^^^^^ Assignments are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:34:9 + │ +34 │ return 0; + │ ^^^^^^^^ 'return' expressions are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:35:9 + │ +35 │ abort 0; + │ ^^^^^^^ 'abort' expressions are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:36:9 + │ +36 │ *(&mut 0) = 0; + │ ^^^^^^^^^^^^^ References (and reference operations) are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:36:11 + │ +36 │ *(&mut 0) = 0; + │ ^^^^^^ References (and reference operations) are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:37:9 + │ +37 │ b.f = 0; + │ ^^^ References (and reference operations) are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:37:9 + │ +37 │ b.f = 0; + │ ^^^^^^^ References (and reference operations) are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:38:9 + │ +38 │ b.f; + │ ^^^ References (and reference operations) are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:39:9 + │ +39 │ *&b.f; + │ ^^^^^ References (and reference operations) are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:39:10 + │ +39 │ *&b.f; + │ ^^^^ References (and reference operations) are not supported in constants + +error[E04013]: invalid statement or expression in constant + ┌─ tests/move_check/typing/constant_unsupported_exps.move:39:11 + │ +39 │ *&b.f; + │ ^^^ References (and reference operations) are not supported in constants diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_all_cases.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_all_cases.exp deleted file mode 100644 index eeb37808c80f5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_all_cases.exp +++ /dev/null @@ -1,81 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/constraints_not_satisfied_all_cases.move:7:30 - │ -3 │ struct CupC { f: T } - │ ---- 'copy' constraint declared here - · -7 │ fun no_constraint(_c: CupC, _r: CupR) { abort 0 } - │ - ^^^^^^^ - │ │ │ │ - │ │ │ The type 'T' does not have the ability 'copy' - │ │ 'copy' constraint not satisifed - │ To satisfy the constraint, the 'copy' ability would need to be added here - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/constraints_not_satisfied_all_cases.move:7:43 - │ -2 │ struct CupR { f: T } - │ --- 'key' constraint declared here - · -7 │ fun no_constraint(_c: CupC, _r: CupR) { abort 0 } - │ - ^^^^^^^ - │ │ │ │ - │ │ │ The type 'T' does not have the ability 'key' - │ │ 'key' constraint not satisifed - │ To satisfy the constraint, the 'key' ability would need to be added here - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/constraints_not_satisfied_all_cases.move:9:32 - │ -3 │ struct CupC { f: T } - │ ---- 'copy' constraint declared here - · -9 │ fun t_resource(_c: CupC, _r: CupR) { abort 0 } - │ - ^^^^^^^ - │ │ │ │ - │ │ │ The type 'T' does not have the ability 'copy' - │ │ 'copy' constraint not satisifed - │ To satisfy the constraint, the 'copy' ability would need to be added here - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/constraints_not_satisfied_all_cases.move:11:46 - │ - 2 │ struct CupR { f: T } - │ --- 'key' constraint declared here - · -11 │ fun t_copyable(_c: CupC, _r: CupR) { abort 0 } - │ - ^^^^^^^ - │ │ │ │ - │ │ │ The type 'T' does not have the ability 'key' - │ │ 'key' constraint not satisifed - │ To satisfy the constraint, the 'key' ability would need to be added here - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/constraints_not_satisfied_all_cases.move:13:15 - │ - 3 │ struct CupC { f: T } - │ ---- 'copy' constraint declared here - 4 │ struct R has key {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here - · -13 │ fun r(_c: CupC, _r: CupR) { abort 0 } - │ ^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/constraints_not_satisfied_all_cases.move:15:28 - │ - 2 │ struct CupR { f: T } - │ --- 'key' constraint declared here - · - 5 │ struct C has copy {} - │ - To satisfy the constraint, the 'key' ability would need to be added here - · -15 │ fun c(_c: CupC, _r: CupR) { abort 0 } - │ ^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::C' does not have the ability 'key' - │ 'key' constraint not satisifed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_all_cases.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_all_cases.snap new file mode 100644 index 0000000000000..b25e4c83e17b8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_all_cases.snap @@ -0,0 +1,88 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_all_cases.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/constraints_not_satisfied_all_cases.move:7:30 + │ +3 │ struct CupC { f: T } + │ ---- 'copy' constraint declared here + · +7 │ fun no_constraint(_c: CupC, _r: CupR) { abort 0 } + │ - ^^^^^^^ + │ │ │ │ + │ │ │ The type 'T' does not have the ability 'copy' + │ │ 'copy' constraint not satisifed + │ To satisfy the constraint, the 'copy' ability would need to be added here + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/constraints_not_satisfied_all_cases.move:7:43 + │ +2 │ struct CupR { f: T } + │ --- 'key' constraint declared here + · +7 │ fun no_constraint(_c: CupC, _r: CupR) { abort 0 } + │ - ^^^^^^^ + │ │ │ │ + │ │ │ The type 'T' does not have the ability 'key' + │ │ 'key' constraint not satisifed + │ To satisfy the constraint, the 'key' ability would need to be added here + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/constraints_not_satisfied_all_cases.move:9:32 + │ +3 │ struct CupC { f: T } + │ ---- 'copy' constraint declared here + · +9 │ fun t_resource(_c: CupC, _r: CupR) { abort 0 } + │ - ^^^^^^^ + │ │ │ │ + │ │ │ The type 'T' does not have the ability 'copy' + │ │ 'copy' constraint not satisifed + │ To satisfy the constraint, the 'copy' ability would need to be added here + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/constraints_not_satisfied_all_cases.move:11:46 + │ + 2 │ struct CupR { f: T } + │ --- 'key' constraint declared here + · +11 │ fun t_copyable(_c: CupC, _r: CupR) { abort 0 } + │ - ^^^^^^^ + │ │ │ │ + │ │ │ The type 'T' does not have the ability 'key' + │ │ 'key' constraint not satisifed + │ To satisfy the constraint, the 'key' ability would need to be added here + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/constraints_not_satisfied_all_cases.move:13:15 + │ + 3 │ struct CupC { f: T } + │ ---- 'copy' constraint declared here + 4 │ struct R has key {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here + · +13 │ fun r(_c: CupC, _r: CupR) { abort 0 } + │ ^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/constraints_not_satisfied_all_cases.move:15:28 + │ + 2 │ struct CupR { f: T } + │ --- 'key' constraint declared here + · + 5 │ struct C has copy {} + │ - To satisfy the constraint, the 'key' ability would need to be added here + · +15 │ fun c(_c: CupC, _r: CupR) { abort 0 } + │ ^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::C' does not have the ability 'key' + │ 'key' constraint not satisifed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_function_parameter.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_function_parameter.exp deleted file mode 100644 index 764660a69f314..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_function_parameter.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/constraints_not_satisfied_function_parameter.move:5:17 - │ -2 │ struct CupC { f: T } - │ ---- 'copy' constraint declared here -3 │ struct R {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here -4 │ -5 │ fun foo(_x: CupC) { abort 0 } - │ ^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'copy' - │ 'copy' constraint not satisifed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_function_parameter.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_function_parameter.snap new file mode 100644 index 0000000000000..aa8e9f690003c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_function_parameter.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_function_parameter.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/constraints_not_satisfied_function_parameter.move:5:17 + │ +2 │ struct CupC { f: T } + │ ---- 'copy' constraint declared here +3 │ struct R {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here +4 │ +5 │ fun foo(_x: CupC) { abort 0 } + │ ^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'copy' + │ 'copy' constraint not satisifed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_function_return_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_function_return_type.exp deleted file mode 100644 index 7ccbfef4025ae..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_function_return_type.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/constraints_not_satisfied_function_return_type.move:5:17 - │ -2 │ struct CupC { f: T } - │ ---- 'copy' constraint declared here -3 │ struct R {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here -4 │ -5 │ fun foo(): CupC { - │ ^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'copy' - │ 'copy' constraint not satisifed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_function_return_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_function_return_type.snap new file mode 100644 index 0000000000000..85efddb096dc9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_function_return_type.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_function_return_type.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/constraints_not_satisfied_function_return_type.move:5:17 + │ +2 │ struct CupC { f: T } + │ ---- 'copy' constraint declared here +3 │ struct R {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here +4 │ +5 │ fun foo(): CupC { + │ ^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'copy' + │ 'copy' constraint not satisifed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_bind_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_bind_type.exp deleted file mode 100644 index 20bef8e20c45c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_bind_type.exp +++ /dev/null @@ -1,22 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/constraints_not_satisfied_lvalues_bind_type.move:6:17 - │ -2 │ struct CupC { f: T } - │ ---- 'copy' constraint declared here -3 │ struct R {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here - · -6 │ let _x: CupC = abort 0; - │ ^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/typing/constraints_not_satisfied_lvalues_bind_type.move:6:27 - │ -6 │ let _x: CupC = abort 0; - │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_bind_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_bind_type.snap new file mode 100644 index 0000000000000..3c171a0838833 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_bind_type.snap @@ -0,0 +1,29 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_bind_type.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/constraints_not_satisfied_lvalues_bind_type.move:6:17 + │ +2 │ struct CupC { f: T } + │ ---- 'copy' constraint declared here +3 │ struct R {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here + · +6 │ let _x: CupC = abort 0; + │ ^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/typing/constraints_not_satisfied_lvalues_bind_type.move:6:27 + │ +6 │ let _x: CupC = abort 0; + │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_decl_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_decl_type.exp deleted file mode 100644 index c524b45d17086..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_decl_type.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/constraints_not_satisfied_lvalues_decl_type.move:6:17 - │ -2 │ struct CupC { f: T } - │ ---- 'copy' constraint declared here -3 │ struct R {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here - · -6 │ let _x: CupC; - │ ^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'copy' - │ 'copy' constraint not satisifed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_decl_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_decl_type.snap new file mode 100644 index 0000000000000..5809abe37c7d0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_decl_type.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_decl_type.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/constraints_not_satisfied_lvalues_decl_type.move:6:17 + │ +2 │ struct CupC { f: T } + │ ---- 'copy' constraint declared here +3 │ struct R {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here + · +6 │ let _x: CupC; + │ ^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'copy' + │ 'copy' constraint not satisifed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_pack_type_args.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_pack_type_args.exp deleted file mode 100644 index 906ea6b17c563..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_pack_type_args.exp +++ /dev/null @@ -1,36 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/constraints_not_satisfied_lvalues_pack_type_args.move:8:15 - │ -2 │ struct CupC {} - │ ---- 'copy' constraint declared here -3 │ struct R {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here - · -8 │ let B> {} = abort 0; - │ ^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/typing/constraints_not_satisfied_lvalues_pack_type_args.move:8:29 - │ -8 │ let B> {} = abort 0; - │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/constraints_not_satisfied_lvalues_pack_type_args.move:9:11 - │ -2 │ struct CupC {} - │ ---- 'copy' constraint declared here -3 │ struct R {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here - · -9 │ B> {} = abort 0; - │ ^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'copy' - │ 'copy' constraint not satisifed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_pack_type_args.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_pack_type_args.snap new file mode 100644 index 0000000000000..cf936a10d4b71 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_pack_type_args.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_lvalues_pack_type_args.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/constraints_not_satisfied_lvalues_pack_type_args.move:8:15 + │ +2 │ struct CupC {} + │ ---- 'copy' constraint declared here +3 │ struct R {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here + · +8 │ let B> {} = abort 0; + │ ^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/typing/constraints_not_satisfied_lvalues_pack_type_args.move:8:29 + │ +8 │ let B> {} = abort 0; + │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/constraints_not_satisfied_lvalues_pack_type_args.move:9:11 + │ +2 │ struct CupC {} + │ ---- 'copy' constraint declared here +3 │ struct R {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here + · +9 │ B> {} = abort 0; + │ ^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'copy' + │ 'copy' constraint not satisifed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_struct_field.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_struct_field.exp deleted file mode 100644 index dea7b7bd6e115..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_struct_field.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/constraints_not_satisfied_struct_field.move:6:12 - │ -2 │ struct CupC { f: T } - │ ---- 'copy' constraint declared here -3 │ struct R {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here - · -6 │ f: CupC, - │ ^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'copy' - │ 'copy' constraint not satisifed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_struct_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_struct_field.snap new file mode 100644 index 0000000000000..1488394ce4d28 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_struct_field.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_struct_field.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/constraints_not_satisfied_struct_field.move:6:12 + │ +2 │ struct CupC { f: T } + │ ---- 'copy' constraint declared here +3 │ struct R {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here + · +6 │ f: CupC, + │ ^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'copy' + │ 'copy' constraint not satisifed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_annotation.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_annotation.exp deleted file mode 100644 index 55b49a84ce1c9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_annotation.exp +++ /dev/null @@ -1,23 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/typing/constraints_not_satisfied_type_annotation.move:7:17 - │ -7 │ ignore((abort 0: CupC)); - │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/constraints_not_satisfied_type_annotation.move:7:26 - │ -2 │ struct CupC { f: T } - │ ---- 'copy' constraint declared here -3 │ struct C {} -4 │ struct R {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here - · -7 │ ignore((abort 0: CupC)); - │ ^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'copy' - │ 'copy' constraint not satisifed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_annotation.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_annotation.snap new file mode 100644 index 0000000000000..6172b9cde2a06 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_annotation.snap @@ -0,0 +1,30 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_annotation.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/typing/constraints_not_satisfied_type_annotation.move:7:17 + │ +7 │ ignore((abort 0: CupC)); + │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/constraints_not_satisfied_type_annotation.move:7:26 + │ +2 │ struct CupC { f: T } + │ ---- 'copy' constraint declared here +3 │ struct C {} +4 │ struct R {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here + · +7 │ ignore((abort 0: CupC)); + │ ^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'copy' + │ 'copy' constraint not satisifed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_call.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_call.exp deleted file mode 100644 index c0c475af89205..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_call.exp +++ /dev/null @@ -1,14 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_call.move:9:13 - │ -2 │ struct CupC { f: T } - │ ---- 'copy' constraint declared here -3 │ struct R {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here - · -9 │ box>(); - │ ^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'copy' - │ 'copy' constraint not satisifed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_call.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_call.snap new file mode 100644 index 0000000000000..8422b850f7158 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_call.snap @@ -0,0 +1,21 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_call.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_call.move:9:13 + │ +2 │ struct CupC { f: T } + │ ---- 'copy' constraint declared here +3 │ struct R {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here + · +9 │ box>(); + │ ^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'copy' + │ 'copy' constraint not satisifed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_pack.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_pack.exp deleted file mode 100644 index b0a77a3bf47a6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_pack.exp +++ /dev/null @@ -1,42 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_pack.move:8:9 - │ -8 │ Box>{ f: abort 0 }; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Box<0x8675309::M::CupD<0x8675309::M::R>>' can have the ability 'drop' but the type argument '0x8675309::M::CupD<0x8675309::M::R>' does not have the required ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - │ The type '0x8675309::M::Box<0x8675309::M::CupD<0x8675309::M::R>>' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_pack.move:8:13 - │ -2 │ struct CupD has drop { f: T } - │ ---- 'drop' constraint declared here -3 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -8 │ Box>{ f: abort 0 }; - │ ^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_pack.move:8:26 - │ -8 │ Box>{ f: abort 0 }; - │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_pack.move:9:9 - │ -9 │ Box{ f: R{} }; - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Box<0x8675309::M::R>' can have the ability 'drop' but the type argument '0x8675309::M::R' does not have the required ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - │ The type '0x8675309::M::Box<0x8675309::M::R>' does not have the ability 'drop' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_pack.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_pack.snap new file mode 100644 index 0000000000000..f8ff980c41fc1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_pack.snap @@ -0,0 +1,49 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_pack.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_pack.move:8:9 + │ +8 │ Box>{ f: abort 0 }; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Box<0x8675309::M::CupD<0x8675309::M::R>>' can have the ability 'drop' but the type argument '0x8675309::M::CupD<0x8675309::M::R>' does not have the required ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + │ The type '0x8675309::M::Box<0x8675309::M::CupD<0x8675309::M::R>>' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_pack.move:8:13 + │ +2 │ struct CupD has drop { f: T } + │ ---- 'drop' constraint declared here +3 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +8 │ Box>{ f: abort 0 }; + │ ^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_pack.move:8:26 + │ +8 │ Box>{ f: abort 0 }; + │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/constraints_not_satisfied_type_arguments_internal_pack.move:9:9 + │ +9 │ Box{ f: R{} }; + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Box<0x8675309::M::R>' can have the ability 'drop' but the type argument '0x8675309::M::R' does not have the required ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + │ The type '0x8675309::M::Box<0x8675309::M::R>' does not have the ability 'drop' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/continue_any_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/continue_any_type.exp deleted file mode 100644 index 9fc74310ae0f6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/continue_any_type.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/typing/continue_any_type.move:6:17 - │ -6 │ 0 + continue; - │ ^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/typing/continue_any_type.move:12:17 - │ -12 │ foo(continue) - │ ^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/continue_any_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/continue_any_type.snap new file mode 100644 index 0000000000000..b4d019254a011 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/continue_any_type.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/continue_any_type.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/typing/continue_any_type.move:6:17 + │ +6 │ 0 + continue; + │ ^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/typing/continue_any_type.move:12:17 + │ +12 │ foo(continue) + │ ^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/continue_outside_loop.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/continue_outside_loop.exp deleted file mode 100644 index a046a45e2fd95..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/continue_outside_loop.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04014]: invalid loop control - ┌─ tests/move_check/typing/continue_outside_loop.move:6:9 - │ -6 │ continue - │ ^^^^^^^^ Invalid usage of 'continue'. 'continue' can only be used inside a loop body or lambda - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/continue_outside_loop.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/continue_outside_loop.snap new file mode 100644 index 0000000000000..8de61a6aa0744 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/continue_outside_loop.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/continue_outside_loop.move +--- +error[E04014]: invalid loop control + ┌─ tests/move_check/typing/continue_outside_loop.move:6:9 + │ +6 │ continue + │ ^^^^^^^^ Invalid usage of 'continue'. 'continue' can only be used inside a loop body or lambda diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/decl_unpack_references.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/decl_unpack_references.snap new file mode 100644 index 0000000000000..723535ba26451 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/decl_unpack_references.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/decl_unpack_references.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_duplicate_binding.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_duplicate_binding.exp deleted file mode 100644 index 2f8e7ff8d6ceb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_duplicate_binding.exp +++ /dev/null @@ -1,48 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/typing/declare_duplicate_binding.move:5:14 - │ -5 │ let (x, x); - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/typing/declare_duplicate_binding.move:5:17 - │ -5 │ let (x, x); - │ - ^ Duplicate declaration for local 'x' in a given 'let' - │ │ - │ Previously declared here - -warning[W09002]: unused variable - ┌─ tests/move_check/typing/declare_duplicate_binding.move:6:14 - │ -6 │ let (f, R{f}, f); - │ ^ Unused local variable 'f'. Consider removing or prefixing with an underscore: '_f' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/typing/declare_duplicate_binding.move:6:19 - │ -6 │ let (f, R{f}, f); - │ ^ Unused local variable 'f'. Consider removing or prefixing with an underscore: '_f' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/typing/declare_duplicate_binding.move:6:19 - │ -6 │ let (f, R{f}, f); - │ - ^ Duplicate declaration for local 'f' in a given 'let' - │ │ - │ Previously declared here - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/typing/declare_duplicate_binding.move:6:23 - │ -6 │ let (f, R{f}, f); - │ - ^ Duplicate declaration for local 'f' in a given 'let' - │ │ - │ Previously declared here - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_duplicate_binding.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_duplicate_binding.snap new file mode 100644 index 0000000000000..a1b5f2de27735 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_duplicate_binding.snap @@ -0,0 +1,55 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/declare_duplicate_binding.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/typing/declare_duplicate_binding.move:5:14 + │ +5 │ let (x, x); + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/typing/declare_duplicate_binding.move:5:17 + │ +5 │ let (x, x); + │ - ^ Duplicate declaration for local 'x' in a given 'let' + │ │ + │ Previously declared here + +warning[W09002]: unused variable + ┌─ tests/move_check/typing/declare_duplicate_binding.move:6:14 + │ +6 │ let (f, R{f}, f); + │ ^ Unused local variable 'f'. Consider removing or prefixing with an underscore: '_f' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/typing/declare_duplicate_binding.move:6:19 + │ +6 │ let (f, R{f}, f); + │ ^ Unused local variable 'f'. Consider removing or prefixing with an underscore: '_f' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/typing/declare_duplicate_binding.move:6:19 + │ +6 │ let (f, R{f}, f); + │ - ^ Duplicate declaration for local 'f' in a given 'let' + │ │ + │ Previously declared here + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/typing/declare_duplicate_binding.move:6:23 + │ +6 │ let (f, R{f}, f); + │ - ^ Duplicate declaration for local 'f' in a given 'let' + │ │ + │ Previously declared here diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_pop_resource.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_pop_resource.exp deleted file mode 100644 index 9c7c29fe4b76b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_pop_resource.exp +++ /dev/null @@ -1,33 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/declare_pop_resource.move:5:13 - │ -2 │ struct R {f: u64} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -5 │ let _: R; - │ ^ - The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ Cannot ignore values without the 'drop' ability. The value must be used - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/declare_pop_resource.move:9:14 - │ -2 │ struct R {f: u64} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -9 │ let (_, _):(R, R); - │ ^ - The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ Cannot ignore values without the 'drop' ability. The value must be used - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/declare_pop_resource.move:9:17 - │ -2 │ struct R {f: u64} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -9 │ let (_, _):(R, R); - │ ^ - The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ Cannot ignore values without the 'drop' ability. The value must be used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_pop_resource.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_pop_resource.snap new file mode 100644 index 0000000000000..a8454a3c7fa77 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_pop_resource.snap @@ -0,0 +1,40 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/declare_pop_resource.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/declare_pop_resource.move:5:13 + │ +2 │ struct R {f: u64} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +5 │ let _: R; + │ ^ - The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ Cannot ignore values without the 'drop' ability. The value must be used + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/declare_pop_resource.move:9:14 + │ +2 │ struct R {f: u64} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +9 │ let (_, _):(R, R); + │ ^ - The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ Cannot ignore values without the 'drop' ability. The value must be used + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/declare_pop_resource.move:9:17 + │ +2 │ struct R {f: u64} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +9 │ let (_, _):(R, R); + │ ^ - The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ Cannot ignore values without the 'drop' ability. The value must be used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_with_type_annot.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_with_type_annot.exp deleted file mode 100644 index ce5f5f46bb882..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_with_type_annot.exp +++ /dev/null @@ -1,32 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/typing/declare_with_type_annot.move:6:13 - │ -6 │ let x: u64; - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/typing/declare_with_type_annot.move:7:14 - │ -7 │ let (x, b, R{f}): (u64, bool, R); - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/typing/declare_with_type_annot.move:7:17 - │ -7 │ let (x, b, R{f}): (u64, bool, R); - │ ^ Unused local variable 'b'. Consider removing or prefixing with an underscore: '_b' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/typing/declare_with_type_annot.move:7:22 - │ -7 │ let (x, b, R{f}): (u64, bool, R); - │ ^ Unused local variable 'f'. Consider removing or prefixing with an underscore: '_f' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_with_type_annot.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_with_type_annot.snap new file mode 100644 index 0000000000000..1c05a2b3ec30d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_with_type_annot.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/declare_with_type_annot.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/typing/declare_with_type_annot.move:6:13 + │ +6 │ let x: u64; + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/typing/declare_with_type_annot.move:7:14 + │ +7 │ let (x, b, R{f}): (u64, bool, R); + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/typing/declare_with_type_annot.move:7:17 + │ +7 │ let (x, b, R{f}): (u64, bool, R); + │ ^ Unused local variable 'b'. Consider removing or prefixing with an underscore: '_b' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/typing/declare_with_type_annot.move:7:22 + │ +7 │ let (x, b, R{f}): (u64, bool, R); + │ ^ Unused local variable 'f'. Consider removing or prefixing with an underscore: '_f' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_wrong_arity.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_wrong_arity.exp deleted file mode 100644 index 92d7ba0ec4ed2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_wrong_arity.exp +++ /dev/null @@ -1,35 +0,0 @@ -error[E04005]: expected a single type - ┌─ tests/move_check/typing/declare_wrong_arity.move:5:13 - │ -5 │ let _x: (); - │ ^^ -- Expected a single type, but found expression list type: '()' - │ │ - │ Invalid type for local - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/declare_wrong_arity.move:6:13 - │ -6 │ let (): u64; - │ ^^ --- Given: 'u64' - │ │ - │ Invalid value for binding - │ Expected: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/declare_wrong_arity.move:7:13 - │ -7 │ let (x, b, R{f}): (u64, bool, R, R); x; b; f; - │ ^^^^^^^^^^^^ ----------------- Given expression list of length 4: '(u64, bool, 0x8675309::M::R, 0x8675309::M::R)' - │ │ - │ Invalid value for binding - │ Expected expression list of length 3: '(_, _, _)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/declare_wrong_arity.move:8:13 - │ -8 │ let (x, b, R{f}): (u64, bool); x; b; f; - │ ^^^^^^^^^^^^ ----------- Given expression list of length 2: '(u64, bool)' - │ │ - │ Invalid value for binding - │ Expected expression list of length 3: '(_, _, _)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_wrong_arity.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_wrong_arity.snap new file mode 100644 index 0000000000000..3bb76529ab664 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_wrong_arity.snap @@ -0,0 +1,42 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/declare_wrong_arity.move +--- +error[E04005]: expected a single type + ┌─ tests/move_check/typing/declare_wrong_arity.move:5:13 + │ +5 │ let _x: (); + │ ^^ -- Expected a single type, but found expression list type: '()' + │ │ + │ Invalid type for local + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/declare_wrong_arity.move:6:13 + │ +6 │ let (): u64; + │ ^^ --- Given: 'u64' + │ │ + │ Invalid value for binding + │ Expected: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/declare_wrong_arity.move:7:13 + │ +7 │ let (x, b, R{f}): (u64, bool, R, R); x; b; f; + │ ^^^^^^^^^^^^ ----------------- Given expression list of length 4: '(u64, bool, 0x8675309::M::R, 0x8675309::M::R)' + │ │ + │ Invalid value for binding + │ Expected expression list of length 3: '(_, _, _)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/declare_wrong_arity.move:8:13 + │ +8 │ let (x, b, R{f}): (u64, bool); x; b; f; + │ ^^^^^^^^^^^^ ----------- Given expression list of length 2: '(u64, bool)' + │ │ + │ Invalid value for binding + │ Expected expression list of length 3: '(_, _, _)' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_wrong_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_wrong_type.exp deleted file mode 100644 index 771a28fe3b893..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_wrong_type.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/declare_wrong_type.move:6:13 - │ -6 │ let S { g } : R; g = 0; - │ ^^^^^^^ - Expected: '0x8675309::M::R' - │ │ - │ Invalid deconstruction binding - │ Given: '0x8675309::M::S' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/declare_wrong_type.move:7:14 - │ -7 │ let (S { g }, R { f }): (R, R); - │ ^^^^^^^ - Expected: '0x8675309::M::R' - │ │ - │ Invalid deconstruction binding - │ Given: '0x8675309::M::S' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_wrong_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_wrong_type.snap new file mode 100644 index 0000000000000..f0875a1d56109 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/declare_wrong_type.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/declare_wrong_type.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/declare_wrong_type.move:6:13 + │ +6 │ let S { g } : R; g = 0; + │ ^^^^^^^ - Expected: '0x8675309::M::R' + │ │ + │ Invalid deconstruction binding + │ Given: '0x8675309::M::S' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/declare_wrong_type.move:7:14 + │ +7 │ let (S { g }, R { f }): (R, R); + │ ^^^^^^^ - Expected: '0x8675309::M::R' + │ │ + │ Invalid deconstruction binding + │ Given: '0x8675309::M::S' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/derefrence.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/derefrence.snap new file mode 100644 index 0000000000000..5042b59d9c1d4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/derefrence.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/derefrence.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/derefrence_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/derefrence_invalid.exp deleted file mode 100644 index cea8ee304cb71..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/derefrence_invalid.exp +++ /dev/null @@ -1,143 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/derefrence_invalid.move:6:15 - │ -5 │ fun t0(x: &u64, x_mut: &mut u64, s: &S, s_mut: &mut S){ - │ --- Given: 'u64' -6 │ (*x : bool); - │ ^^^^ - │ │ - │ Invalid type annotation - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/derefrence_invalid.move:7:18 - │ -5 │ fun t0(x: &u64, x_mut: &mut u64, s: &S, s_mut: &mut S){ - │ --- Given: 'u64' -6 │ (*x : bool); -7 │ (*x_mut: &u64); - │ ^^^^ - │ │ - │ Invalid type annotation - │ Expected: '&u64' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/derefrence_invalid.move:9:14 - │ -5 │ fun t0(x: &u64, x_mut: &mut u64, s: &S, s_mut: &mut S){ - │ - Given: '0x8675309::M::S' - · -9 │ (*s: X); - │ ^ - │ │ - │ Invalid type annotation - │ Expected: '0x8675309::M::X' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/derefrence_invalid.move:10:17 - │ - 3 │ struct S has copy, drop { f: u64, x: X } - │ --- Given: 'u64' - · -10 │ (*&s.f: bool); - │ ^^^^ - │ │ - │ Invalid type annotation - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/derefrence_invalid.move:11:15 - │ - 3 │ struct S has copy, drop { f: u64, x: X } - │ --- Given: 'u64' - · -11 │ (s.f: &u64); - │ ^^^^ - │ │ - │ Invalid type annotation - │ Expected: '&u64' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/derefrence_invalid.move:12:17 - │ - 3 │ struct S has copy, drop { f: u64, x: X } - │ - Given: '0x8675309::M::X' - · -12 │ (*&s.x: &X); - │ ^^ - │ │ - │ Invalid type annotation - │ Expected: '&0x8675309::M::X' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/derefrence_invalid.move:14:18 - │ - 5 │ fun t0(x: &u64, x_mut: &mut u64, s: &S, s_mut: &mut S){ - │ - Given: '0x8675309::M::S' - · -14 │ (*s_mut: X); - │ ^ - │ │ - │ Invalid type annotation - │ Expected: '0x8675309::M::X' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/derefrence_invalid.move:15:21 - │ - 3 │ struct S has copy, drop { f: u64, x: X } - │ --- Given: 'u64' - · -15 │ (*&s_mut.f: bool); - │ ^^^^ - │ │ - │ Invalid type annotation - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/derefrence_invalid.move:16:25 - │ - 3 │ struct S has copy, drop { f: u64, x: X } - │ --- Given: 'u64' - · -16 │ (*&mut s_mut.f: (bool, u64)); - │ ^^^^^^^^^^^ - │ │ - │ Invalid type annotation - │ Expected: '(bool, u64)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/derefrence_invalid.move:17:19 - │ - 3 │ struct S has copy, drop { f: u64, x: X } - │ --- Given: 'u64' - · -17 │ (s_mut.f: &u64); - │ ^^^^ - │ │ - │ Invalid type annotation - │ Expected: '&u64' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/derefrence_invalid.move:18:21 - │ - 3 │ struct S has copy, drop { f: u64, x: X } - │ - Given: '0x8675309::M::X' - · -18 │ (*&s_mut.x: (X, S)); - │ ^^^^^^ - │ │ - │ Invalid type annotation - │ Expected: '(0x8675309::M::X, 0x8675309::M::S)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/derefrence_invalid.move:19:25 - │ - 3 │ struct S has copy, drop { f: u64, x: X } - │ - Given: '0x8675309::M::X' - · -19 │ (*&mut s_mut.x: ()); - │ ^^ - │ │ - │ Invalid type annotation - │ Expected: '()' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/derefrence_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/derefrence_invalid.snap new file mode 100644 index 0000000000000..1d04a1a54b526 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/derefrence_invalid.snap @@ -0,0 +1,150 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/derefrence_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/derefrence_invalid.move:6:15 + │ +5 │ fun t0(x: &u64, x_mut: &mut u64, s: &S, s_mut: &mut S){ + │ --- Given: 'u64' +6 │ (*x : bool); + │ ^^^^ + │ │ + │ Invalid type annotation + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/derefrence_invalid.move:7:18 + │ +5 │ fun t0(x: &u64, x_mut: &mut u64, s: &S, s_mut: &mut S){ + │ --- Given: 'u64' +6 │ (*x : bool); +7 │ (*x_mut: &u64); + │ ^^^^ + │ │ + │ Invalid type annotation + │ Expected: '&u64' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/derefrence_invalid.move:9:14 + │ +5 │ fun t0(x: &u64, x_mut: &mut u64, s: &S, s_mut: &mut S){ + │ - Given: '0x8675309::M::S' + · +9 │ (*s: X); + │ ^ + │ │ + │ Invalid type annotation + │ Expected: '0x8675309::M::X' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/derefrence_invalid.move:10:17 + │ + 3 │ struct S has copy, drop { f: u64, x: X } + │ --- Given: 'u64' + · +10 │ (*&s.f: bool); + │ ^^^^ + │ │ + │ Invalid type annotation + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/derefrence_invalid.move:11:15 + │ + 3 │ struct S has copy, drop { f: u64, x: X } + │ --- Given: 'u64' + · +11 │ (s.f: &u64); + │ ^^^^ + │ │ + │ Invalid type annotation + │ Expected: '&u64' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/derefrence_invalid.move:12:17 + │ + 3 │ struct S has copy, drop { f: u64, x: X } + │ - Given: '0x8675309::M::X' + · +12 │ (*&s.x: &X); + │ ^^ + │ │ + │ Invalid type annotation + │ Expected: '&0x8675309::M::X' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/derefrence_invalid.move:14:18 + │ + 5 │ fun t0(x: &u64, x_mut: &mut u64, s: &S, s_mut: &mut S){ + │ - Given: '0x8675309::M::S' + · +14 │ (*s_mut: X); + │ ^ + │ │ + │ Invalid type annotation + │ Expected: '0x8675309::M::X' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/derefrence_invalid.move:15:21 + │ + 3 │ struct S has copy, drop { f: u64, x: X } + │ --- Given: 'u64' + · +15 │ (*&s_mut.f: bool); + │ ^^^^ + │ │ + │ Invalid type annotation + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/derefrence_invalid.move:16:25 + │ + 3 │ struct S has copy, drop { f: u64, x: X } + │ --- Given: 'u64' + · +16 │ (*&mut s_mut.f: (bool, u64)); + │ ^^^^^^^^^^^ + │ │ + │ Invalid type annotation + │ Expected: '(bool, u64)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/derefrence_invalid.move:17:19 + │ + 3 │ struct S has copy, drop { f: u64, x: X } + │ --- Given: 'u64' + · +17 │ (s_mut.f: &u64); + │ ^^^^ + │ │ + │ Invalid type annotation + │ Expected: '&u64' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/derefrence_invalid.move:18:21 + │ + 3 │ struct S has copy, drop { f: u64, x: X } + │ - Given: '0x8675309::M::X' + · +18 │ (*&s_mut.x: (X, S)); + │ ^^^^^^ + │ │ + │ Invalid type annotation + │ Expected: '(0x8675309::M::X, 0x8675309::M::S)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/derefrence_invalid.move:19:25 + │ + 3 │ struct S has copy, drop { f: u64, x: X } + │ - Given: '0x8675309::M::X' + · +19 │ (*&mut s_mut.x: ()); + │ ^^ + │ │ + │ Invalid type annotation + │ Expected: '()' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/derefrence_reference.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/derefrence_reference.exp deleted file mode 100644 index 027ca6cc6ff8d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/derefrence_reference.exp +++ /dev/null @@ -1,79 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/derefrence_reference.move:6:16 - │ -2 │ struct R {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here - · -5 │ fun t0(r: &R, b: &B) { - │ - The type '0x8675309::M::R' does not have the ability 'copy' -6 │ R {} = *r; - │ ^^ Invalid dereference. Dereference requires the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/derefrence_reference.move:7:24 - │ -3 │ struct B { r: R } - │ - To satisfy the constraint, the 'copy' ability would need to be added here -4 │ -5 │ fun t0(r: &R, b: &B) { - │ - The type '0x8675309::M::B' does not have the ability 'copy' -6 │ R {} = *r; -7 │ B { r: R{} } = *b; - │ ^^ Invalid dereference. Dereference requires the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/derefrence_reference.move:8:15 - │ -2 │ struct R {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here -3 │ struct B { r: R } - │ - The type '0x8675309::M::R' does not have the ability 'copy' - · -8 │ R{} = *&b.r; - │ ^^^^^ Invalid dereference. Dereference requires the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/derefrence_reference.move:12:16 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here - · -11 │ fun t1(r: &mut R, b: &mut B) { - │ - The type '0x8675309::M::R' does not have the ability 'copy' -12 │ R {} = *r; - │ ^^ Invalid dereference. Dereference requires the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/derefrence_reference.move:13:24 - │ - 3 │ struct B { r: R } - │ - To satisfy the constraint, the 'copy' ability would need to be added here - · -11 │ fun t1(r: &mut R, b: &mut B) { - │ - The type '0x8675309::M::B' does not have the ability 'copy' -12 │ R {} = *r; -13 │ B { r: R{} } = *b; - │ ^^ Invalid dereference. Dereference requires the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/derefrence_reference.move:14:15 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ struct B { r: R } - │ - The type '0x8675309::M::R' does not have the ability 'copy' - · -14 │ R{} = *&b.r; - │ ^^^^^ Invalid dereference. Dereference requires the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/derefrence_reference.move:15:15 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ struct B { r: R } - │ - The type '0x8675309::M::R' does not have the ability 'copy' - · -15 │ R{} = *&mut b.r; - │ ^^^^^^^^^ Invalid dereference. Dereference requires the 'copy' ability - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/derefrence_reference.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/derefrence_reference.snap new file mode 100644 index 0000000000000..9c60f7eee6c65 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/derefrence_reference.snap @@ -0,0 +1,86 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/derefrence_reference.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/derefrence_reference.move:6:16 + │ +2 │ struct R {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here + · +5 │ fun t0(r: &R, b: &B) { + │ - The type '0x8675309::M::R' does not have the ability 'copy' +6 │ R {} = *r; + │ ^^ Invalid dereference. Dereference requires the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/derefrence_reference.move:7:24 + │ +3 │ struct B { r: R } + │ - To satisfy the constraint, the 'copy' ability would need to be added here +4 │ +5 │ fun t0(r: &R, b: &B) { + │ - The type '0x8675309::M::B' does not have the ability 'copy' +6 │ R {} = *r; +7 │ B { r: R{} } = *b; + │ ^^ Invalid dereference. Dereference requires the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/derefrence_reference.move:8:15 + │ +2 │ struct R {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here +3 │ struct B { r: R } + │ - The type '0x8675309::M::R' does not have the ability 'copy' + · +8 │ R{} = *&b.r; + │ ^^^^^ Invalid dereference. Dereference requires the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/derefrence_reference.move:12:16 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here + · +11 │ fun t1(r: &mut R, b: &mut B) { + │ - The type '0x8675309::M::R' does not have the ability 'copy' +12 │ R {} = *r; + │ ^^ Invalid dereference. Dereference requires the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/derefrence_reference.move:13:24 + │ + 3 │ struct B { r: R } + │ - To satisfy the constraint, the 'copy' ability would need to be added here + · +11 │ fun t1(r: &mut R, b: &mut B) { + │ - The type '0x8675309::M::B' does not have the ability 'copy' +12 │ R {} = *r; +13 │ B { r: R{} } = *b; + │ ^^ Invalid dereference. Dereference requires the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/derefrence_reference.move:14:15 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ struct B { r: R } + │ - The type '0x8675309::M::R' does not have the ability 'copy' + · +14 │ R{} = *&b.r; + │ ^^^^^ Invalid dereference. Dereference requires the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/derefrence_reference.move:15:15 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ struct B { r: R } + │ - The type '0x8675309::M::R' does not have the ability 'copy' + · +15 │ R{} = *&mut b.r; + │ ^^^^^^^^^ Invalid dereference. Dereference requires the 'copy' ability diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/duplicate_function_parameter_names.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/duplicate_function_parameter_names.exp deleted file mode 100644 index b1e02b57d1cd3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/duplicate_function_parameter_names.exp +++ /dev/null @@ -1,24 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/typing/duplicate_function_parameter_names.move:2:13 - │ -2 │ fun foo(x: u64, x: u64) {} - │ ^ Unused parameter 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/typing/duplicate_function_parameter_names.move:2:21 - │ -2 │ fun foo(x: u64, x: u64) {} - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/typing/duplicate_function_parameter_names.move:2:21 - │ -2 │ fun foo(x: u64, x: u64) {} - │ - ^ Duplicate parameter with name 'x' - │ │ - │ Previously declared here - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/duplicate_function_parameter_names.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/duplicate_function_parameter_names.snap new file mode 100644 index 0000000000000..f7290e6c7a485 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/duplicate_function_parameter_names.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/duplicate_function_parameter_names.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/typing/duplicate_function_parameter_names.move:2:13 + │ +2 │ fun foo(x: u64, x: u64) {} + │ ^ Unused parameter 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/typing/duplicate_function_parameter_names.move:2:21 + │ +2 │ fun foo(x: u64, x: u64) {} + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/typing/duplicate_function_parameter_names.move:2:21 + │ +2 │ fun foo(x: u64, x: u64) {} + │ - ^ Duplicate parameter with name 'x' + │ │ + │ Previously declared here diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/entry_on_any_vis.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/entry_on_any_vis.snap new file mode 100644 index 0000000000000..706163b00e640 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/entry_on_any_vis.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/entry_on_any_vis.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/entry_signature_no_warning.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/entry_signature_no_warning.snap new file mode 100644 index 0000000000000..68a0e93f9dc98 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/entry_signature_no_warning.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/entry_signature_no_warning.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/eq.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/eq.snap new file mode 100644 index 0000000000000..ed5ff0b8b93b7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/eq.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/eq.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/eq_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/eq_invalid.exp deleted file mode 100644 index c1d4ba7433e2a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/eq_invalid.exp +++ /dev/null @@ -1,196 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/eq_invalid.move:12:17 - │ -12 │ (0: u8) == (1: u128); - │ -- ^^ ---- Found: 'u128'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '==' - │ Found: 'u8'. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/eq_invalid.move:13:11 - │ -13 │ 0 == false; - │ - ^^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '==' - │ Found: integer. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/eq_invalid.move:14:12 - │ -14 │ &0 == 1; - │ -- ^^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '==' - │ Found: '&{integer}'. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/eq_invalid.move:15:11 - │ -15 │ 1 == &0; - │ - ^^ -- Found: '&{integer}'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '==' - │ Found: integer. It is not compatible with the other type. - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/eq_invalid.move:16:9 - │ - 2 │ struct S { u: u64 } - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -11 │ fun t0(s: S, s_ref: &S, s_mut: &mut S) { - │ - The type '0x8675309::M::S' does not have the ability 'drop' - · -16 │ s == s_ref; - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/eq_invalid.move:16:11 - │ -11 │ fun t0(s: S, s_ref: &S, s_mut: &mut S) { - │ - -- Found: '&0x8675309::M::S'. It is not compatible with the other type. - │ │ - │ Found: '0x8675309::M::S'. It is not compatible with the other type. - · -16 │ s == s_ref; - │ ^^ Incompatible arguments to '==' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/eq_invalid.move:17:15 - │ -11 │ fun t0(s: S, s_ref: &S, s_mut: &mut S) { - │ - ------ Found: '&mut 0x8675309::M::S'. It is not compatible with the other type. - │ │ - │ Found: '0x8675309::M::S'. It is not compatible with the other type. - · -17 │ s_mut == s; - │ ^^ Incompatible arguments to '==' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/eq_invalid.move:17:18 - │ - 2 │ struct S { u: u64 } - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -11 │ fun t0(s: S, s_ref: &S, s_mut: &mut S) { - │ - The type '0x8675309::M::S' does not have the ability 'drop' - · -17 │ s_mut == s; - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/eq_invalid.move:21:9 - │ - 3 │ struct R has key { - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -20 │ fun t1(r: R) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' -21 │ r == r; - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/eq_invalid.move:21:14 - │ - 3 │ struct R has key { - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -20 │ fun t1(r: R) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' -21 │ r == r; - │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/eq_invalid.move:25:9 - │ -25 │ G0{ f: R { f: 1 } } == G0{ f: R { f: 1 } }; - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::G0<0x8675309::M::R>' can have the ability 'drop' but the type argument '0x8675309::M::R' does not have the required ability 'drop' - │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x8675309::M::G0<0x8675309::M::R>' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/eq_invalid.move:25:35 - │ -25 │ G0{ f: R { f: 1 } } == G0{ f: R { f: 1 } }; - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::G0<0x8675309::M::R>' can have the ability 'drop' but the type argument '0x8675309::M::R' does not have the required ability 'drop' - │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x8675309::M::G0<0x8675309::M::R>' does not have the ability 'drop' - -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/eq_invalid.move:27:9 - │ -27 │ G2{} == G2{}; - │ ^^^^ Could not infer this type. Try adding an annotation - -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/eq_invalid.move:27:17 - │ -27 │ G2{} == G2{}; - │ ^^^^ Could not infer this type. Try adding an annotation - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/eq_invalid.move:28:9 - │ - 7 │ struct G1 { f: T } - │ -- To satisfy the constraint, the 'drop' ability would need to be added here - · -28 │ G1{ f: t } == G1{ f: t }; - │ ^^^^^^^^^^ - │ │ - │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x8675309::M::G1' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/eq_invalid.move:28:23 - │ - 7 │ struct G1 { f: T } - │ -- To satisfy the constraint, the 'drop' ability would need to be added here - · -28 │ G1{ f: t } == G1{ f: t }; - │ ^^^^^^^^^^ - │ │ - │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x8675309::M::G1' does not have the ability 'drop' - -error[E04005]: expected a single type - ┌─ tests/move_check/typing/eq_invalid.move:32:9 - │ -32 │ () == (); - │ ^^^^^^^^ - │ │ │ - │ │ Expected a single type, but found expression list type: '()' - │ Incompatible arguments to '==' - -error[E04005]: expected a single type - ┌─ tests/move_check/typing/eq_invalid.move:33:9 - │ -33 │ (0, 1) == (0, 1); - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single type, but found expression list type: '(u64, u64)' - │ Incompatible arguments to '==' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/eq_invalid.move:34:19 - │ -34 │ (1, 2, 3) == (0, 1); - │ --------- ^^ ------ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - │ │ │ - │ │ Incompatible arguments to '==' - │ Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/eq_invalid.move:35:16 - │ -35 │ (0, 1) == (1, 2, 3); - │ ------ ^^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - │ │ │ - │ │ Incompatible arguments to '==' - │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/eq_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/eq_invalid.snap new file mode 100644 index 0000000000000..a563c83aa9fb0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/eq_invalid.snap @@ -0,0 +1,203 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/eq_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/eq_invalid.move:12:17 + │ +12 │ (0: u8) == (1: u128); + │ -- ^^ ---- Found: 'u128'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '==' + │ Found: 'u8'. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/eq_invalid.move:13:11 + │ +13 │ 0 == false; + │ - ^^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '==' + │ Found: integer. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/eq_invalid.move:14:12 + │ +14 │ &0 == 1; + │ -- ^^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '==' + │ Found: '&{integer}'. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/eq_invalid.move:15:11 + │ +15 │ 1 == &0; + │ - ^^ -- Found: '&{integer}'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '==' + │ Found: integer. It is not compatible with the other type. + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/eq_invalid.move:16:9 + │ + 2 │ struct S { u: u64 } + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +11 │ fun t0(s: S, s_ref: &S, s_mut: &mut S) { + │ - The type '0x8675309::M::S' does not have the ability 'drop' + · +16 │ s == s_ref; + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/eq_invalid.move:16:11 + │ +11 │ fun t0(s: S, s_ref: &S, s_mut: &mut S) { + │ - -- Found: '&0x8675309::M::S'. It is not compatible with the other type. + │ │ + │ Found: '0x8675309::M::S'. It is not compatible with the other type. + · +16 │ s == s_ref; + │ ^^ Incompatible arguments to '==' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/eq_invalid.move:17:15 + │ +11 │ fun t0(s: S, s_ref: &S, s_mut: &mut S) { + │ - ------ Found: '&mut 0x8675309::M::S'. It is not compatible with the other type. + │ │ + │ Found: '0x8675309::M::S'. It is not compatible with the other type. + · +17 │ s_mut == s; + │ ^^ Incompatible arguments to '==' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/eq_invalid.move:17:18 + │ + 2 │ struct S { u: u64 } + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +11 │ fun t0(s: S, s_ref: &S, s_mut: &mut S) { + │ - The type '0x8675309::M::S' does not have the ability 'drop' + · +17 │ s_mut == s; + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/eq_invalid.move:21:9 + │ + 3 │ struct R has key { + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +20 │ fun t1(r: R) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' +21 │ r == r; + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/eq_invalid.move:21:14 + │ + 3 │ struct R has key { + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +20 │ fun t1(r: R) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' +21 │ r == r; + │ ^ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/eq_invalid.move:25:9 + │ +25 │ G0{ f: R { f: 1 } } == G0{ f: R { f: 1 } }; + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::G0<0x8675309::M::R>' can have the ability 'drop' but the type argument '0x8675309::M::R' does not have the required ability 'drop' + │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x8675309::M::G0<0x8675309::M::R>' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/eq_invalid.move:25:35 + │ +25 │ G0{ f: R { f: 1 } } == G0{ f: R { f: 1 } }; + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::G0<0x8675309::M::R>' can have the ability 'drop' but the type argument '0x8675309::M::R' does not have the required ability 'drop' + │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x8675309::M::G0<0x8675309::M::R>' does not have the ability 'drop' + +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/eq_invalid.move:27:9 + │ +27 │ G2{} == G2{}; + │ ^^^^ Could not infer this type. Try adding an annotation + +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/eq_invalid.move:27:17 + │ +27 │ G2{} == G2{}; + │ ^^^^ Could not infer this type. Try adding an annotation + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/eq_invalid.move:28:9 + │ + 7 │ struct G1 { f: T } + │ -- To satisfy the constraint, the 'drop' ability would need to be added here + · +28 │ G1{ f: t } == G1{ f: t }; + │ ^^^^^^^^^^ + │ │ + │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x8675309::M::G1' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/eq_invalid.move:28:23 + │ + 7 │ struct G1 { f: T } + │ -- To satisfy the constraint, the 'drop' ability would need to be added here + · +28 │ G1{ f: t } == G1{ f: t }; + │ ^^^^^^^^^^ + │ │ + │ '==' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x8675309::M::G1' does not have the ability 'drop' + +error[E04005]: expected a single type + ┌─ tests/move_check/typing/eq_invalid.move:32:9 + │ +32 │ () == (); + │ ^^^^^^^^ + │ │ │ + │ │ Expected a single type, but found expression list type: '()' + │ Incompatible arguments to '==' + +error[E04005]: expected a single type + ┌─ tests/move_check/typing/eq_invalid.move:33:9 + │ +33 │ (0, 1) == (0, 1); + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single type, but found expression list type: '(u64, u64)' + │ Incompatible arguments to '==' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/eq_invalid.move:34:19 + │ +34 │ (1, 2, 3) == (0, 1); + │ --------- ^^ ------ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. + │ │ │ + │ │ Incompatible arguments to '==' + │ Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/eq_invalid.move:35:16 + │ +35 │ (0, 1) == (1, 2, 3); + │ ------ ^^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + │ │ │ + │ │ Incompatible arguments to '==' + │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/exp_list.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/exp_list.snap new file mode 100644 index 0000000000000..80783aeb55b2e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/exp_list.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/exp_list.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/exp_list_nested.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/exp_list_nested.exp deleted file mode 100644 index 492a785e84041..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/exp_list_nested.exp +++ /dev/null @@ -1,26 +0,0 @@ -error[E04005]: expected a single type - ┌─ tests/move_check/typing/exp_list_nested.move:6:9 - │ -6 │ (0, (S{}, R{})) - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single type, but found expression list type: '(0x8675309::M::S, 0x8675309::M::R<_>)' - │ Invalid expression list type argument - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/exp_list_nested.move:6:9 - │ -5 │ fun t0(): (u64, S, R) { - │ ---------------- Expected expression list of length 3: '(u64, 0x8675309::M::S, 0x8675309::M::R)' -6 │ (0, (S{}, R{})) - │ ^^^^^^^^^^^^^^^ - │ │ - │ Invalid return expression - │ Given expression list of length 2: '({integer}, (0x8675309::M::S, 0x8675309::M::R<_>))' - -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/exp_list_nested.move:6:19 - │ -6 │ (0, (S{}, R{})) - │ ^^^ Could not infer this type. Try adding an annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/exp_list_nested.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/exp_list_nested.snap new file mode 100644 index 0000000000000..c4f0913f79261 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/exp_list_nested.snap @@ -0,0 +1,33 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/exp_list_nested.move +--- +error[E04005]: expected a single type + ┌─ tests/move_check/typing/exp_list_nested.move:6:9 + │ +6 │ (0, (S{}, R{})) + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single type, but found expression list type: '(0x8675309::M::S, 0x8675309::M::R<_>)' + │ Invalid expression list type argument + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/exp_list_nested.move:6:9 + │ +5 │ fun t0(): (u64, S, R) { + │ ---------------- Expected expression list of length 3: '(u64, 0x8675309::M::S, 0x8675309::M::R)' +6 │ (0, (S{}, R{})) + │ ^^^^^^^^^^^^^^^ + │ │ + │ Invalid return expression + │ Given expression list of length 2: '({integer}, (0x8675309::M::S, 0x8675309::M::R<_>))' + +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/exp_list_nested.move:6:19 + │ +6 │ (0, (S{}, R{})) + │ ^^^ Could not infer this type. Try adding an annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/exp_list_resource_drop.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/exp_list_resource_drop.exp deleted file mode 100644 index 740e1b0b2fb23..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/exp_list_resource_drop.exp +++ /dev/null @@ -1,36 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/exp_list_resource_drop.move:7:9 - │ -7 │ (0, S{ }, R { f: 1 }); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '(u64, 0x8675309::M::S, 0x8675309::M::R)' can have the ability 'drop' but the type argument '0x8675309::M::S' does not have the required ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - │ The type '(u64, 0x8675309::M::S, 0x8675309::M::R)' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/exp_list_resource_drop.move:8:9 - │ -8 │ (0, S{ }, Box> { f: R { f: 1 } }); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '(u64, 0x8675309::M::S, 0x8675309::M::Box<0x8675309::M::R>)' can have the ability 'drop' but the type argument '0x8675309::M::S' does not have the required ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - │ The type '(u64, 0x8675309::M::S, 0x8675309::M::Box<0x8675309::M::R>)' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/exp_list_resource_drop.move:9:9 - │ -9 │ (0, S{ }, Box { f: abort 0 }); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '(u64, 0x8675309::M::S, 0x8675309::M::Box<_>)' can have the ability 'drop' but the type argument '0x8675309::M::S' does not have the required ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - │ The type '(u64, 0x8675309::M::S, 0x8675309::M::Box<_>)' does not have the ability 'drop' - -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/exp_list_resource_drop.move:9:19 - │ -9 │ (0, S{ }, Box { f: abort 0 }); - │ ^^^^^^^^^^^^^^^^^^ Could not infer this type. Try adding an annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/exp_list_resource_drop.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/exp_list_resource_drop.snap new file mode 100644 index 0000000000000..7a971900c59f2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/exp_list_resource_drop.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/exp_list_resource_drop.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/exp_list_resource_drop.move:7:9 + │ +7 │ (0, S{ }, R { f: 1 }); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '(u64, 0x8675309::M::S, 0x8675309::M::R)' can have the ability 'drop' but the type argument '0x8675309::M::S' does not have the required ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + │ The type '(u64, 0x8675309::M::S, 0x8675309::M::R)' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/exp_list_resource_drop.move:8:9 + │ +8 │ (0, S{ }, Box> { f: R { f: 1 } }); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '(u64, 0x8675309::M::S, 0x8675309::M::Box<0x8675309::M::R>)' can have the ability 'drop' but the type argument '0x8675309::M::S' does not have the required ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + │ The type '(u64, 0x8675309::M::S, 0x8675309::M::Box<0x8675309::M::R>)' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/exp_list_resource_drop.move:9:9 + │ +9 │ (0, S{ }, Box { f: abort 0 }); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '(u64, 0x8675309::M::S, 0x8675309::M::Box<_>)' can have the ability 'drop' but the type argument '0x8675309::M::S' does not have the required ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + │ The type '(u64, 0x8675309::M::S, 0x8675309::M::Box<_>)' does not have the ability 'drop' + +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/exp_list_resource_drop.move:9:19 + │ +9 │ (0, S{ }, Box { f: abort 0 }); + │ ^^^^^^^^^^^^^^^^^^ Could not infer this type. Try adding an annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/explicit_copy.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/explicit_copy.snap new file mode 100644 index 0000000000000..9346c1cff1330 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/explicit_copy.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/explicit_copy.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/explicit_move.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/explicit_move.snap new file mode 100644 index 0000000000000..1835a53d1565b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/explicit_move.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/explicit_move.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/hex_and_decimal_address.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/hex_and_decimal_address.snap new file mode 100644 index 0000000000000..d3beb7d6b927d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/hex_and_decimal_address.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/hex_and_decimal_address.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/if_branches_subtype.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_branches_subtype.snap new file mode 100644 index 0000000000000..0e1e264b85d63 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_branches_subtype.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/if_branches_subtype.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/if_branches_subtype_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_branches_subtype_invalid.exp deleted file mode 100644 index 24d5087e24ca0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/if_branches_subtype_invalid.exp +++ /dev/null @@ -1,157 +0,0 @@ -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:3:16 - │ -2 │ fun t0(cond: bool, u: &u64, u_mut: &mut u64) { - │ ---- Given: '&u64' -3 │ let _: &mut u64 = if (cond) u else u_mut; - │ ^^^^^^^^ - │ │ - │ Invalid type annotation - │ Expected: '&mut u64' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:4:16 - │ -2 │ fun t0(cond: bool, u: &u64, u_mut: &mut u64) { - │ ---- Given: '&u64' -3 │ let _: &mut u64 = if (cond) u else u_mut; -4 │ let _: &mut u64 = if (cond) u_mut else u; - │ ^^^^^^^^ - │ │ - │ Invalid type annotation - │ Expected: '&mut u64' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:5:16 - │ -2 │ fun t0(cond: bool, u: &u64, u_mut: &mut u64) { - │ ---- Given: '&u64' - · -5 │ let _: &mut u64 = if (cond) u else u; - │ ^^^^^^^^ - │ │ - │ Invalid type annotation - │ Expected: '&mut u64' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:9:23 - │ -8 │ fun t1(cond: bool, u: &u64, u_mut: &mut u64, b: &bool, b_mut: &mut bool) { - │ --- ---- Found: 'bool'. It is not compatible with the other type. - │ │ - │ Found: 'u64'. It is not compatible with the other type. -9 │ let _: &u64 = if (cond) u else b; - │ ^^^^^^^^^^^^^^^^^^ Incompatible branches - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:10:23 - │ - 8 │ fun t1(cond: bool, u: &u64, u_mut: &mut u64, b: &bool, b_mut: &mut bool) { - │ --- ---- Found: 'bool'. It is not compatible with the other type. - │ │ - │ Found: 'u64'. It is not compatible with the other type. - 9 │ let _: &u64 = if (cond) u else b; -10 │ let _: &u64 = if (cond) b else u; - │ ^^^^^^^^^^^^^^^^^^ Incompatible branches - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:12:23 - │ - 8 │ fun t1(cond: bool, u: &u64, u_mut: &mut u64, b: &bool, b_mut: &mut bool) { - │ --- ---- Found: 'bool'. It is not compatible with the other type. - │ │ - │ Found: 'u64'. It is not compatible with the other type. - · -12 │ let _: &u64 = if (cond) u_mut else b; - │ ^^^^^^^^^^^^^^^^^^^^^^ Incompatible branches - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:13:23 - │ - 8 │ fun t1(cond: bool, u: &u64, u_mut: &mut u64, b: &bool, b_mut: &mut bool) { - │ --- ---- Found: 'bool'. It is not compatible with the other type. - │ │ - │ Found: 'u64'. It is not compatible with the other type. - · -13 │ let _: &u64 = if (cond) b else u_mut; - │ ^^^^^^^^^^^^^^^^^^^^^^ Incompatible branches - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:15:23 - │ - 8 │ fun t1(cond: bool, u: &u64, u_mut: &mut u64, b: &bool, b_mut: &mut bool) { - │ --- ---- Found: 'bool'. It is not compatible with the other type. - │ │ - │ Found: 'u64'. It is not compatible with the other type. - · -15 │ let _: &u64 = if (cond) u else b_mut; - │ ^^^^^^^^^^^^^^^^^^^^^^ Incompatible branches - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:16:23 - │ - 8 │ fun t1(cond: bool, u: &u64, u_mut: &mut u64, b: &bool, b_mut: &mut bool) { - │ --- ---- Found: 'bool'. It is not compatible with the other type. - │ │ - │ Found: 'u64'. It is not compatible with the other type. - · -16 │ let _: &u64 = if (cond) b_mut else u; - │ ^^^^^^^^^^^^^^^^^^^^^^ Incompatible branches - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:19:27 - │ - 8 │ fun t1(cond: bool, u: &u64, u_mut: &mut u64, b: &bool, b_mut: &mut bool) { - │ --- ---- Found: 'bool'. It is not compatible with the other type. - │ │ - │ Found: 'u64'. It is not compatible with the other type. - · -19 │ let _: &mut u64 = if (cond) u_mut else b_mut; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Incompatible branches - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:20:27 - │ - 8 │ fun t1(cond: bool, u: &u64, u_mut: &mut u64, b: &bool, b_mut: &mut bool) { - │ --- ---- Found: 'bool'. It is not compatible with the other type. - │ │ - │ Found: 'u64'. It is not compatible with the other type. - · -20 │ let _: &mut u64 = if (cond) b_mut else u_mut; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Incompatible branches - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:25:21 - │ -24 │ fun t2(cond: bool, u: &u64, u_mut: &mut u64) { - │ ---- Given: '&u64' -25 │ let (_, _): (&mut u64, &mut u64) = if (cond) (u, u) else (u_mut, u_mut); - │ ^^^^^^^^^^^^^^^^^^^^ - │ ││ - │ │Expected: '&mut u64' - │ Invalid type annotation - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:26:21 - │ -24 │ fun t2(cond: bool, u: &u64, u_mut: &mut u64) { - │ ---- Given: '&u64' -25 │ let (_, _): (&mut u64, &mut u64) = if (cond) (u, u) else (u_mut, u_mut); -26 │ let (_, _): (&mut u64, &mut u64) = if (cond) (u_mut, u) else (u, u_mut); - │ ^^^^^^^^^^^^^^^^^^^^ - │ ││ - │ │Expected: '&mut u64' - │ Invalid type annotation - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:27:21 - │ -24 │ fun t2(cond: bool, u: &u64, u_mut: &mut u64) { - │ ---- Given: '&u64' - · -27 │ let (_, _): (&mut u64, &mut u64) = if (cond) (u, u_mut) else (u_mut, u); - │ ^^^^^^^^^^^^^^^^^^^^ - │ ││ - │ │Expected: '&mut u64' - │ Invalid type annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/if_branches_subtype_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_branches_subtype_invalid.snap new file mode 100644 index 0000000000000..59262757372ed --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_branches_subtype_invalid.snap @@ -0,0 +1,164 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/if_branches_subtype_invalid.move +--- +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:3:16 + │ +2 │ fun t0(cond: bool, u: &u64, u_mut: &mut u64) { + │ ---- Given: '&u64' +3 │ let _: &mut u64 = if (cond) u else u_mut; + │ ^^^^^^^^ + │ │ + │ Invalid type annotation + │ Expected: '&mut u64' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:4:16 + │ +2 │ fun t0(cond: bool, u: &u64, u_mut: &mut u64) { + │ ---- Given: '&u64' +3 │ let _: &mut u64 = if (cond) u else u_mut; +4 │ let _: &mut u64 = if (cond) u_mut else u; + │ ^^^^^^^^ + │ │ + │ Invalid type annotation + │ Expected: '&mut u64' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:5:16 + │ +2 │ fun t0(cond: bool, u: &u64, u_mut: &mut u64) { + │ ---- Given: '&u64' + · +5 │ let _: &mut u64 = if (cond) u else u; + │ ^^^^^^^^ + │ │ + │ Invalid type annotation + │ Expected: '&mut u64' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:9:23 + │ +8 │ fun t1(cond: bool, u: &u64, u_mut: &mut u64, b: &bool, b_mut: &mut bool) { + │ --- ---- Found: 'bool'. It is not compatible with the other type. + │ │ + │ Found: 'u64'. It is not compatible with the other type. +9 │ let _: &u64 = if (cond) u else b; + │ ^^^^^^^^^^^^^^^^^^ Incompatible branches + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:10:23 + │ + 8 │ fun t1(cond: bool, u: &u64, u_mut: &mut u64, b: &bool, b_mut: &mut bool) { + │ --- ---- Found: 'bool'. It is not compatible with the other type. + │ │ + │ Found: 'u64'. It is not compatible with the other type. + 9 │ let _: &u64 = if (cond) u else b; +10 │ let _: &u64 = if (cond) b else u; + │ ^^^^^^^^^^^^^^^^^^ Incompatible branches + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:12:23 + │ + 8 │ fun t1(cond: bool, u: &u64, u_mut: &mut u64, b: &bool, b_mut: &mut bool) { + │ --- ---- Found: 'bool'. It is not compatible with the other type. + │ │ + │ Found: 'u64'. It is not compatible with the other type. + · +12 │ let _: &u64 = if (cond) u_mut else b; + │ ^^^^^^^^^^^^^^^^^^^^^^ Incompatible branches + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:13:23 + │ + 8 │ fun t1(cond: bool, u: &u64, u_mut: &mut u64, b: &bool, b_mut: &mut bool) { + │ --- ---- Found: 'bool'. It is not compatible with the other type. + │ │ + │ Found: 'u64'. It is not compatible with the other type. + · +13 │ let _: &u64 = if (cond) b else u_mut; + │ ^^^^^^^^^^^^^^^^^^^^^^ Incompatible branches + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:15:23 + │ + 8 │ fun t1(cond: bool, u: &u64, u_mut: &mut u64, b: &bool, b_mut: &mut bool) { + │ --- ---- Found: 'bool'. It is not compatible with the other type. + │ │ + │ Found: 'u64'. It is not compatible with the other type. + · +15 │ let _: &u64 = if (cond) u else b_mut; + │ ^^^^^^^^^^^^^^^^^^^^^^ Incompatible branches + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:16:23 + │ + 8 │ fun t1(cond: bool, u: &u64, u_mut: &mut u64, b: &bool, b_mut: &mut bool) { + │ --- ---- Found: 'bool'. It is not compatible with the other type. + │ │ + │ Found: 'u64'. It is not compatible with the other type. + · +16 │ let _: &u64 = if (cond) b_mut else u; + │ ^^^^^^^^^^^^^^^^^^^^^^ Incompatible branches + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:19:27 + │ + 8 │ fun t1(cond: bool, u: &u64, u_mut: &mut u64, b: &bool, b_mut: &mut bool) { + │ --- ---- Found: 'bool'. It is not compatible with the other type. + │ │ + │ Found: 'u64'. It is not compatible with the other type. + · +19 │ let _: &mut u64 = if (cond) u_mut else b_mut; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Incompatible branches + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:20:27 + │ + 8 │ fun t1(cond: bool, u: &u64, u_mut: &mut u64, b: &bool, b_mut: &mut bool) { + │ --- ---- Found: 'bool'. It is not compatible with the other type. + │ │ + │ Found: 'u64'. It is not compatible with the other type. + · +20 │ let _: &mut u64 = if (cond) b_mut else u_mut; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Incompatible branches + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:25:21 + │ +24 │ fun t2(cond: bool, u: &u64, u_mut: &mut u64) { + │ ---- Given: '&u64' +25 │ let (_, _): (&mut u64, &mut u64) = if (cond) (u, u) else (u_mut, u_mut); + │ ^^^^^^^^^^^^^^^^^^^^ + │ ││ + │ │Expected: '&mut u64' + │ Invalid type annotation + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:26:21 + │ +24 │ fun t2(cond: bool, u: &u64, u_mut: &mut u64) { + │ ---- Given: '&u64' +25 │ let (_, _): (&mut u64, &mut u64) = if (cond) (u, u) else (u_mut, u_mut); +26 │ let (_, _): (&mut u64, &mut u64) = if (cond) (u_mut, u) else (u, u_mut); + │ ^^^^^^^^^^^^^^^^^^^^ + │ ││ + │ │Expected: '&mut u64' + │ Invalid type annotation + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/if_branches_subtype_invalid.move:27:21 + │ +24 │ fun t2(cond: bool, u: &u64, u_mut: &mut u64) { + │ ---- Given: '&u64' + · +27 │ let (_, _): (&mut u64, &mut u64) = if (cond) (u, u_mut) else (u_mut, u); + │ ^^^^^^^^^^^^^^^^^^^^ + │ ││ + │ │Expected: '&mut u64' + │ Invalid type annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/if_condition.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_condition.snap new file mode 100644 index 0000000000000..a9bf1dad36270 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_condition.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/if_condition.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/if_condition_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_condition_invalid.exp deleted file mode 100644 index 14b55e9f9280c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/if_condition_invalid.exp +++ /dev/null @@ -1,81 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_condition_invalid.move:3:13 - │ -3 │ if (()) () else (); - │ ^^ - │ │ - │ Invalid if condition - │ Expected: 'bool' - │ Given: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_condition_invalid.move:4:14 - │ -4 │ if ((())) () else (); - │ ^^ - │ │ - │ Invalid if condition - │ Expected: 'bool' - │ Given: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_condition_invalid.move:5:13 - │ -5 │ if ({}) () else () - │ ^^ - │ │ - │ Invalid if condition - │ Expected: 'bool' - │ Given: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_condition_invalid.move:9:13 - │ -8 │ fun t1(x: T) { - │ - Given: 'T' -9 │ if (x) () else (); - │ ^ - │ │ - │ Invalid if condition - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_condition_invalid.move:10:13 - │ -10 │ if (0) () else (); - │ ^ - │ │ - │ Invalid if condition - │ Expected: 'bool' - │ Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_condition_invalid.move:11:13 - │ -11 │ if (@0x0) () else () - │ ^^^^ - │ │ - │ Invalid if condition - │ Expected: 'bool' - │ Given: 'address' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_condition_invalid.move:15:13 - │ -15 │ if ((false, true)) () else (); - │ ^^^^^^^^^^^^^ - │ │ - │ Invalid if condition - │ Expected: 'bool' - │ Given: '(bool, bool)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_condition_invalid.move:16:13 - │ -16 │ if ((0, false)) () else () - │ ^^^^^^^^^^ - │ │ - │ Invalid if condition - │ Expected: 'bool' - │ Given: '({integer}, bool)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/if_condition_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_condition_invalid.snap new file mode 100644 index 0000000000000..40e2811f11ff1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_condition_invalid.snap @@ -0,0 +1,88 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/if_condition_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_condition_invalid.move:3:13 + │ +3 │ if (()) () else (); + │ ^^ + │ │ + │ Invalid if condition + │ Expected: 'bool' + │ Given: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_condition_invalid.move:4:14 + │ +4 │ if ((())) () else (); + │ ^^ + │ │ + │ Invalid if condition + │ Expected: 'bool' + │ Given: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_condition_invalid.move:5:13 + │ +5 │ if ({}) () else () + │ ^^ + │ │ + │ Invalid if condition + │ Expected: 'bool' + │ Given: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_condition_invalid.move:9:13 + │ +8 │ fun t1(x: T) { + │ - Given: 'T' +9 │ if (x) () else (); + │ ^ + │ │ + │ Invalid if condition + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_condition_invalid.move:10:13 + │ +10 │ if (0) () else (); + │ ^ + │ │ + │ Invalid if condition + │ Expected: 'bool' + │ Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_condition_invalid.move:11:13 + │ +11 │ if (@0x0) () else () + │ ^^^^ + │ │ + │ Invalid if condition + │ Expected: 'bool' + │ Given: 'address' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_condition_invalid.move:15:13 + │ +15 │ if ((false, true)) () else (); + │ ^^^^^^^^^^^^^ + │ │ + │ Invalid if condition + │ Expected: 'bool' + │ Given: '(bool, bool)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_condition_invalid.move:16:13 + │ +16 │ if ((0, false)) () else () + │ ^^^^^^^^^^ + │ │ + │ Invalid if condition + │ Expected: 'bool' + │ Given: '({integer}, bool)' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/if_default_else.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_default_else.snap new file mode 100644 index 0000000000000..788256ac9d31d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_default_else.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/if_default_else.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/if_matched_branches.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_matched_branches.snap new file mode 100644 index 0000000000000..2de0de397699e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_matched_branches.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/if_matched_branches.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/if_mismatched_branches.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_mismatched_branches.exp deleted file mode 100644 index 3b348568b5b05..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/if_mismatched_branches.exp +++ /dev/null @@ -1,90 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_mismatched_branches.move:3:9 - │ -3 │ if (cond) () else 0; - │ ^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found: integer. It is not compatible with the other type. - │ │ Found: '()'. It is not compatible with the other type. - │ Incompatible branches - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_mismatched_branches.move:4:9 - │ -4 │ if (cond) 0 else (); - │ ^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found: '()'. It is not compatible with the other type. - │ │ Found: integer. It is not compatible with the other type. - │ Incompatible branches - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_mismatched_branches.move:8:9 - │ -8 │ if (cond) @0x0 else 0; - │ ^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found: integer. It is not compatible with the other type. - │ │ Found: 'address'. It is not compatible with the other type. - │ Incompatible branches - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_mismatched_branches.move:9:9 - │ -9 │ if (cond) 0 else false; - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found: 'bool'. It is not compatible with the other type. - │ │ Found: integer. It is not compatible with the other type. - │ Incompatible branches - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_mismatched_branches.move:13:9 - │ -13 │ if (cond) (0, false) else (1, 1); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found: integer. It is not compatible with the other type. - │ │ Found: 'bool'. It is not compatible with the other type. - │ Incompatible branches - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_mismatched_branches.move:14:9 - │ -14 │ if (cond) (0, false) else (false, false); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found: 'bool'. It is not compatible with the other type. - │ │ Found: integer. It is not compatible with the other type. - │ Incompatible branches - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_mismatched_branches.move:15:9 - │ -15 │ if (cond) (0, false) else (true, @0x0); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found: 'bool'. It is not compatible with the other type. - │ │ Found: integer. It is not compatible with the other type. - │ Incompatible branches - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_mismatched_branches.move:19:9 - │ -19 │ if (cond) (0, false, 0) else (0, false); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found expression list of length 2: '({integer}, bool)'. It is not compatible with the other type of length 3. - │ │ Found expression list of length 3: '({integer}, bool, {integer})'. It is not compatible with the other type of length 2. - │ Incompatible branches - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_mismatched_branches.move:20:9 - │ -20 │ if (cond) (0, false) else (0, false, 0); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found expression list of length 3: '({integer}, bool, {integer})'. It is not compatible with the other type of length 2. - │ │ Found expression list of length 2: '({integer}, bool)'. It is not compatible with the other type of length 3. - │ Incompatible branches - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/if_mismatched_branches.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_mismatched_branches.snap new file mode 100644 index 0000000000000..b961227367224 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_mismatched_branches.snap @@ -0,0 +1,97 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/if_mismatched_branches.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_mismatched_branches.move:3:9 + │ +3 │ if (cond) () else 0; + │ ^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found: integer. It is not compatible with the other type. + │ │ Found: '()'. It is not compatible with the other type. + │ Incompatible branches + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_mismatched_branches.move:4:9 + │ +4 │ if (cond) 0 else (); + │ ^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found: '()'. It is not compatible with the other type. + │ │ Found: integer. It is not compatible with the other type. + │ Incompatible branches + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_mismatched_branches.move:8:9 + │ +8 │ if (cond) @0x0 else 0; + │ ^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found: integer. It is not compatible with the other type. + │ │ Found: 'address'. It is not compatible with the other type. + │ Incompatible branches + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_mismatched_branches.move:9:9 + │ +9 │ if (cond) 0 else false; + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found: 'bool'. It is not compatible with the other type. + │ │ Found: integer. It is not compatible with the other type. + │ Incompatible branches + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_mismatched_branches.move:13:9 + │ +13 │ if (cond) (0, false) else (1, 1); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found: integer. It is not compatible with the other type. + │ │ Found: 'bool'. It is not compatible with the other type. + │ Incompatible branches + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_mismatched_branches.move:14:9 + │ +14 │ if (cond) (0, false) else (false, false); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found: 'bool'. It is not compatible with the other type. + │ │ Found: integer. It is not compatible with the other type. + │ Incompatible branches + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_mismatched_branches.move:15:9 + │ +15 │ if (cond) (0, false) else (true, @0x0); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found: 'bool'. It is not compatible with the other type. + │ │ Found: integer. It is not compatible with the other type. + │ Incompatible branches + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_mismatched_branches.move:19:9 + │ +19 │ if (cond) (0, false, 0) else (0, false); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found expression list of length 2: '({integer}, bool)'. It is not compatible with the other type of length 3. + │ │ Found expression list of length 3: '({integer}, bool, {integer})'. It is not compatible with the other type of length 2. + │ Incompatible branches + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_mismatched_branches.move:20:9 + │ +20 │ if (cond) (0, false) else (0, false, 0); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found expression list of length 3: '({integer}, bool, {integer})'. It is not compatible with the other type of length 2. + │ │ Found expression list of length 2: '({integer}, bool)'. It is not compatible with the other type of length 3. + │ Incompatible branches diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/if_no_else.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_no_else.exp deleted file mode 100644 index 56264bc013239..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/if_no_else.exp +++ /dev/null @@ -1,34 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_no_else.move:4:9 - │ -4 │ if (cond) 0; - │ ^^^^^^^^^^^ - │ │ │ - │ │ Given: integer - │ Invalid 'if'. The body of an 'if' without an 'else' must have type '()' - │ Expected: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_no_else.move:5:9 - │ - 5 │ if (cond) foo(); - │ ^^^^^^^^^^^^^^^ - │ │ - │ Invalid 'if'. The body of an 'if' without an 'else' must have type '()' - │ Expected: '()' - · -13 │ fun foo(): u64 { 0 } - │ --- Given: 'u64' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/if_no_else.move:6:9 - │ - 6 │ ╭ ╭ if (cond) { - 7 │ │ │ let x = 0; - 8 │ │ │ let y = 1; - │ │ │ - Given: integer - 9 │ │ │ x * y -10 │ │ │ } - │ ╰─│─────────^ Invalid 'if'. The body of an 'if' without an 'else' must have type '()' - │ ╰─────────' Expected: '()' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/if_no_else.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_no_else.snap new file mode 100644 index 0000000000000..1bdd8588932b0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/if_no_else.snap @@ -0,0 +1,41 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/if_no_else.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_no_else.move:4:9 + │ +4 │ if (cond) 0; + │ ^^^^^^^^^^^ + │ │ │ + │ │ Given: integer + │ Invalid 'if'. The body of an 'if' without an 'else' must have type '()' + │ Expected: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_no_else.move:5:9 + │ + 5 │ if (cond) foo(); + │ ^^^^^^^^^^^^^^^ + │ │ + │ Invalid 'if'. The body of an 'if' without an 'else' must have type '()' + │ Expected: '()' + · +13 │ fun foo(): u64 { 0 } + │ --- Given: 'u64' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/if_no_else.move:6:9 + │ + 6 │ ╭ ╭ if (cond) { + 7 │ │ │ let x = 0; + 8 │ │ │ let y = 1; + │ │ │ - Given: integer + 9 │ │ │ x * y +10 │ │ │ } + │ ╰─│─────────^ Invalid 'if'. The body of an 'if' without an 'else' must have type '()' + │ ╰─────────' Expected: '()' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/ignore_inferred_resource.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/ignore_inferred_resource.exp deleted file mode 100644 index 5b4865281d42f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/ignore_inferred_resource.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/ignore_inferred_resource.move:4:9 - │ -2 │ struct S {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here -3 │ fun no() { -4 │ S{}; - │ ^^^ - │ │ - │ Cannot ignore values without the 'drop' ability. The value must be used - │ The type '0x8675309::M::S<_>' does not have the ability 'drop' - -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/ignore_inferred_resource.move:4:9 - │ -4 │ S{}; - │ ^^^ Could not infer this type. Try adding an annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/ignore_inferred_resource.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/ignore_inferred_resource.snap new file mode 100644 index 0000000000000..78ad8179631b3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/ignore_inferred_resource.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/ignore_inferred_resource.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/ignore_inferred_resource.move:4:9 + │ +2 │ struct S {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here +3 │ fun no() { +4 │ S{}; + │ ^^^ + │ │ + │ Cannot ignore values without the 'drop' ability. The value must be used + │ The type '0x8675309::M::S<_>' does not have the ability 'drop' + +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/ignore_inferred_resource.move:4:9 + │ +4 │ S{}; + │ ^^^ Could not infer this type. Try adding an annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_const_copy.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_const_copy.exp deleted file mode 100644 index 0ce9448f05594..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_const_copy.exp +++ /dev/null @@ -1,64 +0,0 @@ -warning[W04028]: implicit copy of a constant - ┌─ tests/move_check/typing/implicit_const_copy.move:7:10 - │ -7 │ &C; - │ ^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_check/typing/implicit_const_copy.move:8:10 - │ -8 │ &BYTES; - │ ^^^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_check/typing/implicit_const_copy.move:9:11 - │ -9 │ *&C; - │ ^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_check/typing/implicit_const_copy.move:10:11 - │ -10 │ *&BYTES; - │ ^^^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_check/typing/implicit_const_copy.move:11:14 - │ -11 │ &mut C; - │ ^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_check/typing/implicit_const_copy.move:12:14 - │ -12 │ &mut BYTES; - │ ^^^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_check/typing/implicit_const_copy.move:13:15 - │ -13 │ *&mut C = 1; - │ ^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W04028]: implicit copy of a constant - ┌─ tests/move_check/typing/implicit_const_copy.move:14:15 - │ -14 │ *&mut BYTES = b"bye"; - │ ^^^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit - │ - = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_const_copy.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_const_copy.snap new file mode 100644 index 0000000000000..b83f9d91174c1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_const_copy.snap @@ -0,0 +1,71 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/implicit_const_copy.move +--- +warning[W04028]: implicit copy of a constant + ┌─ tests/move_check/typing/implicit_const_copy.move:7:10 + │ +7 │ &C; + │ ^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_check/typing/implicit_const_copy.move:8:10 + │ +8 │ &BYTES; + │ ^^^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_check/typing/implicit_const_copy.move:9:11 + │ +9 │ *&C; + │ ^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_check/typing/implicit_const_copy.move:10:11 + │ +10 │ *&BYTES; + │ ^^^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_check/typing/implicit_const_copy.move:11:14 + │ +11 │ &mut C; + │ ^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_check/typing/implicit_const_copy.move:12:14 + │ +12 │ &mut BYTES; + │ ^^^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_check/typing/implicit_const_copy.move:13:15 + │ +13 │ *&mut C = 1; + │ ^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W04028]: implicit copy of a constant + ┌─ tests/move_check/typing/implicit_const_copy.move:14:15 + │ +14 │ *&mut BYTES = b"bye"; + │ ^^^^^ This access will make a new copy of the constant. Consider binding the value to a variable first to make this copy explicit + │ + = This warning can be suppressed with '#[allow(implicit_const_copy)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field.snap new file mode 100644 index 0000000000000..46901f3e2c870 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_chain.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_chain.snap new file mode 100644 index 0000000000000..e42149dc93dff --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_chain.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_chain.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_chain_missing.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_chain_missing.exp deleted file mode 100644 index 19071c34eff04..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_chain_missing.exp +++ /dev/null @@ -1,54 +0,0 @@ -error[E03010]: unbound field - ┌─ tests/move_check/typing/implicit_deref_borrow_field_chain_missing.move:7:9 - │ -7 │ x1.f; - │ ^^^^ Unbound field 'f' in '0x8675309::M::X1' - -error[E03010]: unbound field - ┌─ tests/move_check/typing/implicit_deref_borrow_field_chain_missing.move:8:9 - │ -8 │ x1.x2.f; - │ ^^^^^^^ Unbound field 'f' in '0x8675309::M::X2' - -error[E03010]: unbound field - ┌─ tests/move_check/typing/implicit_deref_borrow_field_chain_missing.move:9:9 - │ -9 │ x1.x2.x3.g; - │ ^^^^^^^^^^ Unbound field 'g' in '0x8675309::M::X3' - -error[E04009]: expected specific type - ┌─ tests/move_check/typing/implicit_deref_borrow_field_chain_missing.move:10:9 - │ - 4 │ struct X3 { f: u64, } - │ --- Expected a struct type in the current module but got: 'u64' - · -10 │ x1.x2.x3.f.g; - │ ^^^^^^^^^^^^ Unbound field 'g' - -error[E03010]: unbound field - ┌─ tests/move_check/typing/implicit_deref_borrow_field_chain_missing.move:11:9 - │ -11 │ x1_mut.f; - │ ^^^^^^^^ Unbound field 'f' in '0x8675309::M::X1' - -error[E03010]: unbound field - ┌─ tests/move_check/typing/implicit_deref_borrow_field_chain_missing.move:12:9 - │ -12 │ x1_mut.x2.f; - │ ^^^^^^^^^^^ Unbound field 'f' in '0x8675309::M::X2' - -error[E03010]: unbound field - ┌─ tests/move_check/typing/implicit_deref_borrow_field_chain_missing.move:13:9 - │ -13 │ x1_mut.x2.x3.g; - │ ^^^^^^^^^^^^^^ Unbound field 'g' in '0x8675309::M::X3' - -error[E04009]: expected specific type - ┌─ tests/move_check/typing/implicit_deref_borrow_field_chain_missing.move:14:9 - │ - 4 │ struct X3 { f: u64, } - │ --- Expected a struct type in the current module but got: 'u64' - · -14 │ x1_mut.x2.x3.f.g; - │ ^^^^^^^^^^^^^^^^ Unbound field 'g' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_chain_missing.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_chain_missing.snap new file mode 100644 index 0000000000000..a0d369382b1c5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_chain_missing.snap @@ -0,0 +1,61 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_chain_missing.move +--- +error[E03010]: unbound field + ┌─ tests/move_check/typing/implicit_deref_borrow_field_chain_missing.move:7:9 + │ +7 │ x1.f; + │ ^^^^ Unbound field 'f' in '0x8675309::M::X1' + +error[E03010]: unbound field + ┌─ tests/move_check/typing/implicit_deref_borrow_field_chain_missing.move:8:9 + │ +8 │ x1.x2.f; + │ ^^^^^^^ Unbound field 'f' in '0x8675309::M::X2' + +error[E03010]: unbound field + ┌─ tests/move_check/typing/implicit_deref_borrow_field_chain_missing.move:9:9 + │ +9 │ x1.x2.x3.g; + │ ^^^^^^^^^^ Unbound field 'g' in '0x8675309::M::X3' + +error[E04009]: expected specific type + ┌─ tests/move_check/typing/implicit_deref_borrow_field_chain_missing.move:10:9 + │ + 4 │ struct X3 { f: u64, } + │ --- Expected a struct type in the current module but got: 'u64' + · +10 │ x1.x2.x3.f.g; + │ ^^^^^^^^^^^^ Unbound field 'g' + +error[E03010]: unbound field + ┌─ tests/move_check/typing/implicit_deref_borrow_field_chain_missing.move:11:9 + │ +11 │ x1_mut.f; + │ ^^^^^^^^ Unbound field 'f' in '0x8675309::M::X1' + +error[E03010]: unbound field + ┌─ tests/move_check/typing/implicit_deref_borrow_field_chain_missing.move:12:9 + │ +12 │ x1_mut.x2.f; + │ ^^^^^^^^^^^ Unbound field 'f' in '0x8675309::M::X2' + +error[E03010]: unbound field + ┌─ tests/move_check/typing/implicit_deref_borrow_field_chain_missing.move:13:9 + │ +13 │ x1_mut.x2.x3.g; + │ ^^^^^^^^^^^^^^ Unbound field 'g' in '0x8675309::M::X3' + +error[E04009]: expected specific type + ┌─ tests/move_check/typing/implicit_deref_borrow_field_chain_missing.move:14:9 + │ + 4 │ struct X3 { f: u64, } + │ --- Expected a struct type in the current module but got: 'u64' + · +14 │ x1_mut.x2.x3.f.g; + │ ^^^^^^^^^^^^^^^^ Unbound field 'g' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_complex_root_expr.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_complex_root_expr.snap new file mode 100644 index 0000000000000..c297fa1946796 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_complex_root_expr.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_complex_root_expr.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.exp deleted file mode 100644 index 4f6f0a6ee467c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.exp +++ /dev/null @@ -1,90 +0,0 @@ -error[E04009]: expected specific type - ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:6:9 - │ -6 │ 0.f; - │ ^^^ - │ │ - │ Unbound field 'f' - │ Expected a struct type in the current module but got: integer - -error[E04009]: expected specific type - ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:7:9 - │ -7 │ 0.g; - │ ^^^ - │ │ - │ Unbound field 'g' - │ Expected a struct type in the current module but got: integer - -error[E04009]: expected specific type - ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:8:9 - │ -5 │ fun t0(u: u64, cond: bool, addr: address) { - │ --- Expected a struct type in the current module but got: 'u64' - · -8 │ u.value; - │ ^^^^^^^ Unbound field 'value' - -error[E04009]: expected specific type - ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:9:9 - │ -5 │ fun t0(u: u64, cond: bool, addr: address) { - │ ---- Expected a struct type in the current module but got: 'bool' - · -9 │ cond.value; - │ ^^^^^^^^^^ Unbound field 'value' - -error[E04009]: expected specific type - ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:10:9 - │ - 5 │ fun t0(u: u64, cond: bool, addr: address) { - │ ------- Expected a struct type in the current module but got: 'address' - · -10 │ addr.R; - │ ^^^^^^ Unbound field 'R' - -error[E04009]: expected specific type - ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:11:9 - │ - 5 │ fun t0(u: u64, cond: bool, addr: address) { - │ ------- Expected a struct type in the current module but got: 'address' - · -11 │ addr.f; - │ ^^^^^^ Unbound field 'f' - -error[E04005]: expected a single type - ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:12:9 - │ -12 │ ().R; - │ ^^ - │ │ - │ Invalid dot access - │ Expected a single type, but found expression list type: '()' - -error[E04009]: expected specific type - ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:12:9 - │ -12 │ ().R; - │ ^^^^ - │ │ - │ Unbound field 'R' - │ Expected a struct type in the current module but got: '()' - -error[E04005]: expected a single type - ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:13:9 - │ -13 │ (S{f: 0}, S{f:0}).f; - │ ^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid dot access - │ Expected a single type, but found expression list type: '(0x8675309::M::S, 0x8675309::M::S)' - -error[E04009]: expected specific type - ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:13:9 - │ -13 │ (S{f: 0}, S{f:0}).f; - │ ^^^^^^^^^^^^^^^^^^^ - │ │ - │ Unbound field 'f' - │ Expected a struct type in the current module but got: '(0x8675309::M::S, 0x8675309::M::S)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.snap new file mode 100644 index 0000000000000..0a2775b80c884 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.snap @@ -0,0 +1,97 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move +--- +error[E04009]: expected specific type + ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:6:9 + │ +6 │ 0.f; + │ ^^^ + │ │ + │ Unbound field 'f' + │ Expected a struct type in the current module but got: integer + +error[E04009]: expected specific type + ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:7:9 + │ +7 │ 0.g; + │ ^^^ + │ │ + │ Unbound field 'g' + │ Expected a struct type in the current module but got: integer + +error[E04009]: expected specific type + ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:8:9 + │ +5 │ fun t0(u: u64, cond: bool, addr: address) { + │ --- Expected a struct type in the current module but got: 'u64' + · +8 │ u.value; + │ ^^^^^^^ Unbound field 'value' + +error[E04009]: expected specific type + ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:9:9 + │ +5 │ fun t0(u: u64, cond: bool, addr: address) { + │ ---- Expected a struct type in the current module but got: 'bool' + · +9 │ cond.value; + │ ^^^^^^^^^^ Unbound field 'value' + +error[E04009]: expected specific type + ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:10:9 + │ + 5 │ fun t0(u: u64, cond: bool, addr: address) { + │ ------- Expected a struct type in the current module but got: 'address' + · +10 │ addr.R; + │ ^^^^^^ Unbound field 'R' + +error[E04009]: expected specific type + ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:11:9 + │ + 5 │ fun t0(u: u64, cond: bool, addr: address) { + │ ------- Expected a struct type in the current module but got: 'address' + · +11 │ addr.f; + │ ^^^^^^ Unbound field 'f' + +error[E04005]: expected a single type + ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:12:9 + │ +12 │ ().R; + │ ^^ + │ │ + │ Invalid dot access + │ Expected a single type, but found expression list type: '()' + +error[E04009]: expected specific type + ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:12:9 + │ +12 │ ().R; + │ ^^^^ + │ │ + │ Unbound field 'R' + │ Expected a struct type in the current module but got: '()' + +error[E04005]: expected a single type + ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:13:9 + │ +13 │ (S{f: 0}, S{f:0}).f; + │ ^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid dot access + │ Expected a single type, but found expression list type: '(0x8675309::M::S, 0x8675309::M::S)' + +error[E04009]: expected specific type + ┌─ tests/move_check/typing/implicit_deref_borrow_field_from_non_struct.move:13:9 + │ +13 │ (S{f: 0}, S{f:0}).f; + │ ^^^^^^^^^^^^^^^^^^^ + │ │ + │ Unbound field 'f' + │ Expected a struct type in the current module but got: '(0x8675309::M::S, 0x8675309::M::S)' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_internal.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_internal.exp deleted file mode 100644 index db434a48a596e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_internal.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/implicit_deref_borrow_field_internal.move:13:10 - │ -13 │ (X::s().f: u64); - │ ^^^^^^^^ Invalid access of field 'f' on the struct '0x2::X::S'. The field 'f' can only be accessed within the module '0x2::X' since it defines 'S' - -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/implicit_deref_borrow_field_internal.move:15:10 - │ -15 │ (s.f: u64); - │ ^^^ Invalid access of field 'f' on the struct '0x2::X::S'. The field 'f' can only be accessed within the module '0x2::X' since it defines 'S' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_internal.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_internal.snap new file mode 100644 index 0000000000000..862e48653937f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_internal.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_internal.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/implicit_deref_borrow_field_internal.move:13:10 + │ +13 │ (X::s().f: u64); + │ ^^^^^^^^ Invalid access of field 'f' on the struct '0x2::X::S'. The field 'f' can only be accessed within the module '0x2::X' since it defines 'S' + +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/implicit_deref_borrow_field_internal.move:15:10 + │ +15 │ (s.f: u64); + │ ^^^ Invalid access of field 'f' on the struct '0x2::X::S'. The field 'f' can only be accessed within the module '0x2::X' since it defines 'S' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_missing.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_missing.exp deleted file mode 100644 index e473e966b888e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_missing.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E03010]: unbound field - ┌─ tests/move_check/typing/implicit_deref_borrow_field_missing.move:5:9 - │ -5 │ s.g; - │ ^^^ Unbound field 'g' in '0x8675309::M::S' - -error[E03010]: unbound field - ┌─ tests/move_check/typing/implicit_deref_borrow_field_missing.move:6:9 - │ -6 │ sref.g; - │ ^^^^^^ Unbound field 'g' in '0x8675309::M::S' - -error[E03010]: unbound field - ┌─ tests/move_check/typing/implicit_deref_borrow_field_missing.move:7:9 - │ -7 │ s_mut.h; - │ ^^^^^^^ Unbound field 'h' in '0x8675309::M::S' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_missing.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_missing.snap new file mode 100644 index 0000000000000..1f92e20da6c1b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_missing.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_missing.move +--- +error[E03010]: unbound field + ┌─ tests/move_check/typing/implicit_deref_borrow_field_missing.move:5:9 + │ +5 │ s.g; + │ ^^^ Unbound field 'g' in '0x8675309::M::S' + +error[E03010]: unbound field + ┌─ tests/move_check/typing/implicit_deref_borrow_field_missing.move:6:9 + │ +6 │ sref.g; + │ ^^^^^^ Unbound field 'g' in '0x8675309::M::S' + +error[E03010]: unbound field + ┌─ tests/move_check/typing/implicit_deref_borrow_field_missing.move:7:9 + │ +7 │ s_mut.h; + │ ^^^^^^^ Unbound field 'h' in '0x8675309::M::S' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_non_ref_non_local_root.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_non_ref_non_local_root.snap new file mode 100644 index 0000000000000..df25d7f597e73 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_non_ref_non_local_root.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_non_ref_non_local_root.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_non_ref_root.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_non_ref_root.snap new file mode 100644 index 0000000000000..6913c2cabcaf6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_non_ref_root.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_non_ref_root.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_not_copyable.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_not_copyable.exp deleted file mode 100644 index 6d4676a14a0ab..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_not_copyable.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/implicit_deref_borrow_field_not_copyable.move:8:15 - │ -2 │ struct R has drop {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here -3 │ struct S has copy, drop {} -4 │ struct B has drop { s: S, r: R } - │ - The type '0x8675309::M::R' does not have the ability 'copy' - · -8 │ R{} = b.r; - │ ^^^ Invalid implicit copy of field 'r' without the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/implicit_deref_borrow_field_not_copyable.move:11:15 - │ - 2 │ struct R has drop {} - │ - To satisfy the constraint, the 'copy' ability would need to be added here - 3 │ struct S has copy, drop {} - 4 │ struct B has drop { s: S, r: R } - │ - The type '0x8675309::M::R' does not have the ability 'copy' - · -11 │ R{} = bref.r; - │ ^^^^^^ Invalid implicit copy of field 'r' without the 'copy' ability - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_not_copyable.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_not_copyable.snap new file mode 100644 index 0000000000000..988b92b72ecb0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_not_copyable.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/implicit_deref_borrow_field_not_copyable.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/implicit_deref_borrow_field_not_copyable.move:8:15 + │ +2 │ struct R has drop {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here +3 │ struct S has copy, drop {} +4 │ struct B has drop { s: S, r: R } + │ - The type '0x8675309::M::R' does not have the ability 'copy' + · +8 │ R{} = b.r; + │ ^^^ Invalid implicit copy of field 'r' without the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/implicit_deref_borrow_field_not_copyable.move:11:15 + │ + 2 │ struct R has drop {} + │ - To satisfy the constraint, the 'copy' ability would need to be added here + 3 │ struct S has copy, drop {} + 4 │ struct B has drop { s: S, r: R } + │ - The type '0x8675309::M::R' does not have the ability 'copy' + · +11 │ R{} = bref.r; + │ ^^^^^^ Invalid implicit copy of field 'r' without the 'copy' ability diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/infinite_instantiations_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/infinite_instantiations_invalid.exp deleted file mode 100644 index a62e8d1354acd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/infinite_instantiations_invalid.exp +++ /dev/null @@ -1,82 +0,0 @@ -error[E04019]: cyclic type instantiation - ┌─ tests/move_check/typing/infinite_instantiations_invalid.move:7:9 - │ -7 │ t>() - │ ^^^^^^^^^^^ - │ │ │ - │ │ The type parameter 't::T' was instantiated with the type '0x42::X::Box', which contains the type parameter 't::T'. This recursive call causes the instantiation to recurse infinitely - │ Invalid call to '0x42::X::t' - -error[E04019]: cyclic type instantiation - ┌─ tests/move_check/typing/infinite_instantiations_invalid.move:14:9 - │ -11 │ y>() - │ ----------- 'x' calls 'y<0x42::X::Box>' - · -14 │ x>() - │ ^^^^^^^^^^^ - │ │ │ - │ │ The type parameter 'y::T' was instantiated with the type '0x42::X::Box', which contains the type parameter 'x::T'. These mutually recursive calls causes the instantiation to recurse infinitely - │ Invalid call to '0x42::X::x' - │ 'y<0x42::X::Box>' calls 'x<0x42::X::Box<0x42::X::Box>>' - -error[E04019]: cyclic type instantiation - ┌─ tests/move_check/typing/infinite_instantiations_invalid.move:24:9 - │ -18 │ b() - │ ------ 'a' calls 'b' - · -21 │ c() - │ ------ 'b' calls 'c' - · -24 │ a>() - │ ^^^^^^^^^^^ - │ │ │ - │ │ The type parameter 'b::A' was instantiated with the type '0x42::X::Box', which contains the type parameter 'a::C'. A cycle of recursive calls causes the instantiation to recurse infinitely - │ Invalid call to '0x42::X::a' - │ 'c' calls 'a<0x42::X::Box>' - -error[E04019]: cyclic type instantiation - ┌─ tests/move_check/typing/infinite_instantiations_invalid.move:38:9 - │ -38 │ z>() - │ ^^^^^^^^^^^ - │ │ │ - │ │ The type parameter 'z::T' was instantiated with the type '0x42::Y::Box', which contains the type parameter 'z::T'. This recursive call causes the instantiation to recurse infinitely - │ Invalid call to '0x42::Y::z' - -error[E04019]: cyclic type instantiation - ┌─ tests/move_check/typing/infinite_instantiations_invalid.move:48:9 - │ -42 │ b() - │ ------ 'a' calls 'b' - · -45 │ c() - │ ------ 'b' calls 'c' - · -48 │ d>() - │ ^^^^^^^^^^^ - │ │ │ - │ │ The type parameter 'a::D' was instantiated with the type '0x42::Y::Box', which contains the type parameter 'd::C'. A cycle of recursive calls causes the instantiation to recurse infinitely - │ Invalid call to '0x42::Y::d' - │ 'c' calls 'd<0x42::Y::Box>' - · -51 │ a() - │ ------ 'd' calls 'a' - -error[E04019]: cyclic type instantiation - ┌─ tests/move_check/typing/infinite_instantiations_invalid.move:62:9 - │ -59 │ tr() - │ -------- 'tl' calls 'tr' - · -62 │ bl>(); - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ The type parameter 'tl::BL' was instantiated with the type '0x42::Z::Box', which contains the type parameter 'bl::TR'. A cycle of recursive calls causes the instantiation to recurse infinitely - │ Invalid call to '0x42::Z::bl' - │ 'tr' calls 'bl<0x42::Z::Box>' - · -69 │ tl() - │ -------- 'bl' calls 'tl' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/infinite_instantiations_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/infinite_instantiations_invalid.snap new file mode 100644 index 0000000000000..c8b4648c820c9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/infinite_instantiations_invalid.snap @@ -0,0 +1,89 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/infinite_instantiations_invalid.move +--- +error[E04019]: cyclic type instantiation + ┌─ tests/move_check/typing/infinite_instantiations_invalid.move:7:9 + │ +7 │ t>() + │ ^^^^^^^^^^^ + │ │ │ + │ │ The type parameter 't::T' was instantiated with the type '0x42::X::Box', which contains the type parameter 't::T'. This recursive call causes the instantiation to recurse infinitely + │ Invalid call to '0x42::X::t' + +error[E04019]: cyclic type instantiation + ┌─ tests/move_check/typing/infinite_instantiations_invalid.move:14:9 + │ +11 │ y>() + │ ----------- 'x' calls 'y<0x42::X::Box>' + · +14 │ x>() + │ ^^^^^^^^^^^ + │ │ │ + │ │ The type parameter 'y::T' was instantiated with the type '0x42::X::Box', which contains the type parameter 'x::T'. These mutually recursive calls causes the instantiation to recurse infinitely + │ Invalid call to '0x42::X::x' + │ 'y<0x42::X::Box>' calls 'x<0x42::X::Box<0x42::X::Box>>' + +error[E04019]: cyclic type instantiation + ┌─ tests/move_check/typing/infinite_instantiations_invalid.move:24:9 + │ +18 │ b() + │ ------ 'a' calls 'b' + · +21 │ c() + │ ------ 'b' calls 'c' + · +24 │ a>() + │ ^^^^^^^^^^^ + │ │ │ + │ │ The type parameter 'b::A' was instantiated with the type '0x42::X::Box', which contains the type parameter 'a::C'. A cycle of recursive calls causes the instantiation to recurse infinitely + │ Invalid call to '0x42::X::a' + │ 'c' calls 'a<0x42::X::Box>' + +error[E04019]: cyclic type instantiation + ┌─ tests/move_check/typing/infinite_instantiations_invalid.move:38:9 + │ +38 │ z>() + │ ^^^^^^^^^^^ + │ │ │ + │ │ The type parameter 'z::T' was instantiated with the type '0x42::Y::Box', which contains the type parameter 'z::T'. This recursive call causes the instantiation to recurse infinitely + │ Invalid call to '0x42::Y::z' + +error[E04019]: cyclic type instantiation + ┌─ tests/move_check/typing/infinite_instantiations_invalid.move:48:9 + │ +42 │ b() + │ ------ 'a' calls 'b' + · +45 │ c() + │ ------ 'b' calls 'c' + · +48 │ d>() + │ ^^^^^^^^^^^ + │ │ │ + │ │ The type parameter 'a::D' was instantiated with the type '0x42::Y::Box', which contains the type parameter 'd::C'. A cycle of recursive calls causes the instantiation to recurse infinitely + │ Invalid call to '0x42::Y::d' + │ 'c' calls 'd<0x42::Y::Box>' + · +51 │ a() + │ ------ 'd' calls 'a' + +error[E04019]: cyclic type instantiation + ┌─ tests/move_check/typing/infinite_instantiations_invalid.move:62:9 + │ +59 │ tr() + │ -------- 'tl' calls 'tr' + · +62 │ bl>(); + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ The type parameter 'tl::BL' was instantiated with the type '0x42::Z::Box', which contains the type parameter 'bl::TR'. A cycle of recursive calls causes the instantiation to recurse infinitely + │ Invalid call to '0x42::Z::bl' + │ 'tr' calls 'bl<0x42::Z::Box>' + · +69 │ tl() + │ -------- 'bl' calls 'tl' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/infinite_instantiations_valid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/infinite_instantiations_valid.snap new file mode 100644 index 0000000000000..7a584d9f7891e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/infinite_instantiations_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/infinite_instantiations_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/instantiate_signatures.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/instantiate_signatures.exp deleted file mode 100644 index 698da4bb0018c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/instantiate_signatures.exp +++ /dev/null @@ -1,306 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/instantiate_signatures.move:11:13 - │ - 3 │ struct S has drop { f: T } - │ ---- 'drop' constraint declared here - 4 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -11 │ f1: S, - │ ^^^^ - │ │ │ - │ │ The type '0x42::M::R' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:12:13 - │ -12 │ f2: S<&u64>, - │ ^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&u64' - │ Invalid type argument - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:13:13 - │ -13 │ f3: &(&u64), - │ ^^^^^^^ - │ │ - │ Invalid field type - │ Expected a single non-reference type, but found: '&&u64' - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:13:13 - │ -13 │ f3: &(&u64), - │ ^^^^^^^ - │ ││ - │ │Expected a single non-reference type, but found: '&u64' - │ Invalid reference type - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:14:13 - │ -14 │ f4: S<(u64, u64)>, - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '(u64, u64)' - │ Invalid type argument - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/instantiate_signatures.move:18:14 - │ - 3 │ struct S has drop { f: T } - │ ---- 'drop' constraint declared here - 4 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -18 │ _f1: S, - │ ^^^^ - │ │ │ - │ │ The type '0x42::M::R' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:19:14 - │ -19 │ _f2: S<&u64>, - │ ^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&u64' - │ Invalid type argument - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:20:14 - │ -20 │ _f3: &(&u64), - │ ^^^^^^^ - │ ││ - │ │Expected a single non-reference type, but found: '&u64' - │ Invalid reference type - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:21:14 - │ -21 │ _f4: S<(u64, u64)>, - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '(u64, u64)' - │ Invalid type argument - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/instantiate_signatures.move:23:9 - │ - 3 │ struct S has drop { f: T } - │ ---- 'drop' constraint declared here - 4 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -23 │ S, - │ ^^^^ - │ │ │ - │ │ The type '0x42::M::R' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:24:9 - │ -24 │ S<&u64>, - │ ^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&u64' - │ Invalid type argument - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:25:9 - │ -25 │ &(&u64), - │ ^^^^^^^ - │ ││ - │ │Expected a single non-reference type, but found: '&u64' - │ Invalid reference type - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:26:9 - │ -26 │ S<(u64, u64)>, - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '(u64, u64)' - │ Invalid type argument - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/instantiate_signatures.move:32:18 - │ - 3 │ struct S has drop { f: T } - │ ---- 'drop' constraint declared here - 4 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -32 │ let _f1: S = abort 0; - │ ^^^^ - │ │ │ - │ │ The type '0x42::M::R' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:33:18 - │ -33 │ let _f2: S<&u64> = abort 0; - │ ^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&u64' - │ Invalid type argument - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:34:18 - │ -34 │ let _f3: &(&u64) = abort 0; - │ ^^^^^^^ - │ ││ - │ │Expected a single non-reference type, but found: '&u64' - │ Invalid reference type - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:35:18 - │ -35 │ let _f4: S<(u64, u64)> = abort 0; - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '(u64, u64)' - │ Invalid type argument - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/instantiate_signatures.move:37:9 - │ -37 │ id>(abort 0); - │ ^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::S<0x42::M::R>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' - │ │ The type '0x42::M::S<0x42::M::R>' does not have the ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/instantiate_signatures.move:37:12 - │ - 3 │ struct S has drop { f: T } - │ ---- 'drop' constraint declared here - 4 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -37 │ id>(abort 0); - │ ^^^^ - │ │ │ - │ │ The type '0x42::M::R' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:38:12 - │ -38 │ id>(abort 0); - │ ^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&u64' - │ Invalid type argument - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:39:9 - │ -39 │ id<&(&u64)>(abort 0); - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&&u64' - │ Invalid type argument - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:39:12 - │ -39 │ id<&(&u64)>(abort 0); - │ ^^^^^^^ - │ ││ - │ │Expected a single non-reference type, but found: '&u64' - │ Invalid reference type - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:40:12 - │ -40 │ id>(abort 0); - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '(u64, u64)' - │ Invalid type argument - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/instantiate_signatures.move:42:9 - │ - 3 │ struct S has drop { f: T } - │ ---- 'drop' constraint declared here - · -42 │ S> { f: abort 0 }; - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::S<0x42::M::R>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' - │ │ The type '0x42::M::S<0x42::M::R>' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/instantiate_signatures.move:42:9 - │ -42 │ S> { f: abort 0 }; - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::S<0x42::M::S<0x42::M::R>>' can have the ability 'drop' but the type argument '0x42::M::S<0x42::M::R>' does not have the required ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - │ The type '0x42::M::S<0x42::M::S<0x42::M::R>>' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/instantiate_signatures.move:42:11 - │ - 3 │ struct S has drop { f: T } - │ ---- 'drop' constraint declared here - 4 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -42 │ S> { f: abort 0 }; - │ ^^^^ - │ │ │ - │ │ The type '0x42::M::R' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:43:11 - │ -43 │ S> { f: abort 0 }; - │ ^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&u64' - │ Invalid type argument - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:44:9 - │ -44 │ S<&(&u64)> { f: abort 0 }; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&&u64' - │ Invalid type argument - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:44:11 - │ -44 │ S<&(&u64)> { f: abort 0 }; - │ ^^^^^^^ - │ ││ - │ │Expected a single non-reference type, but found: '&u64' - │ Invalid reference type - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/instantiate_signatures.move:45:11 - │ -45 │ S> { f: abort 0 }; - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '(u64, u64)' - │ Invalid type argument - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/instantiate_signatures.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/instantiate_signatures.snap new file mode 100644 index 0000000000000..99a53322d5afa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/instantiate_signatures.snap @@ -0,0 +1,313 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/instantiate_signatures.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/instantiate_signatures.move:11:13 + │ + 3 │ struct S has drop { f: T } + │ ---- 'drop' constraint declared here + 4 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +11 │ f1: S, + │ ^^^^ + │ │ │ + │ │ The type '0x42::M::R' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:12:13 + │ +12 │ f2: S<&u64>, + │ ^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&u64' + │ Invalid type argument + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:13:13 + │ +13 │ f3: &(&u64), + │ ^^^^^^^ + │ │ + │ Invalid field type + │ Expected a single non-reference type, but found: '&&u64' + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:13:13 + │ +13 │ f3: &(&u64), + │ ^^^^^^^ + │ ││ + │ │Expected a single non-reference type, but found: '&u64' + │ Invalid reference type + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:14:13 + │ +14 │ f4: S<(u64, u64)>, + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '(u64, u64)' + │ Invalid type argument + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/instantiate_signatures.move:18:14 + │ + 3 │ struct S has drop { f: T } + │ ---- 'drop' constraint declared here + 4 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +18 │ _f1: S, + │ ^^^^ + │ │ │ + │ │ The type '0x42::M::R' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:19:14 + │ +19 │ _f2: S<&u64>, + │ ^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&u64' + │ Invalid type argument + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:20:14 + │ +20 │ _f3: &(&u64), + │ ^^^^^^^ + │ ││ + │ │Expected a single non-reference type, but found: '&u64' + │ Invalid reference type + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:21:14 + │ +21 │ _f4: S<(u64, u64)>, + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '(u64, u64)' + │ Invalid type argument + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/instantiate_signatures.move:23:9 + │ + 3 │ struct S has drop { f: T } + │ ---- 'drop' constraint declared here + 4 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +23 │ S, + │ ^^^^ + │ │ │ + │ │ The type '0x42::M::R' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:24:9 + │ +24 │ S<&u64>, + │ ^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&u64' + │ Invalid type argument + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:25:9 + │ +25 │ &(&u64), + │ ^^^^^^^ + │ ││ + │ │Expected a single non-reference type, but found: '&u64' + │ Invalid reference type + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:26:9 + │ +26 │ S<(u64, u64)>, + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '(u64, u64)' + │ Invalid type argument + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/instantiate_signatures.move:32:18 + │ + 3 │ struct S has drop { f: T } + │ ---- 'drop' constraint declared here + 4 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +32 │ let _f1: S = abort 0; + │ ^^^^ + │ │ │ + │ │ The type '0x42::M::R' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:33:18 + │ +33 │ let _f2: S<&u64> = abort 0; + │ ^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&u64' + │ Invalid type argument + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:34:18 + │ +34 │ let _f3: &(&u64) = abort 0; + │ ^^^^^^^ + │ ││ + │ │Expected a single non-reference type, but found: '&u64' + │ Invalid reference type + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:35:18 + │ +35 │ let _f4: S<(u64, u64)> = abort 0; + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '(u64, u64)' + │ Invalid type argument + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/instantiate_signatures.move:37:9 + │ +37 │ id>(abort 0); + │ ^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::S<0x42::M::R>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' + │ │ The type '0x42::M::S<0x42::M::R>' does not have the ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/instantiate_signatures.move:37:12 + │ + 3 │ struct S has drop { f: T } + │ ---- 'drop' constraint declared here + 4 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +37 │ id>(abort 0); + │ ^^^^ + │ │ │ + │ │ The type '0x42::M::R' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:38:12 + │ +38 │ id>(abort 0); + │ ^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&u64' + │ Invalid type argument + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:39:9 + │ +39 │ id<&(&u64)>(abort 0); + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&&u64' + │ Invalid type argument + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:39:12 + │ +39 │ id<&(&u64)>(abort 0); + │ ^^^^^^^ + │ ││ + │ │Expected a single non-reference type, but found: '&u64' + │ Invalid reference type + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:40:12 + │ +40 │ id>(abort 0); + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '(u64, u64)' + │ Invalid type argument + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/instantiate_signatures.move:42:9 + │ + 3 │ struct S has drop { f: T } + │ ---- 'drop' constraint declared here + · +42 │ S> { f: abort 0 }; + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::S<0x42::M::R>' can have the ability 'drop' but the type argument '0x42::M::R' does not have the required ability 'drop' + │ │ The type '0x42::M::S<0x42::M::R>' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/instantiate_signatures.move:42:9 + │ +42 │ S> { f: abort 0 }; + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::S<0x42::M::S<0x42::M::R>>' can have the ability 'drop' but the type argument '0x42::M::S<0x42::M::R>' does not have the required ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + │ The type '0x42::M::S<0x42::M::S<0x42::M::R>>' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/instantiate_signatures.move:42:11 + │ + 3 │ struct S has drop { f: T } + │ ---- 'drop' constraint declared here + 4 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +42 │ S> { f: abort 0 }; + │ ^^^^ + │ │ │ + │ │ The type '0x42::M::R' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:43:11 + │ +43 │ S> { f: abort 0 }; + │ ^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&u64' + │ Invalid type argument + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:44:9 + │ +44 │ S<&(&u64)> { f: abort 0 }; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&&u64' + │ Invalid type argument + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:44:11 + │ +44 │ S<&(&u64)> { f: abort 0 }; + │ ^^^^^^^ + │ ││ + │ │Expected a single non-reference type, but found: '&u64' + │ Invalid reference type + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/instantiate_signatures.move:45:11 + │ +45 │ S> { f: abort 0 }; + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '(u64, u64)' + │ Invalid type argument diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/invalid_assertion_const.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/invalid_assertion_const.exp deleted file mode 100644 index 23f1b7ac0656d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/invalid_assertion_const.exp +++ /dev/null @@ -1,22 +0,0 @@ -error[E04035]: invalid constant usage in error context - ┌─ tests/move_check/typing/invalid_assertion_const.move:5:15 - │ -2 │ const X: vector = b"X"; - │ - 'X' defined here with no '#[error]' annotation - · -5 │ abort X; - │ ^ Invalid error code for abort, expected a u64 or constant declared with '#[error]' annotation - │ - = Non-u64 constants can only be used as error codes if the '#[error]' attribute is added to them. - -error[E04035]: invalid constant usage in error context - ┌─ tests/move_check/typing/invalid_assertion_const.move:9:24 - │ -2 │ const X: vector = b"X"; - │ - 'X' defined here with no '#[error]' annotation - · -9 │ assert!(false, X); - │ ^ Invalid error code for assertion, expected a u64 or constant declared with '#[error]' annotation - │ - = Non-u64 constants can only be used as error codes if the '#[error]' attribute is added to them. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/invalid_assertion_const.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/invalid_assertion_const.snap new file mode 100644 index 0000000000000..435f41dd8477e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/invalid_assertion_const.snap @@ -0,0 +1,29 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/invalid_assertion_const.move +--- +error[E04035]: invalid constant usage in error context + ┌─ tests/move_check/typing/invalid_assertion_const.move:5:15 + │ +2 │ const X: vector = b"X"; + │ - 'X' defined here with no '#[error]' annotation + · +5 │ abort X; + │ ^ Invalid error code for abort, expected a u64 or constant declared with '#[error]' annotation + │ + = Non-u64 constants can only be used as error codes if the '#[error]' attribute is added to them. + +error[E04035]: invalid constant usage in error context + ┌─ tests/move_check/typing/invalid_assertion_const.move:9:24 + │ +2 │ const X: vector = b"X"; + │ - 'X' defined here with no '#[error]' annotation + · +9 │ assert!(false, X); + │ ^ Invalid error code for assertion, expected a u64 or constant declared with '#[error]' annotation + │ + = Non-u64 constants can only be used as error codes if the '#[error]' attribute is added to them. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/large_binop.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/large_binop.snap new file mode 100644 index 0000000000000..ad48450b353f5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/large_binop.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/large_binop.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/large_binop_2.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/large_binop_2.snap new file mode 100644 index 0000000000000..b6cf5da84a026 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/large_binop_2.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/large_binop_2.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_body.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_body.snap new file mode 100644 index 0000000000000..2252bbbd37ab1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_body.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/loop_body.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_body_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_body_invalid.exp deleted file mode 100644 index cc49fce663209..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_body_invalid.exp +++ /dev/null @@ -1,50 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/loop_body_invalid.move:3:14 - │ -3 │ loop 0 - │ ^ - │ │ - │ Invalid loop body - │ Expected: '()' - │ Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/loop_body_invalid.move:7:14 - │ -7 │ loop false - │ ^^^^^ - │ │ - │ Invalid loop body - │ Expected: '()' - │ Given: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/loop_body_invalid.move:11:14 - │ -11 │ loop { @0x0 } - │ ^^^^^^^^ - │ │ │ - │ │ Given: 'address' - │ Invalid loop body - │ Expected: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/loop_body_invalid.move:15:14 - │ -15 │ loop { let x = 0; x } - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: integer - │ Invalid loop body - │ Expected: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/loop_body_invalid.move:19:14 - │ -19 │ loop { if (true) 1 else 0 } - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: integer - │ Invalid loop body - │ Expected: '()' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_body_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_body_invalid.snap new file mode 100644 index 0000000000000..6bcded918f94a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_body_invalid.snap @@ -0,0 +1,57 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/loop_body_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/loop_body_invalid.move:3:14 + │ +3 │ loop 0 + │ ^ + │ │ + │ Invalid loop body + │ Expected: '()' + │ Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/loop_body_invalid.move:7:14 + │ +7 │ loop false + │ ^^^^^ + │ │ + │ Invalid loop body + │ Expected: '()' + │ Given: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/loop_body_invalid.move:11:14 + │ +11 │ loop { @0x0 } + │ ^^^^^^^^ + │ │ │ + │ │ Given: 'address' + │ Invalid loop body + │ Expected: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/loop_body_invalid.move:15:14 + │ +15 │ loop { let x = 0; x } + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: integer + │ Invalid loop body + │ Expected: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/loop_body_invalid.move:19:14 + │ +19 │ loop { if (true) 1 else 0 } + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: integer + │ Invalid loop body + │ Expected: '()' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_result_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_result_type.exp deleted file mode 100644 index 7fe2ea3838898..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_result_type.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/typing/loop_result_type.move:19:13 - │ -19 │ foo(loop {}) - │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/typing/loop_result_type.move:25:23 - │ -25 │ let x: X::R = loop { 0; }; - │ ^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_result_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_result_type.snap new file mode 100644 index 0000000000000..049fe942fe264 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_result_type.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/loop_result_type.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/typing/loop_result_type.move:19:13 + │ +19 │ foo(loop {}) + │ ^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/typing/loop_result_type.move:25:23 + │ +25 │ let x: X::R = loop { 0; }; + │ ^^^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_result_type_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_result_type_invalid.exp deleted file mode 100644 index 59fdff00be711..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_result_type_invalid.exp +++ /dev/null @@ -1,51 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/loop_result_type_invalid.move:11:9 - │ -10 │ fun t0(): X::R { - │ ---- Expected: '0x2::X::R' -11 │ loop { if (false) break } - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: '()' - │ Invalid return expression - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/loop_result_type_invalid.move:15:9 - │ -14 │ fun t1(): u64 { - │ --- Expected: 'u64' -15 │ loop { let _x = 0; break } - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: '()' - │ Invalid return expression - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/loop_result_type_invalid.move:19:9 - │ -19 │ foo(loop { break }) - │ ^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: '()' - │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' - · -22 │ fun foo(_: u64) {} - │ --- Expected: 'u64' - -error[E04005]: expected a single type - ┌─ tests/move_check/typing/loop_result_type_invalid.move:25:13 - │ -25 │ let _x = loop { break }; - │ ^^ ----- Expected a single type, but found expression list type: '()' - │ │ - │ Invalid type for local - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/loop_result_type_invalid.move:26:13 - │ -26 │ let (_x, _y) = loop { if (false) break }; - │ ^^^^^^^^ ----- Given: '()' - │ │ - │ Invalid value for binding - │ Expected: '(_, _)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_result_type_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_result_type_invalid.snap new file mode 100644 index 0000000000000..9430e7e4a9c4b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/loop_result_type_invalid.snap @@ -0,0 +1,58 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/loop_result_type_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/loop_result_type_invalid.move:11:9 + │ +10 │ fun t0(): X::R { + │ ---- Expected: '0x2::X::R' +11 │ loop { if (false) break } + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: '()' + │ Invalid return expression + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/loop_result_type_invalid.move:15:9 + │ +14 │ fun t1(): u64 { + │ --- Expected: 'u64' +15 │ loop { let _x = 0; break } + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: '()' + │ Invalid return expression + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/loop_result_type_invalid.move:19:9 + │ +19 │ foo(loop { break }) + │ ^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: '()' + │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' + · +22 │ fun foo(_: u64) {} + │ --- Expected: 'u64' + +error[E04005]: expected a single type + ┌─ tests/move_check/typing/loop_result_type_invalid.move:25:13 + │ +25 │ let _x = loop { break }; + │ ^^ ----- Expected a single type, but found expression list type: '()' + │ │ + │ Invalid type for local + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/loop_result_type_invalid.move:26:13 + │ +26 │ let (_x, _y) = loop { if (false) break }; + │ ^^^^^^^^ ----- Given: '()' + │ │ + │ Invalid value for binding + │ Expected: '(_, _)' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call.exp deleted file mode 100644 index 0273c5bba3bc9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call.exp +++ /dev/null @@ -1,276 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call.move:43:18 - │ - 8 │ public fun baz(a: T1, x: T2): (bool, T1, T2) { - │ -------------- Given: '(bool, (address, u64), _)' - · -11 │ public fun bing(_: bool, _: address, _: u64) { - │ ---- Expected: 'bool' - · -43 │ let () = X::bing(X::baz(X::bar(X::foo()))); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid call of '0x2::X::bing'. Invalid argument for parameter '_' - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call.move:43:18 - │ -43 │ let () = X::bing(X::baz(X::bar(X::foo()))); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x2::X::bing'. The call expected 3 argument(s) but got 1 - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/module_call.move:43:26 - │ - 5 │ public fun bar(x: u64): (address, u64) { - │ -------------- Expected a single non-reference type, but found: '(address, u64)' - · -43 │ let () = X::bing(X::baz(X::bar(X::foo()))); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ Invalid type argument - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call.move:43:26 - │ -43 │ let () = X::bing(X::baz(X::bar(X::foo()))); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x2::X::baz'. The call expected 2 argument(s) but got 1 - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call.move:44:18 - │ - 8 │ public fun baz(a: T1, x: T2): (bool, T1, T2) { - │ -------------- Given: '(bool, (address, u64), _)' - · -11 │ public fun bing(_: bool, _: address, _: u64) { - │ ---- Expected: 'bool' - · -44 │ let () = X::bing (X::baz (X::bar (X::foo()))); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid call of '0x2::X::bing'. Invalid argument for parameter '_' - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call.move:44:18 - │ -44 │ let () = X::bing (X::baz (X::bar (X::foo()))); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x2::X::bing'. The call expected 3 argument(s) but got 1 - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/module_call.move:44:27 - │ - 5 │ public fun bar(x: u64): (address, u64) { - │ -------------- Expected a single non-reference type, but found: '(address, u64)' - · -44 │ let () = X::bing (X::baz (X::bar (X::foo()))); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid type argument - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call.move:44:27 - │ -44 │ let () = X::bing (X::baz (X::bar (X::foo()))); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x2::X::baz'. The call expected 2 argument(s) but got 1 - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call.move:45:18 - │ - 8 │ public fun baz(a: T1, x: T2): (bool, T1, T2) { - │ -------------- Given: '(bool, (address, u64), _)' - · -11 │ public fun bing(_: bool, _: address, _: u64) { - │ ---- Expected: 'bool' - · -45 │ let () = X::bing (X::baz (X::bar(1))); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid call of '0x2::X::bing'. Invalid argument for parameter '_' - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call.move:45:18 - │ -45 │ let () = X::bing (X::baz (X::bar(1))); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x2::X::bing'. The call expected 3 argument(s) but got 1 - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/module_call.move:45:27 - │ - 5 │ public fun bar(x: u64): (address, u64) { - │ -------------- Expected a single non-reference type, but found: '(address, u64)' - · -45 │ let () = X::bing (X::baz (X::bar(1))); - │ ^^^^^^^^^^^^^^^^^^ Invalid type argument - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call.move:45:27 - │ -45 │ let () = X::bing (X::baz (X::bar(1))); - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x2::X::baz'. The call expected 2 argument(s) but got 1 - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call.move:46:18 - │ - 8 │ public fun baz(a: T1, x: T2): (bool, T1, T2) { - │ -------------- Given: '(bool, address, {integer})' - · -11 │ public fun bing(_: bool, _: address, _: u64) { - │ ---- Expected: 'bool' - · -46 │ let () = X::bing (X::baz (@0x0, 1)); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid call of '0x2::X::bing'. Invalid argument for parameter '_' - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call.move:46:18 - │ -46 │ let () = X::bing (X::baz (@0x0, 1)); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x2::X::bing'. The call expected 3 argument(s) but got 1 - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call.move:51:18 - │ -22 │ fun baz(a: T1, x: T2): (bool, T1, T2) { - │ -------------- Given: '(bool, (address, u64), _)' - · -25 │ fun bing(_: bool, _: address, _: u64) { - │ ---- Expected: 'bool' - · -51 │ let () = bing(baz(bar(foo()))); - │ ^^^^^^^^^^^^^^^^^^^^^ Invalid call of '0x2::M::bing'. Invalid argument for parameter '_' - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call.move:51:18 - │ -51 │ let () = bing(baz(bar(foo()))); - │ ^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x2::M::bing'. The call expected 3 argument(s) but got 1 - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/module_call.move:51:23 - │ -19 │ fun bar(x: u64): (address, u64) { - │ -------------- Expected a single non-reference type, but found: '(address, u64)' - · -51 │ let () = bing(baz(bar(foo()))); - │ ^^^^^^^^^^^^^^^ Invalid type argument - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call.move:51:23 - │ -51 │ let () = bing(baz(bar(foo()))); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x2::M::baz'. The call expected 2 argument(s) but got 1 - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call.move:52:18 - │ -22 │ fun baz(a: T1, x: T2): (bool, T1, T2) { - │ -------------- Given: '(bool, (address, u64), _)' - · -25 │ fun bing(_: bool, _: address, _: u64) { - │ ---- Expected: 'bool' - · -52 │ let () = bing (baz (bar (foo()))); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ Invalid call of '0x2::M::bing'. Invalid argument for parameter '_' - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call.move:52:18 - │ -52 │ let () = bing (baz (bar (foo()))); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x2::M::bing'. The call expected 3 argument(s) but got 1 - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/module_call.move:52:24 - │ -19 │ fun bar(x: u64): (address, u64) { - │ -------------- Expected a single non-reference type, but found: '(address, u64)' - · -52 │ let () = bing (baz (bar (foo()))); - │ ^^^^^^^^^^^^^^^^^ Invalid type argument - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call.move:52:24 - │ -52 │ let () = bing (baz (bar (foo()))); - │ ^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x2::M::baz'. The call expected 2 argument(s) but got 1 - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call.move:53:18 - │ -22 │ fun baz(a: T1, x: T2): (bool, T1, T2) { - │ -------------- Given: '(bool, (address, u64), _)' - · -25 │ fun bing(_: bool, _: address, _: u64) { - │ ---- Expected: 'bool' - · -53 │ let () = bing (baz (bar(1))); - │ ^^^^^^^^^^^^^^^^^^^ Invalid call of '0x2::M::bing'. Invalid argument for parameter '_' - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call.move:53:18 - │ -53 │ let () = bing (baz (bar(1))); - │ ^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x2::M::bing'. The call expected 3 argument(s) but got 1 - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/module_call.move:53:24 - │ -19 │ fun bar(x: u64): (address, u64) { - │ -------------- Expected a single non-reference type, but found: '(address, u64)' - · -53 │ let () = bing (baz (bar(1))); - │ ^^^^^^^^^^^^ Invalid type argument - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call.move:53:24 - │ -53 │ let () = bing (baz (bar(1))); - │ ^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x2::M::baz'. The call expected 2 argument(s) but got 1 - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call.move:54:18 - │ -22 │ fun baz(a: T1, x: T2): (bool, T1, T2) { - │ -------------- Given: '(bool, address, {integer})' - · -25 │ fun bing(_: bool, _: address, _: u64) { - │ ---- Expected: 'bool' - · -54 │ let () = bing (baz (@0x0, 1)); - │ ^^^^^^^^^^^^^^^^^^^^ Invalid call of '0x2::M::bing'. Invalid argument for parameter '_' - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call.move:54:18 - │ -54 │ let () = bing (baz (@0x0, 1)); - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x2::M::bing'. The call expected 3 argument(s) but got 1 - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call.snap new file mode 100644 index 0000000000000..785c9db0a392c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call.snap @@ -0,0 +1,283 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/module_call.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call.move:43:18 + │ + 8 │ public fun baz(a: T1, x: T2): (bool, T1, T2) { + │ -------------- Given: '(bool, (address, u64), _)' + · +11 │ public fun bing(_: bool, _: address, _: u64) { + │ ---- Expected: 'bool' + · +43 │ let () = X::bing(X::baz(X::bar(X::foo()))); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid call of '0x2::X::bing'. Invalid argument for parameter '_' + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call.move:43:18 + │ +43 │ let () = X::bing(X::baz(X::bar(X::foo()))); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x2::X::bing'. The call expected 3 argument(s) but got 1 + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/module_call.move:43:26 + │ + 5 │ public fun bar(x: u64): (address, u64) { + │ -------------- Expected a single non-reference type, but found: '(address, u64)' + · +43 │ let () = X::bing(X::baz(X::bar(X::foo()))); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ Invalid type argument + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call.move:43:26 + │ +43 │ let () = X::bing(X::baz(X::bar(X::foo()))); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x2::X::baz'. The call expected 2 argument(s) but got 1 + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call.move:44:18 + │ + 8 │ public fun baz(a: T1, x: T2): (bool, T1, T2) { + │ -------------- Given: '(bool, (address, u64), _)' + · +11 │ public fun bing(_: bool, _: address, _: u64) { + │ ---- Expected: 'bool' + · +44 │ let () = X::bing (X::baz (X::bar (X::foo()))); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid call of '0x2::X::bing'. Invalid argument for parameter '_' + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call.move:44:18 + │ +44 │ let () = X::bing (X::baz (X::bar (X::foo()))); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x2::X::bing'. The call expected 3 argument(s) but got 1 + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/module_call.move:44:27 + │ + 5 │ public fun bar(x: u64): (address, u64) { + │ -------------- Expected a single non-reference type, but found: '(address, u64)' + · +44 │ let () = X::bing (X::baz (X::bar (X::foo()))); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid type argument + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call.move:44:27 + │ +44 │ let () = X::bing (X::baz (X::bar (X::foo()))); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x2::X::baz'. The call expected 2 argument(s) but got 1 + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call.move:45:18 + │ + 8 │ public fun baz(a: T1, x: T2): (bool, T1, T2) { + │ -------------- Given: '(bool, (address, u64), _)' + · +11 │ public fun bing(_: bool, _: address, _: u64) { + │ ---- Expected: 'bool' + · +45 │ let () = X::bing (X::baz (X::bar(1))); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid call of '0x2::X::bing'. Invalid argument for parameter '_' + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call.move:45:18 + │ +45 │ let () = X::bing (X::baz (X::bar(1))); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x2::X::bing'. The call expected 3 argument(s) but got 1 + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/module_call.move:45:27 + │ + 5 │ public fun bar(x: u64): (address, u64) { + │ -------------- Expected a single non-reference type, but found: '(address, u64)' + · +45 │ let () = X::bing (X::baz (X::bar(1))); + │ ^^^^^^^^^^^^^^^^^^ Invalid type argument + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call.move:45:27 + │ +45 │ let () = X::bing (X::baz (X::bar(1))); + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x2::X::baz'. The call expected 2 argument(s) but got 1 + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call.move:46:18 + │ + 8 │ public fun baz(a: T1, x: T2): (bool, T1, T2) { + │ -------------- Given: '(bool, address, {integer})' + · +11 │ public fun bing(_: bool, _: address, _: u64) { + │ ---- Expected: 'bool' + · +46 │ let () = X::bing (X::baz (@0x0, 1)); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid call of '0x2::X::bing'. Invalid argument for parameter '_' + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call.move:46:18 + │ +46 │ let () = X::bing (X::baz (@0x0, 1)); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x2::X::bing'. The call expected 3 argument(s) but got 1 + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call.move:51:18 + │ +22 │ fun baz(a: T1, x: T2): (bool, T1, T2) { + │ -------------- Given: '(bool, (address, u64), _)' + · +25 │ fun bing(_: bool, _: address, _: u64) { + │ ---- Expected: 'bool' + · +51 │ let () = bing(baz(bar(foo()))); + │ ^^^^^^^^^^^^^^^^^^^^^ Invalid call of '0x2::M::bing'. Invalid argument for parameter '_' + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call.move:51:18 + │ +51 │ let () = bing(baz(bar(foo()))); + │ ^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x2::M::bing'. The call expected 3 argument(s) but got 1 + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/module_call.move:51:23 + │ +19 │ fun bar(x: u64): (address, u64) { + │ -------------- Expected a single non-reference type, but found: '(address, u64)' + · +51 │ let () = bing(baz(bar(foo()))); + │ ^^^^^^^^^^^^^^^ Invalid type argument + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call.move:51:23 + │ +51 │ let () = bing(baz(bar(foo()))); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x2::M::baz'. The call expected 2 argument(s) but got 1 + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call.move:52:18 + │ +22 │ fun baz(a: T1, x: T2): (bool, T1, T2) { + │ -------------- Given: '(bool, (address, u64), _)' + · +25 │ fun bing(_: bool, _: address, _: u64) { + │ ---- Expected: 'bool' + · +52 │ let () = bing (baz (bar (foo()))); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ Invalid call of '0x2::M::bing'. Invalid argument for parameter '_' + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call.move:52:18 + │ +52 │ let () = bing (baz (bar (foo()))); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x2::M::bing'. The call expected 3 argument(s) but got 1 + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/module_call.move:52:24 + │ +19 │ fun bar(x: u64): (address, u64) { + │ -------------- Expected a single non-reference type, but found: '(address, u64)' + · +52 │ let () = bing (baz (bar (foo()))); + │ ^^^^^^^^^^^^^^^^^ Invalid type argument + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call.move:52:24 + │ +52 │ let () = bing (baz (bar (foo()))); + │ ^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x2::M::baz'. The call expected 2 argument(s) but got 1 + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call.move:53:18 + │ +22 │ fun baz(a: T1, x: T2): (bool, T1, T2) { + │ -------------- Given: '(bool, (address, u64), _)' + · +25 │ fun bing(_: bool, _: address, _: u64) { + │ ---- Expected: 'bool' + · +53 │ let () = bing (baz (bar(1))); + │ ^^^^^^^^^^^^^^^^^^^ Invalid call of '0x2::M::bing'. Invalid argument for parameter '_' + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call.move:53:18 + │ +53 │ let () = bing (baz (bar(1))); + │ ^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x2::M::bing'. The call expected 3 argument(s) but got 1 + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/module_call.move:53:24 + │ +19 │ fun bar(x: u64): (address, u64) { + │ -------------- Expected a single non-reference type, but found: '(address, u64)' + · +53 │ let () = bing (baz (bar(1))); + │ ^^^^^^^^^^^^ Invalid type argument + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call.move:53:24 + │ +53 │ let () = bing (baz (bar(1))); + │ ^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x2::M::baz'. The call expected 2 argument(s) but got 1 + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call.move:54:18 + │ +22 │ fun baz(a: T1, x: T2): (bool, T1, T2) { + │ -------------- Given: '(bool, address, {integer})' + · +25 │ fun bing(_: bool, _: address, _: u64) { + │ ---- Expected: 'bool' + · +54 │ let () = bing (baz (@0x0, 1)); + │ ^^^^^^^^^^^^^^^^^^^^ Invalid call of '0x2::M::bing'. Invalid argument for parameter '_' + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call.move:54:18 + │ +54 │ let () = bing (baz (@0x0, 1)); + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x2::M::bing'. The call expected 3 argument(s) but got 1 diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_complicated_rhs.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_complicated_rhs.exp deleted file mode 100644 index 08a96618350f7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_complicated_rhs.exp +++ /dev/null @@ -1,162 +0,0 @@ -error[E04017]: too many arguments - ┌─ tests/move_check/typing/module_call_complicated_rhs.move:11:9 - │ -11 │ foo (if (cond) () else ()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x8675309::M::foo'. The call expected 0 argument(s) but got 1 - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/module_call_complicated_rhs.move:13:9 - │ -13 │ baz (if (cond) (false, @0x0) else (true, @0x1)); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '(bool, address)' - │ Invalid type argument - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call_complicated_rhs.move:13:9 - │ -13 │ baz (if (cond) (false, @0x0) else (true, @0x1)); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x8675309::M::baz'. The call expected 2 argument(s) but got 1 - -error[E04017]: too many arguments - ┌─ tests/move_check/typing/module_call_complicated_rhs.move:17:9 - │ -17 │ foo(if (cond) () else ()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x8675309::M::foo'. The call expected 0 argument(s) but got 1 - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/module_call_complicated_rhs.move:19:9 - │ -19 │ baz(if (cond) (false, @0x0) else (true, @0x1)); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '(bool, address)' - │ Invalid type argument - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call_complicated_rhs.move:19:9 - │ -19 │ baz(if (cond) (false, @0x0) else (true, @0x1)); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x8675309::M::baz'. The call expected 2 argument(s) but got 1 - -error[E04017]: too many arguments - ┌─ tests/move_check/typing/module_call_complicated_rhs.move:23:9 - │ -23 │ foo({}); - │ ^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x8675309::M::foo'. The call expected 0 argument(s) but got 1 - -error[E04017]: too many arguments - ┌─ tests/move_check/typing/module_call_complicated_rhs.move:24:9 - │ -24 │ foo({ let _x = 0; }); - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x8675309::M::foo'. The call expected 0 argument(s) but got 1 - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/module_call_complicated_rhs.move:31:9 - │ -31 │ baz({ (a, x) }); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '(address, u64)' - │ Invalid type argument - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call_complicated_rhs.move:31:9 - │ -31 │ baz({ (a, x) }); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x8675309::M::baz'. The call expected 2 argument(s) but got 1 - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/module_call_complicated_rhs.move:32:9 - │ -32 │ baz({ let a = false; (a, x) }); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '(bool, u64)' - │ Invalid type argument - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call_complicated_rhs.move:32:9 - │ -32 │ baz({ let a = false; (a, x) }); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x8675309::M::baz'. The call expected 2 argument(s) but got 1 - -error[E04017]: too many arguments - ┌─ tests/move_check/typing/module_call_complicated_rhs.move:36:9 - │ -36 │ foo({}); - │ ^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x8675309::M::foo'. The call expected 0 argument(s) but got 1 - -error[E04017]: too many arguments - ┌─ tests/move_check/typing/module_call_complicated_rhs.move:37:9 - │ -37 │ foo({ let _x = 0; }); - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x8675309::M::foo'. The call expected 0 argument(s) but got 1 - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/module_call_complicated_rhs.move:44:9 - │ -44 │ baz({ (a, x) }); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '(address, u64)' - │ Invalid type argument - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call_complicated_rhs.move:44:9 - │ -44 │ baz({ (a, x) }); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x8675309::M::baz'. The call expected 2 argument(s) but got 1 - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/module_call_complicated_rhs.move:45:9 - │ -45 │ baz({ let a = false; (a, x) }); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '(bool, u64)' - │ Invalid type argument - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call_complicated_rhs.move:45:9 - │ -45 │ baz({ let a = false; (a, x) }); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x8675309::M::baz'. The call expected 2 argument(s) but got 1 - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_complicated_rhs.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_complicated_rhs.snap new file mode 100644 index 0000000000000..4b21f5984a3a7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_complicated_rhs.snap @@ -0,0 +1,169 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/module_call_complicated_rhs.move +--- +error[E04017]: too many arguments + ┌─ tests/move_check/typing/module_call_complicated_rhs.move:11:9 + │ +11 │ foo (if (cond) () else ()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x8675309::M::foo'. The call expected 0 argument(s) but got 1 + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/module_call_complicated_rhs.move:13:9 + │ +13 │ baz (if (cond) (false, @0x0) else (true, @0x1)); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '(bool, address)' + │ Invalid type argument + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call_complicated_rhs.move:13:9 + │ +13 │ baz (if (cond) (false, @0x0) else (true, @0x1)); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x8675309::M::baz'. The call expected 2 argument(s) but got 1 + +error[E04017]: too many arguments + ┌─ tests/move_check/typing/module_call_complicated_rhs.move:17:9 + │ +17 │ foo(if (cond) () else ()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x8675309::M::foo'. The call expected 0 argument(s) but got 1 + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/module_call_complicated_rhs.move:19:9 + │ +19 │ baz(if (cond) (false, @0x0) else (true, @0x1)); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '(bool, address)' + │ Invalid type argument + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call_complicated_rhs.move:19:9 + │ +19 │ baz(if (cond) (false, @0x0) else (true, @0x1)); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x8675309::M::baz'. The call expected 2 argument(s) but got 1 + +error[E04017]: too many arguments + ┌─ tests/move_check/typing/module_call_complicated_rhs.move:23:9 + │ +23 │ foo({}); + │ ^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x8675309::M::foo'. The call expected 0 argument(s) but got 1 + +error[E04017]: too many arguments + ┌─ tests/move_check/typing/module_call_complicated_rhs.move:24:9 + │ +24 │ foo({ let _x = 0; }); + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x8675309::M::foo'. The call expected 0 argument(s) but got 1 + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/module_call_complicated_rhs.move:31:9 + │ +31 │ baz({ (a, x) }); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '(address, u64)' + │ Invalid type argument + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call_complicated_rhs.move:31:9 + │ +31 │ baz({ (a, x) }); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x8675309::M::baz'. The call expected 2 argument(s) but got 1 + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/module_call_complicated_rhs.move:32:9 + │ +32 │ baz({ let a = false; (a, x) }); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '(bool, u64)' + │ Invalid type argument + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call_complicated_rhs.move:32:9 + │ +32 │ baz({ let a = false; (a, x) }); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x8675309::M::baz'. The call expected 2 argument(s) but got 1 + +error[E04017]: too many arguments + ┌─ tests/move_check/typing/module_call_complicated_rhs.move:36:9 + │ +36 │ foo({}); + │ ^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x8675309::M::foo'. The call expected 0 argument(s) but got 1 + +error[E04017]: too many arguments + ┌─ tests/move_check/typing/module_call_complicated_rhs.move:37:9 + │ +37 │ foo({ let _x = 0; }); + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x8675309::M::foo'. The call expected 0 argument(s) but got 1 + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/module_call_complicated_rhs.move:44:9 + │ +44 │ baz({ (a, x) }); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '(address, u64)' + │ Invalid type argument + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call_complicated_rhs.move:44:9 + │ +44 │ baz({ (a, x) }); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x8675309::M::baz'. The call expected 2 argument(s) but got 1 + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/module_call_complicated_rhs.move:45:9 + │ +45 │ baz({ let a = false; (a, x) }); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '(bool, u64)' + │ Invalid type argument + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call_complicated_rhs.move:45:9 + │ +45 │ baz({ let a = false; (a, x) }); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x8675309::M::baz'. The call expected 2 argument(s) but got 1 diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_constraints_not_satisfied.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_constraints_not_satisfied.exp deleted file mode 100644 index 7f418acac1e51..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_constraints_not_satisfied.exp +++ /dev/null @@ -1,312 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:28:9 - │ - 3 │ struct Coin has key {} - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - · -15 │ fun both(_r: R, _c: C) { - │ ---- 'copy' constraint declared here - · -28 │ both(S{}, Coin{}); - │ ^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Coin' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:28:9 - │ - 2 │ struct S has copy, drop {} - │ - To satisfy the constraint, the 'key' ability would need to be added here - · -15 │ fun both(_r: R, _c: C) { - │ --- 'key' constraint declared here - · -28 │ both(S{}, Coin{}); - │ ^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::S' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:29:9 - │ - 3 │ struct Coin has key {} - │ ---- To satisfy the constraint, the 'copy' ability would need to be added here - · -15 │ fun both(_r: R, _c: C) { - │ ---- 'copy' constraint declared here - · -29 │ both(0, Coin{}) - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Coin' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:29:9 - │ -15 │ fun both(_r: R, _c: C) { - │ --- 'key' constraint declared here - · -29 │ both(0, Coin{}) - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type 'u64' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:33:9 - │ - 7 │ fun new_box(): Box { - │ ------ The type '0x8675309::M::Box' does not have the ability 'copy' - · -15 │ fun both(_r: R, _c: C) { - │ ---- 'copy' constraint declared here - · -33 │ both(new_box(), new_box()) - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Box' can have the ability 'copy' but the type argument 'R' does not have the required ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:33:9 - │ - 4 │ struct Box has copy, drop { f: T } - │ --- To satisfy the constraint, the 'key' ability would need to be added here - · - 7 │ fun new_box(): Box { - │ ------ The type '0x8675309::M::Box' does not have the ability 'key' - · -15 │ fun both(_r: R, _c: C) { - │ --- 'key' constraint declared here - · -33 │ both(new_box(), new_box()) - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:37:9 - │ - 5 │ struct Box3 has copy, drop { f1: T1, f2: T2, f3: T3 } - │ ---- To satisfy the constraint, the 'key' ability would need to be added here - · -11 │ fun new_box3(): Box3 { - │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'key' - · -23 │ fun rsrc(_r: R) { - │ --- 'key' constraint declared here - · -37 │ rsrc(new_box3()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:39:9 - │ -11 │ fun new_box3(): Box3 { - │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' - · -19 │ fun cpy(_c: C) { - │ ---- 'copy' constraint declared here - · -39 │ cpy(new_box3()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'R' does not have the required ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:40:9 - │ -11 │ fun new_box3(): Box3 { - │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' - · -19 │ fun cpy(_c: C) { - │ ---- 'copy' constraint declared here - · -40 │ cpy(new_box3()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'C' does not have the required ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:41:9 - │ -11 │ fun new_box3(): Box3 { - │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' - · -19 │ fun cpy(_c: C) { - │ ---- 'copy' constraint declared here - · -41 │ cpy(new_box3()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'C' does not have the required ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:43:9 - │ -11 │ fun new_box3(): Box3 { - │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' - · -19 │ fun cpy(_c: C) { - │ ---- 'copy' constraint declared here - · -43 │ cpy(new_box3()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'C' does not have the required ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:44:9 - │ -11 │ fun new_box3(): Box3 { - │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' - · -19 │ fun cpy(_c: C) { - │ ---- 'copy' constraint declared here - · -44 │ cpy(new_box3()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'R' does not have the required ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:45:9 - │ -11 │ fun new_box3(): Box3 { - │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' - · -19 │ fun cpy(_c: C) { - │ ---- 'copy' constraint declared here - · -45 │ cpy(new_box3()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'R' does not have the required ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:47:9 - │ -11 │ fun new_box3(): Box3 { - │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' - · -19 │ fun cpy(_c: C) { - │ ---- 'copy' constraint declared here - · -47 │ cpy(new_box3()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'R' does not have the required ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:51:9 - │ -11 │ fun new_box3(): Box3 { - │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' - · -19 │ fun cpy(_c: C) { - │ ---- 'copy' constraint declared here - · -51 │ cpy(new_box3()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'U' does not have the required ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:52:9 - │ -11 │ fun new_box3(): Box3 { - │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' - · -19 │ fun cpy(_c: C) { - │ ---- 'copy' constraint declared here - · -52 │ cpy(new_box3()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'C' does not have the required ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:53:9 - │ -11 │ fun new_box3(): Box3 { - │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' - · -19 │ fun cpy(_c: C) { - │ ---- 'copy' constraint declared here - · -53 │ cpy(new_box3()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'C' does not have the required ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:55:9 - │ -11 │ fun new_box3(): Box3 { - │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' - · -19 │ fun cpy(_c: C) { - │ ---- 'copy' constraint declared here - · -55 │ cpy(new_box3()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'C' does not have the required ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:56:9 - │ -11 │ fun new_box3(): Box3 { - │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' - · -19 │ fun cpy(_c: C) { - │ ---- 'copy' constraint declared here - · -56 │ cpy(new_box3()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'U' does not have the required ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:57:9 - │ -11 │ fun new_box3(): Box3 { - │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' - · -19 │ fun cpy(_c: C) { - │ ---- 'copy' constraint declared here - · -57 │ cpy(new_box3()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'U' does not have the required ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:59:9 - │ -11 │ fun new_box3(): Box3 { - │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' - · -19 │ fun cpy(_c: C) { - │ ---- 'copy' constraint declared here - · -59 │ cpy(new_box3()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'U' does not have the required ability 'copy' - │ 'copy' constraint not satisifed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_constraints_not_satisfied.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_constraints_not_satisfied.snap new file mode 100644 index 0000000000000..99099a9584c24 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_constraints_not_satisfied.snap @@ -0,0 +1,319 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/module_call_constraints_not_satisfied.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:28:9 + │ + 3 │ struct Coin has key {} + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + · +15 │ fun both(_r: R, _c: C) { + │ ---- 'copy' constraint declared here + · +28 │ both(S{}, Coin{}); + │ ^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Coin' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:28:9 + │ + 2 │ struct S has copy, drop {} + │ - To satisfy the constraint, the 'key' ability would need to be added here + · +15 │ fun both(_r: R, _c: C) { + │ --- 'key' constraint declared here + · +28 │ both(S{}, Coin{}); + │ ^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::S' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:29:9 + │ + 3 │ struct Coin has key {} + │ ---- To satisfy the constraint, the 'copy' ability would need to be added here + · +15 │ fun both(_r: R, _c: C) { + │ ---- 'copy' constraint declared here + · +29 │ both(0, Coin{}) + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Coin' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:29:9 + │ +15 │ fun both(_r: R, _c: C) { + │ --- 'key' constraint declared here + · +29 │ both(0, Coin{}) + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type 'u64' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:33:9 + │ + 7 │ fun new_box(): Box { + │ ------ The type '0x8675309::M::Box' does not have the ability 'copy' + · +15 │ fun both(_r: R, _c: C) { + │ ---- 'copy' constraint declared here + · +33 │ both(new_box(), new_box()) + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Box' can have the ability 'copy' but the type argument 'R' does not have the required ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:33:9 + │ + 4 │ struct Box has copy, drop { f: T } + │ --- To satisfy the constraint, the 'key' ability would need to be added here + · + 7 │ fun new_box(): Box { + │ ------ The type '0x8675309::M::Box' does not have the ability 'key' + · +15 │ fun both(_r: R, _c: C) { + │ --- 'key' constraint declared here + · +33 │ both(new_box(), new_box()) + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:37:9 + │ + 5 │ struct Box3 has copy, drop { f1: T1, f2: T2, f3: T3 } + │ ---- To satisfy the constraint, the 'key' ability would need to be added here + · +11 │ fun new_box3(): Box3 { + │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'key' + · +23 │ fun rsrc(_r: R) { + │ --- 'key' constraint declared here + · +37 │ rsrc(new_box3()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:39:9 + │ +11 │ fun new_box3(): Box3 { + │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' + · +19 │ fun cpy(_c: C) { + │ ---- 'copy' constraint declared here + · +39 │ cpy(new_box3()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'R' does not have the required ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:40:9 + │ +11 │ fun new_box3(): Box3 { + │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' + · +19 │ fun cpy(_c: C) { + │ ---- 'copy' constraint declared here + · +40 │ cpy(new_box3()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'C' does not have the required ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:41:9 + │ +11 │ fun new_box3(): Box3 { + │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' + · +19 │ fun cpy(_c: C) { + │ ---- 'copy' constraint declared here + · +41 │ cpy(new_box3()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'C' does not have the required ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:43:9 + │ +11 │ fun new_box3(): Box3 { + │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' + · +19 │ fun cpy(_c: C) { + │ ---- 'copy' constraint declared here + · +43 │ cpy(new_box3()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'C' does not have the required ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:44:9 + │ +11 │ fun new_box3(): Box3 { + │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' + · +19 │ fun cpy(_c: C) { + │ ---- 'copy' constraint declared here + · +44 │ cpy(new_box3()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'R' does not have the required ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:45:9 + │ +11 │ fun new_box3(): Box3 { + │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' + · +19 │ fun cpy(_c: C) { + │ ---- 'copy' constraint declared here + · +45 │ cpy(new_box3()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'R' does not have the required ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:47:9 + │ +11 │ fun new_box3(): Box3 { + │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' + · +19 │ fun cpy(_c: C) { + │ ---- 'copy' constraint declared here + · +47 │ cpy(new_box3()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'R' does not have the required ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:51:9 + │ +11 │ fun new_box3(): Box3 { + │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' + · +19 │ fun cpy(_c: C) { + │ ---- 'copy' constraint declared here + · +51 │ cpy(new_box3()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'U' does not have the required ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:52:9 + │ +11 │ fun new_box3(): Box3 { + │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' + · +19 │ fun cpy(_c: C) { + │ ---- 'copy' constraint declared here + · +52 │ cpy(new_box3()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'C' does not have the required ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:53:9 + │ +11 │ fun new_box3(): Box3 { + │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' + · +19 │ fun cpy(_c: C) { + │ ---- 'copy' constraint declared here + · +53 │ cpy(new_box3()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'C' does not have the required ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:55:9 + │ +11 │ fun new_box3(): Box3 { + │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' + · +19 │ fun cpy(_c: C) { + │ ---- 'copy' constraint declared here + · +55 │ cpy(new_box3()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'C' does not have the required ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:56:9 + │ +11 │ fun new_box3(): Box3 { + │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' + · +19 │ fun cpy(_c: C) { + │ ---- 'copy' constraint declared here + · +56 │ cpy(new_box3()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'U' does not have the required ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:57:9 + │ +11 │ fun new_box3(): Box3 { + │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' + · +19 │ fun cpy(_c: C) { + │ ---- 'copy' constraint declared here + · +57 │ cpy(new_box3()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'U' does not have the required ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/module_call_constraints_not_satisfied.move:59:9 + │ +11 │ fun new_box3(): Box3 { + │ ---------------- The type '0x8675309::M::Box3' does not have the ability 'copy' + · +19 │ fun cpy(_c: C) { + │ ---- 'copy' constraint declared here + · +59 │ cpy(new_box3()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Box3' can have the ability 'copy' but the type argument 'U' does not have the required ability 'copy' + │ 'copy' constraint not satisifed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_entry_function.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_entry_function.snap new file mode 100644 index 0000000000000..7be122f52a532 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_entry_function.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/module_call_entry_function.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_entry_function_was_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_entry_function_was_invalid.exp deleted file mode 100644 index 42da39882579a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_entry_function_was_invalid.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/module_call_entry_function_was_invalid.move:26:48 - │ - 8 │ fun f_private() {} - │ --------- This function is internal to its module. Only 'public' and 'public(friend)' functions can be called outside of their module - · -26 │ public entry fun f_script_call_private() { X::f_private() } - │ ^^^^^^^^^^^^^^ Invalid call to internal function '0x2::X::f_private' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_entry_function_was_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_entry_function_was_invalid.snap new file mode 100644 index 0000000000000..471703ad279a8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_entry_function_was_invalid.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/module_call_entry_function_was_invalid.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/module_call_entry_function_was_invalid.move:26:48 + │ + 8 │ fun f_private() {} + │ --------- This function is internal to its module. Only 'public' and 'public(friend)' functions can be called outside of their module + · +26 │ public entry fun f_script_call_private() { X::f_private() } + │ ^^^^^^^^^^^^^^ Invalid call to internal function '0x2::X::f_private' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_explicit_type_arguments.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_explicit_type_arguments.exp deleted file mode 100644 index f20d70f9c8b1c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_explicit_type_arguments.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/typing/module_call_explicit_type_arguments.move:2:33 - │ -2 │ fun foo(_x: T, _y: U) { - │ - -- - The type 'T' does not have the ability 'drop' - │ │ │ - │ │ The parameter '_x' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns - │ To satisfy the constraint, the 'drop' ability would need to be added here - │ ╭─────────────────────────────────^ -3 │ │ } - │ ╰─────^ Invalid return - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/typing/module_call_explicit_type_arguments.move:2:33 - │ -2 │ fun foo(_x: T, _y: U) { - │ - -- - The type 'U' does not have the ability 'drop' - │ │ │ - │ │ The parameter '_y' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns - │ To satisfy the constraint, the 'drop' ability would need to be added here - │ ╭─────────────────────────────────^ -3 │ │ } - │ ╰─────^ Invalid return - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_explicit_type_arguments.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_explicit_type_arguments.snap new file mode 100644 index 0000000000000..106bbfe9f7127 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_explicit_type_arguments.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/module_call_explicit_type_arguments.move +--- +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/typing/module_call_explicit_type_arguments.move:2:33 + │ +2 │ fun foo(_x: T, _y: U) { + │ - -- - The type 'T' does not have the ability 'drop' + │ │ │ + │ │ The parameter '_x' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns + │ To satisfy the constraint, the 'drop' ability would need to be added here + │ ╭─────────────────────────────────^ +3 │ │ } + │ ╰─────^ Invalid return + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/typing/module_call_explicit_type_arguments.move:2:33 + │ +2 │ fun foo(_x: T, _y: U) { + │ - -- - The type 'U' does not have the ability 'drop' + │ │ │ + │ │ The parameter '_y' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns + │ To satisfy the constraint, the 'drop' ability would need to be added here + │ ╭─────────────────────────────────^ +3 │ │ } + │ ╰─────^ Invalid return diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_explicit_type_arguments_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_explicit_type_arguments_invalid.exp deleted file mode 100644 index a628c3ea1892b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_explicit_type_arguments_invalid.exp +++ /dev/null @@ -1,95 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_explicit_type_arguments_invalid.move:6:9 - │ -6 │ foo(false, false); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Given: 'bool' - │ │ Expected: 'u64' - │ Invalid call of '0x8675309::M::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_explicit_type_arguments_invalid.move:6:9 - │ -6 │ foo(false, false); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Given: 'bool' - │ │ Expected: 'u64' - │ Invalid call of '0x8675309::M::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_explicit_type_arguments_invalid.move:7:9 - │ -7 │ foo(0, false); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Given: integer - │ │ Expected: 'bool' - │ Invalid call of '0x8675309::M::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_explicit_type_arguments_invalid.move:8:9 - │ -8 │ foo(false, 0); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Given: integer - │ │ Expected: 'bool' - │ Invalid call of '0x8675309::M::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_explicit_type_arguments_invalid.move:9:9 - │ -9 │ foo(0, 0); - │ ^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Given: integer - │ │ Expected: 'bool' - │ Invalid call of '0x8675309::M::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_explicit_type_arguments_invalid.move:9:9 - │ -9 │ foo(0, 0); - │ ^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Given: integer - │ │ Expected: 'bool' - │ Invalid call of '0x8675309::M::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_explicit_type_arguments_invalid.move:13:9 - │ -12 │ fun t2(t: T, u: U, v: V) { - │ - Given: 'T' -13 │ foo(t, 0); - │ ^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected: 'U' - │ Invalid call of '0x8675309::M::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_explicit_type_arguments_invalid.move:14:9 - │ -12 │ fun t2(t: T, u: U, v: V) { - │ - Given: 'U' -13 │ foo(t, 0); -14 │ foo(u, v); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected: 'V' - │ Invalid call of '0x8675309::M::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_explicit_type_arguments_invalid.move:14:9 - │ -12 │ fun t2(t: T, u: U, v: V) { - │ - Given: 'V' -13 │ foo(t, 0); -14 │ foo(u, v); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected: 'T' - │ Invalid call of '0x8675309::M::foo'. Invalid argument for parameter '_' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_explicit_type_arguments_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_explicit_type_arguments_invalid.snap new file mode 100644 index 0000000000000..25b03c5bc7275 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_explicit_type_arguments_invalid.snap @@ -0,0 +1,102 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/module_call_explicit_type_arguments_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_explicit_type_arguments_invalid.move:6:9 + │ +6 │ foo(false, false); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Given: 'bool' + │ │ Expected: 'u64' + │ Invalid call of '0x8675309::M::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_explicit_type_arguments_invalid.move:6:9 + │ +6 │ foo(false, false); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Given: 'bool' + │ │ Expected: 'u64' + │ Invalid call of '0x8675309::M::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_explicit_type_arguments_invalid.move:7:9 + │ +7 │ foo(0, false); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Given: integer + │ │ Expected: 'bool' + │ Invalid call of '0x8675309::M::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_explicit_type_arguments_invalid.move:8:9 + │ +8 │ foo(false, 0); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Given: integer + │ │ Expected: 'bool' + │ Invalid call of '0x8675309::M::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_explicit_type_arguments_invalid.move:9:9 + │ +9 │ foo(0, 0); + │ ^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Given: integer + │ │ Expected: 'bool' + │ Invalid call of '0x8675309::M::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_explicit_type_arguments_invalid.move:9:9 + │ +9 │ foo(0, 0); + │ ^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Given: integer + │ │ Expected: 'bool' + │ Invalid call of '0x8675309::M::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_explicit_type_arguments_invalid.move:13:9 + │ +12 │ fun t2(t: T, u: U, v: V) { + │ - Given: 'T' +13 │ foo(t, 0); + │ ^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected: 'U' + │ Invalid call of '0x8675309::M::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_explicit_type_arguments_invalid.move:14:9 + │ +12 │ fun t2(t: T, u: U, v: V) { + │ - Given: 'U' +13 │ foo(t, 0); +14 │ foo(u, v); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected: 'V' + │ Invalid call of '0x8675309::M::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_explicit_type_arguments_invalid.move:14:9 + │ +12 │ fun t2(t: T, u: U, v: V) { + │ - Given: 'V' +13 │ foo(t, 0); +14 │ foo(u, v); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected: 'T' + │ Invalid call of '0x8675309::M::foo'. Invalid argument for parameter '_' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_internal.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_internal.exp deleted file mode 100644 index 62e32704a5665..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_internal.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/module_call_internal.move:10:9 - │ - 4 │ fun foo() {} - │ --- This function is internal to its module. Only 'public' and 'public(friend)' functions can be called outside of their module - · -10 │ X::foo() - │ ^^^^^^^^ Invalid call to internal function '0x2::X::foo' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_internal.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_internal.snap new file mode 100644 index 0000000000000..9f0202e4376ae --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_internal.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/module_call_internal.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/module_call_internal.move:10:9 + │ + 4 │ fun foo() {} + │ --- This function is internal to its module. Only 'public' and 'public(friend)' functions can be called outside of their module + · +10 │ X::foo() + │ ^^^^^^^^ Invalid call to internal function '0x2::X::foo' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_missing_function.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_missing_function.exp deleted file mode 100644 index e67c0aacc55d7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_missing_function.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E03003]: unbound module member - ┌─ tests/move_check/typing/module_call_missing_function.move:13:9 - │ -13 │ Self::fooo(); - │ ^^^^^^^^^^ Unbound function 'fooo' in current scope - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/typing/module_call_missing_function.move:14:9 - │ -14 │ foooo(); - │ ^^^^^ Unbound function 'foooo' in current scope - -error[E03003]: unbound module member - ┌─ tests/move_check/typing/module_call_missing_function.move:15:9 - │ -15 │ X::foooooo(); - │ ^^^^^^^^^^ Invalid module access. Unbound function 'foooooo' in module '0x2::X' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_missing_function.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_missing_function.snap new file mode 100644 index 0000000000000..a469e9e6766e1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_missing_function.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/module_call_missing_function.move +--- +error[E03003]: unbound module member + ┌─ tests/move_check/typing/module_call_missing_function.move:13:9 + │ +13 │ Self::fooo(); + │ ^^^^^^^^^^ Unbound function 'fooo' in current scope + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/typing/module_call_missing_function.move:14:9 + │ +14 │ foooo(); + │ ^^^^^ Unbound function 'foooo' in current scope + +error[E03003]: unbound module member + ┌─ tests/move_check/typing/module_call_missing_function.move:15:9 + │ +15 │ X::foooooo(); + │ ^^^^^^^^^^ Invalid module access. Unbound function 'foooooo' in module '0x2::X' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_visibility_friend.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_visibility_friend.snap new file mode 100644 index 0000000000000..1447a1f5416f7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_visibility_friend.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/module_call_visibility_friend.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_visibility_friend_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_visibility_friend_invalid.exp deleted file mode 100644 index 8b79f193fd934..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_visibility_friend_invalid.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/module_call_visibility_friend_invalid.move:18:49 - │ - 5 │ public(friend) fun f_friend() {} - │ -------------- This function can only be called from a 'friend' of module '0x2::X' - · -18 │ public(friend) fun f_friend_call_friend() { X::f_friend() } - │ ^^^^^^^^^^^^^ Invalid call to 'public(friend)' visible function '0x2::X::f_friend' - -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/module_call_visibility_friend_invalid.move:22:52 - │ - 4 │ fun f_private() {} - │ --------- This function is internal to its module. Only 'public' and 'public(friend)' functions can be called outside of their module - · -22 │ public(friend) fun f_friend_call_private_1() { X::f_private() } - │ ^^^^^^^^^^^^^^ Invalid call to internal function '0x2::X::f_private' - -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/module_call_visibility_friend_invalid.move:23:52 - │ -10 │ fun f_private() {} - │ --------- This function is internal to its module. Only 'public' and 'public(friend)' functions can be called outside of their module - · -23 │ public(friend) fun f_friend_call_private_2() { Y::f_private() } - │ ^^^^^^^^^^^^^^ Invalid call to internal function '0x2::Y::f_private' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_visibility_friend_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_visibility_friend_invalid.snap new file mode 100644 index 0000000000000..e4aaabaf776a0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_visibility_friend_invalid.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/module_call_visibility_friend_invalid.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/module_call_visibility_friend_invalid.move:18:49 + │ + 5 │ public(friend) fun f_friend() {} + │ -------------- This function can only be called from a 'friend' of module '0x2::X' + · +18 │ public(friend) fun f_friend_call_friend() { X::f_friend() } + │ ^^^^^^^^^^^^^ Invalid call to 'public(friend)' visible function '0x2::X::f_friend' + +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/module_call_visibility_friend_invalid.move:22:52 + │ + 4 │ fun f_private() {} + │ --------- This function is internal to its module. Only 'public' and 'public(friend)' functions can be called outside of their module + · +22 │ public(friend) fun f_friend_call_private_1() { X::f_private() } + │ ^^^^^^^^^^^^^^ Invalid call to internal function '0x2::X::f_private' + +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/module_call_visibility_friend_invalid.move:23:52 + │ +10 │ fun f_private() {} + │ --------- This function is internal to its module. Only 'public' and 'public(friend)' functions can be called outside of their module + · +23 │ public(friend) fun f_friend_call_private_2() { Y::f_private() } + │ ^^^^^^^^^^^^^^ Invalid call to internal function '0x2::Y::f_private' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_wrong_argument_in_list.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_wrong_argument_in_list.exp deleted file mode 100644 index 5cd720d62b216..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_wrong_argument_in_list.exp +++ /dev/null @@ -1,216 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:20:9 - │ -16 │ public fun foo(_: address, _: u64, _: S) { - │ ------- Expected: 'address' - · -20 │ foo(false, 0, S{}); - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:21:9 - │ -16 │ public fun foo(_: address, _: u64, _: S) { - │ --- Expected: 'u64' - · -21 │ foo(@0x0, false, S{}); - │ ^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:22:9 - │ -16 │ public fun foo(_: address, _: u64, _: S) { - │ - Expected: '0x2::M::S' - · -22 │ foo(@0x0, 0, false); - │ ^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:23:9 - │ -16 │ public fun foo(_: address, _: u64, _: S) { - │ --- Expected: 'u64' - · -23 │ foo(@0x0, false, false); - │ ^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:23:9 - │ -16 │ public fun foo(_: address, _: u64, _: S) { - │ - Expected: '0x2::M::S' - · -23 │ foo(@0x0, false, false); - │ ^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:24:9 - │ -16 │ public fun foo(_: address, _: u64, _: S) { - │ ------- Expected: 'address' - · -24 │ foo(false, 0, false); - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:24:9 - │ -16 │ public fun foo(_: address, _: u64, _: S) { - │ - Expected: '0x2::M::S' - · -24 │ foo(false, 0, false); - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:25:9 - │ -16 │ public fun foo(_: address, _: u64, _: S) { - │ ------- Expected: 'address' - · -25 │ foo(false, false, S{}); - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:25:9 - │ -16 │ public fun foo(_: address, _: u64, _: S) { - │ --- Expected: 'u64' - · -25 │ foo(false, false, S{}); - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:29:9 - │ - 8 │ public fun foo(_: address, _: u64, _: S) { - │ ------- Expected: 'address' - · -29 │ X::foo(false, 0, X::s()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:30:9 - │ - 8 │ public fun foo(_: address, _: u64, _: S) { - │ --- Expected: 'u64' - · -30 │ X::foo(@0x0, false, X::s()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:31:9 - │ - 8 │ public fun foo(_: address, _: u64, _: S) { - │ - Expected: '0x2::X::S' - · -31 │ X::foo(@0x0, 0, S{}); - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: '0x2::M::S' - │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:32:9 - │ - 8 │ public fun foo(_: address, _: u64, _: S) { - │ --- Expected: 'u64' - · -32 │ X::foo(@0x0, false, S{}); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:32:9 - │ - 8 │ public fun foo(_: address, _: u64, _: S) { - │ - Expected: '0x2::X::S' - · -32 │ X::foo(@0x0, false, S{}); - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: '0x2::M::S' - │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:33:9 - │ - 8 │ public fun foo(_: address, _: u64, _: S) { - │ ------- Expected: 'address' - · -33 │ X::foo(false, 0, S{}); - │ ^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:33:9 - │ - 8 │ public fun foo(_: address, _: u64, _: S) { - │ - Expected: '0x2::X::S' - · -33 │ X::foo(false, 0, S{}); - │ ^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: '0x2::M::S' - │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:34:9 - │ - 8 │ public fun foo(_: address, _: u64, _: S) { - │ ------- Expected: 'address' - · -34 │ X::foo(false, false, X::s()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:34:9 - │ - 8 │ public fun foo(_: address, _: u64, _: S) { - │ --- Expected: 'u64' - · -34 │ X::foo(false, false, X::s()); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_wrong_argument_in_list.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_wrong_argument_in_list.snap new file mode 100644 index 0000000000000..529a60dc63e3b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_wrong_argument_in_list.snap @@ -0,0 +1,223 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/module_call_wrong_argument_in_list.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:20:9 + │ +16 │ public fun foo(_: address, _: u64, _: S) { + │ ------- Expected: 'address' + · +20 │ foo(false, 0, S{}); + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:21:9 + │ +16 │ public fun foo(_: address, _: u64, _: S) { + │ --- Expected: 'u64' + · +21 │ foo(@0x0, false, S{}); + │ ^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:22:9 + │ +16 │ public fun foo(_: address, _: u64, _: S) { + │ - Expected: '0x2::M::S' + · +22 │ foo(@0x0, 0, false); + │ ^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:23:9 + │ +16 │ public fun foo(_: address, _: u64, _: S) { + │ --- Expected: 'u64' + · +23 │ foo(@0x0, false, false); + │ ^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:23:9 + │ +16 │ public fun foo(_: address, _: u64, _: S) { + │ - Expected: '0x2::M::S' + · +23 │ foo(@0x0, false, false); + │ ^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:24:9 + │ +16 │ public fun foo(_: address, _: u64, _: S) { + │ ------- Expected: 'address' + · +24 │ foo(false, 0, false); + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:24:9 + │ +16 │ public fun foo(_: address, _: u64, _: S) { + │ - Expected: '0x2::M::S' + · +24 │ foo(false, 0, false); + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:25:9 + │ +16 │ public fun foo(_: address, _: u64, _: S) { + │ ------- Expected: 'address' + · +25 │ foo(false, false, S{}); + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:25:9 + │ +16 │ public fun foo(_: address, _: u64, _: S) { + │ --- Expected: 'u64' + · +25 │ foo(false, false, S{}); + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:29:9 + │ + 8 │ public fun foo(_: address, _: u64, _: S) { + │ ------- Expected: 'address' + · +29 │ X::foo(false, 0, X::s()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:30:9 + │ + 8 │ public fun foo(_: address, _: u64, _: S) { + │ --- Expected: 'u64' + · +30 │ X::foo(@0x0, false, X::s()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:31:9 + │ + 8 │ public fun foo(_: address, _: u64, _: S) { + │ - Expected: '0x2::X::S' + · +31 │ X::foo(@0x0, 0, S{}); + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: '0x2::M::S' + │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:32:9 + │ + 8 │ public fun foo(_: address, _: u64, _: S) { + │ --- Expected: 'u64' + · +32 │ X::foo(@0x0, false, S{}); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:32:9 + │ + 8 │ public fun foo(_: address, _: u64, _: S) { + │ - Expected: '0x2::X::S' + · +32 │ X::foo(@0x0, false, S{}); + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: '0x2::M::S' + │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:33:9 + │ + 8 │ public fun foo(_: address, _: u64, _: S) { + │ ------- Expected: 'address' + · +33 │ X::foo(false, 0, S{}); + │ ^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:33:9 + │ + 8 │ public fun foo(_: address, _: u64, _: S) { + │ - Expected: '0x2::X::S' + · +33 │ X::foo(false, 0, S{}); + │ ^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: '0x2::M::S' + │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:34:9 + │ + 8 │ public fun foo(_: address, _: u64, _: S) { + │ ------- Expected: 'address' + · +34 │ X::foo(false, false, X::s()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_argument_in_list.move:34:9 + │ + 8 │ public fun foo(_: address, _: u64, _: S) { + │ --- Expected: 'u64' + · +34 │ X::foo(false, false, X::s()); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_wrong_arity.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_wrong_arity.exp deleted file mode 100644 index ab235c5ee2d67..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_wrong_arity.exp +++ /dev/null @@ -1,126 +0,0 @@ -error[E04017]: too many arguments - ┌─ tests/move_check/typing/module_call_wrong_arity.move:27:9 - │ -27 │ X::foo(1); - │ ^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x2::X::foo'. The call expected 0 argument(s) but got 1 - -error[E04017]: too many arguments - ┌─ tests/move_check/typing/module_call_wrong_arity.move:28:9 - │ -28 │ X::foo(1, 2); - │ ^^^^^^^^^^^^ - │ │ │ - │ │ Found 2 argument(s) here - │ Invalid call of '0x2::X::foo'. The call expected 0 argument(s) but got 2 - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call_wrong_arity.move:29:9 - │ -29 │ X::bar(); - │ ^^^^^^^^ - │ │ │ - │ │ Found 0 argument(s) here - │ Invalid call of '0x2::X::bar'. The call expected 1 argument(s) but got 0 - -error[E04017]: too many arguments - ┌─ tests/move_check/typing/module_call_wrong_arity.move:30:9 - │ -30 │ X::bar(1, 2); - │ ^^^^^^^^^^^^ - │ │ │ - │ │ Found 2 argument(s) here - │ Invalid call of '0x2::X::bar'. The call expected 1 argument(s) but got 2 - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call_wrong_arity.move:31:9 - │ -31 │ X::baz(); - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 0 argument(s) here - │ Invalid call of '0x2::X::baz'. The call expected 2 argument(s) but got 0 - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call_wrong_arity.move:32:9 - │ -32 │ X::baz(1); - │ ^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x2::X::baz'. The call expected 2 argument(s) but got 1 - -error[E04017]: too many arguments - ┌─ tests/move_check/typing/module_call_wrong_arity.move:33:9 - │ -33 │ X::baz(1, 2, 3); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 3 argument(s) here - │ Invalid call of '0x2::X::baz'. The call expected 2 argument(s) but got 3 - -error[E04017]: too many arguments - ┌─ tests/move_check/typing/module_call_wrong_arity.move:37:9 - │ -37 │ foo(1); - │ ^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x2::M::foo'. The call expected 0 argument(s) but got 1 - -error[E04017]: too many arguments - ┌─ tests/move_check/typing/module_call_wrong_arity.move:38:9 - │ -38 │ foo(1, 2); - │ ^^^^^^^^^ - │ │ │ - │ │ Found 2 argument(s) here - │ Invalid call of '0x2::M::foo'. The call expected 0 argument(s) but got 2 - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call_wrong_arity.move:39:9 - │ -39 │ bar(); - │ ^^^^^ - │ │ │ - │ │ Found 0 argument(s) here - │ Invalid call of '0x2::M::bar'. The call expected 1 argument(s) but got 0 - -error[E04017]: too many arguments - ┌─ tests/move_check/typing/module_call_wrong_arity.move:40:9 - │ -40 │ bar(1, 2); - │ ^^^^^^^^^ - │ │ │ - │ │ Found 2 argument(s) here - │ Invalid call of '0x2::M::bar'. The call expected 1 argument(s) but got 2 - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call_wrong_arity.move:41:9 - │ -41 │ baz(); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 0 argument(s) here - │ Invalid call of '0x2::M::baz'. The call expected 2 argument(s) but got 0 - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/module_call_wrong_arity.move:42:9 - │ -42 │ baz(1); - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Found 1 argument(s) here - │ Invalid call of '0x2::M::baz'. The call expected 2 argument(s) but got 1 - -error[E04017]: too many arguments - ┌─ tests/move_check/typing/module_call_wrong_arity.move:43:9 - │ -43 │ baz(1, 2, 3); - │ ^^^^^^^^^^^^ - │ │ │ - │ │ Found 3 argument(s) here - │ Invalid call of '0x2::M::baz'. The call expected 2 argument(s) but got 3 - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_wrong_arity.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_wrong_arity.snap new file mode 100644 index 0000000000000..d77e094bc9566 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_wrong_arity.snap @@ -0,0 +1,133 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/module_call_wrong_arity.move +--- +error[E04017]: too many arguments + ┌─ tests/move_check/typing/module_call_wrong_arity.move:27:9 + │ +27 │ X::foo(1); + │ ^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x2::X::foo'. The call expected 0 argument(s) but got 1 + +error[E04017]: too many arguments + ┌─ tests/move_check/typing/module_call_wrong_arity.move:28:9 + │ +28 │ X::foo(1, 2); + │ ^^^^^^^^^^^^ + │ │ │ + │ │ Found 2 argument(s) here + │ Invalid call of '0x2::X::foo'. The call expected 0 argument(s) but got 2 + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call_wrong_arity.move:29:9 + │ +29 │ X::bar(); + │ ^^^^^^^^ + │ │ │ + │ │ Found 0 argument(s) here + │ Invalid call of '0x2::X::bar'. The call expected 1 argument(s) but got 0 + +error[E04017]: too many arguments + ┌─ tests/move_check/typing/module_call_wrong_arity.move:30:9 + │ +30 │ X::bar(1, 2); + │ ^^^^^^^^^^^^ + │ │ │ + │ │ Found 2 argument(s) here + │ Invalid call of '0x2::X::bar'. The call expected 1 argument(s) but got 2 + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call_wrong_arity.move:31:9 + │ +31 │ X::baz(); + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 0 argument(s) here + │ Invalid call of '0x2::X::baz'. The call expected 2 argument(s) but got 0 + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call_wrong_arity.move:32:9 + │ +32 │ X::baz(1); + │ ^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x2::X::baz'. The call expected 2 argument(s) but got 1 + +error[E04017]: too many arguments + ┌─ tests/move_check/typing/module_call_wrong_arity.move:33:9 + │ +33 │ X::baz(1, 2, 3); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 3 argument(s) here + │ Invalid call of '0x2::X::baz'. The call expected 2 argument(s) but got 3 + +error[E04017]: too many arguments + ┌─ tests/move_check/typing/module_call_wrong_arity.move:37:9 + │ +37 │ foo(1); + │ ^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x2::M::foo'. The call expected 0 argument(s) but got 1 + +error[E04017]: too many arguments + ┌─ tests/move_check/typing/module_call_wrong_arity.move:38:9 + │ +38 │ foo(1, 2); + │ ^^^^^^^^^ + │ │ │ + │ │ Found 2 argument(s) here + │ Invalid call of '0x2::M::foo'. The call expected 0 argument(s) but got 2 + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call_wrong_arity.move:39:9 + │ +39 │ bar(); + │ ^^^^^ + │ │ │ + │ │ Found 0 argument(s) here + │ Invalid call of '0x2::M::bar'. The call expected 1 argument(s) but got 0 + +error[E04017]: too many arguments + ┌─ tests/move_check/typing/module_call_wrong_arity.move:40:9 + │ +40 │ bar(1, 2); + │ ^^^^^^^^^ + │ │ │ + │ │ Found 2 argument(s) here + │ Invalid call of '0x2::M::bar'. The call expected 1 argument(s) but got 2 + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call_wrong_arity.move:41:9 + │ +41 │ baz(); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 0 argument(s) here + │ Invalid call of '0x2::M::baz'. The call expected 2 argument(s) but got 0 + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/module_call_wrong_arity.move:42:9 + │ +42 │ baz(1); + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Found 1 argument(s) here + │ Invalid call of '0x2::M::baz'. The call expected 2 argument(s) but got 1 + +error[E04017]: too many arguments + ┌─ tests/move_check/typing/module_call_wrong_arity.move:43:9 + │ +43 │ baz(1, 2, 3); + │ ^^^^^^^^^^^^ + │ │ │ + │ │ Found 3 argument(s) here + │ Invalid call of '0x2::M::baz'. The call expected 2 argument(s) but got 3 diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_wrong_single_argument.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_wrong_single_argument.exp deleted file mode 100644 index 01f0700427a31..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_wrong_single_argument.exp +++ /dev/null @@ -1,84 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_single_argument.move:24:9 - │ -17 │ public fun foo(_: S) { - │ - Expected: '0x2::M::S' - · -24 │ foo(0); - │ ^^^^^^ - │ │ │ - │ │ Given: integer - │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_single_argument.move:25:9 - │ -20 │ public fun bar(_: u64) { - │ --- Expected: 'u64' - · -25 │ bar(S{}); - │ ^^^^^^^^ - │ │ │ - │ │ Given: '0x2::M::S' - │ Invalid call of '0x2::M::bar'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_single_argument.move:26:9 - │ -20 │ public fun bar(_: u64) { - │ --- Expected: 'u64' - · -26 │ bar(@0x0); - │ ^^^^^^^^^ - │ │ │ - │ │ Given: 'address' - │ Invalid call of '0x2::M::bar'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_single_argument.move:30:9 - │ - 6 │ public fun foo(_: S) { - │ - Expected: '0x2::X::S' - · -30 │ X::foo(S{}); - │ ^^^^^^^^^^^ - │ │ │ - │ │ Given: '0x2::M::S' - │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_single_argument.move:31:9 - │ - 6 │ public fun foo(_: S) { - │ - Expected: '0x2::X::S' - · -31 │ X::foo(0); - │ ^^^^^^^^^ - │ │ │ - │ │ Given: integer - │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_single_argument.move:32:9 - │ - 9 │ public fun bar(_: u64) { - │ --- Expected: 'u64' - · -32 │ X::bar(S{}); - │ ^^^^^^^^^^^ - │ │ │ - │ │ Given: '0x2::M::S' - │ Invalid call of '0x2::X::bar'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/module_call_wrong_single_argument.move:33:9 - │ - 9 │ public fun bar(_: u64) { - │ --- Expected: 'u64' - · -33 │ X::bar(false); - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid call of '0x2::X::bar'. Invalid argument for parameter '_' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_wrong_single_argument.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_wrong_single_argument.snap new file mode 100644 index 0000000000000..6d5df55c6c700 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/module_call_wrong_single_argument.snap @@ -0,0 +1,91 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/module_call_wrong_single_argument.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_single_argument.move:24:9 + │ +17 │ public fun foo(_: S) { + │ - Expected: '0x2::M::S' + · +24 │ foo(0); + │ ^^^^^^ + │ │ │ + │ │ Given: integer + │ Invalid call of '0x2::M::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_single_argument.move:25:9 + │ +20 │ public fun bar(_: u64) { + │ --- Expected: 'u64' + · +25 │ bar(S{}); + │ ^^^^^^^^ + │ │ │ + │ │ Given: '0x2::M::S' + │ Invalid call of '0x2::M::bar'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_single_argument.move:26:9 + │ +20 │ public fun bar(_: u64) { + │ --- Expected: 'u64' + · +26 │ bar(@0x0); + │ ^^^^^^^^^ + │ │ │ + │ │ Given: 'address' + │ Invalid call of '0x2::M::bar'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_single_argument.move:30:9 + │ + 6 │ public fun foo(_: S) { + │ - Expected: '0x2::X::S' + · +30 │ X::foo(S{}); + │ ^^^^^^^^^^^ + │ │ │ + │ │ Given: '0x2::M::S' + │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_single_argument.move:31:9 + │ + 6 │ public fun foo(_: S) { + │ - Expected: '0x2::X::S' + · +31 │ X::foo(0); + │ ^^^^^^^^^ + │ │ │ + │ │ Given: integer + │ Invalid call of '0x2::X::foo'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_single_argument.move:32:9 + │ + 9 │ public fun bar(_: u64) { + │ --- Expected: 'u64' + · +32 │ X::bar(S{}); + │ ^^^^^^^^^^^ + │ │ │ + │ │ Given: '0x2::M::S' + │ Invalid call of '0x2::X::bar'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/module_call_wrong_single_argument.move:33:9 + │ + 9 │ public fun bar(_: u64) { + │ --- Expected: 'u64' + · +33 │ X::bar(false); + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid call of '0x2::X::bar'. Invalid argument for parameter '_' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutable_borrow_from_immutable.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutable_borrow_from_immutable.exp deleted file mode 100644 index 622155edf85f2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutable_borrow_from_immutable.exp +++ /dev/null @@ -1,59 +0,0 @@ -error[E07001]: referential transparency violated - ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:6:9 - │ -6 │ &mut (&s).v; - │ ^^^^^^^^^^^ - │ │ │ - │ │ Immutable because of this position - │ Invalid mutable borrow from an immutable reference - -error[E07001]: referential transparency violated - ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:7:9 - │ -7 │ &mut (&s.x).f; - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ Immutable because of this position - │ Invalid mutable borrow from an immutable reference - -error[E07001]: referential transparency violated - ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:10:9 - │ - 8 │ let sref = &s; - │ -- Immutable because of this position - 9 │ let xref = &s.x; -10 │ &mut sref.v; - │ ^^^^^^^^^^^ Invalid mutable borrow from an immutable reference - -error[E07001]: referential transparency violated - ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:11:9 - │ - 9 │ let xref = &s.x; - │ ---- Immutable because of this position -10 │ &mut sref.v; -11 │ &mut xref.v; - │ ^^^^^^^^^^^ Invalid mutable borrow from an immutable reference - -error[E03010]: unbound field - ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:11:14 - │ -11 │ &mut xref.v; - │ ^^^^^^ Unbound field 'v' in '0x8675309::M::X' - -error[E07001]: referential transparency violated - ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:15:9 - │ -14 │ fun t2(s: &S, x: &X) { - │ -- Immutable because of this position -15 │ x.f = x.f + 1; - │ ^^^ Invalid mutable borrow from an immutable reference - -error[E07001]: referential transparency violated - ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:16:9 - │ -14 │ fun t2(s: &S, x: &X) { - │ -- Immutable because of this position -15 │ x.f = x.f + 1; -16 │ s.x.f = s.x.f + 1 - │ ^^^^^ Invalid mutable borrow from an immutable reference - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutable_borrow_from_immutable.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutable_borrow_from_immutable.snap new file mode 100644 index 0000000000000..fb2492fa8fec5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutable_borrow_from_immutable.snap @@ -0,0 +1,66 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/mutable_borrow_from_immutable.move +--- +error[E07001]: referential transparency violated + ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:6:9 + │ +6 │ &mut (&s).v; + │ ^^^^^^^^^^^ + │ │ │ + │ │ Immutable because of this position + │ Invalid mutable borrow from an immutable reference + +error[E07001]: referential transparency violated + ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:7:9 + │ +7 │ &mut (&s.x).f; + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ Immutable because of this position + │ Invalid mutable borrow from an immutable reference + +error[E07001]: referential transparency violated + ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:10:9 + │ + 8 │ let sref = &s; + │ -- Immutable because of this position + 9 │ let xref = &s.x; +10 │ &mut sref.v; + │ ^^^^^^^^^^^ Invalid mutable borrow from an immutable reference + +error[E07001]: referential transparency violated + ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:11:9 + │ + 9 │ let xref = &s.x; + │ ---- Immutable because of this position +10 │ &mut sref.v; +11 │ &mut xref.v; + │ ^^^^^^^^^^^ Invalid mutable borrow from an immutable reference + +error[E03010]: unbound field + ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:11:14 + │ +11 │ &mut xref.v; + │ ^^^^^^ Unbound field 'v' in '0x8675309::M::X' + +error[E07001]: referential transparency violated + ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:15:9 + │ +14 │ fun t2(s: &S, x: &X) { + │ -- Immutable because of this position +15 │ x.f = x.f + 1; + │ ^^^ Invalid mutable borrow from an immutable reference + +error[E07001]: referential transparency violated + ┌─ tests/move_check/typing/mutable_borrow_from_immutable.move:16:9 + │ +14 │ fun t2(s: &S, x: &X) { + │ -- Immutable because of this position +15 │ x.f = x.f + 1; +16 │ s.x.f = s.x.f + 1 + │ ^^^^^ Invalid mutable borrow from an immutable reference diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutable_eq_and_neq.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutable_eq_and_neq.snap new file mode 100644 index 0000000000000..f2ca5943bbdcd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutable_eq_and_neq.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/mutable_eq_and_neq.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutable_eq_and_neq_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutable_eq_and_neq_invalid.exp deleted file mode 100644 index 539d1927d2339..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutable_eq_and_neq_invalid.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E07002]: mutable ownership violated - ┌─ tests/move_check/typing/mutable_eq_and_neq_invalid.move:7:21 - │ -6 │ let f = &mut p.b1.f; - │ ----------- Field 'f' is still being mutably borrowed by this reference -7 │ let comp = (&mut p.b1) == (&mut p.b2); - │ ^^^^^^^^^ Invalid freeze. - -error[E07002]: mutable ownership violated - ┌─ tests/move_check/typing/mutable_eq_and_neq_invalid.move:13:21 - │ -12 │ let f = &mut p.b1.f; - │ ----------- Field 'f' is still being mutably borrowed by this reference -13 │ let comp = (&mut p.b1) != (&mut p.b2); - │ ^^^^^^^^^ Invalid freeze. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutable_eq_and_neq_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutable_eq_and_neq_invalid.snap new file mode 100644 index 0000000000000..e062ec5a6be5c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutable_eq_and_neq_invalid.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/mutable_eq_and_neq_invalid.move +--- +error[E07002]: mutable ownership violated + ┌─ tests/move_check/typing/mutable_eq_and_neq_invalid.move:7:21 + │ +6 │ let f = &mut p.b1.f; + │ ----------- Field 'f' is still being mutably borrowed by this reference +7 │ let comp = (&mut p.b1) == (&mut p.b2); + │ ^^^^^^^^^ Invalid freeze. + +error[E07002]: mutable ownership violated + ┌─ tests/move_check/typing/mutable_eq_and_neq_invalid.move:13:21 + │ +12 │ let f = &mut p.b1.f; + │ ----------- Field 'f' is still being mutably borrowed by this reference +13 │ let comp = (&mut p.b1) != (&mut p.b2); + │ ^^^^^^^^^ Invalid freeze. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate.snap new file mode 100644 index 0000000000000..51264e8b3340a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/mutate.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_field_internal.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_field_internal.exp deleted file mode 100644 index a7479e4c971d8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_field_internal.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/mutate_field_internal.move:13:9 - │ -13 │ X::s().f = 0; - │ ^^^^^^^^ Invalid access of field 'f' on the struct '0x2::X::S'. The field 'f' can only be accessed within the module '0x2::X' since it defines 'S' - -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/mutate_field_internal.move:15:9 - │ -15 │ s.f = 0; - │ ^^^ Invalid access of field 'f' on the struct '0x2::X::S'. The field 'f' can only be accessed within the module '0x2::X' since it defines 'S' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_field_internal.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_field_internal.snap new file mode 100644 index 0000000000000..d9911369d5c69 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_field_internal.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/mutate_field_internal.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/mutate_field_internal.move:13:9 + │ +13 │ X::s().f = 0; + │ ^^^^^^^^ Invalid access of field 'f' on the struct '0x2::X::S'. The field 'f' can only be accessed within the module '0x2::X' since it defines 'S' + +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/mutate_field_internal.move:15:9 + │ +15 │ s.f = 0; + │ ^^^ Invalid access of field 'f' on the struct '0x2::X::S'. The field 'f' can only be accessed within the module '0x2::X' since it defines 'S' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_immutable.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_immutable.exp deleted file mode 100644 index 30f9afa6f6cfc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_immutable.exp +++ /dev/null @@ -1,31 +0,0 @@ -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/mutate_immutable.move:5:10 - │ -5 │ *(s: &S) = S { f: 0 }; - │ ^^^^^^^ - │ │ │ - │ │ Given: '&0x8675309::M::S' - │ Invalid mutation. Expected a mutable reference - │ Expected: '&mut _' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/mutate_immutable.move:6:10 - │ -6 │ *&0 = 1; - │ ^^ - │ │ - │ Invalid mutation. Expected a mutable reference - │ Expected: '&mut _' - │ Given: '&{integer}' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/mutate_immutable.move:10:10 - │ - 9 │ let x_ref: &u64 = x_ref; - │ ---- Given: '&u64' -10 │ *x_ref = 0; - │ ^^^^^ - │ │ - │ Invalid mutation. Expected a mutable reference - │ Expected: '&mut _' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_immutable.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_immutable.snap new file mode 100644 index 0000000000000..49065a2db7a34 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_immutable.snap @@ -0,0 +1,38 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/mutate_immutable.move +--- +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/mutate_immutable.move:5:10 + │ +5 │ *(s: &S) = S { f: 0 }; + │ ^^^^^^^ + │ │ │ + │ │ Given: '&0x8675309::M::S' + │ Invalid mutation. Expected a mutable reference + │ Expected: '&mut _' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/mutate_immutable.move:6:10 + │ +6 │ *&0 = 1; + │ ^^ + │ │ + │ Invalid mutation. Expected a mutable reference + │ Expected: '&mut _' + │ Given: '&{integer}' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/mutate_immutable.move:10:10 + │ + 9 │ let x_ref: &u64 = x_ref; + │ ---- Given: '&u64' +10 │ *x_ref = 0; + │ ^^^^^ + │ │ + │ Invalid mutation. Expected a mutable reference + │ Expected: '&mut _' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_invalid.exp deleted file mode 100644 index a1abc085ab61e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_invalid.exp +++ /dev/null @@ -1,107 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/mutate_invalid.move:6:10 - │ -6 │ *&mut 0 = false; - │ ^^^^^^ ----- Given: 'bool' - │ │ - │ Invalid mutation. New value is not valid for the reference - │ Expected: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/mutate_invalid.move:7:10 - │ -2 │ struct S has drop { f: u64 } - │ --- Expected: 'u64' - · -7 │ *&mut S{f:0}.f = &1; - │ ^^^^^^^^^^^^^ -- Given: '&{integer}' - │ │ - │ Invalid mutation. New value is not valid for the reference - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/mutate_invalid.move:8:10 - │ - 8 │ *foo(&mut 0) = (1, 0); - │ ^^^^^^^^^^^ ------ Given: '({integer}, {integer})' - │ │ - │ Invalid mutation. New value is not valid for the reference - · -23 │ fun foo(x: &mut u64): &mut u64 { - │ --- Expected: 'u64' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/mutate_invalid.move:9:9 - │ -2 │ struct S has drop { f: u64 } - │ --- Expected: 'u64' - · -9 │ bar(&mut S{f:0}).f = (); - │ ^^^^^^^^^^^^^^^^^^ -- Given: '()' - │ │ - │ Invalid mutation. New value is not valid for the reference - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/mutate_invalid.move:10:10 - │ - 2 │ struct S has drop { f: u64 } - │ --- Expected: 'u64' - · -10 │ *&mut bar(&mut S{f:0}).f = &0; - │ ^^^^^^^^^^^^^^^^^^^^^^^ -- Given: '&{integer}' - │ │ - │ Invalid mutation. New value is not valid for the reference - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/mutate_invalid.move:11:9 - │ - 2 │ struct S has drop { f: u64 } - │ --- Expected: 'u64' - · -11 │ baz().f = false; - │ ^^^^^^^ ----- Given: 'bool' - │ │ - │ Invalid mutation. New value is not valid for the reference - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/mutate_invalid.move:12:10 - │ - 2 │ struct S has drop { f: u64 } - │ --- Expected: 'u64' - · -12 │ *&mut baz().f = false; - │ ^^^^^^^^^^^^ ----- Given: 'bool' - │ │ - │ Invalid mutation. New value is not valid for the reference - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/mutate_invalid.move:17:10 - │ -16 │ let r = &mut S{ f: 0 }; - │ --------- Expected: '0x8675309::M::S' -17 │ *r = X { f: 1 }; - │ ^ ---------- Given: '0x8675309::M::X' - │ │ - │ Invalid mutation. New value is not valid for the reference - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/mutate_invalid.move:19:9 - │ - 2 │ struct S has drop { f: u64 } - │ --- Expected: 'u64' - · -19 │ r.f = &0; - │ ^^^ -- Given: '&{integer}' - │ │ - │ Invalid mutation. New value is not valid for the reference - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/mutate_invalid.move:20:10 - │ - 2 │ struct S has drop { f: u64 } - │ --- Expected: 'u64' - · -20 │ *&mut r.f = (); - │ ^^^^^^^^ -- Given: '()' - │ │ - │ Invalid mutation. New value is not valid for the reference - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_invalid.snap new file mode 100644 index 0000000000000..48fdb428fd346 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_invalid.snap @@ -0,0 +1,114 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/mutate_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/mutate_invalid.move:6:10 + │ +6 │ *&mut 0 = false; + │ ^^^^^^ ----- Given: 'bool' + │ │ + │ Invalid mutation. New value is not valid for the reference + │ Expected: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/mutate_invalid.move:7:10 + │ +2 │ struct S has drop { f: u64 } + │ --- Expected: 'u64' + · +7 │ *&mut S{f:0}.f = &1; + │ ^^^^^^^^^^^^^ -- Given: '&{integer}' + │ │ + │ Invalid mutation. New value is not valid for the reference + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/mutate_invalid.move:8:10 + │ + 8 │ *foo(&mut 0) = (1, 0); + │ ^^^^^^^^^^^ ------ Given: '({integer}, {integer})' + │ │ + │ Invalid mutation. New value is not valid for the reference + · +23 │ fun foo(x: &mut u64): &mut u64 { + │ --- Expected: 'u64' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/mutate_invalid.move:9:9 + │ +2 │ struct S has drop { f: u64 } + │ --- Expected: 'u64' + · +9 │ bar(&mut S{f:0}).f = (); + │ ^^^^^^^^^^^^^^^^^^ -- Given: '()' + │ │ + │ Invalid mutation. New value is not valid for the reference + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/mutate_invalid.move:10:10 + │ + 2 │ struct S has drop { f: u64 } + │ --- Expected: 'u64' + · +10 │ *&mut bar(&mut S{f:0}).f = &0; + │ ^^^^^^^^^^^^^^^^^^^^^^^ -- Given: '&{integer}' + │ │ + │ Invalid mutation. New value is not valid for the reference + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/mutate_invalid.move:11:9 + │ + 2 │ struct S has drop { f: u64 } + │ --- Expected: 'u64' + · +11 │ baz().f = false; + │ ^^^^^^^ ----- Given: 'bool' + │ │ + │ Invalid mutation. New value is not valid for the reference + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/mutate_invalid.move:12:10 + │ + 2 │ struct S has drop { f: u64 } + │ --- Expected: 'u64' + · +12 │ *&mut baz().f = false; + │ ^^^^^^^^^^^^ ----- Given: 'bool' + │ │ + │ Invalid mutation. New value is not valid for the reference + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/mutate_invalid.move:17:10 + │ +16 │ let r = &mut S{ f: 0 }; + │ --------- Expected: '0x8675309::M::S' +17 │ *r = X { f: 1 }; + │ ^ ---------- Given: '0x8675309::M::X' + │ │ + │ Invalid mutation. New value is not valid for the reference + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/mutate_invalid.move:19:9 + │ + 2 │ struct S has drop { f: u64 } + │ --- Expected: 'u64' + · +19 │ r.f = &0; + │ ^^^ -- Given: '&{integer}' + │ │ + │ Invalid mutation. New value is not valid for the reference + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/mutate_invalid.move:20:10 + │ + 2 │ struct S has drop { f: u64 } + │ --- Expected: 'u64' + · +20 │ *&mut r.f = (); + │ ^^^^^^^^ -- Given: '()' + │ │ + │ Invalid mutation. New value is not valid for the reference diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_non_ref.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_non_ref.exp deleted file mode 100644 index 4361fb9a3b3e1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_non_ref.exp +++ /dev/null @@ -1,94 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/mutate_non_ref.move:7:10 - │ -6 │ let u = 0; - │ - Given: integer -7 │ *u = 1; - │ ^ - │ │ - │ Invalid mutation. Expected a mutable reference - │ Expected: '&mut _' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/mutate_non_ref.move:10:10 - │ - 9 │ let s = S { f: 0 }; - │ ---------- Given: '0x8675309::M::S' -10 │ *s = S { f: 0 }; - │ ^ - │ │ - │ Invalid mutation. Expected a mutable reference - │ Expected: '&mut _' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/mutate_non_ref.move:11:10 - │ - 2 │ struct S has copy, drop { f: u64 } - │ --- Given: 'u64' - · -11 │ *s.f = 0; - │ ^^^ - │ │ - │ Invalid mutation. Expected a mutable reference - │ Expected: '&mut _' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/mutate_non_ref.move:14:10 - │ - 2 │ struct S has copy, drop { f: u64 } - │ --- Given: 'u64' - · -14 │ *s_ref.f = 0; - │ ^^^^^^^ - │ │ - │ Invalid mutation. Expected a mutable reference - │ Expected: '&mut _' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/mutate_non_ref.move:17:10 - │ - 3 │ struct X has copy, drop { s: S } - │ - Given: '0x8675309::M::S' - · -17 │ *x.s = S { f: 0 }; - │ ^^^ - │ │ - │ Invalid mutation. Expected a mutable reference - │ Expected: '&mut _' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/mutate_non_ref.move:18:10 - │ - 2 │ struct S has copy, drop { f: u64 } - │ --- Given: 'u64' - · -18 │ *x.s.f = 0; - │ ^^^^^ - │ │ - │ Invalid mutation. Expected a mutable reference - │ Expected: '&mut _' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/mutate_non_ref.move:21:10 - │ - 3 │ struct X has copy, drop { s: S } - │ - Given: '0x8675309::M::S' - · -21 │ *x_ref.s = S{ f: 0 }; - │ ^^^^^^^ - │ │ - │ Invalid mutation. Expected a mutable reference - │ Expected: '&mut _' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/mutate_non_ref.move:22:10 - │ - 2 │ struct S has copy, drop { f: u64 } - │ --- Given: 'u64' - · -22 │ *x_ref.s.f = 0; - │ ^^^^^^^^^ - │ │ - │ Invalid mutation. Expected a mutable reference - │ Expected: '&mut _' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_non_ref.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_non_ref.snap new file mode 100644 index 0000000000000..df598acf8d156 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_non_ref.snap @@ -0,0 +1,101 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/mutate_non_ref.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/mutate_non_ref.move:7:10 + │ +6 │ let u = 0; + │ - Given: integer +7 │ *u = 1; + │ ^ + │ │ + │ Invalid mutation. Expected a mutable reference + │ Expected: '&mut _' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/mutate_non_ref.move:10:10 + │ + 9 │ let s = S { f: 0 }; + │ ---------- Given: '0x8675309::M::S' +10 │ *s = S { f: 0 }; + │ ^ + │ │ + │ Invalid mutation. Expected a mutable reference + │ Expected: '&mut _' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/mutate_non_ref.move:11:10 + │ + 2 │ struct S has copy, drop { f: u64 } + │ --- Given: 'u64' + · +11 │ *s.f = 0; + │ ^^^ + │ │ + │ Invalid mutation. Expected a mutable reference + │ Expected: '&mut _' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/mutate_non_ref.move:14:10 + │ + 2 │ struct S has copy, drop { f: u64 } + │ --- Given: 'u64' + · +14 │ *s_ref.f = 0; + │ ^^^^^^^ + │ │ + │ Invalid mutation. Expected a mutable reference + │ Expected: '&mut _' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/mutate_non_ref.move:17:10 + │ + 3 │ struct X has copy, drop { s: S } + │ - Given: '0x8675309::M::S' + · +17 │ *x.s = S { f: 0 }; + │ ^^^ + │ │ + │ Invalid mutation. Expected a mutable reference + │ Expected: '&mut _' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/mutate_non_ref.move:18:10 + │ + 2 │ struct S has copy, drop { f: u64 } + │ --- Given: 'u64' + · +18 │ *x.s.f = 0; + │ ^^^^^ + │ │ + │ Invalid mutation. Expected a mutable reference + │ Expected: '&mut _' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/mutate_non_ref.move:21:10 + │ + 3 │ struct X has copy, drop { s: S } + │ - Given: '0x8675309::M::S' + · +21 │ *x_ref.s = S{ f: 0 }; + │ ^^^^^^^ + │ │ + │ Invalid mutation. Expected a mutable reference + │ Expected: '&mut _' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/mutate_non_ref.move:22:10 + │ + 2 │ struct S has copy, drop { f: u64 } + │ --- Given: 'u64' + · +22 │ *x_ref.s.f = 0; + │ ^^^^^^^^^ + │ │ + │ Invalid mutation. Expected a mutable reference + │ Expected: '&mut _' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_resource.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_resource.exp deleted file mode 100644 index 68cb8901cbc27..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_resource.exp +++ /dev/null @@ -1,31 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/mutate_resource.move:5:10 - │ -2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here -3 │ -4 │ fun t0(r: &mut R) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' -5 │ *r = R {}; - │ ^ Invalid mutation. Mutation requires the 'drop' ability as the old value is destroyed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/mutate_resource.move:9:10 - │ -8 │ fun t1(r: &mut T, x: T) { - │ - - The type 'T' does not have the ability 'drop' - │ │ - │ To satisfy the constraint, the 'drop' ability would need to be added here -9 │ *r = x; - │ ^ Invalid mutation. Mutation requires the 'drop' ability as the old value is destroyed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/mutate_resource.move:13:10 - │ -12 │ fun t2(r: &mut T, x: T) { - │ - - The type 'T' does not have the ability 'drop' - │ │ - │ To satisfy the constraint, the 'drop' ability would need to be added here -13 │ *r = x; - │ ^ Invalid mutation. Mutation requires the 'drop' ability as the old value is destroyed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_resource.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_resource.snap new file mode 100644 index 0000000000000..f69ba335445b4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/mutate_resource.snap @@ -0,0 +1,38 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/mutate_resource.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/mutate_resource.move:5:10 + │ +2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here +3 │ +4 │ fun t0(r: &mut R) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' +5 │ *r = R {}; + │ ^ Invalid mutation. Mutation requires the 'drop' ability as the old value is destroyed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/mutate_resource.move:9:10 + │ +8 │ fun t1(r: &mut T, x: T) { + │ - - The type 'T' does not have the ability 'drop' + │ │ + │ To satisfy the constraint, the 'drop' ability would need to be added here +9 │ *r = x; + │ ^ Invalid mutation. Mutation requires the 'drop' ability as the old value is destroyed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/mutate_resource.move:13:10 + │ +12 │ fun t2(r: &mut T, x: T) { + │ - - The type 'T' does not have the ability 'drop' + │ │ + │ To satisfy the constraint, the 'drop' ability would need to be added here +13 │ *r = x; + │ ^ Invalid mutation. Mutation requires the 'drop' ability as the old value is destroyed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/native_structs_pack_unpack.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/native_structs_pack_unpack.exp deleted file mode 100644 index 78ab43dab6b92..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/native_structs_pack_unpack.exp +++ /dev/null @@ -1,51 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/native_structs_pack_unpack.move:9:9 - │ -3 │ native struct T; - │ - Struct defined in module '0x42::C' - · -9 │ C::T {} - │ ^^^^^^^ Struct '0x42::C::T' can only be instantiated within its defining module '0x42::C' - -error[E04015]: invalid use of native item - ┌─ tests/move_check/typing/native_structs_pack_unpack.move:9:9 - │ -3 │ native struct T; - │ ------ Struct declared 'native' here - · -9 │ C::T {} - │ ^^^^^^^ Invalid argument usage for native struct '0x42::C::T'. Native structs cannot be directly constructed/deconstructed, and their fields cannot be dirctly accessed - -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/native_structs_pack_unpack.move:12:13 - │ - 3 │ native struct T; - │ - Struct defined in module '0x42::C' - · -12 │ let C::T {} = c; - │ ^^^^^^^ Struct '0x42::C::T' can only be used in deconstruction binding within its defining module '0x42::C' - -error[E04015]: invalid use of native item - ┌─ tests/move_check/typing/native_structs_pack_unpack.move:12:13 - │ - 3 │ native struct T; - │ ------ Struct declared 'native' here - · -12 │ let C::T {} = c; - │ ^^^^^^^ Invalid binding usage for native struct '0x42::C::T'. Native structs cannot be directly constructed/deconstructed, and their fields cannot be dirctly accessed - -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/native_structs_pack_unpack.move:15:18 - │ -15 │ let _f = c.f; - │ ^^^ Invalid access of field 'f' on the struct '0x42::C::T'. The field 'f' can only be accessed within the module '0x42::C' since it defines 'T' - -error[E03010]: unbound field - ┌─ tests/move_check/typing/native_structs_pack_unpack.move:15:18 - │ - 3 │ native struct T; - │ ------ Struct declared 'native' here - · -15 │ let _f = c.f; - │ ^^^ Unbound field 'f' for native struct '0x42::C::T' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/native_structs_pack_unpack.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/native_structs_pack_unpack.snap new file mode 100644 index 0000000000000..a667fd0d37c08 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/native_structs_pack_unpack.snap @@ -0,0 +1,58 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/native_structs_pack_unpack.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/native_structs_pack_unpack.move:9:9 + │ +3 │ native struct T; + │ - Struct defined in module '0x42::C' + · +9 │ C::T {} + │ ^^^^^^^ Struct '0x42::C::T' can only be instantiated within its defining module '0x42::C' + +error[E04015]: invalid use of native item + ┌─ tests/move_check/typing/native_structs_pack_unpack.move:9:9 + │ +3 │ native struct T; + │ ------ Struct declared 'native' here + · +9 │ C::T {} + │ ^^^^^^^ Invalid argument usage for native struct '0x42::C::T'. Native structs cannot be directly constructed/deconstructed, and their fields cannot be dirctly accessed + +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/native_structs_pack_unpack.move:12:13 + │ + 3 │ native struct T; + │ - Struct defined in module '0x42::C' + · +12 │ let C::T {} = c; + │ ^^^^^^^ Struct '0x42::C::T' can only be used in deconstruction binding within its defining module '0x42::C' + +error[E04015]: invalid use of native item + ┌─ tests/move_check/typing/native_structs_pack_unpack.move:12:13 + │ + 3 │ native struct T; + │ ------ Struct declared 'native' here + · +12 │ let C::T {} = c; + │ ^^^^^^^ Invalid binding usage for native struct '0x42::C::T'. Native structs cannot be directly constructed/deconstructed, and their fields cannot be dirctly accessed + +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/native_structs_pack_unpack.move:15:18 + │ +15 │ let _f = c.f; + │ ^^^ Invalid access of field 'f' on the struct '0x42::C::T'. The field 'f' can only be accessed within the module '0x42::C' since it defines 'T' + +error[E03010]: unbound field + ┌─ tests/move_check/typing/native_structs_pack_unpack.move:15:18 + │ + 3 │ native struct T; + │ ------ Struct declared 'native' here + · +15 │ let _f = c.f; + │ ^^^ Unbound field 'f' for native struct '0x42::C::T' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/neq.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/neq.snap new file mode 100644 index 0000000000000..270311165e4aa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/neq.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/neq.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/neq_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/neq_invalid.exp deleted file mode 100644 index d6ac4f61a84f8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/neq_invalid.exp +++ /dev/null @@ -1,224 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/neq_invalid.move:13:17 - │ -13 │ (0: u8) != (1: u128); - │ -- ^^ ---- Found: 'u128'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '!=' - │ Found: 'u8'. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/neq_invalid.move:14:11 - │ -14 │ 0 != false; - │ - ^^ ----- Found: 'bool'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '!=' - │ Found: integer. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/neq_invalid.move:15:12 - │ -15 │ &0 != 1; - │ -- ^^ - Found: integer. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '!=' - │ Found: '&{integer}'. It is not compatible with the other type. - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/neq_invalid.move:16:11 - │ -16 │ 1 != &0; - │ - ^^ -- Found: '&{integer}'. It is not compatible with the other type. - │ │ │ - │ │ Incompatible arguments to '!=' - │ Found: integer. It is not compatible with the other type. - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/neq_invalid.move:17:9 - │ - 2 │ struct S { u: u64 } - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -12 │ fun t0(s: S, s_ref: &S, s_mut: &mut S) { - │ - The type '0x8675309::M::S' does not have the ability 'drop' - · -17 │ s != s_ref; - │ ^ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/neq_invalid.move:17:11 - │ -12 │ fun t0(s: S, s_ref: &S, s_mut: &mut S) { - │ - -- Found: '&0x8675309::M::S'. It is not compatible with the other type. - │ │ - │ Found: '0x8675309::M::S'. It is not compatible with the other type. - · -17 │ s != s_ref; - │ ^^ Incompatible arguments to '!=' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/neq_invalid.move:18:15 - │ -12 │ fun t0(s: S, s_ref: &S, s_mut: &mut S) { - │ - ------ Found: '&mut 0x8675309::M::S'. It is not compatible with the other type. - │ │ - │ Found: '0x8675309::M::S'. It is not compatible with the other type. - · -18 │ s_mut != s; - │ ^^ Incompatible arguments to '!=' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/neq_invalid.move:18:18 - │ - 2 │ struct S { u: u64 } - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -12 │ fun t0(s: S, s_ref: &S, s_mut: &mut S) { - │ - The type '0x8675309::M::S' does not have the ability 'drop' - · -18 │ s_mut != s; - │ ^ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/neq_invalid.move:22:9 - │ - 3 │ struct R { - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -21 │ fun t1(r: R) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' -22 │ r != r; - │ ^ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/neq_invalid.move:22:14 - │ - 3 │ struct R { - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -21 │ fun t1(r: R) { - │ - The type '0x8675309::M::R' does not have the ability 'drop' -22 │ r != r; - │ ^ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/neq_invalid.move:26:9 - │ -26 │ G0{} != G0{}; - │ ^^^^ Could not infer this type. Try adding an annotation - -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/neq_invalid.move:26:17 - │ -26 │ G0{} != G0{}; - │ ^^^^ Could not infer this type. Try adding an annotation - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/neq_invalid.move:27:9 - │ - 7 │ struct G1 {} - │ -- To satisfy the constraint, the 'drop' ability would need to be added here - · -27 │ G1{} != G1{}; - │ ^^^^ - │ │ - │ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x8675309::M::G1<_>' does not have the ability 'drop' - -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/neq_invalid.move:27:9 - │ -27 │ G1{} != G1{}; - │ ^^^^ Could not infer this type. Try adding an annotation - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/neq_invalid.move:27:17 - │ - 7 │ struct G1 {} - │ -- To satisfy the constraint, the 'drop' ability would need to be added here - · -27 │ G1{} != G1{}; - │ ^^^^ - │ │ - │ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x8675309::M::G1<_>' does not have the ability 'drop' - -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/neq_invalid.move:27:17 - │ -27 │ G1{} != G1{}; - │ ^^^^ Could not infer this type. Try adding an annotation - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/neq_invalid.move:28:9 - │ - 8 │ struct G2 {} - │ -- To satisfy the constraint, the 'drop' ability would need to be added here - · -28 │ G2{} != G2{}; - │ ^^^^ - │ │ - │ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x8675309::M::G2<_>' does not have the ability 'drop' - -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/neq_invalid.move:28:9 - │ -28 │ G2{} != G2{}; - │ ^^^^ Could not infer this type. Try adding an annotation - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/neq_invalid.move:28:17 - │ - 8 │ struct G2 {} - │ -- To satisfy the constraint, the 'drop' ability would need to be added here - · -28 │ G2{} != G2{}; - │ ^^^^ - │ │ - │ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' - │ The type '0x8675309::M::G2<_>' does not have the ability 'drop' - -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/neq_invalid.move:28:17 - │ -28 │ G2{} != G2{}; - │ ^^^^ Could not infer this type. Try adding an annotation - -error[E04005]: expected a single type - ┌─ tests/move_check/typing/neq_invalid.move:32:9 - │ -32 │ () != (); - │ ^^^^^^^^ - │ │ │ - │ │ Expected a single type, but found expression list type: '()' - │ Incompatible arguments to '!=' - -error[E04005]: expected a single type - ┌─ tests/move_check/typing/neq_invalid.move:33:9 - │ -33 │ (0, 1) != (0, 1); - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single type, but found expression list type: '(u64, u64)' - │ Incompatible arguments to '!=' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/neq_invalid.move:34:19 - │ -34 │ (1, 2, 3) != (0, 1); - │ --------- ^^ ------ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - │ │ │ - │ │ Incompatible arguments to '!=' - │ Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/neq_invalid.move:35:16 - │ -35 │ (0, 1) != (1, 2, 3); - │ ------ ^^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. - │ │ │ - │ │ Incompatible arguments to '!=' - │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/neq_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/neq_invalid.snap new file mode 100644 index 0000000000000..2f84505cd80f1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/neq_invalid.snap @@ -0,0 +1,231 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/neq_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/neq_invalid.move:13:17 + │ +13 │ (0: u8) != (1: u128); + │ -- ^^ ---- Found: 'u128'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '!=' + │ Found: 'u8'. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/neq_invalid.move:14:11 + │ +14 │ 0 != false; + │ - ^^ ----- Found: 'bool'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '!=' + │ Found: integer. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/neq_invalid.move:15:12 + │ +15 │ &0 != 1; + │ -- ^^ - Found: integer. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '!=' + │ Found: '&{integer}'. It is not compatible with the other type. + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/neq_invalid.move:16:11 + │ +16 │ 1 != &0; + │ - ^^ -- Found: '&{integer}'. It is not compatible with the other type. + │ │ │ + │ │ Incompatible arguments to '!=' + │ Found: integer. It is not compatible with the other type. + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/neq_invalid.move:17:9 + │ + 2 │ struct S { u: u64 } + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +12 │ fun t0(s: S, s_ref: &S, s_mut: &mut S) { + │ - The type '0x8675309::M::S' does not have the ability 'drop' + · +17 │ s != s_ref; + │ ^ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/neq_invalid.move:17:11 + │ +12 │ fun t0(s: S, s_ref: &S, s_mut: &mut S) { + │ - -- Found: '&0x8675309::M::S'. It is not compatible with the other type. + │ │ + │ Found: '0x8675309::M::S'. It is not compatible with the other type. + · +17 │ s != s_ref; + │ ^^ Incompatible arguments to '!=' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/neq_invalid.move:18:15 + │ +12 │ fun t0(s: S, s_ref: &S, s_mut: &mut S) { + │ - ------ Found: '&mut 0x8675309::M::S'. It is not compatible with the other type. + │ │ + │ Found: '0x8675309::M::S'. It is not compatible with the other type. + · +18 │ s_mut != s; + │ ^^ Incompatible arguments to '!=' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/neq_invalid.move:18:18 + │ + 2 │ struct S { u: u64 } + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +12 │ fun t0(s: S, s_ref: &S, s_mut: &mut S) { + │ - The type '0x8675309::M::S' does not have the ability 'drop' + · +18 │ s_mut != s; + │ ^ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/neq_invalid.move:22:9 + │ + 3 │ struct R { + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +21 │ fun t1(r: R) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' +22 │ r != r; + │ ^ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/neq_invalid.move:22:14 + │ + 3 │ struct R { + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +21 │ fun t1(r: R) { + │ - The type '0x8675309::M::R' does not have the ability 'drop' +22 │ r != r; + │ ^ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/neq_invalid.move:26:9 + │ +26 │ G0{} != G0{}; + │ ^^^^ Could not infer this type. Try adding an annotation + +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/neq_invalid.move:26:17 + │ +26 │ G0{} != G0{}; + │ ^^^^ Could not infer this type. Try adding an annotation + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/neq_invalid.move:27:9 + │ + 7 │ struct G1 {} + │ -- To satisfy the constraint, the 'drop' ability would need to be added here + · +27 │ G1{} != G1{}; + │ ^^^^ + │ │ + │ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x8675309::M::G1<_>' does not have the ability 'drop' + +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/neq_invalid.move:27:9 + │ +27 │ G1{} != G1{}; + │ ^^^^ Could not infer this type. Try adding an annotation + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/neq_invalid.move:27:17 + │ + 7 │ struct G1 {} + │ -- To satisfy the constraint, the 'drop' ability would need to be added here + · +27 │ G1{} != G1{}; + │ ^^^^ + │ │ + │ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x8675309::M::G1<_>' does not have the ability 'drop' + +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/neq_invalid.move:27:17 + │ +27 │ G1{} != G1{}; + │ ^^^^ Could not infer this type. Try adding an annotation + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/neq_invalid.move:28:9 + │ + 8 │ struct G2 {} + │ -- To satisfy the constraint, the 'drop' ability would need to be added here + · +28 │ G2{} != G2{}; + │ ^^^^ + │ │ + │ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x8675309::M::G2<_>' does not have the ability 'drop' + +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/neq_invalid.move:28:9 + │ +28 │ G2{} != G2{}; + │ ^^^^ Could not infer this type. Try adding an annotation + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/neq_invalid.move:28:17 + │ + 8 │ struct G2 {} + │ -- To satisfy the constraint, the 'drop' ability would need to be added here + · +28 │ G2{} != G2{}; + │ ^^^^ + │ │ + │ '!=' requires the 'drop' ability as the value is consumed. Try borrowing the values with '&' first.' + │ The type '0x8675309::M::G2<_>' does not have the ability 'drop' + +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/neq_invalid.move:28:17 + │ +28 │ G2{} != G2{}; + │ ^^^^ Could not infer this type. Try adding an annotation + +error[E04005]: expected a single type + ┌─ tests/move_check/typing/neq_invalid.move:32:9 + │ +32 │ () != (); + │ ^^^^^^^^ + │ │ │ + │ │ Expected a single type, but found expression list type: '()' + │ Incompatible arguments to '!=' + +error[E04005]: expected a single type + ┌─ tests/move_check/typing/neq_invalid.move:33:9 + │ +33 │ (0, 1) != (0, 1); + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single type, but found expression list type: '(u64, u64)' + │ Incompatible arguments to '!=' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/neq_invalid.move:34:19 + │ +34 │ (1, 2, 3) != (0, 1); + │ --------- ^^ ------ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. + │ │ │ + │ │ Incompatible arguments to '!=' + │ Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/neq_invalid.move:35:16 + │ +35 │ (0, 1) != (1, 2, 3); + │ ------ ^^ --------- Found expression list of length 3: '({integer}, {integer}, {integer})'. It is not compatible with the other type of length 2. + │ │ │ + │ │ Incompatible arguments to '!=' + │ Found expression list of length 2: '({integer}, {integer})'. It is not compatible with the other type of length 3. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/non_phantom_in_phantom_pos.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/non_phantom_in_phantom_pos.exp deleted file mode 100644 index 74002cf169d5a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/non_phantom_in_phantom_pos.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[W02014]: invalid non-phantom type parameter usage - ┌─ tests/move_check/typing/non_phantom_in_phantom_pos.move:5:15 - │ -5 │ struct S2 { - │ ^^ The parameter 'T1' is only used as an argument to phantom parameters. Consider adding a phantom declaration here - │ - = This warning can be suppressed with '#[allow(missing_phantom)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W02014]: invalid non-phantom type parameter usage - ┌─ tests/move_check/typing/non_phantom_in_phantom_pos.move:15:15 - │ -15 │ struct S4 { - │ ^^ The parameter 'T1' is only used as an argument to phantom parameters. Consider adding a phantom declaration here - │ - = This warning can be suppressed with '#[allow(missing_phantom)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/non_phantom_in_phantom_pos.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/non_phantom_in_phantom_pos.snap new file mode 100644 index 0000000000000..0cf8ed84f9b58 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/non_phantom_in_phantom_pos.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/non_phantom_in_phantom_pos.move +--- +warning[W02014]: invalid non-phantom type parameter usage + ┌─ tests/move_check/typing/non_phantom_in_phantom_pos.move:5:15 + │ +5 │ struct S2 { + │ ^^ The parameter 'T1' is only used as an argument to phantom parameters. Consider adding a phantom declaration here + │ + = This warning can be suppressed with '#[allow(missing_phantom)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W02014]: invalid non-phantom type parameter usage + ┌─ tests/move_check/typing/non_phantom_in_phantom_pos.move:15:15 + │ +15 │ struct S4 { + │ ^^ The parameter 'T1' is only used as an argument to phantom parameters. Consider adding a phantom declaration here + │ + = This warning can be suppressed with '#[allow(missing_phantom)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/number_literal_too_large.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/number_literal_too_large.exp deleted file mode 100644 index 1a676a9b127b0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/number_literal_too_large.exp +++ /dev/null @@ -1,92 +0,0 @@ -error[E04021]: invalid number after type inference - ┌─ tests/move_check/typing/number_literal_too_large.move:3:9 - │ -3 │ 340282366920938463463374607431768211455; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid numerical literal - │ Annotating the literal might help inference: '340282366920938463463374607431768211455u128' - │ Expected a literal of type 'u64', but the value is too large. - -error[E04021]: invalid number after type inference - ┌─ tests/move_check/typing/number_literal_too_large.move:5:10 - │ -5 │ (340282366920938463463374607431768211454: u64); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --- Expected a literal of type 'u64', but the value is too large. - │ │ - │ Invalid numerical literal - │ Annotating the literal might help inference: '340282366920938463463374607431768211454u128' - -error[E04021]: invalid number after type inference - ┌─ tests/move_check/typing/number_literal_too_large.move:6:10 - │ -6 │ (340282366920938463463374607431768211454: u8); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- Expected a literal of type 'u8', but the value is too large. - │ │ - │ Invalid numerical literal - │ Annotating the literal might help inference: '340282366920938463463374607431768211454u128' - -error[E04021]: invalid number after type inference - ┌─ tests/move_check/typing/number_literal_too_large.move:8:10 - │ -8 │ (18446744073709551616: u64); - │ ^^^^^^^^^^^^^^^^^^^^ --- Expected a literal of type 'u64', but the value is too large. - │ │ - │ Invalid numerical literal - │ Annotating the literal might help inference: '18446744073709551616u128' - -error[E04021]: invalid number after type inference - ┌─ tests/move_check/typing/number_literal_too_large.move:9:10 - │ -9 │ (18446744073709551616: u8); - │ ^^^^^^^^^^^^^^^^^^^^ -- Expected a literal of type 'u8', but the value is too large. - │ │ - │ Invalid numerical literal - │ Annotating the literal might help inference: '18446744073709551616u128' - -error[E04021]: invalid number after type inference - ┌─ tests/move_check/typing/number_literal_too_large.move:11:10 - │ -11 │ (18446744073709551615: u8); - │ ^^^^^^^^^^^^^^^^^^^^ -- Expected a literal of type 'u8', but the value is too large. - │ │ - │ Invalid numerical literal - │ Annotating the literal might help inference: '18446744073709551615u64' - -error[E04021]: invalid number after type inference - ┌─ tests/move_check/typing/number_literal_too_large.move:13:10 - │ -13 │ (256: u8); - │ ^^^ -- Expected a literal of type 'u8', but the value is too large. - │ │ - │ Invalid numerical literal - │ Annotating the literal might help inference: '256u16' - -error[E04021]: invalid number after type inference - ┌─ tests/move_check/typing/number_literal_too_large.move:19:10 - │ -19 │ (3402534025: u16); - │ ^^^^^^^^^^ --- Expected a literal of type 'u16', but the value is too large. - │ │ - │ Invalid numerical literal - │ Annotating the literal might help inference: '3402534025u32' - -error[E04021]: invalid number after type inference - ┌─ tests/move_check/typing/number_literal_too_large.move:22:10 - │ -22 │ (3402534025534025: u32); - │ ^^^^^^^^^^^^^^^^ --- Expected a literal of type 'u32', but the value is too large. - │ │ - │ Invalid numerical literal - │ Annotating the literal might help inference: '3402534025534025u64' - -error[E04021]: invalid number after type inference - ┌─ tests/move_check/typing/number_literal_too_large.move:24:9 - │ -24 │ 340282366920938463463374607431768211455607431768211455; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Invalid numerical literal - │ Annotating the literal might help inference: '340282366920938463463374607431768211455607431768211455u256' - │ Expected a literal of type 'u64', but the value is too large. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/number_literal_too_large.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/number_literal_too_large.snap new file mode 100644 index 0000000000000..8abaca419d475 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/number_literal_too_large.snap @@ -0,0 +1,99 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/number_literal_too_large.move +--- +error[E04021]: invalid number after type inference + ┌─ tests/move_check/typing/number_literal_too_large.move:3:9 + │ +3 │ 340282366920938463463374607431768211455; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid numerical literal + │ Annotating the literal might help inference: '340282366920938463463374607431768211455u128' + │ Expected a literal of type 'u64', but the value is too large. + +error[E04021]: invalid number after type inference + ┌─ tests/move_check/typing/number_literal_too_large.move:5:10 + │ +5 │ (340282366920938463463374607431768211454: u64); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --- Expected a literal of type 'u64', but the value is too large. + │ │ + │ Invalid numerical literal + │ Annotating the literal might help inference: '340282366920938463463374607431768211454u128' + +error[E04021]: invalid number after type inference + ┌─ tests/move_check/typing/number_literal_too_large.move:6:10 + │ +6 │ (340282366920938463463374607431768211454: u8); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- Expected a literal of type 'u8', but the value is too large. + │ │ + │ Invalid numerical literal + │ Annotating the literal might help inference: '340282366920938463463374607431768211454u128' + +error[E04021]: invalid number after type inference + ┌─ tests/move_check/typing/number_literal_too_large.move:8:10 + │ +8 │ (18446744073709551616: u64); + │ ^^^^^^^^^^^^^^^^^^^^ --- Expected a literal of type 'u64', but the value is too large. + │ │ + │ Invalid numerical literal + │ Annotating the literal might help inference: '18446744073709551616u128' + +error[E04021]: invalid number after type inference + ┌─ tests/move_check/typing/number_literal_too_large.move:9:10 + │ +9 │ (18446744073709551616: u8); + │ ^^^^^^^^^^^^^^^^^^^^ -- Expected a literal of type 'u8', but the value is too large. + │ │ + │ Invalid numerical literal + │ Annotating the literal might help inference: '18446744073709551616u128' + +error[E04021]: invalid number after type inference + ┌─ tests/move_check/typing/number_literal_too_large.move:11:10 + │ +11 │ (18446744073709551615: u8); + │ ^^^^^^^^^^^^^^^^^^^^ -- Expected a literal of type 'u8', but the value is too large. + │ │ + │ Invalid numerical literal + │ Annotating the literal might help inference: '18446744073709551615u64' + +error[E04021]: invalid number after type inference + ┌─ tests/move_check/typing/number_literal_too_large.move:13:10 + │ +13 │ (256: u8); + │ ^^^ -- Expected a literal of type 'u8', but the value is too large. + │ │ + │ Invalid numerical literal + │ Annotating the literal might help inference: '256u16' + +error[E04021]: invalid number after type inference + ┌─ tests/move_check/typing/number_literal_too_large.move:19:10 + │ +19 │ (3402534025: u16); + │ ^^^^^^^^^^ --- Expected a literal of type 'u16', but the value is too large. + │ │ + │ Invalid numerical literal + │ Annotating the literal might help inference: '3402534025u32' + +error[E04021]: invalid number after type inference + ┌─ tests/move_check/typing/number_literal_too_large.move:22:10 + │ +22 │ (3402534025534025: u32); + │ ^^^^^^^^^^^^^^^^ --- Expected a literal of type 'u32', but the value is too large. + │ │ + │ Invalid numerical literal + │ Annotating the literal might help inference: '3402534025534025u64' + +error[E04021]: invalid number after type inference + ┌─ tests/move_check/typing/number_literal_too_large.move:24:9 + │ +24 │ 340282366920938463463374607431768211455607431768211455; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Invalid numerical literal + │ Annotating the literal might help inference: '340282366920938463463374607431768211455607431768211455u256' + │ Expected a literal of type 'u64', but the value is too large. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/other_builtins.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/other_builtins.snap new file mode 100644 index 0000000000000..ec7cfab036c7c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/other_builtins.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/other_builtins.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/other_builtins_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/other_builtins_invalid.exp deleted file mode 100644 index 2e6cf23c0cfed..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/other_builtins_invalid.exp +++ /dev/null @@ -1,89 +0,0 @@ -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/other_builtins_invalid.move:4:10 - │ -3 │ fun foo(x: &u64) { - │ ---- Given: '&u64' -4 │ (freeze(x): &mut u64); - │ ^^^^^^^^^^^^^^ - │ │ - │ Invalid call of 'freeze'. Invalid argument for parameter '0' - │ Expected: '&mut u64' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/other_builtins_invalid.move:4:26 - │ -4 │ (freeze(x): &mut u64); - │ -------------- ^^^^^^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: '&mut u64' - │ Given: '&u64' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/other_builtins_invalid.move:5:10 - │ -5 │ (freeze>(&any()): &mut vector); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: '&_' - │ Invalid call of 'freeze'. Invalid argument for parameter '0' - │ Expected: '&mut vector' - -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/other_builtins_invalid.move:5:32 - │ -5 │ (freeze>(&any()): &mut vector); - │ ^^^^^ Could not infer this type. Try adding an annotation - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/other_builtins_invalid.move:5:40 - │ -5 │ (freeze>(&any()): &mut vector); - │ ---------------------------- ^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: '&mut vector' - │ Given: '&vector' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/other_builtins_invalid.move:7:10 - │ -7 │ (assert!(42, true): ()); - │ ^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: integer - │ Invalid call of 'assert'. Invalid argument for parameter '0' - │ Expected: 'bool' - -error[E04035]: invalid constant usage in error context - ┌─ tests/move_check/typing/other_builtins_invalid.move:7:22 - │ -7 │ (assert!(42, true): ()); - │ ^^^^ - │ │ - │ Invalid error code for assertion, expected a u64 or constant declared with '#[error]' annotation - │ If you want to use a non-u64 as an abort code, you must use a '#[error]' attribute on a constant - │ - = Non-u64 constants can only be used as error codes if the '#[error]' attribute is added to them. - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/other_builtins_invalid.move:8:38 - │ -8 │ (assert!(true && false, *x): bool); - │ -------------------------- ^^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: 'bool' - │ Given: '()' - -error[E04035]: invalid constant usage in error context - ┌─ tests/move_check/typing/other_builtins_invalid.move:9:32 - │ -9 │ assert!(true || false, 0u8); - │ ^^^ - │ │ - │ Invalid error code for assertion, expected a u64 or constant declared with '#[error]' annotation - │ If you want to use a non-u64 as an abort code, you must use a '#[error]' attribute on a constant - │ - = Non-u64 constants can only be used as error codes if the '#[error]' attribute is added to them. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/other_builtins_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/other_builtins_invalid.snap new file mode 100644 index 0000000000000..d01c46e29bc34 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/other_builtins_invalid.snap @@ -0,0 +1,96 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/other_builtins_invalid.move +--- +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/other_builtins_invalid.move:4:10 + │ +3 │ fun foo(x: &u64) { + │ ---- Given: '&u64' +4 │ (freeze(x): &mut u64); + │ ^^^^^^^^^^^^^^ + │ │ + │ Invalid call of 'freeze'. Invalid argument for parameter '0' + │ Expected: '&mut u64' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/other_builtins_invalid.move:4:26 + │ +4 │ (freeze(x): &mut u64); + │ -------------- ^^^^^^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: '&mut u64' + │ Given: '&u64' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/other_builtins_invalid.move:5:10 + │ +5 │ (freeze>(&any()): &mut vector); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: '&_' + │ Invalid call of 'freeze'. Invalid argument for parameter '0' + │ Expected: '&mut vector' + +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/other_builtins_invalid.move:5:32 + │ +5 │ (freeze>(&any()): &mut vector); + │ ^^^^^ Could not infer this type. Try adding an annotation + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/other_builtins_invalid.move:5:40 + │ +5 │ (freeze>(&any()): &mut vector); + │ ---------------------------- ^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: '&mut vector' + │ Given: '&vector' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/other_builtins_invalid.move:7:10 + │ +7 │ (assert!(42, true): ()); + │ ^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: integer + │ Invalid call of 'assert'. Invalid argument for parameter '0' + │ Expected: 'bool' + +error[E04035]: invalid constant usage in error context + ┌─ tests/move_check/typing/other_builtins_invalid.move:7:22 + │ +7 │ (assert!(42, true): ()); + │ ^^^^ + │ │ + │ Invalid error code for assertion, expected a u64 or constant declared with '#[error]' annotation + │ If you want to use a non-u64 as an abort code, you must use a '#[error]' attribute on a constant + │ + = Non-u64 constants can only be used as error codes if the '#[error]' attribute is added to them. + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/other_builtins_invalid.move:8:38 + │ +8 │ (assert!(true && false, *x): bool); + │ -------------------------- ^^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: 'bool' + │ Given: '()' + +error[E04035]: invalid constant usage in error context + ┌─ tests/move_check/typing/other_builtins_invalid.move:9:32 + │ +9 │ assert!(true || false, 0u8); + │ ^^^ + │ │ + │ Invalid error code for assertion, expected a u64 or constant declared with '#[error]' annotation + │ If you want to use a non-u64 as an abort code, you must use a '#[error]' attribute on a constant + │ + = Non-u64 constants can only be used as error codes if the '#[error]' attribute is added to them. diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack.exp deleted file mode 100644 index 5d19339c9f7db..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/pack.move:14:27 - │ - 2 │ struct S has drop { f: u64 } - │ - To satisfy the constraint, the 'copy' ability would need to be added here - · -12 │ let s = S{ f: 0 }; - │ --------- The type '0x8675309::M::S' does not have the ability 'copy' -13 │ let n1 = Nat { f }; -14 │ let n2 = Nat { f: *&s }; - │ ^^^ Invalid dereference. Dereference requires the 'copy' ability - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack.snap new file mode 100644 index 0000000000000..585818b897308 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/pack.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/pack.move:14:27 + │ + 2 │ struct S has drop { f: u64 } + │ - To satisfy the constraint, the 'copy' ability would need to be added here + · +12 │ let s = S{ f: 0 }; + │ --------- The type '0x8675309::M::S' does not have the ability 'copy' +13 │ let n1 = Nat { f }; +14 │ let n2 = Nat { f: *&s }; + │ ^^^ Invalid dereference. Dereference requires the 'copy' ability diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_constraint_not_satisfied.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_constraint_not_satisfied.exp deleted file mode 100644 index 118a0b52a344f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_constraint_not_satisfied.exp +++ /dev/null @@ -1,136 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:7:9 - │ -3 │ struct R { r: T } - │ --- 'key' constraint declared here - · -7 │ R {r:_ } = R { r: 0 }; - │ ^^^^^^^^ - The type 'u64' does not have the ability 'key' - │ │ - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:7:20 - │ -3 │ struct R { r: T } - │ --- 'key' constraint declared here - · -7 │ R {r:_ } = R { r: 0 }; - │ ^^^^^^^^^^ - │ │ │ - │ │ The type 'u64' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:8:9 - │ -2 │ struct Coin {} - │ ---- To satisfy the constraint, the 'drop' ability would need to be added here -3 │ struct R { r: T } -4 │ struct S has drop { c: T } - │ ---- 'drop' constraint declared here - · -8 │ S { c: Coin {} }; - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Coin' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:8:9 - │ -8 │ S { c: Coin {} }; - │ ^^^^^^^^^^^^^^^^ - │ │ - │ Cannot ignore values without the 'drop' ability. The value must be used - │ The type '0x8675309::M::S<0x8675309::M::Coin>' can have the ability 'drop' but the type argument '0x8675309::M::Coin' does not have the required ability 'drop' - │ The type '0x8675309::M::S<0x8675309::M::Coin>' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:12:9 - │ - 3 │ struct R { r: T } - │ - --- 'key' constraint declared here - │ │ - │ To satisfy the constraint, the 'key' ability would need to be added here - · -12 │ R {r: R { r: _ } } = R { r: R { r: 0 }}; - │ ^^^^^^^^^^^^^^^^^^ ---------- The type '0x8675309::M::R' does not have the ability 'key' - │ │ - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:12:15 - │ - 3 │ struct R { r: T } - │ --- 'key' constraint declared here - · -12 │ R {r: R { r: _ } } = R { r: R { r: 0 }}; - │ ^^^^^^^^^^ - The type 'u64' does not have the ability 'key' - │ │ - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:12:30 - │ - 3 │ struct R { r: T } - │ - --- 'key' constraint declared here - │ │ - │ To satisfy the constraint, the 'key' ability would need to be added here - · -12 │ R {r: R { r: _ } } = R { r: R { r: 0 }}; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::R' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:12:37 - │ - 3 │ struct R { r: T } - │ --- 'key' constraint declared here - · -12 │ R {r: R { r: _ } } = R { r: R { r: 0 }}; - │ ^^^^^^^^^^ - │ │ │ - │ │ The type 'u64' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:13:9 - │ - 4 │ struct S has drop { c: T } - │ ---- 'drop' constraint declared here - · -13 │ S { c: S { c: Coin {} } }; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x8675309::M::S<0x8675309::M::Coin>' can have the ability 'drop' but the type argument '0x8675309::M::Coin' does not have the required ability 'drop' - │ │ The type '0x8675309::M::S<0x8675309::M::Coin>' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:13:9 - │ -13 │ S { c: S { c: Coin {} } }; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ Cannot ignore values without the 'drop' ability. The value must be used - │ The type '0x8675309::M::S<0x8675309::M::S<0x8675309::M::Coin>>' can have the ability 'drop' but the type argument '0x8675309::M::S<0x8675309::M::Coin>' does not have the required ability 'drop' - │ The type '0x8675309::M::S<0x8675309::M::S<0x8675309::M::Coin>>' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:13:16 - │ - 2 │ struct Coin {} - │ ---- To satisfy the constraint, the 'drop' ability would need to be added here - 3 │ struct R { r: T } - 4 │ struct S has drop { c: T } - │ ---- 'drop' constraint declared here - · -13 │ S { c: S { c: Coin {} } }; - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x8675309::M::Coin' does not have the ability 'drop' - │ 'drop' constraint not satisifed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_constraint_not_satisfied.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_constraint_not_satisfied.snap new file mode 100644 index 0000000000000..5cd2cb3aad8a5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_constraint_not_satisfied.snap @@ -0,0 +1,143 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/pack_constraint_not_satisfied.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:7:9 + │ +3 │ struct R { r: T } + │ --- 'key' constraint declared here + · +7 │ R {r:_ } = R { r: 0 }; + │ ^^^^^^^^ - The type 'u64' does not have the ability 'key' + │ │ + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:7:20 + │ +3 │ struct R { r: T } + │ --- 'key' constraint declared here + · +7 │ R {r:_ } = R { r: 0 }; + │ ^^^^^^^^^^ + │ │ │ + │ │ The type 'u64' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:8:9 + │ +2 │ struct Coin {} + │ ---- To satisfy the constraint, the 'drop' ability would need to be added here +3 │ struct R { r: T } +4 │ struct S has drop { c: T } + │ ---- 'drop' constraint declared here + · +8 │ S { c: Coin {} }; + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Coin' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:8:9 + │ +8 │ S { c: Coin {} }; + │ ^^^^^^^^^^^^^^^^ + │ │ + │ Cannot ignore values without the 'drop' ability. The value must be used + │ The type '0x8675309::M::S<0x8675309::M::Coin>' can have the ability 'drop' but the type argument '0x8675309::M::Coin' does not have the required ability 'drop' + │ The type '0x8675309::M::S<0x8675309::M::Coin>' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:12:9 + │ + 3 │ struct R { r: T } + │ - --- 'key' constraint declared here + │ │ + │ To satisfy the constraint, the 'key' ability would need to be added here + · +12 │ R {r: R { r: _ } } = R { r: R { r: 0 }}; + │ ^^^^^^^^^^^^^^^^^^ ---------- The type '0x8675309::M::R' does not have the ability 'key' + │ │ + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:12:15 + │ + 3 │ struct R { r: T } + │ --- 'key' constraint declared here + · +12 │ R {r: R { r: _ } } = R { r: R { r: 0 }}; + │ ^^^^^^^^^^ - The type 'u64' does not have the ability 'key' + │ │ + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:12:30 + │ + 3 │ struct R { r: T } + │ - --- 'key' constraint declared here + │ │ + │ To satisfy the constraint, the 'key' ability would need to be added here + · +12 │ R {r: R { r: _ } } = R { r: R { r: 0 }}; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::R' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:12:37 + │ + 3 │ struct R { r: T } + │ --- 'key' constraint declared here + · +12 │ R {r: R { r: _ } } = R { r: R { r: 0 }}; + │ ^^^^^^^^^^ + │ │ │ + │ │ The type 'u64' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:13:9 + │ + 4 │ struct S has drop { c: T } + │ ---- 'drop' constraint declared here + · +13 │ S { c: S { c: Coin {} } }; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x8675309::M::S<0x8675309::M::Coin>' can have the ability 'drop' but the type argument '0x8675309::M::Coin' does not have the required ability 'drop' + │ │ The type '0x8675309::M::S<0x8675309::M::Coin>' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:13:9 + │ +13 │ S { c: S { c: Coin {} } }; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ + │ Cannot ignore values without the 'drop' ability. The value must be used + │ The type '0x8675309::M::S<0x8675309::M::S<0x8675309::M::Coin>>' can have the ability 'drop' but the type argument '0x8675309::M::S<0x8675309::M::Coin>' does not have the required ability 'drop' + │ The type '0x8675309::M::S<0x8675309::M::S<0x8675309::M::Coin>>' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/pack_constraint_not_satisfied.move:13:16 + │ + 2 │ struct Coin {} + │ ---- To satisfy the constraint, the 'drop' ability would need to be added here + 3 │ struct R { r: T } + 4 │ struct S has drop { c: T } + │ ---- 'drop' constraint declared here + · +13 │ S { c: S { c: Coin {} } }; + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x8675309::M::Coin' does not have the ability 'drop' + │ 'drop' constraint not satisifed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_invalid_argument.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_invalid_argument.exp deleted file mode 100644 index e0097886bebc3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_invalid_argument.exp +++ /dev/null @@ -1,60 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/pack_invalid_argument.move:7:17 - │ -2 │ struct S has drop { f: u64 } - │ --- Expected: 'u64' - · -7 │ (S { f: false } : S); - │ ^^^^^ - │ │ - │ Invalid argument for field 'f' for '0x8675309::M::S' - │ Given: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/pack_invalid_argument.move:17:16 - │ - 4 │ struct R { s: S, f: u64, n1: Nat, n2: Nat } - │ - Expected: '0x8675309::M::S' - · -15 │ } : R); - │ - Given: '0x8675309::M::R' -16 │ (R { -17 │ s: r, - │ ^ Invalid argument for field 's' for '0x8675309::M::R' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/pack_invalid_argument.move:18:16 - │ - 4 │ struct R { s: S, f: u64, n1: Nat, n2: Nat } - │ --- Expected: 'u64' - · -18 │ f: false, - │ ^^^^^ - │ │ - │ Invalid argument for field 'f' for '0x8675309::M::R' - │ Given: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/pack_invalid_argument.move:19:17 - │ - 4 │ struct R { s: S, f: u64, n1: Nat, n2: Nat } - │ --- Expected: 'u64' - · -19 │ n1: Nat { f: false }, - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'bool' - │ Invalid argument for field 'n1' for '0x8675309::M::R' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/pack_invalid_argument.move:20:17 - │ - 4 │ struct R { s: S, f: u64, n1: Nat, n2: Nat } - │ - Expected: '0x8675309::M::S' - · -15 │ } : R); - │ - Given: '0x8675309::M::R' - · -20 │ n2: Nat{ f: r } - │ ^^^^^^^^^^^ Invalid argument for field 'n2' for '0x8675309::M::R' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_invalid_argument.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_invalid_argument.snap new file mode 100644 index 0000000000000..3417a905299f2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_invalid_argument.snap @@ -0,0 +1,67 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/pack_invalid_argument.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/pack_invalid_argument.move:7:17 + │ +2 │ struct S has drop { f: u64 } + │ --- Expected: 'u64' + · +7 │ (S { f: false } : S); + │ ^^^^^ + │ │ + │ Invalid argument for field 'f' for '0x8675309::M::S' + │ Given: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/pack_invalid_argument.move:17:16 + │ + 4 │ struct R { s: S, f: u64, n1: Nat, n2: Nat } + │ - Expected: '0x8675309::M::S' + · +15 │ } : R); + │ - Given: '0x8675309::M::R' +16 │ (R { +17 │ s: r, + │ ^ Invalid argument for field 's' for '0x8675309::M::R' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/pack_invalid_argument.move:18:16 + │ + 4 │ struct R { s: S, f: u64, n1: Nat, n2: Nat } + │ --- Expected: 'u64' + · +18 │ f: false, + │ ^^^^^ + │ │ + │ Invalid argument for field 'f' for '0x8675309::M::R' + │ Given: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/pack_invalid_argument.move:19:17 + │ + 4 │ struct R { s: S, f: u64, n1: Nat, n2: Nat } + │ --- Expected: 'u64' + · +19 │ n1: Nat { f: false }, + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'bool' + │ Invalid argument for field 'n1' for '0x8675309::M::R' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/pack_invalid_argument.move:20:17 + │ + 4 │ struct R { s: S, f: u64, n1: Nat, n2: Nat } + │ - Expected: '0x8675309::M::S' + · +15 │ } : R); + │ - Given: '0x8675309::M::R' + · +20 │ n2: Nat{ f: r } + │ ^^^^^^^^^^^ Invalid argument for field 'n2' for '0x8675309::M::R' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_missing_field.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_missing_field.exp deleted file mode 100644 index b48b1799ef9be..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_missing_field.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E04016]: too few arguments - ┌─ tests/move_check/typing/pack_missing_field.move:7:10 - │ -7 │ (S { } : S); - │ ^^^^^ Missing argument for field 'f' in '0x8675309::M::S' - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/pack_missing_field.move:8:37 - │ -8 │ R {s:_, f:_, n1:_, n2:_} = (R { s: S{f: 0}, n1: Nat{f: 0}, f: 0, } : R); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Missing argument for field 'n2' in '0x8675309::M::R' - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/pack_missing_field.move:14:37 - │ -14 │ R {s:_, f:_, n1:_, n2:_} = (R { s, n2, n1 }: R); - │ ^^^^^^^^^^^^^^^ Missing argument for field 'f' in '0x8675309::M::R' - -error[E04016]: too few arguments - ┌─ tests/move_check/typing/pack_missing_field.move:16:28 - │ -16 │ (Nat { f: Nat { f: Nat { }}}: Nat>>); - │ ^^^^^^^ Missing argument for field 'f' in '0x8675309::M::Nat' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_missing_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_missing_field.snap new file mode 100644 index 0000000000000..3fe9c54a54df4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_missing_field.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/pack_missing_field.move +--- +error[E04016]: too few arguments + ┌─ tests/move_check/typing/pack_missing_field.move:7:10 + │ +7 │ (S { } : S); + │ ^^^^^ Missing argument for field 'f' in '0x8675309::M::S' + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/pack_missing_field.move:8:37 + │ +8 │ R {s:_, f:_, n1:_, n2:_} = (R { s: S{f: 0}, n1: Nat{f: 0}, f: 0, } : R); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Missing argument for field 'n2' in '0x8675309::M::R' + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/pack_missing_field.move:14:37 + │ +14 │ R {s:_, f:_, n1:_, n2:_} = (R { s, n2, n1 }: R); + │ ^^^^^^^^^^^^^^^ Missing argument for field 'f' in '0x8675309::M::R' + +error[E04016]: too few arguments + ┌─ tests/move_check/typing/pack_missing_field.move:16:28 + │ +16 │ (Nat { f: Nat { f: Nat { }}}: Nat>>); + │ ^^^^^^^ Missing argument for field 'f' in '0x8675309::M::Nat' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_multiple.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_multiple.exp deleted file mode 100644 index 94723c555405b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_multiple.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/pack_multiple.move:5:9 - │ -5 │ Box { f: (0, 1) }; - │ ^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '(u64, u64)' - │ Invalid type argument - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/pack_multiple.move:6:9 - │ -6 │ Box { f: (0, 1, 2) }; - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '(u64, u64, u64)' - │ Invalid type argument - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/pack_multiple.move:7:9 - │ -7 │ Box { f: (true, Box { f: 0 }) }; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '(bool, 0x8675309::M::Box)' - │ Invalid type argument - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_multiple.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_multiple.snap new file mode 100644 index 0000000000000..6dd5c7d1ca566 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_multiple.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/pack_multiple.move +--- +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/pack_multiple.move:5:9 + │ +5 │ Box { f: (0, 1) }; + │ ^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '(u64, u64)' + │ Invalid type argument + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/pack_multiple.move:6:9 + │ +6 │ Box { f: (0, 1, 2) }; + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '(u64, u64, u64)' + │ Invalid type argument + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/pack_multiple.move:7:9 + │ +7 │ Box { f: (true, Box { f: 0 }) }; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '(bool, 0x8675309::M::Box)' + │ Invalid type argument diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_private_with_field.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_private_with_field.exp deleted file mode 100644 index f77919b74d63f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_private_with_field.exp +++ /dev/null @@ -1,15 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/pack_private_with_field.move:19:11 - │ - 3 │ struct S { - │ - Struct defined in module '0x42::m' - · -19 │ let s = S { - │ ╭───────────^ -20 │ │ f1: 0, -21 │ │ f4: 0, -22 │ │ f2: 0, -23 │ │ f3: 0, -24 │ │ }; - │ ╰───^ Struct '0x42::m::S' can only be instantiated within its defining module '0x42::m' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_private_with_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_private_with_field.snap new file mode 100644 index 0000000000000..d773717cf7ac5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_private_with_field.snap @@ -0,0 +1,22 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/pack_private_with_field.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/pack_private_with_field.move:19:11 + │ + 3 │ struct S { + │ - Struct defined in module '0x42::m' + · +19 │ let s = S { + │ ╭───────────^ +20 │ │ f1: 0, +21 │ │ f4: 0, +22 │ │ f2: 0, +23 │ │ f3: 0, +24 │ │ }; + │ ╰───^ Struct '0x42::m::S' can only be instantiated within its defining module '0x42::m' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_reference.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_reference.exp deleted file mode 100644 index 5949ebca4924a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_reference.exp +++ /dev/null @@ -1,17 +0,0 @@ -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/pack_reference.move:5:9 - │ -4 │ fun t0(r_imm: &u64, r_mut: &mut u64) { - │ ---- Expected a single non-reference type, but found: '&u64' -5 │ Box { f: r_imm }; - │ ^^^^^^^^^^^^^^^^ Invalid type argument - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/pack_reference.move:6:9 - │ -4 │ fun t0(r_imm: &u64, r_mut: &mut u64) { - │ -------- Expected a single non-reference type, but found: '&mut u64' -5 │ Box { f: r_imm }; -6 │ Box { f: r_mut }; - │ ^^^^^^^^^^^^^^^^ Invalid type argument - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_reference.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_reference.snap new file mode 100644 index 0000000000000..ded4b3e3e3814 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_reference.snap @@ -0,0 +1,24 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/pack_reference.move +--- +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/pack_reference.move:5:9 + │ +4 │ fun t0(r_imm: &u64, r_mut: &mut u64) { + │ ---- Expected a single non-reference type, but found: '&u64' +5 │ Box { f: r_imm }; + │ ^^^^^^^^^^^^^^^^ Invalid type argument + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/pack_reference.move:6:9 + │ +4 │ fun t0(r_imm: &u64, r_mut: &mut u64) { + │ -------- Expected a single non-reference type, but found: '&mut u64' +5 │ Box { f: r_imm }; +6 │ Box { f: r_mut }; + │ ^^^^^^^^^^^^^^^^ Invalid type argument diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_unit.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_unit.exp deleted file mode 100644 index f4f157afce03a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_unit.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/pack_unit.move:5:9 - │ -5 │ Box { f: () }; - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '()' - │ Invalid type argument - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_unit.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_unit.snap new file mode 100644 index 0000000000000..8d552322f97a3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_unit.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/pack_unit.move +--- +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/pack_unit.move:5:9 + │ +5 │ Box { f: () }; + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '()' + │ Invalid type argument diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_unpack_private.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_unpack_private.exp deleted file mode 100644 index 5aa2d3fbf8ada..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_unpack_private.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/pack_unpack_private.move:8:9 - │ -2 │ struct T {} - │ - Struct defined in module '0x43::C' - · -8 │ C::T {} - │ ^^^^^^^ Struct '0x43::C::T' can only be instantiated within its defining module '0x43::C' - -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/pack_unpack_private.move:11:13 - │ - 2 │ struct T {} - │ - Struct defined in module '0x43::C' - · -11 │ let C::T {} = c; - │ ^^^^^^^ Struct '0x43::C::T' can only be used in deconstruction binding within its defining module '0x43::C' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_unpack_private.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_unpack_private.snap new file mode 100644 index 0000000000000..6578d0c5c86a0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/pack_unpack_private.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/pack_unpack_private.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/pack_unpack_private.move:8:9 + │ +2 │ struct T {} + │ - Struct defined in module '0x43::C' + · +8 │ C::T {} + │ ^^^^^^^ Struct '0x43::C::T' can only be instantiated within its defining module '0x43::C' + +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/pack_unpack_private.move:11:13 + │ + 2 │ struct T {} + │ - Struct defined in module '0x43::C' + · +11 │ let C::T {} = c; + │ ^^^^^^^ Struct '0x43::C::T' can only be used in deconstruction binding within its defining module '0x43::C' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_param_op_abilities.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_param_op_abilities.snap new file mode 100644 index 0000000000000..1a9cab5237af7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_param_op_abilities.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/phantom_param_op_abilities.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_param_op_abilities_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_param_op_abilities_invalid.exp deleted file mode 100644 index 24413e10c9b1a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_param_op_abilities_invalid.exp +++ /dev/null @@ -1,71 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_param_op_abilities_invalid.move:11:10 - │ -10 │ fun f1(ref: &mut HasDrop) { - │ --------------------------------- - │ │ │ - │ │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'drop' but the type argument '0x42::M::NoAbilities' does not have the required ability 'drop' - │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'drop' -11 │ *ref = HasDrop { a: NoAbilities { } }; - │ ^^^ Invalid mutation. Mutation requires the 'drop' ability as the old value is destroyed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_param_op_abilities_invalid.move:16:9 - │ -16 │ _ = HasDrop { a: NoAbilities { } }; - │ ^ -------------------------------------------------------- - │ │ │ │ - │ │ │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'drop' but the type argument '0x42::M::NoAbilities' does not have the required ability 'drop' - │ │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/typing/phantom_param_op_abilities_invalid.move:20:51 - │ -20 │ fun f3(_x: HasDrop) { - │ -- --------------------------------- - │ │ │ │ - │ │ │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'drop' but the type argument '0x42::M::NoAbilities' does not have the required ability 'drop' - │ │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'drop' - │ The parameter '_x' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns - │ ╭───────────────────────────────────────────────────^ -21 │ │ } - │ ╰─────^ Invalid return - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_param_op_abilities_invalid.move:25:10 - │ -24 │ fun f4(x: HasCopy): (HasCopy, HasCopy) { - │ --------------------------------- - │ │ │ - │ │ The type '0x42::M::HasCopy<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'copy' but the type argument '0x42::M::NoAbilities' does not have the required ability 'copy' - │ The type '0x42::M::HasCopy<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'copy' -25 │ (copy x, x) - │ ^^^^^^ Invalid 'copy' of owned value without the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_param_op_abilities_invalid.move:29:15 - │ - 7 │ struct RequireStore { a: T } - │ ----- 'store' constraint declared here - · -29 │ fun f8(): RequireStore> { - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'store' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' - │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'store' - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_param_op_abilities_invalid.move:30:9 - │ - 7 │ struct RequireStore { a: T } - │ ----- 'store' constraint declared here - · -30 │ RequireStore> { a: HasStore { a: NoAbilities {} } } - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'store' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' - │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'store' - │ 'store' constraint not satisifed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_param_op_abilities_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_param_op_abilities_invalid.snap new file mode 100644 index 0000000000000..5d63a4b74f008 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_param_op_abilities_invalid.snap @@ -0,0 +1,78 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/phantom_param_op_abilities_invalid.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_param_op_abilities_invalid.move:11:10 + │ +10 │ fun f1(ref: &mut HasDrop) { + │ --------------------------------- + │ │ │ + │ │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'drop' but the type argument '0x42::M::NoAbilities' does not have the required ability 'drop' + │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'drop' +11 │ *ref = HasDrop { a: NoAbilities { } }; + │ ^^^ Invalid mutation. Mutation requires the 'drop' ability as the old value is destroyed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_param_op_abilities_invalid.move:16:9 + │ +16 │ _ = HasDrop { a: NoAbilities { } }; + │ ^ -------------------------------------------------------- + │ │ │ │ + │ │ │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'drop' but the type argument '0x42::M::NoAbilities' does not have the required ability 'drop' + │ │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/typing/phantom_param_op_abilities_invalid.move:20:51 + │ +20 │ fun f3(_x: HasDrop) { + │ -- --------------------------------- + │ │ │ │ + │ │ │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'drop' but the type argument '0x42::M::NoAbilities' does not have the required ability 'drop' + │ │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'drop' + │ The parameter '_x' still contains a value. The value does not have the 'drop' ability and must be consumed before the function returns + │ ╭───────────────────────────────────────────────────^ +21 │ │ } + │ ╰─────^ Invalid return + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_param_op_abilities_invalid.move:25:10 + │ +24 │ fun f4(x: HasCopy): (HasCopy, HasCopy) { + │ --------------------------------- + │ │ │ + │ │ The type '0x42::M::HasCopy<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'copy' but the type argument '0x42::M::NoAbilities' does not have the required ability 'copy' + │ The type '0x42::M::HasCopy<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'copy' +25 │ (copy x, x) + │ ^^^^^^ Invalid 'copy' of owned value without the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_param_op_abilities_invalid.move:29:15 + │ + 7 │ struct RequireStore { a: T } + │ ----- 'store' constraint declared here + · +29 │ fun f8(): RequireStore> { + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'store' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' + │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'store' + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_param_op_abilities_invalid.move:30:9 + │ + 7 │ struct RequireStore { a: T } + │ ----- 'store' constraint declared here + · +30 │ RequireStore> { a: HasStore { a: NoAbilities {} } } + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'store' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' + │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'store' + │ 'store' constraint not satisifed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_param_struct_decl.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_param_struct_decl.snap new file mode 100644 index 0000000000000..73eef1a951b31 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_param_struct_decl.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/phantom_param_struct_decl.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_param_struct_decl_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_param_struct_decl_invalid.exp deleted file mode 100644 index ac8f85e668c9e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_param_struct_decl_invalid.exp +++ /dev/null @@ -1,56 +0,0 @@ -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_check/typing/phantom_param_struct_decl_invalid.move:4:12 - │ -2 │ struct S1 { - │ - 'T' declared here as phantom -3 │ // A phantom parameter cannot be used as the type of a field -4 │ a: T, - │ ^ Phantom type parameter cannot be used as a field type - -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_check/typing/phantom_param_struct_decl_invalid.move:6:19 - │ -2 │ struct S1 { - │ - 'T' declared here as phantom - · -6 │ b: vector - │ ^ Phantom type parameter cannot be used as an argument to a non-phantom parameter - -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_check/typing/phantom_param_struct_decl_invalid.move:12:15 - │ -11 │ struct S3 { - │ - 'T' declared here as phantom -12 │ a: S2 - │ ^ Phantom type parameter cannot be used as an argument to a non-phantom parameter - -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_check/typing/phantom_param_struct_decl_invalid.move:17:18 - │ -16 │ struct S4 { - │ - 'T' declared here as phantom -17 │ a: S2> - │ ^ Phantom type parameter cannot be used as an argument to a non-phantom parameter - -error[E02013]: invalid phantom type parameter usage - ┌─ tests/move_check/typing/phantom_param_struct_decl_invalid.move:23:12 - │ -21 │ struct S5 { - │ -- 'T2' declared here as phantom -22 │ a: T1, -23 │ b: T2, - │ ^^ Phantom type parameter cannot be used as a field type - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_param_struct_decl_invalid.move:30:12 - │ -28 │ struct S6 { a: bool } - │ ---- 'copy' constraint declared here -29 │ struct S7 { - │ - To satisfy the constraint, the 'copy' ability would need to be added here -30 │ a: S6 - │ ^^^^^ - │ │ │ - │ │ The type 'T' does not have the ability 'copy' - │ 'copy' constraint not satisifed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_param_struct_decl_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_param_struct_decl_invalid.snap new file mode 100644 index 0000000000000..c7d4f10754f15 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_param_struct_decl_invalid.snap @@ -0,0 +1,63 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/phantom_param_struct_decl_invalid.move +--- +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_check/typing/phantom_param_struct_decl_invalid.move:4:12 + │ +2 │ struct S1 { + │ - 'T' declared here as phantom +3 │ // A phantom parameter cannot be used as the type of a field +4 │ a: T, + │ ^ Phantom type parameter cannot be used as a field type + +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_check/typing/phantom_param_struct_decl_invalid.move:6:19 + │ +2 │ struct S1 { + │ - 'T' declared here as phantom + · +6 │ b: vector + │ ^ Phantom type parameter cannot be used as an argument to a non-phantom parameter + +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_check/typing/phantom_param_struct_decl_invalid.move:12:15 + │ +11 │ struct S3 { + │ - 'T' declared here as phantom +12 │ a: S2 + │ ^ Phantom type parameter cannot be used as an argument to a non-phantom parameter + +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_check/typing/phantom_param_struct_decl_invalid.move:17:18 + │ +16 │ struct S4 { + │ - 'T' declared here as phantom +17 │ a: S2> + │ ^ Phantom type parameter cannot be used as an argument to a non-phantom parameter + +error[E02013]: invalid phantom type parameter usage + ┌─ tests/move_check/typing/phantom_param_struct_decl_invalid.move:23:12 + │ +21 │ struct S5 { + │ -- 'T2' declared here as phantom +22 │ a: T1, +23 │ b: T2, + │ ^^ Phantom type parameter cannot be used as a field type + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_param_struct_decl_invalid.move:30:12 + │ +28 │ struct S6 { a: bool } + │ ---- 'copy' constraint declared here +29 │ struct S7 { + │ - To satisfy the constraint, the 'copy' ability would need to be added here +30 │ a: S6 + │ ^^^^^ + │ │ │ + │ │ The type 'T' does not have the ability 'copy' + │ 'copy' constraint not satisifed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_params_constraint_abilities.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_params_constraint_abilities.snap new file mode 100644 index 0000000000000..258c20d4eccb7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_params_constraint_abilities.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/phantom_params_constraint_abilities.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_params_constraint_abilities_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_params_constraint_abilities_invalid.exp deleted file mode 100644 index 5dec056283988..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_params_constraint_abilities_invalid.exp +++ /dev/null @@ -1,244 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:11:12 - │ - 9 │ struct S1 { a: T } - │ ---- 'copy' constraint declared here -10 │ struct S2 { -11 │ a: S1>, - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'copy' but the type argument '0x42::M::NoAbilities' does not have the required ability 'copy' - │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:11:12 - │ - 9 │ struct S1 { a: T } - │ ---- 'drop' constraint declared here -10 │ struct S2 { -11 │ a: S1>, - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'drop' but the type argument '0x42::M::NoAbilities' does not have the required ability 'drop' - │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:11:12 - │ - 9 │ struct S1 { a: T } - │ --- 'key' constraint declared here -10 │ struct S2 { -11 │ a: S1>, - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'key' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' - │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:11:12 - │ - 9 │ struct S1 { a: T } - │ ----- 'store' constraint declared here -10 │ struct S2 { -11 │ a: S1>, - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'store' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' - │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'store' - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:16:12 - │ -14 │ struct S3 { a: T1, b: T2, c: T3, d: T4 } - │ ---- 'copy' constraint declared here -15 │ struct S4 { -16 │ a: S3< HasDrop, - │ ╭────────────^ -17 │ │ HasCopy, - │ │ --------------------------------- - │ │ │ │ - │ │ │ The type '0x42::M::HasCopy<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'copy' but the type argument '0x42::M::NoAbilities' does not have the required ability 'copy' - │ │ The type '0x42::M::HasCopy<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'copy' -18 │ │ HasStore, -19 │ │ HasKey -20 │ │ > - │ ╰──────────────^ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:16:12 - │ -14 │ struct S3 { a: T1, b: T2, c: T3, d: T4 } - │ ---- 'drop' constraint declared here -15 │ struct S4 { -16 │ a: S3< HasDrop, - │ --------------------------------- - │ │ │ - │ │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'drop' but the type argument '0x42::M::NoAbilities' does not have the required ability 'drop' - │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'drop' - │ ╭────────────^ -17 │ │ HasCopy, -18 │ │ HasStore, -19 │ │ HasKey -20 │ │ > - │ ╰──────────────^ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:16:12 - │ -14 │ struct S3 { a: T1, b: T2, c: T3, d: T4 } - │ --- 'key' constraint declared here -15 │ struct S4 { -16 │ a: S3< HasDrop, - │ ╭────────────^ -17 │ │ HasCopy, -18 │ │ HasStore, -19 │ │ HasKey - │ │ -------------------------------- - │ │ │ │ - │ │ │ The type '0x42::M::HasKey<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'key' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' - │ │ The type '0x42::M::HasKey<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'key' -20 │ │ > - │ ╰──────────────^ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:16:12 - │ -14 │ struct S3 { a: T1, b: T2, c: T3, d: T4 } - │ ----- 'store' constraint declared here -15 │ struct S4 { -16 │ a: S3< HasDrop, - │ ╭────────────^ -17 │ │ HasCopy, -18 │ │ HasStore, - │ │ ---------------------------------- - │ │ │ │ - │ │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'store' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' - │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'store' -19 │ │ HasKey -20 │ │ > - │ ╰──────────────^ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:25:9 - │ -23 │ fun f1() { } - │ ---- 'copy' constraint declared here -24 │ fun f2() { -25 │ f1>(); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'copy' but the type argument '0x42::M::NoAbilities' does not have the required ability 'copy' - │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'copy' - │ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:25:9 - │ -23 │ fun f1() { } - │ ---- 'drop' constraint declared here -24 │ fun f2() { -25 │ f1>(); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'drop' but the type argument '0x42::M::NoAbilities' does not have the required ability 'drop' - │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'drop' - │ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:25:9 - │ -23 │ fun f1() { } - │ --- 'key' constraint declared here -24 │ fun f2() { -25 │ f1>(); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'key' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' - │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'key' - │ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:25:9 - │ -23 │ fun f1() { } - │ ----- 'store' constraint declared here -24 │ fun f2() { -25 │ f1>(); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'store' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' - │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'store' - │ 'store' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:30:9 - │ -28 │ fun f3() { } - │ ---- 'copy' constraint declared here -29 │ fun f4() { -30 │ ╭ f3< HasDrop, -31 │ │ HasCopy, - │ │ --------------------------------- - │ │ │ │ - │ │ │ The type '0x42::M::HasCopy<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'copy' but the type argument '0x42::M::NoAbilities' does not have the required ability 'copy' - │ │ The type '0x42::M::HasCopy<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'copy' -32 │ │ HasStore, -33 │ │ HasKey -34 │ │ >(); - │ ╰─────────────^ 'copy' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:30:9 - │ -28 │ fun f3() { } - │ ---- 'drop' constraint declared here -29 │ fun f4() { -30 │ ╭ f3< HasDrop, - │ --------------------------------- - │ │ │ - │ │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'drop' but the type argument '0x42::M::NoAbilities' does not have the required ability 'drop' - │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'drop' -31 │ │ HasCopy, -32 │ │ HasStore, -33 │ │ HasKey -34 │ │ >(); - │ ╰─────────────^ 'drop' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:30:9 - │ -28 │ fun f3() { } - │ --- 'key' constraint declared here -29 │ fun f4() { -30 │ ╭ f3< HasDrop, -31 │ │ HasCopy, -32 │ │ HasStore, -33 │ │ HasKey - │ │ -------------------------------- - │ │ │ │ - │ │ │ The type '0x42::M::HasKey<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'key' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' - │ │ The type '0x42::M::HasKey<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'key' -34 │ │ >(); - │ ╰─────────────^ 'key' constraint not satisifed - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:30:9 - │ -28 │ fun f3() { } - │ ----- 'store' constraint declared here -29 │ fun f4() { -30 │ ╭ f3< HasDrop, -31 │ │ HasCopy, -32 │ │ HasStore, - │ │ ---------------------------------- - │ │ │ │ - │ │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'store' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' - │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'store' -33 │ │ HasKey -34 │ │ >(); - │ ╰─────────────^ 'store' constraint not satisifed - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_params_constraint_abilities_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_params_constraint_abilities_invalid.snap new file mode 100644 index 0000000000000..2bbc6005ba5ff --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_params_constraint_abilities_invalid.snap @@ -0,0 +1,251 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/phantom_params_constraint_abilities_invalid.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:11:12 + │ + 9 │ struct S1 { a: T } + │ ---- 'copy' constraint declared here +10 │ struct S2 { +11 │ a: S1>, + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'copy' but the type argument '0x42::M::NoAbilities' does not have the required ability 'copy' + │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:11:12 + │ + 9 │ struct S1 { a: T } + │ ---- 'drop' constraint declared here +10 │ struct S2 { +11 │ a: S1>, + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'drop' but the type argument '0x42::M::NoAbilities' does not have the required ability 'drop' + │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:11:12 + │ + 9 │ struct S1 { a: T } + │ --- 'key' constraint declared here +10 │ struct S2 { +11 │ a: S1>, + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'key' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' + │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:11:12 + │ + 9 │ struct S1 { a: T } + │ ----- 'store' constraint declared here +10 │ struct S2 { +11 │ a: S1>, + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'store' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' + │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'store' + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:16:12 + │ +14 │ struct S3 { a: T1, b: T2, c: T3, d: T4 } + │ ---- 'copy' constraint declared here +15 │ struct S4 { +16 │ a: S3< HasDrop, + │ ╭────────────^ +17 │ │ HasCopy, + │ │ --------------------------------- + │ │ │ │ + │ │ │ The type '0x42::M::HasCopy<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'copy' but the type argument '0x42::M::NoAbilities' does not have the required ability 'copy' + │ │ The type '0x42::M::HasCopy<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'copy' +18 │ │ HasStore, +19 │ │ HasKey +20 │ │ > + │ ╰──────────────^ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:16:12 + │ +14 │ struct S3 { a: T1, b: T2, c: T3, d: T4 } + │ ---- 'drop' constraint declared here +15 │ struct S4 { +16 │ a: S3< HasDrop, + │ --------------------------------- + │ │ │ + │ │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'drop' but the type argument '0x42::M::NoAbilities' does not have the required ability 'drop' + │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'drop' + │ ╭────────────^ +17 │ │ HasCopy, +18 │ │ HasStore, +19 │ │ HasKey +20 │ │ > + │ ╰──────────────^ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:16:12 + │ +14 │ struct S3 { a: T1, b: T2, c: T3, d: T4 } + │ --- 'key' constraint declared here +15 │ struct S4 { +16 │ a: S3< HasDrop, + │ ╭────────────^ +17 │ │ HasCopy, +18 │ │ HasStore, +19 │ │ HasKey + │ │ -------------------------------- + │ │ │ │ + │ │ │ The type '0x42::M::HasKey<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'key' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' + │ │ The type '0x42::M::HasKey<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'key' +20 │ │ > + │ ╰──────────────^ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:16:12 + │ +14 │ struct S3 { a: T1, b: T2, c: T3, d: T4 } + │ ----- 'store' constraint declared here +15 │ struct S4 { +16 │ a: S3< HasDrop, + │ ╭────────────^ +17 │ │ HasCopy, +18 │ │ HasStore, + │ │ ---------------------------------- + │ │ │ │ + │ │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'store' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' + │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'store' +19 │ │ HasKey +20 │ │ > + │ ╰──────────────^ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:25:9 + │ +23 │ fun f1() { } + │ ---- 'copy' constraint declared here +24 │ fun f2() { +25 │ f1>(); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'copy' but the type argument '0x42::M::NoAbilities' does not have the required ability 'copy' + │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'copy' + │ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:25:9 + │ +23 │ fun f1() { } + │ ---- 'drop' constraint declared here +24 │ fun f2() { +25 │ f1>(); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'drop' but the type argument '0x42::M::NoAbilities' does not have the required ability 'drop' + │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'drop' + │ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:25:9 + │ +23 │ fun f1() { } + │ --- 'key' constraint declared here +24 │ fun f2() { +25 │ f1>(); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'key' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' + │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'key' + │ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:25:9 + │ +23 │ fun f1() { } + │ ----- 'store' constraint declared here +24 │ fun f2() { +25 │ f1>(); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'store' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' + │ │ The type '0x42::M::HasAbilities<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'store' + │ 'store' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:30:9 + │ +28 │ fun f3() { } + │ ---- 'copy' constraint declared here +29 │ fun f4() { +30 │ ╭ f3< HasDrop, +31 │ │ HasCopy, + │ │ --------------------------------- + │ │ │ │ + │ │ │ The type '0x42::M::HasCopy<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'copy' but the type argument '0x42::M::NoAbilities' does not have the required ability 'copy' + │ │ The type '0x42::M::HasCopy<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'copy' +32 │ │ HasStore, +33 │ │ HasKey +34 │ │ >(); + │ ╰─────────────^ 'copy' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:30:9 + │ +28 │ fun f3() { } + │ ---- 'drop' constraint declared here +29 │ fun f4() { +30 │ ╭ f3< HasDrop, + │ --------------------------------- + │ │ │ + │ │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'drop' but the type argument '0x42::M::NoAbilities' does not have the required ability 'drop' + │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'drop' +31 │ │ HasCopy, +32 │ │ HasStore, +33 │ │ HasKey +34 │ │ >(); + │ ╰─────────────^ 'drop' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:30:9 + │ +28 │ fun f3() { } + │ --- 'key' constraint declared here +29 │ fun f4() { +30 │ ╭ f3< HasDrop, +31 │ │ HasCopy, +32 │ │ HasStore, +33 │ │ HasKey + │ │ -------------------------------- + │ │ │ │ + │ │ │ The type '0x42::M::HasKey<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'key' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' + │ │ The type '0x42::M::HasKey<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'key' +34 │ │ >(); + │ ╰─────────────^ 'key' constraint not satisifed + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_constraint_abilities_invalid.move:30:9 + │ +28 │ fun f3() { } + │ ----- 'store' constraint declared here +29 │ fun f4() { +30 │ ╭ f3< HasDrop, +31 │ │ HasCopy, +32 │ │ HasStore, + │ │ ---------------------------------- + │ │ │ │ + │ │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'store' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' + │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'store' +33 │ │ HasKey +34 │ │ >(); + │ ╰─────────────^ 'store' constraint not satisifed diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_params_field_abilities.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_params_field_abilities.snap new file mode 100644 index 0000000000000..51c35f548f0af --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_params_field_abilities.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/phantom_params_field_abilities.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_params_field_abilities_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_params_field_abilities_invalid.exp deleted file mode 100644 index 8e427a7ba299b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_params_field_abilities_invalid.exp +++ /dev/null @@ -1,40 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_field_abilities_invalid.move:9:29 - │ -9 │ struct S1 has drop { a: HasDrop } - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'drop' but the type argument '0x42::M::NoAbilities' does not have the required ability 'drop' - │ Invalid field type. The struct was declared with the ability 'drop' so all fields require the ability 'drop' - │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_field_abilities_invalid.move:10:29 - │ -10 │ struct S2 has copy { a: HasCopy } - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::HasCopy<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'copy' but the type argument '0x42::M::NoAbilities' does not have the required ability 'copy' - │ Invalid field type. The struct was declared with the ability 'copy' so all fields require the ability 'copy' - │ The type '0x42::M::HasCopy<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'copy' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_field_abilities_invalid.move:11:30 - │ -11 │ struct S3 has store { a: HasStore } - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'store' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' - │ Invalid field type. The struct was declared with the ability 'store' so all fields require the ability 'store' - │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'store' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/phantom_params_field_abilities_invalid.move:12:28 - │ -12 │ struct S4 has key { a: HasStore } - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'store' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' - │ Invalid field type. The struct was declared with the ability 'key' so all fields require the ability 'store' - │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'store' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_params_field_abilities_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_params_field_abilities_invalid.snap new file mode 100644 index 0000000000000..e050a99b16046 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/phantom_params_field_abilities_invalid.snap @@ -0,0 +1,47 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/phantom_params_field_abilities_invalid.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_field_abilities_invalid.move:9:29 + │ +9 │ struct S1 has drop { a: HasDrop } + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'drop' but the type argument '0x42::M::NoAbilities' does not have the required ability 'drop' + │ Invalid field type. The struct was declared with the ability 'drop' so all fields require the ability 'drop' + │ The type '0x42::M::HasDrop<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_field_abilities_invalid.move:10:29 + │ +10 │ struct S2 has copy { a: HasCopy } + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::HasCopy<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'copy' but the type argument '0x42::M::NoAbilities' does not have the required ability 'copy' + │ Invalid field type. The struct was declared with the ability 'copy' so all fields require the ability 'copy' + │ The type '0x42::M::HasCopy<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'copy' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_field_abilities_invalid.move:11:30 + │ +11 │ struct S3 has store { a: HasStore } + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'store' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' + │ Invalid field type. The struct was declared with the ability 'store' so all fields require the ability 'store' + │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'store' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/phantom_params_field_abilities_invalid.move:12:28 + │ +12 │ struct S4 has key { a: HasStore } + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' can have the ability 'store' but the type argument '0x42::M::NoAbilities' does not have the required ability 'store' + │ Invalid field type. The struct was declared with the ability 'key' so all fields require the ability 'store' + │ The type '0x42::M::HasStore<0x42::M::NoAbilities, 0x42::M::NoAbilities>' does not have the ability 'store' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/recursive_local.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/recursive_local.exp deleted file mode 100644 index e19f34747c6aa..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/recursive_local.exp +++ /dev/null @@ -1,28 +0,0 @@ -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/recursive_local.move:4:13 - │ -4 │ let x; - │ ^ Could not infer this type. Try adding an annotation - -error[E04005]: expected a single type - ┌─ tests/move_check/typing/recursive_local.move:5:9 - │ -5 │ x = (x, 0); - │ ^ ------ Expected a single type, but found expression list type: '(_, u64)' - │ │ - │ Invalid type for local - -error[E04008]: invalid type. recursive type found - ┌─ tests/move_check/typing/recursive_local.move:5:9 - │ -4 │ let x; - │ - Unable to infer the type. Recursive type found. -5 │ x = (x, 0); - │ ^ Invalid assignment to variable 'x' - -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/recursive_local.move:5:14 - │ -5 │ x = (x, 0); - │ ^ Could not infer this type. Try adding an annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/recursive_local.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/recursive_local.snap new file mode 100644 index 0000000000000..769d95eefe8df --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/recursive_local.snap @@ -0,0 +1,35 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/recursive_local.move +--- +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/recursive_local.move:4:13 + │ +4 │ let x; + │ ^ Could not infer this type. Try adding an annotation + +error[E04005]: expected a single type + ┌─ tests/move_check/typing/recursive_local.move:5:9 + │ +5 │ x = (x, 0); + │ ^ ------ Expected a single type, but found expression list type: '(_, u64)' + │ │ + │ Invalid type for local + +error[E04008]: invalid type. recursive type found + ┌─ tests/move_check/typing/recursive_local.move:5:9 + │ +4 │ let x; + │ - Unable to infer the type. Recursive type found. +5 │ x = (x, 0); + │ ^ Invalid assignment to variable 'x' + +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/recursive_local.move:5:14 + │ +5 │ x = (x, 0); + │ ^ Could not infer this type. Try adding an annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/recursive_structs.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/recursive_structs.exp deleted file mode 100644 index c0accddbb9909..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/recursive_structs.exp +++ /dev/null @@ -1,45 +0,0 @@ -error[E04018]: cyclic data - ┌─ tests/move_check/typing/recursive_structs.move:4:21 - │ -4 │ struct Foo { f: Foo } - │ ^^^ - │ │ - │ Invalid field containing 'Foo' in struct 'Foo'. - │ Using this struct creates a cycle: 'Foo' contains 'Foo' - -error[E04018]: cyclic data - ┌─ tests/move_check/typing/recursive_structs.move:7:25 - │ -7 │ struct Bar { f: Cup } - │ ^^^ - │ │ - │ Invalid field containing 'Bar' in struct 'Bar'. - │ Using this struct creates a cycle: 'Bar' contains 'Bar' - -error[E04018]: cyclic data - ┌─ tests/move_check/typing/recursive_structs.move:9:26 - │ -9 │ struct X { y: vector } - │ ^ - │ │ - │ Invalid field containing 'Y' in struct 'X'. - │ Using this struct creates a cycle: 'Y' contains 'X' contains 'Y' - -error[E04018]: cyclic data - ┌─ tests/move_check/typing/recursive_structs.move:17:29 - │ -17 │ struct Foo { f: M0::Cup } - │ ^^^ - │ │ - │ Invalid field containing 'Foo' in struct 'Foo'. - │ Using this struct creates a cycle: 'Foo' contains 'Foo' - -error[E04018]: cyclic data - ┌─ tests/move_check/typing/recursive_structs.move:21:26 - │ -21 │ struct C { d: vector } - │ ^ - │ │ - │ Invalid field containing 'D' in struct 'C'. - │ Using this struct creates a cycle: 'D' contains 'A' contains 'B' contains 'C' contains 'D' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/recursive_structs.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/recursive_structs.snap new file mode 100644 index 0000000000000..0ce5efab74966 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/recursive_structs.snap @@ -0,0 +1,52 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/recursive_structs.move +--- +error[E04018]: cyclic data + ┌─ tests/move_check/typing/recursive_structs.move:4:21 + │ +4 │ struct Foo { f: Foo } + │ ^^^ + │ │ + │ Invalid field containing 'Foo' in struct 'Foo'. + │ Using this struct creates a cycle: 'Foo' contains 'Foo' + +error[E04018]: cyclic data + ┌─ tests/move_check/typing/recursive_structs.move:7:25 + │ +7 │ struct Bar { f: Cup } + │ ^^^ + │ │ + │ Invalid field containing 'Bar' in struct 'Bar'. + │ Using this struct creates a cycle: 'Bar' contains 'Bar' + +error[E04018]: cyclic data + ┌─ tests/move_check/typing/recursive_structs.move:9:26 + │ +9 │ struct X { y: vector } + │ ^ + │ │ + │ Invalid field containing 'Y' in struct 'X'. + │ Using this struct creates a cycle: 'Y' contains 'X' contains 'Y' + +error[E04018]: cyclic data + ┌─ tests/move_check/typing/recursive_structs.move:17:29 + │ +17 │ struct Foo { f: M0::Cup } + │ ^^^ + │ │ + │ Invalid field containing 'Foo' in struct 'Foo'. + │ Using this struct creates a cycle: 'Foo' contains 'Foo' + +error[E04018]: cyclic data + ┌─ tests/move_check/typing/recursive_structs.move:21:26 + │ +21 │ struct C { d: vector } + │ ^ + │ │ + │ Invalid field containing 'D' in struct 'C'. + │ Using this struct creates a cycle: 'D' contains 'A' contains 'B' contains 'C' contains 'D' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/recursive_structs_malformed.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/recursive_structs_malformed.exp deleted file mode 100644 index ee623657bff08..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/recursive_structs_malformed.exp +++ /dev/null @@ -1,54 +0,0 @@ -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/recursive_structs_malformed.move:4:21 - │ -4 │ struct Foo { f: (Foo, Foo) } - │ ^^^^^^^^^^ - │ │ - │ Invalid field type - │ Expected a single non-reference type, but found: '(0x42::M0::Foo, 0x42::M0::Foo)' - -error[E04018]: cyclic data - ┌─ tests/move_check/typing/recursive_structs_malformed.move:4:27 - │ -4 │ struct Foo { f: (Foo, Foo) } - │ ^^^ - │ │ - │ Invalid field containing 'Foo' in struct 'Foo'. - │ Using this struct creates a cycle: 'Foo' contains 'Foo' - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/recursive_structs_malformed.move:5:21 - │ -5 │ struct Bar { f: &Bar } - │ ^^^^ - │ │ - │ Invalid field type - │ Expected a single non-reference type, but found: '&0x42::M0::Bar' - -error[E04018]: cyclic data - ┌─ tests/move_check/typing/recursive_structs_malformed.move:5:22 - │ -5 │ struct Bar { f: &Bar } - │ ^^^ - │ │ - │ Invalid field containing 'Bar' in struct 'Bar'. - │ Using this struct creates a cycle: 'Bar' contains 'Bar' - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/recursive_structs_malformed.move:6:21 - │ -6 │ struct Baz { f: vector<(&Baz, &mut Baz)> } - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '(&0x42::M0::Baz, &mut 0x42::M0::Baz)' - │ Invalid type argument - -error[E04018]: cyclic data - ┌─ tests/move_check/typing/recursive_structs_malformed.move:6:40 - │ -6 │ struct Baz { f: vector<(&Baz, &mut Baz)> } - │ ^^^ - │ │ - │ Invalid field containing 'Baz' in struct 'Baz'. - │ Using this struct creates a cycle: 'Baz' contains 'Baz' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/recursive_structs_malformed.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/recursive_structs_malformed.snap new file mode 100644 index 0000000000000..d03d06aa931dd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/recursive_structs_malformed.snap @@ -0,0 +1,61 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/recursive_structs_malformed.move +--- +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/recursive_structs_malformed.move:4:21 + │ +4 │ struct Foo { f: (Foo, Foo) } + │ ^^^^^^^^^^ + │ │ + │ Invalid field type + │ Expected a single non-reference type, but found: '(0x42::M0::Foo, 0x42::M0::Foo)' + +error[E04018]: cyclic data + ┌─ tests/move_check/typing/recursive_structs_malformed.move:4:27 + │ +4 │ struct Foo { f: (Foo, Foo) } + │ ^^^ + │ │ + │ Invalid field containing 'Foo' in struct 'Foo'. + │ Using this struct creates a cycle: 'Foo' contains 'Foo' + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/recursive_structs_malformed.move:5:21 + │ +5 │ struct Bar { f: &Bar } + │ ^^^^ + │ │ + │ Invalid field type + │ Expected a single non-reference type, but found: '&0x42::M0::Bar' + +error[E04018]: cyclic data + ┌─ tests/move_check/typing/recursive_structs_malformed.move:5:22 + │ +5 │ struct Bar { f: &Bar } + │ ^^^ + │ │ + │ Invalid field containing 'Bar' in struct 'Bar'. + │ Using this struct creates a cycle: 'Bar' contains 'Bar' + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/recursive_structs_malformed.move:6:21 + │ +6 │ struct Baz { f: vector<(&Baz, &mut Baz)> } + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '(&0x42::M0::Baz, &mut 0x42::M0::Baz)' + │ Invalid type argument + +error[E04018]: cyclic data + ┌─ tests/move_check/typing/recursive_structs_malformed.move:6:40 + │ +6 │ struct Baz { f: vector<(&Baz, &mut Baz)> } + │ ^^^ + │ │ + │ Invalid field containing 'Baz' in struct 'Baz'. + │ Using this struct creates a cycle: 'Baz' contains 'Baz' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/return_any_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/return_any_type.exp deleted file mode 100644 index 5da4e36cf4b25..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/return_any_type.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/typing/return_any_type.move:5:14 - │ -5 │ 0 + (return ()); - │ ^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09005]: dead or unreachable code - ┌─ tests/move_check/typing/return_any_type.move:9:13 - │ -9 │ foo(return ()); - │ ^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/return_any_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/return_any_type.snap new file mode 100644 index 0000000000000..71aa5b193de92 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/return_any_type.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/return_any_type.move +--- +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/typing/return_any_type.move:5:14 + │ +5 │ 0 + (return ()); + │ ^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09005]: dead or unreachable code + ┌─ tests/move_check/typing/return_any_type.move:9:13 + │ +9 │ foo(return ()); + │ ^^^^^^^^^ Expected a value. Any code surrounding or after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(dead_code)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/return_type_explicit_exp.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/return_type_explicit_exp.snap new file mode 100644 index 0000000000000..0345a75c523af --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/return_type_explicit_exp.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/return_type_explicit_exp.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/return_type_explicit_exp_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/return_type_explicit_exp_invalid.exp deleted file mode 100644 index 0f90e8ba39f1f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/return_type_explicit_exp_invalid.exp +++ /dev/null @@ -1,66 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/return_type_explicit_exp_invalid.move:5:9 - │ -4 │ fun t0(): u64 { - │ --- Expected: 'u64' -5 │ return () - │ ^^^^^^^^^ - │ │ │ - │ │ Given: '()' - │ Invalid return - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/return_type_explicit_exp_invalid.move:9:19 - │ -8 │ fun t1(): () { - │ -- Expected: '()' -9 │ if (true) return 1 else return 0 - │ ^^^^^^^^ - │ │ │ - │ │ Given: integer - │ Invalid return - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/return_type_explicit_exp_invalid.move:9:33 - │ -8 │ fun t1(): () { - │ -- Expected: '()' -9 │ if (true) return 1 else return 0 - │ ^^^^^^^^ - │ │ │ - │ │ Given: integer - │ Invalid return - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/return_type_explicit_exp_invalid.move:13:14 - │ -12 │ fun t2(): (u64, bool) { - │ ----------- Expected expression list of length 2: '(u64, bool)' -13 │ loop return (0, false, R{}); - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given expression list of length 3: '({integer}, bool, 0x8675309::M::R)' - │ Invalid return - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/return_type_explicit_exp_invalid.move:18:22 - │ -17 │ fun t3(): (u64, bool, R, bool) { - │ -------------------- Expected expression list of length 4: '(u64, bool, 0x8675309::M::R, bool)' -18 │ while (true) return (0, false, R{}); - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given expression list of length 3: '({integer}, bool, 0x8675309::M::R)' - │ Invalid return - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/return_type_explicit_exp_invalid.move:23:23 - │ -22 │ fun t4(): (bool, u64, R) { - │ ---- Expected: 'bool' -23 │ while (false) return (0, false, R{}); - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: integer - │ Invalid return - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/return_type_explicit_exp_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/return_type_explicit_exp_invalid.snap new file mode 100644 index 0000000000000..d12d06afc3446 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/return_type_explicit_exp_invalid.snap @@ -0,0 +1,73 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/return_type_explicit_exp_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/return_type_explicit_exp_invalid.move:5:9 + │ +4 │ fun t0(): u64 { + │ --- Expected: 'u64' +5 │ return () + │ ^^^^^^^^^ + │ │ │ + │ │ Given: '()' + │ Invalid return + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/return_type_explicit_exp_invalid.move:9:19 + │ +8 │ fun t1(): () { + │ -- Expected: '()' +9 │ if (true) return 1 else return 0 + │ ^^^^^^^^ + │ │ │ + │ │ Given: integer + │ Invalid return + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/return_type_explicit_exp_invalid.move:9:33 + │ +8 │ fun t1(): () { + │ -- Expected: '()' +9 │ if (true) return 1 else return 0 + │ ^^^^^^^^ + │ │ │ + │ │ Given: integer + │ Invalid return + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/return_type_explicit_exp_invalid.move:13:14 + │ +12 │ fun t2(): (u64, bool) { + │ ----------- Expected expression list of length 2: '(u64, bool)' +13 │ loop return (0, false, R{}); + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given expression list of length 3: '({integer}, bool, 0x8675309::M::R)' + │ Invalid return + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/return_type_explicit_exp_invalid.move:18:22 + │ +17 │ fun t3(): (u64, bool, R, bool) { + │ -------------------- Expected expression list of length 4: '(u64, bool, 0x8675309::M::R, bool)' +18 │ while (true) return (0, false, R{}); + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given expression list of length 3: '({integer}, bool, 0x8675309::M::R)' + │ Invalid return + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/return_type_explicit_exp_invalid.move:23:23 + │ +22 │ fun t4(): (bool, u64, R) { + │ ---- Expected: 'bool' +23 │ while (false) return (0, false, R{}); + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: integer + │ Invalid return diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/return_type_last_exp.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/return_type_last_exp.snap new file mode 100644 index 0000000000000..e627327c5e395 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/return_type_last_exp.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/return_type_last_exp.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/return_type_last_exp_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/return_type_last_exp_invalid.exp deleted file mode 100644 index 68f05a986fd85..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/return_type_last_exp_invalid.exp +++ /dev/null @@ -1,55 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/return_type_last_exp_invalid.move:5:9 - │ -4 │ fun t0(): u64 { - │ --- Expected: 'u64' -5 │ () - │ ^^ - │ │ - │ Invalid return expression - │ Given: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/return_type_last_exp_invalid.move:9:9 - │ -8 │ fun t1(): () { - │ -- Expected: '()' -9 │ 0 - │ ^ - │ │ - │ Invalid return expression - │ Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/return_type_last_exp_invalid.move:13:9 - │ -12 │ fun t2(): (u64, bool) { - │ ----------- Expected expression list of length 2: '(u64, bool)' -13 │ (0, false, R{}) - │ ^^^^^^^^^^^^^^^ - │ │ - │ Invalid return expression - │ Given expression list of length 3: '({integer}, bool, 0x8675309::M::R)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/return_type_last_exp_invalid.move:17:9 - │ -16 │ fun t3(): (u64, bool, R, bool) { - │ -------------------- Expected expression list of length 4: '(u64, bool, 0x8675309::M::R, bool)' -17 │ (0, false, R{}) - │ ^^^^^^^^^^^^^^^ - │ │ - │ Invalid return expression - │ Given expression list of length 3: '({integer}, bool, 0x8675309::M::R)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/return_type_last_exp_invalid.move:21:9 - │ -20 │ fun t4(): (bool, u64, R) { - │ ---- Expected: 'bool' -21 │ (0, false, R{}) - │ ^^^^^^^^^^^^^^^ - │ ││ - │ │Given: integer - │ Invalid return expression - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/return_type_last_exp_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/return_type_last_exp_invalid.snap new file mode 100644 index 0000000000000..ccdf8e5bbfa1d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/return_type_last_exp_invalid.snap @@ -0,0 +1,62 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/return_type_last_exp_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/return_type_last_exp_invalid.move:5:9 + │ +4 │ fun t0(): u64 { + │ --- Expected: 'u64' +5 │ () + │ ^^ + │ │ + │ Invalid return expression + │ Given: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/return_type_last_exp_invalid.move:9:9 + │ +8 │ fun t1(): () { + │ -- Expected: '()' +9 │ 0 + │ ^ + │ │ + │ Invalid return expression + │ Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/return_type_last_exp_invalid.move:13:9 + │ +12 │ fun t2(): (u64, bool) { + │ ----------- Expected expression list of length 2: '(u64, bool)' +13 │ (0, false, R{}) + │ ^^^^^^^^^^^^^^^ + │ │ + │ Invalid return expression + │ Given expression list of length 3: '({integer}, bool, 0x8675309::M::R)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/return_type_last_exp_invalid.move:17:9 + │ +16 │ fun t3(): (u64, bool, R, bool) { + │ -------------------- Expected expression list of length 4: '(u64, bool, 0x8675309::M::R, bool)' +17 │ (0, false, R{}) + │ ^^^^^^^^^^^^^^^ + │ │ + │ Invalid return expression + │ Given expression list of length 3: '({integer}, bool, 0x8675309::M::R)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/return_type_last_exp_invalid.move:21:9 + │ +20 │ fun t4(): (bool, u64, R) { + │ ---- Expected: 'bool' +21 │ (0, false, R{}) + │ ^^^^^^^^^^^^^^^ + │ ││ + │ │Given: integer + │ Invalid return expression diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/seq_cannot_ignore_resource.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/seq_cannot_ignore_resource.exp deleted file mode 100644 index 4fba9582e3014..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/seq_cannot_ignore_resource.exp +++ /dev/null @@ -1,57 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/seq_cannot_ignore_resource.move:5:9 - │ -2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -5 │ R{}; - │ ^^^ - │ │ - │ Cannot ignore values without the 'drop' ability. The value must be used - │ The type '0x8675309::M::R' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/seq_cannot_ignore_resource.move:10:9 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · - 9 │ let r = R{}; - │ --- The type '0x8675309::M::R' does not have the ability 'drop' -10 │ r; - │ ^ Cannot ignore values without the 'drop' ability. The value must be used - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/seq_cannot_ignore_resource.move:14:9 - │ -14 │ (0, false, R{}); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '(u64, bool, 0x8675309::M::R)' can have the ability 'drop' but the type argument '0x8675309::M::R' does not have the required ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - │ The type '(u64, bool, 0x8675309::M::R)' does not have the ability 'drop' - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/seq_cannot_ignore_resource.move:19:9 - │ -18 │ let r = R{}; - │ --- The type '(u64, bool, 0x8675309::M::R)' can have the ability 'drop' but the type argument '0x8675309::M::R' does not have the required ability 'drop' -19 │ if (true) (0, false, R{}) else (0, false, r); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '(u64, bool, 0x8675309::M::R)' does not have the ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - -error[E06001]: unused value without 'drop' - ┌─ tests/move_check/typing/seq_cannot_ignore_resource.move:19:53 - │ - 2 │ struct R {} - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -18 │ let r = R{}; - │ - --- The type '0x8675309::M::R' does not have the ability 'drop' - │ │ - │ The local variable 'r' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns -19 │ if (true) (0, false, R{}) else (0, false, r); - │ ^ Invalid return - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/seq_cannot_ignore_resource.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/seq_cannot_ignore_resource.snap new file mode 100644 index 0000000000000..2c503e880a389 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/seq_cannot_ignore_resource.snap @@ -0,0 +1,64 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/seq_cannot_ignore_resource.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/seq_cannot_ignore_resource.move:5:9 + │ +2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +5 │ R{}; + │ ^^^ + │ │ + │ Cannot ignore values without the 'drop' ability. The value must be used + │ The type '0x8675309::M::R' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/seq_cannot_ignore_resource.move:10:9 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · + 9 │ let r = R{}; + │ --- The type '0x8675309::M::R' does not have the ability 'drop' +10 │ r; + │ ^ Cannot ignore values without the 'drop' ability. The value must be used + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/seq_cannot_ignore_resource.move:14:9 + │ +14 │ (0, false, R{}); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '(u64, bool, 0x8675309::M::R)' can have the ability 'drop' but the type argument '0x8675309::M::R' does not have the required ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + │ The type '(u64, bool, 0x8675309::M::R)' does not have the ability 'drop' + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/seq_cannot_ignore_resource.move:19:9 + │ +18 │ let r = R{}; + │ --- The type '(u64, bool, 0x8675309::M::R)' can have the ability 'drop' but the type argument '0x8675309::M::R' does not have the required ability 'drop' +19 │ if (true) (0, false, R{}) else (0, false, r); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '(u64, bool, 0x8675309::M::R)' does not have the ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + +error[E06001]: unused value without 'drop' + ┌─ tests/move_check/typing/seq_cannot_ignore_resource.move:19:53 + │ + 2 │ struct R {} + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +18 │ let r = R{}; + │ - --- The type '0x8675309::M::R' does not have the ability 'drop' + │ │ + │ The local variable 'r' might still contain a value. The value does not have the 'drop' ability and must be consumed before the function returns +19 │ if (true) (0, false, R{}) else (0, false, r); + │ ^ Invalid return diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/seq_ignores_value.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/seq_ignores_value.snap new file mode 100644 index 0000000000000..4029145cac8ce --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/seq_ignores_value.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/seq_ignores_value.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/shadowing.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/shadowing.snap new file mode 100644 index 0000000000000..ab3ae1c77ed66 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/shadowing.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/shadowing.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/shadowing_invalid_scope.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/shadowing_invalid_scope.exp deleted file mode 100644 index dccc1ba087596..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/shadowing_invalid_scope.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03009]: unbound variable - ┌─ tests/move_check/typing/shadowing_invalid_scope.move:5:10 - │ -5 │ (x: bool); - │ ^ Unbound variable 'x' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/shadowing_invalid_scope.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/shadowing_invalid_scope.snap new file mode 100644 index 0000000000000..bb19c573e5b98 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/shadowing_invalid_scope.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/shadowing_invalid_scope.move +--- +error[E03009]: unbound variable + ┌─ tests/move_check/typing/shadowing_invalid_scope.move:5:10 + │ +5 │ (x: bool); + │ ^ Unbound variable 'x' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/shadowing_invalid_types.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/shadowing_invalid_types.exp deleted file mode 100644 index 66fee4623b548..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/shadowing_invalid_types.exp +++ /dev/null @@ -1,124 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/shadowing_invalid_types.move:8:13 - │ -5 │ let x = 0; - │ - Given: integer - · -8 │ (x: bool); - │ ^^^^ - │ │ - │ Invalid type annotation - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/shadowing_invalid_types.move:10:30 - │ -10 │ { let x = false; (x: u64); }; - │ ----- ^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: 'u64' - │ Given: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/shadowing_invalid_types.move:11:13 - │ - 5 │ let x = 0; - │ - Given: integer - · -11 │ (x: bool); - │ ^^^^ - │ │ - │ Invalid type annotation - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/shadowing_invalid_types.move:13:46 - │ -13 │ { let x = false; { let x = @0x0; (x: u64); }; (x: address); }; - │ ---- ^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: 'u64' - │ Given: 'address' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/shadowing_invalid_types.move:13:59 - │ -13 │ { let x = false; { let x = @0x0; (x: u64); }; (x: address); }; - │ ----- ^^^^^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: 'address' - │ Given: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/shadowing_invalid_types.move:14:13 - │ - 5 │ let x = 0; - │ - Given: integer - · -14 │ (x: bool); - │ ^^^^ - │ │ - │ Invalid type annotation - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/shadowing_invalid_types.move:21:17 - │ -20 │ let (a, x) = (false, false); - │ ----- Given: 'bool' -21 │ (x: u64); - │ ^^^ - │ │ - │ Invalid type annotation - │ Expected: 'u64' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/shadowing_invalid_types.move:25:17 - │ -24 │ let x = @0x0; - │ ---- Given: 'address' -25 │ (x: u64); - │ ^^^ - │ │ - │ Invalid type annotation - │ Expected: 'u64' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/shadowing_invalid_types.move:27:13 - │ -18 │ let x = 0; - │ - Given: integer - · -27 │ (x: address); - │ ^^^^^^^ - │ │ - │ Invalid type annotation - │ Expected: 'address' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/shadowing_invalid_types.move:34:17 - │ - 2 │ struct S {f: u64, b: bool} - │ ---- Given: 'bool' - · -34 │ (x: u64); - │ ^^^ - │ │ - │ Invalid type annotation - │ Expected: 'u64' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/shadowing_invalid_types.move:37:13 - │ -31 │ let x = 0; - │ - Given: integer - · -37 │ (x: bool); - │ ^^^^ - │ │ - │ Invalid type annotation - │ Expected: 'bool' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/shadowing_invalid_types.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/shadowing_invalid_types.snap new file mode 100644 index 0000000000000..633982ff63637 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/shadowing_invalid_types.snap @@ -0,0 +1,131 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/shadowing_invalid_types.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/shadowing_invalid_types.move:8:13 + │ +5 │ let x = 0; + │ - Given: integer + · +8 │ (x: bool); + │ ^^^^ + │ │ + │ Invalid type annotation + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/shadowing_invalid_types.move:10:30 + │ +10 │ { let x = false; (x: u64); }; + │ ----- ^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: 'u64' + │ Given: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/shadowing_invalid_types.move:11:13 + │ + 5 │ let x = 0; + │ - Given: integer + · +11 │ (x: bool); + │ ^^^^ + │ │ + │ Invalid type annotation + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/shadowing_invalid_types.move:13:46 + │ +13 │ { let x = false; { let x = @0x0; (x: u64); }; (x: address); }; + │ ---- ^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: 'u64' + │ Given: 'address' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/shadowing_invalid_types.move:13:59 + │ +13 │ { let x = false; { let x = @0x0; (x: u64); }; (x: address); }; + │ ----- ^^^^^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: 'address' + │ Given: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/shadowing_invalid_types.move:14:13 + │ + 5 │ let x = 0; + │ - Given: integer + · +14 │ (x: bool); + │ ^^^^ + │ │ + │ Invalid type annotation + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/shadowing_invalid_types.move:21:17 + │ +20 │ let (a, x) = (false, false); + │ ----- Given: 'bool' +21 │ (x: u64); + │ ^^^ + │ │ + │ Invalid type annotation + │ Expected: 'u64' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/shadowing_invalid_types.move:25:17 + │ +24 │ let x = @0x0; + │ ---- Given: 'address' +25 │ (x: u64); + │ ^^^ + │ │ + │ Invalid type annotation + │ Expected: 'u64' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/shadowing_invalid_types.move:27:13 + │ +18 │ let x = 0; + │ - Given: integer + · +27 │ (x: address); + │ ^^^^^^^ + │ │ + │ Invalid type annotation + │ Expected: 'address' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/shadowing_invalid_types.move:34:17 + │ + 2 │ struct S {f: u64, b: bool} + │ ---- Given: 'bool' + · +34 │ (x: u64); + │ ^^^ + │ │ + │ Invalid type annotation + │ Expected: 'u64' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/shadowing_invalid_types.move:37:13 + │ +31 │ let x = 0; + │ - Given: integer + · +37 │ (x: bool); + │ ^^^^ + │ │ + │ Invalid type annotation + │ Expected: 'bool' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/spec_block_fail.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/spec_block_fail.exp deleted file mode 100644 index e61e8469bc07a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/spec_block_fail.exp +++ /dev/null @@ -1,48 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/typing/spec_block_fail.move:3:10 - │ -3 │ (spec {}: u64); - │ ^^^^^^^ Specification blocks are deprecated and are no longer used - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/spec_block_fail.move:3:19 - │ -3 │ (spec {}: u64); - │ ------- ^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: 'u64' - │ Given: '()' - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/typing/spec_block_fail.move:4:10 - │ -4 │ (spec {}: &u64); - │ ^^^^^^^ Specification blocks are deprecated and are no longer used - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/spec_block_fail.move:4:19 - │ -4 │ (spec {}: &u64); - │ ------- ^^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: '&u64' - │ Given: '()' - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/typing/spec_block_fail.move:5:10 - │ -5 │ (spec {}: (u64, u64)); - │ ^^^^^^^ Specification blocks are deprecated and are no longer used - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/spec_block_fail.move:5:19 - │ -5 │ (spec {}: (u64, u64)); - │ ------- ^^^^^^^^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: '(u64, u64)' - │ Given: '()' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/spec_block_fail.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/spec_block_fail.snap new file mode 100644 index 0000000000000..633197623b9f2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/spec_block_fail.snap @@ -0,0 +1,55 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/spec_block_fail.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/typing/spec_block_fail.move:3:10 + │ +3 │ (spec {}: u64); + │ ^^^^^^^ Specification blocks are deprecated and are no longer used + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/spec_block_fail.move:3:19 + │ +3 │ (spec {}: u64); + │ ------- ^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: 'u64' + │ Given: '()' + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/typing/spec_block_fail.move:4:10 + │ +4 │ (spec {}: &u64); + │ ^^^^^^^ Specification blocks are deprecated and are no longer used + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/spec_block_fail.move:4:19 + │ +4 │ (spec {}: &u64); + │ ------- ^^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: '&u64' + │ Given: '()' + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/typing/spec_block_fail.move:5:10 + │ +5 │ (spec {}: (u64, u64)); + │ ^^^^^^^ Specification blocks are deprecated and are no longer used + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/spec_block_fail.move:5:19 + │ +5 │ (spec {}: (u64, u64)); + │ ------- ^^^^^^^^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: '(u64, u64)' + │ Given: '()' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/spec_block_ok.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/spec_block_ok.exp deleted file mode 100644 index 6ab57bc971cb1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/spec_block_ok.exp +++ /dev/null @@ -1,6 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/typing/spec_block_ok.move:3:10 - │ -3 │ (spec {}: ()) - │ ^^^^^^^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/spec_block_ok.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/spec_block_ok.snap new file mode 100644 index 0000000000000..62a6f82ed36ec --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/spec_block_ok.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/spec_block_ok.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/typing/spec_block_ok.move:3:10 + │ +3 │ (spec {}: ()) + │ ^^^^^^^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_annotation.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_annotation.snap new file mode 100644 index 0000000000000..3dd5336189216 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_annotation.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/subtype_annotation.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_annotation_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_annotation_invalid.exp deleted file mode 100644 index 726afce6b9701..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_annotation_invalid.exp +++ /dev/null @@ -1,40 +0,0 @@ -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_annotation_invalid.move:5:14 - │ -5 │ (&0: &mut u64); - │ -- ^^^^^^^^ - │ │ │ - │ │ Invalid type annotation - │ │ Expected: '&mut u64' - │ Given: '&{integer}' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_annotation_invalid.move:9:20 - │ -9 │ ((&0, &0): (&mut u64, &mut u64)); - │ -- ^^^^^^^^^^^^^^^^^^^^ - │ │ ││ - │ │ │Expected: '&mut u64' - │ │ Invalid type annotation - │ Given: '&{integer}' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_annotation_invalid.move:10:20 - │ -10 │ ((&0, &0): (&mut u64, &u64)); - │ -- ^^^^^^^^^^^^^^^^ - │ │ ││ - │ │ │Expected: '&mut u64' - │ │ Invalid type annotation - │ Given: '&{integer}' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_annotation_invalid.move:11:20 - │ -11 │ ((&0, &0): (&u64, &mut u64)); - │ -- ^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Expected: '&mut u64' - │ │ Invalid type annotation - │ Given: '&{integer}' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_annotation_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_annotation_invalid.snap new file mode 100644 index 0000000000000..6160b800b1851 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_annotation_invalid.snap @@ -0,0 +1,47 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/subtype_annotation_invalid.move +--- +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_annotation_invalid.move:5:14 + │ +5 │ (&0: &mut u64); + │ -- ^^^^^^^^ + │ │ │ + │ │ Invalid type annotation + │ │ Expected: '&mut u64' + │ Given: '&{integer}' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_annotation_invalid.move:9:20 + │ +9 │ ((&0, &0): (&mut u64, &mut u64)); + │ -- ^^^^^^^^^^^^^^^^^^^^ + │ │ ││ + │ │ │Expected: '&mut u64' + │ │ Invalid type annotation + │ Given: '&{integer}' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_annotation_invalid.move:10:20 + │ +10 │ ((&0, &0): (&mut u64, &u64)); + │ -- ^^^^^^^^^^^^^^^^ + │ │ ││ + │ │ │Expected: '&mut u64' + │ │ Invalid type annotation + │ Given: '&{integer}' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_annotation_invalid.move:11:20 + │ +11 │ ((&0, &0): (&u64, &mut u64)); + │ -- ^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Expected: '&mut u64' + │ │ Invalid type annotation + │ Given: '&{integer}' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_args.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_args.snap new file mode 100644 index 0000000000000..05b49f7a32076 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_args.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/subtype_args.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_args_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_args_invalid.exp deleted file mode 100644 index 2a4615ab74497..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_args_invalid.exp +++ /dev/null @@ -1,72 +0,0 @@ -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_args_invalid.move:10:9 - │ - 4 │ fun mut(_x: &mut T) {} - │ ------ Expected: '&mut u64' - · -10 │ mut(&0); - │ ^^^^^^^^^^^^ - │ │ │ - │ │ Given: '&{integer}' - │ Invalid call of '0x8675309::M::mut'. Invalid argument for parameter '_x' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_args_invalid.move:11:9 - │ - 4 │ fun mut(_x: &mut T) {} - │ ------ Expected: '&mut u64' - · -11 │ mut(&S{}); - │ ^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: '&0x8675309::M::S' - │ Invalid call of '0x8675309::M::mut'. Invalid argument for parameter '_x' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_args_invalid.move:15:9 - │ - 5 │ fun imm_mut(_x: &T, _y: &mut T) {} - │ ------ Expected: '&mut u64' - · -15 │ imm_mut(&0, &0); - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: '&{integer}' - │ Invalid call of '0x8675309::M::imm_mut'. Invalid argument for parameter '_y' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_args_invalid.move:16:9 - │ - 6 │ fun mut_imm(_x: &mut T, _y: &T) {} - │ ------ Expected: '&mut u64' - · -16 │ mut_imm(&0, &0); - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: '&{integer}' - │ Invalid call of '0x8675309::M::mut_imm'. Invalid argument for parameter '_x' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_args_invalid.move:17:9 - │ - 7 │ fun mut_mut(_x: &mut T, _y: &mut T) {} - │ ------ Expected: '&mut u64' - · -17 │ mut_mut(&0, &0); - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: '&{integer}' - │ Invalid call of '0x8675309::M::mut_mut'. Invalid argument for parameter '_x' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_args_invalid.move:17:9 - │ - 7 │ fun mut_mut(_x: &mut T, _y: &mut T) {} - │ ------ Expected: '&mut u64' - · -17 │ mut_mut(&0, &0); - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: '&{integer}' - │ Invalid call of '0x8675309::M::mut_mut'. Invalid argument for parameter '_y' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_args_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_args_invalid.snap new file mode 100644 index 0000000000000..a923ee0e0fa95 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_args_invalid.snap @@ -0,0 +1,79 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/subtype_args_invalid.move +--- +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_args_invalid.move:10:9 + │ + 4 │ fun mut(_x: &mut T) {} + │ ------ Expected: '&mut u64' + · +10 │ mut(&0); + │ ^^^^^^^^^^^^ + │ │ │ + │ │ Given: '&{integer}' + │ Invalid call of '0x8675309::M::mut'. Invalid argument for parameter '_x' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_args_invalid.move:11:9 + │ + 4 │ fun mut(_x: &mut T) {} + │ ------ Expected: '&mut u64' + · +11 │ mut(&S{}); + │ ^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: '&0x8675309::M::S' + │ Invalid call of '0x8675309::M::mut'. Invalid argument for parameter '_x' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_args_invalid.move:15:9 + │ + 5 │ fun imm_mut(_x: &T, _y: &mut T) {} + │ ------ Expected: '&mut u64' + · +15 │ imm_mut(&0, &0); + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: '&{integer}' + │ Invalid call of '0x8675309::M::imm_mut'. Invalid argument for parameter '_y' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_args_invalid.move:16:9 + │ + 6 │ fun mut_imm(_x: &mut T, _y: &T) {} + │ ------ Expected: '&mut u64' + · +16 │ mut_imm(&0, &0); + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: '&{integer}' + │ Invalid call of '0x8675309::M::mut_imm'. Invalid argument for parameter '_x' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_args_invalid.move:17:9 + │ + 7 │ fun mut_mut(_x: &mut T, _y: &mut T) {} + │ ------ Expected: '&mut u64' + · +17 │ mut_mut(&0, &0); + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: '&{integer}' + │ Invalid call of '0x8675309::M::mut_mut'. Invalid argument for parameter '_x' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_args_invalid.move:17:9 + │ + 7 │ fun mut_mut(_x: &mut T, _y: &mut T) {} + │ ------ Expected: '&mut u64' + · +17 │ mut_mut(&0, &0); + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: '&{integer}' + │ Invalid call of '0x8675309::M::mut_mut'. Invalid argument for parameter '_y' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_assign.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_assign.snap new file mode 100644 index 0000000000000..a2629d4c2bc6f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_assign.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/subtype_assign.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_assign_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_assign_invalid.exp deleted file mode 100644 index 9287dda55574c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_assign_invalid.exp +++ /dev/null @@ -1,49 +0,0 @@ -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_assign_invalid.move:5:17 - │ -5 │ let _x: &mut u64 = &0; - │ ^^^^^^^^ -- Given: '&{integer}' - │ │ - │ Invalid type annotation - │ Expected: '&mut u64' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_assign_invalid.move:10:10 - │ - 9 │ let (x, y): (&mut u64, &mut u64); - │ -------- Expected: '&mut u64' -10 │ (x, y) = (&0, &0); - │ ^ -- Given: '&{integer}' - │ │ - │ Invalid assignment to variable 'x' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_assign_invalid.move:10:13 - │ - 9 │ let (x, y): (&mut u64, &mut u64); - │ -------- Expected: '&mut u64' -10 │ (x, y) = (&0, &0); - │ ^ -- Given: '&{integer}' - │ │ - │ Invalid assignment to variable 'y' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_assign_invalid.move:13:10 - │ -12 │ let (x, y): (&mut u64, &u64); - │ -------- Expected: '&mut u64' -13 │ (x, y) = (&0, &0); - │ ^ -- Given: '&{integer}' - │ │ - │ Invalid assignment to variable 'x' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_assign_invalid.move:16:13 - │ -15 │ let (x, y): (&u64, &mut u64); - │ -------- Expected: '&mut u64' -16 │ (x, y)= (&0, &0); - │ ^ -- Given: '&{integer}' - │ │ - │ Invalid assignment to variable 'y' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_assign_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_assign_invalid.snap new file mode 100644 index 0000000000000..5990774e2da26 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_assign_invalid.snap @@ -0,0 +1,56 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/subtype_assign_invalid.move +--- +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_assign_invalid.move:5:17 + │ +5 │ let _x: &mut u64 = &0; + │ ^^^^^^^^ -- Given: '&{integer}' + │ │ + │ Invalid type annotation + │ Expected: '&mut u64' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_assign_invalid.move:10:10 + │ + 9 │ let (x, y): (&mut u64, &mut u64); + │ -------- Expected: '&mut u64' +10 │ (x, y) = (&0, &0); + │ ^ -- Given: '&{integer}' + │ │ + │ Invalid assignment to variable 'x' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_assign_invalid.move:10:13 + │ + 9 │ let (x, y): (&mut u64, &mut u64); + │ -------- Expected: '&mut u64' +10 │ (x, y) = (&0, &0); + │ ^ -- Given: '&{integer}' + │ │ + │ Invalid assignment to variable 'y' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_assign_invalid.move:13:10 + │ +12 │ let (x, y): (&mut u64, &u64); + │ -------- Expected: '&mut u64' +13 │ (x, y) = (&0, &0); + │ ^ -- Given: '&{integer}' + │ │ + │ Invalid assignment to variable 'x' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_assign_invalid.move:16:13 + │ +15 │ let (x, y): (&u64, &mut u64); + │ -------- Expected: '&mut u64' +16 │ (x, y)= (&0, &0); + │ ^ -- Given: '&{integer}' + │ │ + │ Invalid assignment to variable 'y' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_bind.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_bind.snap new file mode 100644 index 0000000000000..8089012a6bdfb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_bind.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/subtype_bind.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_bind_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_bind_invalid.exp deleted file mode 100644 index 714ce0ac26c7f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_bind_invalid.exp +++ /dev/null @@ -1,36 +0,0 @@ -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_bind_invalid.move:5:17 - │ -5 │ let _x: &mut u64 = &0; - │ ^^^^^^^^ -- Given: '&{integer}' - │ │ - │ Invalid type annotation - │ Expected: '&mut u64' - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_bind_invalid.move:9:23 - │ -9 │ let (_x, _y): (&mut u64, &mut u64) = (&0, &0); - │ ^^^^^^^^^^^^^^^^^^^^ -- Given: '&{integer}' - │ ││ - │ │Expected: '&mut u64' - │ Invalid type annotation - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_bind_invalid.move:10:23 - │ -10 │ let (_x, _y): (&mut u64, &u64) = (&0, &0); - │ ^^^^^^^^^^^^^^^^ -- Given: '&{integer}' - │ ││ - │ │Expected: '&mut u64' - │ Invalid type annotation - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_bind_invalid.move:11:23 - │ -11 │ let (_x, _y): (&u64, &mut u64) = (&0, &0); - │ ^^^^^^^^^^^^^^^^ -- Given: '&{integer}' - │ │ │ - │ │ Expected: '&mut u64' - │ Invalid type annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_bind_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_bind_invalid.snap new file mode 100644 index 0000000000000..a1000bde2a87a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_bind_invalid.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/subtype_bind_invalid.move +--- +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_bind_invalid.move:5:17 + │ +5 │ let _x: &mut u64 = &0; + │ ^^^^^^^^ -- Given: '&{integer}' + │ │ + │ Invalid type annotation + │ Expected: '&mut u64' + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_bind_invalid.move:9:23 + │ +9 │ let (_x, _y): (&mut u64, &mut u64) = (&0, &0); + │ ^^^^^^^^^^^^^^^^^^^^ -- Given: '&{integer}' + │ ││ + │ │Expected: '&mut u64' + │ Invalid type annotation + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_bind_invalid.move:10:23 + │ +10 │ let (_x, _y): (&mut u64, &u64) = (&0, &0); + │ ^^^^^^^^^^^^^^^^ -- Given: '&{integer}' + │ ││ + │ │Expected: '&mut u64' + │ Invalid type annotation + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_bind_invalid.move:11:23 + │ +11 │ let (_x, _y): (&u64, &mut u64) = (&0, &0); + │ ^^^^^^^^^^^^^^^^ -- Given: '&{integer}' + │ │ │ + │ │ Expected: '&mut u64' + │ Invalid type annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_return.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_return.snap new file mode 100644 index 0000000000000..b3923b18f963f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_return.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/subtype_return.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_return_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_return_invalid.exp deleted file mode 100644 index 17414915022d9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_return_invalid.exp +++ /dev/null @@ -1,50 +0,0 @@ -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_return_invalid.move:5:9 - │ -4 │ fun t0(u: &u64): &mut u64 { - │ ---- -------- Expected: '&mut u64' - │ │ - │ Given: '&u64' -5 │ u - │ ^ Invalid return expression - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_return_invalid.move:9:9 - │ -8 │ fun t1(s: &S): &mut S { - │ -- ------ Expected: '&mut 0x8675309::M::S' - │ │ - │ Given: '&0x8675309::M::S' -9 │ s - │ ^ Invalid return expression - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_return_invalid.move:13:9 - │ -12 │ fun t2(u1: &u64, u2: &u64): (&u64, &mut u64) { - │ ---- -------- Expected: '&mut u64' - │ │ - │ Given: '&u64' -13 │ (u1, u2) - │ ^^^^^^^^ Invalid return expression - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_return_invalid.move:17:9 - │ -16 │ fun t3(u1: &u64, u2: &u64): (&mut u64, &u64) { - │ ---- -------- Expected: '&mut u64' - │ │ - │ Given: '&u64' -17 │ (u1, u2) - │ ^^^^^^^^ Invalid return expression - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/subtype_return_invalid.move:21:9 - │ -20 │ fun t4(u1: &u64, u2: &u64): (&mut u64, &mut u64) { - │ ---- -------- Expected: '&mut u64' - │ │ - │ Given: '&u64' -21 │ (u1, u2) - │ ^^^^^^^^ Invalid return expression - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_return_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_return_invalid.snap new file mode 100644 index 0000000000000..27ed5093790ff --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/subtype_return_invalid.snap @@ -0,0 +1,57 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/subtype_return_invalid.move +--- +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_return_invalid.move:5:9 + │ +4 │ fun t0(u: &u64): &mut u64 { + │ ---- -------- Expected: '&mut u64' + │ │ + │ Given: '&u64' +5 │ u + │ ^ Invalid return expression + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_return_invalid.move:9:9 + │ +8 │ fun t1(s: &S): &mut S { + │ -- ------ Expected: '&mut 0x8675309::M::S' + │ │ + │ Given: '&0x8675309::M::S' +9 │ s + │ ^ Invalid return expression + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_return_invalid.move:13:9 + │ +12 │ fun t2(u1: &u64, u2: &u64): (&u64, &mut u64) { + │ ---- -------- Expected: '&mut u64' + │ │ + │ Given: '&u64' +13 │ (u1, u2) + │ ^^^^^^^^ Invalid return expression + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_return_invalid.move:17:9 + │ +16 │ fun t3(u1: &u64, u2: &u64): (&mut u64, &u64) { + │ ---- -------- Expected: '&mut u64' + │ │ + │ Given: '&u64' +17 │ (u1, u2) + │ ^^^^^^^^ Invalid return expression + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/subtype_return_invalid.move:21:9 + │ +20 │ fun t4(u1: &u64, u2: &u64): (&mut u64, &mut u64) { + │ ---- -------- Expected: '&mut u64' + │ │ + │ Given: '&u64' +21 │ (u1, u2) + │ ^^^^^^^^ Invalid return expression diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_pack.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_pack.exp deleted file mode 100644 index f2a43e550371f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_pack.exp +++ /dev/null @@ -1,53 +0,0 @@ -error[E01002]: unexpected token - ┌─ tests/move_check/typing/type_variable_join_single_pack.move:2:19 - │ -2 │ struct Box copy, drop { f1: T, f2: T } - │ ^^^^ Unexpected 'copy'. Expected struct fields, 'has' to start abilities declaration, or ';' for a native struct - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/type_variable_join_single_pack.move:6:9 - │ -2 │ struct Box copy, drop { f1: T, f2: T } - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - · -6 │ (*&b: Box); - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Box' does not have the ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/type_variable_join_single_pack.move:6:10 - │ -2 │ struct Box copy, drop { f1: T, f2: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -5 │ let b = Box { f1: 0, f2: 1 }; - │ -------------------- The type '0x42::M::Box' does not have the ability 'copy' -6 │ (*&b: Box); - │ ^^^ Invalid dereference. Dereference requires the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/type_variable_join_single_pack.move:7:28 - │ -2 │ struct Box copy, drop { f1: T, f2: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -5 │ let b = Box { f1: 0, f2: 1 }; - │ -------------------- The type '0x42::M::Box' does not have the ability 'copy' -6 │ (*&b: Box); -7 │ let b2 = Box { f1: *&b, f2: b }; - │ ^^^ Invalid dereference. Dereference requires the 'copy' ability - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/type_variable_join_single_pack.move:8:9 - │ -2 │ struct Box copy, drop { f1: T, f2: T } - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - · -8 │ (b2: Box>); - │ ^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ The type '0x42::M::Box<0x42::M::Box>' does not have the ability 'drop' - │ Cannot ignore values without the 'drop' ability. The value must be used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_pack.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_pack.snap new file mode 100644 index 0000000000000..402512812f9df --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_pack.snap @@ -0,0 +1,60 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/type_variable_join_single_pack.move +--- +error[E01002]: unexpected token + ┌─ tests/move_check/typing/type_variable_join_single_pack.move:2:19 + │ +2 │ struct Box copy, drop { f1: T, f2: T } + │ ^^^^ Unexpected 'copy'. Expected struct fields, 'has' to start abilities declaration, or ';' for a native struct + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/type_variable_join_single_pack.move:6:9 + │ +2 │ struct Box copy, drop { f1: T, f2: T } + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + · +6 │ (*&b: Box); + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Box' does not have the ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/type_variable_join_single_pack.move:6:10 + │ +2 │ struct Box copy, drop { f1: T, f2: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +5 │ let b = Box { f1: 0, f2: 1 }; + │ -------------------- The type '0x42::M::Box' does not have the ability 'copy' +6 │ (*&b: Box); + │ ^^^ Invalid dereference. Dereference requires the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/type_variable_join_single_pack.move:7:28 + │ +2 │ struct Box copy, drop { f1: T, f2: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +5 │ let b = Box { f1: 0, f2: 1 }; + │ -------------------- The type '0x42::M::Box' does not have the ability 'copy' +6 │ (*&b: Box); +7 │ let b2 = Box { f1: *&b, f2: b }; + │ ^^^ Invalid dereference. Dereference requires the 'copy' ability + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/type_variable_join_single_pack.move:8:9 + │ +2 │ struct Box copy, drop { f1: T, f2: T } + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + · +8 │ (b2: Box>); + │ ^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ The type '0x42::M::Box<0x42::M::Box>' does not have the ability 'drop' + │ Cannot ignore values without the 'drop' ability. The value must be used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_pack_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_pack_invalid.exp deleted file mode 100644 index a944cc3a1cd21..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_pack_invalid.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/type_variable_join_single_pack_invalid.move:5:39 - │ -5 │ let _b = Box { f1: false, f2: 1 }; - │ ----- ^ - │ │ │ - │ │ Invalid argument for field 'f2' for '0x8675309::M::Box' - │ │ Given: integer - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/type_variable_join_single_pack_invalid.move:6:56 - │ -6 │ let _b2 = Box { f1: Box { f1: 0, f2: 0 }, f2: Box { f1: false, f2: false } }; - │ -------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Given: 'bool' - │ │ Invalid argument for field 'f2' for '0x8675309::M::Box' - │ Expected: integer - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_pack_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_pack_invalid.snap new file mode 100644 index 0000000000000..0690e19f369b7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_pack_invalid.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/type_variable_join_single_pack_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/type_variable_join_single_pack_invalid.move:5:39 + │ +5 │ let _b = Box { f1: false, f2: 1 }; + │ ----- ^ + │ │ │ + │ │ Invalid argument for field 'f2' for '0x8675309::M::Box' + │ │ Given: integer + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/type_variable_join_single_pack_invalid.move:6:56 + │ +6 │ let _b2 = Box { f1: Box { f1: 0, f2: 0 }, f2: Box { f1: false, f2: false } }; + │ -------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Given: 'bool' + │ │ Invalid argument for field 'f2' for '0x8675309::M::Box' + │ Expected: integer diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack.snap new file mode 100644 index 0000000000000..ac123cad8386b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack_assign.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack_assign.snap new file mode 100644 index 0000000000000..6d651e8b41cdf --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack_assign.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack_assign.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack_assign_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack_assign_invalid.exp deleted file mode 100644 index dea69f69a8b34..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack_assign_invalid.exp +++ /dev/null @@ -1,22 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/type_variable_join_single_unpack_assign_invalid.move:13:14 - │ -12 │ (f1: u64); - │ --- Given: 'u64' -13 │ (f2: bool); - │ ^^^^ - │ │ - │ Invalid type annotation - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/type_variable_join_single_unpack_assign_invalid.move:18:14 - │ -17 │ (f1: Box); - │ --- Given: 'u64' -18 │ (f2: Box); - │ ^^^^^^^^^ - │ │ │ - │ │ Expected: 'bool' - │ Invalid type annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack_assign_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack_assign_invalid.snap new file mode 100644 index 0000000000000..7cf8b189b875f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack_assign_invalid.snap @@ -0,0 +1,29 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack_assign_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/type_variable_join_single_unpack_assign_invalid.move:13:14 + │ +12 │ (f1: u64); + │ --- Given: 'u64' +13 │ (f2: bool); + │ ^^^^ + │ │ + │ Invalid type annotation + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/type_variable_join_single_unpack_assign_invalid.move:18:14 + │ +17 │ (f1: Box); + │ --- Given: 'u64' +18 │ (f2: Box); + │ ^^^^^^^^^ + │ │ │ + │ │ Expected: 'bool' + │ Invalid type annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack_invalid.exp deleted file mode 100644 index 0c59d9c716293..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack_invalid.exp +++ /dev/null @@ -1,22 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/type_variable_join_single_unpack_invalid.move:11:14 - │ -10 │ (f1: u64); - │ --- Given: 'u64' -11 │ (f2: bool); - │ ^^^^ - │ │ - │ Invalid type annotation - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/type_variable_join_single_unpack_invalid.move:14:14 - │ -13 │ (f1: Box); - │ --- Given: 'u64' -14 │ (f2: Box); - │ ^^^^^^^^^ - │ │ │ - │ │ Expected: 'bool' - │ Invalid type annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack_invalid.snap new file mode 100644 index 0000000000000..3a499ccca4190 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack_invalid.snap @@ -0,0 +1,29 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/type_variable_join_single_unpack_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/type_variable_join_single_unpack_invalid.move:11:14 + │ +10 │ (f1: u64); + │ --- Given: 'u64' +11 │ (f2: bool); + │ ^^^^ + │ │ + │ Invalid type annotation + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/type_variable_join_single_unpack_invalid.move:14:14 + │ +13 │ (f1: Box); + │ --- Given: 'u64' +14 │ (f2: Box); + │ ^^^^^^^^^ + │ │ │ + │ │ Expected: 'bool' + │ Invalid type annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_pack.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_pack.snap new file mode 100644 index 0000000000000..0f289d8ef8b95 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_pack.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_pack.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_pack_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_pack_invalid.exp deleted file mode 100644 index 827465e038583..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_pack_invalid.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/type_variable_join_threaded_pack_invalid.move:42:9 - │ -35 │ fun t0(): Box { - │ ---- Expected: 'bool' - · -38 │ let b = Box { f1: x, f2: x }; - │ -------------------- Given: integer - · -42 │ b - │ ^ Invalid return expression - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/type_variable_join_threaded_pack_invalid.move:47:17 - │ -10 │ public fun get(_self: &T): V { - │ ---- 'drop' constraint declared here - · -27 │ struct Box { f1: T, f2: T } - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - · -47 │ let x = Container::get(&v); - │ ^^^^^^^^^^^^^^^^^^ 'drop' constraint not satisifed -48 │ let b = Box { f1: x, f2: x }; -49 │ Container::put(&mut v, Box {f1: R{}, f2: R{}}); - │ ---------------------- The type '0x2::M::Box<0x2::M::R>' does not have the ability 'drop' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_pack_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_pack_invalid.snap new file mode 100644 index 0000000000000..13671baa73215 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_pack_invalid.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_pack_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/type_variable_join_threaded_pack_invalid.move:42:9 + │ +35 │ fun t0(): Box { + │ ---- Expected: 'bool' + · +38 │ let b = Box { f1: x, f2: x }; + │ -------------------- Given: integer + · +42 │ b + │ ^ Invalid return expression + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/type_variable_join_threaded_pack_invalid.move:47:17 + │ +10 │ public fun get(_self: &T): V { + │ ---- 'drop' constraint declared here + · +27 │ struct Box { f1: T, f2: T } + │ --- To satisfy the constraint, the 'drop' ability would need to be added here + · +47 │ let x = Container::get(&v); + │ ^^^^^^^^^^^^^^^^^^ 'drop' constraint not satisifed +48 │ let b = Box { f1: x, f2: x }; +49 │ Container::put(&mut v, Box {f1: R{}, f2: R{}}); + │ ---------------------- The type '0x2::M::Box<0x2::M::R>' does not have the ability 'drop' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack.exp deleted file mode 100644 index 132382faab8cc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/type_variable_join_threaded_unpack.move:39:42 - │ -23 │ struct Box has drop { f1: T, f2: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -36 │ fun t1(): Box> { - │ ------------- The type '0x2::M::Box<0x2::M::Box>' does not have the ability 'copy' - · -39 │ Container::put(&mut v, Box { f1: *&f1, f2 }); - │ ^^^^ Invalid dereference. Dereference requires the 'copy' ability - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack.snap new file mode 100644 index 0000000000000..8593f6bced52e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/type_variable_join_threaded_unpack.move:39:42 + │ +23 │ struct Box has drop { f1: T, f2: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +36 │ fun t1(): Box> { + │ ------------- The type '0x2::M::Box<0x2::M::Box>' does not have the ability 'copy' + · +39 │ Container::put(&mut v, Box { f1: *&f1, f2 }); + │ ^^^^ Invalid dereference. Dereference requires the 'copy' ability diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_assign.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_assign.exp deleted file mode 100644 index ab7fffea67ce9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_assign.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/type_variable_join_threaded_unpack_assign.move:44:42 - │ -23 │ struct Box has drop { f1: T, f2: T } - │ --- To satisfy the constraint, the 'copy' ability would need to be added here - · -39 │ fun t1(): Box> { - │ ------------- The type '0x2::M::Box<0x2::M::Box>' does not have the ability 'copy' - · -44 │ Container::put(&mut v, Box { f1: *&f1, f2 }); - │ ^^^^ Invalid dereference. Dereference requires the 'copy' ability - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_assign.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_assign.snap new file mode 100644 index 0000000000000..08f5fd4c3661c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_assign.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_assign.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/type_variable_join_threaded_unpack_assign.move:44:42 + │ +23 │ struct Box has drop { f1: T, f2: T } + │ --- To satisfy the constraint, the 'copy' ability would need to be added here + · +39 │ fun t1(): Box> { + │ ------------- The type '0x2::M::Box<0x2::M::Box>' does not have the ability 'copy' + · +44 │ Container::put(&mut v, Box { f1: *&f1, f2 }); + │ ^^^^ Invalid dereference. Dereference requires the 'copy' ability diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_assign_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_assign_invalid.exp deleted file mode 100644 index 50e8a4f7eca34..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_assign_invalid.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/type_variable_join_threaded_unpack_assign_invalid.move:36:9 - │ -30 │ fun t0(): bool { - │ ---- Expected: 'bool' -31 │ let v = Container::new(); -32 │ let f1; - │ -- Given: integer - · -36 │ f1 - │ ^^ Invalid return expression - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/type_variable_join_threaded_unpack_assign_invalid.move:43:27 - │ -10 │ public fun get(_self: &T): V { - │ ---- 'drop' constraint declared here - · -43 │ Box { f1, f2 } = Container::get(&v); - │ -------------- ^^^^^^^^^^^^^^^^^^ 'drop' constraint not satisifed - │ │ - │ The type '0x2::M::Box<0x2::M::R>' does not have the ability 'drop' - │ The type '0x2::M::Box<0x2::M::R>' can have the ability 'drop' but the type argument '0x2::M::R' does not have the required ability 'drop' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_assign_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_assign_invalid.snap new file mode 100644 index 0000000000000..fae63074a9194 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_assign_invalid.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_assign_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/type_variable_join_threaded_unpack_assign_invalid.move:36:9 + │ +30 │ fun t0(): bool { + │ ---- Expected: 'bool' +31 │ let v = Container::new(); +32 │ let f1; + │ -- Given: integer + · +36 │ f1 + │ ^^ Invalid return expression + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/type_variable_join_threaded_unpack_assign_invalid.move:43:27 + │ +10 │ public fun get(_self: &T): V { + │ ---- 'drop' constraint declared here + · +43 │ Box { f1, f2 } = Container::get(&v); + │ -------------- ^^^^^^^^^^^^^^^^^^ 'drop' constraint not satisifed + │ │ + │ The type '0x2::M::Box<0x2::M::R>' does not have the ability 'drop' + │ The type '0x2::M::Box<0x2::M::R>' can have the ability 'drop' but the type argument '0x2::M::R' does not have the required ability 'drop' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_invalid.exp deleted file mode 100644 index da3765cc36c68..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_invalid.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/type_variable_join_threaded_unpack_invalid.move:34:9 - │ -30 │ fun t0(): bool { - │ ---- Expected: 'bool' -31 │ let v = Container::new(); -32 │ let Box { f1, f2 } = Container::get(&v); f2; - │ -------------- Given: integer -33 │ Container::put(&mut v, Box { f1: 0, f2: 0}); -34 │ f1 - │ ^^ Invalid return expression - -error[E05001]: ability constraint not satisfied - ┌─ tests/move_check/typing/type_variable_join_threaded_unpack_invalid.move:39:31 - │ -10 │ public fun get(_self: &T): V { - │ ---- 'drop' constraint declared here - · -39 │ let Box { f1, f2 } = Container::get(&v); - │ -------------- ^^^^^^^^^^^^^^^^^^ 'drop' constraint not satisifed - │ │ - │ The type '0x2::M::Box<0x2::M::R>' does not have the ability 'drop' - │ The type '0x2::M::Box<0x2::M::R>' can have the ability 'drop' but the type argument '0x2::M::R' does not have the required ability 'drop' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_invalid.snap new file mode 100644 index 0000000000000..46dd698a98d87 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_invalid.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/type_variable_join_threaded_unpack_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/type_variable_join_threaded_unpack_invalid.move:34:9 + │ +30 │ fun t0(): bool { + │ ---- Expected: 'bool' +31 │ let v = Container::new(); +32 │ let Box { f1, f2 } = Container::get(&v); f2; + │ -------------- Given: integer +33 │ Container::put(&mut v, Box { f1: 0, f2: 0}); +34 │ f1 + │ ^^ Invalid return expression + +error[E05001]: ability constraint not satisfied + ┌─ tests/move_check/typing/type_variable_join_threaded_unpack_invalid.move:39:31 + │ +10 │ public fun get(_self: &T): V { + │ ---- 'drop' constraint declared here + · +39 │ let Box { f1, f2 } = Container::get(&v); + │ -------------- ^^^^^^^^^^^^^^^^^^ 'drop' constraint not satisifed + │ │ + │ The type '0x2::M::Box<0x2::M::R>' does not have the ability 'drop' + │ The type '0x2::M::Box<0x2::M::R>' can have the ability 'drop' but the type argument '0x2::M::R' does not have the required ability 'drop' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unary_not.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/unary_not.snap new file mode 100644 index 0000000000000..c6ca148528a48 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/unary_not.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/unary_not.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unary_not_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/unary_not_invalid.exp deleted file mode 100644 index 8f9a7a4595065..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/unary_not_invalid.exp +++ /dev/null @@ -1,84 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/unary_not_invalid.move:7:10 - │ -7 │ !&true; - │ ^^^^^ - │ │ - │ Invalid argument to '!' - │ Expected: 'bool' - │ Given: '&bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/unary_not_invalid.move:8:10 - │ -8 │ !&false; - │ ^^^^^^ - │ │ - │ Invalid argument to '!' - │ Expected: 'bool' - │ Given: '&bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/unary_not_invalid.move:9:10 - │ -9 │ !0; - │ ^ - │ │ - │ Invalid argument to '!' - │ Expected: 'bool' - │ Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/unary_not_invalid.move:10:10 - │ -10 │ !1; - │ ^ - │ │ - │ Invalid argument to '!' - │ Expected: 'bool' - │ Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/unary_not_invalid.move:11:10 - │ - 6 │ fun t0(r: R) { - │ - Given: '0x8675309::M::R' - · -11 │ !r; - │ ^ - │ │ - │ Invalid argument to '!' - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/unary_not_invalid.move:12:10 - │ - 6 │ fun t0(r: R) { - │ - Given: '0x8675309::M::R' - · -12 │ !r; - │ ^ - │ │ - │ Invalid argument to '!' - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/unary_not_invalid.move:13:10 - │ -13 │ !(0, false); - │ ^^^^^^^^^^ - │ │ - │ Invalid argument to '!' - │ Expected: 'bool' - │ Given: '({integer}, bool)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/unary_not_invalid.move:14:10 - │ -14 │ !(); - │ ^^ - │ │ - │ Invalid argument to '!' - │ Expected: 'bool' - │ Given: '()' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unary_not_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/unary_not_invalid.snap new file mode 100644 index 0000000000000..265ad606c3ad3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/unary_not_invalid.snap @@ -0,0 +1,91 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/unary_not_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/unary_not_invalid.move:7:10 + │ +7 │ !&true; + │ ^^^^^ + │ │ + │ Invalid argument to '!' + │ Expected: 'bool' + │ Given: '&bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/unary_not_invalid.move:8:10 + │ +8 │ !&false; + │ ^^^^^^ + │ │ + │ Invalid argument to '!' + │ Expected: 'bool' + │ Given: '&bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/unary_not_invalid.move:9:10 + │ +9 │ !0; + │ ^ + │ │ + │ Invalid argument to '!' + │ Expected: 'bool' + │ Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/unary_not_invalid.move:10:10 + │ +10 │ !1; + │ ^ + │ │ + │ Invalid argument to '!' + │ Expected: 'bool' + │ Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/unary_not_invalid.move:11:10 + │ + 6 │ fun t0(r: R) { + │ - Given: '0x8675309::M::R' + · +11 │ !r; + │ ^ + │ │ + │ Invalid argument to '!' + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/unary_not_invalid.move:12:10 + │ + 6 │ fun t0(r: R) { + │ - Given: '0x8675309::M::R' + · +12 │ !r; + │ ^ + │ │ + │ Invalid argument to '!' + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/unary_not_invalid.move:13:10 + │ +13 │ !(0, false); + │ ^^^^^^^^^^ + │ │ + │ Invalid argument to '!' + │ Expected: 'bool' + │ Given: '({integer}, bool)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/unary_not_invalid.move:14:10 + │ +14 │ !(); + │ ^^ + │ │ + │ Invalid argument to '!' + │ Expected: 'bool' + │ Given: '()' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_call.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_call.exp deleted file mode 100644 index 1bb21784251c0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_call.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/uninferred_type_call.move:3:9 - │ -3 │ foo() - │ ^^^^^ Could not infer this type. Try adding an annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_call.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_call.snap new file mode 100644 index 0000000000000..1fac675608c54 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_call.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/uninferred_type_call.move +--- +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/uninferred_type_call.move:3:9 + │ +3 │ foo() + │ ^^^^^ Could not infer this type. Try adding an annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_pack.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_pack.exp deleted file mode 100644 index d62df38b54c4d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_pack.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/uninferred_type_pack.move:5:9 - │ -5 │ S{}; - │ ^^^ Could not infer this type. Try adding an annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_pack.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_pack.snap new file mode 100644 index 0000000000000..a95a49a980972 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_pack.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/uninferred_type_pack.move +--- +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/uninferred_type_pack.move:5:9 + │ +5 │ S{}; + │ ^^^ Could not infer this type. Try adding an annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_assign.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_assign.exp deleted file mode 100644 index a1af273a9fcfa..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_assign.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/uninferred_type_unpack_assign.move:5:9 - │ -5 │ S{} = S{}; - │ ^^^ Could not infer this type. Try adding an annotation - -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/uninferred_type_unpack_assign.move:5:15 - │ -5 │ S{} = S{}; - │ ^^^ Could not infer this type. Try adding an annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_assign.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_assign.snap new file mode 100644 index 0000000000000..0b93f5774b76d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_assign.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_assign.move +--- +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/uninferred_type_unpack_assign.move:5:9 + │ +5 │ S{} = S{}; + │ ^^^ Could not infer this type. Try adding an annotation + +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/uninferred_type_unpack_assign.move:5:15 + │ +5 │ S{} = S{}; + │ ^^^ Could not infer this type. Try adding an annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_bind.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_bind.exp deleted file mode 100644 index ff9cc61ed99b6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_bind.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/uninferred_type_unpack_bind.move:5:13 - │ -5 │ let S{} = S{}; - │ ^^^ Could not infer this type. Try adding an annotation - -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/uninferred_type_unpack_bind.move:5:19 - │ -5 │ let S{} = S{}; - │ ^^^ Could not infer this type. Try adding an annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_bind.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_bind.snap new file mode 100644 index 0000000000000..4686f99529c92 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_bind.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_bind.move +--- +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/uninferred_type_unpack_bind.move:5:13 + │ +5 │ let S{} = S{}; + │ ^^^ Could not infer this type. Try adding an annotation + +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/uninferred_type_unpack_bind.move:5:19 + │ +5 │ let S{} = S{}; + │ ^^^ Could not infer this type. Try adding an annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_decl.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_decl.exp deleted file mode 100644 index 4e21d9e9936fc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_decl.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/uninferred_type_unpack_decl.move:5:13 - │ -5 │ let S{}; - │ ^^^ Could not infer this type. Try adding an annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_decl.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_decl.snap new file mode 100644 index 0000000000000..3554412af7480 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_decl.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/uninferred_type_unpack_decl.move +--- +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/uninferred_type_unpack_decl.move:5:13 + │ +5 │ let S{}; + │ ^^^ Could not infer this type. Try adding an annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unit.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/unit.snap new file mode 100644 index 0000000000000..31069e88f61ae --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/unit.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/unit.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_const.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_const.snap new file mode 100644 index 0000000000000..7f4f67fa397c7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_const.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/unused_const.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_const.unused.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_const.unused.exp deleted file mode 100644 index 0c6d9de9e5fdd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_const.unused.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W09011]: unused constant - ┌─ tests/move_check/typing/unused_const.move:2:11 - │ -2 │ const UNUSED: u64 = 42; - │ ^^^^^^ The constant 'UNUSED' is never used. Consider removing it. - │ - = This warning can be suppressed with '#[allow(unused_const)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_const@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_const@unused.snap new file mode 100644 index 0000000000000..70883c5aed143 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_const@unused.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/unused_const.move +--- +warning[W09011]: unused constant + ┌─ tests/move_check/typing/unused_const.move:2:11 + │ +2 │ const UNUSED: u64 = 42; + │ ^^^^^^ The constant 'UNUSED' is never used. Consider removing it. + │ + = This warning can be suppressed with '#[allow(unused_const)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_functions.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_functions.snap new file mode 100644 index 0000000000000..de96a1a295364 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_functions.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/unused_functions.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_functions.unused.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_functions.unused.exp deleted file mode 100644 index c921043fd47cf..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_functions.unused.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[W09008]: unused function - ┌─ tests/move_check/typing/unused_functions.move:3:9 - │ -3 │ fun init() { - │ ^^^^ The non-'public', non-'entry' function 'init' is never called. Consider removing it. - │ - = This warning can be suppressed with '#[allow(unused_function)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09008]: unused function - ┌─ tests/move_check/typing/unused_functions.move:11:9 - │ -11 │ fun unused_private() {} - │ ^^^^^^^^^^^^^^ The non-'public', non-'entry' function 'unused_private' is never called. Consider removing it. - │ - = This warning can be suppressed with '#[allow(unused_function)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_functions@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_functions@unused.snap new file mode 100644 index 0000000000000..060b609496f4c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_functions@unused.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/unused_functions.move +--- +warning[W09008]: unused function + ┌─ tests/move_check/typing/unused_functions.move:3:9 + │ +3 │ fun init() { + │ ^^^^ The non-'public', non-'entry' function 'init' is never called. Consider removing it. + │ + = This warning can be suppressed with '#[allow(unused_function)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09008]: unused function + ┌─ tests/move_check/typing/unused_functions.move:11:9 + │ +11 │ fun unused_private() {} + │ ^^^^^^^^^^^^^^ The non-'public', non-'entry' function 'unused_private' is never called. Consider removing it. + │ + = This warning can be suppressed with '#[allow(unused_function)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_id_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_id_field.snap new file mode 100644 index 0000000000000..195a7995d5362 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_id_field.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/unused_id_field.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_id_field.unused.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_id_field.unused.exp deleted file mode 100644 index cb49f75c89d80..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_id_field.unused.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W09009]: unused struct field - ┌─ tests/move_check/typing/unused_id_field.move:5:26 - │ -5 │ struct Obj has key { id: sui::object::UID } - │ ^^ The 'id' field of the 'Obj' type is unused - │ - = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_id_field@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_id_field@unused.snap new file mode 100644 index 0000000000000..95614cf305365 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_id_field@unused.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/unused_id_field.move +--- +warning[W09009]: unused struct field + ┌─ tests/move_check/typing/unused_id_field.move:5:26 + │ +5 │ struct Obj has key { id: sui::object::UID } + │ ^^ The 'id' field of the 'Obj' type is unused + │ + = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_local.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_local.exp deleted file mode 100644 index 954aea57947c4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_local.exp +++ /dev/null @@ -1,80 +0,0 @@ -warning[W09002]: unused variable - ┌─ tests/move_check/typing/unused_local.move:5:13 - │ -5 │ let x: u64; - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/typing/unused_local.move:9:14 - │ -9 │ let (x, y): (u64, u64); - │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/typing/unused_local.move:9:17 - │ -9 │ let (x, y): (u64, u64); - │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/typing/unused_local.move:13:16 - │ -13 │ let S{ f, g }: S; - │ ^ Unused local variable 'f'. Consider removing or prefixing with an underscore: '_f' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/typing/unused_local.move:13:19 - │ -13 │ let S{ f, g }: S; - │ ^ Unused local variable 'g'. Consider removing or prefixing with an underscore: '_g' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/typing/unused_local.move:25:22 - │ -25 │ fun unused_param(x: u64) { - │ ^ Unused parameter 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/typing/unused_local.move:28:20 - │ -28 │ fun two_unused(x: u64, y: bool) { - │ ^ Unused parameter 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/typing/unused_local.move:28:28 - │ -28 │ fun two_unused(x: u64, y: bool) { - │ ^ Unused parameter 'y'. Consider removing or prefixing with an underscore: '_y' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/typing/unused_local.move:31:35 - │ -31 │ fun unused_param1_used_param2(x: u64, y: bool): bool { - │ ^ Unused parameter 'x'. Consider removing or prefixing with an underscore: '_x' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09002]: unused variable - ┌─ tests/move_check/typing/unused_local.move:35:43 - │ -35 │ fun unused_param2_used_param1(x: u64, y: bool): u64 { - │ ^ Unused parameter 'y'. Consider removing or prefixing with an underscore: '_y' - │ - = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_local.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_local.snap new file mode 100644 index 0000000000000..fc55e51e58e86 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_local.snap @@ -0,0 +1,87 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/unused_local.move +--- +warning[W09002]: unused variable + ┌─ tests/move_check/typing/unused_local.move:5:13 + │ +5 │ let x: u64; + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/typing/unused_local.move:9:14 + │ +9 │ let (x, y): (u64, u64); + │ ^ Unused local variable 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/typing/unused_local.move:9:17 + │ +9 │ let (x, y): (u64, u64); + │ ^ Unused local variable 'y'. Consider removing or prefixing with an underscore: '_y' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/typing/unused_local.move:13:16 + │ +13 │ let S{ f, g }: S; + │ ^ Unused local variable 'f'. Consider removing or prefixing with an underscore: '_f' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/typing/unused_local.move:13:19 + │ +13 │ let S{ f, g }: S; + │ ^ Unused local variable 'g'. Consider removing or prefixing with an underscore: '_g' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/typing/unused_local.move:25:22 + │ +25 │ fun unused_param(x: u64) { + │ ^ Unused parameter 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/typing/unused_local.move:28:20 + │ +28 │ fun two_unused(x: u64, y: bool) { + │ ^ Unused parameter 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/typing/unused_local.move:28:28 + │ +28 │ fun two_unused(x: u64, y: bool) { + │ ^ Unused parameter 'y'. Consider removing or prefixing with an underscore: '_y' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/typing/unused_local.move:31:35 + │ +31 │ fun unused_param1_used_param2(x: u64, y: bool): bool { + │ ^ Unused parameter 'x'. Consider removing or prefixing with an underscore: '_x' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09002]: unused variable + ┌─ tests/move_check/typing/unused_local.move:35:43 + │ +35 │ fun unused_param2_used_param1(x: u64, y: bool): u64 { + │ ^ Unused parameter 'y'. Consider removing or prefixing with an underscore: '_y' + │ + = This warning can be suppressed with '#[allow(unused_variable)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_non_phantom_param.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_non_phantom_param.exp deleted file mode 100644 index 1c90586402086..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_non_phantom_param.exp +++ /dev/null @@ -1,8 +0,0 @@ -warning[W09006]: unused struct type parameter - ┌─ tests/move_check/typing/unused_non_phantom_param.move:2:18 - │ -2 │ struct S { - │ ^^ Unused type parameter 'T2'. Consider declaring it as phantom - │ - = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_non_phantom_param.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_non_phantom_param.snap new file mode 100644 index 0000000000000..1778638d48ad5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_non_phantom_param.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/unused_non_phantom_param.move +--- +warning[W09006]: unused struct type parameter + ┌─ tests/move_check/typing/unused_non_phantom_param.move:2:18 + │ +2 │ struct S { + │ ^^ Unused type parameter 'T2'. Consider declaring it as phantom + │ + = This warning can be suppressed with '#[allow(unused_type_parameter)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_struct_field.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_struct_field.exp deleted file mode 100644 index ff6206324a69c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_struct_field.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/unused_struct_field.move:63:57 - │ -63 │ public fun flaky(x: 0x42::private_struct::S): u64 { x.f } - │ ^^^ Invalid access of field 'f' on the struct '0x42::private_struct::S'. The field 'f' can only be accessed within the module '0x42::private_struct' since it defines 'S' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_struct_field.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_struct_field.snap new file mode 100644 index 0000000000000..8378c745d13eb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_struct_field.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/unused_struct_field.move +--- +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/unused_struct_field.move:63:57 + │ +63 │ public fun flaky(x: 0x42::private_struct::S): u64 { x.f } + │ ^^^ Invalid access of field 'f' on the struct '0x42::private_struct::S'. The field 'f' can only be accessed within the module '0x42::private_struct' since it defines 'S' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_struct_field.unused.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_struct_field.unused.exp deleted file mode 100644 index bd2f900bd76a2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_struct_field.unused.exp +++ /dev/null @@ -1,30 +0,0 @@ -warning[W09009]: unused struct field - ┌─ tests/move_check/typing/unused_struct_field.move:13:9 - │ -13 │ field_unused: u8 - │ ^^^^^^^^^^^^ The 'field_unused' field of the 'OneUnusedFieldStruct' type is unused - │ - = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09009]: unused struct field - ┌─ tests/move_check/typing/unused_struct_field.move:27:9 - │ -27 │ field1: u8, - │ ^^^^^^ The 'field1' field of the 'AllUnusedFieldsStruct' type is unused - │ - = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09009]: unused struct field - ┌─ tests/move_check/typing/unused_struct_field.move:28:9 - │ -28 │ field2: u8, - │ ^^^^^^ The 'field2' field of the 'AllUnusedFieldsStruct' type is unused - │ - = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E04001]: restricted visibility - ┌─ tests/move_check/typing/unused_struct_field.move:63:57 - │ -63 │ public fun flaky(x: 0x42::private_struct::S): u64 { x.f } - │ ^^^ Invalid access of field 'f' on the struct '0x42::private_struct::S'. The field 'f' can only be accessed within the module '0x42::private_struct' since it defines 'S' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_struct_field@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_struct_field@unused.snap new file mode 100644 index 0000000000000..32c58c577b3f2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/unused_struct_field@unused.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/unused_struct_field.move +--- +warning[W09009]: unused struct field + ┌─ tests/move_check/typing/unused_struct_field.move:13:9 + │ +13 │ field_unused: u8 + │ ^^^^^^^^^^^^ The 'field_unused' field of the 'OneUnusedFieldStruct' type is unused + │ + = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09009]: unused struct field + ┌─ tests/move_check/typing/unused_struct_field.move:27:9 + │ +27 │ field1: u8, + │ ^^^^^^ The 'field1' field of the 'AllUnusedFieldsStruct' type is unused + │ + = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09009]: unused struct field + ┌─ tests/move_check/typing/unused_struct_field.move:28:9 + │ +28 │ field2: u8, + │ ^^^^^^ The 'field2' field of the 'AllUnusedFieldsStruct' type is unused + │ + = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E04001]: restricted visibility + ┌─ tests/move_check/typing/unused_struct_field.move:63:57 + │ +63 │ public fun flaky(x: 0x42::private_struct::S): u64 { x.f } + │ ^^^ Invalid access of field 'f' on the struct '0x42::private_struct::S'. The field 'f' can only be accessed within the module '0x42::private_struct' since it defines 'S' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/use_local.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/use_local.snap new file mode 100644 index 0000000000000..ded67bd5c1c9f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/use_local.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/use_local.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/used_const.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/used_const.snap new file mode 100644 index 0000000000000..2e5df203574e0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/used_const.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/used_const.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/used_const@unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/used_const@unused.snap new file mode 100644 index 0000000000000..2e5df203574e0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/used_const@unused.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/used_const.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/values.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/values.snap new file mode 100644 index 0000000000000..9251606e9f18b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/values.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/values.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_basic_cases.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_basic_cases.snap new file mode 100644 index 0000000000000..1edbcd40ce3b8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_basic_cases.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/vector_basic_cases.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_mismatched_args.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_mismatched_args.exp deleted file mode 100644 index 70ae728a80669..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_mismatched_args.exp +++ /dev/null @@ -1,50 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/vector_mismatched_args.move:7:9 - │ -7 │ vector[0, false]; - │ ^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found: 'bool'. It is not compatible with the other type. - │ │ Found: integer. It is not compatible with the other type. - │ Invalid 'vector' instantiation. Incompatible argument - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/vector_mismatched_args.move:8:9 - │ -8 │ vector[0u8, 0u64, 0u128]; - │ ^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found: 'u64'. It is not compatible with the other type. - │ │ Found: 'u8'. It is not compatible with the other type. - │ Invalid 'vector' instantiation. Incompatible argument - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/vector_mismatched_args.move:9:9 - │ -9 │ vector[0, @0]; - │ ^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found: 'address'. It is not compatible with the other type. - │ │ Found: integer. It is not compatible with the other type. - │ Invalid 'vector' instantiation. Incompatible argument - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/vector_mismatched_args.move:10:9 - │ -10 │ vector[X{}, Y{}]; - │ ^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found: '0x42::Test::Y'. It is not compatible with the other type. - │ │ Found: '0x42::Test::X'. It is not compatible with the other type. - │ Invalid 'vector' instantiation. Incompatible argument - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/vector_mismatched_args.move:11:9 - │ -11 │ vector[&0, &false]; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found: 'bool'. It is not compatible with the other type. - │ │ Found: integer. It is not compatible with the other type. - │ Invalid 'vector' instantiation. Incompatible argument - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_mismatched_args.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_mismatched_args.snap new file mode 100644 index 0000000000000..e0469dc36203c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_mismatched_args.snap @@ -0,0 +1,57 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/vector_mismatched_args.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/vector_mismatched_args.move:7:9 + │ +7 │ vector[0, false]; + │ ^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found: 'bool'. It is not compatible with the other type. + │ │ Found: integer. It is not compatible with the other type. + │ Invalid 'vector' instantiation. Incompatible argument + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/vector_mismatched_args.move:8:9 + │ +8 │ vector[0u8, 0u64, 0u128]; + │ ^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found: 'u64'. It is not compatible with the other type. + │ │ Found: 'u8'. It is not compatible with the other type. + │ Invalid 'vector' instantiation. Incompatible argument + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/vector_mismatched_args.move:9:9 + │ +9 │ vector[0, @0]; + │ ^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found: 'address'. It is not compatible with the other type. + │ │ Found: integer. It is not compatible with the other type. + │ Invalid 'vector' instantiation. Incompatible argument + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/vector_mismatched_args.move:10:9 + │ +10 │ vector[X{}, Y{}]; + │ ^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found: '0x42::Test::Y'. It is not compatible with the other type. + │ │ Found: '0x42::Test::X'. It is not compatible with the other type. + │ Invalid 'vector' instantiation. Incompatible argument + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/vector_mismatched_args.move:11:9 + │ +11 │ vector[&0, &false]; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found: 'bool'. It is not compatible with the other type. + │ │ Found: integer. It is not compatible with the other type. + │ Invalid 'vector' instantiation. Incompatible argument diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_mismatched_args_non_base_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_mismatched_args_non_base_type.exp deleted file mode 100644 index efb1fef86121e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_mismatched_args_non_base_type.exp +++ /dev/null @@ -1,29 +0,0 @@ -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/vector_mismatched_args_non_base_type.move:7:9 - │ -7 │ vector<&mut u64>[&0]; - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&mut u64' - │ Invalid 'vector' type - -error[E04006]: invalid subtype - ┌─ tests/move_check/typing/vector_mismatched_args_non_base_type.move:7:9 - │ -7 │ vector<&mut u64>[&0]; - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Given: '&{integer}' - │ │ Expected: '&mut u64' - │ Invalid 'vector' instantiation. Invalid argument type - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/vector_mismatched_args_non_base_type.move:8:9 - │ -8 │ vector[(), (0, 1)]; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ │ - │ │ │ Found: '({integer}, {integer})'. It is not compatible with the other type. - │ │ Found: '()'. It is not compatible with the other type. - │ Invalid 'vector' instantiation. Incompatible argument - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_mismatched_args_non_base_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_mismatched_args_non_base_type.snap new file mode 100644 index 0000000000000..e7c64a1d97801 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_mismatched_args_non_base_type.snap @@ -0,0 +1,36 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/vector_mismatched_args_non_base_type.move +--- +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/vector_mismatched_args_non_base_type.move:7:9 + │ +7 │ vector<&mut u64>[&0]; + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&mut u64' + │ Invalid 'vector' type + +error[E04006]: invalid subtype + ┌─ tests/move_check/typing/vector_mismatched_args_non_base_type.move:7:9 + │ +7 │ vector<&mut u64>[&0]; + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Given: '&{integer}' + │ │ Expected: '&mut u64' + │ Invalid 'vector' instantiation. Invalid argument type + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/vector_mismatched_args_non_base_type.move:8:9 + │ +8 │ vector[(), (0, 1)]; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ │ + │ │ │ Found: '({integer}, {integer})'. It is not compatible with the other type. + │ │ Found: '()'. It is not compatible with the other type. + │ Invalid 'vector' instantiation. Incompatible argument diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_no_type_inferred.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_no_type_inferred.exp deleted file mode 100644 index cad83c588ae37..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_no_type_inferred.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E04010]: cannot infer type - ┌─ tests/move_check/typing/vector_no_type_inferred.move:4:9 - │ -4 │ vector[]; - │ ^^^^^^^^ Could not infer this type. Try adding an annotation - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_no_type_inferred.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_no_type_inferred.snap new file mode 100644 index 0000000000000..747b41166afb4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_no_type_inferred.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/vector_no_type_inferred.move +--- +error[E04010]: cannot infer type + ┌─ tests/move_check/typing/vector_no_type_inferred.move:4:9 + │ +4 │ vector[]; + │ ^^^^^^^^ Could not infer this type. Try adding an annotation diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_with_non_base_type.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_with_non_base_type.exp deleted file mode 100644 index 19b82ed309081..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_with_non_base_type.exp +++ /dev/null @@ -1,36 +0,0 @@ -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/vector_with_non_base_type.move:4:17 - │ -4 │ let _ = vector<&u64>[]; - │ ^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&u64' - │ Invalid 'vector' type - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/vector_with_non_base_type.move:5:17 - │ -5 │ let _ = vector<&mut u64>[]; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&mut u64' - │ Invalid 'vector' type - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/vector_with_non_base_type.move:6:17 - │ -6 │ let _ = vector<()>[]; - │ ^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '()' - │ Invalid 'vector' type - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/vector_with_non_base_type.move:7:17 - │ -7 │ let _ = vector<(u64, bool)>[]; - │ ^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '(u64, bool)' - │ Invalid 'vector' type - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_with_non_base_type.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_with_non_base_type.snap new file mode 100644 index 0000000000000..3a9ad54ae71d8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_with_non_base_type.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/vector_with_non_base_type.move +--- +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/vector_with_non_base_type.move:4:17 + │ +4 │ let _ = vector<&u64>[]; + │ ^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&u64' + │ Invalid 'vector' type + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/vector_with_non_base_type.move:5:17 + │ +5 │ let _ = vector<&mut u64>[]; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&mut u64' + │ Invalid 'vector' type + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/vector_with_non_base_type.move:6:17 + │ +6 │ let _ = vector<()>[]; + │ ^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '()' + │ Invalid 'vector' type + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/vector_with_non_base_type.move:7:17 + │ +7 │ let _ = vector<(u64, bool)>[]; + │ ^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '(u64, bool)' + │ Invalid 'vector' type diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_with_non_base_type_inferred.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_with_non_base_type_inferred.exp deleted file mode 100644 index 46fc4e1495ef1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_with_non_base_type_inferred.exp +++ /dev/null @@ -1,54 +0,0 @@ -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/vector_with_non_base_type_inferred.move:4:9 - │ -4 │ vector[&0]; - │ ^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&u64' - │ Invalid 'vector' type - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/vector_with_non_base_type_inferred.move:5:9 - │ -5 │ vector[&mut 0]; - │ ^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&mut u64' - │ Invalid 'vector' type - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/vector_with_non_base_type_inferred.move:6:9 - │ -6 │ vector[()]; - │ ^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '()' - │ Invalid 'vector' type - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/vector_with_non_base_type_inferred.move:7:9 - │ -7 │ vector[(0, false)]; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '(u64, bool)' - │ Invalid 'vector' type - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/vector_with_non_base_type_inferred.move:9:9 - │ -9 │ vector[&0, &mut 0]; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&u64' - │ Invalid 'vector' type - -error[E04004]: expected a single non-reference type - ┌─ tests/move_check/typing/vector_with_non_base_type_inferred.move:10:9 - │ -10 │ vector[&mut 0, &0]; - │ ^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a single non-reference type, but found: '&u64' - │ Invalid 'vector' type - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_with_non_base_type_inferred.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_with_non_base_type_inferred.snap new file mode 100644 index 0000000000000..504aa1d9c86ca --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/vector_with_non_base_type_inferred.snap @@ -0,0 +1,61 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/vector_with_non_base_type_inferred.move +--- +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/vector_with_non_base_type_inferred.move:4:9 + │ +4 │ vector[&0]; + │ ^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&u64' + │ Invalid 'vector' type + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/vector_with_non_base_type_inferred.move:5:9 + │ +5 │ vector[&mut 0]; + │ ^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&mut u64' + │ Invalid 'vector' type + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/vector_with_non_base_type_inferred.move:6:9 + │ +6 │ vector[()]; + │ ^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '()' + │ Invalid 'vector' type + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/vector_with_non_base_type_inferred.move:7:9 + │ +7 │ vector[(0, false)]; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '(u64, bool)' + │ Invalid 'vector' type + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/vector_with_non_base_type_inferred.move:9:9 + │ +9 │ vector[&0, &mut 0]; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&u64' + │ Invalid 'vector' type + +error[E04004]: expected a single non-reference type + ┌─ tests/move_check/typing/vector_with_non_base_type_inferred.move:10:9 + │ +10 │ vector[&mut 0, &0]; + │ ^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a single non-reference type, but found: '&u64' + │ Invalid 'vector' type diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/while_body.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/while_body.snap new file mode 100644 index 0000000000000..47844d013d9cb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/while_body.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/while_body.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/while_body_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/while_body_invalid.exp deleted file mode 100644 index 65803893d01aa..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/while_body_invalid.exp +++ /dev/null @@ -1,50 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/while_body_invalid.move:3:22 - │ -3 │ while (cond) 0; - │ ^ - │ │ - │ Invalid loop body - │ Expected: '()' - │ Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/while_body_invalid.move:4:22 - │ -4 │ while (cond) false; - │ ^^^^^ - │ │ - │ Invalid loop body - │ Expected: '()' - │ Given: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/while_body_invalid.move:5:22 - │ -5 │ while (cond) { @0x0 }; - │ ^^^^^^^^ - │ │ │ - │ │ Given: 'address' - │ Invalid loop body - │ Expected: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/while_body_invalid.move:6:22 - │ -6 │ while (cond) { let x = 0; x }; - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: integer - │ Invalid loop body - │ Expected: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/while_body_invalid.move:7:22 - │ -7 │ while (cond) { if (cond) 1 else 0 }; - │ ^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: integer - │ Invalid loop body - │ Expected: '()' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/while_body_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/while_body_invalid.snap new file mode 100644 index 0000000000000..7c8c195b25bb2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/while_body_invalid.snap @@ -0,0 +1,57 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/while_body_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/while_body_invalid.move:3:22 + │ +3 │ while (cond) 0; + │ ^ + │ │ + │ Invalid loop body + │ Expected: '()' + │ Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/while_body_invalid.move:4:22 + │ +4 │ while (cond) false; + │ ^^^^^ + │ │ + │ Invalid loop body + │ Expected: '()' + │ Given: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/while_body_invalid.move:5:22 + │ +5 │ while (cond) { @0x0 }; + │ ^^^^^^^^ + │ │ │ + │ │ Given: 'address' + │ Invalid loop body + │ Expected: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/while_body_invalid.move:6:22 + │ +6 │ while (cond) { let x = 0; x }; + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: integer + │ Invalid loop body + │ Expected: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/while_body_invalid.move:7:22 + │ +7 │ while (cond) { if (cond) 1 else 0 }; + │ ^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: integer + │ Invalid loop body + │ Expected: '()' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/while_condition.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/while_condition.snap new file mode 100644 index 0000000000000..7c50bdf4c0e73 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/while_condition.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/while_condition.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/while_condition_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/typing/while_condition_invalid.exp deleted file mode 100644 index 0db67533891f8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/typing/while_condition_invalid.exp +++ /dev/null @@ -1,81 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/typing/while_condition_invalid.move:3:16 - │ -3 │ while (()) (); - │ ^^ - │ │ - │ Invalid while condition - │ Expected: 'bool' - │ Given: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/while_condition_invalid.move:4:17 - │ -4 │ while ((())) (); - │ ^^ - │ │ - │ Invalid while condition - │ Expected: 'bool' - │ Given: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/while_condition_invalid.move:5:16 - │ -5 │ while ({}) () - │ ^^ - │ │ - │ Invalid while condition - │ Expected: 'bool' - │ Given: '()' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/while_condition_invalid.move:9:16 - │ -8 │ fun t1(x: T) { - │ - Given: 'T' -9 │ while (x) (); - │ ^ - │ │ - │ Invalid while condition - │ Expected: 'bool' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/while_condition_invalid.move:10:16 - │ -10 │ while (0) (); - │ ^ - │ │ - │ Invalid while condition - │ Expected: 'bool' - │ Given: integer - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/while_condition_invalid.move:11:16 - │ -11 │ while (@0x0) () - │ ^^^^ - │ │ - │ Invalid while condition - │ Expected: 'bool' - │ Given: 'address' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/while_condition_invalid.move:15:16 - │ -15 │ while ((false, true)) (); - │ ^^^^^^^^^^^^^ - │ │ - │ Invalid while condition - │ Expected: 'bool' - │ Given: '(bool, bool)' - -error[E04007]: incompatible types - ┌─ tests/move_check/typing/while_condition_invalid.move:16:16 - │ -16 │ while ((0, false)) () - │ ^^^^^^^^^^ - │ │ - │ Invalid while condition - │ Expected: 'bool' - │ Given: '({integer}, bool)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/typing/while_condition_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/typing/while_condition_invalid.snap new file mode 100644 index 0000000000000..1cb4d15ab97f0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/typing/while_condition_invalid.snap @@ -0,0 +1,88 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/typing/while_condition_invalid.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/typing/while_condition_invalid.move:3:16 + │ +3 │ while (()) (); + │ ^^ + │ │ + │ Invalid while condition + │ Expected: 'bool' + │ Given: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/while_condition_invalid.move:4:17 + │ +4 │ while ((())) (); + │ ^^ + │ │ + │ Invalid while condition + │ Expected: 'bool' + │ Given: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/while_condition_invalid.move:5:16 + │ +5 │ while ({}) () + │ ^^ + │ │ + │ Invalid while condition + │ Expected: 'bool' + │ Given: '()' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/while_condition_invalid.move:9:16 + │ +8 │ fun t1(x: T) { + │ - Given: 'T' +9 │ while (x) (); + │ ^ + │ │ + │ Invalid while condition + │ Expected: 'bool' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/while_condition_invalid.move:10:16 + │ +10 │ while (0) (); + │ ^ + │ │ + │ Invalid while condition + │ Expected: 'bool' + │ Given: integer + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/while_condition_invalid.move:11:16 + │ +11 │ while (@0x0) () + │ ^^^^ + │ │ + │ Invalid while condition + │ Expected: 'bool' + │ Given: 'address' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/while_condition_invalid.move:15:16 + │ +15 │ while ((false, true)) (); + │ ^^^^^^^^^^^^^ + │ │ + │ Invalid while condition + │ Expected: 'bool' + │ Given: '(bool, bool)' + +error[E04007]: incompatible types + ┌─ tests/move_check/typing/while_condition_invalid.move:16:16 + │ +16 │ while ((0, false)) () + │ ^^^^^^^^^^ + │ │ + │ Invalid while condition + │ Expected: 'bool' + │ Given: '({integer}, bool)' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/attribute_location.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/attribute_location.snap new file mode 100644 index 0000000000000..f45b82ed33eaa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/attribute_location.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/attribute_location.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/attribute_location@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/attribute_location@unit_test.snap new file mode 100644 index 0000000000000..f45b82ed33eaa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/attribute_location@unit_test.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/attribute_location.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/attribute_location_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/attribute_location_invalid.exp deleted file mode 100644 index 6f5f93db3378a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/attribute_location_invalid.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E02015]: invalid attribute - ┌─ tests/move_check/unit_test/attribute_location_invalid.move:5:7 - │ -5 │ #[expected_failure(abort_code = 0)] - │ ^^^^^^^^^^^^^^^^ - │ │ - │ Known attribute 'expected_failure' is not expected with a struct - │ Expected to be used with one of the following: function - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/attribute_location_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/attribute_location_invalid.snap new file mode 100644 index 0000000000000..3706332b7855d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/attribute_location_invalid.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/attribute_location_invalid.move +--- +error[E02015]: invalid attribute + ┌─ tests/move_check/unit_test/attribute_location_invalid.move:5:7 + │ +5 │ #[expected_failure(abort_code = 0)] + │ ^^^^^^^^^^^^^^^^ + │ │ + │ Known attribute 'expected_failure' is not expected with a struct + │ Expected to be used with one of the following: function diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/attribute_location_invalid.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/attribute_location_invalid.unit_test.exp deleted file mode 100644 index d8096a6bf30cf..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/attribute_location_invalid.unit_test.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E02015]: invalid attribute - ┌─ tests/move_check/unit_test/attribute_location_invalid.move:1:3 - │ -1 │ #[test] - │ ^^^^ - │ │ - │ Known attribute 'test' is not expected with a module - │ Expected to be used with one of the following: function - -error[E02015]: invalid attribute - ┌─ tests/move_check/unit_test/attribute_location_invalid.move:5:7 - │ -5 │ #[expected_failure(abort_code = 0)] - │ ^^^^^^^^^^^^^^^^ - │ │ - │ Known attribute 'expected_failure' is not expected with a struct - │ Expected to be used with one of the following: function - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/attribute_location_invalid@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/attribute_location_invalid@unit_test.snap new file mode 100644 index 0000000000000..dbebb9427bd7a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/attribute_location_invalid@unit_test.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/attribute_location_invalid.move +--- +error[E02015]: invalid attribute + ┌─ tests/move_check/unit_test/attribute_location_invalid.move:1:3 + │ +1 │ #[test] + │ ^^^^ + │ │ + │ Known attribute 'test' is not expected with a module + │ Expected to be used with one of the following: function + +error[E02015]: invalid attribute + ┌─ tests/move_check/unit_test/attribute_location_invalid.move:5:7 + │ +5 │ #[expected_failure(abort_code = 0)] + │ ^^^^^^^^^^^^^^^^ + │ │ + │ Known attribute 'expected_failure' is not expected with a struct + │ Expected to be used with one of the following: function diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_members.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_members.snap new file mode 100644 index 0000000000000..18780a44eda4e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_members.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/cross_module_members.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_members@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_members@unit_test.snap new file mode 100644 index 0000000000000..18780a44eda4e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_members@unit_test.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/cross_module_members.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_members_non_test_function.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_members_non_test_function.exp deleted file mode 100644 index 416d8f009c0c2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_members_non_test_function.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E03004]: unbound type - ┌─ tests/move_check/unit_test/cross_module_members_non_test_function.move:23:23 - │ -23 │ public fun bad(): Foo { - │ ^^^ Unbound type 'Foo' in current scope - -error[E03002]: unbound module - ┌─ tests/move_check/unit_test/cross_module_members_non_test_function.move:24:9 - │ -24 │ A::build_foo() - │ ^ Unbound module alias 'A' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_members_non_test_function.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_members_non_test_function.snap new file mode 100644 index 0000000000000..4bee8b0e735da --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_members_non_test_function.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/cross_module_members_non_test_function.move +--- +error[E03004]: unbound type + ┌─ tests/move_check/unit_test/cross_module_members_non_test_function.move:23:23 + │ +23 │ public fun bad(): Foo { + │ ^^^ Unbound type 'Foo' in current scope + +error[E03002]: unbound module + ┌─ tests/move_check/unit_test/cross_module_members_non_test_function.move:24:9 + │ +24 │ A::build_foo() + │ ^ Unbound module alias 'A' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_members_non_test_function@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_members_non_test_function@unit_test.snap new file mode 100644 index 0000000000000..87c59d12c42c4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_members_non_test_function@unit_test.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/cross_module_members_non_test_function.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_test_only_module.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_test_only_module.exp deleted file mode 100644 index d1d5dd6fcbab2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_test_only_module.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/move_check/unit_test/cross_module_test_only_module.move:10:9 - │ -10 │ use 0x1::M; - │ ^^^^^^ Invalid 'use'. Unbound module: '0x1::M' - -error[E03002]: unbound module - ┌─ tests/move_check/unit_test/cross_module_test_only_module.move:13:9 - │ -13 │ M::foo() - │ ^ Unbound module alias 'M' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_test_only_module.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_test_only_module.snap new file mode 100644 index 0000000000000..f2de9bc1b4a38 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_test_only_module.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/cross_module_test_only_module.move +--- +error[E03002]: unbound module + ┌─ tests/move_check/unit_test/cross_module_test_only_module.move:10:9 + │ +10 │ use 0x1::M; + │ ^^^^^^ Invalid 'use'. Unbound module: '0x1::M' + +error[E03002]: unbound module + ┌─ tests/move_check/unit_test/cross_module_test_only_module.move:13:9 + │ +13 │ M::foo() + │ ^ Unbound module alias 'M' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_test_only_module@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_test_only_module@unit_test.snap new file mode 100644 index 0000000000000..7f71f9c3aae42 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/cross_module_test_only_module@unit_test.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/cross_module_test_only_module.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/entry_is_public_in_test_contexts.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/entry_is_public_in_test_contexts.snap new file mode 100644 index 0000000000000..5939c2917d540 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/entry_is_public_in_test_contexts.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/entry_is_public_in_test_contexts.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/entry_is_public_in_test_contexts.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/entry_is_public_in_test_contexts.unit_test.exp deleted file mode 100644 index 590a6b8644506..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/entry_is_public_in_test_contexts.unit_test.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[E04007]: incompatible types - ┌─ tests/move_check/unit_test/entry_is_public_in_test_contexts.move:11:9 - │ - 4 │ entry fun internal(_ :u64) {} - │ --- Expected: 'u64' - · -11 │ a::m::internal(0u8) - │ ^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'u8' - │ Invalid call of 'a::m::internal'. Invalid argument for parameter '_' - -error[E04007]: incompatible types - ┌─ tests/move_check/unit_test/entry_is_public_in_test_contexts.move:19:9 - │ - 4 │ entry fun internal(_ :u64) {} - │ --- Expected: 'u64' - · -19 │ a::m::internal(0u8) - │ ^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Given: 'u8' - │ Invalid call of 'a::m::internal'. Invalid argument for parameter '_' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/entry_is_public_in_test_contexts@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/entry_is_public_in_test_contexts@unit_test.snap new file mode 100644 index 0000000000000..cd6ce98122c8e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/entry_is_public_in_test_contexts@unit_test.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/entry_is_public_in_test_contexts.move +--- +error[E04007]: incompatible types + ┌─ tests/move_check/unit_test/entry_is_public_in_test_contexts.move:11:9 + │ + 4 │ entry fun internal(_ :u64) {} + │ --- Expected: 'u64' + · +11 │ a::m::internal(0u8) + │ ^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'u8' + │ Invalid call of 'a::m::internal'. Invalid argument for parameter '_' + +error[E04007]: incompatible types + ┌─ tests/move_check/unit_test/entry_is_public_in_test_contexts.move:19:9 + │ + 4 │ entry fun internal(_ :u64) {} + │ --- Expected: 'u64' + · +19 │ a::m::internal(0u8) + │ ^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Given: 'u8' + │ Invalid call of 'a::m::internal'. Invalid argument for parameter '_' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_bad_value.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_bad_value.snap new file mode 100644 index 0000000000000..62ef52469f7d2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_bad_value.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/expected_failure_bad_value.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_bad_value.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_bad_value.unit_test.exp deleted file mode 100644 index aa00a53a2e51d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_bad_value.unit_test.exp +++ /dev/null @@ -1,45 +0,0 @@ -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/expected_failure_bad_value.move:7:24 - │ -7 │ #[expected_failure(abort_code=true)] - │ ^^^^^^^^^^^^^^^ - │ │ │ - │ │ Unsupported value in this assignment - │ Invalid value in attribute assignment - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/expected_failure_bad_value.move:11:24 - │ -11 │ #[expected_failure(abort_code=x"")] - │ ^^^^^^^^^^^^^^ - │ │ │ - │ │ Unsupported value in this assignment - │ Invalid value in attribute assignment - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/expected_failure_bad_value.move:15:24 - │ -15 │ #[expected_failure(abort_code=b"")] - │ ^^^^^^^^^^^^^^ - │ │ │ - │ │ Unsupported value in this assignment - │ Invalid value in attribute assignment - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/expected_failure_bad_value.move:19:35 - │ - 2 │ module 0x1::A { - │ - Unbound constant 'Foo' in module '0x1::A' - · -19 │ #[expected_failure(abort_code=Foo)] - │ ^^^ Invalid value in attribute assignment - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/expected_failure_bad_value.move:23:24 - │ -23 │ #[expected_failure(abort_code=@0xC0FFEE)] - │ ^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Unsupported value in this assignment - │ Invalid value in attribute assignment - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_bad_value@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_bad_value@unit_test.snap new file mode 100644 index 0000000000000..d29f5c295f3a5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_bad_value@unit_test.snap @@ -0,0 +1,52 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/expected_failure_bad_value.move +--- +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/expected_failure_bad_value.move:7:24 + │ +7 │ #[expected_failure(abort_code=true)] + │ ^^^^^^^^^^^^^^^ + │ │ │ + │ │ Unsupported value in this assignment + │ Invalid value in attribute assignment + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/expected_failure_bad_value.move:11:24 + │ +11 │ #[expected_failure(abort_code=x"")] + │ ^^^^^^^^^^^^^^ + │ │ │ + │ │ Unsupported value in this assignment + │ Invalid value in attribute assignment + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/expected_failure_bad_value.move:15:24 + │ +15 │ #[expected_failure(abort_code=b"")] + │ ^^^^^^^^^^^^^^ + │ │ │ + │ │ Unsupported value in this assignment + │ Invalid value in attribute assignment + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/expected_failure_bad_value.move:19:35 + │ + 2 │ module 0x1::A { + │ - Unbound constant 'Foo' in module '0x1::A' + · +19 │ #[expected_failure(abort_code=Foo)] + │ ^^^ Invalid value in attribute assignment + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/expected_failure_bad_value.move:23:24 + │ +23 │ #[expected_failure(abort_code=@0xC0FFEE)] + │ ^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Unsupported value in this assignment + │ Invalid value in attribute assignment diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_constants.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_constants.snap new file mode 100644 index 0000000000000..2257f1e928ec6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_constants.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/expected_failure_constants.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_constants@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_constants@unit_test.snap new file mode 100644 index 0000000000000..2257f1e928ec6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_constants@unit_test.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/expected_failure_constants.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_constants_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_constants_invalid.snap new file mode 100644 index 0000000000000..8ce8b47b098f4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_constants_invalid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/expected_failure_constants_invalid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_constants_invalid.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_constants_invalid.unit_test.exp deleted file mode 100644 index c4d55c45eb570..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_constants_invalid.unit_test.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/expected_failure_constants_invalid.move:9:35 - │ -2 │ const C: u8 = 0 + 1 + 2; - │ ------------------------ Constant '0x2::m::C' has a non-u64 value. Only 'u64' values are permitted - · -9 │ #[expected_failure(abort_code=0x2::m::C)] - │ ^^^^^^^^^ Invalid value in attribute assignment - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/expected_failure_constants_invalid.move:13:35 - │ -13 │ #[expected_failure(abort_code=0x2::x::C)] - │ ^^^^^^^^^ - │ │ - │ Invalid value in attribute assignment - │ Unbound module '0x2::x' - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/expected_failure_constants_invalid.move:17:35 - │ -17 │ #[expected_failure(abort_code=0x1::A::C0)] - │ ^^^^^^^^^^ - │ │ - │ Invalid value in attribute assignment - │ Unbound constant 'C0' in module '0x1::A' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_constants_invalid@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_constants_invalid@unit_test.snap new file mode 100644 index 0000000000000..d539628802c9c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_constants_invalid@unit_test.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/expected_failure_constants_invalid.move +--- +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/expected_failure_constants_invalid.move:9:35 + │ +2 │ const C: u8 = 0 + 1 + 2; + │ ------------------------ Constant '0x2::m::C' has a non-u64 value. Only 'u64' values are permitted + · +9 │ #[expected_failure(abort_code=0x2::m::C)] + │ ^^^^^^^^^ Invalid value in attribute assignment + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/expected_failure_constants_invalid.move:13:35 + │ +13 │ #[expected_failure(abort_code=0x2::x::C)] + │ ^^^^^^^^^ + │ │ + │ Invalid value in attribute assignment + │ Unbound module '0x2::x' + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/expected_failure_constants_invalid.move:17:35 + │ +17 │ #[expected_failure(abort_code=0x1::A::C0)] + │ ^^^^^^^^^^ + │ │ + │ Invalid value in attribute assignment + │ Unbound constant 'C0' in module '0x1::A' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_invalid_literals.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_invalid_literals.snap new file mode 100644 index 0000000000000..2bd5a0763cd80 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_invalid_literals.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/expected_failure_invalid_literals.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_invalid_literals.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_invalid_literals.unit_test.exp deleted file mode 100644 index be8293fc8b1bc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_invalid_literals.unit_test.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/expected_failure_invalid_literals.move:14:24 - │ -14 │ #[expected_failure(abort_code=0u8, location=0x1::M)] - │ ^^^^^^^^^^^^^^ - │ │ │ - │ │ Annotated non-u64 literals are not permitted - │ Invalid value in attribute assignment - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/expected_failure_invalid_literals.move:18:24 - │ -18 │ #[expected_failure(abort_code=0u128, location=0x1::M)] - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Annotated non-u64 literals are not permitted - │ Invalid value in attribute assignment - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_invalid_literals@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_invalid_literals@unit_test.snap new file mode 100644 index 0000000000000..975a16915edaf --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_invalid_literals@unit_test.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/expected_failure_invalid_literals.move +--- +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/expected_failure_invalid_literals.move:14:24 + │ +14 │ #[expected_failure(abort_code=0u8, location=0x1::M)] + │ ^^^^^^^^^^^^^^ + │ │ │ + │ │ Annotated non-u64 literals are not permitted + │ Invalid value in attribute assignment + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/expected_failure_invalid_literals.move:18:24 + │ +18 │ #[expected_failure(abort_code=0u128, location=0x1::M)] + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Annotated non-u64 literals are not permitted + │ Invalid value in attribute assignment diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_not_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_not_test.snap new file mode 100644 index 0000000000000..732a618d55002 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_not_test.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/expected_failure_not_test.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_not_test.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_not_test.unit_test.exp deleted file mode 100644 index b9edf0d769231..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_not_test.unit_test.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E10004]: invalid usage of known attribute - ┌─ tests/move_check/unit_test/expected_failure_not_test.move:4:9 - │ -3 │ #[expected_failure] - │ ---------------- Attributed as #[expected_failure] here -4 │ fun foo() { } - │ ^^^ Only functions defined as a test with #[test] can also have an #[expected_failure] attribute - -error[E10004]: invalid usage of known attribute - ┌─ tests/move_check/unit_test/expected_failure_not_test.move:7:9 - │ -6 │ #[test_only, expected_failure] - │ ---------------- Attributed as #[expected_failure] here -7 │ fun bar() { } - │ ^^^ Only functions defined as a test with #[test] can also have an #[expected_failure] attribute - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_not_test@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_not_test@unit_test.snap new file mode 100644 index 0000000000000..a4da386ff96d0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_not_test@unit_test.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/expected_failure_not_test.move +--- +error[E10004]: invalid usage of known attribute + ┌─ tests/move_check/unit_test/expected_failure_not_test.move:4:9 + │ +3 │ #[expected_failure] + │ ---------------- Attributed as #[expected_failure] here +4 │ fun foo() { } + │ ^^^ Only functions defined as a test with #[test] can also have an #[expected_failure] attribute + +error[E10004]: invalid usage of known attribute + ┌─ tests/move_check/unit_test/expected_failure_not_test.move:7:9 + │ +6 │ #[test_only, expected_failure] + │ ---------------- Attributed as #[expected_failure] here +7 │ fun bar() { } + │ ^^^ Only functions defined as a test with #[test] can also have an #[expected_failure] attribute diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_on_non_function.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_on_non_function.exp deleted file mode 100644 index 0adc53246b652..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_on_non_function.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E02015]: invalid attribute - ┌─ tests/move_check/unit_test/expected_failure_on_non_function.move:3:7 - │ -3 │ #[expected_failure] - │ ^^^^^^^^^^^^^^^^ - │ │ - │ Known attribute 'expected_failure' is not expected with a struct - │ Expected to be used with one of the following: function - -error[E02015]: invalid attribute - ┌─ tests/move_check/unit_test/expected_failure_on_non_function.move:6:7 - │ -6 │ #[expected_failure] - │ ^^^^^^^^^^^^^^^^ - │ │ - │ Known attribute 'expected_failure' is not expected with a use - │ Expected to be used with one of the following: function - -error[E02015]: invalid attribute - ┌─ tests/move_check/unit_test/expected_failure_on_non_function.move:9:7 - │ -9 │ #[expected_failure] - │ ^^^^^^^^^^^^^^^^ - │ │ - │ Known attribute 'expected_failure' is not expected with a constant - │ Expected to be used with one of the following: function - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_on_non_function.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_on_non_function.snap new file mode 100644 index 0000000000000..e2f75c2192e7d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_on_non_function.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/expected_failure_on_non_function.move +--- +error[E02015]: invalid attribute + ┌─ tests/move_check/unit_test/expected_failure_on_non_function.move:3:7 + │ +3 │ #[expected_failure] + │ ^^^^^^^^^^^^^^^^ + │ │ + │ Known attribute 'expected_failure' is not expected with a struct + │ Expected to be used with one of the following: function + +error[E02015]: invalid attribute + ┌─ tests/move_check/unit_test/expected_failure_on_non_function.move:6:7 + │ +6 │ #[expected_failure] + │ ^^^^^^^^^^^^^^^^ + │ │ + │ Known attribute 'expected_failure' is not expected with a use + │ Expected to be used with one of the following: function + +error[E02015]: invalid attribute + ┌─ tests/move_check/unit_test/expected_failure_on_non_function.move:9:7 + │ +9 │ #[expected_failure] + │ ^^^^^^^^^^^^^^^^ + │ │ + │ Known attribute 'expected_failure' is not expected with a constant + │ Expected to be used with one of the following: function diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_on_non_function.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_on_non_function.unit_test.exp deleted file mode 100644 index 0adc53246b652..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_on_non_function.unit_test.exp +++ /dev/null @@ -1,27 +0,0 @@ -error[E02015]: invalid attribute - ┌─ tests/move_check/unit_test/expected_failure_on_non_function.move:3:7 - │ -3 │ #[expected_failure] - │ ^^^^^^^^^^^^^^^^ - │ │ - │ Known attribute 'expected_failure' is not expected with a struct - │ Expected to be used with one of the following: function - -error[E02015]: invalid attribute - ┌─ tests/move_check/unit_test/expected_failure_on_non_function.move:6:7 - │ -6 │ #[expected_failure] - │ ^^^^^^^^^^^^^^^^ - │ │ - │ Known attribute 'expected_failure' is not expected with a use - │ Expected to be used with one of the following: function - -error[E02015]: invalid attribute - ┌─ tests/move_check/unit_test/expected_failure_on_non_function.move:9:7 - │ -9 │ #[expected_failure] - │ ^^^^^^^^^^^^^^^^ - │ │ - │ Known attribute 'expected_failure' is not expected with a constant - │ Expected to be used with one of the following: function - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_on_non_function@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_on_non_function@unit_test.snap new file mode 100644 index 0000000000000..e2f75c2192e7d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_on_non_function@unit_test.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/expected_failure_on_non_function.move +--- +error[E02015]: invalid attribute + ┌─ tests/move_check/unit_test/expected_failure_on_non_function.move:3:7 + │ +3 │ #[expected_failure] + │ ^^^^^^^^^^^^^^^^ + │ │ + │ Known attribute 'expected_failure' is not expected with a struct + │ Expected to be used with one of the following: function + +error[E02015]: invalid attribute + ┌─ tests/move_check/unit_test/expected_failure_on_non_function.move:6:7 + │ +6 │ #[expected_failure] + │ ^^^^^^^^^^^^^^^^ + │ │ + │ Known attribute 'expected_failure' is not expected with a use + │ Expected to be used with one of the following: function + +error[E02015]: invalid attribute + ┌─ tests/move_check/unit_test/expected_failure_on_non_function.move:9:7 + │ +9 │ #[expected_failure] + │ ^^^^^^^^^^^^^^^^ + │ │ + │ Known attribute 'expected_failure' is not expected with a constant + │ Expected to be used with one of the following: function diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_out_of_range_value.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_out_of_range_value.snap new file mode 100644 index 0000000000000..0a6be5dc17538 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_out_of_range_value.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/expected_failure_out_of_range_value.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_out_of_range_value.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_out_of_range_value.unit_test.exp deleted file mode 100644 index ad02cf65bb3ed..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_out_of_range_value.unit_test.exp +++ /dev/null @@ -1,25 +0,0 @@ -warning[W10007]: issue with attribute value - ┌─ tests/move_check/unit_test/expected_failure_out_of_range_value.move:6:24 - │ -6 │ #[expected_failure(abort_code=18446744073709551614)] - │ ^^^^^^^^^^ -------------------- Replace value with constant from expected module or add `location=...` attribute. - │ │ - │ WARNING: passes for an abort from any module. - -warning[W10007]: issue with attribute value - ┌─ tests/move_check/unit_test/expected_failure_out_of_range_value.move:11:24 - │ -11 │ #[expected_failure(abort_code=18446744073709551615)] - │ ^^^^^^^^^^ -------------------- Replace value with constant from expected module or add `location=...` attribute. - │ │ - │ WARNING: passes for an abort from any module. - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/expected_failure_out_of_range_value.move:16:24 - │ -16 │ #[expected_failure(abort_code=18446744073709551616)] - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Unsupported value in this assignment - │ Invalid value in attribute assignment - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_out_of_range_value@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_out_of_range_value@unit_test.snap new file mode 100644 index 0000000000000..8c99ec67cf86b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/expected_failure_out_of_range_value@unit_test.snap @@ -0,0 +1,32 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/expected_failure_out_of_range_value.move +--- +warning[W10007]: issue with attribute value + ┌─ tests/move_check/unit_test/expected_failure_out_of_range_value.move:6:24 + │ +6 │ #[expected_failure(abort_code=18446744073709551614)] + │ ^^^^^^^^^^ -------------------- Replace value with constant from expected module or add `location=...` attribute. + │ │ + │ WARNING: passes for an abort from any module. + +warning[W10007]: issue with attribute value + ┌─ tests/move_check/unit_test/expected_failure_out_of_range_value.move:11:24 + │ +11 │ #[expected_failure(abort_code=18446744073709551615)] + │ ^^^^^^^^^^ -------------------- Replace value with constant from expected module or add `location=...` attribute. + │ │ + │ WARNING: passes for an abort from any module. + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/expected_failure_out_of_range_value.move:16:24 + │ +16 │ #[expected_failure(abort_code=18446744073709551616)] + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Unsupported value in this assignment + │ Invalid value in attribute assignment diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/extra_attributes.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/extra_attributes.snap new file mode 100644 index 0000000000000..c4e848039e0b9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/extra_attributes.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/extra_attributes.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/extra_attributes.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/extra_attributes.unit_test.exp deleted file mode 100644 index cdb20d48d5122..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/extra_attributes.unit_test.exp +++ /dev/null @@ -1,40 +0,0 @@ -warning[W09007]: unused attribute - ┌─ tests/move_check/unit_test/extra_attributes.move:8:60 - │ -8 │ #[expected_failure(vector_error, location=std::vector, hello=0)] - │ ^^^^^ Unused attribute for expected_failure - │ - = This warning can be suppressed with '#[allow(unused_attribute)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09007]: unused attribute - ┌─ tests/move_check/unit_test/extra_attributes.move:12:54 - │ -12 │ #[expected_failure(arithmetic_error, location=n, wowza)] - │ ^^^^^ Unused attribute for expected_failure - │ - = This warning can be suppressed with '#[allow(unused_attribute)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09007]: unused attribute - ┌─ tests/move_check/unit_test/extra_attributes.move:16:51 - │ -16 │ #[expected_failure(out_of_gas, location=Self, so_many_attrs)] - │ ^^^^^^^^^^^^^ Unused attribute for expected_failure - │ - = This warning can be suppressed with '#[allow(unused_attribute)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09007]: unused attribute - ┌─ tests/move_check/unit_test/extra_attributes.move:20:43 - │ -20 │ #[expected_failure(major_status=4004, an_attr_here_is_unused, location=Self)] - │ ^^^^^^^^^^^^^^^^^^^^^^ Unused attribute for expected_failure - │ - = This warning can be suppressed with '#[allow(unused_attribute)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09007]: unused attribute - ┌─ tests/move_check/unit_test/extra_attributes.move:24:43 - │ -24 │ #[expected_failure(major_status=4016, minor_code=0, location=Self)] - │ ^^^^^^^^^^ Unused attribute for expected_failure - │ - = This warning can be suppressed with '#[allow(unused_attribute)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/extra_attributes@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/extra_attributes@unit_test.snap new file mode 100644 index 0000000000000..84c606248bc6c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/extra_attributes@unit_test.snap @@ -0,0 +1,47 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/extra_attributes.move +--- +warning[W09007]: unused attribute + ┌─ tests/move_check/unit_test/extra_attributes.move:8:60 + │ +8 │ #[expected_failure(vector_error, location=std::vector, hello=0)] + │ ^^^^^ Unused attribute for expected_failure + │ + = This warning can be suppressed with '#[allow(unused_attribute)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09007]: unused attribute + ┌─ tests/move_check/unit_test/extra_attributes.move:12:54 + │ +12 │ #[expected_failure(arithmetic_error, location=n, wowza)] + │ ^^^^^ Unused attribute for expected_failure + │ + = This warning can be suppressed with '#[allow(unused_attribute)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09007]: unused attribute + ┌─ tests/move_check/unit_test/extra_attributes.move:16:51 + │ +16 │ #[expected_failure(out_of_gas, location=Self, so_many_attrs)] + │ ^^^^^^^^^^^^^ Unused attribute for expected_failure + │ + = This warning can be suppressed with '#[allow(unused_attribute)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09007]: unused attribute + ┌─ tests/move_check/unit_test/extra_attributes.move:20:43 + │ +20 │ #[expected_failure(major_status=4004, an_attr_here_is_unused, location=Self)] + │ ^^^^^^^^^^^^^^^^^^^^^^ Unused attribute for expected_failure + │ + = This warning can be suppressed with '#[allow(unused_attribute)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09007]: unused attribute + ┌─ tests/move_check/unit_test/extra_attributes.move:24:43 + │ +24 │ #[expected_failure(major_status=4016, minor_code=0, location=Self)] + │ ^^^^^^^^^^ Unused attribute for expected_failure + │ + = This warning can be suppressed with '#[allow(unused_attribute)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/invalid_expected_code_name.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/invalid_expected_code_name.snap new file mode 100644 index 0000000000000..83a31d9c7e235 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/invalid_expected_code_name.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/invalid_expected_code_name.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/invalid_expected_code_name.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/invalid_expected_code_name.unit_test.exp deleted file mode 100644 index e74424e0e2508..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/invalid_expected_code_name.unit_test.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/invalid_expected_code_name.move:4:7 - │ -4 │ #[expected_failure(cod=1)] - │ ^^^^^^^^^^^^^^^^^^^^^^^ Invalid #[expected_failure(...)] attribute, expected 1 failure kind but found 0. Expected one of: abort_code, arithmetic_error, vector_error, out_of_gas, major_status - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/invalid_expected_code_name.move:8:7 - │ -8 │ #[expected_failure(code=1)] - │ ^^^^^^^^^^^^^^^^^^^^^^^^ Invalid #[expected_failure(...)] attribute, expected 1 failure kind but found 0. Expected one of: abort_code, arithmetic_error, vector_error, out_of_gas, major_status - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/invalid_expected_code_name.move:12:7 - │ -12 │ #[expected_failure(abort_cod=1)] - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid #[expected_failure(...)] attribute, expected 1 failure kind but found 0. Expected one of: abort_code, arithmetic_error, vector_error, out_of_gas, major_status - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/invalid_expected_code_name@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/invalid_expected_code_name@unit_test.snap new file mode 100644 index 0000000000000..866da26af87a0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/invalid_expected_code_name@unit_test.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/invalid_expected_code_name.move +--- +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/invalid_expected_code_name.move:4:7 + │ +4 │ #[expected_failure(cod=1)] + │ ^^^^^^^^^^^^^^^^^^^^^^^ Invalid #[expected_failure(...)] attribute, expected 1 failure kind but found 0. Expected one of: abort_code, arithmetic_error, vector_error, out_of_gas, major_status + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/invalid_expected_code_name.move:8:7 + │ +8 │ #[expected_failure(code=1)] + │ ^^^^^^^^^^^^^^^^^^^^^^^^ Invalid #[expected_failure(...)] attribute, expected 1 failure kind but found 0. Expected one of: abort_code, arithmetic_error, vector_error, out_of_gas, major_status + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/invalid_expected_code_name.move:12:7 + │ +12 │ #[expected_failure(abort_cod=1)] + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid #[expected_failure(...)] attribute, expected 1 failure kind but found 0. Expected one of: abort_code, arithmetic_error, vector_error, out_of_gas, major_status diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/invalid_expected_failure_name.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/invalid_expected_failure_name.snap new file mode 100644 index 0000000000000..b56f940f0a7ff --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/invalid_expected_failure_name.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/invalid_expected_failure_name.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/invalid_expected_failure_name.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/invalid_expected_failure_name.unit_test.exp deleted file mode 100644 index ddc82bdea826a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/invalid_expected_failure_name.unit_test.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/invalid_expected_failure_name.move:4:24 - │ -4 │ #[expected_failure=1] - │ -----------------^ - │ │ │ - │ │ Invalid expected failure code assignment - │ Expect an #[expected_failure(...)] attribute for error specification - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/invalid_expected_failure_name@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/invalid_expected_failure_name@unit_test.snap new file mode 100644 index 0000000000000..ada39f5c86c5f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/invalid_expected_failure_name@unit_test.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/invalid_expected_failure_name.move +--- +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/invalid_expected_failure_name.move:4:24 + │ +4 │ #[expected_failure=1] + │ -----------------^ + │ │ │ + │ │ Invalid expected failure code assignment + │ Expect an #[expected_failure(...)] attribute for error specification diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/multiple_errors.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/multiple_errors.snap new file mode 100644 index 0000000000000..55a403ad5aa26 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/multiple_errors.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/multiple_errors.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/multiple_errors.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/multiple_errors.unit_test.exp deleted file mode 100644 index 699a7937cfea1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/multiple_errors.unit_test.exp +++ /dev/null @@ -1,88 +0,0 @@ -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/multiple_errors.move:19:7 - │ -19 │ #[test(_a=Foo)] - │ ^^^^^^^^^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute -20 │ public fun b(_a: signer) { } - │ - -- Corresponding to this parameter - │ │ - │ Error found in this test - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/multiple_errors.move:19:15 - │ -19 │ #[test(_a=Foo)] - │ ---^^^ - │ │ │ - │ │ Unsupported attribute value - │ Assigned in this attribute - -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/multiple_errors.move:26:7 - │ -26 │ #[test(_a=@0x1)] - │ ^^^^^^^^^^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute -27 │ #[test(_b=@0x2)] -28 │ public fun d(_a: signer, _b: signer) { } - │ - -- Corresponding to this parameter - │ │ - │ Error found in this test - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/unit_test/multiple_errors.move:27:7 - │ -26 │ #[test(_a=@0x1)] - │ ---- Attribute previously given here -27 │ #[test(_b=@0x2)] - │ ^^^^^^^^^^^^^ Duplicate attribute 'test' attached to the same item - -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/multiple_errors.move:31:7 - │ -31 │ #[test(_a=@0x1)] - │ ^^^^^^^^^^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute -32 │ #[test_only] -33 │ public fun e(_a: signer, _b: signer) { } - │ - -- Corresponding to this parameter - │ │ - │ Error found in this test - -error[E10004]: invalid usage of known attribute - ┌─ tests/move_check/unit_test/multiple_errors.move:32:7 - │ -31 │ #[test(_a=@0x1)] - │ ------------- Previously annotated here -32 │ #[test_only] - │ ^^^^^^^^^ Function annotated as both #[test] and #[test_only]. You need to declare it as either one or the other -33 │ public fun e(_a: signer, _b: signer) { } - │ - Error found in this test - -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/multiple_errors.move:36:7 - │ -36 │ #[test(_a=@0x1)] - │ ^^^^^^^^^^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute -37 │ public fun f(_a: signer, _b: signer) { } - │ - -- Corresponding to this parameter - │ │ - │ Error found in this test - -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/multiple_errors.move:40:7 - │ -40 │ #[test(_a=@0x1)] - │ ^^^^^^^^^^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute - · -43 │ public fun g(_a: signer, _b: signer) { } - │ - -- Corresponding to this parameter - │ │ - │ Error found in this test - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/unit_test/multiple_errors.move:42:7 - │ -41 │ #[expected_failure] - │ ---------------- Attribute previously given here -42 │ #[expected_failure] - │ ^^^^^^^^^^^^^^^^ Duplicate attribute 'expected_failure' attached to the same item - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/multiple_errors@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/multiple_errors@unit_test.snap new file mode 100644 index 0000000000000..5fac158baf87d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/multiple_errors@unit_test.snap @@ -0,0 +1,95 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/multiple_errors.move +--- +error[E10005]: unable to generate test + ┌─ tests/move_check/unit_test/multiple_errors.move:19:7 + │ +19 │ #[test(_a=Foo)] + │ ^^^^^^^^^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute +20 │ public fun b(_a: signer) { } + │ - -- Corresponding to this parameter + │ │ + │ Error found in this test + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/multiple_errors.move:19:15 + │ +19 │ #[test(_a=Foo)] + │ ---^^^ + │ │ │ + │ │ Unsupported attribute value + │ Assigned in this attribute + +error[E10005]: unable to generate test + ┌─ tests/move_check/unit_test/multiple_errors.move:26:7 + │ +26 │ #[test(_a=@0x1)] + │ ^^^^^^^^^^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute +27 │ #[test(_b=@0x2)] +28 │ public fun d(_a: signer, _b: signer) { } + │ - -- Corresponding to this parameter + │ │ + │ Error found in this test + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/unit_test/multiple_errors.move:27:7 + │ +26 │ #[test(_a=@0x1)] + │ ---- Attribute previously given here +27 │ #[test(_b=@0x2)] + │ ^^^^^^^^^^^^^ Duplicate attribute 'test' attached to the same item + +error[E10005]: unable to generate test + ┌─ tests/move_check/unit_test/multiple_errors.move:31:7 + │ +31 │ #[test(_a=@0x1)] + │ ^^^^^^^^^^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute +32 │ #[test_only] +33 │ public fun e(_a: signer, _b: signer) { } + │ - -- Corresponding to this parameter + │ │ + │ Error found in this test + +error[E10004]: invalid usage of known attribute + ┌─ tests/move_check/unit_test/multiple_errors.move:32:7 + │ +31 │ #[test(_a=@0x1)] + │ ------------- Previously annotated here +32 │ #[test_only] + │ ^^^^^^^^^ Function annotated as both #[test] and #[test_only]. You need to declare it as either one or the other +33 │ public fun e(_a: signer, _b: signer) { } + │ - Error found in this test + +error[E10005]: unable to generate test + ┌─ tests/move_check/unit_test/multiple_errors.move:36:7 + │ +36 │ #[test(_a=@0x1)] + │ ^^^^^^^^^^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute +37 │ public fun f(_a: signer, _b: signer) { } + │ - -- Corresponding to this parameter + │ │ + │ Error found in this test + +error[E10005]: unable to generate test + ┌─ tests/move_check/unit_test/multiple_errors.move:40:7 + │ +40 │ #[test(_a=@0x1)] + │ ^^^^^^^^^^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute + · +43 │ public fun g(_a: signer, _b: signer) { } + │ - -- Corresponding to this parameter + │ │ + │ Error found in this test + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/unit_test/multiple_errors.move:42:7 + │ +41 │ #[expected_failure] + │ ---------------- Attribute previously given here +42 │ #[expected_failure] + │ ^^^^^^^^^^^^^^^^ Duplicate attribute 'expected_failure' attached to the same item diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/multiple_test_annotations.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/multiple_test_annotations.snap new file mode 100644 index 0000000000000..c9f59e3c7ce33 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/multiple_test_annotations.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/multiple_test_annotations.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/multiple_test_annotations.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/multiple_test_annotations.unit_test.exp deleted file mode 100644 index 130bd462c9343..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/multiple_test_annotations.unit_test.exp +++ /dev/null @@ -1,49 +0,0 @@ -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/multiple_test_annotations.move:5:7 - │ -5 │ #[test(_a=@0x1)] - │ ^^^^^^^^^^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute -6 │ #[test(_b=@0x2)] -7 │ public fun a(_a: signer, _b: signer) { } - │ - -- Corresponding to this parameter - │ │ - │ Error found in this test - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/unit_test/multiple_test_annotations.move:6:7 - │ -5 │ #[test(_a=@0x1)] - │ ---- Attribute previously given here -6 │ #[test(_b=@0x2)] - │ ^^^^^^^^^^^^^ Duplicate attribute 'test' attached to the same item - -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/multiple_test_annotations.move:9:7 - │ - 9 │ #[test] - │ ^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute -10 │ #[test(_a=@0x1, _b=@0x2)] -11 │ public fun b(_a: signer, _b: signer) { } - │ - -- Corresponding to this parameter - │ │ - │ Error found in this test - -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/multiple_test_annotations.move:9:7 - │ - 9 │ #[test] - │ ^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute -10 │ #[test(_a=@0x1, _b=@0x2)] -11 │ public fun b(_a: signer, _b: signer) { } - │ - -- Corresponding to this parameter - │ │ - │ Error found in this test - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/unit_test/multiple_test_annotations.move:10:7 - │ - 9 │ #[test] - │ ---- Attribute previously given here -10 │ #[test(_a=@0x1, _b=@0x2)] - │ ^^^^^^^^^^^^^^^^^^^^^^ Duplicate attribute 'test' attached to the same item - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/multiple_test_annotations@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/multiple_test_annotations@unit_test.snap new file mode 100644 index 0000000000000..fbe8f6afce811 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/multiple_test_annotations@unit_test.snap @@ -0,0 +1,56 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/multiple_test_annotations.move +--- +error[E10005]: unable to generate test + ┌─ tests/move_check/unit_test/multiple_test_annotations.move:5:7 + │ +5 │ #[test(_a=@0x1)] + │ ^^^^^^^^^^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute +6 │ #[test(_b=@0x2)] +7 │ public fun a(_a: signer, _b: signer) { } + │ - -- Corresponding to this parameter + │ │ + │ Error found in this test + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/unit_test/multiple_test_annotations.move:6:7 + │ +5 │ #[test(_a=@0x1)] + │ ---- Attribute previously given here +6 │ #[test(_b=@0x2)] + │ ^^^^^^^^^^^^^ Duplicate attribute 'test' attached to the same item + +error[E10005]: unable to generate test + ┌─ tests/move_check/unit_test/multiple_test_annotations.move:9:7 + │ + 9 │ #[test] + │ ^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute +10 │ #[test(_a=@0x1, _b=@0x2)] +11 │ public fun b(_a: signer, _b: signer) { } + │ - -- Corresponding to this parameter + │ │ + │ Error found in this test + +error[E10005]: unable to generate test + ┌─ tests/move_check/unit_test/multiple_test_annotations.move:9:7 + │ + 9 │ #[test] + │ ^^^^ Missing test parameter assignment in test. Expected a parameter to be assigned in this attribute +10 │ #[test(_a=@0x1, _b=@0x2)] +11 │ public fun b(_a: signer, _b: signer) { } + │ - -- Corresponding to this parameter + │ │ + │ Error found in this test + +error[E02001]: duplicate declaration, item, or annotation + ┌─ tests/move_check/unit_test/multiple_test_annotations.move:10:7 + │ + 9 │ #[test] + │ ---- Attribute previously given here +10 │ #[test(_a=@0x1, _b=@0x2)] + │ ^^^^^^^^^^^^^^^^^^^^^^ Duplicate attribute 'test' attached to the same item diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/named_address_no_value_in_annotation.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/named_address_no_value_in_annotation.snap new file mode 100644 index 0000000000000..093bd09dc41a1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/named_address_no_value_in_annotation.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/named_address_no_value_in_annotation.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/named_address_no_value_in_annotation.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/named_address_no_value_in_annotation.unit_test.exp deleted file mode 100644 index 4550b8891eb5a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/named_address_no_value_in_annotation.unit_test.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03001]: address with no value - ┌─ tests/move_check/unit_test/named_address_no_value_in_annotation.move:2:18 - │ -2 │ #[test(_a = @UnboundAddr)] - │ ^^^^^^^^^^^ address 'UnboundAddr' is not assigned a value. Try assigning it a value when calling the compiler - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/named_address_no_value_in_annotation@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/named_address_no_value_in_annotation@unit_test.snap new file mode 100644 index 0000000000000..aaf61103b8cd2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/named_address_no_value_in_annotation@unit_test.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/named_address_no_value_in_annotation.move +--- +error[E03001]: address with no value + ┌─ tests/move_check/unit_test/named_address_no_value_in_annotation.move:2:18 + │ +2 │ #[test(_a = @UnboundAddr)] + │ ^^^^^^^^^^^ address 'UnboundAddr' is not assigned a value. Try assigning it a value when calling the compiler diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_assignment.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_assignment.snap new file mode 100644 index 0000000000000..9b7b1f7036909 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_assignment.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_assignment.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_assignment.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_assignment.unit_test.exp deleted file mode 100644 index e4f196f2e5c04..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_assignment.unit_test.exp +++ /dev/null @@ -1,54 +0,0 @@ -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/other_failures_invalid_assignment.move:9:24 - │ -9 │ #[expected_failure(vector_error=0, location=std::vector)] - │ ^^^^^^^^^^^^-- - │ │ - │ Expected no assigned value, e.g. 'vector_error', for expected failure attribute - │ Unsupported attribute in this location - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/other_failures_invalid_assignment.move:13:38 - │ -13 │ #[expected_failure(vector_error, minor_status=x"", location=std::vector)] - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Unsupported value in this assignment - │ Invalid value in attribute assignment - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/other_failures_invalid_assignment.move:17:24 - │ -17 │ #[expected_failure(arithmetic_error=@0, location=n)] - │ ^^^^^^^^^^^^^^^^--- - │ │ - │ Expected no assigned value, e.g. 'arithmetic_error', for expected failure attribute - │ Unsupported attribute in this location - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/other_failures_invalid_assignment.move:21:24 - │ -21 │ #[expected_failure(out_of_gas=bool, location=Self)] - │ ^^^^^^^^^^----- - │ │ - │ Expected no assigned value, e.g. 'out_of_gas', for expected failure attribute - │ Unsupported attribute in this location - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/other_failures_invalid_assignment.move:25:24 - │ -25 │ #[expected_failure(major_status=4004u128, location=Self)] - │ ^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Annotated non-u64 literals are not permitted - │ Invalid value in attribute assignment - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/other_failures_invalid_assignment.move:29:43 - │ -29 │ #[expected_failure(major_status=4016, minor_status=b"", location=Self)] - │ ^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Unsupported value in this assignment - │ Invalid value in attribute assignment - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_assignment@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_assignment@unit_test.snap new file mode 100644 index 0000000000000..81f26c1a23234 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_assignment@unit_test.snap @@ -0,0 +1,61 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_assignment.move +--- +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/other_failures_invalid_assignment.move:9:24 + │ +9 │ #[expected_failure(vector_error=0, location=std::vector)] + │ ^^^^^^^^^^^^-- + │ │ + │ Expected no assigned value, e.g. 'vector_error', for expected failure attribute + │ Unsupported attribute in this location + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/other_failures_invalid_assignment.move:13:38 + │ +13 │ #[expected_failure(vector_error, minor_status=x"", location=std::vector)] + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Unsupported value in this assignment + │ Invalid value in attribute assignment + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/other_failures_invalid_assignment.move:17:24 + │ +17 │ #[expected_failure(arithmetic_error=@0, location=n)] + │ ^^^^^^^^^^^^^^^^--- + │ │ + │ Expected no assigned value, e.g. 'arithmetic_error', for expected failure attribute + │ Unsupported attribute in this location + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/other_failures_invalid_assignment.move:21:24 + │ +21 │ #[expected_failure(out_of_gas=bool, location=Self)] + │ ^^^^^^^^^^----- + │ │ + │ Expected no assigned value, e.g. 'out_of_gas', for expected failure attribute + │ Unsupported attribute in this location + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/other_failures_invalid_assignment.move:25:24 + │ +25 │ #[expected_failure(major_status=4004u128, location=Self)] + │ ^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Annotated non-u64 literals are not permitted + │ Invalid value in attribute assignment + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/other_failures_invalid_assignment.move:29:43 + │ +29 │ #[expected_failure(major_status=4016, minor_status=b"", location=Self)] + │ ^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Unsupported value in this assignment + │ Invalid value in attribute assignment diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location.snap new file mode 100644 index 0000000000000..42d00ab65318e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location.unit_test.exp deleted file mode 100644 index af555fa5a2d75..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location.unit_test.exp +++ /dev/null @@ -1,66 +0,0 @@ -error[E10004]: invalid usage of known attribute - ┌─ tests/move_check/unit_test/other_failures_invalid_location.move:6:24 - │ -6 │ #[expected_failure(vector_error)] - │ ^^^^^^^^^^^^ Expected 'location' following 'vector_error' - -error[E10004]: invalid usage of known attribute - ┌─ tests/move_check/unit_test/other_failures_invalid_location.move:10:24 - │ -10 │ #[expected_failure(arithmetic_error)] - │ ^^^^^^^^^^^^^^^^ Expected 'location' following 'arithmetic_error' - -error[E10004]: invalid usage of known attribute - ┌─ tests/move_check/unit_test/other_failures_invalid_location.move:14:24 - │ -14 │ #[expected_failure(out_of_gas)] - │ ^^^^^^^^^^ Expected 'location' following 'out_of_gas' - -error[E10004]: invalid usage of known attribute - ┌─ tests/move_check/unit_test/other_failures_invalid_location.move:18:24 - │ -18 │ #[expected_failure(major_status=4004)] - │ ^^^^^^^^^^^^ Expected 'location' following 'major_status' - -error[E10004]: invalid usage of known attribute - ┌─ tests/move_check/unit_test/other_failures_invalid_location.move:22:24 - │ -22 │ #[expected_failure(major_status=4016, minor_code=0)] - │ ^^^^^^^^^^^^ Expected 'location' following 'major_status' - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/other_failures_invalid_location.move:26:38 - │ -26 │ #[expected_failure(vector_error, location=x)] - │ ^^^^^^^^^^ - │ │ │ - │ │ Expected a module identifier, e.g. 'std::vector' - │ Invalid value in attribute assignment - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/other_failures_invalid_location.move:30:36 - │ -30 │ #[expected_failure(out_of_gas, location=0x1::m::t0)] - │ ^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a module identifier, e.g. 'std::vector' - │ Invalid value in attribute assignment - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/other_failures_invalid_location.move:34:43 - │ -34 │ #[expected_failure(major_status=4004, location=self)] - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ Expected a module identifier, e.g. 'std::vector' - │ Invalid value in attribute assignment - -error[E10003]: invalid attribute value - ┌─ tests/move_check/unit_test/other_failures_invalid_location.move:38:59 - │ -38 │ #[expected_failure(major_status=4016, minor_status=0, location=0)] - │ ^^^^^^^^^^ - │ │ │ - │ │ Expected a module identifier, e.g. 'std::vector' - │ Invalid value in attribute assignment - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location@unit_test.snap new file mode 100644 index 0000000000000..07976458d0d98 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location@unit_test.snap @@ -0,0 +1,73 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location.move +--- +error[E10004]: invalid usage of known attribute + ┌─ tests/move_check/unit_test/other_failures_invalid_location.move:6:24 + │ +6 │ #[expected_failure(vector_error)] + │ ^^^^^^^^^^^^ Expected 'location' following 'vector_error' + +error[E10004]: invalid usage of known attribute + ┌─ tests/move_check/unit_test/other_failures_invalid_location.move:10:24 + │ +10 │ #[expected_failure(arithmetic_error)] + │ ^^^^^^^^^^^^^^^^ Expected 'location' following 'arithmetic_error' + +error[E10004]: invalid usage of known attribute + ┌─ tests/move_check/unit_test/other_failures_invalid_location.move:14:24 + │ +14 │ #[expected_failure(out_of_gas)] + │ ^^^^^^^^^^ Expected 'location' following 'out_of_gas' + +error[E10004]: invalid usage of known attribute + ┌─ tests/move_check/unit_test/other_failures_invalid_location.move:18:24 + │ +18 │ #[expected_failure(major_status=4004)] + │ ^^^^^^^^^^^^ Expected 'location' following 'major_status' + +error[E10004]: invalid usage of known attribute + ┌─ tests/move_check/unit_test/other_failures_invalid_location.move:22:24 + │ +22 │ #[expected_failure(major_status=4016, minor_code=0)] + │ ^^^^^^^^^^^^ Expected 'location' following 'major_status' + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/other_failures_invalid_location.move:26:38 + │ +26 │ #[expected_failure(vector_error, location=x)] + │ ^^^^^^^^^^ + │ │ │ + │ │ Expected a module identifier, e.g. 'std::vector' + │ Invalid value in attribute assignment + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/other_failures_invalid_location.move:30:36 + │ +30 │ #[expected_failure(out_of_gas, location=0x1::m::t0)] + │ ^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a module identifier, e.g. 'std::vector' + │ Invalid value in attribute assignment + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/other_failures_invalid_location.move:34:43 + │ +34 │ #[expected_failure(major_status=4004, location=self)] + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ Expected a module identifier, e.g. 'std::vector' + │ Invalid value in attribute assignment + +error[E10003]: invalid attribute value + ┌─ tests/move_check/unit_test/other_failures_invalid_location.move:38:59 + │ +38 │ #[expected_failure(major_status=4016, minor_status=0, location=0)] + │ ^^^^^^^^^^ + │ │ │ + │ │ Expected a module identifier, e.g. 'std::vector' + │ Invalid value in attribute assignment diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location_module.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location_module.snap new file mode 100644 index 0000000000000..dab0d3b0c9809 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location_module.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location_module.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location_module.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location_module.unit_test.exp deleted file mode 100644 index 4fb767ca4e375..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location_module.unit_test.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/move_check/unit_test/other_failures_invalid_location_module.move:6:51 - │ -6 │ #[expected_failure(arithmetic_error, location=0x2::m)] - │ ^^^^^^ Unbound module '0x2::m' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location_module@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location_module@unit_test.snap new file mode 100644 index 0000000000000..cb8ca66da1bc7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location_module@unit_test.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/other_failures_invalid_location_module.move +--- +error[E03002]: unbound module + ┌─ tests/move_check/unit_test/other_failures_invalid_location_module.move:6:51 + │ +6 │ #[expected_failure(arithmetic_error, location=0x2::m)] + │ ^^^^^^ Unbound module '0x2::m' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_valid.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_valid.snap new file mode 100644 index 0000000000000..a24ff7a6e9005 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/other_failures_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_valid@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_valid@unit_test.snap new file mode 100644 index 0000000000000..a24ff7a6e9005 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/other_failures_valid@unit_test.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/other_failures_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_multiple_on_main.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_multiple_on_main.exp deleted file mode 100644 index 2e02df13abcc5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_multiple_on_main.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/script_with_multiple_on_main.move:4:7 - │ -4 │ #[expected_failure] - │ ^^^^^^^^^^^^^^^^ Testing attributes are not allowed in scripts. - -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/script_with_multiple_on_main.move:5:7 - │ -5 │ #[test_only, test] - │ ^^^^^^^^^ Testing attributes are not allowed in scripts. - -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/script_with_multiple_on_main.move:5:18 - │ -5 │ #[test_only, test] - │ ^^^^ Testing attributes are not allowed in scripts. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_multiple_on_main.unit_test b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_multiple_on_main.unit_test deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_multiple_on_main.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_multiple_on_main.unit_test.exp deleted file mode 100644 index 2e02df13abcc5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_multiple_on_main.unit_test.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/script_with_multiple_on_main.move:4:7 - │ -4 │ #[expected_failure] - │ ^^^^^^^^^^^^^^^^ Testing attributes are not allowed in scripts. - -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/script_with_multiple_on_main.move:5:7 - │ -5 │ #[test_only, test] - │ ^^^^^^^^^ Testing attributes are not allowed in scripts. - -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/script_with_multiple_on_main.move:5:18 - │ -5 │ #[test_only, test] - │ ^^^^ Testing attributes are not allowed in scripts. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_multiple_top_level.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_multiple_top_level.exp deleted file mode 100644 index 46c739088bb57..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_multiple_top_level.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/script_with_multiple_top_level.move:3:3 - │ -3 │ #[test, expected_failure] - │ ^^^^ Testing attributes are not allowed in scripts. - -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/script_with_multiple_top_level.move:3:9 - │ -3 │ #[test, expected_failure] - │ ^^^^^^^^^^^^^^^^ Testing attributes are not allowed in scripts. - -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/script_with_multiple_top_level.move:4:3 - │ -4 │ #[test_only] - │ ^^^^^^^^^ Testing attributes are not allowed in scripts. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_multiple_top_level.unit_test b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_multiple_top_level.unit_test deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_multiple_top_level.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_multiple_top_level.unit_test.exp deleted file mode 100644 index 46c739088bb57..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_multiple_top_level.unit_test.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/script_with_multiple_top_level.move:3:3 - │ -3 │ #[test, expected_failure] - │ ^^^^ Testing attributes are not allowed in scripts. - -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/script_with_multiple_top_level.move:3:9 - │ -3 │ #[test, expected_failure] - │ ^^^^^^^^^^^^^^^^ Testing attributes are not allowed in scripts. - -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/script_with_multiple_top_level.move:4:3 - │ -4 │ #[test_only] - │ ^^^^^^^^^ Testing attributes are not allowed in scripts. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_test_on_main.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_test_on_main.exp deleted file mode 100644 index 7bff3e304fac5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_test_on_main.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/script_with_test_on_main.move:3:7 - │ -3 │ #[test] - │ ^^^^ Testing attributes are not allowed in scripts. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_test_on_main.unit_test b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_test_on_main.unit_test deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_test_on_main.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_test_on_main.unit_test.exp deleted file mode 100644 index 7bff3e304fac5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_test_on_main.unit_test.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/script_with_test_on_main.move:3:7 - │ -3 │ #[test] - │ ^^^^ Testing attributes are not allowed in scripts. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_test_top_level.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_test_top_level.exp deleted file mode 100644 index 4575c01af959d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_test_top_level.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/script_with_test_top_level.move:2:3 - │ -2 │ #[test_only] - │ ^^^^^^^^^ Testing attributes are not allowed in scripts. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_test_top_level.unit_test b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_test_top_level.unit_test deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_test_top_level.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_test_top_level.unit_test.exp deleted file mode 100644 index 4575c01af959d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/script_with_test_top_level.unit_test.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E10005]: unable to generate test - ┌─ tests/move_check/unit_test/script_with_test_top_level.move:2:3 - │ -2 │ #[test_only] - │ ^^^^^^^^^ Testing attributes are not allowed in scripts. - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_and_test_only_annotation.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_and_test_only_annotation.snap new file mode 100644 index 0000000000000..58b662ed6754f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_and_test_only_annotation.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/test_and_test_only_annotation.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_and_test_only_annotation.unit_test.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_and_test_only_annotation.unit_test.exp deleted file mode 100644 index 7a8dfca3a01e7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_and_test_only_annotation.unit_test.exp +++ /dev/null @@ -1,10 +0,0 @@ -error[E10004]: invalid usage of known attribute - ┌─ tests/move_check/unit_test/test_and_test_only_annotation.move:5:7 - │ -4 │ #[test(_a=@0x1, _b=@0x2)] - │ ---------------------- Previously annotated here -5 │ #[test_only] - │ ^^^^^^^^^ Function annotated as both #[test] and #[test_only]. You need to declare it as either one or the other -6 │ public fun boo(_a: signer, _b: signer) { } - │ --- Error found in this test - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_and_test_only_annotation@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_and_test_only_annotation@unit_test.snap new file mode 100644 index 0000000000000..b203f36558553 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_and_test_only_annotation@unit_test.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/test_and_test_only_annotation.move +--- +error[E10004]: invalid usage of known attribute + ┌─ tests/move_check/unit_test/test_and_test_only_annotation.move:5:7 + │ +4 │ #[test(_a=@0x1, _b=@0x2)] + │ ---------------------- Previously annotated here +5 │ #[test_only] + │ ^^^^^^^^^ Function annotated as both #[test] and #[test_only]. You need to declare it as either one or the other +6 │ public fun boo(_a: signer, _b: signer) { } + │ --- Error found in this test diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_filter_function.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_filter_function.exp deleted file mode 100644 index dc35110a926fb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_filter_function.exp +++ /dev/null @@ -1,6 +0,0 @@ -error[E03005]: unbound unscoped name - ┌─ tests/move_check/unit_test/test_filter_function.move:6:24 - │ -6 │ public fun foo() { bar() } - │ ^^^ Unbound function 'bar' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_filter_function.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_filter_function.snap new file mode 100644 index 0000000000000..dede082885586 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_filter_function.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/test_filter_function.move +--- +error[E03005]: unbound unscoped name + ┌─ tests/move_check/unit_test/test_filter_function.move:6:24 + │ +6 │ public fun foo() { bar() } + │ ^^^ Unbound function 'bar' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_filter_struct.exp b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_filter_struct.exp deleted file mode 100644 index bb710372a72ed..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_filter_struct.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E03004]: unbound type - ┌─ tests/move_check/unit_test/test_filter_struct.move:9:23 - │ -9 │ public fun foo(): Foo { - │ ^^^ Unbound type 'Foo' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/unit_test/test_filter_struct.move:10:9 - │ -10 │ Foo {} - │ ^^^ Unbound type 'Foo' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_filter_struct.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_filter_struct.snap new file mode 100644 index 0000000000000..d8debf804adec --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/test_filter_struct.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/test_filter_struct.move +--- +error[E03004]: unbound type + ┌─ tests/move_check/unit_test/test_filter_struct.move:9:23 + │ +9 │ public fun foo(): Foo { + │ ^^^ Unbound type 'Foo' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/unit_test/test_filter_struct.move:10:9 + │ +10 │ Foo {} + │ ^^^ Unbound type 'Foo' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/valid_test_module.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/valid_test_module.snap new file mode 100644 index 0000000000000..edb4ee916b660 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/valid_test_module.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/valid_test_module.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/unit_test/valid_test_module@unit_test.snap b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/valid_test_module@unit_test.snap new file mode 100644 index 0000000000000..edb4ee916b660 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/unit_test/valid_test_module@unit_test.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/unit_test/valid_test_module.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/verification/cross_module_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/verification/cross_module_invalid.exp deleted file mode 100644 index 5a8b3c0dd6822..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/verification/cross_module_invalid.exp +++ /dev/null @@ -1,30 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/cross_module_invalid.move:10:7 - │ -10 │ #[verify_only] - │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/cross_module_invalid.move:13:7 - │ -13 │ #[verify_only] - │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/cross_module_invalid.move:16:7 - │ -16 │ #[verify_only] - │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks - -error[E03004]: unbound type - ┌─ tests/move_check/verification/cross_module_invalid.move:22:23 - │ -22 │ public fun bad(): Foo { - │ ^^^ Unbound type 'Foo' in current scope - -error[E03002]: unbound module - ┌─ tests/move_check/verification/cross_module_invalid.move:23:9 - │ -23 │ A::build_foo() - │ ^ Unbound module alias 'A' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/verification/cross_module_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/verification/cross_module_invalid.snap new file mode 100644 index 0000000000000..4d8c8812dabcb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/verification/cross_module_invalid.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/verification/cross_module_invalid.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/cross_module_invalid.move:10:7 + │ +10 │ #[verify_only] + │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/cross_module_invalid.move:13:7 + │ +13 │ #[verify_only] + │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/cross_module_invalid.move:16:7 + │ +16 │ #[verify_only] + │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks + +error[E03004]: unbound type + ┌─ tests/move_check/verification/cross_module_invalid.move:22:23 + │ +22 │ public fun bad(): Foo { + │ ^^^ Unbound type 'Foo' in current scope + +error[E03002]: unbound module + ┌─ tests/move_check/verification/cross_module_invalid.move:23:9 + │ +23 │ A::build_foo() + │ ^ Unbound module alias 'A' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/verification/cross_module_valid.exp b/external-crates/move/crates/move-compiler/tests/move_check/verification/cross_module_valid.exp deleted file mode 100644 index ab5cc5275c73f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/verification/cross_module_valid.exp +++ /dev/null @@ -1,30 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/cross_module_valid.move:5:7 - │ -5 │ #[verify_only] - │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/cross_module_valid.move:8:7 - │ -8 │ #[verify_only] - │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/cross_module_valid.move:13:7 - │ -13 │ #[verify_only] - │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/cross_module_valid.move:16:7 - │ -16 │ #[verify_only] - │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/cross_module_valid.move:19:7 - │ -19 │ #[verify_only] - │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/verification/cross_module_valid.snap b/external-crates/move/crates/move-compiler/tests/move_check/verification/cross_module_valid.snap new file mode 100644 index 0000000000000..a46508cabbda6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/verification/cross_module_valid.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/verification/cross_module_valid.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/cross_module_valid.move:5:7 + │ +5 │ #[verify_only] + │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/cross_module_valid.move:8:7 + │ +8 │ #[verify_only] + │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/cross_module_valid.move:13:7 + │ +13 │ #[verify_only] + │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/cross_module_valid.move:16:7 + │ +16 │ #[verify_only] + │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/cross_module_valid.move:19:7 + │ +19 │ #[verify_only] + │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks diff --git a/external-crates/move/crates/move-compiler/tests/move_check/verification/double_annotation.exp b/external-crates/move/crates/move-compiler/tests/move_check/verification/double_annotation.exp deleted file mode 100644 index bcb9f7c7e3ca8..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/verification/double_annotation.exp +++ /dev/null @@ -1,24 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/double_annotation.move:3:7 - │ -3 │ #[verify_only] - │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/double_annotation.move:7:7 - │ -7 │ #[verify_only] - │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/double_annotation.move:13:7 - │ -13 │ #[verify_only] - │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/double_annotation.move:17:7 - │ -17 │ #[verify_only] - │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/verification/double_annotation.snap b/external-crates/move/crates/move-compiler/tests/move_check/verification/double_annotation.snap new file mode 100644 index 0000000000000..9e24088c0ccfc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/verification/double_annotation.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/verification/double_annotation.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/double_annotation.move:3:7 + │ +3 │ #[verify_only] + │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/double_annotation.move:7:7 + │ +7 │ #[verify_only] + │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/double_annotation.move:13:7 + │ +13 │ #[verify_only] + │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/double_annotation.move:17:7 + │ +17 │ #[verify_only] + │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks diff --git a/external-crates/move/crates/move-compiler/tests/move_check/verification/double_annotation.verification.exp b/external-crates/move/crates/move-compiler/tests/move_check/verification/double_annotation.verification.exp deleted file mode 100644 index 8329be3105e77..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/verification/double_annotation.verification.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/verification/double_annotation.move:8:7 - │ -7 │ #[verify_only] - │ ----------- Attribute previously given here -8 │ #[verify_only] - │ ^^^^^^^^^^^ Duplicate attribute 'verify_only' attached to the same item - -error[E02001]: duplicate declaration, item, or annotation - ┌─ tests/move_check/verification/double_annotation.move:18:7 - │ -17 │ #[verify_only] - │ ----------- Attribute previously given here -18 │ #[verify_only] - │ ^^^^^^^^^^^ Duplicate attribute 'verify_only' attached to the same item - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/verification/single_module_invalid.exp b/external-crates/move/crates/move-compiler/tests/move_check/verification/single_module_invalid.exp deleted file mode 100644 index 8210238ed5610..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/verification/single_module_invalid.exp +++ /dev/null @@ -1,30 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/single_module_invalid.move:3:7 - │ -3 │ #[verify_only] - │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks - -error[E03004]: unbound type - ┌─ tests/move_check/verification/single_module_invalid.move:8:23 - │ -8 │ public fun foo(): Foo { - │ ^^^ Unbound type 'Foo' in current scope - -error[E03004]: unbound type - ┌─ tests/move_check/verification/single_module_invalid.move:9:9 - │ -9 │ Foo {} - │ ^^^ Unbound type 'Foo' in current scope - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/single_module_invalid.move:12:7 - │ -12 │ #[verify_only] - │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks - -error[E03005]: unbound unscoped name - ┌─ tests/move_check/verification/single_module_invalid.move:17:24 - │ -17 │ public fun baz() { bar() } - │ ^^^ Unbound function 'bar' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/verification/single_module_invalid.snap b/external-crates/move/crates/move-compiler/tests/move_check/verification/single_module_invalid.snap new file mode 100644 index 0000000000000..38380bf41166a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/verification/single_module_invalid.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/verification/single_module_invalid.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/single_module_invalid.move:3:7 + │ +3 │ #[verify_only] + │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks + +error[E03004]: unbound type + ┌─ tests/move_check/verification/single_module_invalid.move:8:23 + │ +8 │ public fun foo(): Foo { + │ ^^^ Unbound type 'Foo' in current scope + +error[E03004]: unbound type + ┌─ tests/move_check/verification/single_module_invalid.move:9:9 + │ +9 │ Foo {} + │ ^^^ Unbound type 'Foo' in current scope + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/single_module_invalid.move:12:7 + │ +12 │ #[verify_only] + │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks + +error[E03005]: unbound unscoped name + ┌─ tests/move_check/verification/single_module_invalid.move:17:24 + │ +17 │ public fun baz() { bar() } + │ ^^^ Unbound function 'bar' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/move_check/verification/single_module_valid.exp b/external-crates/move/crates/move-compiler/tests/move_check/verification/single_module_valid.exp deleted file mode 100644 index 4058ee3467e08..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/verification/single_module_valid.exp +++ /dev/null @@ -1,18 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/single_module_valid.move:4:7 - │ -4 │ #[verify_only] - │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/single_module_valid.move:10:7 - │ -10 │ #[verify_only] - │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/single_module_valid.move:14:7 - │ -14 │ #[verify_only] - │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/verification/single_module_valid.snap b/external-crates/move/crates/move-compiler/tests/move_check/verification/single_module_valid.snap new file mode 100644 index 0000000000000..115036379c85f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/verification/single_module_valid.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/verification/single_module_valid.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/single_module_valid.move:4:7 + │ +4 │ #[verify_only] + │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/single_module_valid.move:10:7 + │ +10 │ #[verify_only] + │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/single_module_valid.move:14:7 + │ +14 │ #[verify_only] + │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks diff --git a/external-crates/move/crates/move-compiler/tests/move_check/verification/specs_are_not_errors.exp b/external-crates/move/crates/move-compiler/tests/move_check/verification/specs_are_not_errors.exp deleted file mode 100644 index b25cb452aae80..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/verification/specs_are_not_errors.exp +++ /dev/null @@ -1,18 +0,0 @@ -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/specs_are_not_errors.move:4:5 - │ -4 │ spec foo {} - │ ^^^^^^^^^^^ Specification blocks are deprecated and are no longer used - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/specs_are_not_errors.move:7:7 - │ -7 │ #[verify_only] - │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks - -warning[W00001]: DEPRECATED. will be removed - ┌─ tests/move_check/verification/specs_are_not_errors.move:12:9 - │ -12 │ spec a::m { - │ ^ Specification blocks are deprecated and are no longer used - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/verification/specs_are_not_errors.snap b/external-crates/move/crates/move-compiler/tests/move_check/verification/specs_are_not_errors.snap new file mode 100644 index 0000000000000..fefb8dfb3d0dd --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/verification/specs_are_not_errors.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/verification/specs_are_not_errors.move +--- +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/specs_are_not_errors.move:4:5 + │ +4 │ spec foo {} + │ ^^^^^^^^^^^ Specification blocks are deprecated and are no longer used + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/specs_are_not_errors.move:7:7 + │ +7 │ #[verify_only] + │ ^^^^^^^^^^^ The 'verify_only' attribute has been deprecated along with specification blocks + +warning[W00001]: DEPRECATED. will be removed + ┌─ tests/move_check/verification/specs_are_not_errors.move:12:9 + │ +12 │ spec a::m { + │ ^ Specification blocks are deprecated and are no longer used diff --git a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/all.snap b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/all.snap new file mode 100644 index 0000000000000..bad05437928c2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/all.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/warning_suppression/all.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/allow_with_no_filter.exp b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/allow_with_no_filter.exp deleted file mode 100644 index a35bd9364ea1f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/allow_with_no_filter.exp +++ /dev/null @@ -1,6 +0,0 @@ -warning[W10007]: issue with attribute value - ┌─ tests/move_check/warning_suppression/allow_with_no_filter.move:2:3 - │ -2 │ #[allow] - │ ^^^^^ Expected list of warnings, e.g. 'allow(unused)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/allow_with_no_filter.snap b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/allow_with_no_filter.snap new file mode 100644 index 0000000000000..ec86e259267d7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/allow_with_no_filter.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/warning_suppression/allow_with_no_filter.move +--- +warning[W10007]: issue with attribute value + ┌─ tests/move_check/warning_suppression/allow_with_no_filter.move:2:3 + │ +2 │ #[allow] + │ ^^^^^ Expected list of warnings, e.g. 'allow(unused)' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/bad_attr.exp b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/bad_attr.exp deleted file mode 100644 index 4f4f9a76251a5..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/bad_attr.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[E02015]: invalid attribute - ┌─ tests/move_check/warning_suppression/bad_attr.move:3:16 - │ -3 │ #[allow(all(), unused = true, unused_(assignment, variable))] - │ ^^^^^^ Expected a stand alone warning filter identifier, e.g. 'allow(unused)' - -warning[W10007]: issue with attribute value - ┌─ tests/move_check/warning_suppression/bad_attr.move:3:39 - │ -3 │ #[allow(all(), unused = true, unused_(assignment, variable))] - │ ^^^^^^^^^^ Unknown warning filter 'unused_(assignment)' - -warning[W10007]: issue with attribute value - ┌─ tests/move_check/warning_suppression/bad_attr.move:3:51 - │ -3 │ #[allow(all(), unused = true, unused_(assignment, variable))] - │ ^^^^^^^^ Unknown warning filter 'unused_(variable)' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/bad_attr.snap b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/bad_attr.snap new file mode 100644 index 0000000000000..2cd9212d02ad9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/bad_attr.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/warning_suppression/bad_attr.move +--- +error[E02015]: invalid attribute + ┌─ tests/move_check/warning_suppression/bad_attr.move:3:16 + │ +3 │ #[allow(all(), unused = true, unused_(assignment, variable))] + │ ^^^^^^ Expected a stand alone warning filter identifier, e.g. 'allow(unused)' + +warning[W10007]: issue with attribute value + ┌─ tests/move_check/warning_suppression/bad_attr.move:3:39 + │ +3 │ #[allow(all(), unused = true, unused_(assignment, variable))] + │ ^^^^^^^^^^ Unknown warning filter 'unused_(assignment)' + +warning[W10007]: issue with attribute value + ┌─ tests/move_check/warning_suppression/bad_attr.move:3:51 + │ +3 │ #[allow(all(), unused = true, unused_(assignment, variable))] + │ ^^^^^^^^ Unknown warning filter 'unused_(variable)' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/bad_location.exp b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/bad_location.exp deleted file mode 100644 index 297fe5549d59f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/bad_location.exp +++ /dev/null @@ -1,26 +0,0 @@ -error[E02015]: invalid attribute - ┌─ tests/move_check/warning_suppression/bad_location.move:4:7 - │ -4 │ #[allow(unused)] - │ ^^^^^ - │ │ - │ Known attribute 'allow' is not expected with a use - │ Expected to be used with one of the following: module, constant, struct, enum, function - -warning[W09001]: unused alias - ┌─ tests/move_check/warning_suppression/bad_location.move:5:15 - │ -5 │ use 0x42::x; - │ ^ Unused 'use' of alias 'x'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -error[E02015]: invalid attribute - ┌─ tests/move_check/warning_suppression/bad_location.move:7:7 - │ -7 │ #[allow(all)] - │ ^^^^^ - │ │ - │ Known attribute 'allow' is not expected with a friend - │ Expected to be used with one of the following: module, constant, struct, enum, function - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/bad_location.snap b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/bad_location.snap new file mode 100644 index 0000000000000..76805a5766ffa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/bad_location.snap @@ -0,0 +1,33 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/warning_suppression/bad_location.move +--- +error[E02015]: invalid attribute + ┌─ tests/move_check/warning_suppression/bad_location.move:4:7 + │ +4 │ #[allow(unused)] + │ ^^^^^ + │ │ + │ Known attribute 'allow' is not expected with a use + │ Expected to be used with one of the following: module, constant, struct, enum, function + +warning[W09001]: unused alias + ┌─ tests/move_check/warning_suppression/bad_location.move:5:15 + │ +5 │ use 0x42::x; + │ ^ Unused 'use' of alias 'x'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +error[E02015]: invalid attribute + ┌─ tests/move_check/warning_suppression/bad_location.move:7:7 + │ +7 │ #[allow(all)] + │ ^^^^^ + │ │ + │ Known attribute 'allow' is not expected with a friend + │ Expected to be used with one of the following: module, constant, struct, enum, function diff --git a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/dead_code.snap b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/dead_code.snap new file mode 100644 index 0000000000000..fbf6197cd20ed --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/dead_code.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/warning_suppression/dead_code.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/missing_phantom.snap b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/missing_phantom.snap new file mode 100644 index 0000000000000..2d4023f6c81ff --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/missing_phantom.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/warning_suppression/missing_phantom.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unknown_warning.exp b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unknown_warning.exp deleted file mode 100644 index 894090e5dfb66..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unknown_warning.exp +++ /dev/null @@ -1,6 +0,0 @@ -warning[W10007]: issue with attribute value - ┌─ tests/move_check/warning_suppression/unknown_warning.move:3:9 - │ -3 │ #[allow(who_am_i)] - │ ^^^^^^^^ Unknown warning filter 'who_am_i' - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unknown_warning.snap b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unknown_warning.snap new file mode 100644 index 0000000000000..7418342522e99 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unknown_warning.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/warning_suppression/unknown_warning.move +--- +warning[W10007]: issue with attribute value + ┌─ tests/move_check/warning_suppression/unknown_warning.move:3:9 + │ +3 │ #[allow(who_am_i)] + │ ^^^^^^^^ Unknown warning filter 'who_am_i' diff --git a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused.exp b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused.exp deleted file mode 100644 index 87b7d982ca134..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[W02014]: invalid non-phantom type parameter usage - ┌─ tests/move_check/warning_suppression/unused.move:8:14 - │ -8 │ struct S { f: B } - │ ^^ The parameter 'T1' is only used as an argument to phantom parameters. Consider adding a phantom declaration here - │ - = This warning can be suppressed with '#[allow(missing_phantom)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W02014]: invalid non-phantom type parameter usage - ┌─ tests/move_check/warning_suppression/unused.move:32:14 - │ -32 │ struct S { f: B } - │ ^^ The parameter 'T1' is only used as an argument to phantom parameters. Consider adding a phantom declaration here - │ - = This warning can be suppressed with '#[allow(missing_phantom)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused.snap b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused.snap new file mode 100644 index 0000000000000..3480f3e923814 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/warning_suppression/unused.move +--- +warning[W02014]: invalid non-phantom type parameter usage + ┌─ tests/move_check/warning_suppression/unused.move:8:14 + │ +8 │ struct S { f: B } + │ ^^ The parameter 'T1' is only used as an argument to phantom parameters. Consider adding a phantom declaration here + │ + = This warning can be suppressed with '#[allow(missing_phantom)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W02014]: invalid non-phantom type parameter usage + ┌─ tests/move_check/warning_suppression/unused.move:32:14 + │ +32 │ struct S { f: B } + │ ^^ The parameter 'T1' is only used as an argument to phantom parameters. Consider adding a phantom declaration here + │ + = This warning can be suppressed with '#[allow(missing_phantom)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused_assignment.snap b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused_assignment.snap new file mode 100644 index 0000000000000..1f6bd89eef298 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused_assignment.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/warning_suppression/unused_assignment.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused_trailing_semi.snap b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused_trailing_semi.snap new file mode 100644 index 0000000000000..a2868ff60e9d1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused_trailing_semi.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/warning_suppression/unused_trailing_semi.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused_type_parameter.snap b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused_type_parameter.snap new file mode 100644 index 0000000000000..83ba3dd69d9ed --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused_type_parameter.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/warning_suppression/unused_type_parameter.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused_use.snap b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused_use.snap new file mode 100644 index 0000000000000..ff2ad3709ca10 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused_use.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/warning_suppression/unused_use.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused_variable.snap b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused_variable.snap new file mode 100644 index 0000000000000..aef2fe116271e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/move_check/warning_suppression/unused_variable.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: core + edition: legacy + lint: false +input_file: crates/move-compiler/tests/move_check/warning_suppression/unused_variable.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/move_check_testsuite.rs b/external-crates/move/crates/move-compiler/tests/move_check_testsuite.rs index 39389d80a728a..78357bc37a78b 100644 --- a/external-crates/move/crates/move-compiler/tests/move_check_testsuite.rs +++ b/external-crates/move/crates/move-compiler/tests/move_check_testsuite.rs @@ -2,11 +2,17 @@ // Copyright (c) The Move Contributors // SPDX-License-Identifier: Apache-2.0 -use std::{collections::BTreeMap, fs, path::Path}; +use std::{ + collections::BTreeMap, + fs, + path::{Path, PathBuf}, +}; use move_command_line_common::{ env::read_bool_env_var, - testing::{add_update_baseline_fix, format_diff, read_env_update_baseline, EXP_EXT, OUT_EXT}, + files::MOVE_EXTENSION, + insta_assert, + testing::{InstaOptions, OUT_EXT}, }; use move_compiler::{ command_line::compiler::move_check_for_errors, @@ -17,6 +23,7 @@ use move_compiler::{ shared::{Flags, NumericalAddress, PackageConfig, PackagePaths}, sui_mode, Compiler, PASS_PARSER, }; +use serde::{Deserialize, Serialize}; /// Shared flag to keep any temporary results of the test const KEEP_TMP: &str = "KEEP"; @@ -31,6 +38,39 @@ const SUI_MODE_DIR: &str = "sui_mode"; const MOVE_2024_DIR: &str = "move_2024"; const DEV_DIR: &str = "development"; +#[derive(Debug, Clone, Copy, Serialize, Deserialize)] +struct TestInfo { + flavor: Flavor, + edition: Edition, + lint: bool, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +enum TestKind { + // Normal test + Normal, + // Tests unit test functionality + Test, + // Does not silence warnings for unused items + Unused, + // Tests edition migration + Migration, + // Tests additional generation for the IDE + IDE, +} + +impl TestKind { + fn snap_suffix(&self) -> Option<&'static str> { + match self { + TestKind::Normal => None, + TestKind::Test => Some(TEST_EXT), + TestKind::Unused => Some(UNUSED_EXT), + TestKind::Migration => Some(MIGRATION_EXT), + TestKind::IDE => Some(IDE_EXT), + } + } +} + fn default_testing_addresses(flavor: Flavor) -> BTreeMap { let mut mapping = vec![ ("std", "0x1"), @@ -52,7 +92,8 @@ fn default_testing_addresses(flavor: Flavor) -> BTreeMap datatest_stable::Result<()> { +fn test_config(path: &Path) -> (TestKind, TestInfo, PackageConfig, Flags) { + let path_extension = path.extension().unwrap(); let path_contains = |s| path.components().any(|c| c.as_os_str() == s); let lint = path_contains(LINTER_DIR); let flavor = if path_contains(SUI_MODE_DIR) { @@ -60,169 +101,113 @@ fn move_check_testsuite(path: &Path) -> datatest_stable::Result<()> { } else { Flavor::default() }; - let edition = if path_contains(MOVE_2024_DIR) { + let migration_mode = path_extension == MIGRATION_EXT; + let move_2024_mode = path_contains(MOVE_2024_DIR); + let dev_mode = path_contains(DEV_DIR); + assert!( + [move_2024_mode, dev_mode,] + .into_iter() + .filter(|x| *x) + .count() + <= 1, + "A test can have at most directory based edition" + ); + let edition = if migration_mode { + // migration mode overrides the edition + Edition::E2024_MIGRATION + } else if move_2024_mode { Edition::E2024_ALPHA - } else if path_contains(DEV_DIR) { + } else if dev_mode { Edition::DEVELOPMENT } else { Edition::LEGACY }; - let config = PackageConfig { + // test kind + let test_kind = match () { + _ if path_extension == MOVE_EXTENSION => TestKind::Normal, + _ if path_extension == TEST_EXT => TestKind::Test, + _ if path_extension == UNUSED_EXT => TestKind::Unused, + _ if path_extension == MIGRATION_EXT => TestKind::Migration, + _ if path_extension == IDE_EXT => TestKind::IDE, + _ => panic!("Unknown extension: {}", path_extension.to_string_lossy()), + }; + // config + let mut config = PackageConfig { flavor, edition, is_dependency: false, warning_filter: WarningFiltersBuilder::new_for_source(), }; - testsuite(path, config, lint) -} - -fn testsuite(path: &Path, mut config: PackageConfig, lint: bool) -> datatest_stable::Result<()> { - // A test is marked that it should also be compiled in test mode by having a `path.unit_test` - // file. - if path.with_extension(TEST_EXT).exists() { - let test_exp_path = format!( - "{}.{TEST_EXT}.{EXP_EXT}", - path.with_extension("").to_string_lossy(), - ); - let test_out_path = format!( - "{}.{TEST_EXT}.{OUT_EXT}", - path.with_extension("").to_string_lossy(), - ); - let mut config = config.clone(); - config - .warning_filter - .union(&WarningFiltersBuilder::unused_warnings_filter_for_test()); - run_test( - path, - Path::new(&test_exp_path), - Path::new(&test_out_path), - Flags::testing(), - config, - lint, - )?; - } - - // A test is marked that it should also be compiled in migration mode by having a - // `path.migration` file. - if path.with_extension(MIGRATION_EXT).exists() { - let migration_exp_path = format!( - "{}.{MIGRATION_EXT}.{EXP_EXT}", - path.with_extension("").to_string_lossy(), - ); - let migration_out_path = format!( - "{}.{MIGRATION_EXT}.{OUT_EXT}", - path.with_extension("").to_string_lossy(), - ); - let mut config = config.clone(); + // Unused and IDE do not have additional warning filters + if !matches!(test_kind, TestKind::Unused | TestKind::IDE) { config .warning_filter .union(&WarningFiltersBuilder::unused_warnings_filter_for_test()); - run_test_inner( - path, - Path::new(&migration_exp_path), - Path::new(&migration_out_path), - Flags::testing(), - config, - lint, - true, - )?; } - - // A cross-module unused case that should run without unused warnings suppression - if path.with_extension(UNUSED_EXT).exists() { - let unused_exp_path = format!( - "{}.{UNUSED_EXT}.{EXP_EXT}", - path.with_extension("").to_string_lossy(), - ); - let unused_out_path = format!( - "{}.{UNUSED_EXT}.{OUT_EXT}", - path.with_extension("").to_string_lossy(), - ); - run_test( - path, - Path::new(&unused_exp_path), - Path::new(&unused_out_path), - Flags::testing(), - config.clone(), - lint, - )?; - } - - // A cross-module unused case that should run without unused warnings suppression - if path.with_extension(IDE_EXT).exists() { - let ide_exp_path = format!( - "{}.{IDE_EXT}.{EXP_EXT}", - path.with_extension("").to_string_lossy(), - ); - let ide_out_path = format!( - "{}.{IDE_EXT}.{OUT_EXT}", - path.with_extension("").to_string_lossy(), - ); - run_test( - path, - Path::new(&ide_exp_path), - Path::new(&ide_out_path), - Flags::testing().set_ide_test_mode(true).set_ide_mode(true), - config.clone(), - lint, - )?; - } - - let exp_path = path.with_extension(EXP_EXT); - let out_path = path.with_extension(OUT_EXT); - - config - .warning_filter - .union(&WarningFiltersBuilder::unused_warnings_filter_for_test()); - run_test(path, &exp_path, &out_path, Flags::empty(), config, lint)?; - Ok(()) + // test info + let test_info = TestInfo { + flavor, + edition, + lint, + }; + // flags + let flags = match test_kind { + // no flags for normal tests + TestKind::Normal => Flags::empty(), + // we want to be able to see test/test_only elements in these modes + TestKind::Test | TestKind::Unused | TestKind::Migration => Flags::testing(), + // additional flags for IDE + TestKind::IDE => Flags::testing().set_ide_test_mode(true).set_ide_mode(true), + }; + (test_kind, test_info, config, flags) } -// Runs all tests under the test/testsuite directory. -pub fn run_test( - path: &Path, - exp_path: &Path, - out_path: &Path, - flags: Flags, - default_config: PackageConfig, - lint: bool, -) -> anyhow::Result<()> { - run_test_inner(path, exp_path, out_path, flags, default_config, lint, false) +fn out_path(path: &Path, test_name: &str, test_kind: Option<&str>) -> PathBuf { + let n; + let file_name = match test_kind { + Some(c) => { + n = format!("{test_name}@{c}"); + &n + } + None => test_name, + }; + path.with_file_name(file_name).with_extension(OUT_EXT) } // Runs all tests under the test/testsuite directory. -pub fn run_test_inner( - path: &Path, - exp_path: &Path, - out_path: &Path, - flags: Flags, - package_config: PackageConfig, - lint: bool, - migration_mode: bool, -) -> anyhow::Result<()> { +pub fn run_test(path: &Path) -> datatest_stable::Result<()> { + let (test_kind, test_info, package_config, flags) = test_config(path); + let suffix = test_kind.snap_suffix(); + let migration_mode = package_config.edition == Edition::E2024_MIGRATION; + let p; + let test_name = { + p = path.with_extension(""); + assert!(p.extension().is_none()); + p.file_name().unwrap().to_string_lossy() + }; + let test_name: &str = test_name.as_ref(); + let move_path = path.with_extension(MOVE_EXTENSION); + let out_path = out_path(path, test_name, suffix); let flavor = package_config.flavor; - let targets: Vec = vec![path.to_str().unwrap().to_owned()]; + let targets: Vec = vec![move_path.to_str().unwrap().to_owned()]; let named_address_map = default_testing_addresses(flavor); let deps = vec![PackagePaths { name: Some(("stdlib".into(), PackageConfig::default())), paths: move_stdlib::move_stdlib_files(), named_address_map: named_address_map.clone(), }]; - let name = if migration_mode { - let mut config = package_config.clone(); - config.edition = Edition::E2024_MIGRATION; - Some(("test".into(), config)) + let target_name = if migration_mode { + Some(("test".into(), package_config.clone())) } else { None }; let targets = vec![PackagePaths { - name, + name: target_name, paths: targets, named_address_map, }]; let flags = flags.set_sources_shadow_deps(true); - let mut compiler = Compiler::from_package_paths(None, targets, deps) .unwrap() .set_flags(flags) @@ -231,13 +216,13 @@ pub fn run_test_inner( if flavor == Flavor::Sui { let (prefix, filters) = sui_mode::linters::known_filters(); compiler = compiler.add_custom_known_filters(prefix, filters); - if lint { + if test_info.lint { compiler = compiler.add_visitors(sui_mode::linters::linter_visitors(LintLevel::All)) } } let (prefix, filters) = linters::known_filters(); compiler = compiler.add_custom_known_filters(prefix, filters); - if lint { + if test_info.lint { compiler = compiler.add_visitors(linters::linter_visitors(LintLevel::All)) } @@ -256,52 +241,38 @@ pub fn run_test_inner( }; let save_diags = read_bool_env_var(KEEP_TMP); - let update_baseline = read_env_update_baseline(); let rendered_diags = std::str::from_utf8(&diag_buffer)?; if save_diags { fs::write(out_path, &diag_buffer)?; } - if update_baseline { - if has_diags { - fs::write(exp_path, rendered_diags)?; - } else if exp_path.is_file() { - fs::remove_file(exp_path)?; - } - return Ok(()); - } - - let exp_exists = exp_path.is_file(); - match (has_diags, exp_exists) { - (false, false) => Ok(()), - (true, false) => { - let msg = format!( - "Expected success. Unexpected diagnostics:\n{}", - rendered_diags - ); - anyhow::bail!(add_update_baseline_fix(msg)) - } - (false, true) => { - let msg = format!( - "Unexpected success. Expected diagnostics:\n{}", - fs::read_to_string(exp_path)? - ); - anyhow::bail!(add_update_baseline_fix(msg)) - } - (true, true) => { - let expected_diags = fs::read_to_string(exp_path)?; - if rendered_diags != expected_diags { - let msg = format!( - "Expected diagnostics differ from actual diagnostics:\n{}", - format_diff(expected_diags, rendered_diags), - ); - anyhow::bail!(add_update_baseline_fix(msg)) - } else { - Ok(()) - } - } - } + let mut options = InstaOptions::new(); + options.info = Some(test_info); + options.suffix = suffix; + insta_assert! { + name: test_name, + input_path: move_path, + contents: rendered_diags, + options: options, + }; + Ok(()) } -datatest_stable::harness!(move_check_testsuite, "tests/", r".*\.move$"); +datatest_stable::harness!( + run_test, + "tests/", + r".*\.move$", + run_test, + "tests/", + r".*\.unit_test$", + run_test, + "tests/", + r".*\.unused$", + run_test, + "tests/", + r".*\.migration$", + run_test, + "tests/", + r".*\.ide$", +); diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/clock_mut.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/clock_mut.exp deleted file mode 100644 index e05355834e4c0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/clock_mut.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/clock_mut.move:4:35 - │ -4 │ public entry fun no_clock_mut(_: &mut sui::clock::Clock) { - │ ----- ^ ---------------------- sui::clock::Clock must be passed by immutable reference, e.g. '&sui::clock::Clock' - │ │ │ - │ │ Invalid 'entry' parameter type for parameter '_' - │ 'no_clock_mut' was declared 'entry' here - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/clock_mut.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/clock_mut.snap new file mode 100644 index 0000000000000..2501ebac8eeb1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/clock_mut.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/clock_mut.move +--- +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/clock_mut.move:4:35 + │ +4 │ public entry fun no_clock_mut(_: &mut sui::clock::Clock) { + │ ----- ^ ---------------------- sui::clock::Clock must be passed by immutable reference, e.g. '&sui::clock::Clock' + │ │ │ + │ │ Invalid 'entry' parameter type for parameter '_' + │ 'no_clock_mut' was declared 'entry' here diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/clock_ref.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/clock_ref.snap new file mode 100644 index 0000000000000..0012a42310a9a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/clock_ref.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/clock_ref.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/clock_val.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/clock_val.exp deleted file mode 100644 index bdb220a8125bf..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/clock_val.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/clock_val.move:4:35 - │ -4 │ public entry fun no_clock_val(_: sui::clock::Clock) { - │ ----- ^ ----------------- sui::clock::Clock must be passed by immutable reference, e.g. '&sui::clock::Clock' - │ │ │ - │ │ Invalid 'entry' parameter type for parameter '_' - │ 'no_clock_val' was declared 'entry' here - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/clock_val.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/clock_val.snap new file mode 100644 index 0000000000000..09eb18ccfb47b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/clock_val.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/clock_val.move +--- +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/clock_val.move:4:35 + │ +4 │ public entry fun no_clock_val(_: sui::clock::Clock) { + │ ----- ^ ----------------- sui::clock::Clock must be passed by immutable reference, e.g. '&sui::clock::Clock' + │ │ │ + │ │ Invalid 'entry' parameter type for parameter '_' + │ 'no_clock_val' was declared 'entry' here diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_and_generic_object_params.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_and_generic_object_params.snap new file mode 100644 index 0000000000000..ab28d9d3f2b54 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_and_generic_object_params.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/generic_and_generic_object_params.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_obj_mut_ref_vector.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_obj_mut_ref_vector.exp deleted file mode 100644 index 606e3b03050b6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_obj_mut_ref_vector.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/generic_obj_mut_ref_vector.move:5:32 - │ -5 │ public entry fun no(_: &mut vector) { - │ ----- ^ -------------- 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) - │ │ │ - │ │ Invalid 'entry' parameter type for parameter '_' - │ 'no' was declared 'entry' here - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_obj_mut_ref_vector.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_obj_mut_ref_vector.snap new file mode 100644 index 0000000000000..7c84e572875ad --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_obj_mut_ref_vector.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/generic_obj_mut_ref_vector.move +--- +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/generic_obj_mut_ref_vector.move:5:32 + │ +5 │ public entry fun no(_: &mut vector) { + │ ----- ^ -------------- 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) + │ │ │ + │ │ Invalid 'entry' parameter type for parameter '_' + │ 'no' was declared 'entry' here diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_obj_ref_vector.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_obj_ref_vector.exp deleted file mode 100644 index 323d92010ff1e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_obj_ref_vector.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/generic_obj_ref_vector.move:4:32 - │ -4 │ public entry fun no(_: &vector) { - │ ----- ^ ---------- 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) - │ │ │ - │ │ Invalid 'entry' parameter type for parameter '_' - │ 'no' was declared 'entry' here - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_obj_ref_vector.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_obj_ref_vector.snap new file mode 100644 index 0000000000000..330560742f628 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_obj_ref_vector.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/generic_obj_ref_vector.move +--- +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/generic_obj_ref_vector.move:4:32 + │ +4 │ public entry fun no(_: &vector) { + │ ----- ^ ---------- 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) + │ │ │ + │ │ Invalid 'entry' parameter type for parameter '_' + │ 'no' was declared 'entry' here diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_param_after_primitive.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_param_after_primitive.snap new file mode 100644 index 0000000000000..57a476fdc2c12 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_param_after_primitive.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/generic_param_after_primitive.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_with_key_invalid.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_with_key_invalid.exp deleted file mode 100644 index 5e9ceb81a485a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_with_key_invalid.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/generic_with_key_invalid.move:6:31 - │ -6 │ public entry fun t(_: option::Option) { - │ ----- ^ ----------------- 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) - │ │ │ - │ │ Invalid 'entry' parameter type for parameter '_' - │ 't' was declared 'entry' here - -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/generic_with_key_invalid.move:10:32 - │ -10 │ public entry fun t2(_: vector>) { - │ ----- ^ ------------------------- 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) - │ │ │ - │ │ Invalid 'entry' parameter type for parameter '_' - │ 't2' was declared 'entry' here - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_with_key_invalid.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_with_key_invalid.snap new file mode 100644 index 0000000000000..ccd0afca20a2d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_with_key_invalid.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/generic_with_key_invalid.move +--- +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/generic_with_key_invalid.move:6:31 + │ +6 │ public entry fun t(_: option::Option) { + │ ----- ^ ----------------- 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) + │ │ │ + │ │ Invalid 'entry' parameter type for parameter '_' + │ 't' was declared 'entry' here + +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/generic_with_key_invalid.move:10:32 + │ +10 │ public entry fun t2(_: vector>) { + │ ----- ^ ------------------------- 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) + │ │ │ + │ │ Invalid 'entry' parameter type for parameter '_' + │ 't2' was declared 'entry' here diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_with_key_valid.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_with_key_valid.snap new file mode 100644 index 0000000000000..036c53a357fd9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/generic_with_key_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/generic_with_key_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/id.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/id.snap new file mode 100644 index 0000000000000..09fed750a9fd4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/id.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/id.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/immut_receiving_ref.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/immut_receiving_ref.snap new file mode 100644 index 0000000000000..1cc5db5a155d6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/immut_receiving_ref.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/immut_receiving_ref.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/mut_receiving_ref.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/mut_receiving_ref.snap new file mode 100644 index 0000000000000..9fa4c76ef4755 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/mut_receiving_ref.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/mut_receiving_ref.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/nested_generic_vector_param.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/nested_generic_vector_param.snap new file mode 100644 index 0000000000000..f670d773f7f1a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/nested_generic_vector_param.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/nested_generic_vector_param.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/nested_key_generic_vector_param.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/nested_key_generic_vector_param.exp deleted file mode 100644 index 5600e180cdca3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/nested_key_generic_vector_param.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/nested_key_generic_vector_param.move:3:34 - │ -3 │ public entry fun foo(_: vector>) { - │ ----- ^ ----------------- 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) - │ │ │ - │ │ Invalid 'entry' parameter type for parameter '_' - │ 'foo' was declared 'entry' here - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/nested_key_generic_vector_param.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/nested_key_generic_vector_param.snap new file mode 100644 index 0000000000000..82e165de97dc1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/nested_key_generic_vector_param.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/nested_key_generic_vector_param.move +--- +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/nested_key_generic_vector_param.move:3:34 + │ +3 │ public entry fun foo(_: vector>) { + │ ----- ^ ----------------- 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) + │ │ │ + │ │ Invalid 'entry' parameter type for parameter '_' + │ 'foo' was declared 'entry' here diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct.exp deleted file mode 100644 index 9c376375124aa..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/non_key_struct.move:6:25 - │ -6 │ public entry fun no(_: S) { - │ ----- ^ - 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) - │ │ │ - │ │ Invalid 'entry' parameter type for parameter '_' - │ 'no' was declared 'entry' here - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct.snap new file mode 100644 index 0000000000000..555886cd2edca --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/non_key_struct.move +--- +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/non_key_struct.move:6:25 + │ +6 │ public entry fun no(_: S) { + │ ----- ^ - 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) + │ │ │ + │ │ Invalid 'entry' parameter type for parameter '_' + │ 'no' was declared 'entry' here diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct_generic.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct_generic.exp deleted file mode 100644 index 8b4c4a45d2a8d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct_generic.exp +++ /dev/null @@ -1,18 +0,0 @@ -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/non_key_struct_generic.move:9:25 - │ -9 │ public entry fun t1(_: Obj) { - │ ----- ^ ------------ 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) - │ │ │ - │ │ Invalid 'entry' parameter type for parameter '_' - │ 't1' was declared 'entry' here - -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/non_key_struct_generic.move:14:28 - │ -14 │ public entry fun t2(_: Obj) { - │ ----- ^ ------ 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) - │ │ │ - │ │ Invalid 'entry' parameter type for parameter '_' - │ 't2' was declared 'entry' here - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct_generic.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct_generic.snap new file mode 100644 index 0000000000000..17d34bbeb438c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct_generic.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/non_key_struct_generic.move +--- +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/non_key_struct_generic.move:9:25 + │ +9 │ public entry fun t1(_: Obj) { + │ ----- ^ ------------ 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) + │ │ │ + │ │ Invalid 'entry' parameter type for parameter '_' + │ 't1' was declared 'entry' here + +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/non_key_struct_generic.move:14:28 + │ +14 │ public entry fun t2(_: Obj) { + │ ----- ^ ------ 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) + │ │ │ + │ │ Invalid 'entry' parameter type for parameter '_' + │ 't2' was declared 'entry' here diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct_generic_valid.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct_generic_valid.snap new file mode 100644 index 0000000000000..f98000f4a3ccb --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct_generic_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/non_key_struct_generic_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct_vector.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct_vector.exp deleted file mode 100644 index f3d21d93e4660..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct_vector.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/non_key_struct_vector.move:6:25 - │ -6 │ public entry fun no(_: vector) { - │ ----- ^ --------- 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) - │ │ │ - │ │ Invalid 'entry' parameter type for parameter '_' - │ 'no' was declared 'entry' here - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct_vector.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct_vector.snap new file mode 100644 index 0000000000000..e111b9ee5bf0f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/non_key_struct_vector.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/non_key_struct_vector.move +--- +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/non_key_struct_vector.move:6:25 + │ +6 │ public entry fun no(_: vector) { + │ ----- ^ --------- 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) + │ │ │ + │ │ Invalid 'entry' parameter type for parameter '_' + │ 'no' was declared 'entry' here diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/obj_mut_ref_vector.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/obj_mut_ref_vector.exp deleted file mode 100644 index 8a7d091e35d1f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/obj_mut_ref_vector.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/obj_mut_ref_vector.move:8:25 - │ -8 │ public entry fun no(_: &mut vector) { - │ ----- ^ -------------- 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) - │ │ │ - │ │ Invalid 'entry' parameter type for parameter '_' - │ 'no' was declared 'entry' here - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/obj_mut_ref_vector.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/obj_mut_ref_vector.snap new file mode 100644 index 0000000000000..7370aa6e67534 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/obj_mut_ref_vector.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/obj_mut_ref_vector.move +--- +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/obj_mut_ref_vector.move:8:25 + │ +8 │ public entry fun no(_: &mut vector) { + │ ----- ^ -------------- 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) + │ │ │ + │ │ Invalid 'entry' parameter type for parameter '_' + │ 'no' was declared 'entry' here diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/obj_ref_vector.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/obj_ref_vector.exp deleted file mode 100644 index 8f772bd6130fd..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/obj_ref_vector.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/obj_ref_vector.move:8:25 - │ -8 │ public entry fun no(_: &vector) { - │ ----- ^ ---------- 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) - │ │ │ - │ │ Invalid 'entry' parameter type for parameter '_' - │ 'no' was declared 'entry' here - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/obj_ref_vector.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/obj_ref_vector.snap new file mode 100644 index 0000000000000..3d29ede00efad --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/obj_ref_vector.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/obj_ref_vector.move +--- +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/obj_ref_vector.move:8:25 + │ +8 │ public entry fun no(_: &vector) { + │ ----- ^ ---------- 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) + │ │ │ + │ │ Invalid 'entry' parameter type for parameter '_' + │ 'no' was declared 'entry' here diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/ok.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/ok.snap new file mode 100644 index 0000000000000..7a3a4dfddb347 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/ok.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/ok.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/option.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/option.snap new file mode 100644 index 0000000000000..ecb9adfe5298b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/option.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/option.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/optional_txn_context.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/optional_txn_context.snap new file mode 100644 index 0000000000000..37192a48239e9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/optional_txn_context.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/optional_txn_context.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/random_mut.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/random_mut.exp deleted file mode 100644 index f88af642071ae..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/random_mut.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/random_mut.move:4:36 - │ -4 │ public entry fun no_random_mut(_: &mut sui::random::Random) { - │ ----- ^ ------------------------ sui::random::Random must be passed by immutable reference, e.g. '&sui::random::Random' - │ │ │ - │ │ Invalid 'entry' parameter type for parameter '_' - │ 'no_random_mut' was declared 'entry' here - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/random_mut.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/random_mut.snap new file mode 100644 index 0000000000000..4ab7f29c5362f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/random_mut.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/random_mut.move +--- +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/random_mut.move:4:36 + │ +4 │ public entry fun no_random_mut(_: &mut sui::random::Random) { + │ ----- ^ ------------------------ sui::random::Random must be passed by immutable reference, e.g. '&sui::random::Random' + │ │ │ + │ │ Invalid 'entry' parameter type for parameter '_' + │ 'no_random_mut' was declared 'entry' here diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/random_ref.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/random_ref.snap new file mode 100644 index 0000000000000..20dbd443e39da --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/random_ref.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/random_ref.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/random_val.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/random_val.exp deleted file mode 100644 index 1d9b4208e3bb7..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/random_val.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/random_val.move:4:36 - │ -4 │ public entry fun no_random_val(_: sui::random::Random) { - │ ----- ^ ------------------- sui::random::Random must be passed by immutable reference, e.g. '&sui::random::Random' - │ │ │ - │ │ Invalid 'entry' parameter type for parameter '_' - │ 'no_random_val' was declared 'entry' here - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/random_val.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/random_val.snap new file mode 100644 index 0000000000000..54abc23d8e7f0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/random_val.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/random_val.move +--- +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/random_val.move:4:36 + │ +4 │ public entry fun no_random_val(_: sui::random::Random) { + │ ----- ^ ------------------- sui::random::Random must be passed by immutable reference, e.g. '&sui::random::Random' + │ │ │ + │ │ Invalid 'entry' parameter type for parameter '_' + │ 'no_random_val' was declared 'entry' here diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/receiving_non_object_type.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/receiving_non_object_type.exp deleted file mode 100644 index 3422c96ab49c1..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/receiving_non_object_type.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/sui_mode/entry_points/receiving_non_object_type.move:6:28 - │ - 6 │ public entry fun no(_: Receiving) { abort 0 } - │ ^^^^^^^^^^^^^^ - │ │ │ - │ │ The type 'u64' does not have the ability 'key' - │ 'key' constraint not satisifed - · -10 │ struct Receiving has drop { - │ --- 'key' constraint declared here - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/receiving_non_object_type.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/receiving_non_object_type.snap new file mode 100644 index 0000000000000..25dc0f24b2c7c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/receiving_non_object_type.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/receiving_non_object_type.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/sui_mode/entry_points/receiving_non_object_type.move:6:28 + │ + 6 │ public entry fun no(_: Receiving) { abort 0 } + │ ^^^^^^^^^^^^^^ + │ │ │ + │ │ The type 'u64' does not have the ability 'key' + │ 'key' constraint not satisifed + · +10 │ struct Receiving has drop { + │ --- 'key' constraint declared here diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/receiving_with_object_type.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/receiving_with_object_type.snap new file mode 100644 index 0000000000000..3619adc9de7b4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/receiving_with_object_type.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/receiving_with_object_type.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/return_values.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/return_values.snap new file mode 100644 index 0000000000000..27205ecfe5485 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/return_values.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/return_values.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/return_values_invalid.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/return_values_invalid.exp deleted file mode 100644 index 81359485bfab6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/return_values_invalid.exp +++ /dev/null @@ -1,46 +0,0 @@ -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/return_values_invalid.move:4:12 - │ -4 │ public entry fun t0(): &u8 { - │ ^^^^^ --- Expected a non-reference type - │ │ - │ Invalid return type for entry function 't0' - -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/return_values_invalid.move:7:12 - │ -7 │ public entry fun t1(): &mut u8 { - │ ^^^^^ ------- Expected a non-reference type - │ │ - │ Invalid return type for entry function 't1' - -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/return_values_invalid.move:14:12 - │ -13 │ struct Copyable has copy, store {} - │ -------- To satisfy the constraint, the 'drop' ability would need to be added here -14 │ public entry fun t3(): Copyable { - │ ^^^^^ -------- The type 'a::m::Copyable' does not have the ability 'drop' - │ │ - │ Invalid return type for entry function 't3' - -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/return_values_invalid.move:18:12 - │ -17 │ struct Obj has key, store { id: sui::object::UID } - │ --- To satisfy the constraint, the 'drop' ability would need to be added here -18 │ public entry fun t4(): Obj { - │ ^^^^^ --- The type 'a::m::Obj' does not have the ability 'drop' - │ │ - │ Invalid return type for entry function 't4' - -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/entry_points/return_values_invalid.move:21:12 - │ -21 │ public entry fun t5(): vector { - │ ^^^^^ ----------- - │ │ │ │ - │ │ │ The type 'vector' can have the ability 'drop' but the type argument 'a::m::Obj' does not have the required ability 'drop' - │ │ The type 'vector' does not have the ability 'drop' - │ Invalid return type for entry function 't5' - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/return_values_invalid.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/return_values_invalid.snap new file mode 100644 index 0000000000000..f85b17a27e817 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/return_values_invalid.snap @@ -0,0 +1,53 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/return_values_invalid.move +--- +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/return_values_invalid.move:4:12 + │ +4 │ public entry fun t0(): &u8 { + │ ^^^^^ --- Expected a non-reference type + │ │ + │ Invalid return type for entry function 't0' + +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/return_values_invalid.move:7:12 + │ +7 │ public entry fun t1(): &mut u8 { + │ ^^^^^ ------- Expected a non-reference type + │ │ + │ Invalid return type for entry function 't1' + +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/return_values_invalid.move:14:12 + │ +13 │ struct Copyable has copy, store {} + │ -------- To satisfy the constraint, the 'drop' ability would need to be added here +14 │ public entry fun t3(): Copyable { + │ ^^^^^ -------- The type 'a::m::Copyable' does not have the ability 'drop' + │ │ + │ Invalid return type for entry function 't3' + +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/return_values_invalid.move:18:12 + │ +17 │ struct Obj has key, store { id: sui::object::UID } + │ --- To satisfy the constraint, the 'drop' ability would need to be added here +18 │ public entry fun t4(): Obj { + │ ^^^^^ --- The type 'a::m::Obj' does not have the ability 'drop' + │ │ + │ Invalid return type for entry function 't4' + +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/entry_points/return_values_invalid.move:21:12 + │ +21 │ public entry fun t5(): vector { + │ ^^^^^ ----------- + │ │ │ │ + │ │ │ The type 'vector' can have the ability 'drop' but the type argument 'a::m::Obj' does not have the required ability 'drop' + │ │ The type 'vector' does not have the ability 'drop' + │ Invalid return type for entry function 't5' diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/single_generic_vector_param.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/single_generic_vector_param.snap new file mode 100644 index 0000000000000..1244a0b9ad0a2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/single_generic_vector_param.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/single_generic_vector_param.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/single_type_param.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/single_type_param.snap new file mode 100644 index 0000000000000..3e6eb7f42c8e7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/single_type_param.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/single_type_param.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/single_type_param_generic_object.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/single_type_param_generic_object.snap new file mode 100644 index 0000000000000..cbd2d0584428d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/single_type_param_generic_object.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/single_type_param_generic_object.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/single_type_param_key.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/single_type_param_key.snap new file mode 100644 index 0000000000000..9676cebb40570 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/single_type_param_key.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/single_type_param_key.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/string.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/string.snap new file mode 100644 index 0000000000000..7c87fa7aadda8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/entry_points/string.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/entry_points/string.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/direct_leak_through_call.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/direct_leak_through_call.snap new file mode 100644 index 0000000000000..89247ef9f86c4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/direct_leak_through_call.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/id_leak/direct_leak_through_call.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/indirect_leak_through_call.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/indirect_leak_through_call.exp deleted file mode 100644 index 6bfb9fbe73a3b..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/indirect_leak_through_call.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[Sui E01001]: invalid object construction - ┌─ tests/sui_mode/id_leak/indirect_leak_through_call.move:15:18 - │ -15 │ transfer(Foo { id }); - │ ^^^^^^^^^^ - │ │ │ - │ │ The UID must come directly from sui::object::new. Or for tests, it can come from sui::test_scenario::new_object - │ Invalid object creation without a newly created UID. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/indirect_leak_through_call.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/indirect_leak_through_call.snap new file mode 100644 index 0000000000000..58f98eb3c6172 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/indirect_leak_through_call.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/id_leak/indirect_leak_through_call.move +--- +error[Sui E01001]: invalid object construction + ┌─ tests/sui_mode/id_leak/indirect_leak_through_call.move:15:18 + │ +15 │ transfer(Foo { id }); + │ ^^^^^^^^^^ + │ │ │ + │ │ The UID must come directly from sui::object::new. Or for tests, it can come from sui::test_scenario::new_object + │ Invalid object creation without a newly created UID. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/infinite_loop.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/infinite_loop.snap new file mode 100644 index 0000000000000..3b442152f1e2e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/infinite_loop.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/id_leak/infinite_loop.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/loop.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/loop.snap new file mode 100644 index 0000000000000..5c289c5340199 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/loop.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/id_leak/loop.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/private_pack.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/private_pack.exp deleted file mode 100644 index 9736ca4c7aad2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/private_pack.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[E04001]: restricted visibility - ┌─ tests/sui_mode/id_leak/private_pack.move:19:9 - │ - 5 │ struct A has key { - │ - Struct defined in module 'a::a' - · -19 │ A { id } - │ ^^^^^^^^ Struct 'a::a::A' can only be instantiated within its defining module 'a::a' - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/private_pack.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/private_pack.snap new file mode 100644 index 0000000000000..fc33d60135fb6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/private_pack.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/id_leak/private_pack.move +--- +error[E04001]: restricted visibility + ┌─ tests/sui_mode/id_leak/private_pack.move:19:9 + │ + 5 │ struct A has key { + │ - Struct defined in module 'a::a' + · +19 │ A { id } + │ ^^^^^^^^ Struct 'a::a::A' can only be instantiated within its defining module 'a::a' diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_call_with_borrow_field.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_call_with_borrow_field.exp deleted file mode 100644 index 414a1d03e49f3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_call_with_borrow_field.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[Sui E01001]: invalid object construction - ┌─ tests/sui_mode/id_leak/through_call_with_borrow_field.move:11:9 - │ -11 │ Object { id } - │ ^^^^^^^^^^^^^ - │ │ │ - │ │ The UID must come directly from sui::object::new. Or for tests, it can come from sui::test_scenario::new_object - │ Invalid object creation without a newly created UID. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_call_with_borrow_field.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_call_with_borrow_field.snap new file mode 100644 index 0000000000000..6d19a57aec32a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_call_with_borrow_field.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/id_leak/through_call_with_borrow_field.move +--- +error[Sui E01001]: invalid object construction + ┌─ tests/sui_mode/id_leak/through_call_with_borrow_field.move:11:9 + │ +11 │ Object { id } + │ ^^^^^^^^^^^^^ + │ │ │ + │ │ The UID must come directly from sui::object::new. Or for tests, it can come from sui::test_scenario::new_object + │ Invalid object creation without a newly created UID. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_direct_return.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_direct_return.snap new file mode 100644 index 0000000000000..ad874153f40e6 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_direct_return.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/id_leak/through_direct_return.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_indirect_return.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_indirect_return.exp deleted file mode 100644 index eafe425172e74..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_indirect_return.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[Sui E01001]: invalid object construction - ┌─ tests/sui_mode/id_leak/through_indirect_return.move:11:9 - │ -11 │ Foo { id } - │ ^^^^^^^^^^ - │ │ │ - │ │ The UID must come directly from sui::object::new. Or for tests, it can come from sui::test_scenario::new_object - │ Invalid object creation without a newly created UID. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_indirect_return.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_indirect_return.snap new file mode 100644 index 0000000000000..b770a49f68c56 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_indirect_return.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/id_leak/through_indirect_return.move +--- +error[Sui E01001]: invalid object construction + ┌─ tests/sui_mode/id_leak/through_indirect_return.move:11:9 + │ +11 │ Foo { id } + │ ^^^^^^^^^^ + │ │ │ + │ │ The UID must come directly from sui::object::new. Or for tests, it can come from sui::test_scenario::new_object + │ Invalid object creation without a newly created UID. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_pack.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_pack.exp deleted file mode 100644 index b4142af9e9d6d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_pack.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[Sui E01001]: invalid object construction - ┌─ tests/sui_mode/id_leak/through_pack.move:22:17 - │ -22 │ let c = C { id }; - │ ^^^^^^^^ - │ │ │ - │ │ The UID must come directly from sui::object::new. Or for tests, it can come from sui::test_scenario::new_object - │ Invalid object creation without a newly created UID. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_pack.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_pack.snap new file mode 100644 index 0000000000000..9710f7f14a41c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_pack.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/id_leak/through_pack.move +--- +error[Sui E01001]: invalid object construction + ┌─ tests/sui_mode/id_leak/through_pack.move:22:17 + │ +22 │ let c = C { id }; + │ ^^^^^^^^ + │ │ │ + │ │ The UID must come directly from sui::object::new. Or for tests, it can come from sui::test_scenario::new_object + │ Invalid object creation without a newly created UID. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_reference.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_reference.exp deleted file mode 100644 index dae66d37518bb..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_reference.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/sui_mode/id_leak/through_reference.move:11:10 - │ - 9 │ public fun foo(f: Foo, ref: &mut UID) { - │ --- The type 'sui::object::UID' does not have the ability 'drop' -10 │ let Foo { id } = f; -11 │ *ref = id; - │ ^^^ Invalid mutation. Mutation requires the 'drop' ability as the old value is destroyed - · -17 │ struct UID has store { - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_reference.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_reference.snap new file mode 100644 index 0000000000000..443b9d9aefcb2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_reference.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/id_leak/through_reference.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/sui_mode/id_leak/through_reference.move:11:10 + │ + 9 │ public fun foo(f: Foo, ref: &mut UID) { + │ --- The type 'sui::object::UID' does not have the ability 'drop' +10 │ let Foo { id } = f; +11 │ *ref = id; + │ ^^^ Invalid mutation. Mutation requires the 'drop' ability as the old value is destroyed + · +17 │ struct UID has store { + │ --- To satisfy the constraint, the 'drop' ability would need to be added here diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_vector.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_vector.snap new file mode 100644 index 0000000000000..7220e311355b0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/through_vector.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/id_leak/through_vector.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/transmute.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/transmute.exp deleted file mode 100644 index 7124dd969dba6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/transmute.exp +++ /dev/null @@ -1,9 +0,0 @@ -error[Sui E01001]: invalid object construction - ┌─ tests/sui_mode/id_leak/transmute.move:17:19 - │ -17 │ let dog = Dog { id }; - │ ^^^^^^^^^^ - │ │ │ - │ │ The UID must come directly from sui::object::new. Or for tests, it can come from sui::test_scenario::new_object - │ Invalid object creation without a newly created UID. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/transmute.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/transmute.snap new file mode 100644 index 0000000000000..a8870000a3227 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/id_leak/transmute.snap @@ -0,0 +1,16 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/id_leak/transmute.move +--- +error[Sui E01001]: invalid object construction + ┌─ tests/sui_mode/id_leak/transmute.move:17:19 + │ +17 │ let dog = Dog { id }; + │ ^^^^^^^^^^ + │ │ │ + │ │ The UID must come directly from sui::object::new. Or for tests, it can come from sui::test_scenario::new_object + │ Invalid object creation without a newly created UID. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/init/cannot_call_init.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/init/cannot_call_init.exp deleted file mode 100644 index bb9c41d3d5498..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/init/cannot_call_init.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[Sui E02006]: invalid 'init' call - ┌─ tests/sui_mode/init/cannot_call_init.move:9:9 - │ -9 │ init(ctx) - │ ^^^^^^^^^ Invalid call to 'a::m::init'. Module initializers cannot be called directly - │ - = Module initializers are called implicitly upon publishing. If you need to reuse this function (or want to call it from a test), consider extracting the logic into a new function and calling that instead. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/init/cannot_call_init.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/init/cannot_call_init.snap new file mode 100644 index 0000000000000..992e238adbbb8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/init/cannot_call_init.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/init/cannot_call_init.move +--- +error[Sui E02006]: invalid 'init' call + ┌─ tests/sui_mode/init/cannot_call_init.move:9:9 + │ +9 │ init(ctx) + │ ^^^^^^^^^ Invalid call to 'a::m::init'. Module initializers cannot be called directly + │ + = Module initializers are called implicitly upon publishing. If you need to reuse this function (or want to call it from a test), consider extracting the logic into a new function and calling that instead. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/init/imm_tx_context.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/init/imm_tx_context.snap new file mode 100644 index 0000000000000..bbd90df01668f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/init/imm_tx_context.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/init/imm_tx_context.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/init/must_have_txn_context.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/init/must_have_txn_context.exp deleted file mode 100644 index 5040e737099c0..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/init/must_have_txn_context.exp +++ /dev/null @@ -1,19 +0,0 @@ -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/init/must_have_txn_context.move:3:9 - │ -3 │ fun init() { - │ ^^^^ - │ │ - │ Invalid 'init' function declaration - │ 'init' functions must have their last parameter as '&sui::tx_context::TxContext' or '&mut sui::tx_context::TxContext' - -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/init/must_have_txn_context.move:11:9 - │ -11 │ fun init(_ctx: &mut tx_context::TxContext, _ctx2: &mut tx_context::TxContext) { - │ ^^^^ -------------------------- Invalid parameter '_ctx' of type '&mut sui::tx_context::TxContext'. Expected a one-time witness type, 'a::n::N - │ │ - │ Invalid 'init' function declaration - │ - = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/init/must_have_txn_context.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/init/must_have_txn_context.snap new file mode 100644 index 0000000000000..edc8da26a9cba --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/init/must_have_txn_context.snap @@ -0,0 +1,26 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/init/must_have_txn_context.move +--- +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/init/must_have_txn_context.move:3:9 + │ +3 │ fun init() { + │ ^^^^ + │ │ + │ Invalid 'init' function declaration + │ 'init' functions must have their last parameter as '&sui::tx_context::TxContext' or '&mut sui::tx_context::TxContext' + +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/init/must_have_txn_context.move:11:9 + │ +11 │ fun init(_ctx: &mut tx_context::TxContext, _ctx2: &mut tx_context::TxContext) { + │ ^^^^ -------------------------- Invalid parameter '_ctx' of type '&mut sui::tx_context::TxContext'. Expected a one-time witness type, 'a::n::N + │ │ + │ Invalid 'init' function declaration + │ + = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/init/not_generic.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/init/not_generic.exp deleted file mode 100644 index 12e4a8916db7e..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/init/not_generic.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/init/not_generic.move:4:9 - │ -4 │ fun init(_ctx: &mut tx_context::TxContext) { - │ ^^^^ - 'init' functions cannot have type parameters - │ │ - │ Invalid 'init' function declaration - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/init/not_generic.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/init/not_generic.snap new file mode 100644 index 0000000000000..83bd54ade05d2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/init/not_generic.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/init/not_generic.move +--- +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/init/not_generic.move:4:9 + │ +4 │ fun init(_ctx: &mut tx_context::TxContext) { + │ ^^^^ - 'init' functions cannot have type parameters + │ │ + │ Invalid 'init' function declaration diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/init/not_private.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/init/not_private.exp deleted file mode 100644 index f798e2dee58d4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/init/not_private.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/init/not_private.move:4:16 - │ -4 │ public fun init(_ctxctx: &mut tx_context::TxContext) { - │ ------ ^^^^ Invalid 'init' function declaration - │ │ - │ 'init' functions must be internal to their module - -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/init/not_private.move:11:15 - │ -11 │ entry fun init(_ctx: &mut tx_context::TxContext) { - │ ----- ^^^^ Invalid 'init' function declaration - │ │ - │ 'init' functions cannot be 'entry' functions - -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/init/not_private.move:18:24 - │ -18 │ public(friend) fun init(_ctx: &mut tx_context::TxContext) { - │ -------------- ^^^^ Invalid 'init' function declaration - │ │ - │ 'init' functions must be internal to their module - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/init/not_private.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/init/not_private.snap new file mode 100644 index 0000000000000..13bc4d04b92c8 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/init/not_private.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/init/not_private.move +--- +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/init/not_private.move:4:16 + │ +4 │ public fun init(_ctxctx: &mut tx_context::TxContext) { + │ ------ ^^^^ Invalid 'init' function declaration + │ │ + │ 'init' functions must be internal to their module + +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/init/not_private.move:11:15 + │ +11 │ entry fun init(_ctx: &mut tx_context::TxContext) { + │ ----- ^^^^ Invalid 'init' function declaration + │ │ + │ 'init' functions cannot be 'entry' functions + +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/init/not_private.move:18:24 + │ +18 │ public(friend) fun init(_ctx: &mut tx_context::TxContext) { + │ -------------- ^^^^ Invalid 'init' function declaration + │ │ + │ 'init' functions must be internal to their module diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/init/not_txn_context.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/init/not_txn_context.exp deleted file mode 100644 index 2ae78773ecd52..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/init/not_txn_context.exp +++ /dev/null @@ -1,24 +0,0 @@ -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/init/not_txn_context.move:3:9 - │ -3 │ fun init(_: u64) { - │ ^^^^ --- 'init' functions must have their last parameter as '&sui::tx_context::TxContext' or '&mut sui::tx_context::TxContext' - │ │ - │ Invalid 'init' function declaration - -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/init/not_txn_context.move:10:9 - │ -10 │ fun init(_: TxContext) { - │ ^^^^ --------- 'init' functions must have their last parameter as '&sui::tx_context::TxContext' or '&mut sui::tx_context::TxContext' - │ │ - │ Invalid 'init' function declaration - -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/init/not_txn_context.move:17:9 - │ -17 │ fun init(_: tx_context::TxContext) { - │ ^^^^ --------------------- 'init' functions must have their last parameter as '&sui::tx_context::TxContext' or '&mut sui::tx_context::TxContext' - │ │ - │ Invalid 'init' function declaration - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/init/not_txn_context.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/init/not_txn_context.snap new file mode 100644 index 0000000000000..91bc41585e0d5 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/init/not_txn_context.snap @@ -0,0 +1,31 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/init/not_txn_context.move +--- +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/init/not_txn_context.move:3:9 + │ +3 │ fun init(_: u64) { + │ ^^^^ --- 'init' functions must have their last parameter as '&sui::tx_context::TxContext' or '&mut sui::tx_context::TxContext' + │ │ + │ Invalid 'init' function declaration + +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/init/not_txn_context.move:10:9 + │ +10 │ fun init(_: TxContext) { + │ ^^^^ --------- 'init' functions must have their last parameter as '&sui::tx_context::TxContext' or '&mut sui::tx_context::TxContext' + │ │ + │ Invalid 'init' function declaration + +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/init/not_txn_context.move:17:9 + │ +17 │ fun init(_: tx_context::TxContext) { + │ ^^^^ --------------------- 'init' functions must have their last parameter as '&sui::tx_context::TxContext' or '&mut sui::tx_context::TxContext' + │ │ + │ Invalid 'init' function declaration diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/init/ok.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/init/ok.snap new file mode 100644 index 0000000000000..30f5c35af35ec --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/init/ok.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/init/ok.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/init/return_values.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/init/return_values.exp deleted file mode 100644 index c215c96a8fd7d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/init/return_values.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/init/return_values.move:4:9 - │ -4 │ fun init(_: &mut tx_context::TxContext): u64 { - │ ^^^^ --- 'init' functions must have a return type of '()' - │ │ - │ Invalid 'init' function declaration - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/init/return_values.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/init/return_values.snap new file mode 100644 index 0000000000000..e0c247bc626ad --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/init/return_values.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/init/return_values.move +--- +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/init/return_values.move:4:9 + │ +4 │ fun init(_: &mut tx_context::TxContext): u64 { + │ ^^^^ --- 'init' functions must have a return type of '()' + │ │ + │ Invalid 'init' function declaration diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/init/unused_function.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/init/unused_function.snap new file mode 100644 index 0000000000000..9689f683bf31c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/init/unused_function.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/init/unused_function.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/coin_field.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/coin_field.exp deleted file mode 100644 index f28726716acaf..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/coin_field.exp +++ /dev/null @@ -1,16 +0,0 @@ -warning[Lint W99003]: sub-optimal 'sui::coin::Coin' field type - ┌─ tests/sui_mode/linter/coin_field.move:13:12 - │ -13 │ c: Coin, - │ ^^^^^^^^ Sub-optimal 'sui::coin::Coin' field type. Using 'sui::balance::Balance' instead will be more space efficient - │ - = This warning can be suppressed with '#[allow(lint(coin_field))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99003]: sub-optimal 'sui::coin::Coin' field type - ┌─ tests/sui_mode/linter/coin_field.move:27:12 - │ -27 │ c: Balance, - │ ^^^^^^^^^^^ Sub-optimal 'sui::coin::Coin' field type. Using 'sui::balance::Balance' instead will be more space efficient - │ - = This warning can be suppressed with '#[allow(lint(coin_field))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/coin_field.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/coin_field.snap new file mode 100644 index 0000000000000..49ef7b636f2ff --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/coin_field.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/coin_field.move +--- +warning[Lint W99003]: sub-optimal 'sui::coin::Coin' field type + ┌─ tests/sui_mode/linter/coin_field.move:13:12 + │ +13 │ c: Coin, + │ ^^^^^^^^ Sub-optimal 'sui::coin::Coin' field type. Using 'sui::balance::Balance' instead will be more space efficient + │ + = This warning can be suppressed with '#[allow(lint(coin_field))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99003]: sub-optimal 'sui::coin::Coin' field type + ┌─ tests/sui_mode/linter/coin_field.move:27:12 + │ +27 │ c: Balance, + │ ^^^^^^^^^^^ Sub-optimal 'sui::coin::Coin' field type. Using 'sui::balance::Balance' instead will be more space efficient + │ + = This warning can be suppressed with '#[allow(lint(coin_field))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/collection_equality.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/collection_equality.exp deleted file mode 100644 index 84ef8f0ad22bf..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/collection_equality.exp +++ /dev/null @@ -1,72 +0,0 @@ -warning[Lint W99005]: possibly useless collections compare - ┌─ tests/sui_mode/linter/collection_equality.move:17:14 - │ -17 │ bag1 == bag2 - │ ^^ Comparing collections of type 'sui::bag::Bag' may yield unexpected result. - │ - = Equality for collections of type 'sui::bag::Bag' IS NOT a structural check based on content - = This warning can be suppressed with '#[allow(lint(collection_equality))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99005]: possibly useless collections compare - ┌─ tests/sui_mode/linter/collection_equality.move:21:14 - │ -21 │ bag1 != bag2 - │ ^^ Comparing collections of type 'sui::object_bag::ObjectBag' may yield unexpected result. - │ - = Equality for collections of type 'sui::object_bag::ObjectBag' IS NOT a structural check based on content - = This warning can be suppressed with '#[allow(lint(collection_equality))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99005]: possibly useless collections compare - ┌─ tests/sui_mode/linter/collection_equality.move:25:16 - │ -25 │ table1 == table2 - │ ^^ Comparing collections of type 'sui::table::Table' may yield unexpected result. - │ - = Equality for collections of type 'sui::table::Table' IS NOT a structural check based on content - = This warning can be suppressed with '#[allow(lint(collection_equality))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99005]: possibly useless collections compare - ┌─ tests/sui_mode/linter/collection_equality.move:32:20 - │ -32 │ table1 == table2 - │ ^^ Comparing collections of type 'sui::object_table::ObjectTable' may yield unexpected result. - │ - = Equality for collections of type 'sui::object_table::ObjectTable' IS NOT a structural check based on content - = This warning can be suppressed with '#[allow(lint(collection_equality))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99005]: possibly useless collections compare - ┌─ tests/sui_mode/linter/collection_equality.move:36:16 - │ -36 │ table1 == table2 - │ ^^ Comparing collections of type 'sui::linked_table::LinkedTable' may yield unexpected result. - │ - = Equality for collections of type 'sui::linked_table::LinkedTable' IS NOT a structural check based on content - = This warning can be suppressed with '#[allow(lint(collection_equality))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99005]: possibly useless collections compare - ┌─ tests/sui_mode/linter/collection_equality.move:40:16 - │ -40 │ table1 == table2 - │ ^^ Comparing collections of type 'sui::table_vec::TableVec' may yield unexpected result. - │ - = Equality for collections of type 'sui::table_vec::TableVec' IS NOT a structural check based on content - = This warning can be suppressed with '#[allow(lint(collection_equality))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99005]: possibly useless collections compare - ┌─ tests/sui_mode/linter/collection_equality.move:44:14 - │ -44 │ vec1 == vec2 - │ ^^ Comparing collections of type 'sui::vec_map::VecMap' may yield unexpected result. - │ - = Equality for collections of type 'sui::vec_map::VecMap' IS NOT a structural check based on content - = This warning can be suppressed with '#[allow(lint(collection_equality))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99005]: possibly useless collections compare - ┌─ tests/sui_mode/linter/collection_equality.move:48:14 - │ -48 │ vec1 == vec2 - │ ^^ Comparing collections of type 'sui::vec_set::VecSet' may yield unexpected result. - │ - = Equality for collections of type 'sui::vec_set::VecSet' IS NOT a structural check based on content - = This warning can be suppressed with '#[allow(lint(collection_equality))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/collection_equality.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/collection_equality.snap new file mode 100644 index 0000000000000..2ba01f0af9ab0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/collection_equality.snap @@ -0,0 +1,79 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/collection_equality.move +--- +warning[Lint W99005]: possibly useless collections compare + ┌─ tests/sui_mode/linter/collection_equality.move:17:14 + │ +17 │ bag1 == bag2 + │ ^^ Comparing collections of type 'sui::bag::Bag' may yield unexpected result. + │ + = Equality for collections of type 'sui::bag::Bag' IS NOT a structural check based on content + = This warning can be suppressed with '#[allow(lint(collection_equality))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99005]: possibly useless collections compare + ┌─ tests/sui_mode/linter/collection_equality.move:21:14 + │ +21 │ bag1 != bag2 + │ ^^ Comparing collections of type 'sui::object_bag::ObjectBag' may yield unexpected result. + │ + = Equality for collections of type 'sui::object_bag::ObjectBag' IS NOT a structural check based on content + = This warning can be suppressed with '#[allow(lint(collection_equality))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99005]: possibly useless collections compare + ┌─ tests/sui_mode/linter/collection_equality.move:25:16 + │ +25 │ table1 == table2 + │ ^^ Comparing collections of type 'sui::table::Table' may yield unexpected result. + │ + = Equality for collections of type 'sui::table::Table' IS NOT a structural check based on content + = This warning can be suppressed with '#[allow(lint(collection_equality))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99005]: possibly useless collections compare + ┌─ tests/sui_mode/linter/collection_equality.move:32:20 + │ +32 │ table1 == table2 + │ ^^ Comparing collections of type 'sui::object_table::ObjectTable' may yield unexpected result. + │ + = Equality for collections of type 'sui::object_table::ObjectTable' IS NOT a structural check based on content + = This warning can be suppressed with '#[allow(lint(collection_equality))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99005]: possibly useless collections compare + ┌─ tests/sui_mode/linter/collection_equality.move:36:16 + │ +36 │ table1 == table2 + │ ^^ Comparing collections of type 'sui::linked_table::LinkedTable' may yield unexpected result. + │ + = Equality for collections of type 'sui::linked_table::LinkedTable' IS NOT a structural check based on content + = This warning can be suppressed with '#[allow(lint(collection_equality))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99005]: possibly useless collections compare + ┌─ tests/sui_mode/linter/collection_equality.move:40:16 + │ +40 │ table1 == table2 + │ ^^ Comparing collections of type 'sui::table_vec::TableVec' may yield unexpected result. + │ + = Equality for collections of type 'sui::table_vec::TableVec' IS NOT a structural check based on content + = This warning can be suppressed with '#[allow(lint(collection_equality))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99005]: possibly useless collections compare + ┌─ tests/sui_mode/linter/collection_equality.move:44:14 + │ +44 │ vec1 == vec2 + │ ^^ Comparing collections of type 'sui::vec_map::VecMap' may yield unexpected result. + │ + = Equality for collections of type 'sui::vec_map::VecMap' IS NOT a structural check based on content + = This warning can be suppressed with '#[allow(lint(collection_equality))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99005]: possibly useless collections compare + ┌─ tests/sui_mode/linter/collection_equality.move:48:14 + │ +48 │ vec1 == vec2 + │ ^^ Comparing collections of type 'sui::vec_set::VecSet' may yield unexpected result. + │ + = Equality for collections of type 'sui::vec_set::VecSet' IS NOT a structural check based on content + = This warning can be suppressed with '#[allow(lint(collection_equality))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/custom_state_change.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/custom_state_change.exp deleted file mode 100644 index c011fe28efdf3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/custom_state_change.exp +++ /dev/null @@ -1,39 +0,0 @@ -warning[Lint W99002]: potentially unenforceable custom transfer/share/freeze policy - ┌─ tests/sui_mode/linter/custom_state_change.move:15:16 - │ -15 │ public fun custom_transfer_bad(o: S1, ctx: &TxContext) { - │ ^^^^^^^^^^^^^^^^^^^ - An instance of a module-private type with a 'store' ability to be transferred coming from here - │ │ - │ Potential unintended implementation of a custom transfer function. -16 │ transfer::transfer(o, tx_context::sender(ctx)) - │ -------- Instances of a type with a 'store' ability can be transferred using the 'public_transfer' function which often negates the intent of enforcing a custom transfer policy - │ - = A custom transfer policy for a given type is implemented through calling the private 'transfer' function variant in the module defining this type - = This warning can be suppressed with '#[allow(lint(custom_state_change))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99002]: potentially unenforceable custom transfer/share/freeze policy - ┌─ tests/sui_mode/linter/custom_state_change.move:20:16 - │ -20 │ public fun custom_share_bad(o: S1) { - │ ^^^^^^^^^^^^^^^^ - An instance of a module-private type with a 'store' ability to be shared coming from here - │ │ - │ Potential unintended implementation of a custom share function. -21 │ transfer::share_object(o) - │ ------------ Instances of a type with a 'store' ability can be shared using the 'public_share_object' function which often negates the intent of enforcing a custom share policy - │ - = A custom share policy for a given type is implemented through calling the private 'share_object' function variant in the module defining this type - = This warning can be suppressed with '#[allow(lint(custom_state_change))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99002]: potentially unenforceable custom transfer/share/freeze policy - ┌─ tests/sui_mode/linter/custom_state_change.move:24:16 - │ -24 │ public fun custom_freeze_bad(o: S1) { - │ ^^^^^^^^^^^^^^^^^ - An instance of a module-private type with a 'store' ability to be frozen coming from here - │ │ - │ Potential unintended implementation of a custom freeze function. -25 │ transfer::freeze_object(o) - │ ------------- Instances of a type with a 'store' ability can be frozen using the 'public_freeze_object' function which often negates the intent of enforcing a custom freeze policy - │ - = A custom freeze policy for a given type is implemented through calling the private 'freeze_object' function variant in the module defining this type - = This warning can be suppressed with '#[allow(lint(custom_state_change))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/custom_state_change.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/custom_state_change.snap new file mode 100644 index 0000000000000..b32810ed17315 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/custom_state_change.snap @@ -0,0 +1,46 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/custom_state_change.move +--- +warning[Lint W99002]: potentially unenforceable custom transfer/share/freeze policy + ┌─ tests/sui_mode/linter/custom_state_change.move:15:16 + │ +15 │ public fun custom_transfer_bad(o: S1, ctx: &TxContext) { + │ ^^^^^^^^^^^^^^^^^^^ - An instance of a module-private type with a 'store' ability to be transferred coming from here + │ │ + │ Potential unintended implementation of a custom transfer function. +16 │ transfer::transfer(o, tx_context::sender(ctx)) + │ -------- Instances of a type with a 'store' ability can be transferred using the 'public_transfer' function which often negates the intent of enforcing a custom transfer policy + │ + = A custom transfer policy for a given type is implemented through calling the private 'transfer' function variant in the module defining this type + = This warning can be suppressed with '#[allow(lint(custom_state_change))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99002]: potentially unenforceable custom transfer/share/freeze policy + ┌─ tests/sui_mode/linter/custom_state_change.move:20:16 + │ +20 │ public fun custom_share_bad(o: S1) { + │ ^^^^^^^^^^^^^^^^ - An instance of a module-private type with a 'store' ability to be shared coming from here + │ │ + │ Potential unintended implementation of a custom share function. +21 │ transfer::share_object(o) + │ ------------ Instances of a type with a 'store' ability can be shared using the 'public_share_object' function which often negates the intent of enforcing a custom share policy + │ + = A custom share policy for a given type is implemented through calling the private 'share_object' function variant in the module defining this type + = This warning can be suppressed with '#[allow(lint(custom_state_change))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99002]: potentially unenforceable custom transfer/share/freeze policy + ┌─ tests/sui_mode/linter/custom_state_change.move:24:16 + │ +24 │ public fun custom_freeze_bad(o: S1) { + │ ^^^^^^^^^^^^^^^^^ - An instance of a module-private type with a 'store' ability to be frozen coming from here + │ │ + │ Potential unintended implementation of a custom freeze function. +25 │ transfer::freeze_object(o) + │ ------------- Instances of a type with a 'store' ability can be frozen using the 'public_freeze_object' function which often negates the intent of enforcing a custom freeze policy + │ + = A custom freeze policy for a given type is implemented through calling the private 'freeze_object' function variant in the module defining this type + = This warning can be suppressed with '#[allow(lint(custom_state_change))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/edge_case_lint_missing_key.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/edge_case_lint_missing_key.snap new file mode 100644 index 0000000000000..184387c0a482f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/edge_case_lint_missing_key.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/edge_case_lint_missing_key.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/false_negative_lint_missing_key.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/false_negative_lint_missing_key.exp deleted file mode 100644 index 6162ba8ff27d4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/false_negative_lint_missing_key.exp +++ /dev/null @@ -1,10 +0,0 @@ -warning[Lint W99007]: struct with id but missing key ability - ┌─ tests/sui_mode/linter/false_negative_lint_missing_key.move:22:5 - │ -22 │ ╭ struct Wrapper { -23 │ │ id: UID, -24 │ │ } - │ ╰─────^ Struct's first field has an 'id' field of type 'sui::object::UID' but is missing the 'key' ability. - │ - = This warning can be suppressed with '#[allow(lint(missing_key))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/false_negative_lint_missing_key.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/false_negative_lint_missing_key.snap new file mode 100644 index 0000000000000..344db93af770a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/false_negative_lint_missing_key.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/false_negative_lint_missing_key.move +--- +warning[Lint W99007]: struct with id but missing key ability + ┌─ tests/sui_mode/linter/false_negative_lint_missing_key.move:22:5 + │ +22 │ ╭ struct Wrapper { +23 │ │ id: UID, +24 │ │ } + │ ╰─────^ Struct's first field has an 'id' field of type 'sui::object::UID' but is missing the 'key' ability. + │ + = This warning can be suppressed with '#[allow(lint(missing_key))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/false_positive_share_owned.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/false_positive_share_owned.exp deleted file mode 100644 index f91df3b166d3d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/false_positive_share_owned.exp +++ /dev/null @@ -1,34 +0,0 @@ -warning[Lint W99000]: possible owned object share - ┌─ tests/sui_mode/linter/false_positive_share_owned.move:12:9 - │ - 6 │ struct Obj has key, store { - │ ----- Potentially an owned object because 'store' grants access to public transfers - · -10 │ public fun arg_object(o: Obj) { - │ - A potentially owned object coming from here -11 │ let arg = o; -12 │ transfer::public_share_object(arg); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Creating a fresh object and sharing it within the same function will ensure this does not abort. - │ Potential abort from a (potentially) owned object created by a different transaction. - │ - = This warning can be suppressed with '#[allow(lint(share_owned))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99000]: possible owned object share - ┌─ tests/sui_mode/linter/false_positive_share_owned.move:42:9 - │ -30 │ fun make_obj(o: Obj2, ctx: &mut sui::tx_context::TxContext): Obj { - │ --- A potentially owned object coming from here - · -37 │ transfer::transfer(o, sui::tx_context::sender(ctx)); - │ --------------------------------------------------- Transferred as an owned object here - · -42 │ transfer::share_object(o); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Creating a fresh object and sharing it within the same function will ensure this does not abort. - │ Potential abort from a (potentially) owned object created by a different transaction. - │ - = This warning can be suppressed with '#[allow(lint(share_owned))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/false_positive_share_owned.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/false_positive_share_owned.snap new file mode 100644 index 0000000000000..0d0269a204ff7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/false_positive_share_owned.snap @@ -0,0 +1,41 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/false_positive_share_owned.move +--- +warning[Lint W99000]: possible owned object share + ┌─ tests/sui_mode/linter/false_positive_share_owned.move:12:9 + │ + 6 │ struct Obj has key, store { + │ ----- Potentially an owned object because 'store' grants access to public transfers + · +10 │ public fun arg_object(o: Obj) { + │ - A potentially owned object coming from here +11 │ let arg = o; +12 │ transfer::public_share_object(arg); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Creating a fresh object and sharing it within the same function will ensure this does not abort. + │ Potential abort from a (potentially) owned object created by a different transaction. + │ + = This warning can be suppressed with '#[allow(lint(share_owned))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99000]: possible owned object share + ┌─ tests/sui_mode/linter/false_positive_share_owned.move:42:9 + │ +30 │ fun make_obj(o: Obj2, ctx: &mut sui::tx_context::TxContext): Obj { + │ --- A potentially owned object coming from here + · +37 │ transfer::transfer(o, sui::tx_context::sender(ctx)); + │ --------------------------------------------------- Transferred as an owned object here + · +42 │ transfer::share_object(o); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Creating a fresh object and sharing it within the same function will ensure this does not abort. + │ Potential abort from a (potentially) owned object created by a different transaction. + │ + = This warning can be suppressed with '#[allow(lint(share_owned))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freeze_wrapped.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freeze_wrapped.exp deleted file mode 100644 index 2f755c3177a95..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freeze_wrapped.exp +++ /dev/null @@ -1,83 +0,0 @@ -warning[Lint W99004]: attempting to freeze wrapped objects - ┌─ tests/sui_mode/linter/freeze_wrapped.move:43:40 - │ -15 │ inner: Inner, - │ ----- The field of this type is a wrapped object - · -43 │ transfer::public_freeze_object(w); - │ ^ Freezing an object of type 'Wrapper' also freezes all objects wrapped in its field 'inner'. - │ - = This warning can be suppressed with '#[allow(lint(freeze_wrapped))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99004]: attempting to freeze wrapped objects - ┌─ tests/sui_mode/linter/freeze_wrapped.move:47:40 - │ - 9 │ struct Inner has key, store { - │ ----- Indirectly wrapped object is of this type - · -24 │ s: S, - │ - The field of this type indirectly contains a wrapped object - · -47 │ transfer::public_freeze_object(w); - │ ^ Freezing an object of type 'IndirectWrapper' also freezes all objects wrapped in its field 's'. - │ - = This warning can be suppressed with '#[allow(lint(freeze_wrapped))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99004]: attempting to freeze wrapped objects - ┌─ tests/sui_mode/linter/freeze_wrapped.move:52:40 - │ -15 │ inner: Inner, - │ ----- The field of this type is a wrapped object - · -52 │ transfer::public_freeze_object(v); - │ ^ Freezing an object of type 'Wrapper' also freezes all objects wrapped in its field 'inner'. - │ - = This warning can be suppressed with '#[allow(lint(freeze_wrapped))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99004]: attempting to freeze wrapped objects - ┌─ tests/sui_mode/linter/freeze_wrapped.move:56:40 - │ -29 │ inner: T, - │ - The field of this type is a wrapped object - · -56 │ transfer::public_freeze_object(w); - │ ^ Freezing an object of type 'GenWrapper' also freezes all objects wrapped in its field 'inner'. - │ - = This warning can be suppressed with '#[allow(lint(freeze_wrapped))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99004]: attempting to freeze wrapped objects - ┌─ tests/sui_mode/linter/freeze_wrapped.move:60:40 - │ -32 │ struct S2 has store { - │ - Indirectly wrapped object is of this type - · -38 │ inner: S2, - │ ----- The field of this type indirectly contains a wrapped object - · -60 │ transfer::public_freeze_object(w); - │ ^ Freezing an object of type 'IndirectGenWrapper' also freezes all objects wrapped in its field 'inner'. - │ - = This warning can be suppressed with '#[allow(lint(freeze_wrapped))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99004]: attempting to freeze wrapped objects - ┌─ tests/sui_mode/linter/freeze_wrapped.move:64:40 - │ -15 │ inner: Inner, - │ ----- The field of this type is a wrapped object - · -64 │ transfer::public_freeze_object({ transfer::public_freeze_object(w1) ; w2}); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Freezing an object of type 'Wrapper' also freezes all objects wrapped in its field 'inner'. - │ - = This warning can be suppressed with '#[allow(lint(freeze_wrapped))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99004]: attempting to freeze wrapped objects - ┌─ tests/sui_mode/linter/freeze_wrapped.move:64:73 - │ -15 │ inner: Inner, - │ ----- The field of this type is a wrapped object - · -64 │ transfer::public_freeze_object({ transfer::public_freeze_object(w1) ; w2}); - │ ^^ Freezing an object of type 'Wrapper' also freezes all objects wrapped in its field 'inner'. - │ - = This warning can be suppressed with '#[allow(lint(freeze_wrapped))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freeze_wrapped.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freeze_wrapped.snap new file mode 100644 index 0000000000000..edcd2b21612e3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freeze_wrapped.snap @@ -0,0 +1,90 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/freeze_wrapped.move +--- +warning[Lint W99004]: attempting to freeze wrapped objects + ┌─ tests/sui_mode/linter/freeze_wrapped.move:43:40 + │ +15 │ inner: Inner, + │ ----- The field of this type is a wrapped object + · +43 │ transfer::public_freeze_object(w); + │ ^ Freezing an object of type 'Wrapper' also freezes all objects wrapped in its field 'inner'. + │ + = This warning can be suppressed with '#[allow(lint(freeze_wrapped))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99004]: attempting to freeze wrapped objects + ┌─ tests/sui_mode/linter/freeze_wrapped.move:47:40 + │ + 9 │ struct Inner has key, store { + │ ----- Indirectly wrapped object is of this type + · +24 │ s: S, + │ - The field of this type indirectly contains a wrapped object + · +47 │ transfer::public_freeze_object(w); + │ ^ Freezing an object of type 'IndirectWrapper' also freezes all objects wrapped in its field 's'. + │ + = This warning can be suppressed with '#[allow(lint(freeze_wrapped))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99004]: attempting to freeze wrapped objects + ┌─ tests/sui_mode/linter/freeze_wrapped.move:52:40 + │ +15 │ inner: Inner, + │ ----- The field of this type is a wrapped object + · +52 │ transfer::public_freeze_object(v); + │ ^ Freezing an object of type 'Wrapper' also freezes all objects wrapped in its field 'inner'. + │ + = This warning can be suppressed with '#[allow(lint(freeze_wrapped))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99004]: attempting to freeze wrapped objects + ┌─ tests/sui_mode/linter/freeze_wrapped.move:56:40 + │ +29 │ inner: T, + │ - The field of this type is a wrapped object + · +56 │ transfer::public_freeze_object(w); + │ ^ Freezing an object of type 'GenWrapper' also freezes all objects wrapped in its field 'inner'. + │ + = This warning can be suppressed with '#[allow(lint(freeze_wrapped))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99004]: attempting to freeze wrapped objects + ┌─ tests/sui_mode/linter/freeze_wrapped.move:60:40 + │ +32 │ struct S2 has store { + │ - Indirectly wrapped object is of this type + · +38 │ inner: S2, + │ ----- The field of this type indirectly contains a wrapped object + · +60 │ transfer::public_freeze_object(w); + │ ^ Freezing an object of type 'IndirectGenWrapper' also freezes all objects wrapped in its field 'inner'. + │ + = This warning can be suppressed with '#[allow(lint(freeze_wrapped))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99004]: attempting to freeze wrapped objects + ┌─ tests/sui_mode/linter/freeze_wrapped.move:64:40 + │ +15 │ inner: Inner, + │ ----- The field of this type is a wrapped object + · +64 │ transfer::public_freeze_object({ transfer::public_freeze_object(w1) ; w2}); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Freezing an object of type 'Wrapper' also freezes all objects wrapped in its field 'inner'. + │ + = This warning can be suppressed with '#[allow(lint(freeze_wrapped))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99004]: attempting to freeze wrapped objects + ┌─ tests/sui_mode/linter/freeze_wrapped.move:64:73 + │ +15 │ inner: Inner, + │ ----- The field of this type is a wrapped object + · +64 │ transfer::public_freeze_object({ transfer::public_freeze_object(w1) ; w2}); + │ ^^ Freezing an object of type 'Wrapper' also freezes all objects wrapped in its field 'inner'. + │ + = This warning can be suppressed with '#[allow(lint(freeze_wrapped))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_false_negatives.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_false_negatives.snap new file mode 100644 index 0000000000000..1f2d5812d700b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_false_negatives.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/freezing_capability_false_negatives.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_false_positives.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_false_positives.exp deleted file mode 100644 index fad2409846d1c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_false_positives.exp +++ /dev/null @@ -1,18 +0,0 @@ -warning[Lint W99008]: freezing potential capability - ┌─ tests/sui_mode/linter/freezing_capability_false_positives.move:25:9 - │ -25 │ transfer::public_freeze_object(w); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The type 'a::test_false_positives::NoCap' is potentially a capability based on its name - │ - = Freezing a capability might lock out critical operations or otherwise open access to operations that otherwise should be restricted - = This warning can be suppressed with '#[allow(lint(freezing_capability))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99008]: freezing potential capability - ┌─ tests/sui_mode/linter/freezing_capability_false_positives.move:29:9 - │ -29 │ transfer::public_freeze_object(w); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The type 'a::test_false_positives::CapAndHat' is potentially a capability based on its name - │ - = Freezing a capability might lock out critical operations or otherwise open access to operations that otherwise should be restricted - = This warning can be suppressed with '#[allow(lint(freezing_capability))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_false_positives.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_false_positives.snap new file mode 100644 index 0000000000000..787c3ec6f1a9c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_false_positives.snap @@ -0,0 +1,25 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/freezing_capability_false_positives.move +--- +warning[Lint W99008]: freezing potential capability + ┌─ tests/sui_mode/linter/freezing_capability_false_positives.move:25:9 + │ +25 │ transfer::public_freeze_object(w); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The type 'a::test_false_positives::NoCap' is potentially a capability based on its name + │ + = Freezing a capability might lock out critical operations or otherwise open access to operations that otherwise should be restricted + = This warning can be suppressed with '#[allow(lint(freezing_capability))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99008]: freezing potential capability + ┌─ tests/sui_mode/linter/freezing_capability_false_positives.move:29:9 + │ +29 │ transfer::public_freeze_object(w); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The type 'a::test_false_positives::CapAndHat' is potentially a capability based on its name + │ + = Freezing a capability might lock out critical operations or otherwise open access to operations that otherwise should be restricted + = This warning can be suppressed with '#[allow(lint(freezing_capability))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_suppression.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_suppression.snap new file mode 100644 index 0000000000000..d472e7e913b3d --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_suppression.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/freezing_capability_suppression.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_true_negatives.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_true_negatives.snap new file mode 100644 index 0000000000000..5dda7da633a9c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_true_negatives.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/freezing_capability_true_negatives.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_true_positives.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_true_positives.exp deleted file mode 100644 index 78c5b8538a69c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_true_positives.exp +++ /dev/null @@ -1,27 +0,0 @@ -warning[Lint W99008]: freezing potential capability - ┌─ tests/sui_mode/linter/freezing_capability_true_positives.move:21:9 - │ -21 │ transfer::public_freeze_object(w); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The type 'a::test_true_positives::AdminCap' is potentially a capability based on its name - │ - = Freezing a capability might lock out critical operations or otherwise open access to operations that otherwise should be restricted - = This warning can be suppressed with '#[allow(lint(freezing_capability))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99008]: freezing potential capability - ┌─ tests/sui_mode/linter/freezing_capability_true_positives.move:25:9 - │ -25 │ transfer::public_freeze_object(w); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The type 'a::test_true_positives::UserCapability' is potentially a capability based on its name - │ - = Freezing a capability might lock out critical operations or otherwise open access to operations that otherwise should be restricted - = This warning can be suppressed with '#[allow(lint(freezing_capability))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99008]: freezing potential capability - ┌─ tests/sui_mode/linter/freezing_capability_true_positives.move:29:9 - │ -29 │ transfer::public_freeze_object(w); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The type 'a::test_true_positives::OwnerCapV2' is potentially a capability based on its name - │ - = Freezing a capability might lock out critical operations or otherwise open access to operations that otherwise should be restricted - = This warning can be suppressed with '#[allow(lint(freezing_capability))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_true_positives.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_true_positives.snap new file mode 100644 index 0000000000000..3d4fce36cbfa3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/freezing_capability_true_positives.snap @@ -0,0 +1,34 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/freezing_capability_true_positives.move +--- +warning[Lint W99008]: freezing potential capability + ┌─ tests/sui_mode/linter/freezing_capability_true_positives.move:21:9 + │ +21 │ transfer::public_freeze_object(w); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The type 'a::test_true_positives::AdminCap' is potentially a capability based on its name + │ + = Freezing a capability might lock out critical operations or otherwise open access to operations that otherwise should be restricted + = This warning can be suppressed with '#[allow(lint(freezing_capability))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99008]: freezing potential capability + ┌─ tests/sui_mode/linter/freezing_capability_true_positives.move:25:9 + │ +25 │ transfer::public_freeze_object(w); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The type 'a::test_true_positives::UserCapability' is potentially a capability based on its name + │ + = Freezing a capability might lock out critical operations or otherwise open access to operations that otherwise should be restricted + = This warning can be suppressed with '#[allow(lint(freezing_capability))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99008]: freezing potential capability + ┌─ tests/sui_mode/linter/freezing_capability_true_positives.move:29:9 + │ +29 │ transfer::public_freeze_object(w); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The type 'a::test_true_positives::OwnerCapV2' is potentially a capability based on its name + │ + = Freezing a capability might lock out critical operations or otherwise open access to operations that otherwise should be restricted + = This warning can be suppressed with '#[allow(lint(freezing_capability))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/lint_all_syntax.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/lint_all_syntax.snap new file mode 100644 index 0000000000000..3add5b50bed0f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/lint_all_syntax.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/lint_all_syntax.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/lint_all_syntax_missing.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/lint_all_syntax_missing.exp deleted file mode 100644 index c5f3f3686e21d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/lint_all_syntax_missing.exp +++ /dev/null @@ -1,6 +0,0 @@ -warning[W10007]: issue with attribute value - ┌─ tests/sui_mode/linter/lint_all_syntax_missing.move:2:14 - │ -2 │ #[lint_allow(x)] - │ ^ Unknown warning filter 'lint_allow(x)' - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/lint_all_syntax_missing.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/lint_all_syntax_missing.snap new file mode 100644 index 0000000000000..0ec60e06efcff --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/lint_all_syntax_missing.snap @@ -0,0 +1,13 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/lint_all_syntax_missing.move +--- +warning[W10007]: issue with attribute value + ┌─ tests/sui_mode/linter/lint_all_syntax_missing.move:2:14 + │ +2 │ #[lint_allow(x)] + │ ^ Unknown warning filter 'lint_allow(x)' diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/lint_does_not_suppress_compiler_warnings.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/lint_does_not_suppress_compiler_warnings.snap new file mode 100644 index 0000000000000..98c133e44e250 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/lint_does_not_suppress_compiler_warnings.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/lint_does_not_suppress_compiler_warnings.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/no_trigger_lint_missing_key.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/no_trigger_lint_missing_key.snap new file mode 100644 index 0000000000000..345d614c382b1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/no_trigger_lint_missing_key.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/no_trigger_lint_missing_key.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/public_random_invalid.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/public_random_invalid.exp deleted file mode 100644 index 22d654c03279d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/public_random_invalid.exp +++ /dev/null @@ -1,50 +0,0 @@ -warning[Lint W99006]: Risky use of 'sui::random' - ┌─ tests/sui_mode/linter/public_random_invalid.move:7:42 - │ -7 │ public fun not_allowed1(_x: u64, _r: &Random) {} - │ ^^^^^^^ 'public' function 'not_allowed1' accepts 'Random' as a parameter - │ - = Functions that accept 'sui::random::Random' as a parameter might be abused by attackers by inspecting the results of randomness - = Non-public functions are preferred - = This warning can be suppressed with '#[allow(lint(public_random))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99006]: Risky use of 'sui::random' - ┌─ tests/sui_mode/linter/public_random_invalid.move:8:34 - │ -8 │ public fun not_allowed2(_rg: &RandomGenerator, _x: u64) {} - │ ^^^^^^^^^^^^^^^^ 'public' function 'not_allowed2' accepts 'RandomGenerator' as a parameter - │ - = Functions that accept 'sui::random::RandomGenerator' as a parameter might be abused by attackers by inspecting the results of randomness - = Non-public functions are preferred - = This warning can be suppressed with '#[allow(lint(public_random))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99006]: Risky use of 'sui::random' - ┌─ tests/sui_mode/linter/public_random_invalid.move:9:33 - │ -9 │ public fun not_allowed3(_r: &Random, _rg: &RandomGenerator, _x: u64) {} - │ ^^^^^^^ 'public' function 'not_allowed3' accepts 'Random' as a parameter - │ - = Functions that accept 'sui::random::Random' as a parameter might be abused by attackers by inspecting the results of randomness - = Non-public functions are preferred - = This warning can be suppressed with '#[allow(lint(public_random))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99006]: Risky use of 'sui::random' - ┌─ tests/sui_mode/linter/public_random_invalid.move:9:47 - │ -9 │ public fun not_allowed3(_r: &Random, _rg: &RandomGenerator, _x: u64) {} - │ ^^^^^^^^^^^^^^^^ 'public' function 'not_allowed3' accepts 'RandomGenerator' as a parameter - │ - = Functions that accept 'sui::random::RandomGenerator' as a parameter might be abused by attackers by inspecting the results of randomness - = Non-public functions are preferred - = This warning can be suppressed with '#[allow(lint(public_random))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99006]: Risky use of 'sui::random' - ┌─ tests/sui_mode/linter/public_random_invalid.move:10:48 - │ -10 │ public entry fun not_allowed4(_x: u64, _r: &Random, _y: u64) {} - │ ^^^^^^^ 'public' function 'not_allowed4' accepts 'Random' as a parameter - │ - = Functions that accept 'sui::random::Random' as a parameter might be abused by attackers by inspecting the results of randomness - = Non-public functions are preferred - = This warning can be suppressed with '#[allow(lint(public_random))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/public_random_invalid.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/public_random_invalid.snap new file mode 100644 index 0000000000000..00b528ea0f56c --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/public_random_invalid.snap @@ -0,0 +1,57 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/public_random_invalid.move +--- +warning[Lint W99006]: Risky use of 'sui::random' + ┌─ tests/sui_mode/linter/public_random_invalid.move:7:42 + │ +7 │ public fun not_allowed1(_x: u64, _r: &Random) {} + │ ^^^^^^^ 'public' function 'not_allowed1' accepts 'Random' as a parameter + │ + = Functions that accept 'sui::random::Random' as a parameter might be abused by attackers by inspecting the results of randomness + = Non-public functions are preferred + = This warning can be suppressed with '#[allow(lint(public_random))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99006]: Risky use of 'sui::random' + ┌─ tests/sui_mode/linter/public_random_invalid.move:8:34 + │ +8 │ public fun not_allowed2(_rg: &RandomGenerator, _x: u64) {} + │ ^^^^^^^^^^^^^^^^ 'public' function 'not_allowed2' accepts 'RandomGenerator' as a parameter + │ + = Functions that accept 'sui::random::RandomGenerator' as a parameter might be abused by attackers by inspecting the results of randomness + = Non-public functions are preferred + = This warning can be suppressed with '#[allow(lint(public_random))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99006]: Risky use of 'sui::random' + ┌─ tests/sui_mode/linter/public_random_invalid.move:9:33 + │ +9 │ public fun not_allowed3(_r: &Random, _rg: &RandomGenerator, _x: u64) {} + │ ^^^^^^^ 'public' function 'not_allowed3' accepts 'Random' as a parameter + │ + = Functions that accept 'sui::random::Random' as a parameter might be abused by attackers by inspecting the results of randomness + = Non-public functions are preferred + = This warning can be suppressed with '#[allow(lint(public_random))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99006]: Risky use of 'sui::random' + ┌─ tests/sui_mode/linter/public_random_invalid.move:9:47 + │ +9 │ public fun not_allowed3(_r: &Random, _rg: &RandomGenerator, _x: u64) {} + │ ^^^^^^^^^^^^^^^^ 'public' function 'not_allowed3' accepts 'RandomGenerator' as a parameter + │ + = Functions that accept 'sui::random::RandomGenerator' as a parameter might be abused by attackers by inspecting the results of randomness + = Non-public functions are preferred + = This warning can be suppressed with '#[allow(lint(public_random))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99006]: Risky use of 'sui::random' + ┌─ tests/sui_mode/linter/public_random_invalid.move:10:48 + │ +10 │ public entry fun not_allowed4(_x: u64, _r: &Random, _y: u64) {} + │ ^^^^^^^ 'public' function 'not_allowed4' accepts 'Random' as a parameter + │ + = Functions that accept 'sui::random::Random' as a parameter might be abused by attackers by inspecting the results of randomness + = Non-public functions are preferred + = This warning can be suppressed with '#[allow(lint(public_random))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/public_random_valid.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/public_random_valid.snap new file mode 100644 index 0000000000000..4baa071527501 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/public_random_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/public_random_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/self_transfer.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/self_transfer.exp deleted file mode 100644 index 039f255b61ce3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/self_transfer.exp +++ /dev/null @@ -1,39 +0,0 @@ -warning[Lint W99001]: non-composable transfer to sender - ┌─ tests/sui_mode/linter/self_transfer.move:23:9 - │ -22 │ public fun public_transfer_bad(ctx: &mut TxContext) { - │ ------------------- Returning an object from a function, allows a caller to use the object and enables composability via programmable transactions. -23 │ transfer::public_transfer(S1 { id: object::new(ctx), }, tx_context::sender(ctx)) - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Transaction sender address coming from here - │ Transfer of an object to transaction sender address - │ - = This warning can be suppressed with '#[allow(lint(self_transfer))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99001]: non-composable transfer to sender - ┌─ tests/sui_mode/linter/self_transfer.move:27:9 - │ -26 │ public fun private_transfer_bad(ctx: &mut TxContext) { - │ -------------------- Returning an object from a function, allows a caller to use the object and enables composability via programmable transactions. -27 │ transfer::transfer(S1 { id: object::new(ctx), }, tx_context::sender(ctx)) - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Transaction sender address coming from here - │ Transfer of an object to transaction sender address - │ - = This warning can be suppressed with '#[allow(lint(self_transfer))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99001]: non-composable transfer to sender - ┌─ tests/sui_mode/linter/self_transfer.move:39:9 - │ -36 │ public fun transfer_through_assigns_bad(ctx: &mut TxContext) { - │ ---------------------------- Returning an object from a function, allows a caller to use the object and enables composability via programmable transactions. -37 │ let sender = tx_context::sender(ctx); - │ ----------------------- Transaction sender address coming from here -38 │ let another_sender = sender; -39 │ transfer::public_transfer(S1 { id: object::new(ctx), }, another_sender) - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Transfer of an object to transaction sender address - │ - = This warning can be suppressed with '#[allow(lint(self_transfer))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/self_transfer.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/self_transfer.snap new file mode 100644 index 0000000000000..f313a552ed4be --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/self_transfer.snap @@ -0,0 +1,46 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/self_transfer.move +--- +warning[Lint W99001]: non-composable transfer to sender + ┌─ tests/sui_mode/linter/self_transfer.move:23:9 + │ +22 │ public fun public_transfer_bad(ctx: &mut TxContext) { + │ ------------------- Returning an object from a function, allows a caller to use the object and enables composability via programmable transactions. +23 │ transfer::public_transfer(S1 { id: object::new(ctx), }, tx_context::sender(ctx)) + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Transaction sender address coming from here + │ Transfer of an object to transaction sender address + │ + = This warning can be suppressed with '#[allow(lint(self_transfer))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99001]: non-composable transfer to sender + ┌─ tests/sui_mode/linter/self_transfer.move:27:9 + │ +26 │ public fun private_transfer_bad(ctx: &mut TxContext) { + │ -------------------- Returning an object from a function, allows a caller to use the object and enables composability via programmable transactions. +27 │ transfer::transfer(S1 { id: object::new(ctx), }, tx_context::sender(ctx)) + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Transaction sender address coming from here + │ Transfer of an object to transaction sender address + │ + = This warning can be suppressed with '#[allow(lint(self_transfer))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99001]: non-composable transfer to sender + ┌─ tests/sui_mode/linter/self_transfer.move:39:9 + │ +36 │ public fun transfer_through_assigns_bad(ctx: &mut TxContext) { + │ ---------------------------- Returning an object from a function, allows a caller to use the object and enables composability via programmable transactions. +37 │ let sender = tx_context::sender(ctx); + │ ----------------------- Transaction sender address coming from here +38 │ let another_sender = sender; +39 │ transfer::public_transfer(S1 { id: object::new(ctx), }, another_sender) + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Transfer of an object to transaction sender address + │ + = This warning can be suppressed with '#[allow(lint(self_transfer))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/suppress_lint_missing_key.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/suppress_lint_missing_key.snap new file mode 100644 index 0000000000000..081b0c73fceae --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/suppress_lint_missing_key.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/suppress_lint_missing_key.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/suppress_public_mut_tx_context.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/suppress_public_mut_tx_context.snap new file mode 100644 index 0000000000000..2ef58f5d6210e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/suppress_public_mut_tx_context.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/suppress_public_mut_tx_context.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/trigger_lint_missing_key.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/trigger_lint_missing_key.exp deleted file mode 100644 index 243ce11581d70..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/trigger_lint_missing_key.exp +++ /dev/null @@ -1,10 +0,0 @@ -warning[Lint W99007]: struct with id but missing key ability - ┌─ tests/sui_mode/linter/trigger_lint_missing_key.move:5:5 - │ -5 │ ╭ struct MissingKeyAbility { -6 │ │ id: UID, -7 │ │ } - │ ╰─────^ Struct's first field has an 'id' field of type 'sui::object::UID' but is missing the 'key' ability. - │ - = This warning can be suppressed with '#[allow(lint(missing_key))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/trigger_lint_missing_key.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/trigger_lint_missing_key.snap new file mode 100644 index 0000000000000..bc416b2975450 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/trigger_lint_missing_key.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/trigger_lint_missing_key.move +--- +warning[Lint W99007]: struct with id but missing key ability + ┌─ tests/sui_mode/linter/trigger_lint_missing_key.move:5:5 + │ +5 │ ╭ struct MissingKeyAbility { +6 │ │ id: UID, +7 │ │ } + │ ╰─────^ Struct's first field has an 'id' field of type 'sui::object::UID' but is missing the 'key' ability. + │ + = This warning can be suppressed with '#[allow(lint(missing_key))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/true_negative_public_mut_tx_context.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/true_negative_public_mut_tx_context.snap new file mode 100644 index 0000000000000..2780b0f7c2c9e --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/true_negative_public_mut_tx_context.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/true_negative_public_mut_tx_context.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/true_negative_share_owned.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/true_negative_share_owned.snap new file mode 100644 index 0000000000000..bc2dc26f600ac --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/true_negative_share_owned.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/true_negative_share_owned.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/true_positive_public_mut_tx_context.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/true_positive_public_mut_tx_context.exp deleted file mode 100644 index 981d0e737b750..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/true_positive_public_mut_tx_context.exp +++ /dev/null @@ -1,36 +0,0 @@ -warning[Lint W99009]: prefer '&mut TxContext' over '&TxContext' - ┌─ tests/sui_mode/linter/true_positive_public_mut_tx_context.move:8:37 - │ -8 │ public fun incorrect_mint(_ctx: &TxContext) { - │ ^^^^^^^^^^ 'public' functions should prefer '&mut TxContext' over '&TxContext' for better upgradability. - │ - = When upgrading, the public function cannot be modified to take '&mut TxContext' instead of '&TxContext'. As such, it is recommended to consider using '&mut TxContext' to future-proof the function. - = This warning can be suppressed with '#[allow(lint(prefer_mut_tx_context))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99009]: prefer '&mut TxContext' over '&TxContext' - ┌─ tests/sui_mode/linter/true_positive_public_mut_tx_context.move:11:47 - │ -11 │ public fun another_incorrect(_a: u64, _b: &TxContext, _c: u64) { - │ ^^^^^^^^^^ 'public' functions should prefer '&mut TxContext' over '&TxContext' for better upgradability. - │ - = When upgrading, the public function cannot be modified to take '&mut TxContext' instead of '&TxContext'. As such, it is recommended to consider using '&mut TxContext' to future-proof the function. - = This warning can be suppressed with '#[allow(lint(prefer_mut_tx_context))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99009]: prefer '&mut TxContext' over '&TxContext' - ┌─ tests/sui_mode/linter/true_positive_public_mut_tx_context.move:14:54 - │ -14 │ public fun mixed_function(_a: &CustomStruct, _b: &TxContext, _c: &mut TxContext) {} - │ ^^^^^^^^^^ 'public' functions should prefer '&mut TxContext' over '&TxContext' for better upgradability. - │ - = When upgrading, the public function cannot be modified to take '&mut TxContext' instead of '&TxContext'. As such, it is recommended to consider using '&mut TxContext' to future-proof the function. - = This warning can be suppressed with '#[allow(lint(prefer_mut_tx_context))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99009]: prefer '&mut TxContext' over '&TxContext' - ┌─ tests/sui_mode/linter/true_positive_public_mut_tx_context.move:20:13 - │ -20 │ _b: &TxContext, // Should warn - │ ^^^^^^^^^^ 'public' functions should prefer '&mut TxContext' over '&TxContext' for better upgradability. - │ - = When upgrading, the public function cannot be modified to take '&mut TxContext' instead of '&TxContext'. As such, it is recommended to consider using '&mut TxContext' to future-proof the function. - = This warning can be suppressed with '#[allow(lint(prefer_mut_tx_context))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/true_positive_public_mut_tx_context.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/true_positive_public_mut_tx_context.snap new file mode 100644 index 0000000000000..6dcf1e2ed3c1a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/true_positive_public_mut_tx_context.snap @@ -0,0 +1,43 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/true_positive_public_mut_tx_context.move +--- +warning[Lint W99009]: prefer '&mut TxContext' over '&TxContext' + ┌─ tests/sui_mode/linter/true_positive_public_mut_tx_context.move:8:37 + │ +8 │ public fun incorrect_mint(_ctx: &TxContext) { + │ ^^^^^^^^^^ 'public' functions should prefer '&mut TxContext' over '&TxContext' for better upgradability. + │ + = When upgrading, the public function cannot be modified to take '&mut TxContext' instead of '&TxContext'. As such, it is recommended to consider using '&mut TxContext' to future-proof the function. + = This warning can be suppressed with '#[allow(lint(prefer_mut_tx_context))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99009]: prefer '&mut TxContext' over '&TxContext' + ┌─ tests/sui_mode/linter/true_positive_public_mut_tx_context.move:11:47 + │ +11 │ public fun another_incorrect(_a: u64, _b: &TxContext, _c: u64) { + │ ^^^^^^^^^^ 'public' functions should prefer '&mut TxContext' over '&TxContext' for better upgradability. + │ + = When upgrading, the public function cannot be modified to take '&mut TxContext' instead of '&TxContext'. As such, it is recommended to consider using '&mut TxContext' to future-proof the function. + = This warning can be suppressed with '#[allow(lint(prefer_mut_tx_context))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99009]: prefer '&mut TxContext' over '&TxContext' + ┌─ tests/sui_mode/linter/true_positive_public_mut_tx_context.move:14:54 + │ +14 │ public fun mixed_function(_a: &CustomStruct, _b: &TxContext, _c: &mut TxContext) {} + │ ^^^^^^^^^^ 'public' functions should prefer '&mut TxContext' over '&TxContext' for better upgradability. + │ + = When upgrading, the public function cannot be modified to take '&mut TxContext' instead of '&TxContext'. As such, it is recommended to consider using '&mut TxContext' to future-proof the function. + = This warning can be suppressed with '#[allow(lint(prefer_mut_tx_context))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99009]: prefer '&mut TxContext' over '&TxContext' + ┌─ tests/sui_mode/linter/true_positive_public_mut_tx_context.move:20:13 + │ +20 │ _b: &TxContext, // Should warn + │ ^^^^^^^^^^ 'public' functions should prefer '&mut TxContext' over '&TxContext' for better upgradability. + │ + = When upgrading, the public function cannot be modified to take '&mut TxContext' instead of '&TxContext'. As such, it is recommended to consider using '&mut TxContext' to future-proof the function. + = This warning can be suppressed with '#[allow(lint(prefer_mut_tx_context))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/true_positive_share_owned.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/true_positive_share_owned.exp deleted file mode 100644 index 8ee1b12fc86a6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/true_positive_share_owned.exp +++ /dev/null @@ -1,34 +0,0 @@ -warning[Lint W99000]: possible owned object share - ┌─ tests/sui_mode/linter/true_positive_share_owned.move:17:9 - │ - 7 │ struct Obj has key, store { - │ ----- Potentially an owned object because 'store' grants access to public transfers - · -15 │ public fun share(o: Obj) { - │ - A potentially owned object coming from here -16 │ let arg = o; -17 │ transfer::public_share_object(arg); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Creating a fresh object and sharing it within the same function will ensure this does not abort. - │ Potential abort from a (potentially) owned object created by a different transaction. - │ - = This warning can be suppressed with '#[allow(lint(share_owned))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[Lint W99000]: possible owned object share - ┌─ tests/sui_mode/linter/true_positive_share_owned.move:42:9 - │ -37 │ transfer::transfer(arg, tx_context::sender(ctx)); - │ ------------------------------------------------ Transferred as an owned object here - · -40 │ public fun share(o: Obj) { - │ - A potentially owned object coming from here -41 │ let arg = o; -42 │ transfer::share_object(arg); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ │ - │ │ Creating a fresh object and sharing it within the same function will ensure this does not abort. - │ Potential abort from a (potentially) owned object created by a different transaction. - │ - = This warning can be suppressed with '#[allow(lint(share_owned))]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/linter/true_positive_share_owned.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/true_positive_share_owned.snap new file mode 100644 index 0000000000000..c2094d6f1526f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/linter/true_positive_share_owned.snap @@ -0,0 +1,41 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: true +input_file: crates/move-compiler/tests/sui_mode/linter/true_positive_share_owned.move +--- +warning[Lint W99000]: possible owned object share + ┌─ tests/sui_mode/linter/true_positive_share_owned.move:17:9 + │ + 7 │ struct Obj has key, store { + │ ----- Potentially an owned object because 'store' grants access to public transfers + · +15 │ public fun share(o: Obj) { + │ - A potentially owned object coming from here +16 │ let arg = o; +17 │ transfer::public_share_object(arg); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Creating a fresh object and sharing it within the same function will ensure this does not abort. + │ Potential abort from a (potentially) owned object created by a different transaction. + │ + = This warning can be suppressed with '#[allow(lint(share_owned))]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[Lint W99000]: possible owned object share + ┌─ tests/sui_mode/linter/true_positive_share_owned.move:42:9 + │ +37 │ transfer::transfer(arg, tx_context::sender(ctx)); + │ ------------------------------------------------ Transferred as an owned object here + · +40 │ public fun share(o: Obj) { + │ - A potentially owned object coming from here +41 │ let arg = o; +42 │ transfer::share_object(arg); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + │ │ │ + │ │ Creating a fresh object and sharing it within the same function will ensure this does not abort. + │ Potential abort from a (potentially) owned object created by a different transaction. + │ + = This warning can be suppressed with '#[allow(lint(share_owned))]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/move_2024/expansion/implicit_sui_aliases.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/move_2024/expansion/implicit_sui_aliases.snap new file mode 100644 index 0000000000000..c9d1b730bf6b3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/move_2024/expansion/implicit_sui_aliases.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/sui_mode/move_2024/expansion/implicit_sui_aliases.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/move_2024/expansion/unnecessary_alias_default.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/move_2024/expansion/unnecessary_alias_default.exp deleted file mode 100644 index d139b60df2346..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/move_2024/expansion/unnecessary_alias_default.exp +++ /dev/null @@ -1,96 +0,0 @@ -warning[W02021]: duplicate alias - ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:11:23 - │ -11 │ use sui::object::{Self, ID, UID}; - │ ^^^^ Unnecessary alias 'object' for module 'sui::object'. This alias is provided by default - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:11:23 - │ -11 │ use sui::object::{Self, ID, UID}; - │ ^^^^ Unused 'use' of alias 'object'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W02021]: duplicate alias - ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:11:29 - │ -11 │ use sui::object::{Self, ID, UID}; - │ ^^ Unnecessary alias 'ID' for module member 'sui::object::ID'. This alias is provided by default - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:11:29 - │ -11 │ use sui::object::{Self, ID, UID}; - │ ^^ Unused 'use' of alias 'ID'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W02021]: duplicate alias - ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:11:33 - │ -11 │ use sui::object::{Self, ID, UID}; - │ ^^^ Unnecessary alias 'UID' for module member 'sui::object::UID'. This alias is provided by default - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:11:33 - │ -11 │ use sui::object::{Self, ID, UID}; - │ ^^^ Unused 'use' of alias 'UID'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W02021]: duplicate alias - ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:12:14 - │ -12 │ use sui::transfer; - │ ^^^^^^^^ Unnecessary alias 'transfer' for module 'sui::transfer'. This alias is provided by default - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:12:14 - │ -12 │ use sui::transfer; - │ ^^^^^^^^ Unused 'use' of alias 'transfer'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W02021]: duplicate alias - ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:13:27 - │ -13 │ use sui::tx_context::{Self, TxContext}; - │ ^^^^ Unnecessary alias 'tx_context' for module 'sui::tx_context'. This alias is provided by default - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:13:27 - │ -13 │ use sui::tx_context::{Self, TxContext}; - │ ^^^^ Unused 'use' of alias 'tx_context'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W02021]: duplicate alias - ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:13:33 - │ -13 │ use sui::tx_context::{Self, TxContext}; - │ ^^^^^^^^^ Unnecessary alias 'TxContext' for module member 'sui::tx_context::TxContext'. This alias is provided by default - │ - = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - -warning[W09001]: unused alias - ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:13:33 - │ -13 │ use sui::tx_context::{Self, TxContext}; - │ ^^^^^^^^^ Unused 'use' of alias 'TxContext'. Consider removing it - │ - = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/move_2024/expansion/unnecessary_alias_default.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/move_2024/expansion/unnecessary_alias_default.snap new file mode 100644 index 0000000000000..69059bf8c94aa --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/move_2024/expansion/unnecessary_alias_default.snap @@ -0,0 +1,103 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move +--- +warning[W02021]: duplicate alias + ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:11:23 + │ +11 │ use sui::object::{Self, ID, UID}; + │ ^^^^ Unnecessary alias 'object' for module 'sui::object'. This alias is provided by default + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:11:23 + │ +11 │ use sui::object::{Self, ID, UID}; + │ ^^^^ Unused 'use' of alias 'object'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W02021]: duplicate alias + ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:11:29 + │ +11 │ use sui::object::{Self, ID, UID}; + │ ^^ Unnecessary alias 'ID' for module member 'sui::object::ID'. This alias is provided by default + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:11:29 + │ +11 │ use sui::object::{Self, ID, UID}; + │ ^^ Unused 'use' of alias 'ID'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W02021]: duplicate alias + ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:11:33 + │ +11 │ use sui::object::{Self, ID, UID}; + │ ^^^ Unnecessary alias 'UID' for module member 'sui::object::UID'. This alias is provided by default + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:11:33 + │ +11 │ use sui::object::{Self, ID, UID}; + │ ^^^ Unused 'use' of alias 'UID'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W02021]: duplicate alias + ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:12:14 + │ +12 │ use sui::transfer; + │ ^^^^^^^^ Unnecessary alias 'transfer' for module 'sui::transfer'. This alias is provided by default + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:12:14 + │ +12 │ use sui::transfer; + │ ^^^^^^^^ Unused 'use' of alias 'transfer'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W02021]: duplicate alias + ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:13:27 + │ +13 │ use sui::tx_context::{Self, TxContext}; + │ ^^^^ Unnecessary alias 'tx_context' for module 'sui::tx_context'. This alias is provided by default + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:13:27 + │ +13 │ use sui::tx_context::{Self, TxContext}; + │ ^^^^ Unused 'use' of alias 'tx_context'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W02021]: duplicate alias + ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:13:33 + │ +13 │ use sui::tx_context::{Self, TxContext}; + │ ^^^^^^^^^ Unnecessary alias 'TxContext' for module member 'sui::tx_context::TxContext'. This alias is provided by default + │ + = This warning can be suppressed with '#[allow(duplicate_alias)]' applied to the 'module' or module member ('const', 'fun', or 'struct') + +warning[W09001]: unused alias + ┌─ tests/sui_mode/move_2024/expansion/unnecessary_alias_default.move:13:33 + │ +13 │ use sui::tx_context::{Self, TxContext}; + │ ^^^^^^^^^ Unused 'use' of alias 'TxContext'. Consider removing it + │ + = This warning can be suppressed with '#[allow(unused_use)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/move_2024/typing/enum_in_struct_position.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/move_2024/typing/enum_in_struct_position.exp deleted file mode 100644 index 5f388c9fe77c9..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/move_2024/typing/enum_in_struct_position.exp +++ /dev/null @@ -1,39 +0,0 @@ -error[Sui E02007]: invalid object declaration - ┌─ tests/sui_mode/move_2024/typing/enum_in_struct_position.move:11:13 - │ -11 │ public enum Obj has key, store { - │ ^^^ --- Enums cannot have the 'key' ability. - │ │ - │ Invalid object 'Obj' - -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/move_2024/typing/enum_in_struct_position.move:18:1 - │ - 3 │ public enum E { - │ - To satisfy the constraint, the 'drop' ability would need to be added here - · -18 │ entry fun ret(): E { - │ ^^^^^ - The type 'a::m::E' does not have the ability 'drop' - │ │ - │ Invalid return type for entry function 'ret' - -error[Sui E02002]: invalid 'entry' function signature - ┌─ tests/sui_mode/move_2024/typing/enum_in_struct_position.move:22:14 - │ -22 │ entry fun x3(_: E) { - │ ----- ^ - 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) - │ │ │ - │ │ Invalid 'entry' parameter type for parameter '_' - │ 'x3' was declared 'entry' here - -error[Sui E02009]: invalid private transfer call - ┌─ tests/sui_mode/move_2024/typing/enum_in_struct_position.move:30:5 - │ -11 │ public enum Obj has key, store { - │ ----- The object has 'store' so 'sui::transfer::public_transfer' can be called instead - · -29 │ public fun transfer(o: a::m::Obj) { - │ --------- The type 'a::m::Obj' is not declared in the current module -30 │ transfer::transfer(o, @0) - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::transfer' is restricted to being called in the object's module, 'a::m' - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/move_2024/typing/enum_in_struct_position.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/move_2024/typing/enum_in_struct_position.snap new file mode 100644 index 0000000000000..6fc2617b50026 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/move_2024/typing/enum_in_struct_position.snap @@ -0,0 +1,46 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: 2024.alpha + lint: false +input_file: crates/move-compiler/tests/sui_mode/move_2024/typing/enum_in_struct_position.move +--- +error[Sui E02007]: invalid object declaration + ┌─ tests/sui_mode/move_2024/typing/enum_in_struct_position.move:11:13 + │ +11 │ public enum Obj has key, store { + │ ^^^ --- Enums cannot have the 'key' ability. + │ │ + │ Invalid object 'Obj' + +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/move_2024/typing/enum_in_struct_position.move:18:1 + │ + 3 │ public enum E { + │ - To satisfy the constraint, the 'drop' ability would need to be added here + · +18 │ entry fun ret(): E { + │ ^^^^^ - The type 'a::m::E' does not have the ability 'drop' + │ │ + │ Invalid return type for entry function 'ret' + +error[Sui E02002]: invalid 'entry' function signature + ┌─ tests/sui_mode/move_2024/typing/enum_in_struct_position.move:22:14 + │ +22 │ entry fun x3(_: E) { + │ ----- ^ - 'entry' parameters must be primitives (by-value), vectors of primitives, objects (by-reference or by-value), vectors of objects, or 'Receiving' arguments (by-reference or by-value) + │ │ │ + │ │ Invalid 'entry' parameter type for parameter '_' + │ 'x3' was declared 'entry' here + +error[Sui E02009]: invalid private transfer call + ┌─ tests/sui_mode/move_2024/typing/enum_in_struct_position.move:30:5 + │ +11 │ public enum Obj has key, store { + │ ----- The object has 'store' so 'sui::transfer::public_transfer' can be called instead + · +29 │ public fun transfer(o: a::m::Obj) { + │ --------- The type 'a::m::Obj' is not declared in the current module +30 │ transfer::transfer(o, @0) + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::transfer' is restricted to being called in the object's module, 'a::m' diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/bool_field.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/bool_field.exp deleted file mode 100644 index a37470fc51cc4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/bool_field.exp +++ /dev/null @@ -1,12 +0,0 @@ -warning[W09004]: unnecessary trailing semicolon - ┌─ tests/sui_mode/one_time_witness/bool_field.move:9:15 - │ -9 │ return; - │ ------^ - │ │ │ - │ │ Invalid trailing ';' - │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable - │ Any code after this expression will not be reached - │ - = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/bool_field.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/bool_field.snap new file mode 100644 index 0000000000000..1422f41a4abd1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/bool_field.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/bool_field.move +--- +warning[W09004]: unnecessary trailing semicolon + ┌─ tests/sui_mode/one_time_witness/bool_field.move:9:15 + │ +9 │ return; + │ ------^ + │ │ │ + │ │ Invalid trailing ';' + │ │ A trailing ';' in an expression block implicitly adds a '()' value after the semicolon. That '()' value will not be reachable + │ Any code after this expression will not be reached + │ + = This warning can be suppressed with '#[allow(unused_trailing_semi)]' applied to the 'module' or module member ('const', 'fun', or 'struct') diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/init_many_wrong_parameters.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/init_many_wrong_parameters.exp deleted file mode 100644 index e322aa96bbac3..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/init_many_wrong_parameters.exp +++ /dev/null @@ -1,40 +0,0 @@ -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/one_time_witness/init_many_wrong_parameters.move:2:9 - │ -2 │ fun init(_: who::X, _: who::Y, _: who::Z) {} - │ ^^^^ - 'init' functions can have at most two parameters - │ │ - │ Invalid 'init' function declaration - -error[E03002]: unbound module - ┌─ tests/sui_mode/one_time_witness/init_many_wrong_parameters.move:2:17 - │ -2 │ fun init(_: who::X, _: who::Y, _: who::Z) {} - │ ^^^ Unbound module alias 'who' - -error[E03002]: unbound module - ┌─ tests/sui_mode/one_time_witness/init_many_wrong_parameters.move:2:28 - │ -2 │ fun init(_: who::X, _: who::Y, _: who::Z) {} - │ ^^^ Unbound module alias 'who' - -error[E03002]: unbound module - ┌─ tests/sui_mode/one_time_witness/init_many_wrong_parameters.move:2:39 - │ -2 │ fun init(_: who::X, _: who::Y, _: who::Z) {} - │ ^^^ Unbound module alias 'who' - -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/one_time_witness/init_many_wrong_parameters.move:7:9 - │ -7 │ fun init(_: Who, _: u64, _: &mut sui::tx_context::TxContext) {} - │ ^^^^ - 'init' functions can have at most two parameters - │ │ - │ Invalid 'init' function declaration - -error[E03004]: unbound type - ┌─ tests/sui_mode/one_time_witness/init_many_wrong_parameters.move:7:17 - │ -7 │ fun init(_: Who, _: u64, _: &mut sui::tx_context::TxContext) {} - │ ^^^ Unbound type 'Who' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/init_many_wrong_parameters.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/init_many_wrong_parameters.snap new file mode 100644 index 0000000000000..283789f2e0981 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/init_many_wrong_parameters.snap @@ -0,0 +1,47 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/init_many_wrong_parameters.move +--- +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/one_time_witness/init_many_wrong_parameters.move:2:9 + │ +2 │ fun init(_: who::X, _: who::Y, _: who::Z) {} + │ ^^^^ - 'init' functions can have at most two parameters + │ │ + │ Invalid 'init' function declaration + +error[E03002]: unbound module + ┌─ tests/sui_mode/one_time_witness/init_many_wrong_parameters.move:2:17 + │ +2 │ fun init(_: who::X, _: who::Y, _: who::Z) {} + │ ^^^ Unbound module alias 'who' + +error[E03002]: unbound module + ┌─ tests/sui_mode/one_time_witness/init_many_wrong_parameters.move:2:28 + │ +2 │ fun init(_: who::X, _: who::Y, _: who::Z) {} + │ ^^^ Unbound module alias 'who' + +error[E03002]: unbound module + ┌─ tests/sui_mode/one_time_witness/init_many_wrong_parameters.move:2:39 + │ +2 │ fun init(_: who::X, _: who::Y, _: who::Z) {} + │ ^^^ Unbound module alias 'who' + +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/one_time_witness/init_many_wrong_parameters.move:7:9 + │ +7 │ fun init(_: Who, _: u64, _: &mut sui::tx_context::TxContext) {} + │ ^^^^ - 'init' functions can have at most two parameters + │ │ + │ Invalid 'init' function declaration + +error[E03004]: unbound type + ┌─ tests/sui_mode/one_time_witness/init_many_wrong_parameters.move:7:17 + │ +7 │ fun init(_: Who, _: u64, _: &mut sui::tx_context::TxContext) {} + │ ^^^ Unbound type 'Who' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/init_unbound_type.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/init_unbound_type.exp deleted file mode 100644 index a8381192f882f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/init_unbound_type.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E03002]: unbound module - ┌─ tests/sui_mode/one_time_witness/init_unbound_type.move:2:20 - │ -2 │ fun init(_ctx: who::TxContext) {} - │ ^^^ Unbound module alias 'who' - -error[E03004]: unbound type - ┌─ tests/sui_mode/one_time_witness/init_unbound_type.move:7:17 - │ -7 │ fun init(_: Who, _ctx: &mut sui::tx_context::TxContext) {} - │ ^^^ Unbound type 'Who' in current scope - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/init_unbound_type.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/init_unbound_type.snap new file mode 100644 index 0000000000000..29c07eebef2ea --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/init_unbound_type.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/init_unbound_type.move +--- +error[E03002]: unbound module + ┌─ tests/sui_mode/one_time_witness/init_unbound_type.move:2:20 + │ +2 │ fun init(_ctx: who::TxContext) {} + │ ^^^ Unbound module alias 'who' + +error[E03004]: unbound type + ┌─ tests/sui_mode/one_time_witness/init_unbound_type.move:7:17 + │ +7 │ fun init(_: Who, _ctx: &mut sui::tx_context::TxContext) {} + │ ^^^ Unbound type 'Who' in current scope diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/instantiate.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/instantiate.exp deleted file mode 100644 index a1c405cc6174a..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/instantiate.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[Sui E02005]: invalid one-time witness usage - ┌─ tests/sui_mode/one_time_witness/instantiate.move:12:9 - │ -12 │ M { dummy: false } - │ ^^^^^^^^^^^^^^^^^^ Invalid one-time witness construction. One-time witness types cannot be created manually, but are passed as an argument 'init' - │ - = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/instantiate.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/instantiate.snap new file mode 100644 index 0000000000000..91eb6463a6bfc --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/instantiate.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/instantiate.move +--- +error[Sui E02005]: invalid one-time witness usage + ┌─ tests/sui_mode/one_time_witness/instantiate.move:12:9 + │ +12 │ M { dummy: false } + │ ^^^^^^^^^^^^^^^^^^ Invalid one-time witness construction. One-time witness types cannot be created manually, but are passed as an argument 'init' + │ + = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/many_fields_invalid.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/many_fields_invalid.exp deleted file mode 100644 index b8c67781245fc..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/many_fields_invalid.exp +++ /dev/null @@ -1,13 +0,0 @@ -error[Sui E02004]: invalid one-time witness declaration - ┌─ tests/sui_mode/one_time_witness/many_fields_invalid.move:5:12 - │ -5 │ struct M has drop { some_field: bool, some_field2: bool } - │ ^ ----------- Found more than one field. One-time witness types must have no fields, or exactly one field of type 'bool' - │ │ - │ Invalid one-time witness declaration -6 │ -7 │ fun init(_otw: M, _ctx: &mut tx_context::TxContext) { - │ - Attempted usage as a one-time witness here - │ - = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/many_fields_invalid.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/many_fields_invalid.snap new file mode 100644 index 0000000000000..a1cc4beb18ee2 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/many_fields_invalid.snap @@ -0,0 +1,20 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/many_fields_invalid.move +--- +error[Sui E02004]: invalid one-time witness declaration + ┌─ tests/sui_mode/one_time_witness/many_fields_invalid.move:5:12 + │ +5 │ struct M has drop { some_field: bool, some_field2: bool } + │ ^ ----------- Found more than one field. One-time witness types must have no fields, or exactly one field of type 'bool' + │ │ + │ Invalid one-time witness declaration +6 │ +7 │ fun init(_otw: M, _ctx: &mut tx_context::TxContext) { + │ - Attempted usage as a one-time witness here + │ + = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/many_fields_valid.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/many_fields_valid.snap new file mode 100644 index 0000000000000..bec6e2673302a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/many_fields_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/many_fields_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/more_abilities.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/more_abilities.exp deleted file mode 100644 index 91d1713c9b40c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/more_abilities.exp +++ /dev/null @@ -1,30 +0,0 @@ -error[Sui E02004]: invalid one-time witness declaration - ┌─ tests/sui_mode/one_time_witness/more_abilities.move:6:12 - │ -6 │ struct M1 has drop, copy { dummy: bool } - │ ^^ ---- One-time witness types can only have the have the 'drop' ability - │ │ - │ Invalid one-time witness declaration - │ - = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. - -error[Sui E02004]: invalid one-time witness declaration - ┌─ tests/sui_mode/one_time_witness/more_abilities.move:16:12 - │ -16 │ struct M2 has drop, store { dummy: bool } - │ ^^ ----- One-time witness types can only have the have the 'drop' ability - │ │ - │ Invalid one-time witness declaration - │ - = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. - -error[Sui E02004]: invalid one-time witness declaration - ┌─ tests/sui_mode/one_time_witness/more_abilities.move:26:12 - │ -26 │ struct M3 has drop, copy, store { dummy: bool } - │ ^^ ---- One-time witness types can only have the have the 'drop' ability - │ │ - │ Invalid one-time witness declaration - │ - = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/more_abilities.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/more_abilities.snap new file mode 100644 index 0000000000000..69250cbce5174 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/more_abilities.snap @@ -0,0 +1,37 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/more_abilities.move +--- +error[Sui E02004]: invalid one-time witness declaration + ┌─ tests/sui_mode/one_time_witness/more_abilities.move:6:12 + │ +6 │ struct M1 has drop, copy { dummy: bool } + │ ^^ ---- One-time witness types can only have the have the 'drop' ability + │ │ + │ Invalid one-time witness declaration + │ + = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. + +error[Sui E02004]: invalid one-time witness declaration + ┌─ tests/sui_mode/one_time_witness/more_abilities.move:16:12 + │ +16 │ struct M2 has drop, store { dummy: bool } + │ ^^ ----- One-time witness types can only have the have the 'drop' ability + │ │ + │ Invalid one-time witness declaration + │ + = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. + +error[Sui E02004]: invalid one-time witness declaration + ┌─ tests/sui_mode/one_time_witness/more_abilities.move:26:12 + │ +26 │ struct M3 has drop, copy, store { dummy: bool } + │ ^^ ---- One-time witness types can only have the have the 'drop' ability + │ │ + │ Invalid one-time witness declaration + │ + = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/no_drop.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/no_drop.exp deleted file mode 100644 index 1d29bd8c2ec55..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/no_drop.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[Sui E02004]: invalid one-time witness declaration - ┌─ tests/sui_mode/one_time_witness/no_drop.move:7:12 - │ -7 │ struct M { dummy: bool } - │ ^ - │ │ - │ Invalid one-time witness declaration - │ One-time witness types can only have the have the 'drop' ability - │ - = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/no_drop.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/no_drop.snap new file mode 100644 index 0000000000000..4689e25927cbf --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/no_drop.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/no_drop.move +--- +error[Sui E02004]: invalid one-time witness declaration + ┌─ tests/sui_mode/one_time_witness/no_drop.move:7:12 + │ +7 │ struct M { dummy: bool } + │ ^ + │ │ + │ Invalid one-time witness declaration + │ One-time witness types can only have the have the 'drop' ability + │ + = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/no_field.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/no_field.snap new file mode 100644 index 0000000000000..9ea28592c6e46 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/no_field.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/no_field.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/no_init_arg.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/no_init_arg.exp deleted file mode 100644 index b81835de92f1c..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/no_init_arg.exp +++ /dev/null @@ -1,11 +0,0 @@ -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/one_time_witness/no_init_arg.move:8:20 - │ -6 │ struct M has drop { dummy: bool } - │ - One-time witness declared here -7 │ -8 │ fun init(_ctx: &mut tx_context::TxContext) { - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid first parameter to 'init'. Expected this module's one-time witness type 'a::m::M' - │ - = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/no_init_arg.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/no_init_arg.snap new file mode 100644 index 0000000000000..a362d78d9181f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/no_init_arg.snap @@ -0,0 +1,18 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/no_init_arg.move +--- +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/one_time_witness/no_init_arg.move:8:20 + │ +6 │ struct M has drop { dummy: bool } + │ - One-time witness declared here +7 │ +8 │ fun init(_ctx: &mut tx_context::TxContext) { + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid first parameter to 'init'. Expected this module's one-time witness type 'a::m::M' + │ + = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/other_mod_def.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/other_mod_def.exp deleted file mode 100644 index 119f8efa07363..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/other_mod_def.exp +++ /dev/null @@ -1,10 +0,0 @@ -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/one_time_witness/other_mod_def.move:7:9 - │ -7 │ fun init(_otw: sui::SUI, _ctx: &mut tx_context::TxContext) { - │ ^^^^ -------- Invalid parameter '_otw' of type 'sui::sui::SUI'. Expected a one-time witness type, 'a::n::N - │ │ - │ Invalid 'init' function declaration - │ - = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/other_mod_def.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/other_mod_def.snap new file mode 100644 index 0000000000000..9146fbbe0c4e0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/other_mod_def.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/other_mod_def.move +--- +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/one_time_witness/other_mod_def.move:7:9 + │ +7 │ fun init(_otw: sui::SUI, _ctx: &mut tx_context::TxContext) { + │ ^^^^ -------- Invalid parameter '_otw' of type 'sui::sui::SUI'. Expected a one-time witness type, 'a::n::N + │ │ + │ Invalid 'init' function declaration + │ + = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/type_param.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/type_param.exp deleted file mode 100644 index ff2fc49d2944d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/type_param.exp +++ /dev/null @@ -1,39 +0,0 @@ -error[Sui E02004]: invalid one-time witness declaration - ┌─ tests/sui_mode/one_time_witness/type_param.move:7:12 - │ -7 │ struct M has drop { dummy: bool } - │ ^ - One-time witness types cannot have type parameters - │ │ - │ Invalid one-time witness declaration - │ - = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. - -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/one_time_witness/type_param.move:9:9 - │ -9 │ fun init(_otw: M, _ctx: &mut tx_context::TxContext) { - │ ^^^^ - 'init' functions cannot have type parameters - │ │ - │ Invalid 'init' function declaration - -error[Sui E02004]: invalid one-time witness declaration - ┌─ tests/sui_mode/one_time_witness/type_param.move:16:12 - │ -16 │ struct X has drop { dummy: bool } - │ ^ - One-time witness types cannot have type parameters - │ │ - │ Invalid one-time witness declaration - │ - = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. - -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/one_time_witness/type_param.move:18:20 - │ -16 │ struct X has drop { dummy: bool } - │ - One-time witness declared here -17 │ -18 │ fun init(_ctx: &mut tx_context::TxContext) { - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid first parameter to 'init'. Expected this module's one-time witness type 'a::x::X' - │ - = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/type_param.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/type_param.snap new file mode 100644 index 0000000000000..69ec93f837db4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/type_param.snap @@ -0,0 +1,46 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/type_param.move +--- +error[Sui E02004]: invalid one-time witness declaration + ┌─ tests/sui_mode/one_time_witness/type_param.move:7:12 + │ +7 │ struct M has drop { dummy: bool } + │ ^ - One-time witness types cannot have type parameters + │ │ + │ Invalid one-time witness declaration + │ + = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. + +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/one_time_witness/type_param.move:9:9 + │ +9 │ fun init(_otw: M, _ctx: &mut tx_context::TxContext) { + │ ^^^^ - 'init' functions cannot have type parameters + │ │ + │ Invalid 'init' function declaration + +error[Sui E02004]: invalid one-time witness declaration + ┌─ tests/sui_mode/one_time_witness/type_param.move:16:12 + │ +16 │ struct X has drop { dummy: bool } + │ ^ - One-time witness types cannot have type parameters + │ │ + │ Invalid one-time witness declaration + │ + = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. + +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/one_time_witness/type_param.move:18:20 + │ +16 │ struct X has drop { dummy: bool } + │ - One-time witness declared here +17 │ +18 │ fun init(_ctx: &mut tx_context::TxContext) { + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid first parameter to 'init'. Expected this module's one-time witness type 'a::x::X' + │ + = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type.snap new file mode 100644 index 0000000000000..55d68e6b249f9 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type_and_extra_field.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type_and_extra_field.snap new file mode 100644 index 0000000000000..29aef1c7bb9b1 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type_and_extra_field.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type_and_extra_field.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type_and_extra_field_with_init.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type_and_extra_field_with_init.exp deleted file mode 100644 index abce69a44c9e2..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type_and_extra_field_with_init.exp +++ /dev/null @@ -1,13 +0,0 @@ -error[Sui E02004]: invalid one-time witness declaration - ┌─ tests/sui_mode/one_time_witness/wrong_field_type_and_extra_field_with_init.move:2:12 - │ -2 │ struct BEEP has drop { - │ ^^^^ Invalid one-time witness declaration -3 │ f0: u64, - │ -- One-time witness types must have no fields, or exactly one field of type 'bool' - · -6 │ fun init(_: BEEP, _ctx: &mut sui::tx_context::TxContext) { - │ ---- Attempted usage as a one-time witness here - │ - = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type_and_extra_field_with_init.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type_and_extra_field_with_init.snap new file mode 100644 index 0000000000000..e8817c5650457 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type_and_extra_field_with_init.snap @@ -0,0 +1,20 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type_and_extra_field_with_init.move +--- +error[Sui E02004]: invalid one-time witness declaration + ┌─ tests/sui_mode/one_time_witness/wrong_field_type_and_extra_field_with_init.move:2:12 + │ +2 │ struct BEEP has drop { + │ ^^^^ Invalid one-time witness declaration +3 │ f0: u64, + │ -- One-time witness types must have no fields, or exactly one field of type 'bool' + · +6 │ fun init(_: BEEP, _ctx: &mut sui::tx_context::TxContext) { + │ ---- Attempted usage as a one-time witness here + │ + = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type_with_init.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type_with_init.exp deleted file mode 100644 index 714baf8fa7502..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type_with_init.exp +++ /dev/null @@ -1,13 +0,0 @@ -error[Sui E02004]: invalid one-time witness declaration - ┌─ tests/sui_mode/one_time_witness/wrong_field_type_with_init.move:6:12 - │ -6 │ struct M has drop { value: u64 } - │ ^ ----- One-time witness types must have no fields, or exactly one field of type 'bool' - │ │ - │ Invalid one-time witness declaration -7 │ -8 │ fun init(_otw: M, _ctx: &mut tx_context::TxContext) { - │ - Attempted usage as a one-time witness here - │ - = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type_with_init.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type_with_init.snap new file mode 100644 index 0000000000000..56fd32938eb93 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type_with_init.snap @@ -0,0 +1,20 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/wrong_field_type_with_init.move +--- +error[Sui E02004]: invalid one-time witness declaration + ┌─ tests/sui_mode/one_time_witness/wrong_field_type_with_init.move:6:12 + │ +6 │ struct M has drop { value: u64 } + │ ^ ----- One-time witness types must have no fields, or exactly one field of type 'bool' + │ │ + │ Invalid one-time witness declaration +7 │ +8 │ fun init(_otw: M, _ctx: &mut tx_context::TxContext) { + │ - Attempted usage as a one-time witness here + │ + = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_init_type.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_init_type.exp deleted file mode 100644 index 0103726337e9f..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_init_type.exp +++ /dev/null @@ -1,10 +0,0 @@ -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/one_time_witness/wrong_init_type.move:9:9 - │ -9 │ fun init(_otw: N, _ctx: &mut tx_context::TxContext) { - │ ^^^^ - Invalid parameter '_otw' of type 'a::m::N'. Expected a one-time witness type, 'a::m::M - │ │ - │ Invalid 'init' function declaration - │ - = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_init_type.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_init_type.snap new file mode 100644 index 0000000000000..8bef0deceae46 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_init_type.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/wrong_init_type.move +--- +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/one_time_witness/wrong_init_type.move:9:9 + │ +9 │ fun init(_otw: N, _ctx: &mut tx_context::TxContext) { + │ ^^^^ - Invalid parameter '_otw' of type 'a::m::N'. Expected a one-time witness type, 'a::m::M + │ │ + │ Invalid 'init' function declaration + │ + = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_name.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_name.exp deleted file mode 100644 index b267e06bcdd9d..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_name.exp +++ /dev/null @@ -1,10 +0,0 @@ -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/one_time_witness/wrong_name.move:8:9 - │ -8 │ fun init(_otw: OneTimeWitness, _ctx: &mut tx_context::TxContext) { - │ ^^^^ -------------- Invalid parameter '_otw' of type 'a::m::OneTimeWitness'. Expected a one-time witness type, 'a::m::M - │ │ - │ Invalid 'init' function declaration - │ - = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_name.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_name.snap new file mode 100644 index 0000000000000..317dc7f5be203 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_name.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/wrong_name.move +--- +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/one_time_witness/wrong_name.move:8:9 + │ +8 │ fun init(_otw: OneTimeWitness, _ctx: &mut tx_context::TxContext) { + │ ^^^^ -------------- Invalid parameter '_otw' of type 'a::m::OneTimeWitness'. Expected a one-time witness type, 'a::m::M + │ │ + │ Invalid 'init' function declaration + │ + = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_name_format.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_name_format.exp deleted file mode 100644 index eba886486e2af..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_name_format.exp +++ /dev/null @@ -1,10 +0,0 @@ -error[Sui E02003]: invalid 'init' function - ┌─ tests/sui_mode/one_time_witness/wrong_name_format.move:8:9 - │ -8 │ fun init(_mod: Mod, _ctx: &mut tx_context::TxContext) { - │ ^^^^ --- Invalid parameter '_mod' of type 'a::mod::Mod'. Expected a one-time witness type, 'a::mod::MOD - │ │ - │ Invalid 'init' function declaration - │ - = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_name_format.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_name_format.snap new file mode 100644 index 0000000000000..cc08cb7c7cce4 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/one_time_witness/wrong_name_format.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/one_time_witness/wrong_name_format.move +--- +error[Sui E02003]: invalid 'init' function + ┌─ tests/sui_mode/one_time_witness/wrong_name_format.move:8:9 + │ +8 │ fun init(_mod: Mod, _ctx: &mut tx_context::TxContext) { + │ ^^^^ --- Invalid parameter '_mod' of type 'a::mod::Mod'. Expected a one-time witness type, 'a::mod::MOD + │ │ + │ Invalid 'init' function declaration + │ + = One-time witness types are structs with the following requirements: their name is the upper-case version of the module's name, they have no fields (or a single boolean field), they have no type parameters, and they have only the 'drop' ability. diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer.exp deleted file mode 100644 index d6ed18a684813..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer.exp +++ /dev/null @@ -1,32 +0,0 @@ -error[Sui E02009]: invalid private transfer call - ┌─ tests/sui_mode/private_generics/no_public_transfer.move:9:9 - │ -8 │ public fun t1(s: other::S) { - │ -------- The type 'a::other::S' is not declared in the current module -9 │ transfer::transfer(s, @0x100); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::transfer' is restricted to being called in the object's module, 'a::other' - -error[Sui E02009]: invalid private transfer call - ┌─ tests/sui_mode/private_generics/no_public_transfer.move:13:9 - │ -12 │ public fun t2(s: other::S) { - │ -------- The type 'a::other::S' is not declared in the current module -13 │ transfer::freeze_object(s); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::freeze_object' is restricted to being called in the object's module, 'a::other' - -error[Sui E02009]: invalid private transfer call - ┌─ tests/sui_mode/private_generics/no_public_transfer.move:17:9 - │ -16 │ public fun t3(s: other::S) { - │ -------- The type 'a::other::S' is not declared in the current module -17 │ transfer::share_object(s); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::share_object' is restricted to being called in the object's module, 'a::other' - -error[Sui E02009]: invalid private transfer call - ┌─ tests/sui_mode/private_generics/no_public_transfer.move:21:9 - │ -20 │ public fun t4(p: &mut UID, s: Receiving): other::S { - │ -------- The type 'a::other::S' is not declared in the current module -21 │ transfer::receive(p, s) - │ ^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::receive' is restricted to being called in the object's module, 'a::other' - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer.snap new file mode 100644 index 0000000000000..86867925c2d2a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer.move +--- +error[Sui E02009]: invalid private transfer call + ┌─ tests/sui_mode/private_generics/no_public_transfer.move:9:9 + │ +8 │ public fun t1(s: other::S) { + │ -------- The type 'a::other::S' is not declared in the current module +9 │ transfer::transfer(s, @0x100); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::transfer' is restricted to being called in the object's module, 'a::other' + +error[Sui E02009]: invalid private transfer call + ┌─ tests/sui_mode/private_generics/no_public_transfer.move:13:9 + │ +12 │ public fun t2(s: other::S) { + │ -------- The type 'a::other::S' is not declared in the current module +13 │ transfer::freeze_object(s); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::freeze_object' is restricted to being called in the object's module, 'a::other' + +error[Sui E02009]: invalid private transfer call + ┌─ tests/sui_mode/private_generics/no_public_transfer.move:17:9 + │ +16 │ public fun t3(s: other::S) { + │ -------- The type 'a::other::S' is not declared in the current module +17 │ transfer::share_object(s); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::share_object' is restricted to being called in the object's module, 'a::other' + +error[Sui E02009]: invalid private transfer call + ┌─ tests/sui_mode/private_generics/no_public_transfer.move:21:9 + │ +20 │ public fun t4(p: &mut UID, s: Receiving): other::S { + │ -------- The type 'a::other::S' is not declared in the current module +21 │ transfer::receive(p, s) + │ ^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::receive' is restricted to being called in the object's module, 'a::other' diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_generic.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_generic.exp deleted file mode 100644 index 5710d1a25b568..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_generic.exp +++ /dev/null @@ -1,32 +0,0 @@ -error[Sui E02009]: invalid private transfer call - ┌─ tests/sui_mode/private_generics/no_public_transfer_generic.move:10:9 - │ - 9 │ public fun t1(s: T) { - │ - The type 'T' is not declared in the current module -10 │ transfer::transfer(s, @0x100); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::transfer' is restricted to being called in the object's module - -error[Sui E02009]: invalid private transfer call - ┌─ tests/sui_mode/private_generics/no_public_transfer_generic.move:14:9 - │ -13 │ public fun t2(s: T) { - │ - The type 'T' is not declared in the current module -14 │ transfer::freeze_object(s); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::freeze_object' is restricted to being called in the object's module - -error[Sui E02009]: invalid private transfer call - ┌─ tests/sui_mode/private_generics/no_public_transfer_generic.move:18:9 - │ -17 │ public fun t3(s: T) { - │ - The type 'T' is not declared in the current module -18 │ transfer::share_object(s); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::share_object' is restricted to being called in the object's module - -error[Sui E02009]: invalid private transfer call - ┌─ tests/sui_mode/private_generics/no_public_transfer_generic.move:22:9 - │ -21 │ public fun t4(p: &mut UID, s: Receiving): T { - │ - The type 'T' is not declared in the current module -22 │ transfer::receive(p, s) - │ ^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::receive' is restricted to being called in the object's module - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_generic.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_generic.snap new file mode 100644 index 0000000000000..2abd19b088ab7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_generic.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_generic.move +--- +error[Sui E02009]: invalid private transfer call + ┌─ tests/sui_mode/private_generics/no_public_transfer_generic.move:10:9 + │ + 9 │ public fun t1(s: T) { + │ - The type 'T' is not declared in the current module +10 │ transfer::transfer(s, @0x100); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::transfer' is restricted to being called in the object's module + +error[Sui E02009]: invalid private transfer call + ┌─ tests/sui_mode/private_generics/no_public_transfer_generic.move:14:9 + │ +13 │ public fun t2(s: T) { + │ - The type 'T' is not declared in the current module +14 │ transfer::freeze_object(s); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::freeze_object' is restricted to being called in the object's module + +error[Sui E02009]: invalid private transfer call + ┌─ tests/sui_mode/private_generics/no_public_transfer_generic.move:18:9 + │ +17 │ public fun t3(s: T) { + │ - The type 'T' is not declared in the current module +18 │ transfer::share_object(s); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::share_object' is restricted to being called in the object's module + +error[Sui E02009]: invalid private transfer call + ┌─ tests/sui_mode/private_generics/no_public_transfer_generic.move:22:9 + │ +21 │ public fun t4(p: &mut UID, s: Receiving): T { + │ - The type 'T' is not declared in the current module +22 │ transfer::receive(p, s) + │ ^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::receive' is restricted to being called in the object's module diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_store.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_store.exp deleted file mode 100644 index 998579184d8df..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_store.exp +++ /dev/null @@ -1,44 +0,0 @@ -error[Sui E02009]: invalid private transfer call - ┌─ tests/sui_mode/private_generics/no_public_transfer_store.move:10:9 - │ - 9 │ public fun t1(s: other::S) { - │ -------- The type 'a::other::S' is not declared in the current module -10 │ transfer::transfer(s, @0x100); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::transfer' is restricted to being called in the object's module, 'a::other' - · -27 │ struct S has key, store { - │ ----- The object has 'store' so 'sui::transfer::public_transfer' can be called instead - -error[Sui E02009]: invalid private transfer call - ┌─ tests/sui_mode/private_generics/no_public_transfer_store.move:14:9 - │ -13 │ public fun t2(s: other::S) { - │ -------- The type 'a::other::S' is not declared in the current module -14 │ transfer::freeze_object(s); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::freeze_object' is restricted to being called in the object's module, 'a::other' - · -27 │ struct S has key, store { - │ ----- The object has 'store' so 'sui::transfer::public_freeze_object' can be called instead - -error[Sui E02009]: invalid private transfer call - ┌─ tests/sui_mode/private_generics/no_public_transfer_store.move:18:9 - │ -17 │ public fun t3(s: other::S) { - │ -------- The type 'a::other::S' is not declared in the current module -18 │ transfer::share_object(s); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::share_object' is restricted to being called in the object's module, 'a::other' - · -27 │ struct S has key, store { - │ ----- The object has 'store' so 'sui::transfer::public_share_object' can be called instead - -error[Sui E02009]: invalid private transfer call - ┌─ tests/sui_mode/private_generics/no_public_transfer_store.move:22:9 - │ -21 │ public fun t4(p: &mut UID, s: Receiving): other::S { - │ -------- The type 'a::other::S' is not declared in the current module -22 │ transfer::receive(p, s) - │ ^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::receive' is restricted to being called in the object's module, 'a::other' - · -27 │ struct S has key, store { - │ ----- The object has 'store' so 'sui::transfer::public_receive' can be called instead - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_store.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_store.snap new file mode 100644 index 0000000000000..dcded1ecc7976 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_store.snap @@ -0,0 +1,51 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_store.move +--- +error[Sui E02009]: invalid private transfer call + ┌─ tests/sui_mode/private_generics/no_public_transfer_store.move:10:9 + │ + 9 │ public fun t1(s: other::S) { + │ -------- The type 'a::other::S' is not declared in the current module +10 │ transfer::transfer(s, @0x100); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::transfer' is restricted to being called in the object's module, 'a::other' + · +27 │ struct S has key, store { + │ ----- The object has 'store' so 'sui::transfer::public_transfer' can be called instead + +error[Sui E02009]: invalid private transfer call + ┌─ tests/sui_mode/private_generics/no_public_transfer_store.move:14:9 + │ +13 │ public fun t2(s: other::S) { + │ -------- The type 'a::other::S' is not declared in the current module +14 │ transfer::freeze_object(s); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::freeze_object' is restricted to being called in the object's module, 'a::other' + · +27 │ struct S has key, store { + │ ----- The object has 'store' so 'sui::transfer::public_freeze_object' can be called instead + +error[Sui E02009]: invalid private transfer call + ┌─ tests/sui_mode/private_generics/no_public_transfer_store.move:18:9 + │ +17 │ public fun t3(s: other::S) { + │ -------- The type 'a::other::S' is not declared in the current module +18 │ transfer::share_object(s); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::share_object' is restricted to being called in the object's module, 'a::other' + · +27 │ struct S has key, store { + │ ----- The object has 'store' so 'sui::transfer::public_share_object' can be called instead + +error[Sui E02009]: invalid private transfer call + ┌─ tests/sui_mode/private_generics/no_public_transfer_store.move:22:9 + │ +21 │ public fun t4(p: &mut UID, s: Receiving): other::S { + │ -------- The type 'a::other::S' is not declared in the current module +22 │ transfer::receive(p, s) + │ ^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::receive' is restricted to being called in the object's module, 'a::other' + · +27 │ struct S has key, store { + │ ----- The object has 'store' so 'sui::transfer::public_receive' can be called instead diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_store_generic.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_store_generic.exp deleted file mode 100644 index e82afd84176b4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_store_generic.exp +++ /dev/null @@ -1,40 +0,0 @@ -error[Sui E02009]: invalid private transfer call - ┌─ tests/sui_mode/private_generics/no_public_transfer_store_generic.move:11:9 - │ -10 │ public fun t1(s: T) { - │ ----- - The type 'T' is not declared in the current module - │ │ - │ The object has 'store' so 'sui::transfer::public_transfer' can be called instead -11 │ transfer::transfer(s, @0x100); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::transfer' is restricted to being called in the object's module - -error[Sui E02009]: invalid private transfer call - ┌─ tests/sui_mode/private_generics/no_public_transfer_store_generic.move:15:9 - │ -14 │ public fun t2(s: T) { - │ ----- - The type 'T' is not declared in the current module - │ │ - │ The object has 'store' so 'sui::transfer::public_freeze_object' can be called instead -15 │ transfer::freeze_object(s); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::freeze_object' is restricted to being called in the object's module - -error[Sui E02009]: invalid private transfer call - ┌─ tests/sui_mode/private_generics/no_public_transfer_store_generic.move:19:9 - │ -18 │ public fun t3(s: T) { - │ ----- - The type 'T' is not declared in the current module - │ │ - │ The object has 'store' so 'sui::transfer::public_share_object' can be called instead -19 │ transfer::share_object(s); - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::share_object' is restricted to being called in the object's module - -error[Sui E02009]: invalid private transfer call - ┌─ tests/sui_mode/private_generics/no_public_transfer_store_generic.move:23:9 - │ -22 │ public fun t4(p: &mut UID, s: Receiving): T { - │ ----- - The type 'T' is not declared in the current module - │ │ - │ The object has 'store' so 'sui::transfer::public_receive' can be called instead -23 │ transfer::receive(p, s) - │ ^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::receive' is restricted to being called in the object's module - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_store_generic.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_store_generic.snap new file mode 100644 index 0000000000000..cd0636d52237f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_store_generic.snap @@ -0,0 +1,47 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/private_generics/no_public_transfer_store_generic.move +--- +error[Sui E02009]: invalid private transfer call + ┌─ tests/sui_mode/private_generics/no_public_transfer_store_generic.move:11:9 + │ +10 │ public fun t1(s: T) { + │ ----- - The type 'T' is not declared in the current module + │ │ + │ The object has 'store' so 'sui::transfer::public_transfer' can be called instead +11 │ transfer::transfer(s, @0x100); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::transfer' is restricted to being called in the object's module + +error[Sui E02009]: invalid private transfer call + ┌─ tests/sui_mode/private_generics/no_public_transfer_store_generic.move:15:9 + │ +14 │ public fun t2(s: T) { + │ ----- - The type 'T' is not declared in the current module + │ │ + │ The object has 'store' so 'sui::transfer::public_freeze_object' can be called instead +15 │ transfer::freeze_object(s); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::freeze_object' is restricted to being called in the object's module + +error[Sui E02009]: invalid private transfer call + ┌─ tests/sui_mode/private_generics/no_public_transfer_store_generic.move:19:9 + │ +18 │ public fun t3(s: T) { + │ ----- - The type 'T' is not declared in the current module + │ │ + │ The object has 'store' so 'sui::transfer::public_share_object' can be called instead +19 │ transfer::share_object(s); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::share_object' is restricted to being called in the object's module + +error[Sui E02009]: invalid private transfer call + ┌─ tests/sui_mode/private_generics/no_public_transfer_store_generic.move:23:9 + │ +22 │ public fun t4(p: &mut UID, s: Receiving): T { + │ ----- - The type 'T' is not declared in the current module + │ │ + │ The object has 'store' so 'sui::transfer::public_receive' can be called instead +23 │ transfer::receive(p, s) + │ ^^^^^^^^^^^^^^^^^^^^^^^ Invalid private transfer. The function 'sui::transfer::receive' is restricted to being called in the object's module diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/private_event_emit.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/private_event_emit.exp deleted file mode 100644 index 046e3f1bd99d4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/private_event_emit.exp +++ /dev/null @@ -1,32 +0,0 @@ -error[Sui E02008]: invalid event - ┌─ tests/sui_mode/private_generics/private_event_emit.move:8:9 - │ -7 │ public fun t(s: a::other::Event) { - │ --------------- The type 'a::other::Event' is not declared in the current module -8 │ event::emit(s) - │ ^^^^^^^^^^^^^^ Invalid event. The function 'sui::event::emit' must be called with a type defined in the current module - -error[Sui E02008]: invalid event - ┌─ tests/sui_mode/private_generics/private_event_emit.move:12:9 - │ -11 │ public fun gen(x: T) { - │ - The type 'T' is not declared in the current module -12 │ event::emit(move x) - │ ^^^^^^^^^^^^^^^^^^^ Invalid event. The function 'sui::event::emit' must be called with a type defined in the current module - -error[Sui E02008]: invalid event - ┌─ tests/sui_mode/private_generics/private_event_emit.move:16:9 - │ -15 │ public fun prim(x: u64) { - │ --- The type 'u64' is not declared in the current module -16 │ event::emit(x) - │ ^^^^^^^^^^^^^^ Invalid event. The function 'sui::event::emit' must be called with a type defined in the current module - -error[Sui E02008]: invalid event - ┌─ tests/sui_mode/private_generics/private_event_emit.move:20:9 - │ -19 │ public fun vec(x: vector) { - │ --------- The type 'vector' is not declared in the current module -20 │ event::emit(move x) - │ ^^^^^^^^^^^^^^^^^^^ Invalid event. The function 'sui::event::emit' must be called with a type defined in the current module - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/private_event_emit.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/private_event_emit.snap new file mode 100644 index 0000000000000..03fbdf362f29b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/private_event_emit.snap @@ -0,0 +1,39 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/private_generics/private_event_emit.move +--- +error[Sui E02008]: invalid event + ┌─ tests/sui_mode/private_generics/private_event_emit.move:8:9 + │ +7 │ public fun t(s: a::other::Event) { + │ --------------- The type 'a::other::Event' is not declared in the current module +8 │ event::emit(s) + │ ^^^^^^^^^^^^^^ Invalid event. The function 'sui::event::emit' must be called with a type defined in the current module + +error[Sui E02008]: invalid event + ┌─ tests/sui_mode/private_generics/private_event_emit.move:12:9 + │ +11 │ public fun gen(x: T) { + │ - The type 'T' is not declared in the current module +12 │ event::emit(move x) + │ ^^^^^^^^^^^^^^^^^^^ Invalid event. The function 'sui::event::emit' must be called with a type defined in the current module + +error[Sui E02008]: invalid event + ┌─ tests/sui_mode/private_generics/private_event_emit.move:16:9 + │ +15 │ public fun prim(x: u64) { + │ --- The type 'u64' is not declared in the current module +16 │ event::emit(x) + │ ^^^^^^^^^^^^^^ Invalid event. The function 'sui::event::emit' must be called with a type defined in the current module + +error[Sui E02008]: invalid event + ┌─ tests/sui_mode/private_generics/private_event_emit.move:20:9 + │ +19 │ public fun vec(x: vector) { + │ --------- The type 'vector' is not declared in the current module +20 │ event::emit(move x) + │ ^^^^^^^^^^^^^^^^^^^ Invalid event. The function 'sui::event::emit' must be called with a type defined in the current module diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/public_transfer_with_store.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/public_transfer_with_store.snap new file mode 100644 index 0000000000000..5152c441937c7 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/public_transfer_with_store.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/private_generics/public_transfer_with_store.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/public_transfer_with_store_generic.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/public_transfer_with_store_generic.snap new file mode 100644 index 0000000000000..ed3df4a2db237 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/private_generics/public_transfer_with_store_generic.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/private_generics/public_transfer_with_store_generic.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_first_field_not_id.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_first_field_not_id.exp deleted file mode 100644 index 055d2d9c46e24..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_first_field_not_id.exp +++ /dev/null @@ -1,8 +0,0 @@ -error[Sui E02007]: invalid object declaration - ┌─ tests/sui_mode/struct_with_key/key_struct_first_field_not_id.move:4:9 - │ -3 │ struct S has key { - │ --- The 'key' ability is used to declare objects in Sui -4 │ flag: bool - │ ^^^^ Invalid object 'S'. Structs with the 'key' ability must have 'id: sui::object::UID' as their first field - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_first_field_not_id.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_first_field_not_id.snap new file mode 100644 index 0000000000000..0abfcc7df1148 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_first_field_not_id.snap @@ -0,0 +1,15 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_first_field_not_id.move +--- +error[Sui E02007]: invalid object declaration + ┌─ tests/sui_mode/struct_with_key/key_struct_first_field_not_id.move:4:9 + │ +3 │ struct S has key { + │ --- The 'key' ability is used to declare objects in Sui +4 │ flag: bool + │ ^^^^ Invalid object 'S'. Structs with the 'key' ability must have 'id: sui::object::UID' as their first field diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_address.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_address.exp deleted file mode 100644 index 24a10a40b69c4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_address.exp +++ /dev/null @@ -1,20 +0,0 @@ -error[Sui E02007]: invalid object declaration - ┌─ tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_address.move:5:9 - │ -4 │ struct S has key { - │ --- The 'key' ability is used to declare objects in Sui -5 │ id: UID - │ ^^ --- But found type: 'a::object::UID' - │ │ - │ Invalid object 'S'. Structs with the 'key' ability must have 'id: sui::object::UID' as their first field - -error[Sui E02007]: invalid object declaration - ┌─ tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_address.move:12:9 - │ -11 │ struct S has key { - │ --- The 'key' ability is used to declare objects in Sui -12 │ id: UID - │ ^^ --- But found type: '0x3::object::UID' - │ │ - │ Invalid object 'S'. Structs with the 'key' ability must have 'id: sui::object::UID' as their first field - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_address.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_address.snap new file mode 100644 index 0000000000000..d606690210e71 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_address.snap @@ -0,0 +1,27 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_address.move +--- +error[Sui E02007]: invalid object declaration + ┌─ tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_address.move:5:9 + │ +4 │ struct S has key { + │ --- The 'key' ability is used to declare objects in Sui +5 │ id: UID + │ ^^ --- But found type: 'a::object::UID' + │ │ + │ Invalid object 'S'. Structs with the 'key' ability must have 'id: sui::object::UID' as their first field + +error[Sui E02007]: invalid object declaration + ┌─ tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_address.move:12:9 + │ +11 │ struct S has key { + │ --- The 'key' ability is used to declare objects in Sui +12 │ id: UID + │ ^^ --- But found type: '0x3::object::UID' + │ │ + │ Invalid object 'S'. Structs with the 'key' ability must have 'id: sui::object::UID' as their first field diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_name.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_name.exp deleted file mode 100644 index 1c76a807589c6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_name.exp +++ /dev/null @@ -1,10 +0,0 @@ -error[Sui E02007]: invalid object declaration - ┌─ tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_name.move:5:9 - │ -4 │ struct S has key { - │ --- The 'key' ability is used to declare objects in Sui -5 │ id: object::ID - │ ^^ ---------- But found type: 'sui::object::ID' - │ │ - │ Invalid object 'S'. Structs with the 'key' ability must have 'id: sui::object::UID' as their first field - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_name.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_name.snap new file mode 100644 index 0000000000000..6b533a742d5f0 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_name.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_name.move +--- +error[Sui E02007]: invalid object declaration + ┌─ tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_struct_name.move:5:9 + │ +4 │ struct S has key { + │ --- The 'key' ability is used to declare objects in Sui +5 │ id: object::ID + │ ^^ ---------- But found type: 'sui::object::ID' + │ │ + │ Invalid object 'S'. Structs with the 'key' ability must have 'id: sui::object::UID' as their first field diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_type.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_type.exp deleted file mode 100644 index 41074849a6aa6..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_type.exp +++ /dev/null @@ -1,10 +0,0 @@ -error[Sui E02007]: invalid object declaration - ┌─ tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_type.move:4:9 - │ -3 │ struct S has key { - │ --- The 'key' ability is used to declare objects in Sui -4 │ id: bool - │ ^^ ---- But found type: 'bool' - │ │ - │ Invalid object 'S'. Structs with the 'key' ability must have 'id: sui::object::UID' as their first field - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_type.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_type.snap new file mode 100644 index 0000000000000..ee5ff2a45442b --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_type.snap @@ -0,0 +1,17 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_type.move +--- +error[Sui E02007]: invalid object declaration + ┌─ tests/sui_mode/struct_with_key/key_struct_id_field_incorrect_type.move:4:9 + │ +3 │ struct S has key { + │ --- The 'key' ability is used to declare objects in Sui +4 │ id: bool + │ ^^ ---- But found type: 'bool' + │ │ + │ Invalid object 'S'. Structs with the 'key' ability must have 'id: sui::object::UID' as their first field diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_valid.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_valid.snap new file mode 100644 index 0000000000000..fb55e3dcb0386 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_valid.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_id_field_valid.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_second_field_id.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_second_field_id.exp deleted file mode 100644 index 5dc557584cfc4..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_second_field_id.exp +++ /dev/null @@ -1,16 +0,0 @@ -error[Sui E02007]: invalid object declaration - ┌─ tests/sui_mode/struct_with_key/key_struct_second_field_id.move:6:9 - │ -5 │ struct S has key { - │ --- The 'key' ability is used to declare objects in Sui -6 │ flag: bool, - │ ^^^^ Invalid object 'S'. Structs with the 'key' ability must have 'id: sui::object::UID' as their first field - -error[Sui E02007]: invalid object declaration - ┌─ tests/sui_mode/struct_with_key/key_struct_second_field_id.move:11:9 - │ -10 │ struct R has key { - │ --- The 'key' ability is used to declare objects in Sui -11 │ flag: bool, - │ ^^^^ Invalid object 'R'. Structs with the 'key' ability must have 'id: sui::object::UID' as their first field - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_second_field_id.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_second_field_id.snap new file mode 100644 index 0000000000000..faa7ac2f9ba4f --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_second_field_id.snap @@ -0,0 +1,23 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_second_field_id.move +--- +error[Sui E02007]: invalid object declaration + ┌─ tests/sui_mode/struct_with_key/key_struct_second_field_id.move:6:9 + │ +5 │ struct S has key { + │ --- The 'key' ability is used to declare objects in Sui +6 │ flag: bool, + │ ^^^^ Invalid object 'S'. Structs with the 'key' ability must have 'id: sui::object::UID' as their first field + +error[Sui E02007]: invalid object declaration + ┌─ tests/sui_mode/struct_with_key/key_struct_second_field_id.move:11:9 + │ +10 │ struct R has key { + │ --- The 'key' ability is used to declare objects in Sui +11 │ flag: bool, + │ ^^^^ Invalid object 'R'. Structs with the 'key' ability must have 'id: sui::object::UID' as their first field diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_with_drop.exp b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_with_drop.exp deleted file mode 100644 index b37a23fadf0ed..0000000000000 --- a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_with_drop.exp +++ /dev/null @@ -1,12 +0,0 @@ -error[E05001]: ability constraint not satisfied - ┌─ tests/sui_mode/struct_with_key/key_struct_with_drop.move:6:13 - │ - 6 │ id: object::UID, - │ ^^^^^^^^^^^ - │ │ - │ Invalid field type. The struct was declared with the ability 'drop' so all fields require the ability 'drop' - │ The type 'sui::object::UID' does not have the ability 'drop' - · -12 │ struct UID has store { - │ --- To satisfy the constraint, the 'drop' ability would need to be added here - diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_with_drop.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_with_drop.snap new file mode 100644 index 0000000000000..881a4571388c3 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_with_drop.snap @@ -0,0 +1,19 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/struct_with_key/key_struct_with_drop.move +--- +error[E05001]: ability constraint not satisfied + ┌─ tests/sui_mode/struct_with_key/key_struct_with_drop.move:6:13 + │ + 6 │ id: object::UID, + │ ^^^^^^^^^^^ + │ │ + │ Invalid field type. The struct was declared with the ability 'drop' so all fields require the ability 'drop' + │ The type 'sui::object::UID' does not have the ability 'drop' + · +12 │ struct UID has store { + │ --- To satisfy the constraint, the 'drop' ability would need to be added here diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/unused_id_field.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/unused_id_field.snap new file mode 100644 index 0000000000000..415bfcb0c4e11 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/unused_id_field.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/struct_with_key/unused_id_field.move +--- + diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/unused_id_field@unused.snap b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/unused_id_field@unused.snap new file mode 100644 index 0000000000000..415bfcb0c4e11 --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/struct_with_key/unused_id_field@unused.snap @@ -0,0 +1,9 @@ +--- +source: crates/move-compiler/tests/move_check_testsuite.rs +info: + flavor: sui + edition: legacy + lint: false +input_file: crates/move-compiler/tests/sui_mode/struct_with_key/unused_id_field.move +--- +