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