Skip to content

Commit 537e106

Browse files
committed
---
yaml --- r: 106110 b: refs/heads/auto c: 8767c69 h: refs/heads/master v: v3
1 parent 3161176 commit 537e106

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
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 3848021faedff3b99ad03fca320a1388e71e5039
16+
refs/heads/auto: 8767c693390c0ad53ce96bf1d00548e1205be01b
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/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/auto/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)