repo/toolchain-pinned/rust
Toolchain version is pinned
Implements repo/toolchain-pinned for rust.
| Severity | warning |
| Tiers | 1, 2 |
| Stacks | rust |
| Scope | each |
| Kind | expr |
| Source | library v0.3.1 |
| Selected by | fleetlint-recommended@v0.3.1 |
Requirement
rust-toolchain.toml (or rust-toolchain) names a version or a dated channel (1.86.0, nightly-2026-01-15; stable moves and does not count), or .tool-versions/mise names rust with a version. rust-version in Cargo.toml is the minimum supported version, not a pin.
Why
Without a pin, every machine and every CI run builds with whatever compiler or runtime happens to be installed, and failures cannot be reproduced.
Check
["", "../", "../../", "../../../"].exists(d,
(file(d + "rust-toolchain.toml") && scan(d + "rust-toolchain.toml", r'^\s*channel\s*=\s*"((stable|beta|nightly)-)?\d').size() > 0)
|| (file(d + "rust-toolchain") && scan(d + "rust-toolchain", r'^\s*((stable|beta|nightly)-)?\d').size() > 0))
|| ["", "../", "../../", "../../../"].exists(d, file(d + ".tool-versions") && scan(d + ".tool-versions", r'^\s*(rust)\s+\S*\d').size() > 0) || ["", "../", "../../", "../../../"].exists(d, ["mise.toml", ".mise.toml", ".config/mise.toml", ".config/mise/config.toml", "mise/config.toml"].exists(n,
file(d + n) && scan(d + n, r'^\s*"?(rust)"?\s*=\s*[^#\n]*\d').size() > 0))Fix
Add rust-toolchain.toml with [toolchain] channel = "1.x.y".
Agent instruction: Add the stack’s toolchain pin set to the version currently installed; do not upgrade the toolchain in the same change.
See: https://fleetlint.org/baseline/#hygiene, https://fleetlint.org/stacks/, https://fleetlint.org/stacks/#rust
Generated by fleetlint docs from catalog v0.3.1.