rust
БесплатноБез исполняемых скриптовНе проверенRust is a compiled, memory-safe systems programming language whose toolchain (rustup, rustc, Cargo, Clippy, rustfmt) builds, tests, lints and packages code…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Rust — Memory-Safe Systems Language and Cargo Toolchain
Overview
Rust compiles to native code with no garbage collector; the borrow checker enforces memory and thread safety at compile time. Day-to-day work goes through a small set of tools: rustup installs and switches toolchains, cargo creates, builds, tests and publishes packages (crates), clippy lints, and rustfmt formats. Stable releases ship every six weeks; language-level breaking changes are opt-in through editions (2015, 2018, 2021, 2024), set per crate in Cargo.toml.
This skill covers the language and toolchain. For web servers use the axum or rocket skills, for async runtimes tokio, for desktop apps tauri, for WebAssembly wasm.
Instructions
Install the toolchain with rustup
# Install rustup, not a distro rustc package; Debian 13+/Ubuntu 24.04+, Arch and Homebrew ship it
sudo apt install rustup # or: sudo pacman -S rustup / brew install rustup
rustup default stable
On Fedora the DNF package provides only rustup-init; run it once to create the proxies and install a toolchain. Homebrew's rustup does not put rustc/cargo on PATH; add $(brew --prefix rustup)/bin. Without a package manager, download the installer binary from the official domain and run it as a separate step (on Windows, run rustup-init.exe from https://rustup.rs):
URL=https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init
curl --proto '=https' --tlsv1.2 -sSfo rustup-init $URL
curl --proto '=https' --tlsv1.2 -sSf $URL.sha256 | sha256sum -c - # must print "./rustup-init: OK"
chmod +x rustup-init
./rustup-init -y --profile minimal -c clippy -c rustfmt
rustup puts the proxies (rustc, cargo, rustup) in ~/.cargo/bin, which must be on PATH; toolchains are stored under ~/.rustup/toolchains. Useful commands:
rustup update # update every installed toolchain and rustup
rustup component add clippy rustfmt # lint + format tools for the active toolchain
rustup target add wasm32-unknown-unknown aarch64-unknown-linux-gnu
rustc --explain E0382 # long-form explanation of any error code
Pin the toolchain per project
When half a team is on an old rustc and CI keeps breaking, commit a rust-toolchain.toml at the repo root so every developer and CI job uses the same compiler:
[toolchain]
channel = "1.98.1"
components = ["clippy", "rustfmt"]
rustup show active-toolchain then prints 1.98.1-x86_64-unknown-linux-gnu (overridden by '.../rust-toolchain.toml'). rustup downloads the pinned toolchain the first time any cargo command runs in the repo, so CI needs only rustup itself. If auto-install is off (RUSTUP_AUTO_INSTALL=0 or rustup set auto-install disable), run rustup toolchain install in the repo; with no argument it installs what the file names. channel accepts stable, beta, nightly, nightly-2026-09-01, or a version such as 1.85 / 1.98.1. Separately, declare the minimum supported version (MSRV) in Cargo.toml with rust-version = "1.85".
Create and build a crate
cargo new invoice-sync # binary crate: src/main.rs, edition = "2024"
cd invoice-sync
cargo check # fast type-check, no codegen — use while editing
cargo build # debug build -> target/debug/invoice-sync
cargo run -- --since 2026-09-01 # args after -- go to your program
cargo build --release # optimized -> target/release/invoice-sync
Manage dependencies
cargo add serde --features derive # edits Cargo.toml [dependencies]
cargo add --dev pretty_assertions # test-only dependency
cargo remove --dev pretty_assertions # --dev needed: plain remove only looks in [dependencies]
cargo update # refresh Cargo.lock within semver ranges
cargo tree --depth 1 # see what pulled in what
Commit Cargo.lock for binaries and workspaces. Install Rust-written CLIs with cargo install --locked ripgrep so the published lockfile is honored.
Organize a multi-crate workspace
A virtual workspace root has only a [workspace] table. Shared metadata, dependency versions and lints are declared once and inherited:
[workspace]
resolver = "3" # required in a virtual workspace; MSRV-aware resolution
members = [] # `cargo new crates/<name>` appends each crate
[workspace.package]
edition = "2024"
rust-version = "1.85"
[workspace.dependencies]
thiserror = "2"
[workspace.lints.clippy]
unwrap_used = "warn"
[profile.release]
lto = true
codegen-units = 1
Running cargo new --lib crates/logparse inside the root appends the crate to members and writes edition.workspace = true plus [lints] workspace = true (the opt-in to the shared lint table). cargo add thiserror -p logparse then writes thiserror.workspace = true. Path dependencies b
Установить rust в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл rust?
Rust is a compiled, memory-safe systems programming language whose toolchain (rustup, rustc, Cargo, Clippy, rustfmt) builds, tests, lints and packages code. Use this skill to install or pin a Rust toolchain, start a crate or a multi-crate Cargo workspace, add dependencies, fix borrow-checker errors, design error handling with Result, gate CI on clippy and fmt, migrate to the 2024 edition, or ship an optimized release binary. Triggers: "set up Rust", "cargo new", "cargo workspace", "fix this borrow checker error", "clippy warnings", "migrate to edition 2024", "pin the Rust version", "build a Rust CLI".
Как установить скилл rust?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rust запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic