Skip to content

Commit 3d0d9bb

Browse files
committed
auto merge of #20896 : sfackler/rust/atomic-rename, r=alexcrichton
Change any use of AtomicInt to AtomicIsize and AtomicUint to AtomicUsize Closes #20893 [breaking-change]
2 parents 3a44a19 + 8b6cda3 commit 3d0d9bb

24 files changed

+360
-227
lines changed

src/liballoc/arc.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ unsafe impl<T: Sync + Send> Send for Weak<T> { }
137137
unsafe impl<T: Sync + Send> Sync for Weak<T> { }
138138

139139
struct ArcInner<T> {
140-
strong: atomic::AtomicUint,
141-
weak: atomic::AtomicUint,
140+
strong: atomic::AtomicUsize,
141+
weak: atomic::AtomicUsize,
142142
data: T,
143143
}
144144

@@ -161,8 +161,8 @@ impl<T> Arc<T> {
161161
// Start the weak pointer count as 1 which is the weak pointer that's
162162
// held by all the strong pointers (kinda), see std/rc.rs for more info
163163
let x = box ArcInner {
164-
strong: atomic::AtomicUint::new(1),
165-
weak: atomic::AtomicUint::new(1),
164+
strong: atomic::AtomicUsize::new(1),
165+
weak: atomic::AtomicUsize::new(1),
166166
data: data,
167167
};
168168
Arc { _ptr: unsafe { NonZero::new(mem::transmute(x)) } }
@@ -619,7 +619,7 @@ mod tests {
619619
use super::{Arc, Weak, weak_count, strong_count};
620620
use std::sync::Mutex;
621621

622-
struct Canary(*mut atomic::AtomicUint);
622+
struct Canary(*mut atomic::AtomicUsize);
623623

624624
impl Drop for Canary
625625
{
@@ -743,16 +743,16 @@ mod tests {
743743

744744
#[test]
745745
fn drop_arc() {
746-
let mut canary = atomic::AtomicUint::new(0);
747-
let x = Arc::new(Canary(&mut canary as *mut atomic::AtomicUint));
746+
let mut canary = atomic::AtomicUsize::new(0);
747+
let x = Arc::new(Canary(&mut canary as *mut atomic::AtomicUsize));
748748
drop(x);
749749
assert!(canary.load(Acquire) == 1);
750750
}
751751

752752
#[test]
753753
fn drop_arc_weak() {
754-
let mut canary = atomic::AtomicUint::new(0);
755-
let arc = Arc::new(Canary(&mut canary as *mut atomic::AtomicUint));
754+
let mut canary = atomic::AtomicUsize::new(0);
755+
let arc = Arc::new(Canary(&mut canary as *mut atomic::AtomicUsize));
756756
let arc_weak = arc.downgrade();
757757
assert!(canary.load(Acquire) == 0);
758758
drop(arc);

src/libcollections/vec.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2199,7 +2199,7 @@ mod tests {
21992199

22002200
#[test]
22012201
fn test_map_in_place_zero_drop_count() {
2202-
use std::sync::atomic::{AtomicUint, Ordering, ATOMIC_UINT_INIT};
2202+
use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
22032203

22042204
#[derive(Clone, PartialEq, Show)]
22052205
struct Nothing;
@@ -2213,7 +2213,7 @@ mod tests {
22132213
}
22142214
}
22152215
const NUM_ELEMENTS: uint = 2;
2216-
static DROP_COUNTER: AtomicUint = ATOMIC_UINT_INIT;
2216+
static DROP_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;
22172217

22182218
let v = repeat(Nothing).take(NUM_ELEMENTS).collect::<Vec<_>>();
22192219

0 commit comments

Comments
 (0)