Attempt to work around E0425 in test macros on Rust 1.8

This commit is contained in:
Yoan Lecoq 2017-04-30 10:33:35 +02:00
parent 3f6ea76e60
commit 3896c64dc7
2 changed files with 4 additions and 4 deletions

View File

@ -468,7 +468,7 @@ fn to_primitive_float() {
macro_rules! test_wrapping_to_primitive {
($($t:ty)+) => {
$(
$({
let i: $t = 0;
let w = Wrapping(i);
assert_eq!(i.to_u8(), w.to_u8());
@ -483,7 +483,7 @@ macro_rules! test_wrapping_to_primitive {
assert_eq!(i.to_isize(), w.to_isize());
assert_eq!(i.to_f32(), w.to_f32());
assert_eq!(i.to_f64(), w.to_f64());
)+
})+
};
}

View File

@ -190,7 +190,7 @@ impl<T: Unsigned> Unsigned for Wrapping<T> where Wrapping<T>: Num {}
macro_rules! test_signed_wrapping {
($($t:ty)+) => {
$(
$({
let range = -1 as $t .. 2 as $t;
for i in range.clone() {
let w = Wrapping(i);
@ -202,7 +202,7 @@ macro_rules! test_signed_wrapping {
assert_eq!(i.is_positive(), w.is_positive());
assert_eq!(i.is_negative(), w.is_negative());
}
)+
})+
};
}