Skip to content

Commit baf457e

Browse files
authored
Fix mutable static warnings (#1702)
2 parents d585c77 + e407b53 commit baf457e

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

src/docker/local.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ pub(crate) fn run(
165165
// terminate or it may be a known interrupt return status (130, 137, 143).
166166
// simpler: just test if the program termination handler was called.
167167
// SAFETY: an atomic load.
168-
let is_terminated = unsafe { crate::errors::TERMINATED.load(Ordering::SeqCst) };
168+
let is_terminated = crate::errors::TERMINATED.load(Ordering::SeqCst);
169169
if !is_terminated {
170170
ChildContainer::exit_static();
171171
}

src/docker/shared.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(static_mut_refs)] // FIXME: Use correct types for CHILD_CONTAINER
2+
13
use super::custom::{Dockerfile, PreBuild};
24
use super::image::PossibleImage;
35
use super::Image;

src/errors.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub use color_eyre::Section;
77
pub use eyre::Context;
88
pub use eyre::Result;
99

10-
pub static mut TERMINATED: AtomicBool = AtomicBool::new(false);
10+
pub static TERMINATED: AtomicBool = AtomicBool::new(false);
1111

1212
pub fn install_panic_hook() -> Result<()> {
1313
let is_dev = !crate::commit_info().is_empty() || std::env::var("CROSS_DEBUG").is_ok();
@@ -102,6 +102,7 @@ unsafe fn termination_handler() {
102102
// however, we'd need to store the engine path and the argument list as
103103
// a global CString and `Vec<CString>`, respectively. this atomic guard
104104
// makes this safe regardless.
105+
#[allow(static_mut_refs)] // FIXME: Use correct types for CHILD_CONTAINER
105106
docker::CHILD_CONTAINER.terminate();
106107

107108
// all termination exit codes are 128 + signal code. the exit code is

src/temp.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(static_mut_refs)] // FIXME: use appropriate std types for `FILES` and `DIRS`.
2+
13
use std::fs;
24
use std::path::{Path, PathBuf};
35

0 commit comments

Comments
 (0)