1 | extern crate autocfg; |
2 | |
3 | fn main() { |
4 | let ac = autocfg::new(); |
5 | |
6 | // Check for a minimum version for a few features |
7 | if ac.probe_rustc_version(1, 20) { |
8 | println!("cargo:rustc-cfg=tuple_ty" ); |
9 | } |
10 | if ac.probe_rustc_version(1, 31) { |
11 | println!("cargo:rustc-cfg=allow_clippy" ); |
12 | } |
13 | if ac.probe_rustc_version(1, 36) { |
14 | println!("cargo:rustc-cfg=maybe_uninit" ); |
15 | } |
16 | if ac.probe_rustc_version(1, 40) { |
17 | println!("cargo:rustc-cfg=doctests" ); |
18 | } |
19 | if ac.probe_rustc_version(1, 51) { |
20 | println!("cargo:rustc-cfg=raw_ref_macros" ); |
21 | } |
22 | if ac.probe_rustc_version(1, 65) { |
23 | println!("cargo:rustc-cfg=stable_const" ); |
24 | } |
25 | } |
26 | |