Repository navigation
fix(clippy): allow macro-generated double_must_use on four async_trait traits (unblocks every PR) - #104
fix(clippy): allow macro-generated double_must_use on four async_trait traits (unblocks every PR)#104bkataru wants to merge 1 commit into
Conversation
…t traits `Check & Lint` fails on `main` under clippy 1.99 with four `clippy::double_must_use` errors, which blocks every PR (incl. #97). All four are `#[async_trait]` attributes whose generated boxed future carries `#[must_use]`, on top of a return type that is already `#[must_use]`: agent/backend/mod.rs:18 LlmBackend -> Result<LLMResponse> agent/pool.rs:44 PoolExecutor -> PoolResult coordinator/mod.rs:444 TaskRunner -> crate::Result<Value> tools/mod.rs:42 Tool The duplication is produced by macro expansion, so there is no source-level `#[must_use]` to remove or annotate. A `must_use` grep finds nothing at any of these sites -- that is why the issue read as stale. Uses the repo's existing convention of per-item allows (cf. agent/backend/ares_backend.rs:18, tools/task.rs:325). No behaviour change: 20 insertions, 0 deletions. Fixes #86
Closing as superseded — the fix is upstream, and a bump already existsThis PR adds four Measured in the local cargo registry:
This repo pins The bump is already proposed — four times
Opening a fifth would add to a cluster, not to a fix. Two corrections this PR would otherwise have shipped
Closing rather than leaving it open as an alternative, because it is not a real alternative — it is strictly worse than the bump. Fixes #86 only via the bump, so #86 stays open until one of #87/#92/#94 merges. It also means the four-site census is still useful: it is what any of those PRs should be validated against ( Note for whoever picks the survivor: four open PRs for one dependency bump is itself the defect to clean up — pick one, close the rest, preserve the strongest verification. |
Unblocks
Check & Lint— four macro-generateddouble_must_useerrors onmainmainis red under clippy 1.99 with 4 ×clippy::double_must_use, which failsCheck & Lintand blocks every PR, including the release-gate work in #97.The four sites
All are
#[async_trait]attributes. The macro generates a boxed-future method carrying#[must_use], layered on a return type that is already#[must_use]:agent/backend/mod.rs:18LlmBackendResult<LLMResponse>agent/pool.rs:44PoolExecutorPoolResultcoordinator/mod.rs:444TaskRunnercrate::Result<Value>tools/mod.rs:42ToolWhy a
must_usegrep finds nothingThis is what made #86 read as stale to earlier investigation. The attribute is not in the source — it is produced by
#[async_trait]expansion. A source scan formust_usereturns 0 on a tree where the lint fires at all four sites. That argument is not sound evidence of absence.The other check, a duplicated
#[must_use]on a synthetic function not firing, exercises a different construct (literal duplicate attributes, which rustc'sunused_attributescatches) on clippy 0.1.95.The fix
A targeted
#[allow(clippy::double_must_use)]on each trait, matching this repo's existing convention of per-item allows — cf.agent/backend/ares_backend.rs:18,tools/task.rs:325,tools/edit_tests.rs:1304. There is no workspace[lints]section and no crate-root lint level, so this is the established pattern.20 insertions, 0 deletions. No behaviour change.
Verification — CI's exact gate, both directions
Full three-step gate on the patched tree:
Run on 1.99.0, not local
stable(1.98.0) — see below.Why it re-broke, and why that matters more than the lint
ci.yml:19pinsdtolnay/rust-toolchain@stableand the repo has norust-toolchain.toml, so the compiler that decides CI floats. This was green when earlier lanes checked it and went red when stable reached 1.99. The recurring "is this still real?" cycle on #86 is the real cost.Not done here: adding a
rust-toolchain.tomlor changing the-D warningspolicy. Whether to pin the toolchain or absorb new lints is a maintainer decision, and #87 tracks the version bump. This change only makes the current failure go away.Fixes #86