Skip to content

Commit be7c059

Browse files
committed
CI: pin rustfmt in rust-toolchain.toml so cargo fmt finds it
The test workflow failed at `cargo fmt --check` with "'cargo-fmt' is not installed for the toolchain '1.96'". The rust-toolchain.toml channel pin (1.96) is what rustup resolves when cargo fmt runs, but the rustfmt component installed via the toolchain action's `components:` input landed on a different toolchain resolution. Listing the component in the toml makes it the single source of truth, so rustup ensures rustfmt is present for the pinned toolchain. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R3vgA3Q6PR9VQn8X5pLcMR
1 parent 2f393fb commit be7c059

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

rust-toolchain.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
[toolchain]
22
# 1.96+ required: oxc 0.137 uses stabilized `if let` guards.
33
channel = "1.96"
4+
# Pin rustfmt here so any toolchain rustup resolves from this file (e.g. when
5+
# `cargo fmt` triggers an install) always has the component — CI's separate
6+
# component install can land on a different toolchain resolution otherwise.
7+
components = ["rustfmt"]

0 commit comments

Comments
 (0)