mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
improve zig panic clarity
This commit is contained in:
parent
eef5b1a349
commit
2bbb17c1de
1 changed files with 6 additions and 4 deletions
|
@ -394,11 +394,13 @@ fn exportUtilsFn(comptime func: anytype, comptime func_name: []const u8) void {
|
|||
|
||||
// Custom panic function, as builtin Zig version errors during LLVM verification
|
||||
pub fn panic(message: []const u8, stacktrace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
|
||||
if (builtin.is_test) {
|
||||
std.debug.print("{s}: {?}", .{ message, stacktrace });
|
||||
if (builtin.target.cpu.arch != .wasm32) {
|
||||
std.debug.print("\nSomehow in unreachable zig panic!\nThis is a roc standard libarry bug\n{s}: {?}", .{ message, stacktrace });
|
||||
std.process.abort();
|
||||
} else {
|
||||
// Can't call abort or print from wasm. Just leave it as unreachable.
|
||||
unreachable;
|
||||
}
|
||||
|
||||
unreachable;
|
||||
}
|
||||
|
||||
// Run all tests in imported modules
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue