Use debug_assert_ne rather than debug_assert with a !=.

https://github.com/rust-lang-nursery/rust-clippy/wiki#should_assert_eq
This commit is contained in:
Dan Gohman
2018-03-07 21:32:56 -08:00
parent e6db8e278c
commit 99f7cb5b8d

View File

@@ -223,7 +223,7 @@ fn do_divrem_transformation(divrem_info: &DivRemByConstInfo, pos: &mut FuncCurso
let t3 = pos.ins().iadd(t2, q1);
// I never found any case where shiftBy == 1 here.
// So there's no attempt to fold out a zero shift.
debug_assert!(shiftBy != 1);
debug_assert_ne!(shiftBy, 1);
qf = pos.ins().ushr_imm(t3, (shiftBy - 1) as i64);
} else {
debug_assert!(shiftBy >= 0 && shiftBy <= 31);
@@ -295,7 +295,7 @@ fn do_divrem_transformation(divrem_info: &DivRemByConstInfo, pos: &mut FuncCurso
let t3 = pos.ins().iadd(t2, q1);
// I never found any case where shiftBy == 1 here.
// So there's no attempt to fold out a zero shift.
debug_assert!(shiftBy != 1);
debug_assert_ne!(shiftBy, 1);
qf = pos.ins().ushr_imm(t3, (shiftBy - 1) as i64);
} else {
debug_assert!(shiftBy >= 0 && shiftBy <= 63);