Add a note on foreign exceptions

This commit is contained in:
Alisa Sireneva 2025-07-25 22:14:02 +03:00
parent 5b8c61494f
commit c1d06cccae

View file

@ -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: