File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -313,6 +313,12 @@ pub struct Rc<T: ?Sized> {
313
313
314
314
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
315
315
impl < T : ?Sized > !marker:: Send for Rc < T > { }
316
+
317
+ // Note that this negative impl isn't strictly necessary for correctness,
318
+ // as `Rc` transitively contains a `Cell`, which is itself `!Sync`.
319
+ // However, given how important `Rc`'s `!Sync`-ness is,
320
+ // having an explicit negative impl is nice for documentation purposes
321
+ // and results in nicer error messages.
316
322
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
317
323
impl < T : ?Sized > !marker:: Sync for Rc < T > { }
318
324
Original file line number Diff line number Diff line change @@ -240,6 +240,11 @@ pub struct Cell<T: ?Sized> {
240
240
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
241
241
unsafe impl < T : ?Sized > Send for Cell < T > where T : Send { }
242
242
243
+ // Note that this negative impl isn't strictly necessary for correctness,
244
+ // as `Cell` wraps `UnsafeCell`, which is itself `!Sync`.
245
+ // However, given how important `Cell`'s `!Sync`-ness is,
246
+ // having an explicit negative impl is nice for documentation purposes
247
+ // and results in nicer error messages.
243
248
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
244
249
impl < T : ?Sized > !Sync for Cell < T > { }
245
250
You can’t perform that action at this time.
0 commit comments