3 ms·
Rust's type system doesn't attempt to guard against resource leaks.
by quotemstr 11y ago
Rust's type system doesn't attempt to guard against resource leaks.
- Rusky 11y agoIt doesn't guarantee destructors will run, that's true, but that's for things like Rc cycles. Take a look at the RFC for std::panic::recover- it definitely takes exception safety into account: https://github.com/rust-lang/rfcs/blob/master/text/1236-stabilize-catch-panic.md https://github.com/rust-lang/rfcs/blob/master/text/1236-stab... Also take a look at things like the design of the Drain iterator- the stdlib is definitely (intended to be) exception safe.