Skip to content

chore: make clippy and the lib tests pass on the declared minimum Rust - #1679

Merged
xiaolai merged 1 commit into
mainfrom
chore/clear-local-toolchain-lints
Nov 12, 2026
Merged

xiaolai merged 1 commit into
mainfrom
chore/clear-local-toolchain-lints

Conversation

@xiaolai

@xiaolai xiaolai commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Cargo.toml declares rust-version = "1.89" and CI runs stable (1.99). On 1.90, clippy --all-targets -D warnings reported three lints and the test target did not compile, so anyone on the supported minimum could run neither. No CI job builds the minimum, so nothing noticed.
  • Four small edits make both pass on 1.90 and on 1.99. No behaviour change.

What Changed

  • agent_journal/admission/owned_end.rs: !x.is_some_and(f) becomes x.is_none_or(!f) (same meaning; stable since 1.82).
  • browser/console_shim_macos.rs: #[allow(clippy::assertions_on_constants)] on the compile-time pin whose point is the constant.
  • workflow/dir_fd.rs: #[allow(clippy::unnecessary_cast)] on holds, with the reason on the line (dev_t is i32 on macOS, so the casts are needed somewhere). Placed on the function so the file stays at exactly 300 lines.
  • window_manager/commands.test.rs: compare Vec<PathBuf> with Vec<PathBuf>. String == PathBuf only compiles on a newer standard library.

Validation

  • cargo clippy --all-targets -- -D warnings: clean on 1.90 and on 1.99
  • cargo fmt --check, pnpm check:predelta (50 gates)
  • cargo test --lib on 1.90 and on 1.99: 5274 passed, 4 failed in both. The four are kvo::native_tests (WebKit, macOS): they fail in a full parallel run on this machine on either toolchain, pass alone (4/4), and pass in CI's macOS job.
  • Not done: an MSRV job in CI. That would keep this from regressing, and is a separate change.

🤖 Generated with Claude Code

Cargo.toml declares rust-version 1.89 and CI runs stable, which is newer.
On 1.90 clippy reported three lints and the test target did not compile,
so a contributor on the supported minimum could not run either. No CI job
builds the minimum, which is why it went unnoticed.

- owned_end.rs: !x.is_some_and(f) becomes x.is_none_or(!f), same meaning.
- console_shim_macos.rs, dir_fd.rs: allow the lint with the reason beside
  it; the compile-time assert and the per-Unix integer widths are the point.
- commands.test.rs: compare Vec<PathBuf> with Vec<PathBuf>. String against
  PathBuf only compiles on a newer standard library.

Verified with clippy --all-targets -D warnings and the lib tests on both
1.90 and 1.99.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@xiaolai
xiaolai merged commit 7ed2552 into main Nov 12, 2026
18 checks passed
@xiaolai
xiaolai deleted the chore/clear-local-toolchain-lints branch November 12, 2026 10:31
@xiaolai xiaolai mentioned this pull request Nov 12, 2026
3 tasks done
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