Skip to content
Standard libraryZig 0.17.1Official documentation
Sourcestd/debug/no_panic.zig

Source line 1

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.

std.debug.no_panic.call

function

Source line 8

pub fn call(_: []const u8, _: ?usize) noreturn

Parameters

_: []const u8
_: ?usize

std.debug.no_panic.castToNull

function

Source line 53

pub fn castToNull() noreturn

std.debug.no_panic.copyLenMismatch

function

Source line 128

pub fn copyLenMismatch() noreturn

std.debug.no_panic.corruptSwitch

function

Source line 108

pub fn corruptSwitch() noreturn

std.debug.no_panic.divideByZero

function

Source line 93

pub fn divideByZero() noreturn

std.debug.no_panic.exactDivisionRemainder

function

Source line 98

pub fn exactDivisionRemainder() noreturn

std.debug.no_panic.forLenMismatch

function

Source line 123

pub fn forLenMismatch() noreturn

std.debug.no_panic.inactiveUnionField

function

Source line 33

pub fn inactiveUnionField(_: anytype, _: anytype) noreturn

std.debug.no_panic.incorrectAlignment

function

Source line 58

pub fn incorrectAlignment() noreturn

std.debug.no_panic.integerOutOfBounds

function

Source line 73

pub fn integerOutOfBounds() noreturn

std.debug.no_panic.integerOverflow

function

Source line 78

pub fn integerOverflow() noreturn

std.debug.no_panic.integerPartOutOfBounds

function

Source line 103

pub fn integerPartOutOfBounds() noreturn

std.debug.no_panic.invalidEnumValue

function

Source line 118

pub fn invalidEnumValue() noreturn

std.debug.no_panic.invalidErrorCode

function

Source line 63

pub fn invalidErrorCode() noreturn

std.debug.no_panic.loadUninstantiableType

function

Source line 143

pub fn loadUninstantiableType() noreturn

std.debug.no_panic.memcpyAlias

function

Source line 133

pub fn memcpyAlias() noreturn

std.debug.no_panic.noreturnReturned

function

Source line 138

pub fn noreturnReturned() noreturn

std.debug.no_panic.outOfBounds

function

Source line 23

pub fn outOfBounds(_: usize, _: usize) noreturn

Parameters

_: usize
_: usize

std.debug.no_panic.reachedUnreachable

function

Source line 43

pub fn reachedUnreachable() noreturn

std.debug.no_panic.sentinelMismatch

function

Source line 13

pub fn sentinelMismatch(_: anytype, _: anytype) noreturn

std.debug.no_panic.shiftRhsTooBig

function

Source line 113

pub fn shiftRhsTooBig() noreturn

std.debug.no_panic.shlOverflow

function

Source line 83

pub fn shlOverflow() noreturn

std.debug.no_panic.shrOverflow

function

Source line 88

pub fn shrOverflow() noreturn

std.debug.no_panic.sliceCastLenRemainder

function

Source line 38

pub fn sliceCastLenRemainder(_: usize) noreturn

Parameters

_: usize

std.debug.no_panic.startGreaterThanEnd

function

Source line 28

pub fn startGreaterThanEnd(_: usize, _: usize) noreturn

Parameters

_: usize
_: usize

std.debug.no_panic.std

alias

Source line 6

Alias of std

std.debug.no_panic.unexpectedErrorCode

function

Source line 68

pub fn unexpectedErrorCode(_: anyerror) noreturn

Parameters

_: anyerror

std.debug.no_panic.unwrapError

function

Source line 18

pub fn unwrapError(_: anyerror) noreturn

Parameters

_: anyerror

std.debug.no_panic.unwrapNull

function

Source line 48

pub fn unwrapNull() noreturn
Source code

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`.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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