Skip to content

clippy::op_ref false positive with deref coercions #4556

@Manishearth

Description

@Manishearth
    let a = "a".to_string();
    let b = "a";

    if b < &a {
        println!("OK");
    }

This warns, but it should not, since the &a is necessary to coerce the type. We even incorrectly test for this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when applied

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions