macros: various error message improvements (#3677)

Improves a few of the error messages for `#[tokio::main]` and `#[tokio::test]`.

Also adds a note to the docs about `start_paused` requiring the `test-util` feature which wasn't mentioned previously.
This commit is contained in:
David Pedersen
2021-04-05 22:40:42 +02:00
committed by GitHub
parent f6e4e85dfb
commit 618d2bfc71
4 changed files with 105 additions and 28 deletions
+4
View File
@@ -167,6 +167,8 @@ use proc_macro::TokenStream;
/// }
/// ```
///
/// Note that `start_paused` requires the `test-util` feature to be enabled.
///
/// ### NOTE:
///
/// If you rename the Tokio crate in your dependencies this macro will not work.
@@ -257,6 +259,8 @@ pub fn main_rt(args: TokenStream, item: TokenStream) -> TokenStream {
/// }
/// ```
///
/// Note that `start_paused` requires the `test-util` feature to be enabled.
///
/// ### NOTE:
///
/// If you rename the Tokio crate in your dependencies this macro will not work.