Skip to content

manual_is_variant_and should also trigger for some_option.map(|x| x.is_foo) == Some(true) #14542

Open
@sdroege

Description

@sdroege

Summary

See title :)

Lint Name

manual_is_variant_and

Reproducer

I tried this code:

let x = Some(2).map(|x| x % 2 == 0) == Some(true);

I expected to see this happen:

Suggestion to use let x = Some(2).is_some_and(|x| x % 2 == 0);

Instead, this happened:

Nothing

Version

rustc 1.86.0 (05f9846f8 2025-03-31)
binary: rustc
commit-hash: 05f9846f893b09a1be1fc8560e33fc3c815cfecb
commit-date: 2025-03-31
host: x86_64-unknown-linux-gnu
release: 1.86.0
LLVM version: 19.1.7

Metadata

Metadata

Assignees

No one assigned

    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