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

Clippy errors inside select! #5616

Open
Erigara opened this issue Apr 12, 2023 · 2 comments
Open

Clippy errors inside select! #5616

Erigara opened this issue Apr 12, 2023 · 2 comments
Labels
A-tokio Area: The main tokio crate C-bug Category: This is a bug. M-macros Module: macros in the main Tokio crate

Comments

@Erigara
Copy link

Erigara commented Apr 12, 2023

Version

tokio v1.27.0

Platform

Rust playground.

Description

Clippy return errors that originate inside select!.

I tried this code (playground):

#![deny(clippy::arithmetic_side_effects, clippy::redundant_pub_crate)]

extern crate tokio; // 1.27.0

#[tokio::main]
async fn main() {
    let (_, mut receiver) = tokio::sync::mpsc::channel(1);
    
    loop {
        tokio::select! {
            Some(()) = receiver.recv() => {}
            else => break,
        }
    }
}

I expected to see this happen: clippy run without errors.

Instead, this happened: clippy return errors due to error in the macro select!.

@Erigara Erigara added A-tokio Area: The main tokio crate C-bug Category: This is a bug. labels Apr 12, 2023
@taiki-e
Copy link
Member

taiki-e commented Apr 12, 2023

This is a clippy bug that warns external macros. (similar to rust-lang/rust-clippy#7304, rust-lang/rust-clippy#10259, rust-lang/rust-clippy#10318, etc.)

I would accept a PR to add the corresponding #[allow()] attribute to the generated code, but please consider submitting issues to https://github.com/rust-lang/rust-clippy to fix the underlying problems.

@Darksonn Darksonn added the M-macros Module: macros in the main Tokio crate label Apr 12, 2023
@taiki-e
Copy link
Member

taiki-e commented Apr 15, 2023

(upstream issue: rust-lang/rust-clippy#10636)

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-bug Category: This is a bug. M-macros Module: macros in the main Tokio crate
Projects
None yet
Development

No branches or pull requests

3 participants