rust-send-synclisted
Install: claude install-skill po4yka/rust-skills
# Rust Send and Sync
## Purpose
Decide whether a type crosses a thread boundary, and read the diagnostic when it does not. One
sentence generates almost every rule below: **`&T` is `Send` exactly when `T` is `Sync`**. `Sync`
states that one fact at the type level. A `Send` error whose `help:` line names `Sync` therefore
does not ask for a `Send` impl. It reports a shared reference to a non-shareable value.
This skill is safe-code type reasoning. It stops where a manual `unsafe impl` starts: the proof
obligation, the field audit, and the `SAFETY` comment belong to `rust-unsafe`. Atomics belong to
`memory-model`. Cancel safety belongs to `rust-async-internals`.
Every error text below comes from rustc 1.97.0, edition 2024, on aarch64-apple-darwin.
## Route the symptom to a section
| Symptom or task | Section |
| --- | --- |
| `error[E0277]: X cannot be sent between threads safely` with `help: the trait Sync is not implemented` | [The one rule](#the-one-rule-t-is-send-exactly-when-t-is-sync) |
| `error[E0277]: X cannot be shared between threads safely` | [The auto trait table](#the-auto-trait-table) |
| `error[E0321]: cross-crate traits with a default impl, like Send` | [E0321](#unsafe-impl-send-cannot-target-a-reference-e0321) |
| A `Mutex` was changed to an `RwLock` and the build broke | [Lock payload bounds](#lock-payload-bounds-mutex-and-rwlock-are-not-interchangeable) |
| `MutexGuard<'_, T> cannot be sent between threads safely` | [Guards](#guards-mutexguard-is-not-sen