clean up unused macros
This commit is contained in:
parent
2a9750ada4
commit
2f8f952d1d
|
@ -1,3 +1,5 @@
|
|||
#![allow(unknown_lints)] // older rustc doesn't know `unused_macros`
|
||||
#![allow(unused_macros)]
|
||||
|
||||
macro_rules! forward_val_val_binop {
|
||||
(impl $imp:ident for $res:ty, $method:ident) => {
|
||||
|
|
|
@ -77,17 +77,17 @@ for_each_tuple!(bounded_tuple);
|
|||
bounded_impl!(f64, f64::MIN, f64::MAX);
|
||||
|
||||
|
||||
macro_rules! test_wrapping_bounded {
|
||||
#[test]
|
||||
fn wrapping_bounded() {
|
||||
macro_rules! test_wrapping_bounded {
|
||||
($($t:ty)+) => {
|
||||
$(
|
||||
assert_eq!(Wrapping::<$t>::min_value().0, <$t>::min_value());
|
||||
assert_eq!(Wrapping::<$t>::max_value().0, <$t>::max_value());
|
||||
)+
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn wrapping_bounded() {
|
||||
test_wrapping_bounded!(usize u8 u16 u32 u64 isize i8 i16 i32 i64);
|
||||
}
|
||||
|
||||
|
|
|
@ -466,7 +466,9 @@ fn to_primitive_float() {
|
|||
assert!((f64::NAN).to_f32().map_or(false, |f| f.is_nan()));
|
||||
}
|
||||
|
||||
macro_rules! test_wrapping_to_primitive {
|
||||
#[test]
|
||||
fn wrapping_to_primitive() {
|
||||
macro_rules! test_wrapping_to_primitive {
|
||||
($($t:ty)+) => {
|
||||
$({
|
||||
let i: $t = 0;
|
||||
|
@ -485,10 +487,8 @@ macro_rules! test_wrapping_to_primitive {
|
|||
assert_eq!(i.to_f64(), w.to_f64());
|
||||
})+
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn wrapping_to_primitive() {
|
||||
test_wrapping_to_primitive!(usize u8 u16 u32 u64 isize i8 i16 i32 i64);
|
||||
}
|
||||
|
||||
|
|
|
@ -120,7 +120,9 @@ impl<T: One> One for Wrapping<T> where Wrapping<T>: Mul<Output=Wrapping<T>> {
|
|||
#[inline(always)] pub fn one<T: One>() -> T { One::one() }
|
||||
|
||||
|
||||
macro_rules! test_wrapping_identities {
|
||||
#[test]
|
||||
fn wrapping_identities() {
|
||||
macro_rules! test_wrapping_identities {
|
||||
($($t:ty)+) => {
|
||||
$(
|
||||
assert_eq!(zero::<$t>(), zero::<Wrapping<$t>>().0);
|
||||
|
@ -129,10 +131,8 @@ macro_rules! test_wrapping_identities {
|
|||
assert_eq!((1 as $t).is_zero(), Wrapping(1 as $t).is_zero());
|
||||
)+
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn wrapping_identities() {
|
||||
test_wrapping_identities!(isize i8 i16 i32 i64 usize u8 u16 u32 u64);
|
||||
}
|
||||
|
||||
|
|
|
@ -361,7 +361,16 @@ fn from_str_radix_unwrap() {
|
|||
assert_eq!(f, 0.0);
|
||||
}
|
||||
|
||||
macro_rules! test_wrapping_from_str_radix {
|
||||
#[test]
|
||||
fn wrapping_is_num() {
|
||||
fn require_num<T: Num>(_: &T) {}
|
||||
require_num(&Wrapping(42_u32));
|
||||
require_num(&Wrapping(-42));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn wrapping_from_str_radix() {
|
||||
macro_rules! test_wrapping_from_str_radix {
|
||||
($($t:ty)+) => {
|
||||
$(
|
||||
for &(s, r) in &[("42", 10), ("42", 2), ("-13.0", 10), ("foo", 10)] {
|
||||
|
@ -370,15 +379,8 @@ macro_rules! test_wrapping_from_str_radix {
|
|||
}
|
||||
)+
|
||||
};
|
||||
}
|
||||
#[test]
|
||||
fn wrapping_is_num() {
|
||||
fn require_num<T: Num>(_: &T) {}
|
||||
require_num(&Wrapping(42_u32));
|
||||
require_num(&Wrapping(-42));
|
||||
}
|
||||
#[test]
|
||||
fn wrapping_from_str_radix() {
|
||||
}
|
||||
|
||||
test_wrapping_from_str_radix!(usize u8 u16 u32 u64 isize i8 i16 i32 i64);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue