Conversation
added 3 commits
April 21, 2026 10:57
Updates the minimum supported Rust version from 1.75.0 to 1.85.0. This unlocks the 2024 edition, `Error` in `core`, `#[expect(...)]`, and other improvements that will be taken advantage of in subsequent commits.
The `Error` trait has been available in `core` since Rust 1.81, which is below our new MSRV of 1.85. Previously, `Error` impls were gated behind the `std` feature so that the crate could build in a no_std environment. Now that the trait lives in `core`, these impls are unconditional and available even without the `std` feature enabled.
Previously, we depended on hashbrown 0.16.1. With this commit, we bump to 0.17.0, which requires Rust 1.85.0 — the same as our MSRV.
added 4 commits
April 21, 2026 12:17
Migrate the crate from the 2021 edition to the 2024 edition. The bulk of the diff is mechanical: - `cargo fix --edition` renames the `expr` macro fragment specifier to `expr_2021` to preserve the 2021 matching behavior. The 2024 `expr` specifier also accepts `const` blocks and `_`, which isn't wanted in these macros. - `cargo fix --edition` adds an extra `&` in a closure pattern to match the new match ergonomics rules. - `cargo fmt` rewrites `use` blocks because rustfmt's 2024 style uses case-sensitive ordering (uppercase before lowercase), whereas the 2021 style was case-insensitive.
The `expect` attribute was stabilized in Rust 1.81, which is below the new MSRV of 1.85. Switch the three `allow(dead_code)` attributes on `BinaryPatchParseErrorKind` variants to `expect(dead_code)` so the attribute itself becomes a maintenance signal: if a variant becomes reachable when the `binary` feature is disabled, the compiler will flag the now-unfulfilled expectation. In the process, also drop the `allow(dead_code)` from `InvalidHeader`. That variant was never actually dead when the `binary` feature was disabled — `parse_binary_patch` is called unconditionally from `patch_set::parse`, and it produces `InvalidHeader` when the header line is missing. The pre-existing `allow` silently hid this; `expect` surfaces it and lets us remove the attribute entirely.
`Option::is_none_or` was stabilized in Rust 1.82, which is below the new MSRV of 1.85. Use it in place of `map_or(true, ...)` to match clippy's `unnecessary_map_or` lint and read closer to the intent: "none, or the predicate holds."
The `expect` attribute, stabilized in Rust 1.81, is stricter than `allow`: it verifies that the suppressed lint actually fires. This surfaces stale suppressions and prevents silently hiding new issues. Convert remaining `allow(...)` attributes to `expect(...)` across the codebase where the suppression is genuinely load-bearing. For items that are dead in non-test builds but used by tests, use `#[cfg_attr(not(test), expect(dead_code))]` so the expectation holds under every configuration. Several `allow(...)` attributes turned out to be suppressing nothing at all — drop them. Examples: - `Range::range` and `Range::empty` are called from the merge path. - `ParseOpts::no_skip_preamble` is called from the patch set parser. - `Text::ends_with` and `Text::lines` are called through the trait. - The `Diff` enum and `DiffOptions::diff` are reachable through the free `diff` fn, which is the only real anchor in that chain. - A number of `needless_lifetimes` annotations as the lint was relaxed upstream. These were all silently wrong under `allow`; `expect` caught them.
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.
No description provided.