3 ms·
Recover is basically catch, it shows how a panic can leave something in a invalid and unsafe state, which can be accessed after recovery (without recover you wo
by Manishearth 11y ago
Recover is basically catch, it shows how a panic can leave something in a invalid and unsafe state, which can be accessed after recovery (without recover you wouldn't be able to access it). :)
- cousin_it 11y agoYou can see the invalid state even without catch/recover, e.g. from destructors that are called during unwinding.
- Manishearth 11y agoAh, I see. Right, that works in this case, but it doesn't work in all -- you can come up with a situation where the destructor is fine but the recovery can lead to arbitrary unsafe things.