Skip to content

chore: Fix warnings for custom postgres_## cfg flags #3950

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iamjpotts
Copy link
Contributor

Resolves build warnings related to custom cfg conditions that are present in the code because they are set for various CI runs defined in a matrix in the GitHub workflow.

Example warning that disappears with this change:

warning: unexpected `cfg` condition name: `postgres_15`
   --> tests/postgres/types.rs:691:24
    |
691 | #[cfg(any(postgres_14, postgres_15))]
    |                        ^^^^^^^^^^^
    |
    = help: consider using a Cargo feature instead
    = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
             [lints.rust]
             unexpected_cfgs = { level = "warn", check-cfg = ['cfg(postgres_15)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(postgres_15)");` to the top of the `build.rs`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

Note that even though sqlx supports Postgres 16 and 17, we do not need to add entries for those because they are never referenced as cfg conditions.

Does your PR solve an issue?

No

Is this a breaking change?

No - informs linter of an expected set of possible custom cfg parameter values

@iamjpotts iamjpotts marked this pull request as ready for review July 27, 2025 01:38
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