rust-borrow-semantics
Installation
SKILL.md
Rust Borrow Semantics
Keep the exact source expression until you know every borrow and drop point. A manual desugaring, an added helper call, a macro, or an edition change can move those points while the types stay the same.
Start with four facts
Record these facts before you propose a fix:
- Is each operand a place expression or a value expression?
- Which expression creates each temporary?
- Which borrow is explicit, and which borrow does autoref or reborrow insert?
- Which edition and which minimum supported Rust version (MSRV) apply? Temporary scope and lifetime extension rules changed in several releases from 1.79 to 1.98.
Then write the expected reservation, activation, and drop points. Prove them with a probe (see Verification).