@@ -54,6 +54,9 @@ use std::kinds::marker;
5454use std:: sync:: arc:: UnsafeArc ;
5555use std:: task;
5656
57+ #[ cfg( stage0) ]
58+ use std:: kinds:: Share ;
59+
5760/// As sync::condvar, a mechanism for unlock-and-descheduling and
5861/// signaling, for use with the Arc types.
5962pub struct ArcCondvar < ' a > {
@@ -122,7 +125,7 @@ pub struct Arc<T> { priv x: UnsafeArc<T> }
122125 * Access the underlying data in an atomically reference counted
123126 * wrapper.
124127 */
125- impl < T : Freeze + Send > Arc < T > {
128+ impl < T : Share + Send > Arc < T > {
126129 /// Create an atomically reference counted wrapper.
127130 #[ inline]
128131 pub fn new ( data : T ) -> Arc < T > {
@@ -135,7 +138,7 @@ impl<T:Freeze+Send> Arc<T> {
135138 }
136139}
137140
138- impl < T : Freeze + Send > Clone for Arc < T > {
141+ impl < T : Share + Send > Clone for Arc < T > {
139142 /**
140143 * Duplicate an atomically reference counted wrapper.
141144 *
@@ -295,19 +298,21 @@ struct RWArcInner<T> { lock: RWLock, failed: bool, data: T }
295298pub struct RWArc < T > {
296299 priv x: UnsafeArc < RWArcInner < T > > ,
297300 priv marker : marker:: NoFreeze ,
301+ priv marker1 : marker:: NoShare ,
298302}
299303
300- impl < T : Freeze + Send > Clone for RWArc < T > {
304+ impl < T : Share + Send > Clone for RWArc < T > {
301305 /// Duplicate a rwlock-protected Arc. See arc::clone for more details.
302306 #[ inline]
303307 fn clone ( & self ) -> RWArc < T > {
304308 RWArc { x : self . x . clone ( ) ,
305- marker : marker:: NoFreeze , }
309+ marker : marker:: NoFreeze ,
310+ marker1 : marker:: NoShare , }
306311 }
307312
308313}
309314
310- impl < T : Freeze + Send > RWArc < T > {
315+ impl < T : Share + Send > RWArc < T > {
311316 /// Create a reader/writer Arc with the supplied data.
312317 pub fn new ( user_data : T ) -> RWArc < T > {
313318 RWArc :: new_with_condvars ( user_data, 1 )
@@ -323,7 +328,8 @@ impl<T:Freeze + Send> RWArc<T> {
323328 failed : false , data : user_data
324329 } ;
325330 RWArc { x : UnsafeArc :: new ( data) ,
326- marker : marker:: NoFreeze , }
331+ marker : marker:: NoFreeze ,
332+ marker1 : marker:: NoShare , }
327333 }
328334
329335 /**
@@ -454,7 +460,7 @@ impl<T:Freeze + Send> RWArc<T> {
454460// lock it. This wraps the unsafety, with the justification that the 'lock'
455461// field is never overwritten; only 'failed' and 'data'.
456462#[ doc( hidden) ]
457- fn borrow_rwlock < T : Freeze + Send > ( state : * mut RWArcInner < T > ) -> * RWLock {
463+ fn borrow_rwlock < T : Share + Send > ( state : * mut RWArcInner < T > ) -> * RWLock {
458464 unsafe { cast:: transmute ( & ( * state) . lock ) }
459465}
460466
@@ -471,7 +477,7 @@ pub struct RWReadMode<'a, T> {
471477 priv token : sync:: RWLockReadMode < ' a > ,
472478}
473479
474- impl < ' a , T : Freeze + Send > RWWriteMode < ' a , T > {
480+ impl < ' a , T : Share + Send > RWWriteMode < ' a , T > {
475481 /// Access the pre-downgrade RWArc in write mode.
476482 pub fn write < U > ( & mut self , blk: |x: & mut T | -> U ) -> U {
477483 match * self {
@@ -510,7 +516,7 @@ impl<'a, T:Freeze + Send> RWWriteMode<'a, T> {
510516 }
511517}
512518
513- impl < ' a , T : Freeze + Send > RWReadMode < ' a , T > {
519+ impl < ' a , T : Share + Send > RWReadMode < ' a , T > {
514520 /// Access the post-downgrade rwlock in read mode.
515521 pub fn read < U > ( & self , blk: |x: & T | -> U ) -> U {
516522 match * self {
@@ -534,7 +540,7 @@ pub struct CowArc<T> { priv x: UnsafeArc<T> }
534540/// mutation of the contents if there is only a single reference to
535541/// the data. If there are multiple references the data is automatically
536542/// cloned and the task modifies the cloned data in place of the shared data.
537- impl < T : Clone + Send + Freeze > CowArc < T > {
543+ impl < T : Clone + Send + Share > CowArc < T > {
538544 /// Create a copy-on-write atomically reference counted wrapper
539545 #[ inline]
540546 pub fn new ( data : T ) -> CowArc < T > {
@@ -558,7 +564,7 @@ impl<T:Clone+Send+Freeze> CowArc<T> {
558564 }
559565}
560566
561- impl < T : Clone + Send + Freeze > Clone for CowArc < T > {
567+ impl < T : Clone + Send + Share > Clone for CowArc < T > {
562568 /// Duplicate a Copy-on-write Arc. See arc::clone for more details.
563569 fn clone ( & self ) -> CowArc < T > {
564570 CowArc { x : self . x . clone ( ) }
0 commit comments