Skip to main content

Module aborts

Module aborts 

Source
Expand description

The message a source program aborts with, in the words of the source language, so every target aborts where the source does with the message the source prints.

Machine integers are Rust’s, whose arithmetic panics (overflow checks on, as in a debug build) with these messages; BigInt division by zero is JavaScript’s RangeError; a natural parameter is a JavaScript BigInt parameter whose leading guard throws its own message.

Mirrors js/src/translation/aborts.js.

Functions§

cast_message
The abort of a checked conversion of a negative integer to a natural: the guard’s own message.
overflow_message
The panic of a machine-integer operation whose result is out of range: op is add, sub, mul, div, rem or neg.
rust_macro_message
The message of panic!, unreachable!, unimplemented! and todo!, with an optional literal message.
zero_divisor_message
The abort of an integer division or remainder by zero.