-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn't
Description
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 thingCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn't