Skip to content

Pin rust-toolchain to 1.97.1 and fix 8 clippy useless_borrows_in_formatting sites - #230

Merged
xoloki merged 1 commit into
mainfrom
unbreak-ci
Nov 18, 2026
Merged

xoloki merged 1 commit into
mainfrom
unbreak-ci

Conversation

@xoloki

@xoloki xoloki commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Why

CI has been red since stable moved past the last green run (2026-04-30), and nothing in this repo changed to cause it. There is no rust-toolchain.toml, and the CI action leaves its toolchain input unset, so every run floats on whatever stable is current. clippy::useless_borrows_in_formatting was not firing in April; it now fails the -D warnings clippy job at 8 sites.

This is the first of a series of cleanup PRs, and it has to come first: until CI is green, no later PR's CI result means anything.

What

Fix the 8 lint sites. All are redundant & in formatting macros — no behaviour change, applied with cargo clippy --fix:

File Macro Count
src/common.rs write! 2
src/taproot.rs println! 4
src/state_machine/coordinator/mod.rs assert_eq!, panic! 2

The parties, &bad_parties comparison in coordinator/mod.rs is deliberately untouched — that & is a real reference, not a formatting argument.

Pin the toolchain, so a future stable release cannot turn CI red without a code change. Bumping the pin becomes a deliberate PR that fixes the newer lints alongside it, instead of a surprise red build on an unrelated change.

[toolchain]
channel = "1.97.1"
profile = "minimal"
components = ["clippy", "rustfmt"]

profile = "minimal" matters: the action's file-driven branch runs rustup toolchain install with no --profile, so without it every job also pulls rust-docs.

Why 1.97.1 and not 1.100.0

Deliberate. 1.97.1 is the toolchain these 8 fixes were verified against, and suppressing only that one lint yields a clean run — so the set is provably complete, with nothing hidden behind the compile abort. Current stable is 1.100.0, three minor releases further on, whose newer lints have not been evaluated. Bumping to it is a follow-up PR where the new lints can be reviewed on their own.

Note on CI actions

This PR needs no workflow changes. The existing stacks-sbtc/actions/setup-rust-toolchain shim wraps actions-rust-lang/setup-rust-toolchain@v1.15.2, which already honours rust-toolchain.toml whenever its toolchain input is empty — which it is. So CI goes green immediately, and migrating off those actions stays a separate PR.

Verification

All run under the pinned 1.97.1:

  • cargo fmt --all -- --check — clean
  • cargo clippy --all-targets --all-features -- -D warnings -A clippy::op-ref -A clippy::needless-range-loop (the exact CI line) — passes; failed before this change
  • cargo test — 88 passed
  • cargo test --features with_v1 — 164 passed
  • cargo build --all-features — clean

Test counts are unchanged from 5d0e698, as a behaviour-neutral change requires.

🤖 Generated with Claude Code

@xoloki xoloki self-assigned this Nov 18, 2026
@xoloki
xoloki merged commit 53b818b into main Nov 18, 2026
5 checks passed
@xoloki
xoloki deleted the unbreak-ci branch November 18, 2026 03:21
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