When the owner goes out of scope the value is dropped. Assigning a heap-backed value such as String moves ownership and invalidates the old binding. Types implementing Copy (scalars, shared references) are copied instead.
← Rust theorytheory 0/50 · 0%
Ownership · easy
7. Ownership
Every value has exactly one owner.
Check your understanding
1. After `let b = a;` with a String, a is…
2. Which type is Copy?