Skip to content

Commit 4f67850

Browse files
committed
Fix test for 32-bit targets.
(The cast from the 64-bit value to isize was using the lower 32-bits, which led to it being treated as a large positive value rather than a smallish negative one. The fix was to use the same bits for the upper- and lower- 32 bits.)
1 parent 0610ee4 commit 4f67850

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/test/run-pass/wrapping-int-api.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ fn main() {
101101
check_mul_no_wrap!(0xfedc_u16 as i16, -2);
102102
check_mul_no_wrap!(0xfedc_ba98_u32 as i32, -2);
103103
check_mul_no_wrap!(0xfedc_ba98_7654_3217_u64 as i64, -2);
104-
check_mul_no_wrap!(0xfedc_ba98_7654_3217_u64 as u64 as isize, -2);
104+
check_mul_no_wrap!(0xfedc_ba98_fedc_ba98_u64 as u64 as isize, -2);
105105

106106
check_mul_no_wrap!(0xfe_u8 as i8, 2);
107107
check_mul_no_wrap!(0xfedc_u16 as i16, 2);
108108
check_mul_no_wrap!(0xfedc_ba98_u32 as i32, 2);
109109
check_mul_no_wrap!(0xfedc_ba98_7654_3217_u64 as i64, 2);
110-
check_mul_no_wrap!(0xfedc_ba98_7654_3217_u64 as u64 as isize, 2);
110+
check_mul_no_wrap!(0xfedc_ba98_fedc_ba98_u64 as u64 as isize, 2);
111111

112112
check_mul_wraps!(0x80_u8 as i8, -1);
113113
check_mul_wraps!(0x8000_u16 as i16, -1);

0 commit comments

Comments
 (0)