Merge pull request #1103 from alexcrichton/autocfg

Switch from `rustc_version` to `autocfg`
This commit is contained in:
Steven Fackler 2019-05-01 08:39:49 -07:00 committed by GitHub
commit 9f3cf9907f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -21,7 +21,7 @@ libc = "0.2"
cc = "1.0"
openssl-src = { version = "111.0.1", optional = true }
pkg-config = "0.3.9"
rustc_version = "0.2"
autocfg = "0.1.2"
[target.'cfg(target_env = "msvc")'.build-dependencies]
vcpkg = "0.2"

View File

@ -2,7 +2,7 @@ extern crate cc;
#[cfg(feature = "vendored")]
extern crate openssl_src;
extern crate pkg_config;
extern crate rustc_version;
extern crate autocfg;
#[cfg(target_env = "msvc")]
extern crate vcpkg;
@ -94,9 +94,9 @@ fn main() {
}
fn check_rustc_versions() {
let version = rustc_version::version().unwrap();
let cfg = autocfg::new();
if version >= rustc_version::Version::new(1, 31, 0) {
if cfg.probe_rustc_version(1, 31) {
println!("cargo:rustc-cfg=const_fn");
}
}