Repository navigation
Pin Rust 1.97.1 to match ruff, and fix the 9 clippy lints it surfaces - #1
Merged
Merged
Conversation
…ts that surfaces
The two repos were split: ruff pinned 1.97.1, r2sleigh 1.93.0. That split was
already fictional in one direction — `ruff_r2il` lives inside the ruff tree, so
rustup's directory walk gives it ruff's 1.97.1, and it path-deps these crates.
r2sleigh's source was therefore ALREADY being compiled under 1.97.1 whenever the
intake arm built; the pin just didn't say so. Building from inside r2sleigh's
own directory was the only place 1.93.0 applied.
Measured before changing anything:
- `cargo fmt --all --check` is clean under BOTH 1.93.0 and 1.97.1, so the bump
costs zero reformatting churn. (This was the actual question — rustfmt output
does differ across these versions in general; here it does not.)
- `cargo clippy --workspace --all-features -- -D warnings` under 1.97.1 was
NOT clean: 9 lints across 4 crates, revealed one crate at a time because
cargo stops at the first failure. r2ssa (4) → r2sym (2) → r2dec (2) →
r2plugin (1).
Every fix is behavior-identical, hand-applied, no `cargo clippy --fix`:
- `while_let_loop` (r2ssa/function.rs): `loop { let Some(x) = .. else { break }; }`
→ `while let Some(x) = .. { }`.
- `unnecessary_sort_by` (r2ssa/phi.rs): `sort_unstable_by(|(a,_),(b,_)| a.cmp(b))`
→ `sort_unstable_by_key(|(a,_)| *a)`.
- `question_mark` (r2ssa/semantic.rs): an `else if let .. else { return None }`
chain → `strip_prefix("ram:")?`.
- `manual_checked_ops` (r2sym/value.rs): an explicit `if *b == 0` guard around
`*a / *b` → `a.checked_div(*b)`. Safe because `value` is **u64** — on unsigned,
`checked_div` returns None only for a zero divisor, exactly matching the guard.
(On signed it would ALSO catch `MIN / -1`, which would be a behavior change.)
- `collapsible_match` ×5 (r2ssa/semantic.rs, r2sym/value.rs, r2dec ×2,
r2plugin): `Pat => { if C { BODY } }` → `Pat if C => { BODY }`.
That last one is the only class that can silently change behavior, because a
false guard now falls through to a LATER arm. Each of the five was verified
individually before collapsing: four had no `else` at all with `_ => {}` as the
fallthrough (a no-op either way), and the fifth (r2sym/value.rs concat) had an
`else` body BYTE-IDENTICAL to the `_` arm's body. None were collapsed on faith.
Verified after: clippy 0 errors, `cargo fmt --all --check` clean, and 541 tests
green across the three changed non-z3 crates (r2ssa 371+59+99, r2dec, r2il).
Downstream `ruff_r2il` still passes 43/43 against these crates.
Not covered locally, and pre-existing: `r2sym` and `r2sleigh-plugin` cannot LINK
in this container — `unable to find library -lz3`. Confirmed identical under the
old 1.93.0 toolchain, so it is a missing system Z3, not a consequence of this
bump; CI installs it.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AGVLyRZNEKKBSfBDJfbY3V
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_c3462c25-cb35-4810-93e4-d992be60165e) |
AdaWorldAPI
marked this pull request as ready for review
August 18, 2026 03:09
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This was referenced Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
ruffpins 1.97.1; this repo pinned 1.93.0. That split was already fictional in one direction:ruff_r2il(the R2IL intake arm, ruff#94) lives inside the ruff tree, so rustup's directory walk gives it ruff's 1.97.1 — and it path-depsr2il/r2ssa. This repo's source was therefore already being compiled under 1.97.1 whenever the intake arm built; the pin just didn't say so. 1.93.0 applied only when building from inside this directory.Aligning the pin makes
cargo fmtproduce identical output on both sides of that seam, which is the point.Measured before changing anything
cargo fmt --all --checkis clean under BOTH 1.93.0 and 1.97.1 — so the bump costs zero reformatting churn. This was the actual open question (rustfmt output does differ across these versions in general); here it does not.cargo clippy --workspace --all-features -- -D warningsunder 1.97.1 was not clean: 9 lints across 4 crates, revealed one crate at a time because cargo stops at the first failure —r2ssa(4) →r2sym(2) →r2dec(2) →r2plugin(1).The fixes
All behavior-identical, all hand-applied. No
cargo clippy --fix.function.rswhile_let_looploop { let Some(x) = .. else { break }; }→while let Some(x) = .. { }phi.rsunnecessary_sort_bysort_unstable_by(...cmp...)→sort_unstable_by_key(|(a,_)| *a)semantic.rsquestion_markelse if let .. else { return None }chain →strip_prefix("ram:")?value.rsmanual_checked_opsif *b == 0guard around*a / *b→a.checked_div(*b)collapsible_match×5Pat => { if C { BODY } }→Pat if C => { BODY }Two correctness notes, because both classes can silently change behavior
checked_divis only equivalent on unsigned. Thevaluefield isu64, sochecked_divreturnsNoneexactly when the divisor is zero — matching the guard it replaces. On a signed type it would also returnNoneforMIN / -1, which would be a real behavior change. Type checked first.collapsible_matchmoves non-matching cases to a later arm. Each of the five was verified individually before collapsing, never on clippy's word:elseat all, with_ => {}as the fallthrough — a no-op either way.r2sym/value.rs, the concat path) had anelsebody byte-identical to the_arm's body.Verified after
cargo clippy --workspace --all-features -- -D warnings→ 0 errorscargo fmt --all -- --check→ cleanr2ssa371+59+99,r2dec,r2il), 0 failuresruff_r2ilstill passes 43/43 against these cratesKnown, pre-existing, not caused by this
r2symandr2sleigh-plugincannot link in a container without Z3 —rust-lld: error: unable to find library -lz3. Confirmed identical under the old 1.93.0 toolchain, so it is a missing system library, not a consequence of this bump. CI installs Z3, so CI is unaffected.Generated by Claude Code