Skip to content

pin Rust toolchain to 1.95.0 for deterministic rustfmt#26

Merged
johncarmack1984 merged 4 commits into
mainfrom
john/rust-toolchain-pin
May 6, 2026
Merged

pin Rust toolchain to 1.95.0 for deterministic rustfmt#26
johncarmack1984 merged 4 commits into
mainfrom
john/rust-toolchain-pin

Conversation

@johncarmack1984
Copy link
Copy Markdown
Collaborator

@johncarmack1984 johncarmack1984 commented May 6, 2026

Summary

Adds rust-toolchain.toml pinning to Rust 1.95.0 (rustfmt 1.9.0-stable, released 2026-04-14).

Why

dprint's exec plugin shells out to rustfmt --edition 2024 for .rs files. Without a pinned toolchain, both CI (ubuntu-latest's bundled Rust) and contributors run whatever rustfmt is on PATH. Different rustfmt builds emit different layouts for the same input -- e.g., let-chain if let Some(_) = expr { ... } gets formatted as one line by some versions and two lines (brace on its own line) by others. That surfaced in #22 as a dprint check failure on taurpc/src/export.rs even though the contributor's local rustfmt was happy with their formatting.

The --edition 2024 flag stays as-is (it's the latest stabilized Rust language edition; there is no 2025 edition). What this pin closes is the binary-version drift, separate from the edition flag.

Verified

  • rustup run 1.95.0 rustfmt --edition 2024 --check taurpc/src/export.rs -> zero diff on current main
  • pnpm lint clean (types + format + js)

Caveat for #22 specifically

This makes the toolchain deterministic going forward. It does not retroactively reformat files. After rebasing #22 on this main:

  • The taurpc/src/export.rs content Oscar wrote uses a layout produced by a different rustfmt version and will still fail dprint check until he runs pnpm format (or cargo fmt) locally with the pinned 1.95.0 toolchain and pushes the resulting diff
  • Any other in-flight branches with rustfmt-formatted Rust changes will pay the same one-time reformat cost

@johncarmack1984 johncarmack1984 changed the title pin Rust toolchain to 1.93.0 for deterministic rustfmt pin Rust toolchain to 1.95.0 for deterministic rustfmt May 6, 2026
@johncarmack1984 johncarmack1984 merged commit 7b51a1f into main May 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant