Skip to content

if-then-else/needless_bool is breaking easily #11248

Closed
@GuillaumeGomez

Description

@GuillaumeGomez

Summary

The if-then-else lint is breaking very easily.

Reproducer

if x {
    // some comment
    true
} else {
    true
}

The if-then-else lint is not triggered if the block contains comments.

Version

I tested it in clippy repository directly.

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