News for hackers. Stuff that matters.
Re:Why Discord is switching from Go to Rust (2020) by etra0 on Thursday April 14, 2022 @11:33AM (#31028286)
Doing std::mem::forget is not unsafe as you cannot get any sort of undefined behavior which is what Rust protects you from [0].

Leaking is pretty safe, not always desired but definitely not dangerous like random pointers derefs.

But as OP says, leaking accidentally is uncommon.

[0] https://doc.rust-lang.org/nomicon/safe-unsafe-meaning.html

There are no comments on this comment yet.