this post was submitted on 21 Nov 2025
245 points (96.2% liked)

Technology

76986 readers
2294 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related news or articles.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] calcopiritus@lemmy.world 17 points 1 day ago (2 children)

It's really hard to do without Rc (or similar) or unsafe.

[–] Mechanize@feddit.it 28 points 1 day ago* (last edited 1 day ago) (1 children)

You can leak memory in perfectly safe Rust, because it is not a bug per se, an example is by using Box::leak

Preventing memory leaks was never in the intentions of Rust. What it tries to safeguard you from are Memory Safety bugs like the infamous and common double free.

[–] 8uurg@lemmy.world 2 points 23 hours ago

And it still cleans up once the ownership model indicates it can be cleaned up. That does not ensure memory is never leaked, but it is equivalent to destructors running automatically when using unique ptr or shared ptr without cycles in C++, which avoids at least a portion of possible memory leaks.