Skip to content

Commit 378c638

Browse files
Rollup merge of #52876 - cuviper:const-endianness-be, r=kennytm
run-pass/const-endianness: negate before to_le() `const LE_I128` needs parentheses to negate the value *before* calling `to_le()`, otherwise it doesn't match the operations performed in the black-boxed part of the test. This only makes a tangible difference on big-endian targets.
2 parents 50e7fdd + 1ea2765 commit 378c638

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/test/run-pass/const-endianess.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn main() {
2525
#[cfg(not(target_arch = "asmjs"))]
2626
{
2727
const BE_U128: u128 = 999999u128.to_be();
28-
const LE_I128: i128 = -999999i128.to_le();
28+
const LE_I128: i128 = (-999999i128).to_le();
2929
assert_eq!(BE_U128, b(999999u128).to_be());
3030
assert_eq!(LE_I128, b(-999999i128).to_le());
3131
}

0 commit comments

Comments
 (0)