From e4fc04b6df93785e935ec776705803e6b50e2c23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20F=C3=A4rnstrand?= Date: Mon, 6 Apr 2020 23:07:38 +0200 Subject: [PATCH] Use usize::MAX as assoc const in liballoc --- src/liballoc/raw_vec.rs | 2 +- src/liballoc/tests/btree/map.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/liballoc/raw_vec.rs b/src/liballoc/raw_vec.rs index 7ac67870eb7..0780b33e53a 100644 --- a/src/liballoc/raw_vec.rs +++ b/src/liballoc/raw_vec.rs @@ -608,7 +608,7 @@ fn drop(&mut self) { #[inline] fn alloc_guard(alloc_size: usize) -> Result<(), TryReserveError> { - if mem::size_of::() < 8 && alloc_size > core::isize::MAX as usize { + if mem::size_of::() < 8 && alloc_size > isize::MAX as usize { Err(CapacityOverflow) } else { Ok(()) diff --git a/src/liballoc/tests/btree/map.rs b/src/liballoc/tests/btree/map.rs index 14f12ca2d77..96b6c32a1fa 100644 --- a/src/liballoc/tests/btree/map.rs +++ b/src/liballoc/tests/btree/map.rs @@ -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::>(), &[(&max, &0)]);