From 114ab12801a2df1e0117b6b47002cad4cd1c60be Mon Sep 17 00:00:00 2001 From: avtrujillo Date: Mon, 22 Apr 2024 18:34:22 -0700 Subject: [PATCH 1/2] Remove unnecessary uses of #[cfg(not(test))] --- tokio-macros/src/entry.rs | 1 - tokio-macros/src/lib.rs | 2 -- tokio/src/lib.rs | 2 -- 3 files changed, 5 deletions(-) diff --git a/tokio-macros/src/entry.rs b/tokio-macros/src/entry.rs index ed782ad38f6..20cbdb1c92a 100644 --- a/tokio-macros/src/entry.rs +++ b/tokio-macros/src/entry.rs @@ -418,7 +418,6 @@ fn token_stream_with_error(mut tokens: TokenStream, error: syn::Error) -> TokenS tokens } -#[cfg(not(test))] // Work around for rust-lang/rust#62127 pub(crate) fn main(args: TokenStream, item: TokenStream, rt_multi_thread: bool) -> TokenStream { // If any of the steps for this macro fail, we still want to expand to an item that is as close // to the expected output as possible. This helps out IDEs such that completions and other diff --git a/tokio-macros/src/lib.rs b/tokio-macros/src/lib.rs index 919c4ac0ba9..ab7b083d381 100644 --- a/tokio-macros/src/lib.rs +++ b/tokio-macros/src/lib.rs @@ -202,7 +202,6 @@ use proc_macro::TokenStream; /// } /// ``` #[proc_macro_attribute] -#[cfg(not(test))] // Work around for rust-lang/rust#62127 pub fn main(args: TokenStream, item: TokenStream) -> TokenStream { entry::main(args.into(), item.into(), true).into() } @@ -267,7 +266,6 @@ pub fn main(args: TokenStream, item: TokenStream) -> TokenStream { /// } /// ``` #[proc_macro_attribute] -#[cfg(not(test))] // Work around for rust-lang/rust#62127 pub fn main_rt(args: TokenStream, item: TokenStream) -> TokenStream { entry::main(args.into(), item.into(), false).into() } diff --git a/tokio/src/lib.rs b/tokio/src/lib.rs index 57b6560bf0d..41062cc36f4 100644 --- a/tokio/src/lib.rs +++ b/tokio/src/lib.rs @@ -654,7 +654,6 @@ cfg_macros! { cfg_rt! { #[cfg(feature = "rt-multi-thread")] - #[cfg(not(test))] // Work around for rust-lang/rust#62127 #[cfg_attr(docsrs, doc(cfg(feature = "macros")))] #[doc(inline)] pub use tokio_macros::main; @@ -665,7 +664,6 @@ cfg_macros! { pub use tokio_macros::test; cfg_not_rt_multi_thread! { - #[cfg(not(test))] // Work around for rust-lang/rust#62127 #[doc(inline)] pub use tokio_macros::main_rt as main; From 0d973a3c03003b3df51215678da77ba740437f21 Mon Sep 17 00:00:00 2001 From: avtrujillo Date: Tue, 23 Apr 2024 03:09:07 -0700 Subject: [PATCH 2/2] Remove #[cfg(not(test))] from cfg_macros block in tokio/src/lib.rs --- tokio/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/tokio/src/lib.rs b/tokio/src/lib.rs index 41062cc36f4..52b098986fb 100644 --- a/tokio/src/lib.rs +++ b/tokio/src/lib.rs @@ -674,7 +674,6 @@ cfg_macros! { // Always fail if rt is not enabled. cfg_not_rt! { - #[cfg(not(test))] #[doc(inline)] pub use tokio_macros::main_fail as main;