Skip to content

meta: bump MSRV to 1.85#79

Merged
bmwill merged 7 commits into
masterfrom
msrv
Apr 21, 2026
Merged

meta: bump MSRV to 1.85#79
bmwill merged 7 commits into
masterfrom
msrv

Conversation

@bmwill
Copy link
Copy Markdown
Owner

@bmwill bmwill commented Apr 21, 2026

No description provided.

Brandon Williams 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.
Brandon Williams 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.
@bmwill bmwill merged commit c10a9af into master Apr 21, 2026
42 checks passed
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