Skip to content

result_large_err does not apply to closures #16249

@narpfel

Description

@narpfel

Summary

The result_large_err lint does not apply to closures.

Lint Name

result_large_err

Reproducer

I tried this code:

#![allow(unused)]

pub type Large = [u8; 1024];

pub fn f() -> Result<(), Large> {
    Ok(())
}

pub fn main() {
    let closure = || -> Result<(), Large> {
        Ok(())
    };
}

I expected to see this happen: The lint should be triggered by f and by closure.

Instead, this happened: The lint is only triggered by f.

Godbolt link: https://godbolt.org/z/s99dsq9WK

Version

rustc 1.94.0-nightly (21ff67df1 2025-12-15)
binary: rustc
commit-hash: 21ff67df15329dd7548ccba54b6c6ae9a562124f
commit-date: 2025-12-15
host: x86_64-unknown-linux-gnu
release: 1.94.0-nightly
LLVM version: 21.1.8

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