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: always emit return statement #4636

Merged
merged 5 commits into from Apr 27, 2022
Merged

macros: always emit return statement #4636

merged 5 commits into from Apr 27, 2022

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Apr 24, 2022

Fixes #4635

There are two approaches, each divided into commits to compare.

The first commit is the let () = approach mentioned in #4635 (comment), which fixes #4635 while maintaining the current diagnostics. However, the diagnostics for #4635's case are not very good.

The second commit is a greatly simplified version of the current approach. There is small diagnostics regression, but it improves somewhat for #4635's case.

I tend to prefer the second one, but if other reviewers prefer the first one, I can revert the second commit.

@taiki-e taiki-e added the A-tokio-macros Area: The tokio-macros crate label Apr 24, 2022
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

Go for the approach you prefer. Either is fine with me.

@taiki-e taiki-e changed the title macros: fix issue 4635 macros: always emit return statement Apr 27, 2022
@taiki-e taiki-e merged commit fa665b9 into master Apr 27, 2022
@taiki-e taiki-e deleted the taiki-e/issue-4635 branch April 27, 2022 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-macros Area: The tokio-macros crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

#[tokio::main] allowing arbitrary return values from main
2 participants