rust-syntax-ownership

Installation
SKILL.md

rust-syntax-ownership

The mechanics of ownership transfer in Rust: how moves work, when Copy applies, when to call .clone(), when Drop runs, and the API patterns that consume self by value (builder, From/Into, into_inner). Partial moves out of struct fields are covered here too.

Cross-references: [[rust-core-memory-model]] (conceptual overview, big picture) [[rust-syntax-borrowing]] (the alternative to move) [[rust-errors-borrow-checker]] (E-codes in depth)


When to use this skill

  • User writes code that hits a move-related compile error: E0382, E0507, E0509, E0040, E0184, E0204, E0515
  • User asks "why was this value moved" or "why can't I use x after passing it to a function"
  • User wonders whether to derive Copy, derive Clone, both, or neither
  • User wants to design a fluent builder, an Into<T> conversion, or an into_inner accessor
  • User struggles with partial moves out of struct fields (s.field moved, but s still partly usable)
  • User asks "do I need to clone here" or wants to remove .clone() calls that Clippy flagged

For the borrow alternative (sharing without taking ownership) see [[rust-syntax-borrowing]]. For the conceptual story (stack vs heap, smart pointers, Send/Sync) see [[rust-core-memory-model]].

Installs
2
GitHub Stars
1
First Seen
May 24, 2026