Skip to content

feat(harden): Rust 1.95 rustc lint floor in workspace.lints.rust (#198)#226

Merged
EffortlessSteven merged 1 commit into
mainfrom
feat/rustc-lint-floor-20260512
May 12, 2026
Merged

feat(harden): Rust 1.95 rustc lint floor in workspace.lints.rust (#198)#226
EffortlessSteven merged 1 commit into
mainfrom
feat/rustc-lint-floor-20260512

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Adds five 1.95-stable compiler-side lints to [workspace.lints.rust]. Codebase is clean against all of them — single-commit activation, no fallout.

Issue

Closes #198. Builds on #171 (MSRV 1.95 bump). Refines #109 (Harden pillar).

Activated

[workspace.lints.rust]
unsafe_code              = "forbid"   # preserved from prior state
unsafe_op_in_unsafe_fn   = "deny"
unused_must_use          = "deny"
unexpected_cfgs          = "warn"
const_item_mutation      = "deny"

Lint-name correction (important)

Issue #198 listed seven lints; two had names that are not real rustc lints in 1.95:

Issue body Status
function_casts_as_integer ❌ Not a real lint. Omitted.
unused_visibilities ❌ Not a real lint. Omitted.
const_item_interior_mutations ❌ Near-miss → real name const_item_mutation. Used the real one.

The Haiku planning agent that filed #198 inferred lint names by pattern rather than against the rustc lint catalog. The five remaining lints are verified — cargo check with -D <lint> rejects unknown lint names via E0602, and all five compile cleanly here.

Acceptance

  • cargo check --workspace --all-targets --all-features --locked passes.
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings clean.
  • cargo fmt --all -- --check clean.
  • Single-commit activation per the issue's "zero fallout" verdict.

Note: cargo test --workspace produced one flake in ops::git::cleanliness::tests::ensure_git_clean_new_phrasing (a pre-existing race that passes in isolation). Not introduced by this PR — the only change here is to Cargo.toml, no Rust code modified.

Follow-ups

Adds five 1.95-stable compiler-side lints to [workspace.lints.rust].
The codebase is clean against all five — single-commit activation,
no fallout to fix.

Activated:

  unsafe_op_in_unsafe_fn   = "deny"
  unused_must_use          = "deny"
  unexpected_cfgs          = "warn"
  const_item_mutation      = "deny"

`unsafe_code = "forbid"` was already in place; preserved.

## Lint-name correction

Issue #198 listed seven lints. Two had names that are not real rustc
lints in 1.95:

  function_casts_as_integer  — no such lint; omitted.
  unused_visibilities        — no such lint; omitted.

A third had a near-name: `const_item_interior_mutations` in the issue
maps to the real `const_item_mutation`. Used the real name here.

The Haiku planning agent that filed #198 inferred lint names by
pattern rather than against the rustc lint catalog. The five
remaining lints are verified against `cargo check` with `-D` (rustc
rejects unknown lint names via E0602; all five compile cleanly).

## Acceptance

- cargo check --workspace --all-targets --all-features --locked passes.
- cargo clippy --workspace --all-targets --all-features --locked -- -D warnings clean.
- cargo fmt --all -- --check clean.
- cargo test workspace (one unrelated flaky test in
  `ops::git::cleanliness::tests::ensure_git_clean_new_phrasing` —
  passes in isolation, pre-existing race not introduced by this PR).

## Out of scope

- PR for #191 (Clippy ratchet activation) — turns the 10 [[planned]]
  entries in policy/clippy-lints.toml into live [workspace.lints.clippy].
- Re-filing for the missing lints: the two omitted names are not real
  in 1.95, so there's nothing to follow up on. If a future rustc
  release adds equivalent lints, file a fresh issue against that
  version.
- Convert bare `#[allow(clippy::...)]` to `#[expect(..., reason = ".."]
  — surfaced by #179's check-clippy-exceptions as informational.

Closes #198.
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 24 minutes and 5 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b0eeeb49-b482-4e3c-b7dc-32488efb4331

📥 Commits

Reviewing files that changed from the base of the PR and between c67e94c and fb1db0e.

📒 Files selected for processing (1)
  • Cargo.toml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/rustc-lint-floor-20260512

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@factory-droid

factory-droid Bot commented May 12, 2026

Copy link
Copy Markdown

Droid finished @EffortlessSteven's task —— View job


Review Validation Complete

Status: approved

Summary: No review comment candidates were generated (review_candidates.json contained zero comments). The PR cleanly adds five verified rustc lints to [workspace.lints.rust], all correctly named and validated against the rustc lint catalog. The build, clippy, and format checks pass. The two invalid lint names from issue #198 (function_casts_as_integer, unused_visibilities) are correctly omitted, and const_item_interior_mutations is correctly mapped to the real const_item_mutation lint.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb1db0e324

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Cargo.toml
Comment on lines +32 to +34
# Issue #198 listed two lint names that turned out not to be real rustc lints
# in 1.95 (`function_casts_as_integer` and `unused_visibilities`). They are
# omitted here. `const_item_interior_mutations` from the issue maps to the

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add the omitted rustc lints

Failure mode: Observed with rustc 1.95.0, rustc -W help lists function-casts-as-integer and unused-visibilities, and a minimal Cargo manifest with function_casts_as_integer = "deny" / unused_visibilities = "deny" parses under cargo check --offline; treating them as nonexistent leaves #198's requested lint floor only partially active, so these checks are not enforced by normal cargo check. Why here: the new comment is the reason the lints are omitted. Fix direction: add the two [workspace.lints.rust] entries at the intended levels and update this note. Validation: cargo check --workspace --all-targets --all-features --locked. Confidence: high.

Useful? React with 👍 / 👎.

@EffortlessSteven EffortlessSteven merged commit a6db801 into main May 12, 2026
24 checks passed
@EffortlessSteven EffortlessSteven deleted the feat/rustc-lint-floor-20260512 branch May 12, 2026 05:43
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.

PR 6: Rust 1.95 rustc lint floor

1 participant