-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
macros: various error message improvements #3677
Conversation
27 | #[tokio::test(flavor = "foo")] | ||
| ^^^^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would previously point to flavor
even though "foo"
is the problem.
error: The `start_paused` option requires the `current_thread` runtime flavor. Use `#[tokio::test(flavor = "current_thread")]` | ||
--> $DIR/macros_invalid_input.rs:30:55 | ||
| | ||
30 | #[tokio::test(flavor = "multi_thread", start_paused = false)] | ||
| ^^^^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding Use ...
suggestion the user can copy-paste.
error: Failed to parse value of `worker_threads` as integer. | ||
--> $DIR/macros_invalid_input.rs:33:57 | ||
| | ||
33 | #[tokio::test(flavor = "multi_thread", worker_threads = "foo")] | ||
| ^^^^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added missing backticks.
Why does CI require this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks good to me.
Improves a few of the error messages for
#[tokio::main]
and#[tokio::test]
. The changes are probably best illustrated by the new trybuild tests.I also added a note to the docs about
start_paused
requiring thetest-util
feature which wasn't mentioned previously. Took me some digging to discover.