mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
Rollup merge of #87530 - bstrie:commentsync, r=bstrie
Add comments regarding superfluous `!Sync` impls
This commit is contained in:
commit
d638c1d13c
@ -313,6 +313,12 @@ pub struct Rc<T: ?Sized> {
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: ?Sized> !marker::Send for Rc<T> {}
|
||||
|
||||
// Note that this negative impl isn't strictly necessary for correctness,
|
||||
// as `Rc` transitively contains a `Cell`, which is itself `!Sync`.
|
||||
// However, given how important `Rc`'s `!Sync`-ness is,
|
||||
// having an explicit negative impl is nice for documentation purposes
|
||||
// and results in nicer error messages.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: ?Sized> !marker::Sync for Rc<T> {}
|
||||
|
||||
|
@ -240,6 +240,11 @@ pub struct Cell<T: ?Sized> {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
unsafe impl<T: ?Sized> Send for Cell<T> where T: Send {}
|
||||
|
||||
// Note that this negative impl isn't strictly necessary for correctness,
|
||||
// as `Cell` wraps `UnsafeCell`, which is itself `!Sync`.
|
||||
// However, given how important `Cell`'s `!Sync`-ness is,
|
||||
// having an explicit negative impl is nice for documentation purposes
|
||||
// and results in nicer error messages.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: ?Sized> !Sync for Cell<T> {}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user