aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-07-07 20:54:10 +0300
committerVeikka Tuominen <git@vexu.eu>2022-07-10 23:15:17 +0300
commitb9f01bc39452042be1609b63f3066cfcac82f273 (patch)
tree5db2748bb4a8f7fafc1d9c375d205b05fd391d1e /test/cases/compile_errors
parentb9ed07227832a10e5a18667d6c7cbdffd2018da7 (diff)
downloadzig-b9f01bc39452042be1609b63f3066cfcac82f273.tar.gz
zig-b9f01bc39452042be1609b63f3066cfcac82f273.zip
Sema: add detailed error notes to `coerceInMemoryAllowed`
Diffstat (limited to 'test/cases/compile_errors')
-rw-r--r--test/cases/compile_errors/address_of_number_literal.zig1
-rw-r--r--test/cases/compile_errors/attempted_implicit_cast_from_const_T_to_array_len_1_T.zig (renamed from test/cases/compile_errors/stage1/obj/attempted_implicit_cast_from_const_T_to_array_len_1_T.zig)6
-rw-r--r--test/cases/compile_errors/cast_error_union_of_global_error_set_to_error_union_of_smaller_error_set.zig15
-rw-r--r--test/cases/compile_errors/cast_global_error_set_to_error_set.zig (renamed from test/cases/compile_errors/stage1/obj/cast_global_error_set_to_error_set.zig)6
-rw-r--r--test/cases/compile_errors/casting_bit_offset_pointer_to_regular_pointer.zig2
-rw-r--r--test/cases/compile_errors/dont_implicit_cast_double_pointer_to_anyopaque.zig1
-rw-r--r--test/cases/compile_errors/error_note_for_function_parameter_incompatibility.zig13
-rw-r--r--test/cases/compile_errors/implicit_cast_of_error_set_not_a_subset.zig (renamed from test/cases/compile_errors/stage1/obj/implicit_cast_of_error_set_not_a_subset.zig)6
-rw-r--r--test/cases/compile_errors/implicit_casting_C_pointers_which_would_mess_up_null_semantics.zig26
-rw-r--r--test/cases/compile_errors/implicitly_casting_enum_to_tag_type.zig1
-rw-r--r--test/cases/compile_errors/incompatible_sentinels.zig29
-rw-r--r--test/cases/compile_errors/incorrect_return_type.zig2
-rw-r--r--test/cases/compile_errors/invalid_address_space_coercion.zig1
-rw-r--r--test/cases/compile_errors/invalid_cast_from_integral_type_to_enum.zig1
-rw-r--r--test/cases/compile_errors/invalid_pointer_keeps_address_space_when_taking_address_of_dereference.zig1
-rw-r--r--test/cases/compile_errors/not_an_enum_type.zig1
-rw-r--r--test/cases/compile_errors/passing_a_not-aligned-enough_pointer_to_cmpxchg.zig1
-rw-r--r--test/cases/compile_errors/pointer_with_different_address_spaces.zig1
-rw-r--r--test/cases/compile_errors/pointers_with_different_address_spaces.zig1
-rw-r--r--test/cases/compile_errors/shifting_RHS_is_log2_of_LHS_int_bit_width.zig1
-rw-r--r--test/cases/compile_errors/slice_sentinel_mismatch-2.zig12
-rw-r--r--test/cases/compile_errors/stage1/obj/cast_error_union_of_global_error_set_to_error_union_of_smaller_error_set.zig16
-rw-r--r--test/cases/compile_errors/stage1/obj/error_note_for_function_parameter_incompatibility.zig12
-rw-r--r--test/cases/compile_errors/stage1/obj/implicit_casting_C_pointers_which_would_mess_up_null_semantics.zig26
-rw-r--r--test/cases/compile_errors/stage1/obj/incompatible_sentinels.zig29
-rw-r--r--test/cases/compile_errors/stage1/obj/slice_sentinel_mismatch-2.zig12
-rw-r--r--test/cases/compile_errors/stage1/obj/type_checking_function_pointers.zig13
-rw-r--r--test/cases/compile_errors/type_checking_function_pointers.zig15
-rw-r--r--test/cases/compile_errors/type_mismatch_in_C_prototype_with_varargs.zig2
-rw-r--r--test/cases/compile_errors/wrong_type_for_reify_type.zig1
30 files changed, 137 insertions, 117 deletions
diff --git a/test/cases/compile_errors/address_of_number_literal.zig b/test/cases/compile_errors/address_of_number_literal.zig
index 2d8380634a..2000561207 100644
--- a/test/cases/compile_errors/address_of_number_literal.zig
+++ b/test/cases/compile_errors/address_of_number_literal.zig
@@ -8,3 +8,4 @@ export fn entry() usize { return @sizeOf(@TypeOf(&foo)); }
// target=native
//
// :3:30: error: expected type '*const i32', found '*const comptime_int'
+// :3:30: note: pointer type child 'comptime_int' cannot cast into pointer type child 'i32'
diff --git a/test/cases/compile_errors/stage1/obj/attempted_implicit_cast_from_const_T_to_array_len_1_T.zig b/test/cases/compile_errors/attempted_implicit_cast_from_const_T_to_array_len_1_T.zig
index 760866dd65..b553d492ae 100644
--- a/test/cases/compile_errors/stage1/obj/attempted_implicit_cast_from_const_T_to_array_len_1_T.zig
+++ b/test/cases/compile_errors/attempted_implicit_cast_from_const_T_to_array_len_1_T.zig
@@ -7,8 +7,8 @@ export fn entry(byte: u8) void {
}
// error
-// backend=stage1
+// backend=stage2
// target=native
//
-// tmp.zig:4:22: error: expected type '*[1]i32', found '*const i32'
-// tmp.zig:4:22: note: cast discards const qualifier
+// :4:22: error: expected type '*[1]i32', found '*const i32'
+// :4:22: note: cast discards const qualifier
diff --git a/test/cases/compile_errors/cast_error_union_of_global_error_set_to_error_union_of_smaller_error_set.zig b/test/cases/compile_errors/cast_error_union_of_global_error_set_to_error_union_of_smaller_error_set.zig
new file mode 100644
index 0000000000..36a17d734b
--- /dev/null
+++ b/test/cases/compile_errors/cast_error_union_of_global_error_set_to_error_union_of_smaller_error_set.zig
@@ -0,0 +1,15 @@
+const SmallErrorSet = error{A};
+export fn entry() void {
+ var x: SmallErrorSet!i32 = foo();
+ _ = x;
+}
+fn foo() anyerror!i32 {
+ return error.B;
+}
+
+// error
+// backend=stage2
+// target=native
+//
+// :3:35: error: expected type 'error{A}!i32', found 'anyerror!i32'
+// :3:35: note: global error set cannot cast into a smaller set
diff --git a/test/cases/compile_errors/stage1/obj/cast_global_error_set_to_error_set.zig b/test/cases/compile_errors/cast_global_error_set_to_error_set.zig
index be9487cc5a..39d9474016 100644
--- a/test/cases/compile_errors/stage1/obj/cast_global_error_set_to_error_set.zig
+++ b/test/cases/compile_errors/cast_global_error_set_to_error_set.zig
@@ -8,8 +8,8 @@ fn foo() anyerror {
}
// error
-// backend=stage1
+// backend=stage2
// target=native
//
-// tmp.zig:3:31: error: expected type 'SmallErrorSet', found 'anyerror'
-// tmp.zig:3:31: note: cannot cast global error set into smaller set
+// :3:31: error: expected type 'error{A}', found 'anyerror'
+// :3:31: note: global error set cannot cast into a smaller set
diff --git a/test/cases/compile_errors/casting_bit_offset_pointer_to_regular_pointer.zig b/test/cases/compile_errors/casting_bit_offset_pointer_to_regular_pointer.zig
index 083d68ee40..f25a4a656b 100644
--- a/test/cases/compile_errors/casting_bit_offset_pointer_to_regular_pointer.zig
+++ b/test/cases/compile_errors/casting_bit_offset_pointer_to_regular_pointer.zig
@@ -19,3 +19,5 @@ export fn entry() usize { return @sizeOf(@TypeOf(&foo)); }
// target=native
//
// :8:15: error: expected type '*const u3', found '*align(0:3:1) const u3'
+// :8:15: note: pointer host size '1' cannot cast into pointer host size '0'
+// :8:15: note: pointer bit offset '3' cannot cast into pointer bit offset '0'
diff --git a/test/cases/compile_errors/dont_implicit_cast_double_pointer_to_anyopaque.zig b/test/cases/compile_errors/dont_implicit_cast_double_pointer_to_anyopaque.zig
index 2ba566f221..44ae18ae8a 100644
--- a/test/cases/compile_errors/dont_implicit_cast_double_pointer_to_anyopaque.zig
+++ b/test/cases/compile_errors/dont_implicit_cast_double_pointer_to_anyopaque.zig
@@ -11,3 +11,4 @@ export fn entry() void {
// target=native
//
// :5:28: error: expected type '*anyopaque', found '**u32'
+// :5:28: note: pointer type child '*u32' cannot cast into pointer type child 'anyopaque'
diff --git a/test/cases/compile_errors/error_note_for_function_parameter_incompatibility.zig b/test/cases/compile_errors/error_note_for_function_parameter_incompatibility.zig
new file mode 100644
index 0000000000..c43df47dfd
--- /dev/null
+++ b/test/cases/compile_errors/error_note_for_function_parameter_incompatibility.zig
@@ -0,0 +1,13 @@
+fn do_the_thing(func: *const fn (arg: i32) void) void { _ = func; }
+fn bar(arg: bool) void { _ = arg; }
+export fn entry() void {
+ do_the_thing(bar);
+}
+
+// error
+// backend=stage2
+// target=native
+//
+// :4:17: error: expected type '*const fn(i32) void', found '*const fn(bool) void'
+// :4:17: note: pointer type child 'fn(bool) void' cannot cast into pointer type child 'fn(i32) void'
+// :4:17: note: parameter 0 'bool' cannot cast into 'i32'
diff --git a/test/cases/compile_errors/stage1/obj/implicit_cast_of_error_set_not_a_subset.zig b/test/cases/compile_errors/implicit_cast_of_error_set_not_a_subset.zig
index 5958a41639..0a182343b9 100644
--- a/test/cases/compile_errors/stage1/obj/implicit_cast_of_error_set_not_a_subset.zig
+++ b/test/cases/compile_errors/implicit_cast_of_error_set_not_a_subset.zig
@@ -9,8 +9,8 @@ fn foo(set1: Set1) void {
}
// error
-// backend=stage1
+// backend=stage2
// target=native
//
-// tmp.zig:7:19: error: expected type 'Set2', found 'Set1'
-// tmp.zig:1:23: note: 'error.B' not a member of destination error set
+// :7:19: error: expected type 'error{A,C}', found 'error{A,B}'
+// :7:19: note: 'error.B' not a member of destination error set
diff --git a/test/cases/compile_errors/implicit_casting_C_pointers_which_would_mess_up_null_semantics.zig b/test/cases/compile_errors/implicit_casting_C_pointers_which_would_mess_up_null_semantics.zig
new file mode 100644
index 0000000000..ecdc6c14c9
--- /dev/null
+++ b/test/cases/compile_errors/implicit_casting_C_pointers_which_would_mess_up_null_semantics.zig
@@ -0,0 +1,26 @@
+export fn entry() void {
+ var slice: []const u8 = "aoeu";
+ const opt_many_ptr: [*]const u8 = slice.ptr;
+ var ptr_opt_many_ptr = &opt_many_ptr;
+ var c_ptr: [*c]const [*c]const u8 = ptr_opt_many_ptr;
+ ptr_opt_many_ptr = c_ptr;
+}
+export fn entry2() void {
+ var buf: [4]u8 = "aoeu".*;
+ var slice: []u8 = &buf;
+ var opt_many_ptr: [*]u8 = slice.ptr;
+ var ptr_opt_many_ptr = &opt_many_ptr;
+ var c_ptr: [*c][*c]const u8 = ptr_opt_many_ptr;
+ _ = c_ptr;
+}
+
+// error
+// backend=stage2
+// target=native
+//
+// :6:24: error: expected type '*const [*]const u8', found '[*c]const [*c]const u8'
+// :6:24: note: pointer type child '[*c]const u8' cannot cast into pointer type child '[*]const u8'
+// :6:24: note: '[*c]const u8' could have null values which are illegal in type '[*]const u8'
+// :13:35: error: expected type '[*c][*c]const u8', found '*[*]u8'
+// :13:35: note: pointer type child '[*]u8' cannot cast into pointer type child '[*c]const u8'
+// :13:35: note: mutable '[*]u8' allows illegal null values stored to type '[*c]const u8'
diff --git a/test/cases/compile_errors/implicitly_casting_enum_to_tag_type.zig b/test/cases/compile_errors/implicitly_casting_enum_to_tag_type.zig
index b1930cb548..2f7686c93d 100644
--- a/test/cases/compile_errors/implicitly_casting_enum_to_tag_type.zig
+++ b/test/cases/compile_errors/implicitly_casting_enum_to_tag_type.zig
@@ -15,3 +15,4 @@ export fn entry() void {
// target=native
//
// :9:22: error: expected type 'u2', found 'tmp.Small'
+// :1:15: note: enum declared here
diff --git a/test/cases/compile_errors/incompatible_sentinels.zig b/test/cases/compile_errors/incompatible_sentinels.zig
new file mode 100644
index 0000000000..a2ed320e18
--- /dev/null
+++ b/test/cases/compile_errors/incompatible_sentinels.zig
@@ -0,0 +1,29 @@
+// Note: One of the error messages here is backwards. It would be nice to fix, but that's not
+// going to stop me from merging this branch which fixes a bunch of other stuff.
+export fn entry1(ptr: [*:255]u8) [*:0]u8 {
+ return ptr;
+}
+export fn entry2(ptr: [*]u8) [*:0]u8 {
+ return ptr;
+}
+export fn entry3() void {
+ var array: [2:0]u8 = [_:255]u8{ 1, 2 };
+ _ = array;
+}
+export fn entry4() void {
+ var array: [2:0]u8 = [_]u8{ 1, 2 };
+ _ = array;
+}
+
+// error
+// backend=stage2
+// target=native
+//
+// :4:12: error: expected type '[*:0]u8', found '[*:255]u8'
+// :4:12: note: pointer sentinel '255' cannot cast into pointer sentinel '0'
+// :7:12: error: expected type '[*:0]u8', found '[*]u8'
+// :7:12: note: destination pointer requires '0' sentinel
+// :10:35: error: expected type '[2:0]u8', found '[2:255]u8'
+// :10:35: note: array sentinel '255' cannot cast into array sentinel '0'
+// :14:31: error: expected type '[2:0]u8', found '[2]u8'
+// :14:31: note: destination array requires '0' sentinel
diff --git a/test/cases/compile_errors/incorrect_return_type.zig b/test/cases/compile_errors/incorrect_return_type.zig
index b37cbebc7f..7b678b68e3 100644
--- a/test/cases/compile_errors/incorrect_return_type.zig
+++ b/test/cases/compile_errors/incorrect_return_type.zig
@@ -19,3 +19,5 @@
// target=native
//
// :8:16: error: expected type 'tmp.A', found 'tmp.B'
+// :10:12: note: struct declared here
+// :4:12: note: struct declared here
diff --git a/test/cases/compile_errors/invalid_address_space_coercion.zig b/test/cases/compile_errors/invalid_address_space_coercion.zig
index fd49aecb32..1c42260a0e 100644
--- a/test/cases/compile_errors/invalid_address_space_coercion.zig
+++ b/test/cases/compile_errors/invalid_address_space_coercion.zig
@@ -11,3 +11,4 @@ pub fn main() void {
// target=x86_64-linux,x86_64-macos
//
// :2:12: error: expected type '*i32', found '*addrspace(.gs) i32'
+// :2:12: note: address space 'gs' cannot cast into address space 'generic'
diff --git a/test/cases/compile_errors/invalid_cast_from_integral_type_to_enum.zig b/test/cases/compile_errors/invalid_cast_from_integral_type_to_enum.zig
index ce2f64169b..0041976683 100644
--- a/test/cases/compile_errors/invalid_cast_from_integral_type_to_enum.zig
+++ b/test/cases/compile_errors/invalid_cast_from_integral_type_to_enum.zig
@@ -15,3 +15,4 @@ fn foo(x: usize) void {
// target=native
//
// :9:10: error: expected type 'usize', found 'tmp.E'
+// :1:11: note: enum declared here
diff --git a/test/cases/compile_errors/invalid_pointer_keeps_address_space_when_taking_address_of_dereference.zig b/test/cases/compile_errors/invalid_pointer_keeps_address_space_when_taking_address_of_dereference.zig
index 1560dcc46a..fb8e0d5fd4 100644
--- a/test/cases/compile_errors/invalid_pointer_keeps_address_space_when_taking_address_of_dereference.zig
+++ b/test/cases/compile_errors/invalid_pointer_keeps_address_space_when_taking_address_of_dereference.zig
@@ -11,3 +11,4 @@ pub fn main() void {
// target=x86_64-linux,x86_64-macos
//
// :2:12: error: expected type '*i32', found '*addrspace(.gs) i32'
+// :2:12: note: address space 'gs' cannot cast into address space 'generic'
diff --git a/test/cases/compile_errors/not_an_enum_type.zig b/test/cases/compile_errors/not_an_enum_type.zig
index 6868cf7dc0..063ee8a8d8 100644
--- a/test/cases/compile_errors/not_an_enum_type.zig
+++ b/test/cases/compile_errors/not_an_enum_type.zig
@@ -17,3 +17,4 @@ const ExpectedVarDeclOrFn = struct {};
// target=native
//
// :4:9: error: expected type '@typeInfo(tmp.Error).Union.tag_type.?', found 'type'
+// :8:1: note: enum declared here
diff --git a/test/cases/compile_errors/passing_a_not-aligned-enough_pointer_to_cmpxchg.zig b/test/cases/compile_errors/passing_a_not-aligned-enough_pointer_to_cmpxchg.zig
index 3ddd24f7a9..6deb06b1ff 100644
--- a/test/cases/compile_errors/passing_a_not-aligned-enough_pointer_to_cmpxchg.zig
+++ b/test/cases/compile_errors/passing_a_not-aligned-enough_pointer_to_cmpxchg.zig
@@ -10,3 +10,4 @@ export fn entry() bool {
// target=native
//
// :4:31: error: expected type '*i32', found '*align(1) i32'
+// :4:31: note: pointer alignment '1' cannot cast into pointer alignment '4'
diff --git a/test/cases/compile_errors/pointer_with_different_address_spaces.zig b/test/cases/compile_errors/pointer_with_different_address_spaces.zig
index b16c4a4e64..3f8c961174 100644
--- a/test/cases/compile_errors/pointer_with_different_address_spaces.zig
+++ b/test/cases/compile_errors/pointer_with_different_address_spaces.zig
@@ -11,3 +11,4 @@ export fn entry2() void {
// target=x86_64-linux,x86_64-macos
//
// :2:12: error: expected type '*addrspace(.fs) i32', found '*addrspace(.gs) i32'
+// :2:12: note: address space 'gs' cannot cast into address space 'fs'
diff --git a/test/cases/compile_errors/pointers_with_different_address_spaces.zig b/test/cases/compile_errors/pointers_with_different_address_spaces.zig
index 210c252893..2a7698d0d9 100644
--- a/test/cases/compile_errors/pointers_with_different_address_spaces.zig
+++ b/test/cases/compile_errors/pointers_with_different_address_spaces.zig
@@ -11,3 +11,4 @@ pub fn main() void {
// target=x86_64-linux,x86_64-macos
//
// :2:13: error: expected type '*i32', found '*addrspace(.gs) i32'
+// :2:13: note: address space 'gs' cannot cast into address space 'generic'
diff --git a/test/cases/compile_errors/shifting_RHS_is_log2_of_LHS_int_bit_width.zig b/test/cases/compile_errors/shifting_RHS_is_log2_of_LHS_int_bit_width.zig
index a2104d1aa6..5141062a0b 100644
--- a/test/cases/compile_errors/shifting_RHS_is_log2_of_LHS_int_bit_width.zig
+++ b/test/cases/compile_errors/shifting_RHS_is_log2_of_LHS_int_bit_width.zig
@@ -7,3 +7,4 @@ export fn entry(x: u8, y: u8) u8 {
// target=native
//
// :2:17: error: expected type 'u3', found 'u8'
+// :2:17: note: unsigned 3-bit int cannot represent all possible unsigned 8-bit values
diff --git a/test/cases/compile_errors/slice_sentinel_mismatch-2.zig b/test/cases/compile_errors/slice_sentinel_mismatch-2.zig
new file mode 100644
index 0000000000..b1ff905e26
--- /dev/null
+++ b/test/cases/compile_errors/slice_sentinel_mismatch-2.zig
@@ -0,0 +1,12 @@
+fn foo() [:0]u8 {
+ var x: []u8 = undefined;
+ return x;
+}
+comptime { _ = foo; }
+
+// error
+// backend=stage2
+// target=native
+//
+// :3:12: error: expected type '[:0]u8', found '[]u8'
+// :3:12: note: destination pointer requires '0' sentinel
diff --git a/test/cases/compile_errors/stage1/obj/cast_error_union_of_global_error_set_to_error_union_of_smaller_error_set.zig b/test/cases/compile_errors/stage1/obj/cast_error_union_of_global_error_set_to_error_union_of_smaller_error_set.zig
deleted file mode 100644
index 08962afc85..0000000000
--- a/test/cases/compile_errors/stage1/obj/cast_error_union_of_global_error_set_to_error_union_of_smaller_error_set.zig
+++ /dev/null
@@ -1,16 +0,0 @@
-const SmallErrorSet = error{A};
-export fn entry() void {
- var x: SmallErrorSet!i32 = foo();
- _ = x;
-}
-fn foo() anyerror!i32 {
- return error.B;
-}
-
-// error
-// backend=stage1
-// target=native
-//
-// tmp.zig:3:35: error: expected type 'SmallErrorSet!i32', found 'anyerror!i32'
-// tmp.zig:3:35: note: error set 'anyerror' cannot cast into error set 'SmallErrorSet'
-// tmp.zig:3:35: note: cannot cast global error set into smaller set
diff --git a/test/cases/compile_errors/stage1/obj/error_note_for_function_parameter_incompatibility.zig b/test/cases/compile_errors/stage1/obj/error_note_for_function_parameter_incompatibility.zig
deleted file mode 100644
index edc421d8f4..0000000000
--- a/test/cases/compile_errors/stage1/obj/error_note_for_function_parameter_incompatibility.zig
+++ /dev/null
@@ -1,12 +0,0 @@
-fn do_the_thing(func: fn (arg: i32) void) void { _ = func; }
-fn bar(arg: bool) void { _ = arg; }
-export fn entry() void {
- do_the_thing(bar);
-}
-
-// error
-// backend=stage1
-// target=native
-//
-// tmp.zig:4:18: error: expected type 'fn(i32) void', found 'fn(bool) void
-// tmp.zig:4:18: note: parameter 0: 'bool' cannot cast into 'i32'
diff --git a/test/cases/compile_errors/stage1/obj/implicit_casting_C_pointers_which_would_mess_up_null_semantics.zig b/test/cases/compile_errors/stage1/obj/implicit_casting_C_pointers_which_would_mess_up_null_semantics.zig
deleted file mode 100644
index 760bab41da..0000000000
--- a/test/cases/compile_errors/stage1/obj/implicit_casting_C_pointers_which_would_mess_up_null_semantics.zig
+++ /dev/null
@@ -1,26 +0,0 @@
-export fn entry() void {
- var slice: []const u8 = "aoeu";
- const opt_many_ptr: [*]const u8 = slice.ptr;
- var ptr_opt_many_ptr = &opt_many_ptr;
- var c_ptr: [*c]const [*c]const u8 = ptr_opt_many_ptr;
- ptr_opt_many_ptr = c_ptr;
-}
-export fn entry2() void {
- var buf: [4]u8 = "aoeu".*;
- var slice: []u8 = &buf;
- var opt_many_ptr: [*]u8 = slice.ptr;
- var ptr_opt_many_ptr = &opt_many_ptr;
- var c_ptr: [*c][*c]const u8 = ptr_opt_many_ptr;
- _ = c_ptr;
-}
-
-// error
-// backend=stage1
-// target=native
-//
-// tmp.zig:6:24: error: expected type '*const [*]const u8', found '[*c]const [*c]const u8'
-// tmp.zig:6:24: note: pointer type child '[*c]const u8' cannot cast into pointer type child '[*]const u8'
-// tmp.zig:6:24: note: '[*c]const u8' could have null values which are illegal in type '[*]const u8'
-// tmp.zig:13:35: error: expected type '[*c][*c]const u8', found '*[*]u8'
-// tmp.zig:13:35: note: pointer type child '[*]u8' cannot cast into pointer type child '[*c]const u8'
-// tmp.zig:13:35: note: mutable '[*c]const u8' allows illegal null values stored to type '[*]u8'
diff --git a/test/cases/compile_errors/stage1/obj/incompatible_sentinels.zig b/test/cases/compile_errors/stage1/obj/incompatible_sentinels.zig
deleted file mode 100644
index a292ae3d7c..0000000000
--- a/test/cases/compile_errors/stage1/obj/incompatible_sentinels.zig
+++ /dev/null
@@ -1,29 +0,0 @@
-// Note: One of the error messages here is backwards. It would be nice to fix, but that's not
-// going to stop me from merging this branch which fixes a bunch of other stuff.
-export fn entry1(ptr: [*:255]u8) [*:0]u8 {
- return ptr;
-}
-export fn entry2(ptr: [*]u8) [*:0]u8 {
- return ptr;
-}
-export fn entry3() void {
- var array: [2:0]u8 = [_:255]u8{ 1, 2 };
- _ = array;
-}
-export fn entry4() void {
- var array: [2:0]u8 = [_]u8{ 1, 2 };
- _ = array;
-}
-
-// error
-// backend=stage1
-// target=native
-//
-// tmp.zig:4:12: error: expected type '[*:0]u8', found '[*:255]u8'
-// tmp.zig:4:12: note: destination pointer requires a terminating '0' sentinel, but source pointer has a terminating '255' sentinel
-// tmp.zig:7:12: error: expected type '[*:0]u8', found '[*]u8'
-// tmp.zig:7:12: note: destination pointer requires a terminating '0' sentinel
-// tmp.zig:10:35: error: expected type '[2:255]u8', found '[2:0]u8'
-// tmp.zig:10:35: note: destination array requires a terminating '255' sentinel, but source array has a terminating '0' sentinel
-// tmp.zig:14:31: error: expected type '[2:0]u8', found '[2]u8'
-// tmp.zig:14:31: note: destination array requires a terminating '0' sentinel
diff --git a/test/cases/compile_errors/stage1/obj/slice_sentinel_mismatch-2.zig b/test/cases/compile_errors/stage1/obj/slice_sentinel_mismatch-2.zig
deleted file mode 100644
index 5f8d312a3c..0000000000
--- a/test/cases/compile_errors/stage1/obj/slice_sentinel_mismatch-2.zig
+++ /dev/null
@@ -1,12 +0,0 @@
-fn foo() [:0]u8 {
- var x: []u8 = undefined;
- return x;
-}
-comptime { _ = foo; }
-
-// error
-// backend=stage1
-// target=native
-//
-// tmp.zig:3:12: error: expected type '[:0]u8', found '[]u8'
-// tmp.zig:3:12: note: destination pointer requires a terminating '0' sentinel
diff --git a/test/cases/compile_errors/stage1/obj/type_checking_function_pointers.zig b/test/cases/compile_errors/stage1/obj/type_checking_function_pointers.zig
deleted file mode 100644
index b88b6bdb52..0000000000
--- a/test/cases/compile_errors/stage1/obj/type_checking_function_pointers.zig
+++ /dev/null
@@ -1,13 +0,0 @@
-fn a(b: fn (*const u8) void) void {
- b('a');
-}
-fn c(d: u8) void {_ = d;}
-export fn entry() void {
- a(c);
-}
-
-// error
-// backend=stage1
-// target=native
-//
-// tmp.zig:6:7: error: expected type 'fn(*const u8) void', found 'fn(u8) void'
diff --git a/test/cases/compile_errors/type_checking_function_pointers.zig b/test/cases/compile_errors/type_checking_function_pointers.zig
new file mode 100644
index 0000000000..e6c7a7a1f7
--- /dev/null
+++ b/test/cases/compile_errors/type_checking_function_pointers.zig
@@ -0,0 +1,15 @@
+fn a(b: *const fn (*const u8) void) void {
+ _ = b;
+}
+fn c(d: u8) void {_ = d;}
+export fn entry() void {
+ a(c);
+}
+
+// error
+// backend=stage2
+// target=native
+//
+// :6:6: error: expected type '*const fn(*const u8) void', found '*const fn(u8) void'
+// :6:6: note: pointer type child 'fn(u8) void' cannot cast into pointer type child 'fn(*const u8) void'
+// :6:6: note: parameter 0 'u8' cannot cast into '*const u8'
diff --git a/test/cases/compile_errors/type_mismatch_in_C_prototype_with_varargs.zig b/test/cases/compile_errors/type_mismatch_in_C_prototype_with_varargs.zig
index 125ded95d6..1e7acb55b8 100644
--- a/test/cases/compile_errors/type_mismatch_in_C_prototype_with_varargs.zig
+++ b/test/cases/compile_errors/type_mismatch_in_C_prototype_with_varargs.zig
@@ -11,3 +11,5 @@ export fn main() void {
// target=native
//
// :5:22: error: expected type 'fn([*c]u8, ...) callconv(.C) void', found 'fn([*:0]u8, ...) callconv(.C) void'
+// :5:22: note: parameter 0 '[*:0]u8' cannot cast into '[*c]u8'
+// :5:22: note: '[*c]u8' could have null values which are illegal in type '[*:0]u8'
diff --git a/test/cases/compile_errors/wrong_type_for_reify_type.zig b/test/cases/compile_errors/wrong_type_for_reify_type.zig
index 7f712b441f..b88f6563b5 100644
--- a/test/cases/compile_errors/wrong_type_for_reify_type.zig
+++ b/test/cases/compile_errors/wrong_type_for_reify_type.zig
@@ -7,3 +7,4 @@ export fn entry() void {
// target=native
//
// :2:15: error: expected type 'builtin.Type', found 'comptime_int'
+// :?:?: note: union declared here