Description
Summary
Code using catch_unwind
is not typically prepared to handle an object that panics in its Drop
impl. Even the standard library has had various bugs in this regard, and if the standard library doesn't consistently get it right, we can hardly expect others to do so.
This came up in @rust-lang/libs discussion.
We discussed various ways to handle this, including potential tweaks to panic_any
or catch_unwind
to add special handling of types that implement Drop
, but on balance we felt like it would be preferable to decide at the language level to generally not allow unwind from Drop
impls. (We may not be able to universally prohibit this, but we could work towards transitioning there.)
Background reading
About this issue
This issue corresponds to a lang-team design meeting proposal. It corresponds
to a possible topic of discussion that may be scheduled for deeper discussion
during one of our design meetings.
Metadata
Assignees
Type
Projects
Status
No status