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

tokio::select not compatible with clippy::default_numeric_fallback #3830

Closed
kamulos opened this issue Jun 1, 2021 · 3 comments · Fixed by #3831
Closed

tokio::select not compatible with clippy::default_numeric_fallback #3830

kamulos opened this issue Jun 1, 2021 · 3 comments · Fixed by #3831
Labels
A-tokio Area: The main tokio crate M-macros Module: macros in the main Tokio crate

Comments

@kamulos
Copy link
Contributor

kamulos commented Jun 1, 2021

Version
1.6.1

Platform
Linux xyz 5.12.7-arch1-1 #1 SMP PREEMPT Wed, 26 May 2021 22:03:57 +0000 x86_64 GNU/Linux

Description
There might be good reasons for this, but the tokio::select macro is preventing me from activating clippy::default_numeric_fallback in my code.

pub async fn myfunc() {
    tokio::select! {
        _ = empty() => (),
        else => (),
    }
}

async fn empty() {}

Run with:

cargo clippy -- -W clippy::default_numeric_fallback
@kamulos kamulos added A-tokio Area: The main tokio crate C-bug Category: This is a bug. labels Jun 1, 2021
@taiki-e
Copy link
Member

taiki-e commented Jun 1, 2021

This is a bug of clippy that warns code generated by external macros.

@taiki-e
Copy link
Member

taiki-e commented Jun 1, 2021

Filed rust-lang/rust-clippy#7304 to report this bug, and filed #3831 to avoid this bug.

@kamulos
Copy link
Contributor Author

kamulos commented Jun 2, 2021

thanks for the quick reaction 😊

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 M-macros Module: macros in the main Tokio crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants