agentleFS
Quad4-SoftwareQuad4-Software/skills/.agents/skills/rust/SKILL.md

rust

Skill1 starsChanged 42 days ago0BSDView on GitHub

This skill covers the Rust toolchain and edition system, with the full Rust 2024 edition surface: language changes, stdlib, Cargo, rustdoc, rustfmt, and the migration workflow. Use when writing Rust, bumping an edition, reviewing edition-sensitive code, or pinning toolchain versions.

38 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use java, node and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • testdino-hqSkill

    java

    Google's official Java style guide. Covers 2-space indentation, 100-char line limit, naming conventions, braces, imports, Javadoc, exception handling, lambdas, and streams. Enforces @Override annotations and specific imports.

    Also in 4 projects that use this

  • mcollinaSkill

    node

    Provides domain-specific best practices for Node.js development with TypeScript, covering type stripping, async patterns, error handling, streams, modules, testing, performance, caching, logging, and more. Use when setting up Node.js projects with native TypeScript support, configuring type stripping (--experimental-strip-types), writing Node 22+ TypeScript without a build step, or when the user mentions 'native TypeScript in Node', 'strip types', 'Node 22 TypeScript', '.ts files without compilation', 'ts-node alternative', or needs guidance on error handling, graceful shutdown, flaky tests, profiling, or environment configuration in Node.js. Helps configure tsconfig.json for type stripping, set up package.json scripts, handle module resolution and import extensions, and apply robust patterns across the full Node.js stack.

    Also in 3 projects that use this

  • rogue-dev-studioSkill

    python

    Python 3.13 with uv package manager via mise. Use when the project needs this capability or the user / team manifest asks for it. Use for specialized `python` work when listed in TEAM.yaml or explicitly requested.

    Also in 6 projects that use this

  • rogue-dev-studioSkill

    golang

    Go development environment. Use when the project needs this capability or the user / team manifest asks for it. Use for specialized `golang` work when listed in TEAM.yaml or explicitly requested.

    Also in 3 projects that use this

  • trotsky1997Skill

    ast-grep

    Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for code patterns, find specific language constructs, or locate code with particular structural characteristics.

    Also in 3 projects that use this

  • OpenAISkill

    nextjs

    Next.js App Router expert guidance. Use when building, debugging, or architecting Next.js applications — routing, Server Components, Server Actions, Cache Components, layouts, middleware/proxy, data fetching, rendering strategies, and deployment on Vercel.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 31 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read this file for the edition model and the Rust 2024 change list.

    line 23
  2. Very specific:

    Read references/edition-2024.md for per-change before/after migration examples.

    line 24
  3. Very specific:

    Match ergonomics restrictions: when the default binding mode is not move (scrutinee matched by reference), bindings may not declare mut, …

    line 69
  4. Very specific:

    Never type fallback: never-to-any coercions fall back to !

    line 100
  5. Very specific:

    Use the hyphenated/[package] forms.

    line 126
  6. Very specific:

    Not edition-gated but landed around the same window and often conflated with 2024: async closures async |x| {} (1.85), #[diagnostic] …

    line 155

“Common” is measured: kept by at least 6 in 10 of the 31 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

When to use this skill

  • You are choosing or bumping edition in Cargo.toml, or migrating a crate to Rust 2024.
  • Code fails to compile after an edition bump and you need the actual rule change, not a guess.
  • You need current toolchain facts: stable is 1.99.x (October 2026), Rust 2024 was released in 1.85.0.

How to use

  1. Read this file for the edition model and the Rust 2024 change list.
  2. Read references/edition-2024.md for per-change before/after migration examples.
  3. Migrate with cargo fix --edition on a clean tree, then build and review the lint output.

Examples

  • "Bump this crate to edition 2024 and fix the fallout."
  • "Why does this impl Iterator now complain about a captured lifetime?"
  • "Is let chaining usable on stable yet?"

Rust editions and the 2024 edition

Editions are opt-in per package via edition = "..." in Cargo.toml. They let rustc make small breaking changes while old crates keep compiling. Editions so far: 2015, 2018, 2021, 2024. Edition is per package, not per workspace; dependencies on other editions link fine. rust-version (MSRV) is orthogonal: it states the minimum toolchain, not the language dialect.

Current state (October 2026): stable is rustc 1.99.0. Rust 2024 shipped in 1.85.0 (February 2025). cargo new defaults to 2024. There is no Rust 2027 yet; a 2027 edition is not announced.

Rust 2024 language changes

Breaking changes and behavior shifts, grouped by how often they bite in real code.

