Talk:Ownership

From Rust Community Wiki
Jump to navigation Jump to search

Ownership rules[edit source]

The explanation of ownership is a bit fuzzy. I prefer the definition in the official book:

  • Each value in Rust has a variable that’s called its owner.
  • There can only be one owner at a time.
  • When the owner goes out of scope, the value will be dropped.

This still ignores the fact that ManuallyDrop isn't dropped automatically, and can therefore leak memory, but it's much clearer and more correct than the explanation in this article.


Please change it if you would like - I just wrote that explanation there because something needed to be there, but it's not well-thought out by any means --Koxiaet (talk) 20:47, 2 June 2020 (UTC)