Closed
Description
I just stumbled over this and think the test cases specify the wrong behaviour.
This line:
Gets turned into this:
But these are opposite asserts, so this will break the test.
The same applies to all the other calls to assert_eq!(..., false)
and assert_neq!(..., true)
of course.
Edit: sorry for the lack of template, I created this from the GH blame view which seems so sidestep that.
Minimal Reproducer
fn main() {
println!("Hello, world!");
}
#[cfg(test)]
mod test {
#[test]
fn assert_correctly_transformed() {
let must_be_false = false;
assert_eq!(must_be_false, false);
}
}
Expected:
assert!(!must_be_false);
Observed:
assert!(must_be_false);
(note the lack of !
)
clippy 0.1.69 (658fad6 2023-02-03)
This does NOT happen on stable (yet) since the auto-fix was only introduced recently.
Metadata
Metadata
Assignees
Labels
No labels