Commit 6d8ee89721

Robin Voetter <robin@voetter.nl>
2024-10-27 18:02:12
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.
1 parent 49a067c
test/cases/compile_errors/explicit_error_set_cast_known_at_comptime_violates_error_sets.zig
@@ -10,4 +10,4 @@ comptime {
 // backend=stage2
 // target=native
 //
-// :5:21: error: 'error.B' not a member of error set 'error{C,A}'
+// :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
@@ -12,5 +12,5 @@ fn foo(set1: Set1) void {
 // backend=stage2
 // target=native
 //
-// :7:21: error: expected type 'error{C,A}', found 'error{A,B}'
+// :7:21: error: expected type 'error{A,C}', found 'error{A,B}'
 // :7:21: note: 'error.B' not a member of destination error set
test/cases/compile_errors/int_to_err_non_global_invalid_number.zig
@@ -16,4 +16,4 @@ comptime {
 // backend=llvm
 // target=native
 //
-// :11:21: error: 'error.B' not a member of error set 'error{C,A}'
+// :11:21: error: 'error.B' not a member of error set 'error{A,C}'