In the documentation for Unwindsafe
we have:
Types such as
&mut
T and&RefCell<T>
are examples which are not unwind safe. The general idea is that any mutable state which can be shared acrosscatch_unwind
is not unwind safe by default. This is because it is very easy to witness a broken invariant outside ofcatch_unwind
as the data is simply accessed as usual.
Following this logic it seems to me that *mut T
should not be Unwindsafe
. But it turns out that it is. Why is that?