fix(ci): admit intentional async trait implementations - #35
Merged
farhan-syah merged 1 commit intoSep 16, 2026
Merged
farhan-syah merged 1 commit into
farhan-syah merged 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restore the repository's
cargo clippy --all-targets --all-features -- -D warningsgate on Rust/Clippy 1.98 by acknowledging the small set of async implementations that are intentionally synchronous today.This is a CI-compatibility change only. It does not change the
VfsorVfsFilecontracts, does not change any future's observable behavior, and does not weaken Clippy globally. The new lint is allowed only at the specific production and test implementations where an async trait contract is deliberately preserved even though the current body can complete without awaiting.What failed
The latest two upstream CI runs fail only in
Test Suite / Lint, Format & Docsafter the hosted toolchain began reporting Clippy'sunused_async_trait_impllint. The current gate promotes all warnings to errors, so otherwise-correct implementations now stop the build.The failures are not ordinary
async fnfunctions that can safely become synchronous. They occur in implementations of PageDB's shared async storage surface:VfsandVfsFilebackend;These implementations happen not to suspend in the affected configurations. Their peers do suspend, and callers rely on one backend-independent interface.
Change
This PR adds
clippy::unused_async_trait_implto the existing, narrow allowances on the affected pager methods and to the specific traitimplblocks that Clippy identifies.Comments at the less-obvious sites record why the allowance is part of the abstraction contract:
Unsupportedimmediately but must still implement the portable trait; andNo crate-level or module-level allowance is introduced. A new occurrence elsewhere will still fail CI and require its own review.
Why retain async here
Removing
asyncwould not be a local warning cleanup. For trait implementations it would stop implementing the trait. Splitting the trait into synchronous and asynchronous variants would multiply the generic surface across the pager, transaction layer, tests, and every VFS backend without improving runtime behavior. Wrapping each body in a manufactured pending operation would silence static analysis by adding useless runtime machinery.The scoped allowance states the actual invariant directly: these particular implementations are allowed to finish immediately while remaining members of an asynchronous portability contract.
Alternatives considered
Allow the lint crate-wide
Rejected. A crate-wide allowance would conceal accidental async functions in unrelated code and make the
-D warningsgate less useful. This PR keeps the warning active everywhere except the reviewed contract sites.Change Clippy or Rust versions in CI
Rejected. Pinning an older toolchain would make the gate green by avoiding a useful new diagnostic, and it would defer the same failure until the next upgrade. The code should state its intent instead.
Remove
asyncor split the traitsRejected. The affected methods participate in an intentionally uniform interface. A backend-specific synchronous API would spread conditional behavior into callers and tests for no correctness or performance benefit.
Add artificial awaits
Rejected. Yielding or awaiting an immediately-ready future solely to satisfy a lint would add behavior and overhead while obscuring why the implementation is synchronous.
Compatibility and risk
The primary risk is future code being added inside an allowed
implblock and becoming unintentionally synchronous. That is bounded to the few whole-impl allowances required by the lint's placement. The accompanying comments make the intent reviewable, and other Clippy lints remain active inside those implementations.Verification
Run on the exact upstream base plus this commit:
All four commands pass with Rust/Clippy 1.98.1 and target standard libraries from the same pinned toolchain. Before the patch, the Clippy command reproduces the hosted CI failure; after the patch, the gate completes without suppressing unrelated warnings. Both browser-facing target checks also pass, covering the OPFS implementation and the WASI shim touched by the scoped allowances.
The live Sep 8 GitHub run (
34231800975) provides the baseline separation: every test, feature, platform, WASM, benchmark, invariant, and audit job passed, while onlyTest Suite / Lint, Format & Docsfailed onunused_async_trait_impl(102079528103). This PR addresses that exact failing gate and no green job's behavior.The same commit was then used as the prerequisite under both functional candidates prepared alongside it. Their complete PageDB suites passed independently: 791/791 tests for the key-formatting stack and 789/789 tests for the header-capability stack, with the repository's same ten slow tests skipped by default in each run.
The change is annotation-only, so no behavior-specific regression test is appropriate: a test cannot distinguish an accepted lint annotation from the pre-existing implementation. The relevant regression guard is the exact CI command itself, which continues to compile every target and feature combination under
-D warnings.Review guide
The useful review question for each allowance is: "Must this method retain the asynchronous interface even though this implementation currently does not await?" The answer should be yes at every touched site. If a site can leave the shared async contract without widening the API or platform-specific branching, that site should be removed from this PR rather than permitted speculatively.
Non-goals
This PR does not redesign the VFS traits, change executor behavior, alter backend selection, or normalize every existing lint attribute. It restores the existing strict gate with the smallest contract-accurate change.