From aac006ed4933c230a99736f4ebb8afe4929677ca Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 2 Mar 2018 13:20:11 -0800 Subject: [PATCH] Avoid trivial numeric casts. --- lib/cretonne/src/divconst_magic_numbers.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cretonne/src/divconst_magic_numbers.rs b/lib/cretonne/src/divconst_magic_numbers.rs index 64416e48fe..a34608359f 100644 --- a/lib/cretonne/src/divconst_magic_numbers.rs +++ b/lib/cretonne/src/divconst_magic_numbers.rs @@ -498,14 +498,14 @@ mod tests { println!("Testing UP magicU64"); for x in 2..(200 * 1000u64) { let m = magicU64(x); - total = total ^ (m.mulBy as u64); + total = total ^ m.mulBy; total = total + (m.shiftBy as u64); total = total - (if m.doAdd { 123 } else { 456 }); } println!("Testing DOWN magicU64"); for x in 0..(200 * 1000u64) { let m = magicU64(0xFFFF_FFFF_FFFF_FFFFu64 - x); - total = total ^ (m.mulBy as u64); + total = total ^ m.mulBy; total = total + (m.shiftBy as u64); total = total - (if m.doAdd { 123 } else { 456 }); }