From 493e5e6af5e42b2d60c15573e656489921809d55 Mon Sep 17 00:00:00 2001 From: Hayden Stainsby Date: Thu, 21 Jul 2022 16:57:06 +0200 Subject: [PATCH] io: add track_caller caller to no-rt io driver This change adds a case that was missing from the original PR, #4793. The `io::driver::Handle::current` function was only covered by `#[track_caller]` in the case that the `rt` feature is enabled, however it was missing in the case that the `rt` feture isn't enabled (in which case a panic would be more common). This particular case cannot be tested in the tokio tests as they always run with all features enabled. Refs: #4413 --- tokio/src/io/driver/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tokio/src/io/driver/mod.rs b/tokio/src/io/driver/mod.rs index 745c73bafd1..5d9e114a604 100644 --- a/tokio/src/io/driver/mod.rs +++ b/tokio/src/io/driver/mod.rs @@ -282,6 +282,7 @@ cfg_not_rt! { /// /// This function panics if there is no current reactor set, or if the `rt` /// feature flag is not enabled. + #[track_caller] pub(super) fn current() -> Self { panic!("{}", crate::util::error::CONTEXT_MISSING_ERROR) }