1 2 3 4 5 6 7 8 9 10 11 12
use rustc_version::{version, version_meta, Channel}; fn main() { assert!(version().unwrap().major >= 1); match version_meta().unwrap().channel { Channel::Stable => { println!("cargo:rustc-cfg=feature=\"stable\"") } _ => {} } }