diff --git a/tokio/src/sync/mpsc/bounded.rs b/tokio/src/sync/mpsc/bounded.rs index a1e0a82d9..3cdba3dc2 100644 --- a/tokio/src/sync/mpsc/bounded.rs +++ b/tokio/src/sync/mpsc/bounded.rs @@ -1367,6 +1367,7 @@ impl Sender { /// towards RAII semantics, i.e. if all `Sender` instances of the /// channel were dropped and only `WeakSender` instances remain, /// the channel is closed. + #[must_use = "Downgrade creates a WeakSender without destroying the original non-weak sender."] pub fn downgrade(&self) -> WeakSender { WeakSender { chan: self.chan.downgrade(), diff --git a/tokio/src/sync/mpsc/unbounded.rs b/tokio/src/sync/mpsc/unbounded.rs index 7dff942ee..b87b07ba6 100644 --- a/tokio/src/sync/mpsc/unbounded.rs +++ b/tokio/src/sync/mpsc/unbounded.rs @@ -572,6 +572,7 @@ impl UnboundedSender { /// towards RAII semantics, i.e. if all `UnboundedSender` instances of the /// channel were dropped and only `WeakUnboundedSender` instances remain, /// the channel is closed. + #[must_use = "Downgrade creates a WeakSender without destroying the original non-weak sender."] pub fn downgrade(&self) -> WeakUnboundedSender { WeakUnboundedSender { chan: self.chan.downgrade(),