Skip to content

Commit 547d004

Browse files
committed
---
yaml --- r: 109191 b: refs/heads/dist-snap c: 8767c69 h: refs/heads/master i: 109189: fe3370d 109187: ff0f389 109183: 997990b v: v3
1 parent 2fdfaaf commit 547d004

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 3848021faedff3b99ad03fca320a1388e71e5039
9+
refs/heads/dist-snap: 8767c693390c0ad53ce96bf1d00548e1205be01b
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libstd/sync/arc.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use ops::Drop;
2828
use ptr::RawPtr;
2929
use sync::atomics::{fence, AtomicUint, Relaxed, Acquire, Release};
3030
use slice;
31+
use ty::Unsafe;
3132

3233
/// An atomically reference counted pointer.
3334
///
@@ -39,11 +40,14 @@ pub struct UnsafeArc<T> {
3940

4041
struct ArcData<T> {
4142
count: AtomicUint,
42-
data: T,
43+
data: Unsafe<T>,
4344
}
4445

4546
unsafe fn new_inner<T: Send>(data: T, refcount: uint) -> *mut ArcData<T> {
46-
let data = ~ArcData { count: AtomicUint::new(refcount), data: data };
47+
let data = ~ArcData {
48+
count: AtomicUint::new(refcount),
49+
data: Unsafe::new(data)
50+
};
4751
cast::transmute(data)
4852
}
4953

@@ -82,7 +86,7 @@ impl<T: Send> UnsafeArc<T> {
8286
unsafe {
8387
// FIXME(#12049): this needs some sort of debug assertion
8488
if cfg!(test) { assert!((*self.data).count.load(Relaxed) > 0); }
85-
return &mut (*self.data).data as *mut T;
89+
return (*self.data).data.get();
8690
}
8791
}
8892

@@ -93,7 +97,7 @@ impl<T: Send> UnsafeArc<T> {
9397
unsafe {
9498
// FIXME(#12049): this needs some sort of debug assertion
9599
if cfg!(test) { assert!((*self.data).count.load(Relaxed) > 0); }
96-
return &(*self.data).data as *T;
100+
return (*self.data).data.get() as *T;
97101
}
98102
}
99103

branches/dist-snap/src/libstd/ty.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ pub struct Unsafe<T> {
6565
marker1: marker::InvariantType<T>
6666
}
6767

68-
6968
impl<T> Unsafe<T> {
7069

7170
/// Static constructor

0 commit comments

Comments
 (0)