Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clippy::op_ref false positive with deref coercions #4556

Closed
Manishearth opened this issue Sep 20, 2019 · 2 comments
Closed

clippy::op_ref false positive with deref coercions #4556

Manishearth opened this issue Sep 20, 2019 · 2 comments
Labels
C-bug Category: Clippy is not doing the correct thing I-suggestion-causes-error Issue: The suggestions provided by this Lint cause an ICE/error when applied

Comments

@Manishearth
Copy link
Member

    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.

@Manishearth Manishearth added C-bug Category: Clippy is not doing the correct thing I-suggestion-causes-error Issue: The suggestions provided by this Lint cause an ICE/error when applied labels Sep 20, 2019
@ghost
Copy link

ghost commented Sep 20, 2019

Is this the same as #2597?

@Manishearth
Copy link
Member Author

Yep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-suggestion-causes-error Issue: The suggestions provided by this Lint cause an ICE/error when applied
Projects
None yet
Development

No branches or pull requests

1 participant