Skip to content

Commit 3e4396b

Browse files
committed
Use integer assoc consts in libcore
1 parent e4fc04b commit 3e4396b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/libcore/tests/slice.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1108,14 +1108,14 @@ mod slice_index {
11081108

11091109
// note: using 0 specifically ensures that the result of overflowing is 0..0,
11101110
// so that `get` doesn't simply return None for the wrong reason.
1111-
bad: data[0 ..= ::std::usize::MAX];
1111+
bad: data[0 ..= usize::MAX];
11121112
message: "maximum usize";
11131113
}
11141114

11151115
in mod rangetoinclusive_overflow {
11161116
data: [0, 1];
11171117

1118-
bad: data[..= ::std::usize::MAX];
1118+
bad: data[..= usize::MAX];
11191119
message: "maximum usize";
11201120
}
11211121
} // panic_cases!

src/libcore/tests/time.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn creation() {
1414
#[test]
1515
#[should_panic]
1616
fn new_overflow() {
17-
let _ = Duration::new(::core::u64::MAX, 1_000_000_000);
17+
let _ = Duration::new(u64::MAX, 1_000_000_000);
1818
}
1919

2020
#[test]
@@ -86,7 +86,7 @@ fn checked_add() {
8686
Duration::new(0, 500_000_000).checked_add(Duration::new(0, 500_000_001)),
8787
Some(Duration::new(1, 1))
8888
);
89-
assert_eq!(Duration::new(1, 0).checked_add(Duration::new(::core::u64::MAX, 0)), None);
89+
assert_eq!(Duration::new(1, 0).checked_add(Duration::new(u64::MAX, 0)), None);
9090
}
9191

9292
#[test]
@@ -133,7 +133,7 @@ fn checked_mul() {
133133
assert_eq!(Duration::new(1, 1).checked_mul(3), Some(Duration::new(3, 3)));
134134
assert_eq!(Duration::new(0, 500_000_001).checked_mul(4), Some(Duration::new(2, 4)));
135135
assert_eq!(Duration::new(0, 500_000_001).checked_mul(4000), Some(Duration::new(2000, 4000)));
136-
assert_eq!(Duration::new(::core::u64::MAX - 1, 0).checked_mul(2), None);
136+
assert_eq!(Duration::new(u64::MAX - 1, 0).checked_mul(2), None);
137137
}
138138

139139
#[test]

0 commit comments

Comments
 (0)