15
15
16
16
use core:: atomic;
17
17
use core:: clone:: Clone ;
18
- use core:: kinds:: { Share , Send } ;
18
+ use core:: kinds:: { Sync , Send } ;
19
19
use core:: mem:: { min_align_of, size_of, drop} ;
20
20
use core:: mem;
21
21
use core:: ops:: { Drop , Deref } ;
@@ -76,7 +76,7 @@ struct ArcInner<T> {
76
76
data : T ,
77
77
}
78
78
79
- impl < T : Share + Send > Arc < T > {
79
+ impl < T : Sync + Send > Arc < T > {
80
80
/// Create an atomically reference counted wrapper.
81
81
#[ inline]
82
82
#[ stable]
@@ -95,8 +95,8 @@ impl<T: Share + Send> Arc<T> {
95
95
fn inner ( & self ) -> & ArcInner < T > {
96
96
// This unsafety is ok because while this arc is alive we're guaranteed
97
97
// that the inner pointer is valid. Furthermore, we know that the
98
- // `ArcInner` structure itself is `Share ` because the inner data is
99
- // `Share ` as well, so we're ok loaning out an immutable pointer to
98
+ // `ArcInner` structure itself is `Sync ` because the inner data is
99
+ // `Sync ` as well, so we're ok loaning out an immutable pointer to
100
100
// these contents.
101
101
unsafe { & * self . _ptr }
102
102
}
@@ -115,7 +115,7 @@ impl<T: Share + Send> Arc<T> {
115
115
}
116
116
117
117
#[ unstable = "waiting on stability of Clone" ]
118
- impl < T : Share + Send > Clone for Arc < T > {
118
+ impl < T : Sync + Send > Clone for Arc < T > {
119
119
/// Duplicate an atomically reference counted wrapper.
120
120
///
121
121
/// The resulting two `Arc` objects will point to the same underlying data
@@ -140,14 +140,14 @@ impl<T: Share + Send> Clone for Arc<T> {
140
140
}
141
141
142
142
#[ experimental = "Deref is experimental." ]
143
- impl < T : Send + Share > Deref < T > for Arc < T > {
143
+ impl < T : Send + Sync > Deref < T > for Arc < T > {
144
144
#[ inline]
145
145
fn deref ( & self ) -> & T {
146
146
& self . inner ( ) . data
147
147
}
148
148
}
149
149
150
- impl < T : Send + Share + Clone > Arc < T > {
150
+ impl < T : Send + Sync + Clone > Arc < T > {
151
151
/// Acquires a mutable pointer to the inner contents by guaranteeing that
152
152
/// the reference count is one (no sharing is possible).
153
153
///
@@ -175,7 +175,7 @@ impl<T: Send + Share + Clone> Arc<T> {
175
175
176
176
#[ unsafe_destructor]
177
177
#[ experimental = "waiting on stability of Drop" ]
178
- impl < T : Share + Send > Drop for Arc < T > {
178
+ impl < T : Sync + Send > Drop for Arc < T > {
179
179
fn drop ( & mut self ) {
180
180
// This structure has #[unsafe_no_drop_flag], so this drop glue may run
181
181
// more than once (but it is guaranteed to be zeroed after the first if
@@ -219,7 +219,7 @@ impl<T: Share + Send> Drop for Arc<T> {
219
219
}
220
220
221
221
#[ experimental = "Weak pointers may not belong in this module." ]
222
- impl < T : Share + Send > Weak < T > {
222
+ impl < T : Sync + Send > Weak < T > {
223
223
/// Attempts to upgrade this weak reference to a strong reference.
224
224
///
225
225
/// This method will fail to upgrade this reference if the strong reference
@@ -245,7 +245,7 @@ impl<T: Share + Send> Weak<T> {
245
245
}
246
246
247
247
#[ experimental = "Weak pointers may not belong in this module." ]
248
- impl < T : Share + Send > Clone for Weak < T > {
248
+ impl < T : Sync + Send > Clone for Weak < T > {
249
249
#[ inline]
250
250
fn clone ( & self ) -> Weak < T > {
251
251
// See comments in Arc::clone() for why this is relaxed
@@ -256,7 +256,7 @@ impl<T: Share + Send> Clone for Weak<T> {
256
256
257
257
#[ unsafe_destructor]
258
258
#[ experimental = "Weak pointers may not belong in this module." ]
259
- impl < T : Share + Send > Drop for Weak < T > {
259
+ impl < T : Sync + Send > Drop for Weak < T > {
260
260
fn drop ( & mut self ) {
261
261
// see comments above for why this check is here
262
262
if self . _ptr . is_null ( ) { return }
0 commit comments