High-impact:

  • RPIT/impl-Trait lifetime capture: impl Trait return types now capture ALL in-scope lifetimes by default. Previously lifetimes had to be named in the bound (+ 'a). Code that relied on non-capture now needs + use<..> precise capturing, and the Captures/outlives tricks are obsolete. Most common edition-2024 breakage.
  • Tail expression temporary scope: temporaries in the tail expression of a block, function, or closure may drop BEFORE local variables, not after. Code relying on the old order (a MutexGuard in the tail expr while a local is read by a Drop impl) can deadlock or UB-observe changes; the tail_expr_drop_order lint flags it.
  • if-let temporary scope: temporaries in an if let scrutinee drop before the else branch runs, instead of after the whole expression. if let Ok(x) = lock.read() else { .. } no longer holds the lock in the else arm.
  • Match ergonomics restrictions: when the default binding mode is not move (scrutinee matched by reference), bindings may not declare mut, ref, or ref mut, and &/&mut patterns can only appear before a binding-mode shift. Fix by matching explicitly or binding by value. Hard error in 2024.
  • static mut references denied: taking &/&mut to a static mut is a deny-by-default static_mut_refs error in 2024. Migrate to UnsafeCell/SyncUnsafeCell or addr_of_mut!.

Safety surface tightening:

  • unsafe extern blocks: extern "C" { .. } must be written unsafe extern "C" { .. }, since declaring an item is itself unsafe.
  • Unsafe attributes: no_mangle, export_name, link_section must be written #[unsafe(no_mangle)] etc.
  • unsafe_op_in_unsafe_fn warns by default: unsafe ops inside an unsafe fn body need explicit unsafe { } blocks.

New capability:

  • let chains: if let A = x && let B = y { } and the same in while. Edition-gated to 2024+ because let in condition position needed a grammar carve-out.
  • gen keyword reserved: gen identifiers need r#gen. Reserves space for gen blocks (still unstable) and the future generators feature. gen blocks do not exist on stable yet.
  • Reserved syntax: unprefixed #"foo"# guarded strings and runs of 2+ # are reserved for future use.

Type inference / macros:

  • Never type fallback: never-to-any coercions fall back to ! instead of (). Was edition-2024-only. Since Rust 1.100 (beta as of October 2026) it applies on all editions and the migration lint is gone.
  • expr macro fragment now also matches const { } blocks and _ underscore expressions; expr_2021 preserves the old match set.
  • missing_fragment_specifier is a hard error: bare $x in macro_rules! must have a specifier.

Standard library changes

  • Prelude gains Future and IntoFuture. Custom traits named Future or a method .into_future() can become ambiguous.
  • Box<[T]> implements IntoIterator in all editions, but boxed.into_iter() only resolves to it in 2024+. Earlier editions keep autoref'ing to a slice iterator. A real silent-behavior change.
  • Newly unsafe fn: std::env::set_var, std::env::remove_var, and CommandExt::before_exec. Treat process env mutation as unsafe because of shared-state races with threads.

Cargo changes

  • edition = "2024" implies resolver = "3": the version-aware feature resolver prefers the latest compatible dep versions.
  • Removed duplicate Cargo.toml keys: [project], default_features, crate_type, proc_macro, dev_dependencies, build_dependencies. Use the hyphenated/[package] forms.
  • Since Rust 1.99, default-features on an inherited dep in a 2024 package overrides the [workspace.dependencies] value instead of erroring.

Rustdoc and rustfmt

  • Doctests are merged into a single binary per crate (much faster). Doctests that relied on separate binaries may need attention.
  • include_str!'d doctests resolve nested include!/include_str! relative to the Markdown file, not the Rust source.
  • style_edition = "2024" in rustfmt.toml applies the new formatting style independently of the code edition. Raw identifiers sort ignoring r#, and Version sorting changed; check diffs before mass-reformatting.

Migration workflow

  1. On stable: cargo fix --edition applies the rust-2024-compatibility lint group and auto-fixes what it can (needs a clean git tree).
  2. Set edition = "2024", run cargo build and cargo test.
  3. Review remaining warnings manually; the dangerous ones are the silent drop-order changes (tail expr, if-let scrutinee) and Box<[T]>::into_iter.
  4. CI: pin with rust-toolchain.toml channel = "1.85" or later; use channel = "stable" for rolling.

Adjacent stabilized features worth knowing

Not edition-gated but landed around the same window and often conflated with 2024: async closures async |x| {} (1.85), #[diagnostic] attributes for custom error messages (1.78), use<..> precise capturing syntax itself (usable on all editions since 1.82).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.