158
158
use clone:: Clone ;
159
159
use cmp:: PartialEq ;
160
160
use default:: Default ;
161
- use kinds:: { marker , Copy } ;
161
+ use kinds:: { Copy , Send } ;
162
162
use ops:: { Deref , DerefMut , Drop } ;
163
163
use option:: Option ;
164
164
use option:: Option :: { None , Some } ;
@@ -167,7 +167,6 @@ use option::Option::{None, Some};
167
167
#[ stable]
168
168
pub struct Cell < T > {
169
169
value : UnsafeCell < T > ,
170
- noshare : marker:: NoSync ,
171
170
}
172
171
173
172
impl < T : Copy > Cell < T > {
@@ -176,7 +175,6 @@ impl<T:Copy> Cell<T> {
176
175
pub fn new ( value : T ) -> Cell < T > {
177
176
Cell {
178
177
value : UnsafeCell :: new ( value) ,
179
- noshare : marker:: NoSync ,
180
178
}
181
179
}
182
180
@@ -208,6 +206,9 @@ impl<T:Copy> Cell<T> {
208
206
}
209
207
}
210
208
209
+ #[ stable]
210
+ unsafe impl < T > Send for Cell < T > where T : Send { }
211
+
211
212
#[ stable]
212
213
impl < T : Copy > Clone for Cell < T > {
213
214
fn clone ( & self ) -> Cell < T > {
@@ -235,7 +236,6 @@ impl<T:PartialEq + Copy> PartialEq for Cell<T> {
235
236
pub struct RefCell < T > {
236
237
value : UnsafeCell < T > ,
237
238
borrow : Cell < BorrowFlag > ,
238
- noshare : marker:: NoSync ,
239
239
}
240
240
241
241
// Values [1, MAX-1] represent the number of `Ref` active
@@ -251,7 +251,6 @@ impl<T> RefCell<T> {
251
251
RefCell {
252
252
value : UnsafeCell :: new ( value) ,
253
253
borrow : Cell :: new ( UNUSED ) ,
254
- noshare : marker:: NoSync ,
255
254
}
256
255
}
257
256
@@ -341,6 +340,9 @@ impl<T> RefCell<T> {
341
340
}
342
341
}
343
342
343
+ #[ stable]
344
+ unsafe impl < T > Send for RefCell < T > where T : Send { }
345
+
344
346
#[ stable]
345
347
impl < T : Clone > Clone for RefCell < T > {
346
348
fn clone ( & self ) -> RefCell < T > {
0 commit comments