2020-03-16 17:23:25 +00:00
|
|
|
extern crate autocfg;
|
|
|
|
|
2019-03-15 09:24:04 +00:00
|
|
|
fn main() {
|
2020-03-16 17:07:13 +00:00
|
|
|
let ac = autocfg::new();
|
2019-03-15 09:24:04 +00:00
|
|
|
|
2019-11-17 19:47:03 +00:00
|
|
|
// Check for a minimum version for a few features
|
2020-10-23 07:16:25 +00:00
|
|
|
if ac.probe_rustc_version(1, 20) {
|
|
|
|
println!("cargo:rustc-cfg=tuple_ty");
|
|
|
|
}
|
2020-03-16 17:07:13 +00:00
|
|
|
if ac.probe_rustc_version(1, 31) {
|
2019-11-17 19:47:03 +00:00
|
|
|
println!("cargo:rustc-cfg=allow_clippy");
|
|
|
|
}
|
2020-03-16 17:07:13 +00:00
|
|
|
if ac.probe_rustc_version(1, 36) {
|
2019-11-17 19:45:27 +00:00
|
|
|
println!("cargo:rustc-cfg=maybe_uninit");
|
2019-03-15 09:24:04 +00:00
|
|
|
}
|
2020-03-16 17:07:13 +00:00
|
|
|
if ac.probe_rustc_version(1, 40) {
|
2019-11-17 19:45:27 +00:00
|
|
|
println!("cargo:rustc-cfg=doctests");
|
2019-08-10 09:43:04 +00:00
|
|
|
}
|
2021-03-08 18:56:59 +00:00
|
|
|
if ac.probe_rustc_version(1, 51) {
|
|
|
|
println!("cargo:rustc-cfg=raw_ref_macros");
|
|
|
|
}
|
2022-12-11 19:53:36 +00:00
|
|
|
if ac.probe_rustc_version(1, 65) {
|
|
|
|
println!("cargo:rustc-cfg=stable_const");
|
|
|
|
}
|
2019-03-15 09:24:04 +00:00
|
|
|
}
|