Skip to content

Commit 1ea2765

Browse files
committedJul 30, 2018
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.
1 parent 54628c8 commit 1ea2765

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)
Please sign in to comment.