mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
macros: #[cfg(not(test))] is no longer necessary for main macros (#6508)
This commit is contained in:
@@ -418,7 +418,6 @@ fn token_stream_with_error(mut tokens: TokenStream, error: syn::Error) -> TokenS
|
|||||||
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 {
|
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
|
// 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
|
// to the expected output as possible. This helps out IDEs such that completions and other
|
||||||
|
|||||||
@@ -202,7 +202,6 @@ use proc_macro::TokenStream;
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
#[proc_macro_attribute]
|
#[proc_macro_attribute]
|
||||||
#[cfg(not(test))] // Work around for rust-lang/rust#62127
|
|
||||||
pub fn main(args: TokenStream, item: TokenStream) -> TokenStream {
|
pub fn main(args: TokenStream, item: TokenStream) -> TokenStream {
|
||||||
entry::main(args.into(), item.into(), true).into()
|
entry::main(args.into(), item.into(), true).into()
|
||||||
}
|
}
|
||||||
@@ -267,7 +266,6 @@ pub fn main(args: TokenStream, item: TokenStream) -> TokenStream {
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
#[proc_macro_attribute]
|
#[proc_macro_attribute]
|
||||||
#[cfg(not(test))] // Work around for rust-lang/rust#62127
|
|
||||||
pub fn main_rt(args: TokenStream, item: TokenStream) -> TokenStream {
|
pub fn main_rt(args: TokenStream, item: TokenStream) -> TokenStream {
|
||||||
entry::main(args.into(), item.into(), false).into()
|
entry::main(args.into(), item.into(), false).into()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -654,7 +654,6 @@ cfg_macros! {
|
|||||||
|
|
||||||
cfg_rt! {
|
cfg_rt! {
|
||||||
#[cfg(feature = "rt-multi-thread")]
|
#[cfg(feature = "rt-multi-thread")]
|
||||||
#[cfg(not(test))] // Work around for rust-lang/rust#62127
|
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
|
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use tokio_macros::main;
|
pub use tokio_macros::main;
|
||||||
@@ -665,7 +664,6 @@ cfg_macros! {
|
|||||||
pub use tokio_macros::test;
|
pub use tokio_macros::test;
|
||||||
|
|
||||||
cfg_not_rt_multi_thread! {
|
cfg_not_rt_multi_thread! {
|
||||||
#[cfg(not(test))] // Work around for rust-lang/rust#62127
|
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use tokio_macros::main_rt as main;
|
pub use tokio_macros::main_rt as main;
|
||||||
|
|
||||||
@@ -676,7 +674,6 @@ cfg_macros! {
|
|||||||
|
|
||||||
// Always fail if rt is not enabled.
|
// Always fail if rt is not enabled.
|
||||||
cfg_not_rt! {
|
cfg_not_rt! {
|
||||||
#[cfg(not(test))]
|
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use tokio_macros::main_fail as main;
|
pub use tokio_macros::main_fail as main;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user