From 327181a1a5d51769351296c164f3cc506812e12b Mon Sep 17 00:00:00 2001 From: whatisaphone Date: Sun, 20 Sep 2026 15:04:44 -0400 Subject: [PATCH] Fix simple_panic --- lib/std/debug/simple_panic.zig | 2 +- test/cases/std_debug_no_panic.zig | 9 +++++++++ test/cases/std_debug_simple_panic.zig | 9 +++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 test/cases/std_debug_no_panic.zig create mode 100644 test/cases/std_debug_simple_panic.zig diff --git a/lib/std/debug/simple_panic.zig b/lib/std/debug/simple_panic.zig index 8453aadbb985766f749199c0bac617cb858afe04..60c64324405ea53bba07374fc1d8ac8fbdebfb68 100644 --- a/lib/std/debug/simple_panic.zig +++ b/lib/std/debug/simple_panic.zig @@ -84,7 +84,7 @@ pub fn invalidErrorCode() noreturn { pub fn unexpectedErrorCode(err: anyerror) noreturn { @branchHint(.cold); - _ = err; + _ = &err; call("unexpected error code", null); } diff --git a/test/cases/std_debug_no_panic.zig b/test/cases/std_debug_no_panic.zig new file mode 100644 index 0000000000000000000000000000000000000000..63b8183d51a072c1a286f1fd13f10ea26b9374ae --- /dev/null +++ b/test/cases/std_debug_no_panic.zig @@ -0,0 +1,9 @@ +const std = @import("std"); + +pub const panic = std.debug.no_panic; + +pub fn main() void { + @panic("this makes the compiler reference the panic namespace"); +} + +// compile diff --git a/test/cases/std_debug_simple_panic.zig b/test/cases/std_debug_simple_panic.zig new file mode 100644 index 0000000000000000000000000000000000000000..3655fd7e4d048d05926aa63e2d30206fce018e11 --- /dev/null +++ b/test/cases/std_debug_simple_panic.zig @@ -0,0 +1,9 @@ +const std = @import("std"); + +pub const panic = std.debug.simple_panic; + +pub fn main() void { + @panic("this makes the compiler reference the panic namespace"); +} + +// compile -- 2.54.0