Constant panic [src]
This namespace is used by the Zig compiler to emit various kinds of safety
panics. These can be overridden by making a public panic namespace in the
root source file.
Type
type
Source
pub const panic: type = p: {
if (@hasDecl(root, "panic")) {
if (@TypeOf(root.panic) != type) {
// Deprecated; make `panic` a namespace instead.
break :p std.debug.FullPanic(struct {
fn panic(msg: []const u8, ra: ?usize) noreturn {
root.panic(msg, @errorReturnTrace(), ra);
}
}.panic);
}
break :p root.panic;
}
if (@hasDecl(root, "Panic")) {
break :p root.Panic; // Deprecated; use `panic` instead.
}
if (builtin.zig_backend == .stage2_riscv64) {
break :p std.debug.simple_panic;
}
break :p std.debug.FullPanic(std.debug.defaultPanic);
}