Skip to content

Commit e86afe2

Browse files
committed
Auto merge of #6600 - ehuss:atomic-deprecated, r=dwijnand
Remove deprecated ATOMIC initializers. Required for rust-lang/rust#57765. cc @Mark-Simulacrum
2 parents 1b716f6 + 490b1ce commit e86afe2

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/cargo/core/source/source_id.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::hash::{self, Hash};
55
use std::path::Path;
66
use std::ptr;
77
use std::sync::atomic::Ordering::SeqCst;
8-
use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT};
8+
use std::sync::atomic::AtomicBool;
99
use std::sync::Mutex;
1010

1111
use log::trace;
@@ -193,7 +193,7 @@ impl SourceId {
193193
config.crates_io_source_id(|| {
194194
let cfg = ops::registry_configuration(config, None)?;
195195
let url = if let Some(ref index) = cfg.index {
196-
static WARNED: AtomicBool = ATOMIC_BOOL_INIT;
196+
static WARNED: AtomicBool = AtomicBool::new(false);
197197
if !WARNED.swap(true, SeqCst) {
198198
config.shell().warn(
199199
"custom registry support via \

tests/testsuite/support/cross_compile.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::env;
22
use std::process::Command;
3-
use std::sync::atomic::{AtomicBool, Ordering, ATOMIC_BOOL_INIT};
3+
use std::sync::atomic::{AtomicBool, Ordering};
44
use std::sync::{Once, ONCE_INIT};
55

66
use crate::support::{basic_bin_manifest, main_file, project};
@@ -22,7 +22,7 @@ pub fn disabled() -> bool {
2222
// It's not particularly common to have a cross-compilation setup, so
2323
// try to detect that before we fail a bunch of tests through no fault
2424
// of the user.
25-
static CAN_RUN_CROSS_TESTS: AtomicBool = ATOMIC_BOOL_INIT;
25+
static CAN_RUN_CROSS_TESTS: AtomicBool = AtomicBool::new(false);
2626
static CHECK: Once = ONCE_INIT;
2727

2828
let cross_target = alternate();
@@ -56,7 +56,7 @@ pub fn disabled() -> bool {
5656
// pass. We don't use std::sync::Once here because panicing inside its
5757
// call_once method would poison the Once instance, which is not what
5858
// we want.
59-
static HAVE_WARNED: AtomicBool = ATOMIC_BOOL_INIT;
59+
static HAVE_WARNED: AtomicBool = AtomicBool::new(false);
6060

6161
if HAVE_WARNED.swap(true, Ordering::SeqCst) {
6262
// We are some other test and somebody else is handling the warning.

tests/testsuite/support/paths.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ use std::env;
33
use std::fs;
44
use std::io::{self, ErrorKind};
55
use std::path::{Path, PathBuf};
6-
use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
6+
use std::sync::atomic::{AtomicUsize, Ordering};
77
use std::sync::{Once, ONCE_INIT};
88

99
use filetime::{self, FileTime};
1010

1111
static CARGO_INTEGRATION_TEST_DIR: &'static str = "cit";
12-
static NEXT_ID: AtomicUsize = ATOMIC_USIZE_INIT;
12+
static NEXT_ID: AtomicUsize = AtomicUsize::new(0);
1313

1414
thread_local!(static TASK_ID: usize = NEXT_ID.fetch_add(1, Ordering::SeqCst));
1515

0 commit comments

Comments
 (0)