Use usize::MAX as assoc const in liballoc
This commit is contained in:
parent
09b5d666a0
commit
e4fc04b6df
@ -608,7 +608,7 @@ fn drop(&mut self) {
|
||||
|
||||
#[inline]
|
||||
fn alloc_guard(alloc_size: usize) -> Result<(), TryReserveError> {
|
||||
if mem::size_of::<usize>() < 8 && alloc_size > core::isize::MAX as usize {
|
||||
if mem::size_of::<usize>() < 8 && alloc_size > isize::MAX as usize {
|
||||
Err(CapacityOverflow)
|
||||
} else {
|
||||
Ok(())
|
||||
|
@ -475,7 +475,7 @@ fn check<'a, L, R>(lhs: L, rhs: R)
|
||||
|
||||
#[test]
|
||||
fn test_range_inclusive_max_value() {
|
||||
let max = std::usize::MAX;
|
||||
let max = usize::MAX;
|
||||
let map: BTreeMap<_, _> = vec![(max, 0)].into_iter().collect();
|
||||
|
||||
assert_eq!(map.range(max..=max).collect::<Vec<_>>(), &[(&max, &0)]);
|
||||
|
Loading…
Reference in New Issue
Block a user