Skip to content

policy(clippy): activate planned 1.94/1.95 ratchets after v0.7.0 publishes (#505) #573

Description

@EffortlessSteven

Summary

PR #505 (policy: activate Clippy 1.94/1.95 ratchets) is the long-standing draft that promotes 8 planned Clippy lints to active in [workspace.lints.clippy]. The workspace MSRV is now 1.95 (v0.7.0), so the 1.94 and 1.95 ratchets are eligible. #505 is intentionally PARKED until v0.7.0 publishes; this issue tracks the prerequisites, merge plan, and acceptance criteria so the flip is clean once unblocked.

PR reference

  • policy: activate Clippy 1.94/1.95 ratchets #505policy: activate Clippy 1.94/1.95 ratchets (draft, 8 lints to activate, +53/-50)
  • Last commit on the branch: 40405a4 (2026-05-08) — predates the publish-recovery lane below.
  • Branch: policy/clippy-rust-1.95-ratchetsmain.

Lints to activate

Sourced from policy/clippy-lints.toml [[planned]] entries.

Lint Level activate_when_msrv Reason Status in #505
clippy::same_length_and_capacity deny 1.94 Catch raw-parts reconstruction mistakes in low-level adapters. Activate
clippy::manual_ilog2 warn 1.94 Prefer standard integer log helper. Activate
clippy::decimal_bitwise_operands warn 1.94 Make bit masks visually inspectable. Activate
clippy::needless_type_cast warn 1.94 Avoid stale numeric type drift. Activate
clippy::manual_checked_ops warn 1.95 Prefer checked arithmetic over manual divide-by-zero guards. Activate
clippy::manual_take warn 1.95 Use standard ownership helper instead of local reimplementation. Activate
clippy::duration_suboptimal_units warn 1.95 Make durations legible without mental unit conversion. Activate
clippy::unnecessary_trailing_comma warn 1.95 Keep format macro calls clean. Activate
clippy::disallowed_fields deny 1.95 Ban direct field access across protected seams. HELD in #505 (no protected seams configured yet).
clippy::manual_pop_if warn 1.95 Use collection APIs that encode predicate-and-pop intent. DEFERRED to MSRV 1.96 per #505 (not present in Rust 1.95).

#505 also fixes resulting duration_suboptimal_units warnings by replacing Duration::from_secs(N*3600/86400) with from_hours / from_mins.

Prerequisites

Merge plan

  1. Confirm v0.7.0 is on crates.io and main CI is green.
  2. Rebase policy: activate Clippy 1.94/1.95 ratchets #505 onto current main. Resolve any conflicts in Cargo.toml ([workspace.lints.clippy]) and policy/clippy-lints.toml.
  3. Re-run rtk cargo xtask gate --check locally and re-confirm rtk cargo clippy --workspace --all-targets --all-features --locked -- -D warnings.
  4. Push the rebased branch; verify the pr workflow run is green.
  5. Mark policy: activate Clippy 1.94/1.95 ratchets #505 ready for review; merge once CI passes and review is complete.
  6. After merge, verify on main that cargo xtask check-lint-policy reports the 8 lints as active in [[active_clippy]] (not [[planned]]).

Risks

Acceptance criteria

  • policy: activate Clippy 1.94/1.95 ratchets #505 merged to main.
  • cargo xtask check-lint-policy reports 8 lints as active (with disallowed_fields and manual_pop_if remaining tracked separately).
  • No CI regressions on main post-merge.
  • Workspace [workspace.lints.clippy] block reflects the activated entries; policy/clippy-lints.toml [[planned]] reduced accordingly.

Not in scope

This is the tracking issue and plan. The actual lint flip happens in PR #505 once unblocked; this issue does not modify any source files. disallowed_fields (HELD) and manual_pop_if (DEFERRED to MSRV 1.96) remain out of scope for #505 and this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions