From f6d061919f7a56eebf78edb1d1d379fadad33b6a Mon Sep 17 00:00:00 2001 From: kim / Motoyuki Kimura Date: Tue, 5 Mar 2024 00:56:40 +0900 Subject: [PATCH] test: mark `Spawn` as `#[must_use]` (#6371) --- 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>,