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

Fix select macro giving warning when branch's returns never #2678

Merged

Conversation

blasrodri
Copy link
Contributor

@blasrodri blasrodri commented Jul 22, 2020

Solves #2665 by adding #[allow(unreachable_code)] inside a branch
matching arm.

Motivation

Fixing #2665 after founding out that the error is generated when
an async function is of return type ! (never)

Solution

Add #[allow(unreachable_code)] in the right block to prevent this.

@blasrodri blasrodri force-pushed the fix-select-macro-unreachable-warning branch 2 times, most recently from b238391 to 274ae25 Compare July 22, 2020 08:46
@Darksonn
Copy link
Contributor

Can you add a test too?

Solves tokio-rs#2665 by adding #[allow(unreachable_code)] inside a branch
matching arm.
@blasrodri blasrodri force-pushed the fix-select-macro-unreachable-warning branch from 274ae25 to 53a6ba7 Compare July 22, 2020 22:21
@Darksonn Darksonn added A-tokio Area: The main tokio crate C-enhancement Category: A PR with an enhancement or bugfix. M-macros Module: macros in the main Tokio crate labels Jul 25, 2020
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.

Thanks for getting this done 👍

@carllerche carllerche merged commit 027351d into tokio-rs:master Jul 28, 2020
@blasrodri blasrodri deleted the fix-select-macro-unreachable-warning branch July 28, 2020 20:12
@Darksonn Darksonn mentioned this pull request Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-enhancement Category: A PR with an enhancement or bugfix. M-macros Module: macros in the main Tokio crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants