about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2019-01-26 09:14:49 -0700
committerMark Rousskov <mark.simulacrum@gmail.com>2019-01-26 15:27:38 -0700
commit7a58c6d1deec25c37c93ae4cf9ec2432918bc360 (patch)
tree9f3c97f64498d562b514adeae98bedd1fe3f95a3 /src/liballoc
parentabe36c4741e780ba3ed3e9b48d823ac8007f786a (diff)
downloadrust-7a58c6d1deec25c37c93ae4cf9ec2432918bc360.tar.gz
rust-7a58c6d1deec25c37c93ae4cf9ec2432918bc360.zip
Replace deprecated ATOMIC_INIT consts
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/tests/binary_heap.rs4
-rw-r--r--src/liballoc/tests/slice.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/liballoc/tests/binary_heap.rs b/src/liballoc/tests/binary_heap.rs
index 6af1cf40809..94ae43237d1 100644
--- a/src/liballoc/tests/binary_heap.rs
+++ b/src/liballoc/tests/binary_heap.rs
@@ -2,7 +2,7 @@ use std::cmp;
 use std::collections::BinaryHeap;
 use std::collections::binary_heap::{Drain, PeekMut};
 use std::panic::{self, AssertUnwindSafe};
-use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
+use std::sync::atomic::{AtomicUsize, Ordering};
 
 use rand::{thread_rng, seq::SliceRandom};
 
@@ -283,7 +283,7 @@ fn assert_covariance() {
 // Destructors must be called exactly once per element.
 #[test]
 fn panic_safe() {
-    static DROP_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;
+    static DROP_COUNTER: AtomicUsize = AtomicUsize::new(0);
 
     #[derive(Eq, PartialEq, Ord, Clone, Debug)]
     struct PanicOrd<T>(T, bool);
diff --git a/src/liballoc/tests/slice.rs b/src/liballoc/tests/slice.rs
index 8ecd17236c0..0300bd7f3f6 100644
--- a/src/liballoc/tests/slice.rs
+++ b/src/liballoc/tests/slice.rs
@@ -5,7 +5,7 @@ use std::mem;
 use std::panic;
 use std::rc::Rc;
 use std::sync::atomic::Ordering::Relaxed;
-use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize};
+use std::sync::atomic::AtomicUsize;
 use std::thread;
 
 use rand::{Rng, RngCore, thread_rng, seq::SliceRandom};
@@ -1500,7 +1500,7 @@ static DROP_COUNTS: [AtomicUsize; MAX_LEN] = [
     AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0),
 ];
 
-static VERSIONS: AtomicUsize = ATOMIC_USIZE_INIT;
+static VERSIONS: AtomicUsize = AtomicUsize::new(0);
 
 #[derive(Clone, Eq)]
 struct DropCounter {