@@ -26,18 +26,18 @@ fn test_left_shift() {
26
26
27
27
macro_rules! tests {
28
28
( $iN: ty, $uN: ty, $max_rhs: expr, $expect_i: expr, $expect_u: expr) => { {
29
- let x = 1 as $iN << id( 0 ) ;
29
+ let x = ( 1 as $iN) << id( 0 ) ;
30
30
assert_eq!( x, 1 ) ;
31
- let x = 1 as $uN << id( 0 ) ;
31
+ let x = ( 1 as $uN) << id( 0 ) ;
32
32
assert_eq!( x, 1 ) ;
33
- let x = 1 as $iN << id( $max_rhs) ;
33
+ let x = ( 1 as $iN) << id( $max_rhs) ;
34
34
assert_eq!( x, $expect_i) ;
35
- let x = 1 as $uN << id( $max_rhs) ;
35
+ let x = ( 1 as $uN) << id( $max_rhs) ;
36
36
assert_eq!( x, $expect_u) ;
37
37
// high-order bits on LHS are silently discarded without panic.
38
- let x = 3 as $iN << id( $max_rhs) ;
38
+ let x = ( 3 as $iN) << id( $max_rhs) ;
39
39
assert_eq!( x, $expect_i) ;
40
- let x = 3 as $uN << id( $max_rhs) ;
40
+ let x = ( 3 as $uN) << id( $max_rhs) ;
41
41
assert_eq!( x, $expect_u) ;
42
42
} }
43
43
}
@@ -71,23 +71,23 @@ fn test_right_shift() {
71
71
( $iN: ty, $uN: ty, $max_rhs: expr,
72
72
$signbit_i: expr, $highbit_i: expr, $highbit_u: expr) =>
73
73
{ {
74
- let x = 1 as $iN >> id( 0 ) ;
74
+ let x = ( 1 as $iN) >> id( 0 ) ;
75
75
assert_eq!( x, 1 ) ;
76
- let x = 1 as $uN >> id( 0 ) ;
76
+ let x = ( 1 as $uN) >> id( 0 ) ;
77
77
assert_eq!( x, 1 ) ;
78
- let x = $highbit_i >> id( $max_rhs-1 ) ;
78
+ let x = ( $highbit_i) >> id( $max_rhs-1 ) ;
79
79
assert_eq!( x, 1 ) ;
80
- let x = $highbit_u >> id( $max_rhs) ;
80
+ let x = ( $highbit_u) >> id( $max_rhs) ;
81
81
assert_eq!( x, 1 ) ;
82
82
// sign-bit is carried by arithmetic right shift
83
- let x = $signbit_i >> id( $max_rhs) ;
83
+ let x = ( $signbit_i) >> id( $max_rhs) ;
84
84
assert_eq!( x, -1 ) ;
85
85
// low-order bits on LHS are silently discarded without panic.
86
- let x = $highbit_i + 1 >> id( $max_rhs-1 ) ;
86
+ let x = ( $highbit_i + 1 ) >> id( $max_rhs-1 ) ;
87
87
assert_eq!( x, 1 ) ;
88
- let x = $highbit_u + 1 >> id( $max_rhs) ;
88
+ let x = ( $highbit_u + 1 ) >> id( $max_rhs) ;
89
89
assert_eq!( x, 1 ) ;
90
- let x = $signbit_i + 1 >> id( $max_rhs) ;
90
+ let x = ( $signbit_i + 1 ) >> id( $max_rhs) ;
91
91
assert_eq!( x, -1 ) ;
92
92
} }
93
93
}
0 commit comments