Skip to content
← All tracks

Ownership I: Moves, Copy, Clone, Drop

Rust

Single ownership in isolation. No `&` or `&mut` appears in this track and `.clone()` is explicitly permitted; every abstract claim is cashed out as a compiler error or a drop log.

This track is written for Rust, which isn't the mode you're browsing in.

0 / 18 solved · 2 articles
  1. 1. Not solved yet. The three rules of ownership
  2. 2. Not solved yet. Stack, heap, and what a variable actually holds
  3. 3. Not solved yet. Move semantics: the relay
  4. 4. Not solved yet. Reading E0382 line by line
  5. 5. Not solved yet. Copy: the types that don't move
  6. 6. Not solved yet. Clone: explicit, deep, and never free
  7. 7. Copy and Drop are mutually exclusive Read
  8. 8. Not solved yet. Ownership through function calls
  9. 9. Not solved yet. Giving ownership back
  10. 10. Not solved yet. Partial moves: taking one field and leaving the rest
  11. 11. Not solved yet. E0509: a Drop type is an atom
  12. 12. Not solved yet. drop(x) is just a function
  13. 13. Not solved yet. Drop order is specified
  14. 14. Not solved yet. Moving out of &mut: take, replace, swap
  15. 15. Not solved yet. Conditional moves and drop flags
  16. 16. Not solved yet. Ownership inside loops
  17. 17. Not solved yet. Shadowing is not moving
  18. 18. Not solved yet. Method receivers and the consuming builder
  19. 19. Not solved yet. Leaking is safe
  20. 20. "Just clone it": the honest argument Read

Check yourself

3 questions · one attempt each

These do not count toward finishing the track. They are here to catch the things that are easy to read past.

0 / 3

After this runs, which bindings are still usable?

let a = String::from("foo");
let b = String::from("bar");
let c = a + &b;
Question 1 of 3