Skip to content

Commit

Permalink
Do not fail to compile if autocfg unable to determine rustc version
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Nov 22, 2020
1 parent 3b14dec commit da1081a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion crossbeam-utils/build.rs
@@ -1,5 +1,17 @@
use autocfg::AutoCfg;

fn main() {
let cfg = autocfg::new();
let cfg = match AutoCfg::new() {
Ok(cfg) => cfg,
Err(e) => {
println!(
"cargo:warning=crossbeam-utils: unable to determine rustc version: {}",
e
);
return;
}
};

cfg.emit_type_cfg("core::sync::atomic::AtomicU8", "has_atomic_u8");
cfg.emit_type_cfg("core::sync::atomic::AtomicU16", "has_atomic_u16");
cfg.emit_type_cfg("core::sync::atomic::AtomicU32", "has_atomic_u32");
Expand Down

0 comments on commit da1081a

Please sign in to comment.