diff options
| author | Alisa Sireneva <me@purplesyringa.moe> | 2025-07-25 22:14:02 +0300 |
|---|---|---|
| committer | Alisa Sireneva <me@purplesyringa.moe> | 2025-07-25 22:14:02 +0300 |
| commit | c1d06cccaed537c799838dc5338dda28bbace52b (patch) | |
| tree | ada0e9d351745f39c7f2af5af07f9a995289002b /library/std/src/sync | |
| parent | 5b8c61494f85a58759dad04194c8353de07d75e1 (diff) | |
| download | rust-c1d06cccaed537c799838dc5338dda28bbace52b.tar.gz rust-c1d06cccaed537c799838dc5338dda28bbace52b.zip | |
Add a note on foreign exceptions
Diffstat (limited to 'library/std/src/sync')
| -rw-r--r-- | library/std/src/sync/poison/mutex.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/library/std/src/sync/poison/mutex.rs b/library/std/src/sync/poison/mutex.rs index 317e5fc3bfb..363220baf7b 100644 --- a/library/std/src/sync/poison/mutex.rs +++ b/library/std/src/sync/poison/mutex.rs @@ -46,6 +46,9 @@ use crate::sys::sync as sys; /// storing the guard to a [`Cell`] within [`Drop::drop`] and accessing it /// outside, or vice versa, can affect poisoning status in an unexpected way. /// +/// - Foreign exceptions do not currently trigger poisoning even in absence of +/// other panics. +/// /// While this rarely happens in realistic code, `unsafe` code cannot rely on /// poisoning for soundness, since the behavior of poisoning can depend on /// outside context. Here's an example of **incorrect** use of poisoning: |
