3 ms·
You can execute arbitrary code on drop operations by implementing `std::ops::Drop` for a type.
by zigger69 4y ago
You can execute arbitrary code on drop operations by implementing `std::ops::Drop` for a type.
- pornel 4y agoA `.deinit()` function could also run some arbitrary code that does weird and unexpected things. The point is that reasonable people don't abuse functions like that — if they do abuse, don't use their code. Neither Rust nor Zig is a sandbox that could stop actively stupid/malicious code.