Skip to content

Commit

Permalink
Rewrite platform support section
Browse files Browse the repository at this point in the history
  • Loading branch information
purplesyringa committed Oct 30, 2024
1 parent c6a0153 commit bb11066
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
//! Throw an exception with [`throw`], catch it with [`catch`] or the more low-level [`intercept`].
//! Unlike with Rust panics, non-[`Send`] and non-`'static` types can be used soundly.
//!
//! Using the `panic = "abort"` strategy breaks Lithium; avoid doing that.
//!
//! For interop, all crates that depend on Lithium need to use the same version:
//!
//! ```toml
Expand All @@ -24,17 +26,22 @@
//!
//! # Platform support
//!
//! At the moment, the custom mechanism is only supported on nightly on the following platforms:
//! On stable Rust, Lithium uses the built-in panic mechanism, tweaking it to increase performance
//! just a little bit.
//!
//! On nightly Rust, Lithium uses a custom mechanism on the following targets:
//!
//! - Unix-like targets (Linux and macOS included)
//! - Windows (both MinGW and MSVC)
//! - WASM
//! |Target |Implementation|Performance |`no_std` support|
//! |-------------------|--------------|---------------------------------------------|----------------|
//! |Linux, macOS |Itanium EH ABI|2.5x faster than panics |Yes |
//! |Windows (MSVC ABI) |SEH |1.5x faster than panics |Yes |
//! |Windows (GNU ABI) |Itanium EH ABI|2.5x faster than panics, but slower than MSVC|No |
//!
//! This mechanism works with `#![no_std]`, as long as the Itanium EH unwinder is linked in. Use
//! `default-features = false` feature to enable no-std support.
//! Lithium strives to support all targets that Rust panics support. If Lithium does not work
//! correctly on such a target, please open an issue.
//!
//! On stable, when compiled with MSVC on Windows, or on more exotic platforms, exception handling
//! is gracefully degraded to Rust panics. This requires `std`.
//! `no_std` support can be enabled by using `default-features = false` (only on nightly). This
//! requires an Itanium EH unwinder to be linked in on targets that use it as the implementation.
//!
//!
//! # Safety
Expand Down

0 comments on commit bb11066

Please sign in to comment.