From 1cc016833569e2dbae3b0431b7c87d5e75ef5de6 Mon Sep 17 00:00:00 2001 From: Jeb Rosen Date: Tue, 12 May 2020 00:09:59 -0700 Subject: macros: disambiguate the built-in #[test] attribute in macro expansion (#2503) `tokio::test` and related macros now use the absolute path `::core::prelude::v1::test` to refer to the built-in `test` macro. This absolute path was introduced in rust-lang/rust#62086. --- tokio-macros/src/entry.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tokio-macros') diff --git a/tokio-macros/src/entry.rs b/tokio-macros/src/entry.rs index 6a58b791..2681f50d 100644 --- a/tokio-macros/src/entry.rs +++ b/tokio-macros/src/entry.rs @@ -142,7 +142,7 @@ fn parse_knobs( let header = { if is_test { quote! { - #[test] + #[::core::prelude::v1::test] } } else { quote! {} @@ -334,14 +334,14 @@ pub(crate) mod old { let result = match runtime { Runtime::Threaded => quote! { - #[test] + #[::core::prelude::v1::test] #(#attrs)* #vis fn #name() #ret { tokio::runtime::Runtime::new().unwrap().block_on(async { #body }) } }, Runtime::Basic | Runtime::Auto => quote! { - #[test] + #[::core::prelude::v1::test] #(#attrs)* #vis fn #name() #ret { tokio::runtime::Builder::new() -- cgit v1.2.3