2 ms·
Rust does help to prevent memory leaks, but it is not considered a soundness bug to leak memory, whereas it is a soundness bug to (e.g.) use memory after it is
by jcranmer 2y ago
Rust does help to prevent memory leaks, but it is not considered a soundness bug to leak memory, whereas it is a soundness bug to (e.g.) use memory after it is freed.
Historically, what happened in Rust is that shortly before 1.0 was released, someone found a situation where you could get a reference-count cycle with the standard container types, and there was a lot of consternation as to whether or not this was actually a bug. This is termed the "leakpocalypse." The ultimate resolution was to accept that destructors are not guaranteed to be run, and therefore the kind of leak that was created is not actually a bug.