| author | |
| committer | |
| log | 996321250d9a9438fc65fcfe64a0d6ada04e50a0 |
| tree | 363e0577c74fd6218aec86c90c6015e3432df9b9 |
| parent | b5908c03d6e09494b38ff596b39fdf0eed7258a3 |
3 files changed, 19 insertions(+), 1 deletions(-)
lib/std/debug/simple_panic.zig+1-1| ... | @@ -84,7 +84,7 @@ pub fn invalidErrorCode() noreturn { | ... | @@ -84,7 +84,7 @@ pub fn invalidErrorCode() noreturn { |
| 84 | 84 | ||
| 85 | pub fn unexpectedErrorCode(err: anyerror) noreturn { | 85 | pub fn unexpectedErrorCode(err: anyerror) noreturn { |
| 86 | @branchHint(.cold); | 86 | @branchHint(.cold); |
| 87 | _ = err; | 87 | _ = &err; |
| 88 | call("unexpected error code", null); | 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 | ||