From dda53300af2d0561b1c5f3c95efa43574dd856bb Mon Sep 17 00:00:00 2001 From: Luther Monson Date: Sun, 4 Oct 2026 21:37:37 -0700 Subject: [PATCH] chore(clippy): allow double_must_use on async_trait traits (clippy 1.99) Rust 1.99's clippy fires double_must_use on the three #[async_trait] traits: the macro emits a bare #[must_use] on methods that return a Pin>, which is already must_use. The code is unchanged; scope an allow (with reason) to each trait. CI floats to stable via rust-toolchain.toml, so main and every PR went red the day 1.99 shipped. --- crates/litewire-backend/src/auth.rs | 4 ++++ crates/litewire-backend/src/lib.rs | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/crates/litewire-backend/src/auth.rs b/crates/litewire-backend/src/auth.rs index 7e5c3ca..3c5f0a0 100644 --- a/crates/litewire-backend/src/auth.rs +++ b/crates/litewire-backend/src/auth.rs @@ -111,6 +111,10 @@ pub struct AuthRequest<'a> { /// /// See the [module docs](self) for the security contract — in particular, why /// returning a backend chosen from `username` alone is not isolation. +#[allow( + clippy::double_must_use, + reason = "async_trait emits a bare #[must_use] on methods returning a boxed Future (already must_use); clippy 1.99" +)] #[async_trait::async_trait] pub trait ConnectionAuthenticator: Send + Sync + 'static { /// Verify `req` and return the backend this connection may use. diff --git a/crates/litewire-backend/src/lib.rs b/crates/litewire-backend/src/lib.rs index da95aa4..faeae7e 100644 --- a/crates/litewire-backend/src/lib.rs +++ b/crates/litewire-backend/src/lib.rs @@ -109,6 +109,10 @@ pub enum BackendError { /// Implementations must be `Send + Sync` because wire frontends move them /// across `.await` points and (in some frontends) hand them to spawned /// tasks. +#[allow( + clippy::double_must_use, + reason = "async_trait emits a bare #[must_use] on methods returning a boxed Future (already must_use); clippy 1.99" +)] #[async_trait::async_trait] pub trait BackendConn: Send + Sync { /// Execute a query that returns rows. @@ -145,6 +149,10 @@ pub trait BackendConn: Send + Sync { /// for callers that do not need transactions (metrics wrappers, one-off /// probes). They open a fresh `BackendConn` per call and drop it -- do **not** /// use them for BEGIN/COMMIT sequences. +#[allow( + clippy::double_must_use, + reason = "async_trait emits a bare #[must_use] on methods returning a boxed Future (already must_use); clippy 1.99" +)] #[async_trait::async_trait] pub trait Backend: Send + Sync + 'static { /// Open a new session against the underlying storage.