From fee35918d01f903aec9f6a5da7ab6b46ed3f7b8c Mon Sep 17 00:00:00 2001 From: harryscholes Date: Thu, 21 May 2026 14:59:15 +0100 Subject: [PATCH] Annotate recv_expect calls to silence never-type-fallback lint The `recv_expect` calls in `sqlx-postgres` previously relied on the compiler's never-type fallback to infer `()` for the message payload. This fallback was removed in Rust 2024 and now triggers a future-incompat warning on stable. Add explicit `::<()>` turbofish to each affected call site; no behavioral change. --- sqlx-postgres/src/connection/executor.rs | 2 +- sqlx-postgres/src/copy.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sqlx-postgres/src/connection/executor.rs b/sqlx-postgres/src/connection/executor.rs index 67ffa16ac..99ed24f14 100644 --- a/sqlx-postgres/src/connection/executor.rs +++ b/sqlx-postgres/src/connection/executor.rs @@ -65,7 +65,7 @@ async fn prepare( // indicates that the SQL query string is now successfully parsed and has semantic validity let _ = conn .stream - .recv_expect(MessageFormat::ParseComplete) + .recv_expect::<()>(MessageFormat::ParseComplete) .await?; let metadata = if let Some(metadata) = metadata { diff --git a/sqlx-postgres/src/copy.rs b/sqlx-postgres/src/copy.rs index f5a6ea857..8cc481251 100644 --- a/sqlx-postgres/src/copy.rs +++ b/sqlx-postgres/src/copy.rs @@ -281,7 +281,7 @@ impl> PgCopyIn { Some(Cow::Borrowed("57014")) => { // postgres abort received error code conn.stream - .recv_expect(MessageFormat::ReadyForQuery) + .recv_expect::<()>(MessageFormat::ReadyForQuery) .await?; Ok(()) } @@ -315,7 +315,7 @@ impl> PgCopyIn { }; conn.stream - .recv_expect(MessageFormat::ReadyForQuery) + .recv_expect::<()>(MessageFormat::ReadyForQuery) .await?; Ok(cc.rows_affected()) @@ -351,8 +351,8 @@ async fn pg_begin_copy_out<'c, C: DerefMut + Send + 'c>( MessageFormat::CopyData => r#yield!(msg.decode::>()?.0), MessageFormat::CopyDone => { let _ = msg.decode::()?; - conn.stream.recv_expect(MessageFormat::CommandComplete).await?; - conn.stream.recv_expect(MessageFormat::ReadyForQuery).await?; + conn.stream.recv_expect::<()>(MessageFormat::CommandComplete).await?; + conn.stream.recv_expect::<()>(MessageFormat::ReadyForQuery).await?; return Ok(()) }, _ => return Err(err_protocol!("unexpected message format during copy out: {:?}", msg.format))