diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-06-12 22:50:50 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-12 22:50:50 -0700 |
| commit | 529ef75101e21bd45402c516138343b4770238eb (patch) | |
| tree | 56c925bd7df84e5f223c31a7c8fa90606c8e2dc9 /test/cases/compile_errors | |
| parent | 1e7dcaa3ae57294ab5998b44a8c13ccc5019e7ea (diff) | |
| parent | 2ad073ec6d4e2be967f18c9907844404a7eed42e (diff) | |
| download | zig-529ef75101e21bd45402c516138343b4770238eb.tar.gz zig-529ef75101e21bd45402c516138343b4770238eb.zip | |
Merge pull request #15569 from ziglang/intern-pool-3
Use InternPool for all types and constant values
Diffstat (limited to 'test/cases/compile_errors')
11 files changed, 19 insertions, 20 deletions
diff --git a/test/cases/compile_errors/access_non-existent_member_of_error_set.zig b/test/cases/compile_errors/access_non-existent_member_of_error_set.zig index 765bbe59c3..7f0bc562ac 100644 --- a/test/cases/compile_errors/access_non-existent_member_of_error_set.zig +++ b/test/cases/compile_errors/access_non-existent_member_of_error_set.zig @@ -9,4 +9,3 @@ comptime { // target=native // // :3:18: error: no error named 'Bar' in 'error{A}' -// :1:13: note: error set declared here diff --git a/test/cases/compile_errors/compile_log_statement_inside_function_which_must_be_comptime_evaluated.zig b/test/cases/compile_errors/compile_log_statement_inside_function_which_must_be_comptime_evaluated.zig index 8a39fdec46..64fae2aac3 100644 --- a/test/cases/compile_errors/compile_log_statement_inside_function_which_must_be_comptime_evaluated.zig +++ b/test/cases/compile_errors/compile_log_statement_inside_function_which_must_be_comptime_evaluated.zig @@ -14,4 +14,4 @@ export fn entry() void { // :2:5: error: found compile log statement // // Compile Log Output: -// @as(*const [3:0]u8, "i32\x00") +// @as(*const [3:0]u8, "i32") diff --git a/test/cases/compile_errors/explicit_error_set_cast_known_at_comptime_violates_error_sets.zig b/test/cases/compile_errors/explicit_error_set_cast_known_at_comptime_violates_error_sets.zig index 22fc965769..a3af883198 100644 --- a/test/cases/compile_errors/explicit_error_set_cast_known_at_comptime_violates_error_sets.zig +++ b/test/cases/compile_errors/explicit_error_set_cast_known_at_comptime_violates_error_sets.zig @@ -1,5 +1,5 @@ -const Set1 = error {A, B}; -const Set2 = error {A, C}; +const Set1 = error{ A, B }; +const Set2 = error{ A, C }; comptime { var x = Set1.B; var y = @errSetCast(Set2, x); @@ -10,5 +10,4 @@ comptime { // backend=stage2 // target=native // -// :5:13: error: 'error.B' not a member of error set 'error{A,C}' -// :2:14: note: error set declared here +// :5:13: error: 'error.B' not a member of error set 'error{C,A}' diff --git a/test/cases/compile_errors/implicit_cast_of_error_set_not_a_subset.zig b/test/cases/compile_errors/implicit_cast_of_error_set_not_a_subset.zig index 0a182343b9..5e5b57680c 100644 --- a/test/cases/compile_errors/implicit_cast_of_error_set_not_a_subset.zig +++ b/test/cases/compile_errors/implicit_cast_of_error_set_not_a_subset.zig @@ -1,5 +1,5 @@ -const Set1 = error{A, B}; -const Set2 = error{A, C}; +const Set1 = error{ A, B }; +const Set2 = error{ A, C }; export fn entry() void { foo(Set1.B); } @@ -12,5 +12,5 @@ fn foo(set1: Set1) void { // backend=stage2 // target=native // -// :7:19: error: expected type 'error{A,C}', found 'error{A,B}' +// :7:19: error: expected type 'error{C,A}', found 'error{A,B}' // :7:19: note: 'error.B' not a member of destination error set diff --git a/test/cases/compile_errors/int_to_err_non_global_invalid_number.zig b/test/cases/compile_errors/int_to_err_non_global_invalid_number.zig index 43aad76f45..f837ccd532 100644 --- a/test/cases/compile_errors/int_to_err_non_global_invalid_number.zig +++ b/test/cases/compile_errors/int_to_err_non_global_invalid_number.zig @@ -16,5 +16,4 @@ comptime { // backend=llvm // target=native // -// :11:13: error: 'error.B' not a member of error set 'error{A,C}' -// :5:14: note: error set declared here +// :11:13: error: 'error.B' not a member of error set 'error{C,A}' diff --git a/test/cases/compile_errors/invalid_non-exhaustive_enum_to_union.zig b/test/cases/compile_errors/invalid_non-exhaustive_enum_to_union.zig index c7fc39f769..fa58c0845a 100644 --- a/test/cases/compile_errors/invalid_non-exhaustive_enum_to_union.zig +++ b/test/cases/compile_errors/invalid_non-exhaustive_enum_to_union.zig @@ -24,5 +24,5 @@ export fn bar() void { // // :12:16: error: runtime coercion to union 'tmp.U' from non-exhaustive enum // :1:11: note: enum declared here -// :17:16: error: union 'tmp.U' has no tag with value '15' +// :17:16: error: union 'tmp.U' has no tag with value '@intToEnum(tmp.E, 15)' // :6:11: note: union declared here diff --git a/test/cases/compile_errors/pointer_attributes_checked_when_coercing_pointer_to_anon_literal.zig b/test/cases/compile_errors/pointer_attributes_checked_when_coercing_pointer_to_anon_literal.zig index c0a0b06af0..da7f2492d1 100644 --- a/test/cases/compile_errors/pointer_attributes_checked_when_coercing_pointer_to_anon_literal.zig +++ b/test/cases/compile_errors/pointer_attributes_checked_when_coercing_pointer_to_anon_literal.zig @@ -16,9 +16,9 @@ comptime { // backend=stage2 // target=native // -// :2:29: error: expected type '[][]const u8', found '*const tuple{comptime *const [5:0]u8 = "hello", comptime *const [5:0]u8 = "world"}' +// :2:29: error: expected type '[][]const u8', found '*const struct{comptime *const [5:0]u8 = "hello", comptime *const [5:0]u8 = "world"}' // :2:29: note: cast discards const qualifier -// :6:31: error: expected type '*[2][]const u8', found '*const tuple{comptime *const [5:0]u8 = "hello", comptime *const [5:0]u8 = "world"}' +// :6:31: error: expected type '*[2][]const u8', found '*const struct{comptime *const [5:0]u8 = "hello", comptime *const [5:0]u8 = "world"}' // :6:31: note: cast discards const qualifier // :11:19: error: expected type '*tmp.S', found '*const struct{comptime a: comptime_int = 2}' // :11:19: note: cast discards const qualifier diff --git a/test/cases/compile_errors/return_invalid_type_from_test.zig b/test/cases/compile_errors/return_invalid_type_from_test.zig index a954bd7ee5..acc932cb0a 100644 --- a/test/cases/compile_errors/return_invalid_type_from_test.zig +++ b/test/cases/compile_errors/return_invalid_type_from_test.zig @@ -1,8 +1,10 @@ -test "example" { return 1; } +test "example" { + return 1; +} // error // backend=stage2 // target=native // is_test=1 // -// :1:25: error: expected type '@typeInfo(@typeInfo(@TypeOf(tmp.test.example)).Fn.return_type.?).ErrorUnion.error_set!void', found 'comptime_int'
\ No newline at end of file +// :2:12: error: expected type 'anyerror!void', found 'comptime_int' diff --git a/test/cases/compile_errors/tagName_on_invalid_value_of_non-exhaustive_enum.zig b/test/cases/compile_errors/tagName_on_invalid_value_of_non-exhaustive_enum.zig index 1de0d1c145..3523a36054 100644 --- a/test/cases/compile_errors/tagName_on_invalid_value_of_non-exhaustive_enum.zig +++ b/test/cases/compile_errors/tagName_on_invalid_value_of_non-exhaustive_enum.zig @@ -1,5 +1,5 @@ test "enum" { - const E = enum(u8) {A, B, _}; + const E = enum(u8) { A, B, _ }; _ = @tagName(@intToEnum(E, 5)); } @@ -8,5 +8,5 @@ test "enum" { // target=native // is_test=1 // -// :3:9: error: no field with value '5' in enum 'test.enum.E' +// :3:9: error: no field with value '@intToEnum(tmp.test.enum.E, 5)' in enum 'test.enum.E' // :2:15: note: declared here diff --git a/test/cases/compile_errors/tuple_init_edge_cases.zig b/test/cases/compile_errors/tuple_init_edge_cases.zig index 32b52cdc1f..f093515a38 100644 --- a/test/cases/compile_errors/tuple_init_edge_cases.zig +++ b/test/cases/compile_errors/tuple_init_edge_cases.zig @@ -41,4 +41,4 @@ pub export fn entry5() void { // :12:14: error: missing tuple field with index 1 // :17:14: error: missing tuple field with index 1 // :29:14: error: expected at most 2 tuple fields; found 3 -// :34:30: error: index '2' out of bounds of tuple 'tuple{comptime comptime_int = 123, u32}' +// :34:30: error: index '2' out of bounds of tuple 'struct{comptime comptime_int = 123, u32}' diff --git a/test/cases/compile_errors/type_mismatch_with_tuple_concatenation.zig b/test/cases/compile_errors/type_mismatch_with_tuple_concatenation.zig index 284d3c0d0d..9f360e2afe 100644 --- a/test/cases/compile_errors/type_mismatch_with_tuple_concatenation.zig +++ b/test/cases/compile_errors/type_mismatch_with_tuple_concatenation.zig @@ -7,4 +7,4 @@ export fn entry() void { // backend=stage2 // target=native // -// :3:11: error: expected type '@TypeOf(.{})', found 'tuple{comptime comptime_int = 1, comptime comptime_int = 2, comptime comptime_int = 3}' +// :3:11: error: expected type '@TypeOf(.{})', found 'struct{comptime comptime_int = 1, comptime comptime_int = 2, comptime comptime_int = 3}' |
