@@ -8,7 +8,7 @@ use core::ptr::{self, NonNull, Unique};
88use core:: slice;
99
1010use crate :: alloc:: { Alloc , Layout , Global , handle_alloc_error} ;
11- use crate :: collections:: CollectionAllocErr :: { self , * } ;
11+ use crate :: collections:: TryReserveError :: { self , * } ;
1212use crate :: boxed:: Box ;
1313
1414#[ cfg( test) ]
@@ -385,7 +385,7 @@ impl<T, A: Alloc> RawVec<T, A> {
385385
386386 /// The same as `reserve_exact`, but returns on errors instead of panicking or aborting.
387387 pub fn try_reserve_exact ( & mut self , used_capacity : usize , needed_extra_capacity : usize )
388- -> Result < ( ) , CollectionAllocErr > {
388+ -> Result < ( ) , TryReserveError > {
389389
390390 self . reserve_internal ( used_capacity, needed_extra_capacity, Fallible , Exact )
391391 }
@@ -422,7 +422,7 @@ impl<T, A: Alloc> RawVec<T, A> {
422422 /// needed_extra_capacity` elements. This logic is used in amortized reserve methods.
423423 /// Returns `(new_capacity, new_alloc_size)`.
424424 fn amortized_new_size ( & self , used_capacity : usize , needed_extra_capacity : usize )
425- -> Result < usize , CollectionAllocErr > {
425+ -> Result < usize , TryReserveError > {
426426
427427 // Nothing we can really do about these checks :(
428428 let required_cap = used_capacity. checked_add ( needed_extra_capacity)
@@ -435,7 +435,7 @@ impl<T, A: Alloc> RawVec<T, A> {
435435
436436 /// The same as `reserve`, but returns on errors instead of panicking or aborting.
437437 pub fn try_reserve ( & mut self , used_capacity : usize , needed_extra_capacity : usize )
438- -> Result < ( ) , CollectionAllocErr > {
438+ -> Result < ( ) , TryReserveError > {
439439 self . reserve_internal ( used_capacity, needed_extra_capacity, Fallible , Amortized )
440440 }
441441
@@ -640,7 +640,7 @@ impl<T, A: Alloc> RawVec<T, A> {
640640 needed_extra_capacity : usize ,
641641 fallibility : Fallibility ,
642642 strategy : ReserveStrategy ,
643- ) -> Result < ( ) , CollectionAllocErr > {
643+ ) -> Result < ( ) , TryReserveError > {
644644 unsafe {
645645 use crate :: alloc:: AllocErr ;
646646
@@ -737,7 +737,7 @@ unsafe impl<#[may_dangle] T, A: Alloc> Drop for RawVec<T, A> {
737737// all 4GB in user-space. e.g., PAE or x32
738738
739739#[ inline]
740- fn alloc_guard ( alloc_size : usize ) -> Result < ( ) , CollectionAllocErr > {
740+ fn alloc_guard ( alloc_size : usize ) -> Result < ( ) , TryReserveError > {
741741 if mem:: size_of :: < usize > ( ) < 8 && alloc_size > core:: isize:: MAX as usize {
742742 Err ( CapacityOverflow )
743743 } else {
0 commit comments