extern crate rustc_version;
use rustc_version::Channel;
const DEPRECATED_CFG: &'static str = "has_deprecated";
fn main() {
let version = rustc_version::version_meta();
println!("cargo:rerun-if-changed=build.rs");
if version.channel == Channel::Nightly {
if let Some(ref date) = version.commit_date {
let ndate = date.splitn(3, "-")
.map(str::parse)
.collect::<Result<Vec<i32>, _>>().unwrap();
if ndate >= vec![2015, 12, 18] {
println!("cargo:rustc-cfg={}", DEPRECATED_CFG);
}
}
}
}