Skip to content

cleanup int suffixes in libcoretest #32186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/libcoretest/fmt/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand All @@ -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()
}
}
Expand Down Expand Up @@ -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()
}
}
Expand All @@ -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()
}
}
Expand Down Expand Up @@ -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()
}
}
Expand All @@ -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()
}
}
Expand Down Expand Up @@ -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()
}
}
Expand All @@ -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()
}
}
Expand Down Expand Up @@ -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()
}
}
Expand All @@ -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()
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/libcoretest/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)));
}
Expand Down Expand Up @@ -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));
Expand Down
8 changes: 4 additions & 4 deletions src/libcoretest/num/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/libcoretest/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ mod tests {

#[test]
fn test_leading_plus() {
assert_eq!("+127".parse::<u8>().ok(), Some(127u8));
assert_eq!("+9223372036854775807".parse::<i64>().ok(), Some(9223372036854775807i64));
assert_eq!("+127".parse::<u8>().ok(), Some(127));
assert_eq!("+9223372036854775807".parse::<i64>().ok(), Some(9223372036854775807));
}

#[test]
Expand Down
6 changes: 3 additions & 3 deletions src/libcoretest/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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));
}