Skip to content

Commit 7ea34a1

Browse files
authored
Merge pull request #57 from crawford/build
Support dev channels of rustc
2 parents 57dd0fa + 35a319c commit 7ea34a1

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

cortex-m-rt/build.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@ use std::path::PathBuf;
99
use chrono::NaiveDate;
1010

1111
fn main() {
12-
let date: NaiveDate = rustc_version::version_meta()
13-
.unwrap()
14-
.commit_date
15-
.unwrap()
16-
.parse()
17-
.unwrap();
18-
19-
if date > NaiveDate::from_ymd(2017, 12, 26) {
12+
let meta = rustc_version::version_meta().unwrap();
13+
if meta.channel == rustc_version::Channel::Dev
14+
|| meta.commit_date.unwrap().parse::<NaiveDate>().unwrap()
15+
> NaiveDate::from_ymd(2017, 12, 26)
16+
{
2017
println!("cargo:rustc-cfg=has_termination_lang")
2118
}
2219

0 commit comments

Comments
 (0)