Skip to content

rustc 1.83.0-nightly clippy wrongly report needless_return #13479

Closed
@yipu3

Description

@yipu3

Summary

When using rustc 1.83.0-nightly clippy wrongly report needless_return. After changed to the stable version it became normal.

Reproducer

I tried this code:

use xxx::run;
use eyre::Result;

#[tokio::main]
async fn main() -> Result<()> {
    tracing_subscriber::fmt::init();
    run().await;
}

I expected to see this happen: Do not report needless_return because I even haven't used the return keywords.

Instead, this happened: It reported needless_return and suggested me to change run().await; to run().run().await;. There is definately something wrong here.

(Cannot provide the whole code and output because is a private project)

Version

rustc 1.83.0-nightly (7608018 2024-09-29)
binary: rustc
commit-hash: 7608018...
commit-date: 2024-09-29
host: x86_64-unknown-linux-gnu
release: 1.83.0-nightly
LLVM version: 19.1.0

Additional Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions