Skip to content

Silence never-type-fallback warning in sqlx-postgres#5

Merged
harryscholes merged 1 commit into
reprofrom
harry/fix-never-type-fallback
May 21, 2026
Merged

Silence never-type-fallback warning in sqlx-postgres#5
harryscholes merged 1 commit into
reprofrom
harry/fix-never-type-fallback

Conversation

@harryscholes
Copy link
Copy Markdown

Summary

sqlx-postgres has five call sites that invoke PgStream::recv_expect without specifying its generic return type. The compiler used to infer () via never-type fallback; that fallback was removed in the Rust 2024 edition and now triggers a future-incompat lint on stable (never_type_fallback_flowing_into_unsafe / dependency_on_unit_never_type_fallback).

Building pinecone-db against this fork therefore emits:

warning: the following packages contain code that will be rejected by a future version of Rust: sqlx-postgres v0.7.3 …

The fix is purely cosmetic — add an explicit ::<()> turbofish at each affected call site. No behavioral change.

Fixed call sites:

  • sqlx-postgres/src/connection/executor.rs:68 (in prepare)
  • sqlx-postgres/src/copy.rs:284 (in PgCopyIn::abort)
  • sqlx-postgres/src/copy.rs:318 (in PgCopyIn::finish)
  • sqlx-postgres/src/copy.rs:354-355 (in pg_begin_copy_out)

This mirrors the equivalent fix that landed upstream in launchbadge/sqlx for 0.7.4.

Test plan

  • cargo check -p sqlx-postgres --no-default-features --features any,migrate in the fork — no more never type fallback warnings
  • After merge, bump the rev in pinecone-db/Cargo.toml and confirm the future-incompat report on cargo check is gone

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.
@harryscholes harryscholes merged commit 470cc5f into repro May 21, 2026
4 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant