Silence never-type-fallback warning in sqlx-postgres#5
Merged
Conversation
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.
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
sqlx-postgreshas five call sites that invokePgStream::recv_expectwithout 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-dbagainst this fork therefore emits: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(inprepare)sqlx-postgres/src/copy.rs:284(inPgCopyIn::abort)sqlx-postgres/src/copy.rs:318(inPgCopyIn::finish)sqlx-postgres/src/copy.rs:354-355(inpg_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,migratein the fork — no morenever type fallbackwarningsrevinpinecone-db/Cargo.tomland confirm the future-incompat report oncargo checkis gone