sync: clarify the cancellation safety of oneshot::Receiver (#7780)

Signed-off-by: ADD-SP <[email protected]>
Co-authored-by: Alice Ryhl <[email protected]>
This commit is contained in:
Qi
2025-12-18 19:21:59 +08:00
committed by GitHub
co-authored by Alice Ryhl
parent 231a3a69f9
commit 009a2567d0
+7
View File
@@ -243,6 +243,13 @@ pub struct Sender<T> {
///
/// [`Future`]: trait@std::future::Future
///
/// # Cancellation safety
///
/// The `Receiver` is cancel safe. If it is used as the event in a
/// [`tokio::select!`](crate::select) statement and some other branch
/// completes first, it is guaranteed that no message was received on this
/// channel.
///
/// # Examples
///
/// ```