diff --git a/src/test/run-pass/shift-near-oflo.rs b/src/test/run-pass/shift-near-oflo.rs index c656fc00fc272..4ff058f336661 100644 --- a/src/test/run-pass/shift-near-oflo.rs +++ b/src/test/run-pass/shift-near-oflo.rs @@ -26,18 +26,18 @@ fn test_left_shift() { macro_rules! tests { ($iN:ty, $uN:ty, $max_rhs:expr, $expect_i:expr, $expect_u:expr) => { { - let x = 1 as $iN << id(0); + let x = (1 as $iN) << id(0); assert_eq!(x, 1); - let x = 1 as $uN << id(0); + let x = (1 as $uN) << id(0); assert_eq!(x, 1); - let x = 1 as $iN << id($max_rhs); + let x = (1 as $iN) << id($max_rhs); assert_eq!(x, $expect_i); - let x = 1 as $uN << id($max_rhs); + let x = (1 as $uN) << id($max_rhs); assert_eq!(x, $expect_u); // high-order bits on LHS are silently discarded without panic. - let x = 3 as $iN << id($max_rhs); + let x = (3 as $iN) << id($max_rhs); assert_eq!(x, $expect_i); - let x = 3 as $uN << id($max_rhs); + let x = (3 as $uN) << id($max_rhs); assert_eq!(x, $expect_u); } } } @@ -71,23 +71,23 @@ fn test_right_shift() { ($iN:ty, $uN:ty, $max_rhs:expr, $signbit_i:expr, $highbit_i:expr, $highbit_u:expr) => { { - let x = 1 as $iN >> id(0); + let x = (1 as $iN) >> id(0); assert_eq!(x, 1); - let x = 1 as $uN >> id(0); + let x = (1 as $uN) >> id(0); assert_eq!(x, 1); - let x = $highbit_i >> id($max_rhs-1); + let x = ($highbit_i) >> id($max_rhs-1); assert_eq!(x, 1); - let x = $highbit_u >> id($max_rhs); + let x = ($highbit_u) >> id($max_rhs); assert_eq!(x, 1); // sign-bit is carried by arithmetic right shift - let x = $signbit_i >> id($max_rhs); + let x = ($signbit_i) >> id($max_rhs); assert_eq!(x, -1); // low-order bits on LHS are silently discarded without panic. - let x = $highbit_i + 1 >> id($max_rhs-1); + let x = ($highbit_i + 1) >> id($max_rhs-1); assert_eq!(x, 1); - let x = $highbit_u + 1 >> id($max_rhs); + let x = ($highbit_u + 1) >> id($max_rhs); assert_eq!(x, 1); - let x = $signbit_i + 1 >> id($max_rhs); + let x = ($signbit_i + 1) >> id($max_rhs); assert_eq!(x, -1); } } }