@@ -8,7 +8,7 @@ use core::ptr::{self, NonNull, Unique};
8
8
use core:: slice;
9
9
10
10
use crate :: alloc:: { Alloc , Layout , Global , handle_alloc_error} ;
11
- use crate :: collections:: CollectionAllocErr :: { self , * } ;
11
+ use crate :: collections:: TryReserveError :: { self , * } ;
12
12
use crate :: boxed:: Box ;
13
13
14
14
#[ cfg( test) ]
@@ -385,7 +385,7 @@ impl<T, A: Alloc> RawVec<T, A> {
385
385
386
386
/// The same as `reserve_exact`, but returns on errors instead of panicking or aborting.
387
387
pub fn try_reserve_exact ( & mut self , used_capacity : usize , needed_extra_capacity : usize )
388
- -> Result < ( ) , CollectionAllocErr > {
388
+ -> Result < ( ) , TryReserveError > {
389
389
390
390
self . reserve_internal ( used_capacity, needed_extra_capacity, Fallible , Exact )
391
391
}
@@ -422,7 +422,7 @@ impl<T, A: Alloc> RawVec<T, A> {
422
422
/// needed_extra_capacity` elements. This logic is used in amortized reserve methods.
423
423
/// Returns `(new_capacity, new_alloc_size)`.
424
424
fn amortized_new_size ( & self , used_capacity : usize , needed_extra_capacity : usize )
425
- -> Result < usize , CollectionAllocErr > {
425
+ -> Result < usize , TryReserveError > {
426
426
427
427
// Nothing we can really do about these checks :(
428
428
let required_cap = used_capacity. checked_add ( needed_extra_capacity)
@@ -435,7 +435,7 @@ impl<T, A: Alloc> RawVec<T, A> {
435
435
436
436
/// The same as `reserve`, but returns on errors instead of panicking or aborting.
437
437
pub fn try_reserve ( & mut self , used_capacity : usize , needed_extra_capacity : usize )
438
- -> Result < ( ) , CollectionAllocErr > {
438
+ -> Result < ( ) , TryReserveError > {
439
439
self . reserve_internal ( used_capacity, needed_extra_capacity, Fallible , Amortized )
440
440
}
441
441
@@ -640,7 +640,7 @@ impl<T, A: Alloc> RawVec<T, A> {
640
640
needed_extra_capacity : usize ,
641
641
fallibility : Fallibility ,
642
642
strategy : ReserveStrategy ,
643
- ) -> Result < ( ) , CollectionAllocErr > {
643
+ ) -> Result < ( ) , TryReserveError > {
644
644
unsafe {
645
645
use crate :: alloc:: AllocErr ;
646
646
@@ -737,7 +737,7 @@ unsafe impl<#[may_dangle] T, A: Alloc> Drop for RawVec<T, A> {
737
737
// all 4GB in user-space. e.g., PAE or x32
738
738
739
739
#[ inline]
740
- fn alloc_guard ( alloc_size : usize ) -> Result < ( ) , CollectionAllocErr > {
740
+ fn alloc_guard ( alloc_size : usize ) -> Result < ( ) , TryReserveError > {
741
741
if mem:: size_of :: < usize > ( ) < 8 && alloc_size > core:: isize:: MAX as usize {
742
742
Err ( CapacityOverflow )
743
743
} else {
0 commit comments