diff --git a/src/libcoretest/fmt/builders.rs b/src/libcoretest/fmt/builders.rs index 885ee3f9c3be2..e71e61bda5efd 100644 --- a/src/libcoretest/fmt/builders.rs +++ b/src/libcoretest/fmt/builders.rs @@ -53,7 +53,7 @@ mod debug_struct { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("Foo") .field("bar", &true) - .field("baz", &format_args!("{}/{}", 10i32, 20i32)) + .field("baz", &format_args!("{}/{}", 10, 20)) .finish() } } @@ -75,7 +75,7 @@ mod debug_struct { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("Foo") .field("bar", &true) - .field("baz", &format_args!("{}/{}", 10i32, 20i32)) + .field("baz", &format_args!("{}/{}", 10, 20)) .finish() } } @@ -150,7 +150,7 @@ mod debug_tuple { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_tuple("Foo") .field(&true) - .field(&format_args!("{}/{}", 10i32, 20i32)) + .field(&format_args!("{}/{}", 10, 20)) .finish() } } @@ -172,7 +172,7 @@ mod debug_tuple { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_tuple("Foo") .field(&true) - .field(&format_args!("{}/{}", 10i32, 20i32)) + .field(&format_args!("{}/{}", 10, 20)) .finish() } } @@ -247,7 +247,7 @@ mod debug_map { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_map() .entry(&"bar", &true) - .entry(&10i32, &format_args!("{}/{}", 10i32, 20i32)) + .entry(&10, &format_args!("{}/{}", 10, 20)) .finish() } } @@ -269,7 +269,7 @@ mod debug_map { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_map() .entry(&"bar", &true) - .entry(&10i32, &format_args!("{}/{}", 10i32, 20i32)) + .entry(&10, &format_args!("{}/{}", 10, 20)) .finish() } } @@ -348,7 +348,7 @@ mod debug_set { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_set() .entry(&true) - .entry(&format_args!("{}/{}", 10i32, 20i32)) + .entry(&format_args!("{}/{}", 10, 20)) .finish() } } @@ -370,7 +370,7 @@ mod debug_set { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_set() .entry(&true) - .entry(&format_args!("{}/{}", 10i32, 20i32)) + .entry(&format_args!("{}/{}", 10, 20)) .finish() } } @@ -445,7 +445,7 @@ mod debug_list { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_list() .entry(&true) - .entry(&format_args!("{}/{}", 10i32, 20i32)) + .entry(&format_args!("{}/{}", 10, 20)) .finish() } } @@ -467,7 +467,7 @@ mod debug_list { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_list() .entry(&true) - .entry(&format_args!("{}/{}", 10i32, 20i32)) + .entry(&format_args!("{}/{}", 10, 20)) .finish() } } diff --git a/src/libcoretest/iter.rs b/src/libcoretest/iter.rs index acdced6492816..6c0cb03b5f775 100644 --- a/src/libcoretest/iter.rs +++ b/src/libcoretest/iter.rs @@ -677,7 +677,7 @@ fn test_rev() { #[test] fn test_cloned() { - let xs = [2u8, 4, 6, 8]; + let xs = [2, 4, 6, 8]; let mut it = xs.iter().cloned(); assert_eq!(it.len(), 4); @@ -861,8 +861,8 @@ fn test_range() { assert_eq!((-10..-1).size_hint(), (9, Some(9))); assert_eq!((-1..-10).size_hint(), (0, Some(0))); - assert_eq!((-70..58i8).size_hint(), (128, Some(128))); - assert_eq!((-128..127i8).size_hint(), (255, Some(255))); + assert_eq!((-70..58).size_hint(), (128, Some(128))); + assert_eq!((-128..127).size_hint(), (255, Some(255))); assert_eq!((-2..isize::MAX).size_hint(), (isize::MAX as usize + 2, Some(isize::MAX as usize + 2))); } @@ -1013,7 +1013,7 @@ fn bench_max_by_key2(b: &mut Bencher) { array.iter().enumerate().max_by_key(|&(_, item)| item).unwrap().0 } - let mut data = vec![0i32; 1638]; + let mut data = vec![0; 1638]; data[514] = 9999; b.iter(|| max_index_iter(&data)); diff --git a/src/libcoretest/num/int_macros.rs b/src/libcoretest/num/int_macros.rs index afcf836ad10f5..8d791283ab87e 100644 --- a/src/libcoretest/num/int_macros.rs +++ b/src/libcoretest/num/int_macros.rs @@ -208,11 +208,11 @@ mod tests { fn test_pow() { let mut r = 2 as $T; - assert_eq!(r.pow(2u32), 4 as $T); - assert_eq!(r.pow(0u32), 1 as $T); + assert_eq!(r.pow(2), 4 as $T); + assert_eq!(r.pow(0), 1 as $T); r = -2 as $T; - assert_eq!(r.pow(2u32), 4 as $T); - assert_eq!(r.pow(3u32), -8 as $T); + assert_eq!(r.pow(2), 4 as $T); + assert_eq!(r.pow(3), -8 as $T); } } diff --git a/src/libcoretest/num/mod.rs b/src/libcoretest/num/mod.rs index fba56db32bb4c..11c1bd667fb36 100644 --- a/src/libcoretest/num/mod.rs +++ b/src/libcoretest/num/mod.rs @@ -99,8 +99,8 @@ mod tests { #[test] fn test_leading_plus() { - assert_eq!("+127".parse::().ok(), Some(127u8)); - assert_eq!("+9223372036854775807".parse::().ok(), Some(9223372036854775807i64)); + assert_eq!("+127".parse::().ok(), Some(127)); + assert_eq!("+9223372036854775807".parse::().ok(), Some(9223372036854775807)); } #[test] diff --git a/src/libcoretest/option.rs b/src/libcoretest/option.rs index 3e564cf197061..51b0655f680f6 100644 --- a/src/libcoretest/option.rs +++ b/src/libcoretest/option.rs @@ -251,7 +251,7 @@ fn test_collect() { #[test] fn test_cloned() { - let val = 1u32; + let val = 1; let val_ref = &val; let opt_none: Option<&'static u32> = None; let opt_ref = Some(&val); @@ -263,10 +263,10 @@ fn test_cloned() { // Immutable ref works assert_eq!(opt_ref.clone(), Some(&val)); - assert_eq!(opt_ref.cloned(), Some(1u32)); + assert_eq!(opt_ref.cloned(), Some(1)); // Double Immutable ref works assert_eq!(opt_ref_ref.clone(), Some(&val_ref)); assert_eq!(opt_ref_ref.clone().cloned(), Some(&val)); - assert_eq!(opt_ref_ref.cloned().cloned(), Some(1u32)); + assert_eq!(opt_ref_ref.cloned().cloned(), Some(1)); }