Skip to content
Select theme

Moves and ownership

Ownership is the idea that makes Rust different, and the reason most people are here. A value has exactly one owner; passing it around moves it; and the variable you left behind is gone, not empty.

Every one of these rules produces a compiler error with a code attached, which is why this is the most-searched part of the language.