trap 0.2.1

Bare metal trapping.
Documentation
# `trap-rs`

This library provides the [`trap`] function for aborting Rust programmes without the [`std`] crate.

[`trap`]: <https://docs.rs/trap/latest/trap/fn.trap.html>
[`std`]: <https://doc.rust-lang.org/nightly/std/index.html>

Fundamentally, the goal of this crate is to allow for abnormal programme termination with more or less the guarantee that execution of the current code path will stop.
Usually, [`std::process::abort`] is used for this, but on platforms or in crates without `std`, this is not possible.

[`std::process::abort`]: <https://doc.rust-lang.org/nightly/std/process/fn.abort.html>

## Features

The `std` feature can be enabled to allow for raising the [`SIGABRT`] signal when calling [`trap`].
Furthermore, the `nightly` feature can be enabled for more architectural support in cases where the [`std`] crate isn't available.

[`SIGABRT`]: <https://pubs.opengroup.org/onlinepubs/7908799/xsh/signal.h.html>
[`trap`]: <https://docs.rs/trap/latest/trap/fn.trap.html>
[`std`]: <https://doc.rust-lang.org/nightly/std/index.html>

## Platform support

The following, target architectures have special code paths that do not yield infinite loops by default:

* `aarch64`
* `arm`
* `loongarch32`
* `loongarch64`
* `riscv32`
* `riscv64`
* `x86`
* `x86_64`

Additionally, with the `nightly` feature enabled, the following architectures are supported as well:

* `powerpc`
* `powerpc64`
* `sparc`
* `sparc64`
* `wasm32`

Other targets will, by default, halt all execution in an infinite loop.

## Copyright & Licence

Copyright &#169; 2025 Gabriel Bj&#248;rnager Jensen.

`trap-rs` is distributed under either an MIT licence (see `LICENCE-MIT.txt`) or version 2.0 of the Apache License (see `LICENCE-APACHE.txt`), at your option.