From 37d010b234d0cb4462a1ef3b2fe14893857541af Mon Sep 17 00:00:00 2001 From: Luca Barbato <lu_zero@gentoo.org> Date: Wed, 17 Oct 2018 15:45:09 +0200 Subject: [PATCH] Unbreak non-x86_64 The rust compiler DCE works in a different way so conditionals on `cfg!` should not be used if the code in the branches may not compile. While at it move the `use` statements where they are needed to avoid warnings. Fix #657 --- build.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.rs b/build.rs index 4a93a199..2928f3ac 100644 --- a/build.rs +++ b/build.rs @@ -11,12 +11,12 @@ extern crate nasm_rs; use std::env; use std::fs; -use std::fs::File; -use std::io::Write; use std::path::Path; fn main() { - if cfg!(target_arch = "x86_64") { + #[cfg(target_arch = "x86_64")] { + use std::fs::File; + use std::io::Write; let out_dir = env::var("OUT_DIR").unwrap(); { let dest_path = Path::new(&out_dir).join("config.asm"); -- GitLab