Skip to content

Commit

Permalink
Use usize::MAX as assoc const in liballoc
Browse files Browse the repository at this point in the history
  • Loading branch information
faern committed Apr 6, 2020
1 parent 09b5d66 commit e4fc04b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/liballoc/raw_vec.rs
Expand Up @@ -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(())
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/tests/btree/map.rs
Expand Up @@ -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)]);
Expand Down

0 comments on commit e4fc04b

Please sign in to comment.