From: Josh Stone Date: Mon, 30 Jul 2018 20:08:56 +0000 (-0700) Subject: run-pass/const-endianness: negate before to_le() X-Git-Tag: archive/raspbian/1.29.0+dfsg1-1+rpi1~1^2~18 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fe25648edc07f0bb7cbad13853a3dcb0a5fd37e1;p=rustc.git 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. Gbp-Pq: Name u-rust-52876-const-endianess.patch --- diff --git a/src/test/run-pass/const-endianess.rs b/src/test/run-pass/const-endianess.rs index fa34b49210..95c738d3ec 100644 --- a/src/test/run-pass/const-endianess.rs +++ b/src/test/run-pass/const-endianess.rs @@ -25,7 +25,7 @@ fn main() { #[cfg(not(target_arch = "asmjs"))] { const BE_U128: u128 = 999999u128.to_be(); - const LE_I128: i128 = -999999i128.to_le(); + const LE_I128: i128 = (-999999i128).to_le(); assert_eq!(BE_U128, b(999999u128).to_be()); assert_eq!(LE_I128, b(-999999i128).to_le()); }