sync: add warning for watch in non-Send futures (#4741)

This commit is contained in:
Alice Ryhl 2022-06-28 23:01:35 +02:00 committed by GitHub
parent b51aa8f6f9
commit 45f24f1b86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,7 +91,9 @@ pub struct Sender<T> {
///
/// Outstanding borrows hold a read lock on the inner value. This means that
/// long lived borrows could cause the produce half to block. It is recommended
/// to keep the borrow as short lived as possible.
/// to keep the borrow as short lived as possible. Additionally, if you are
/// running in an environment that allows `!Send` futures, you must ensure that
/// the returned `Ref` type is never held alive across an `.await` point.
///
/// The priority policy of the lock is dependent on the underlying lock
/// implementation, and this type does not guarantee that any particular policy
@ -301,7 +303,9 @@ impl<T> Receiver<T> {
///
/// Outstanding borrows hold a read lock. This means that long lived borrows
/// could cause the send half to block. It is recommended to keep the borrow
/// as short lived as possible.
/// as short lived as possible. Additionally, if you are running in an
/// environment that allows `!Send` futures, you must ensure that the
/// returned `Ref` type is never held alive across an `.await` point.
///
/// The priority policy of the lock is dependent on the underlying lock
/// implementation, and this type does not guarantee that any particular policy
@ -344,7 +348,9 @@ impl<T> Receiver<T> {
///
/// Outstanding borrows hold a read lock. This means that long lived borrows
/// could cause the send half to block. It is recommended to keep the borrow
/// as short lived as possible.
/// as short lived as possible. Additionally, if you are running in an
/// environment that allows `!Send` futures, you must ensure that the
/// returned `Ref` type is never held alive across an `.await` point.
///
/// The priority policy of the lock is dependent on the underlying lock
/// implementation, and this type does not guarantee that any particular policy