← core

core/process.kur

//! Process traps and termination primitives.
// Ending the program from code that has no operating system: `trap`, a
// builtin, stops it at once with the machine's trap instruction (C's
// `__builtin_trap`), which the host reports as a signal. Nothing after it
// runs and nothing is flushed or unwound, so it breaks no invariant and is
// safe to call. Its type is `fn() -> !`, so it stands in any expression
// position; core's aborting accessors (`Option::unwrap`, `Slice::at`, ...)
// use it when asked for what is not there.
export builtin::trap;