nounwind-macros

Crates.ionounwind-macros
lib.rsnounwind-macros
version0.1.0
created_at2025-09-11 18:49:02.780739+00
updated_at2025-09-11 18:49:02.780739+00
descriptionImplementation of the #[nounwind] attribute macro
homepage
repositoryhttps://github.com/Techcable/nounwind.rs
max_upload_size
id1834341
size5,657
(Techcable)

documentation

README

threadid.rs

Defines a #[nounwind] attribute macro that prevents panics from unwinding, similar to the C++ noexcept specifier.

This is clearer than using a drop guard, and in some versions of Rust can provide a better error message. In particular, aborting panics will often print a messages like "panic in a function that cannot unwind", although this behavior is version-specific and not guaranteed to occur.

The crate also provides a polyfill for the nightly std::panic::abort_unwind function. The #[noexcept] attribute is implemented in terms of this function.

On older versions, this requires use of libabort to abort the program. This is necessary to support aborts in #[no_std] mode. Enabling the std feature simply makes libabort delegate to std::process::abort.

License

Licensed under either the Apache 2.0 License or MIT License at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 2

cargo fmt