Bump Rust toolchain to 1.97.1 - #52
Conversation
Rust 1.97's clippy flags `&x` passed to format-like macros where the borrow is redundant, since Display and Debug forward transparently through references. Drop the borrow in the 8 affected call sites. Formatted output is byte-identical; no logic or error paths change. Landed ahead of the toolchain bump so each commit passes clippy on its own (verified clean under both 1.90 and 1.97). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Moves off 1.92.0 to current stable. No CI workflow pins a Rust version, so all jobs pick this up from rust-toolchain.toml automatically. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
dduugg
left a comment
There was a problem hiding this comment.
Approving — the bump itself is clean and low-risk. Two corrections to the description, both of which will misdirect the next reader if left as-is.
Verified
- All 8 format-arg edits are behavior-neutral. Every site is a format-like macro (
println!/eprintln!/format!/panic!) — nowrite!,assert!, or structuredtracingfields touched, no smart-pointerDisplaymismatch, and no site where the variable is later moved (format macros only borrow). - No
rust-version/MSRV inCargo.toml, and none of the four workflows installs a pinned toolchain — all rely on the runner's rustup readingrust-toolchain.toml, so this file is the whole change surface. - 1.97.1 installs and runs with both required components (
clippy0.1.97,rustfmt). parse_utils.rs:149-152is exactly as described (unreachableunwrap_or_else(|| panic!(...))behind anis_some()guard, plus a stale commented-out copy still carrying the old&node). Agreed it belongs in its own PR — it's a logic cleanup, not a lint fix.
1. The "Heads-up: unrelated flaky test" diagnosis is incorrect.
The section attributes test_respect_gitignore_can_be_disabled to #[serial] on test_respects_global_gitignore racing over core.excludesFile. That can't be the cause for this test:
tests/fixtures/app_with_gitignore_disabled/packwerk.ymlsetsrespect_gitignore: false, andsrc/packs/walk_directory.rs:146gatesbuild_gitignore_matcherbehind exactly that flag — so this test never readscore.excludesFileat all, mid-set or otherwise.- The global pattern written by that test is
*.global_ignore, which could never maskignored_folder/violating.rb. - The observed failure is a cache-file creation error, not a missed violation, which independently rules out gitignore matching.
The real cause is the one #54 and #57 identify: common::teardown() globs tests/fixtures/*/tmp/cache/packwerk and deletes every fixture's cache, and gitignore_test.rs calls it from tests running on parallel threads in one binary. The precise window is src/packs/caching/per_file_cache.rs:59 (create_dir_all(parent)) vs :67 (File::create) — losing the parent between those two calls is why it surfaces as EINVAL rather than the ENOENT you'd expect.
Your general point about serial_test semantics (#[serial] only serializes against other #[serial] tests) is correct and worth keeping — it just isn't what breaks this test. Suggest replacing the section with a pointer to #57, which fixes it.
2. The "Follow-ups noted" section is stale.
actions/checkout@v2 and actions-rs/audit-check@v1 were both already fixed on main by #51 and #55 — main now pins actions/checkout@3d3c42e # v7.0.1 by SHA across ci.yml/audit.yml/zizmor.yml, and audit.yml has moved to taiki-e/install-action. They are still present on this branch, which forks from 0ccf146 — three commits before those landed — so the observation was accurate when written and will simply disappear on rebase. Worth dropping the section so it doesn't read as outstanding work.
| @@ -1,4 +1,4 @@ | |||
| [toolchain] | |||
| channel = "1.92.0" | |||
| channel = "1.97.1" | |||
There was a problem hiding this comment.
Non-blocking: 1.98.0 shipped 2026-08-18, so "the current stable release" in the description is now one behind. Pinning one release back is defensible — just noting the wording no longer matches if landing on current stable was the intent.
| .context(format!( | ||
| "Reference#defining_pack_name is {}, but that pack is not found in pack set.", | ||
| &name | ||
| name |
There was a problem hiding this comment.
Flagging this one site as the one worth actually reading rather than skimming, since it isn't the simple case the rest of the diff is.
name is bound by if let Some(name) = &self.defining_pack_name over an Option<String> field, so name is already &String — meaning the original format!(..., &name) was &&String, a double borrow, not the single &x -> x the description describes.
It is still correct to remove it: the blanket impl<T: Display + ?Sized> Display for &T makes Display transparent through any depth of references, so the formatted output is byte-identical. No change needed. Noting it only because a mechanical &-strip is exactly the kind of edit where a nested borrow can hide a real change, and this is the site a reviewer should verify by hand.
One conflict, in `update`'s summary line. rubyatscale#52 bumped the toolchain to 1.97.1 and the newer clippy removed the needless borrow in `&strict_violations.len()`; this branch had renamed that binding to `unlisted_strict_violations` when it added the recorded filter. Resolved as both: the rename kept, the borrow dropped. Everything else merged clean, including `tests/common/mod.rs`, where rubyatscale#57 adds `common::Fixture` next to this branch's `RoundTripFixture`. Worth flagging that they now solve the same problem two ways: rubyatscale#57 copies a fixture to a temp dir and drops it, while `RoundTripFixture` restores the shared fixture in place. rubyatscale#57 converts `create_test.rs` and `gitignore_test.rs` only, so `update_test.rs` still uses the older mechanism. Happy to fold the three round-trip tests onto `common::Fixture` if that is preferred, in this PR or a follow-up. Verified on the merged tree with the 1.97.1 toolchain the merge brings in: `cargo test --no-fail-fast` 265 passed 0 failed, clippy with `-Dwarnings` clean, `cargo fmt --check` clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
rust-toolchain.tomlautomatically. The release workflow is cargo-dist-generated and installs via rustup, so it inherits it too.Why there are source changes
&passed to format-like macros, which 1.92's did not. Under CI'sRUSTFLAGS=-Dwarningsthese 9 warnings fail the Lints job, so the bump can't land without fixing them.format!("{}", &x)becomesformat!("{}", x).DisplayandDebugforward transparently through references, so formatted output is byte-identical and no behavior changes.Reviewing this
git bisectnever lands on a red commit.Contributor impact
rust-toolchain.toml.rust-version/MSRV is declared inCargo.toml, so no downstream compatibility constraint is affected.Heads-up: unrelated flaky test
While running the suite locally,
test_respect_gitignore_can_be_disabledfailed once under full concurrent load, then passed in isolation. This looks like a pre-existing test-isolation bug rather than something introduced here:test_respects_global_gitignoremutates the developer's real global git config (git config --global core.excludesFile) and is marked#[serial].serial_test's#[serial]only serializes against other#[serial]tests, not against unmarked parallel ones, sotest_respect_gitignore_can_be_disabledcan run whileexcludesFileis mid-set/unset and pick up a bogus ignore path.If CI goes red on that test, this is the likely cause. Worth fixing separately.
Related: a failed local run can leave
tests/fixtures/app_with_unnecessary_dependencies/packs/foo/package.ymlmodified, sincetest_auto_correct_unnecessary_dependenciesrewrites it and skips cleanup when the suite aborts.Follow-ups noted, deliberately not included
parse_utils.rs:149-152isif name.is_some() { name.unwrap_or_else(|| panic!(...)) }. The panic is unreachable given the guard and wants to beif let Some(..) = name. There is also a stale commented-out copy just above it that still contains the old&node, so it will drift further out of sync.ci.ymlusesactions/checkout@v2(deprecated Node runtime) andaudit.ymluses the archivedactions-rs/audit-check@v1.🤖 Generated with Claude Code