catch_unwind […] does not guarantee the program is in a consistent state afterward, since Drop impls may have run partway through.
Wait, what? Any more details about this, I’ve never heard about that before. Partially run Drop impls sounds like a big potential for undefined behavior, how could catch_unwind possibly cause that?
EDIT: The more I read this article, the more AI-generated it looks and so I’m sort of wondering if the above quote is just complete bogus.
Wait, what? Any more details about this, I’ve never heard about that before. Partially run Drop impls sounds like a big potential for undefined behavior, how could catch_unwind possibly cause that?
Yeah, no, I don’t think this is true. It’s the reason a double panic will cause an abort. The docs do recommend against using this for general error recovery, but there’s no mention of any possibillity of inconsistent state.
Wait, what? Any more details about this, I’ve never heard about that before. Partially run Drop impls sounds like a big potential for undefined behavior, how could
catch_unwindpossibly cause that?EDIT: The more I read this article, the more AI-generated it looks and so I’m sort of wondering if the above quote is just complete bogus.
Yeah, no, I don’t think this is true. It’s the reason a double panic will cause an abort. The docs do recommend against using this for general error recovery, but there’s no mention of any possibillity of inconsistent state.