feat(harden): Rust 1.95 rustc lint floor in workspace.lints.rust (#198)#226
Conversation
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.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
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 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. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Droid finished @EffortlessSteven's task —— View job Review Validation CompleteStatus: approved Summary: No review comment candidates were generated (review_candidates.json contained zero comments). The PR cleanly adds five verified rustc lints to |
There was a problem hiding this comment.
💡 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".
| # 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 |
There was a problem hiding this comment.
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 👍 / 👎.
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
Lint-name correction (important)
Issue #198 listed seven lints; two had names that are not real rustc lints in 1.95:
function_casts_as_integerunused_visibilitiesconst_item_interior_mutationsconst_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 checkwith-D <lint>rejects unknown lint names via E0602, and all five compile cleanly here.Acceptance
cargo check --workspace --all-targets --all-features --lockedpasses.cargo clippy --workspace --all-targets --all-features --locked -- -D warningsclean.cargo fmt --all -- --checkclean.Note:
cargo test --workspaceproduced one flake inops::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 toCargo.toml, no Rust code modified.Follow-ups
[[planned]]entries inpolicy/clippy-lints.toml(landed in feat(policy): Clippy lint ledgers + check-lint-policy / check-clippy-exceptions (#179) #225) into live[workspace.lints.clippy]entries with measured fallout intoclippy-debt.toml.#[allow(clippy::...)]to#[expect(..., reason = "...")]— 10 occurrences surfaced by feat(policy): Clippy lint ledgers + check-lint-policy / check-clippy-exceptions (#179) #225'scheck-clippy-exceptions.SHIPPER_GIT_BINenv var leak between parallel tests).