Skip to content
This repository was archived by the owner on Oct 30, 2019. It is now read-only.

improved error message for unused futures #32

Merged
merged 1 commit into from
May 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/net/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ impl AsyncWrite for TcpStream {
///
/// [`TcpStream::connect`]: struct.TcpStream.html#method.connect
/// [`TcpStream`]: struct.TcpStream.html
#[must_use = "futures do nothing unless polled"]
#[must_use = "futures do nothing unless you `.await` or poll them"]
pub struct Connect {
addrs: Option<io::Result<VecDeque<SocketAddr>>>,
last_err: Option<io::Error>,
Expand Down Expand Up @@ -453,7 +453,7 @@ impl TcpListener {
///
/// [`TcpStream::accept`]: struct.TcpStream.html#method.accept
/// [`TcpStream`]: struct.TcpStream.html
#[must_use = "futures do nothing unless polled"]
#[must_use = "futures do nothing unless you `.await` or poll them"]
#[derive(Debug)]
pub struct Accept<'stream> {
inner: Incoming<'stream>,
Expand Down
4 changes: 2 additions & 2 deletions src/net/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ impl UdpSocket {
/// On success, returns the number of bytes written.
///
/// [`UdpSocket::send_to`]: struct.UdpSocket.html#method.send_to
#[must_use = "futures do nothing unless polled"]
#[must_use = "futures do nothing unless you `.await` or poll them"]
#[derive(Debug)]
pub struct SendTo<'socket, 'buf> {
/// The open socket we use to send the message from.
Expand Down Expand Up @@ -393,7 +393,7 @@ impl<'socket, 'buf> Future for SendTo<'socket, 'buf> {
/// On success, returns the number of bytes read and the origin.
///
/// [`UdpSocket::recv_from`]: struct.UdpSocket.html#method.recv_from
#[must_use = "futures do nothing unless polled"]
#[must_use = "futures do nothing unless you `.await` or poll them"]
#[derive(Debug)]
pub struct RecvFrom<'socket, 'buf> {
socket: &'socket mut UdpSocket,
Expand Down
2 changes: 1 addition & 1 deletion src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ where
/// A handle that awaits the result of a [`spawn`]ed future.
///
/// [`spawn`]: fn.spawn.html
#[must_use = "futures do nothing unless polled"]
#[must_use = "futures do nothing unless you `.await` or poll them"]
#[derive(Debug)]
pub struct JoinHandle<T> {
pub(crate) rx: futures::channel::oneshot::Receiver<T>,
Expand Down