Skip to content

chore(clippy): drop expect_used quarantine for lading_throttle#1883

Draft
goxberry wants to merge 1 commit into
goxberry/enforce-no-expect-in-productionfrom
goxberry/expect-cleanup-lading-throttle
Draft

chore(clippy): drop expect_used quarantine for lading_throttle#1883
goxberry wants to merge 1 commit into
goxberry/enforce-no-expect-in-productionfrom
goxberry/expect-cleanup-lading-throttle

Conversation

@goxberry
Copy link
Copy Markdown
Contributor

@goxberry goxberry commented May 22, 2026

What does this PR do?

Removes the transitional #![allow(clippy::expect_used)] quarantine from lading_throttle/src/lib.rs. The crate is now fully governed by the workspace-level clippy::expect_used = "deny" introduced in the parent PR.

No code other than the lint-config line is touched.

Motivation

All 28 .expect() sites in lading_throttle are already in code paths that the lint does not (and should not) reach:

Location Count Why the lint doesn't apply
lading_throttle/src/lib.rs — inside #[cfg(test)] mod tests 20 Exempted by allow-expect-in-tests = true in clippy.toml.
lading_throttle/src/linear.rs — inside #[cfg(kani)] mod verification 4 cargo clippy does not compile cfg(kani) blocks; the kani harness runs under cargo kani, which does not run clippy.
lading_throttle/src/stable.rs — inside #[cfg(kani)] mod verification 4 Same as above.

That is, the quarantine was already redundant the moment the parent PR's allow-expect-in-tests exemption was in place. Removing it returns this crate to "fully enforced" with no behavior change — and proves the workspace gate is wired correctly.

This is the first per-crate cleanup in the stack started by #1882 (parent). The remaining crates have real production .expect() sites that require code changes; this one was cost-free.

Related issues

Stacked on top of #1882.

Additional Notes

  • ci/validate passes locally end-to-end, including kani proofs for lading_throttle.
  • The gate's active enforcement was already verified in the parent PR. This PR is a no-op for code but flips one more crate from "quarantined" to "enforced" — exactly what the stacked-PR plan called for.

All 28 `.expect()` sites in `lading_throttle` live under either
`#[cfg(test)]` or `#[cfg(kani)]`. The `#[cfg(test)]` sites are exempted
by clippy's `allow-expect-in-tests`; the `#[cfg(kani)]` sites are not
compiled by `cargo clippy` so the lint never sees them. The crate-root
`#![allow(clippy::expect_used)]` is therefore unnecessary and is
removed, putting `lading_throttle` fully under the workspace-level
`clippy::expect_used = "deny"`.

This is the first per-crate cleanup in the stack that began with
"chore(clippy): forbid .expect() in production code".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

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.

1 participant