Files
zig/std/panic.zig
Andrew Kelley 451ce09067 new unreachable syntax
* `noreturn` is the primitive type.
 * `unreachable` is a control flow keyword.
 * `@unreachable()` builtin function is deleted.

closes #214
2017-03-26 04:58:48 -04:00

13 lines
422 B
Zig

// This file is included if and only if the user's main source file does not
// include a public panic function.
// If this file wants to import other files *by name*, support for that would
// have to be added in the compiler.
pub coldcc fn panic(message: []const u8) -> noreturn {
if (@compileVar("os") == Os.freestanding) {
while (true) {}
} else {
@import("std").debug.panic(message);
}
}