Skip to content

the workspace declares an MSRV no crate inherits, so nothing reads it and nothing checks it #270

Description

@CarlAllenn

Defect

Cargo.toml:26 declares the workspace MSRV and says, in a comment,
exactly what it is for:

# The MSRV a consumer reads, and the one clippy's `incompatible_msrv`
# checks against: it defaults to this field rather than to a number in
# clippy.toml, so the manifest stays the single source (canon #445).
rust-version = "1.97"

No member inherits it. Every member inherits version, edition,
license, repository, readme, keywords and categories from
[workspace.package]; rust-version.workspace = true is on none of the
four. Cargo's inheritance is opt-in per field, so:

$ cargo metadata --no-deps | jq -r '.packages[] | "\(.name) -> \(.rust_version)"'
lab-core -> null
lab-cli -> null
lab-wasm -> null
lab-pg -> null

Three claims in that comment are false at once. No published crate
carries an MSRV, so no consumer reads one. clippy::incompatible_msrv
has no version to check against, so the lint that comment names as the
reason for the field is silently inert. And lint:msrv (.github#820),
whose whole job is to compile each declared minimum at the rustc that
names it, reports:

lint:msrv: no crate declares rust-version, skipped

That line is the check being honest — it is the fail-closed wording
#820 built precisely so a skip cannot read as a pass. Nobody had read it,
because until .github#813 nothing ran lint:msrv here at all.

Decided build

Add rust-version.workspace = true to all four members, beside the seven
fields they already inherit. Nothing else changes: the value is already
declared once with its reasoning, and this is the line that makes the
declaration reach the crates it describes.

Then re-run mise run lint:msrv and expect it to compile, not skip. The
workspace pins exactly one rustc (1.97.1) and the declared minimum is
1.97, so #820's patch-exact rule is already satisfied — see its
agreement leg, which names both files.

Rejected, recorded: deleting the field instead. The comment's reasoning
is right — the manifest IS the single source clippy reads, and a fixture
that publishes four crates to two registries should say what rustc they
need. What was missing was the inheritance, not the intent.

Canon consequence

None. lint:msrv already reported this correctly and needs no change; it
is a repository that never met it.

Done when

  • all four members carry rust-version.workspace = true
  • cargo metadata shows 1.97 for each
  • mise run lint:msrv compiles a declared minimum instead of skipping,
    and says so in its own output

Sequencing

Independent of #265 and #268 — this is repo-local and blocked by
nothing. Found 2026-08-24 while doing #265: it is the second thing the
belt at .github#813's pin reported the first time it ever looked at this
workspace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions