Soni
21
we think rust (std) should make the following 2 changes:
- encourage catch_unwind to be used as ManuallyDrop::new(catch_unwind). this prevents the error type from dropping on an extra panic.
- as such, having a built-in way to turn ManuallyDrop<Result<...>> into Result<ManuallyDrop<...>> would be good, probably?
but uh anyway we're probably overthinking this
CAD97
22
See also Never allow unwinding from Drop impls · Issue #97 · rust-lang/lang-team · GitHub for discussion around the pitfalls of panicking in drop. (The best-effort solution would likely be to forget(catch_unwind(|| drop(panic_payload)))
: drop it if it plays nice, but don't unwind if it doesn't.
system
Closed
23
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.