2 ms·
One nit: > With Rust, you actively have to fight the compiler to cause memory leaks. Memory leaks are not considered unsafe in Rust[1]! They're actually an im
by woodruffw 5y ago
One nit:
> With Rust, you actively have to fight the compiler to cause memory leaks.
Memory leaks are not considered unsafe in Rust[1]! They're actually an important part of Rust's lifetime semantics: intentionally leaking memory is both safe and equivalent to producing a `'static` out of thin air.
You probably shouldn't leak memory as a matter of practice, of course, but Rust will happily allow you to do so in 100% safe code.
[1]: https://stackoverflow.com/a/56108074 https://stackoverflow.com/a/56108074