authorgravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2024-10-27 18:02:12+01:00
committergravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2024-10-27 18:02:12+01:00
log6d8ee89721f742a90d218a621640c9e11633e758
tree1701d9b6ae9dcd2107e71aa5189db79625fe92af
parent49a067ccfe6cc3ee59b0fe0f2dc32f80ab75d574
signaturebadge-check Signed by SSH key SHA256:ZS52FNyUv2WUXvO4njmVaFVO46RHojFuOrxRc4LuKzg

fix compile error tests with unstable error sets

The print order of error sets depends on the order that the compiler adds names to its internal state. These names can be anything, and do not necessarily need to be from the same error set or be errors at all. When the last remaining reference to builtin.cpu.arch was removed in start.zig in 9b42bc1ce5, this order changed. Likely there is something that has the name 'C' that is referenced somewhere recursively from builtin.cpu.arch. This all causes these few tests to fail, and hence the expected order is simply updated now. Perhaps there is a better way to add this.

3 files changed, 3 insertions(+), 3 deletions(-)

test/cases/compile_errors/explicit_error_set_cast_known_at_comptime_violates_error_sets.zig+1-1
...@@ -10,4 +10,4 @@ comptime {...@@ -10,4 +10,4 @@ comptime {
10// backend=stage210// backend=stage2
11// target=native11// target=native
12//12//
13// :5:21: error: 'error.B' not a member of error set 'error{C,A}'13// :5:21: error: 'error.B' not a member of error set 'error{A,C}'
test/cases/compile_errors/implicit_cast_of_error_set_not_a_subset.zig+1-1
...@@ -12,5 +12,5 @@ fn foo(set1: Set1) void {...@@ -12,5 +12,5 @@ fn foo(set1: Set1) void {
12// backend=stage212// backend=stage2
13// target=native13// target=native
14//14//
15// :7:21: error: expected type 'error{C,A}', found 'error{A,B}'15// :7:21: error: expected type 'error{A,C}', found 'error{A,B}'
16// :7:21: note: 'error.B' not a member of destination error set16// :7:21: note: 'error.B' not a member of destination error set
test/cases/compile_errors/int_to_err_non_global_invalid_number.zig+1-1
...@@ -16,4 +16,4 @@ comptime {...@@ -16,4 +16,4 @@ comptime {
16// backend=llvm16// backend=llvm
17// target=native17// target=native
18//18//
19// :11:21: error: 'error.B' not a member of error set 'error{C,A}'19// :11:21: error: 'error.B' not a member of error set 'error{A,C}'