this post was submitted on 26 Mar 2024
4 points (57.1% liked)

Rust

6111 readers
12 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

[email protected]

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 2 years ago
MODERATORS
all 6 comments
sorted by: hot top controversial new old
[–] Solemarc 20 points 8 months ago* (last edited 8 months ago) (1 children)

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

[–] [email protected] -1 points 8 months ago (2 children)

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.

[–] [email protected] 10 points 8 months ago* (last edited 8 months ago) (1 children)

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.

[–] [email protected] 1 points 8 months ago

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.

[–] [email protected] 6 points 8 months ago

Aww man uncalled destructors were definitely not even on my radar