mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-05 11:33:04 +00:00
Use usize::MAX as assoc const in liballoc
This commit is contained in:
parent
09b5d666a0
commit
e4fc04b6df
@ -608,7 +608,7 @@ unsafe impl<#[may_dangle] T, A: AllocRef> Drop for RawVec<T, A> {
|
||||
|
||||
#[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 test_range_large() {
|
||||
|
||||
#[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