Skip to content

Commit 378a7f2

Browse files
committed
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 alexcrichton#576
1 parent a09b66e commit 378a7f2

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,7 @@ required-features = ["static-curl", "ssl"]
8383
name = "multi-dl"
8484
path = "examples/multi-dl.rs"
8585
required-features = ["ssl"]
86+
87+
[lints.rust.unexpected_cfgs]
88+
level = "warn"
89+
check-cfg = ["cfg(need_openssl_init, need_openssl_probe)"]

build.rs

-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
use std::env;
22

33
fn main() {
4-
println!(
5-
"cargo::rustc-check-cfg=cfg(\
6-
need_openssl_init,\
7-
need_openssl_probe,\
8-
)"
9-
);
104
// OpenSSL >= 1.1.0 can be initialized concurrently and is initialized correctly by libcurl.
115
// <= 1.0.2 need locking callbacks, which are provided by openssl_sys::init().
126
let use_openssl = match env::var("DEP_OPENSSL_VERSION_NUMBER") {

curl-sys/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,7 @@ zlib-ng-compat = ["libz-sys/zlib-ng", "static-curl"]
5555
upkeep_7_62_0 = []
5656
poll_7_68_0 = []
5757
ntlm = []
58+
59+
[lints.rust.unexpected_cfgs]
60+
level = "warn"
61+
check-cfg = ["cfg(libcurl_vendored,link_libnghttp2,link_libz,link_openssl)"]

curl-sys/build.rs

-8
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@ use std::process::Command;
55

66
fn main() {
77
println!("cargo:rerun-if-changed=curl");
8-
println!(
9-
"cargo::rustc-check-cfg=cfg(\
10-
libcurl_vendored,\
11-
link_libnghttp2,\
12-
link_libz,\
13-
link_openssl,\
14-
)"
15-
);
168
let target = env::var("TARGET").unwrap();
179
let windows = target.contains("windows");
1810

0 commit comments

Comments
 (0)