Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated ATOMIC initializers. #6600

Merged
merged 1 commit into from
Jan 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cargo/core/source/source_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::hash::{self, Hash};
use std::path::Path;
use std::ptr;
use std::sync::atomic::Ordering::SeqCst;
use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT};
use std::sync::atomic::AtomicBool;
use std::sync::Mutex;

use log::trace;
Expand Down Expand Up @@ -193,7 +193,7 @@ impl SourceId {
config.crates_io_source_id(|| {
let cfg = ops::registry_configuration(config, None)?;
let url = if let Some(ref index) = cfg.index {
static WARNED: AtomicBool = ATOMIC_BOOL_INIT;
static WARNED: AtomicBool = AtomicBool::new(false);
if !WARNED.swap(true, SeqCst) {
config.shell().warn(
"custom registry support via \
Expand Down
6 changes: 3 additions & 3 deletions tests/testsuite/support/cross_compile.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::env;
use std::process::Command;
use std::sync::atomic::{AtomicBool, Ordering, ATOMIC_BOOL_INIT};
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Once, ONCE_INIT};

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

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

if HAVE_WARNED.swap(true, Ordering::SeqCst) {
// We are some other test and somebody else is handling the warning.
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/support/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ use std::env;
use std::fs;
use std::io::{self, ErrorKind};
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Once, ONCE_INIT};

use filetime::{self, FileTime};

static CARGO_INTEGRATION_TEST_DIR: &'static str = "cit";
static NEXT_ID: AtomicUsize = ATOMIC_USIZE_INIT;
static NEXT_ID: AtomicUsize = AtomicUsize::new(0);

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

Expand Down