From 1f68cff9a55bc263c2bd6079ca6b0e3684d899cc Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 23 Sep 2026 05:48:07 +0200 Subject: [PATCH] Fix R-I26: turn host_actuator.rs's never_loop into a real if, restore --all-targets The answerer thread's `while let Some(frame) = client.receive_once()? { ...; return Ok(()); }` always returns on its first (and only reachable) iteration, so clippy::never_loop was right that it never loops -- the outer `for` is what actually retries across polls. Rewritten as `if let`. With that gone, cargo clippy --all-targets has nothing left to scope the lint workflow around, so .github/workflows/lint.yml runs it again. Test code is exactly where a disallowed_methods bypass would hide, and it was the one place the workflow's own lint couldn't reach. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/lint.yml | 18 ++++++++---------- src/host_actuator.rs | 6 +++++- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 395084f..e04df2d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,19 +13,17 @@ jobs: # `FrozenSymlinkFs` port (see `src/drivers.rs`, `frozen_symlink_port`) # if something actually runs clippy with the lint promoted to an error. # - # No `--all-targets`: measured on Yggdrasil against this batch and - # against a46b997 (its parent, before this batch touched anything) -- - # `cargo clippy --all-targets` already fails on a pre-existing, - # unrelated `clippy::never_loop` in `host_actuator.rs`'s own test code, - # nothing this batch introduced or is chartered to fix. Without - # `--all-targets`, clippy still analyzes the library crate itself, - # which is where `frozen_symlink_port` and every other disallowed-method - # call site actually live, so the port's coverage is unaffected; only - # test-only code outside the lib is left unchecked by this job. + # R-I26 (Self's ruling, migration-hazard follow-up): the pre-existing + # `clippy::never_loop` this batch's parent scoped the workflow around is + # fixed (`host_actuator.rs`'s answerer thread used a `while let` whose + # every path returned; it is an `if let` now, since the outer `for` was + # already what retried across polls). Test code is exactly where a + # `disallowed_methods` bypass would hide, so `--all-targets` is back: + # this job now reaches it too, not just the library crate. runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: components: clippy - - run: cargo clippy --all-features -- -D clippy::disallowed_methods + - run: cargo clippy --all-targets --all-features -- -D clippy::disallowed_methods diff --git a/src/host_actuator.rs b/src/host_actuator.rs index 90592be..2226ae4 100644 --- a/src/host_actuator.rs +++ b/src/host_actuator.rs @@ -1108,7 +1108,11 @@ mod tests { let answerer = thread::spawn(move || -> Result<()> { for _ in 0..500 { client.poll_resends()?; - while let Some(frame) = client.receive_once()? { + // A plain `if let`, not `while`: every path through this body + // returns, so a loop here would never run a second iteration + // (`clippy::never_loop`) -- the outer `for` is what retries + // across polls. + if let Some(frame) = client.receive_once()? { let envelope = HostActuatorEnvelope::decode(&frame.payload)?; let request = envelope.open_request("raven", &idunn_anchor)?; assert_eq!(envelope.session_nonce, nonce);