From 953087fe4ee7df801b1a12c690baeb34299323cb Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 19 Sep 2017 14:00:51 -0700 Subject: [PATCH] Fix biguint assert_assign_op for rust 1.8 The `$op` only seems to be accepted when used indirectly through another macro, in this case `assert_eq`. How nice. --- bigint/src/tests/biguint.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bigint/src/tests/biguint.rs b/bigint/src/tests/biguint.rs index 39c31a0..c656575 100644 --- a/bigint/src/tests/biguint.rs +++ b/bigint/src/tests/biguint.rs @@ -29,11 +29,10 @@ macro_rules! assert_assign_op { ($left:ident $op:tt $right:ident == $expected:expr) => { { let mut tmp12384 = $left.clone(); - tmp12384 $op &$right; - assert_eq!(tmp12384, $expected); - tmp12384 = $left.clone(); - tmp12384 $op $right.clone(); - assert_eq!(tmp12384, $expected); + assert_eq!({ tmp12384 $op &$right; tmp12384}, $expected); + + let mut tmp12384 = $left.clone(); + assert_eq!({ tmp12384 $op $right.clone(); tmp12384}, $expected); } }; }