builtintrap
Builtintrap is a programming construct used by several languages and their compilers to intentionally trigger a trap, an abrupt interruption of program execution. It represents a non-returning operation that transfers control to the runtime or environment in a way that is typically not catchable as a normal error. The exact effect varies by architecture and implementation, but it is generally used to indicate unreachable code, critical failures, or a deliberate abort in low-level code.
In practice, a builtin trap is usually implemented as a compiler intrinsic. In C and C++, compilers
Other ecosystems describe similar capabilities under different names, often mapped to an underlying LLVM or machine
Use cases include asserting invariants in performance-critical code, providing a compact way to implement unreachable branches,
See also: trap instruction, __builtin_unreachable, abort, panic, unreachable.