Skip to content

Commit ded685d

Browse files
taiki-ecramertj
authored andcommitted
Update #[must_use] message of impl Future types
Refs: rust-lang/rust#60808
1 parent 5884327 commit ded685d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+69
-69
lines changed

futures-channel/src/oneshot.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::lock::Lock;
1414
/// A future for a value that will be provided by another asynchronous task.
1515
///
1616
/// This is created by the [`channel`] function.
17-
#[must_use = "futures do nothing unless polled"]
17+
#[must_use = "futures do nothing unless you `.await` or poll them"]
1818
#[derive(Debug)]
1919
pub struct Receiver<T> {
2020
inner: Arc<Inner<T>>,

futures-test/src/future/assert_unmoved.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::thread::panicking;
1010
/// [`FutureTestExt::assert_unmoved`](super::FutureTestExt::assert_unmoved)
1111
/// method.
1212
#[derive(Debug, Clone)]
13-
#[must_use = "futures do nothing unless polled"]
13+
#[must_use = "futures do nothing unless you `.await` or poll them"]
1414
pub struct AssertUnmoved<Fut> {
1515
future: Fut,
1616
this_ptr: *const AssertUnmoved<Fut>,

futures-test/src/future/pending_once.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use pin_utils::{unsafe_pinned, unsafe_unpinned};
1010
/// [`FutureTestExt::pending_once`](super::FutureTestExt::pending_once)
1111
/// method.
1212
#[derive(Debug, Clone)]
13-
#[must_use = "futures do nothing unless polled"]
13+
#[must_use = "futures do nothing unless you `.await` or poll them"]
1414
pub struct PendingOnce<Fut: Future> {
1515
future: Fut,
1616
polled_before: bool,

futures-util/src/compat/compat01as03.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub use io::{AsyncRead01CompatExt, AsyncWrite01CompatExt};
1717
/// Converts a futures 0.1 Future, Stream, AsyncRead, or AsyncWrite
1818
/// object to a futures 0.3-compatible version,
1919
#[derive(Debug)]
20-
#[must_use = "futures do nothing unless polled"]
20+
#[must_use = "futures do nothing unless you `.await` or poll them"]
2121
pub struct Compat01As03<T> {
2222
pub(crate) inner: Spawn01<T>,
2323
}

futures-util/src/compat/compat03as01.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use std::{
2929
/// [`Stream`](futures::stream::Stream) or
3030
/// [`Sink`](futures::sink::Sink).
3131
#[derive(Debug, Clone, Copy)]
32-
#[must_use = "futures do nothing unless polled"]
32+
#[must_use = "futures do nothing unless you `.await` or poll them"]
3333
pub struct Compat<T> {
3434
pub(crate) inner: T,
3535
}

futures-util/src/future/abortable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use alloc::sync::Arc;
88

99
/// A future which can be remotely short-circuited using an `AbortHandle`.
1010
#[derive(Debug, Clone)]
11-
#[must_use = "futures do nothing unless polled"]
11+
#[must_use = "futures do nothing unless you `.await` or poll them"]
1212
pub struct Abortable<Fut> {
1313
future: Fut,
1414
inner: Arc<AbortInner>,

futures-util/src/future/catch_unwind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::prelude::v1::*;
88

99
/// Future for the [`catch_unwind`](super::FutureExt::catch_unwind) method.
1010
#[derive(Debug)]
11-
#[must_use = "futures do nothing unless polled"]
11+
#[must_use = "futures do nothing unless you `.await` or poll them"]
1212
pub struct CatchUnwind<Fut> where Fut: Future {
1313
future: Fut,
1414
}

futures-util/src/future/chain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use core::pin::Pin;
22
use futures_core::future::Future;
33
use futures_core::task::{Context, Poll};
44

5-
#[must_use = "futures do nothing unless polled"]
5+
#[must_use = "futures do nothing unless you `.await` or poll them"]
66
#[derive(Debug)]
77
pub(crate) enum Chain<Fut1, Fut2, Data> {
88
First(Fut1, Option<Data>),

futures-util/src/future/empty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use futures_core::task::{Context, Poll};
55

66
/// Future for the [`empty`] function.
77
#[derive(Debug)]
8-
#[must_use = "futures do nothing unless polled"]
8+
#[must_use = "futures do nothing unless you `.await` or poll them"]
99
pub struct Empty<T> {
1010
_data: marker::PhantomData<T>,
1111
}

futures-util/src/future/flatten.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use futures_core::task::{Context, Poll};
66
use pin_utils::unsafe_pinned;
77

88
/// Future for the [`flatten`](super::FutureExt::flatten) method.
9-
#[must_use = "futures do nothing unless polled"]
9+
#[must_use = "futures do nothing unless you `.await` or poll them"]
1010
pub struct Flatten<Fut>
1111
where Fut: Future,
1212
Fut::Output: Future,

0 commit comments

Comments
 (0)