Skip to content
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: fix skipping generics on #[tokio::main] #2177

Merged
merged 1 commit into from
Jan 26, 2020
Merged

macros: fix skipping generics on #[tokio::main] #2177

merged 1 commit into from
Jan 26, 2020

Conversation

daxpedda
Copy link
Contributor

Motivation

Fixes #2176.

Solution

The solution is pretty straightforward:
Instead of #vis fn #name(#inputs) #ret { just writing #vis #sig works magic.

I also included a test.

When using #[tokio::main] on a function with generics, the generics are
skipped. Simply using #vis #sig instead of #vis fn #name(#inputs) #ret
fixes the problem.

I also included a simple test.

Fixes #2176
Copy link
Member

@carllerche carllerche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great 👍 thanks!

@carllerche carllerche merged commit 4996e27 into tokio-rs:master Jan 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

#[tokio::main] ignores generics
2 participants