• Solemarc@lemmy.world
    link
    fedilink
    arrow-up
    20
    ·
    edit-2
    8 months ago

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

    • BatmanAoD
      link
      fedilink
      arrow-up
      3
      arrow-down
      4
      ·
      8 months ago

      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
        link
        fedilink
        arrow-up
        10
        ·
        edit-2
        8 months ago

        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
          link
          fedilink
          arrow-up
          2
          arrow-down
          1
          ·
          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.

  • 0x01@lemmy.ml
    link
    fedilink
    arrow-up
    7
    ·
    8 months ago

    Aww man uncalled destructors were definitely not even on my radar