You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I might be worth to more clear point out that UnwindSafe is misleading, in that it is unrelated to unsafe/rust safety guarantees.
I.e. your type must be rust-safe to reuse after a catch_unwind no matter weather it implements UnwindSafe or not. If it's not it is unsound. Something which is often missed.
UnwindSafe is more like a marker indicating that something plays well with unwinding, instead of it being "rust-safe" wrt. unwinding.
To make things worse it is relatively easy to have code which doesn't play well with unwinding, but does accidentally implement UnwindSafe due *mut T being UnwindSafe if T: RefUnwindSafe... (it is that way due to *mut T often being an owning pointer, but if it's used for a &mut T-like thing you have to explicitly remember to disable it's UnwindSafe implementation).
The text was updated successfully, but these errors were encountered:
I might be worth to more clear point out that
UnwindSafe
is misleading, in that it is unrelated tounsafe
/rust safety guarantees.I.e. your type must be rust-safe to reuse after a
catch_unwind
no matter weather it implementsUnwindSafe
or not. If it's not it is unsound. Something which is often missed.UnwindSafe
is more like a marker indicating that something plays well with unwinding, instead of it being "rust-safe" wrt. unwinding.To make things worse it is relatively easy to have code which doesn't play well with unwinding, but does accidentally implement
UnwindSafe
due*mut T
beingUnwindSafe
ifT: RefUnwindSafe
... (it is that way due to*mut T
often being an owning pointer, but if it's used for a&mut T
-like thing you have to explicitly remember to disable it'sUnwindSafe
implementation).The text was updated successfully, but these errors were encountered: