mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
make zig roc_panic
return type be noreturn
and remove some unreachable
calls
This commit is contained in:
parent
2a762f1379
commit
a5180bed67
3 changed files with 4 additions and 18 deletions
|
@ -2,14 +2,14 @@ const std = @import("std");
|
|||
const RocStr = @import("str.zig").RocStr;
|
||||
|
||||
// Signals to the host that the program has panicked
|
||||
extern fn roc_panic(msg: *const RocStr, tag_id: u32) callconv(.C) void;
|
||||
extern fn roc_panic(msg: *const RocStr, tag_id: u32) callconv(.C) noreturn;
|
||||
|
||||
pub fn panic_help(msg: []const u8, tag_id: u32) void {
|
||||
pub fn panic_help(msg: []const u8, tag_id: u32) noreturn {
|
||||
var str = RocStr.init(msg.ptr, msg.len);
|
||||
roc_panic(&str, tag_id);
|
||||
}
|
||||
|
||||
// must export this explicitly because right now it is not used from zig code
|
||||
pub fn panic(msg: *const RocStr, alignment: u32) callconv(.C) void {
|
||||
pub fn panic(msg: *const RocStr, alignment: u32) callconv(.C) noreturn {
|
||||
return roc_panic(msg, alignment);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue