---
source: https://iinventedlight.com/library/notes/rust-ownership-borrowing.md
title: "Rust ownership and borrowing in five rules"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "MIT OR Apache-2.0 (rust-lang/book; Copyright (c) 2010 The Rust Project Developers); prose restates cited source lines"
attribution: "Summary by iinventedlight (AI-assisted). Copyright (c) 2010 The Rust Project Developers. Sources: The Rust Project (The Rust Programming Language book), What is Ownership? - The Rust Programming Language, MIT OR Apache-2.0 (rust-lang/book); The Rust Project (The Rust Programming Language book), References and Borrowing - The Rust Programming Language, MIT OR Apache-2.0 (rust-lang/book)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-04
as_of: 2026-11-04
confidence: medium
untested: "No code was run for this note; only the fetched documentation pages were read."
category: coding-references
topic_area: "code-ai-eng: Rust"
tags: rust, ownership, borrowing, memory
sources:
  - id: S1
    title: "What is Ownership? - The Rust Programming Language"
    publisher: The Rust Project (The Rust Programming Language book)
    url: https://doc.rust-lang.org/book/ch04-01-what-is-ownership.html
    accessed: 2026-11-04
    license: "MIT OR Apache-2.0 (rust-lang/book)"
  - id: S2
    title: "References and Borrowing - The Rust Programming Language"
    publisher: The Rust Project (The Rust Programming Language book)
    url: https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html
    accessed: 2026-11-04
    license: "MIT OR Apache-2.0 (rust-lang/book)"
---
# Rust ownership and borrowing in five rules

## Short answer
Rust manages memory through ownership rules the compiler checks, with no garbage collector and no runtime cost:
1. Each value has an owner.
2. There is one owner at a time.
3. When the owner goes out of scope, the value is dropped. [S1]


```rust
fn len(s: &String) -> usize { s.len() } // borrows, caller keeps s
```

## Claims
- id: C1
  claim: Each value in Rust has an owner.
  source: S1
  evidence: "Each value in Rust has an owner."
- id: C2
  claim: There can only be one owner at a time.
  source: S1
  evidence: "There can only be one owner at a time."
- id: C3
  claim: When the owner goes out of scope, the value is dropped.
  source: S1
  evidence: "When the owner goes out of scope, the value will be dropped."
- id: C4
  claim: You can have one mutable reference or many immutable ones.
  source: S2
  evidence: "At any given time, you can have either one mutable reference or any"

## Sources
- [S1] What is Ownership? - The Rust Programming Language. The Rust Project (The Rust Programming Language book). https://doc.rust-lang.org/book/ch04-01-what-is-ownership.html . License: MIT OR Apache-2.0 (rust-lang/book). Accessed 2026-11-04.
- [S2] References and Borrowing - The Rust Programming Language. The Rust Project (The Rust Programming Language book). https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html . License: MIT OR Apache-2.0 (rust-lang/book). Accessed 2026-11-04.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
