News for hackers. Stuff that matters.
Re:Microsoft to Explore Using Rust by nayuki on Thursday July 18, 2019 @11:43AM (#20470999)
> I think it's possible to leak memory if you are sufficiently clever and doing really weird stuff

Note that Rust provides an easy way to intentionally leak memory, unlike many other languages: https://doc.rust-lang.org/std/mem/fn.forget.html

Re:Microsoft to Explore Using Rust by pornel on Friday July 19, 2019 @05:20AM (#20477199)
`mem::forget()` only prevents destructors from running, which leaks data managed by the destructor as a side effect, but it gives no guarantees about not freeing the object passed to it (e.g. if you call it on a stack-allocated object, it can't leak it).

`Box::leak()` leaks memory.