From 378a7f22b3bad037081e0511952d2f7b965e7428 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Sat, 21 Sep 2024 07:10:15 +0900 Subject: [PATCH] Use the Cargo.toml version of the check-cfg squelching It doesn't make older version of cargo complain. https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html#check-cfg-in-lintsrust-table Fixes #576 --- Cargo.toml | 4 ++++ build.rs | 6 ------ curl-sys/Cargo.toml | 4 ++++ curl-sys/build.rs | 8 -------- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ed871cfdd..54eb015b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -83,3 +83,7 @@ required-features = ["static-curl", "ssl"] name = "multi-dl" path = "examples/multi-dl.rs" required-features = ["ssl"] + +[lints.rust.unexpected_cfgs] +level = "warn" +check-cfg = ["cfg(need_openssl_init, need_openssl_probe)"] diff --git a/build.rs b/build.rs index d6b0797a6..11539d433 100644 --- a/build.rs +++ b/build.rs @@ -1,12 +1,6 @@ use std::env; fn main() { - println!( - "cargo::rustc-check-cfg=cfg(\ - need_openssl_init,\ - need_openssl_probe,\ - )" - ); // OpenSSL >= 1.1.0 can be initialized concurrently and is initialized correctly by libcurl. // <= 1.0.2 need locking callbacks, which are provided by openssl_sys::init(). let use_openssl = match env::var("DEP_OPENSSL_VERSION_NUMBER") { diff --git a/curl-sys/Cargo.toml b/curl-sys/Cargo.toml index 51e30028d..b83fb3a99 100644 --- a/curl-sys/Cargo.toml +++ b/curl-sys/Cargo.toml @@ -55,3 +55,7 @@ zlib-ng-compat = ["libz-sys/zlib-ng", "static-curl"] upkeep_7_62_0 = [] poll_7_68_0 = [] ntlm = [] + +[lints.rust.unexpected_cfgs] +level = "warn" +check-cfg = ["cfg(libcurl_vendored,link_libnghttp2,link_libz,link_openssl)"] diff --git a/curl-sys/build.rs b/curl-sys/build.rs index 9eefa8e72..abb717c42 100644 --- a/curl-sys/build.rs +++ b/curl-sys/build.rs @@ -5,14 +5,6 @@ use std::process::Command; fn main() { println!("cargo:rerun-if-changed=curl"); - println!( - "cargo::rustc-check-cfg=cfg(\ - libcurl_vendored,\ - link_libnghttp2,\ - link_libz,\ - link_openssl,\ - )" - ); let target = env::var("TARGET").unwrap(); let windows = target.contains("windows");