Skip to content

Commit 638a6a8

Browse files
committed
catch_panic: warn about panicking payload drop
1 parent e08d065 commit 638a6a8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: 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)