3 files changed, 19 insertions(+), 1 deletions(-)
lib/std/debug/simple_panic.zig+1-1
| ... | ... | @@ -84,7 +84,7 @@ pub fn invalidErrorCode() noreturn { |
| 84 | 84 | |
| 85 | 85 | pub fn unexpectedErrorCode(err: anyerror) noreturn { |
| 86 | 86 | @branchHint(.cold); |
| 87 | | _ = err; |
| 87 | _ = &err; |
| 88 | 88 | call("unexpected error code", null); |
| 89 | 89 | } |
| 90 | 90 | |
test/cases/std_debug_no_panic.zig created+9
| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | const std = @import("std"); |
| 2 | |
| 3 | pub const panic = std.debug.no_panic; |
| 4 | |
| 5 | pub fn main() void { |
| 6 | @panic("this makes the compiler reference the panic namespace"); |
| 7 | } |
| 8 | |
| 9 | // compile |
test/cases/std_debug_simple_panic.zig created+9
| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | const std = @import("std"); |
| 2 | |
| 3 | pub const panic = std.debug.simple_panic; |
| 4 | |
| 5 | pub fn main() void { |
| 6 | @panic("this makes the compiler reference the panic namespace"); |
| 7 | } |
| 8 | |
| 9 | // compile |