Pre-Pooping Your Pants With Rust (cglab.ca)
from ericjmorey@programming.dev to rust@programming.dev on 26 Mar 2024 00:03
https://programming.dev/post/11928679

#rust

threaded - newest

0x01@lemmy.ml on 26 Mar 2024 01:36 next collapse

Aww man uncalled destructors were definitely not even on my radar

Solemarc@lemmy.world on 26 Mar 2024 02:13 collapse

FYI, this is from 2015 and was deprecated around rust v1.0 release. It’s not a current issue.

BatmanAoD@programming.dev on 26 Mar 2024 05:36 collapse

Well, it’s still true that mem::forget is safe, and Rust will almost certainly never change that. As noted in the blog post, this makes certain patterns unsound.

arendjr@programming.dev on 26 Mar 2024 06:32 next collapse

Only if your definition of soundness includes that leaks can never occur, which is not how Rust generally defines soundness. I think most Rust users know that the language doesn’t prevent leaks at this point.

BatmanAoD@programming.dev on 26 Mar 2024 15:12 collapse

Maybe, but the comment I was responding to is not at all clear about what is deprecated and what is no longer an issue. Note, too, that the other top-level comment on the post is from someone who didn’t realize that destructors can be missed.

[deleted] on 26 Mar 2024 08:23 collapse

.