Skip to content

infinite_loop no longer lints async functions #15541

@kpreid

Description

@kpreid

Summary

On nightly, the infinite_loop lint seems to no longer lint any async functions at all, regardless of their return type. I imagine this is likely an unintended consequence of false positive fix #15157.

Lint Name

infinite_loop

Reproducer

I tried this code:

#![deny(clippy::infinite_loop)]

// should not be linted
async fn good() -> ! {
    loop {
        std::future::pending().await
    }
}

// should be linted
async fn bad() {
    loop {
        std::future::pending().await
    }
}

I expected to see this happen: One deny error from bad()

Instead, this happened: Zero errors

Version

rustc 1.91.0-nightly (46c219bd2 2025-08-22)
binary: rustc
commit-hash: 46c219bd24862c0a87f0299570bb37f2d5ecf6ce
commit-date: 2025-08-22
host: aarch64-apple-darwin
release: 1.91.0-nightly
LLVM version: 21.1.0

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn't

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions