Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 204805a

Browse files
committedMar 31, 2024
Auto merge of rust-lang#123266 - RalfJung:catch-panic, r=workingjubilee
catch_panic: warn about panicking payload drop Warns about the footgun in rust-lang#86027. Will be unnecessary if panics escaping from drop leads to abort (rust-lang/rfcs#3288). But until that is enforced everywhere, let's warn users about this.
2 parents bf71dae + 42972f5 commit 204805a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎library/std/src/panic.rs

+3
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ where
126126
/// Also note that unwinding into Rust code with a foreign exception (e.g.
127127
/// an exception thrown from C++ code) is undefined behavior.
128128
///
129+
/// Finally, be **careful in how you drop the result of this function**.
130+
/// If it is `Err`, it contains the panic payload, and dropping that may in turn panic!
131+
///
129132
/// # Examples
130133
///
131134
/// ```

0 commit comments

Comments
 (0)
Failed to load comments.