From 91e798b70026b10e0700823caf64f699ead2eddc Mon Sep 17 00:00:00 2001 From: mox692 Date: Thu, 29 Feb 2024 22:05:04 +0900 Subject: [PATCH] mark Spawn as must_use --- tokio-test/src/task.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tokio-test/src/task.rs b/tokio-test/src/task.rs index a9cf50f52f9..812f908aca8 100644 --- a/tokio-test/src/task.rs +++ b/tokio-test/src/task.rs @@ -49,6 +49,7 @@ pub fn spawn(task: T) -> Spawn { /// Future spawned on a mock task that can be used to poll the future or stream /// without needing pinning or context types. #[derive(Debug)] +#[must_use = "futures do nothing unless you `.await` or poll them"] pub struct Spawn { task: MockTask, future: Pin>,