From abfd02e255702a57e6d4534b01ddd169d067e45a Mon Sep 17 00:00:00 2001 From: faraz Date: Thu, 11 Mar 2021 19:20:43 -0800 Subject: [PATCH] Issue 3608 EnterGuard must always be used. { let _guard = handle.enter(); // skipping _guard is wrong in all likelihood } --- tokio/src/runtime/handle.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tokio/src/runtime/handle.rs b/tokio/src/runtime/handle.rs index 76b28f24e36..5de23669b82 100644 --- a/tokio/src/runtime/handle.rs +++ b/tokio/src/runtime/handle.rs @@ -39,6 +39,7 @@ pub struct Handle { /// /// [`Runtime::enter`]: fn@crate::runtime::Runtime::enter #[derive(Debug)] +#[must_use = "Creating and dropping a guard does nothing"] pub struct EnterGuard<'a> { handle: &'a Handle, guard: context::EnterGuard,