test: mark Spawn as #[must_use] (#6371)

This commit is contained in:
kim / Motoyuki Kimura 2024-03-05 00:56:40 +09:00 committed by GitHub
parent f5ca423bf1
commit f6d061919f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,6 +49,7 @@ pub fn spawn<T>(task: T) -> Spawn<T> {
/// 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<T> {
task: MockTask,
future: Pin<Box<T>>,