File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 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> {
313313
314314#[ stable( feature = "rust1" , since = "1.0.0" ) ]
315315impl < 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.
316322#[ stable( feature = "rust1" , since = "1.0.0" ) ]
317323impl < T : ?Sized > !marker:: Sync for Rc < T > { }
318324
Original file line number Diff line number Diff line change @@ -240,6 +240,11 @@ pub struct Cell<T: ?Sized> {
240240#[ stable( feature = "rust1" , since = "1.0.0" ) ]
241241unsafe impl < T : ?Sized > Send for Cell < T > where T : Send { }
242242
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.
243248#[ stable( feature = "rust1" , since = "1.0.0" ) ]
244249impl < T : ?Sized > !Sync for Cell < T > { }
245250
You can’t perform that action at this time.
0 commit comments