fleetlint Policy for a fleet of repositories
v0.11 (latest)
Getting started

repo/toolchain-pinned/rust

Toolchain version is pinned

Implements repo/toolchain-pinned for rust.

Severitywarning
Tiers1, 2
Stacksrust
Scopeeach
Kindexpr
Sourcelibrary v0.8.0
Selected byfleetlint-recommended@v0.8.0

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), .tool-versions/mise names rust with a version, or devbox.json names rustc or cargo with a version (rustc@1.86.0; @latest does not count, and rustup installs rustup, not a toolchain). 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))
|| ["", "../", "../../", "../../../"].exists(d, file(d + "devbox.json") && text(d + "devbox.json").matches(r'"(rustc|cargo)(@v?\d|"\s*:\s*("v?\d|\{[^}]*"version"\s*:\s*"v?\d))'))

Fix

Add rust-toolchain.toml with [toolchain] channel = "1.x.y".

Agent instruction (from repo/toolchain-pinned): Add the stack’s toolchain pin set to the version currently installed; do not upgrade the toolchain in the same change.

A finding that names no file points at rust-toolchain.toml.

Sources


Generated by fleetlint docs from catalog v0.8.0.