2 ms·
> doesn't this violate RAII? It's C, you don't get any RAII.
by lmm 2y ago
> doesn't this violate RAII?
It's C, you don't get any RAII.
- meltyness 2y agoNot the Rust abstraction. If mutation is needed, you'd write closures into the interface, or provider borrows. It's definitely weird to barf out ownership of half of the fields. E: I guess it sort of depends whether the handle is Copy semantics or not. E2: I guess they're correctly leaking the resource, but I question whether they should, protections like that are kind of the whole point of using Rust to begin with.
- pjmlp 2y agoNo, but you get defer via compiler extensions, and maybe in C2y as standard language feature.