diff options
-rw-r--r-- | cortex-m-rt/build.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/cortex-m-rt/build.rs b/cortex-m-rt/build.rs index dee75b7..7784b98 100644 --- a/cortex-m-rt/build.rs +++ b/cortex-m-rt/build.rs @@ -9,14 +9,11 @@ use std::path::PathBuf; use chrono::NaiveDate; fn main() { - let date: NaiveDate = rustc_version::version_meta() - .unwrap() - .commit_date - .unwrap() - .parse() - .unwrap(); - - if date > NaiveDate::from_ymd(2017, 12, 26) { + let meta = rustc_version::version_meta().unwrap(); + if meta.channel == rustc_version::Channel::Dev + || meta.commit_date.unwrap().parse::<NaiveDate>().unwrap() + > NaiveDate::from_ymd(2017, 12, 26) + { println!("cargo:rustc-cfg=has_termination_lang") } |