Skip to content

Fix MSRV build: qualify size_of, add cargo-msrv CI check#121

Merged
arthurprs merged 1 commit into
masterfrom
fix-msrv-size-of
Jun 4, 2026
Merged

Fix MSRV build: qualify size_of, add cargo-msrv CI check#121
arthurprs merged 1 commit into
masterfrom
fix-msrv-size-of

Conversation

@arthurprs
Copy link
Copy Markdown
Owner

Fixes #118.

Problem

std::mem::size_of was only added to the standard prelude in Rust 1.80, but the declared MSRV is 1.71 (rust-version = "1.71" in Cargo.toml). It was used unqualified in linked_slab.rs::memory_used, so downstream crates on Rust < 1.80 failed to build (reported on 1.75).

Fix

  • Qualify the call as std::mem::size_of::<Entry<T>>() (matching the existing usage in shard.rs).
  • Add an msrv CI job that runs cargo msrv verify, which checks the crate compiles with the rust-version declared in Cargo.toml, across the same feature combinations as the existing check job. CI previously only ran on stable, which is why this slipped through.

Verification

Tested locally with cargo-msrv 0.19.3 against a real Rust 1.71.0 toolchain:

  • cargo msrv verify reports compatible with 1.71.0 for default features, --features stats, --no-default-features, and --no-default-features --features sharded-lock.
  • Reverting the one-line fix makes cargo msrv verify fail with E0425 (cannot find size_of), confirming the new CI job actually catches this class of regression.

`std::mem::size_of` was only added to the prelude in Rust 1.80, but the
declared MSRV is 1.71. It was used unqualified in linked_slab.rs, breaking
builds for downstream crates on Rust < 1.80.

Qualify the call as `std::mem::size_of` (matching shard.rs) and add an
`msrv` CI job that runs `cargo msrv verify` so this regression is caught
in the future.

Fixes #118
@arthurprs arthurprs merged commit 4cb2092 into master Jun 4, 2026
12 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.

Cannot build on older Rust version

1 participant