diff --git a/src/lib.rs b/src/lib.rs index 64798fca8..bcb835d2e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -263,6 +263,7 @@ impl CommandExt for process::Command { /// > done because futures in general take `drop` as a sign of cancellation, and /// > this `Child` is itself a future. If you'd like to run a process in the /// > background, though, you may use the `forget` method. +#[must_use = "futures do nothing unless polled"] #[derive(Debug)] pub struct Child { child: imp::Child, @@ -372,6 +373,7 @@ impl Drop for Child { /// /// This future will resolve to the standard library's `Output` type which /// contains the exit status, stdout, and stderr of a child process. +#[must_use = "futures do nothing unless polled"] pub struct WaitWithOutput { inner: IoFuture, } @@ -398,6 +400,7 @@ impl Future for WaitWithOutput { /// This future is used to conveniently spawn a child and simply wait for its /// exit status. This future will resolves to the `ExitStatus` type in the /// standard library. +#[must_use = "futures do nothing unless polled"] #[derive(Debug)] pub struct StatusAsync { inner: Flatten>, @@ -417,6 +420,7 @@ impl Future for StatusAsync { /// This future is mostly equivalent to spawning a process and then calling /// `wait_with_output` on it internally. This can be useful to simply spawn a /// process, collecting all of its output and its exit status. +#[must_use = "futures do nothing unless polled"] pub struct OutputAsync { inner: IoFuture, } diff --git a/src/unix.rs b/src/unix.rs index 7e85a6017..fed6deea2 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -40,6 +40,7 @@ use std::fmt; use tokio_io::IoFuture; use tokio_core::reactor::{Handle, PollEvented}; +#[must_use = "futures do nothing unless polled"] pub struct Child { inner: process::Child, reaped: bool, diff --git a/src/windows.rs b/src/windows.rs index e87ece162..8ed1781fc 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -31,6 +31,7 @@ use futures::future::Fuse; use self::mio_named_pipes::NamedPipe; use tokio_core::reactor::{PollEvented, Handle}; +#[must_use = "futures do nothing unless polled"] pub struct Child { child: process::Child, waiting: Option,