zig/lib/std / debug/no_panic.zig

This namespace can be used with pub const panic = std.debug.no_panic; in the root file. It emits as little code as possible, for testing purposes. For a functional alternative, see std.debug.FullPanic.

//! This namespace can be used with `pub const panic = std.debug.no_panic;` in the root file.
//! It emits as little code as possible, for testing purposes.
//!
//! For a functional alternative, see `std.debug.FullPanic`.

call()


const std = @import("../std.zig");

sentinelMismatch()


pub fn call(_: []const u8, _: ?usize) noreturn {
    @branchHint(.cold);
    @trap();
}

unwrapError()


pub fn sentinelMismatch(_: anytype, _: anytype) noreturn {
    @branchHint(.cold);
    @trap();
}

outOfBounds()


pub fn unwrapError(_: anyerror) noreturn {
    @branchHint(.cold);
    @trap();
}

startGreaterThanEnd()


pub fn outOfBounds(_: usize, _: usize) noreturn {
    @branchHint(.cold);
    @trap();
}

inactiveUnionField()


pub fn startGreaterThanEnd(_: usize, _: usize) noreturn {
    @branchHint(.cold);
    @trap();
}

sliceCastLenRemainder()


pub fn inactiveUnionField(_: anytype, _: anytype) noreturn {
    @branchHint(.cold);
    @trap();
}

reachedUnreachable()


pub fn sliceCastLenRemainder(_: usize) noreturn {
    @branchHint(.cold);
    @trap();
}

unwrapNull()


pub fn reachedUnreachable() noreturn {
    @branchHint(.cold);
    @trap();
}

castToNull()


pub fn unwrapNull() noreturn {
    @branchHint(.cold);
    @trap();
}

incorrectAlignment()


pub fn castToNull() noreturn {
    @branchHint(.cold);
    @trap();
}

invalidErrorCode()


pub fn incorrectAlignment() noreturn {
    @branchHint(.cold);
    @trap();
}

castTruncatedData()


pub fn invalidErrorCode() noreturn {
    @branchHint(.cold);
    @trap();
}

negativeToUnsigned()


pub fn castTruncatedData() noreturn {
    @branchHint(.cold);
    @trap();
}

integerOverflow()


pub fn negativeToUnsigned() noreturn {
    @branchHint(.cold);
    @trap();
}

shlOverflow()


pub fn integerOverflow() noreturn {
    @branchHint(.cold);
    @trap();
}

shrOverflow()


pub fn shlOverflow() noreturn {
    @branchHint(.cold);
    @trap();
}

divideByZero()


pub fn shrOverflow() noreturn {
    @branchHint(.cold);
    @trap();
}

exactDivisionRemainder()


pub fn divideByZero() noreturn {
    @branchHint(.cold);
    @trap();
}

integerPartOutOfBounds()


pub fn exactDivisionRemainder() noreturn {
    @branchHint(.cold);
    @trap();
}

corruptSwitch()


pub fn integerPartOutOfBounds() noreturn {
    @branchHint(.cold);
    @trap();
}

shiftRhsTooBig()


pub fn corruptSwitch() noreturn {
    @branchHint(.cold);
    @trap();
}

invalidEnumValue()


pub fn shiftRhsTooBig() noreturn {
    @branchHint(.cold);
    @trap();
}

forLenMismatch()


pub fn invalidEnumValue() noreturn {
    @branchHint(.cold);
    @trap();
}

memcpyLenMismatch()


pub fn forLenMismatch() noreturn {
    @branchHint(.cold);
    @trap();
}

memcpyAlias()


pub fn memcpyLenMismatch() noreturn {
    @branchHint(.cold);
    @trap();
}

noreturnReturned()


pub fn memcpyAlias() noreturn {
    @branchHint(.cold);
    @trap();
}

pub fn noreturnReturned() noreturn {
    @branchHint(.cold);
    @trap();
}