diff --git a/examples/examples/echo.rs b/examples/examples/echo.rs index e26ebc0ae6..3edd63cef4 100644 --- a/examples/examples/echo.rs +++ b/examples/examples/echo.rs @@ -116,6 +116,7 @@ async fn main() -> Result<(), Box> { info!(message = "echo'd data", %peer_addr, size = n); } }) - .instrument(info_span!("echo", %peer_addr)); + .instrument(info_span!("echo", %peer_addr)) + .await?; } } diff --git a/tracing/src/instrument.rs b/tracing/src/instrument.rs index d90fa936a7..d1070ba8e2 100644 --- a/tracing/src/instrument.rs +++ b/tracing/src/instrument.rs @@ -123,6 +123,7 @@ pub trait WithSubscriber: Sized { pin_project! { /// A future that has been instrumented with a `tracing` subscriber. #[derive(Clone, Debug)] + #[must_use = "futures do nothing unless you `.await` or poll them"] pub struct WithDispatch { #[pin] inner: T, @@ -133,6 +134,7 @@ pin_project! { pin_project! { /// A future that has been instrumented with a `tracing` span. #[derive(Debug, Clone)] + #[must_use = "futures do nothing unless you `.await` or poll them"] pub struct Instrumented { #[pin] inner: T,