From 86de2e306b91eb9a6de7aa5a38e3359789f27bf4 Mon Sep 17 00:00:00 2001 From: Martin Grigorov Date: Mon, 15 Sep 2025 10:22:42 +0300 Subject: [PATCH] util: fix `pending_only_on_first_poll_with_cancellation_token_owned_test` to use an owned cancellation token (#7613) The name of the test suggests that it should test the with_cancellation_token_owned() extension method --- tokio-util/tests/future.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio-util/tests/future.rs b/tokio-util/tests/future.rs index 974a934cd..0456dd885 100644 --- a/tokio-util/tests/future.rs +++ b/tokio-util/tests/future.rs @@ -250,7 +250,7 @@ fn pending_fut_with_owned_token_cancelled_test() { fn pending_only_on_first_poll_with_cancellation_token_owned_test() { let (waker, wake_count) = new_count_waker(); let token = CancellationToken::new(); - let fut = ReadyOnTheSecondPollFuture::default().with_cancellation_token(&token); + let fut = ReadyOnTheSecondPollFuture::default().with_cancellation_token_owned(token.clone()); pin!(fut); // first poll, ReadyOnTheSecondPollFuture returned Pending