1515
1616use core:: atomic;
1717use core:: clone:: Clone ;
18- use core:: kinds:: { Share , Send } ;
18+ use core:: kinds:: { Sync , Send } ;
1919use core:: mem:: { min_align_of, size_of, drop} ;
2020use core:: mem;
2121use core:: ops:: { Drop , Deref } ;
@@ -76,7 +76,7 @@ struct ArcInner<T> {
7676 data : T ,
7777}
7878
79- impl < T : Share + Send > Arc < T > {
79+ impl < T : Sync + Send > Arc < T > {
8080 /// Create an atomically reference counted wrapper.
8181 #[ inline]
8282 #[ stable]
@@ -95,8 +95,8 @@ impl<T: Share + Send> Arc<T> {
9595 fn inner ( & self ) -> & ArcInner < T > {
9696 // This unsafety is ok because while this arc is alive we're guaranteed
9797 // 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
100100 // these contents.
101101 unsafe { & * self . _ptr }
102102 }
@@ -115,7 +115,7 @@ impl<T: Share + Send> Arc<T> {
115115}
116116
117117#[ unstable = "waiting on stability of Clone" ]
118- impl < T : Share + Send > Clone for Arc < T > {
118+ impl < T : Sync + Send > Clone for Arc < T > {
119119 /// Duplicate an atomically reference counted wrapper.
120120 ///
121121 /// The resulting two `Arc` objects will point to the same underlying data
@@ -140,14 +140,14 @@ impl<T: Share + Send> Clone for Arc<T> {
140140}
141141
142142#[ experimental = "Deref is experimental." ]
143- impl < T : Send + Share > Deref < T > for Arc < T > {
143+ impl < T : Send + Sync > Deref < T > for Arc < T > {
144144 #[ inline]
145145 fn deref ( & self ) -> & T {
146146 & self . inner ( ) . data
147147 }
148148}
149149
150- impl < T : Send + Share + Clone > Arc < T > {
150+ impl < T : Send + Sync + Clone > Arc < T > {
151151 /// Acquires a mutable pointer to the inner contents by guaranteeing that
152152 /// the reference count is one (no sharing is possible).
153153 ///
@@ -175,7 +175,7 @@ impl<T: Send + Share + Clone> Arc<T> {
175175
176176#[ unsafe_destructor]
177177#[ experimental = "waiting on stability of Drop" ]
178- impl < T : Share + Send > Drop for Arc < T > {
178+ impl < T : Sync + Send > Drop for Arc < T > {
179179 fn drop ( & mut self ) {
180180 // This structure has #[unsafe_no_drop_flag], so this drop glue may run
181181 // 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> {
219219}
220220
221221#[ experimental = "Weak pointers may not belong in this module." ]
222- impl < T : Share + Send > Weak < T > {
222+ impl < T : Sync + Send > Weak < T > {
223223 /// Attempts to upgrade this weak reference to a strong reference.
224224 ///
225225 /// This method will fail to upgrade this reference if the strong reference
@@ -245,7 +245,7 @@ impl<T: Share + Send> Weak<T> {
245245}
246246
247247#[ 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 > {
249249 #[ inline]
250250 fn clone ( & self ) -> Weak < T > {
251251 // See comments in Arc::clone() for why this is relaxed
@@ -256,7 +256,7 @@ impl<T: Share + Send> Clone for Weak<T> {
256256
257257#[ unsafe_destructor]
258258#[ 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 > {
260260 fn drop ( & mut self ) {
261261 // see comments above for why this check is here
262262 if self . _ptr . is_null ( ) { return }
0 commit comments