rust-1.98listed
Install: claude install-skill alphaonedev/rust-agent-skill
# Rust 1.98 Engineering Standard (2024 Edition)
All rules and examples verified against official Rust 1.98 / Edition 2024 sources (std, Reference, Nomicon, API Guidelines, Clippy, release notes). Version-specific APIs are annotated with their stabilization release.
## How to use this skill
This is a prioritized rulebook. Each rule has a stable ID (`[SECTION-NN]`), a priority (**P0** safety/correctness, **P1** important, **P2** polish), a one-line imperative directive, a short rationale after `—`, and a minimal 1.98-correct example where it adds value. When reviewing or writing code, cite the rule ID you follow or flag (e.g. "per OWNERSHIP-10"). Rules are grouped by category and ordered P0 → P1 → P2 within each section; the highest-impact category (Ownership) and the Edition-2024 hazards come first. When two concerns collide, the lower P-number wins. Start every task by scanning the P0 checklist below, then read the sections relevant to what you are building.
## P0 quick-reference checklist
Correctness/safety gates — get these right before anything else:
- **Ownership & aliasing** — single owner per value (OWNERSHIP-01); at any point, many `&T` XOR one `&mut T` (OWNERSHIP-10); never return a reference to a local (OWNERSHIP-12); slice `str` only on char boundaries (OWNERSHIP-15).
- **Edition 2024** — never take `&`/`&mut` to a `static mut` (hard error + UB, IDIOMS-01); don't rely on an `if let` scrutinee temporary living into the `else` (IDIOMS-02), nor on a block tail-ex