Skip to content

Commit c1d06cc

Browse files
committed
Add a note on foreign exceptions
1 parent 5b8c614 commit c1d06cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

library/std/src/sync/poison/mutex.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ use crate::sys::sync as sys;
4646
/// storing the guard to a [`Cell`] within [`Drop::drop`] and accessing it
4747
/// outside, or vice versa, can affect poisoning status in an unexpected way.
4848
///
49+
/// - Foreign exceptions do not currently trigger poisoning even in absence of
50+
/// other panics.
51+
///
4952
/// While this rarely happens in realistic code, `unsafe` code cannot rely on
5053
/// poisoning for soundness, since the behavior of poisoning can depend on
5154
/// outside context. Here's an example of **incorrect** use of poisoning:

0 commit comments

Comments
 (0)