Skip to content

Commit

Permalink
Merge pull request #67 from dtolnay/unwind
Browse files Browse the repository at this point in the history
Clarify panic="unwind" requirement
  • Loading branch information
dtolnay authored Dec 22, 2024
2 parents a2f1c4f + 7c32821 commit 71f2deb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ provides the name of the offending function.
detection. This includes `cargo build` of library crates and `cargo check` of
binary and library crates.

- The attribute is useless in code built with `panic = "abort"`.
- The attribute is useless in code built with `panic = "abort"`. Code must be
built with `panic = "unwind"` (the default) in order for any panics to be
detected. After confirming absence of panics, you can of course still ship
your software as a `panic = "abort"` build.

If you find that code requires optimization to pass `#[no_panic]`, either make
no-panic an optional dependency that you only enable in release builds, or add a
Expand Down
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@
//! detection. This includes `cargo build` of library crates and `cargo check`
//! of binary and library crates.
//!
//! - The attribute is useless in code built with `panic = "abort"`.
//! - The attribute is useless in code built with `panic = "abort"`. Code must
//! be built with `panic = "unwind"` (the default) in order for any panics to
//! be detected. After confirming absence of panics, you can of course still
//! ship your software as a `panic = "abort"` build.
//!
//! If you find that code requires optimization to pass `#[no_panic]`, either
//! make no-panic an optional dependency that you only enable in release builds,
Expand Down

0 comments on commit 71f2deb

Please sign in to comment.