From ad7830d8b79ea397cba73297a59d3eedf3a7491c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Rouill=C3=A9?= Date: Wed, 17 Jul 2019 18:45:24 +0200 Subject: [PATCH] add must_use attributes on Future and Stream --- src/future/mod.rs | 1 + src/stream/mod.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/future/mod.rs b/src/future/mod.rs index 063322e29d..9867765902 100644 --- a/src/future/mod.rs +++ b/src/future/mod.rs @@ -174,6 +174,7 @@ use {Poll, stream}; /// More information about combinators can be found [on tokio.rs]. /// /// [on tokio.rs]: https://tokio.rs/docs/going-deeper-futures/futures-mechanics/ +#[must_use = "futures do nothing unless polled"] pub trait Future { /// The type of value that this future will resolved with if it is /// successful. diff --git a/src/stream/mod.rs b/src/stream/mod.rs index b674aefdcd..2d90362470 100644 --- a/src/stream/mod.rs +++ b/src/stream/mod.rs @@ -180,6 +180,7 @@ if_std! { /// please feel welcome to comment on [the issue][being considered]! /// /// [being considered]: https://github.com/rust-lang-nursery/futures-rs/issues/206 +#[must_use = "streams do nothing unless polled"] pub trait Stream { /// The type of item this stream will yield on success. type Item;