From 32e88251e48d9f4a412b08acbd04d5694ec91e19 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 15 Jan 2024 01:53:41 -0700 Subject: [PATCH] update test case for new const/var compile error commit 8afafa717f5c036595a3a781c63b6be7b478c025 was created when this error did not exist yet. --- .../slice_of_single-item_pointer_bounds.zig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/cases/compile_errors/slice_of_single-item_pointer_bounds.zig b/test/cases/compile_errors/slice_of_single-item_pointer_bounds.zig index 17c031f12b..8b43842f23 100644 --- a/test/cases/compile_errors/slice_of_single-item_pointer_bounds.zig +++ b/test/cases/compile_errors/slice_of_single-item_pointer_bounds.zig @@ -19,11 +19,13 @@ comptime { export fn entry1() void { var start: usize = 0; + _ = &start; _ = ptr[start..2]; } export fn entry2() void { var end: usize = 0; + _ = &end; _ = ptr[0..end]; } @@ -35,7 +37,7 @@ export fn entry2() void { // :13:16: error: slice of single-item pointer must have comptime-known bounds [0..0], [0..1], or [1..1] // :13:16: note: expected '1', found '2' // :17:16: error: end index 2 out of bounds for slice of single-item pointer -// :22:13: error: unable to resolve comptime value -// :22:13: note: slice of single-item pointer must have comptime-known bounds [0..0], [0..1], or [1..1] -// :27:16: error: unable to resolve comptime value -// :27:16: note: slice of single-item pointer must have comptime-known bounds [0..0], [0..1], or [1..1] +// :23:13: error: unable to resolve comptime value +// :23:13: note: slice of single-item pointer must have comptime-known bounds [0..0], [0..1], or [1..1] +// :29:16: error: unable to resolve comptime value +// :29:16: note: slice of single-item pointer must have comptime-known bounds [0..0], [0..1], or [1..1]