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

warn on identical arguments of assert_eq!() #3574

Closed
matthiaskrgr opened this issue Dec 22, 2018 · 7 comments · Fixed by #6167
Closed

warn on identical arguments of assert_eq!() #3574

matthiaskrgr opened this issue Dec 22, 2018 · 7 comments · Fixed by #6167
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy L-correctness Lint: Belongs in the correctness lint group

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Dec 22, 2018

fn main() {
    let thing_a = 3;
    let thing_b = 4;
    assert_eq!(thing_a, thing_a); // lint here, this should probably be
    // assert_eq!(thing_a, thing_b)
    println!("{} {}", thing_a, thing_b);
}
@flip1995 flip1995 added good-first-issue These issues are a good way to get started with Clippy A-lint Area: New lints L-correctness Lint: Belongs in the correctness lint group labels Dec 22, 2018
@Arkweid
Copy link

Arkweid commented Dec 22, 2018

Is there a good place among the available lint files or need a new one?

@oli-obk
Copy link
Contributor

oli-obk commented Dec 23, 2018

We do have the eq_op lint for x == x. Maybe we could just not silence it inside the assert family of macros?

@HarrisonMc555
Copy link
Contributor

Has anyone picked this up? I could take this one.

@flip1995
Copy link
Member

You can pick this up!

@Lythenas
Copy link
Contributor

Lythenas commented Oct 3, 2019

@HarrisonMc555 are you still working on this? I already did a similar thing with the unit_cmp lint so I could help out.

@HarrisonMc555
Copy link
Contributor

@Lythenas I recently started a new job, so I've been pretty busy. If you want to take a stab at it, go for it!

@Lythenas
Copy link
Contributor

Lythenas commented Oct 7, 2019

@HarrisonMc555 It's probably gonna take me a while to get around to this. If you find time feel free to take this otherwise I will eventually do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy L-correctness Lint: Belongs in the correctness lint group
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants