-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
feat: generate function declaration in macro for better type check compile error message #6307
Conversation
…ithout #[tokio::main] invocation
This approach was considered in the past but rejected because it would be a breaking change. While "use this approach if there are no arguments" might be fine, it's not clear that it's worth the complexity. |
Thanks for the clarification, I understand why this implementation is not valid and going to close this PR. However, the test So, before I close this PR, would you mind if I change the |
Yeah, it is definitely a problem that the trait_method test did not catch that this is a breaking change. |
this should fail for PR tokio-rs#6307
While not every check has been finished, I checked following compiler error locally and for some of the github checks:
So I'm closing this issue and going to create a PR for |
Motivation
issue #6306
parse_knobs
method creates an async block and then calls it. While doing so, the return type of original function is erased for the async block.This slightly changes the compiler error message from type mismatch.
Solution
Create a temporary function with original return type preserved instead of creating an async block.
Caveats