diff --git a/src/docker/local.rs b/src/docker/local.rs index f7d0507d7..bd6f9ca30 100644 --- a/src/docker/local.rs +++ b/src/docker/local.rs @@ -165,7 +165,7 @@ pub(crate) fn run( // terminate or it may be a known interrupt return status (130, 137, 143). // simpler: just test if the program termination handler was called. // SAFETY: an atomic load. - let is_terminated = unsafe { crate::errors::TERMINATED.load(Ordering::SeqCst) }; + let is_terminated = crate::errors::TERMINATED.load(Ordering::SeqCst); if !is_terminated { ChildContainer::exit_static(); } diff --git a/src/docker/shared.rs b/src/docker/shared.rs index 005f53cb4..1045bd3ba 100644 --- a/src/docker/shared.rs +++ b/src/docker/shared.rs @@ -1,3 +1,5 @@ +#![allow(static_mut_refs)] // FIXME: Use correct types for CHILD_CONTAINER + use super::custom::{Dockerfile, PreBuild}; use super::image::PossibleImage; use super::Image; diff --git a/src/errors.rs b/src/errors.rs index bcb4d3595..0dad33bbb 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -7,7 +7,7 @@ pub use color_eyre::Section; pub use eyre::Context; pub use eyre::Result; -pub static mut TERMINATED: AtomicBool = AtomicBool::new(false); +pub static TERMINATED: AtomicBool = AtomicBool::new(false); pub fn install_panic_hook() -> Result<()> { let is_dev = !crate::commit_info().is_empty() || std::env::var("CROSS_DEBUG").is_ok(); @@ -102,6 +102,7 @@ unsafe fn termination_handler() { // however, we'd need to store the engine path and the argument list as // a global CString and `Vec`, respectively. this atomic guard // makes this safe regardless. + #[allow(static_mut_refs)] // FIXME: Use correct types for CHILD_CONTAINER docker::CHILD_CONTAINER.terminate(); // all termination exit codes are 128 + signal code. the exit code is diff --git a/src/temp.rs b/src/temp.rs index f9a180d2d..39ea74d1a 100644 --- a/src/temp.rs +++ b/src/temp.rs @@ -1,3 +1,5 @@ +#![allow(static_mut_refs)] // FIXME: use appropriate std types for `FILES` and `DIRS`. + use std::fs; use std::path::{Path, PathBuf};