@@ -431,18 +431,18 @@ impl<T, A: AllocRef + Clone> RawTable<T, A> {
431
431
unsafe fn new_uninitialized (
432
432
alloc : A ,
433
433
buckets : usize ,
434
- fallability : Fallibility ,
434
+ fallibility : Fallibility ,
435
435
) -> Result < Self , TryReserveError > {
436
436
debug_assert ! ( buckets. is_power_of_two( ) ) ;
437
437
438
438
// Avoid `Option::ok_or_else` because it bloats LLVM IR.
439
439
let ( layout, ctrl_offset) = match calculate_layout :: < T > ( buckets) {
440
440
Some ( lco) => lco,
441
- None => return Err ( fallability . capacity_overflow ( ) ) ,
441
+ None => return Err ( fallibility . capacity_overflow ( ) ) ,
442
442
} ;
443
443
let ptr: NonNull < u8 > = match do_alloc ( & alloc, layout) {
444
444
Ok ( block) => block. cast ( ) ,
445
- Err ( _) => return Err ( fallability . alloc_err ( layout) ) ,
445
+ Err ( _) => return Err ( fallibility . alloc_err ( layout) ) ,
446
446
} ;
447
447
let ctrl = NonNull :: new_unchecked ( ptr. as_ptr ( ) . add ( ctrl_offset) ) ;
448
448
Ok ( Self {
@@ -460,7 +460,7 @@ impl<T, A: AllocRef + Clone> RawTable<T, A> {
460
460
fn fallible_with_capacity (
461
461
alloc : A ,
462
462
capacity : usize ,
463
- fallability : Fallibility ,
463
+ fallibility : Fallibility ,
464
464
) -> Result < Self , TryReserveError > {
465
465
if capacity == 0 {
466
466
Ok ( Self :: new_in ( alloc) )
@@ -469,9 +469,9 @@ impl<T, A: AllocRef + Clone> RawTable<T, A> {
469
469
// Avoid `Option::ok_or_else` because it bloats LLVM IR.
470
470
let buckets = match capacity_to_buckets ( capacity) {
471
471
Some ( buckets) => buckets,
472
- None => return Err ( fallability . capacity_overflow ( ) ) ,
472
+ None => return Err ( fallibility . capacity_overflow ( ) ) ,
473
473
} ;
474
- let result = Self :: new_uninitialized ( alloc, buckets, fallability ) ?;
474
+ let result = Self :: new_uninitialized ( alloc, buckets, fallibility ) ?;
475
475
result. ctrl ( 0 ) . write_bytes ( EMPTY , result. num_ctrl_bytes ( ) ) ;
476
476
477
477
Ok ( result)
@@ -794,12 +794,12 @@ impl<T, A: AllocRef + Clone> RawTable<T, A> {
794
794
& mut self ,
795
795
additional : usize ,
796
796
hasher : impl Fn ( & T ) -> u64 ,
797
- fallability : Fallibility ,
797
+ fallibility : Fallibility ,
798
798
) -> Result < ( ) , TryReserveError > {
799
799
// Avoid `Option::ok_or_else` because it bloats LLVM IR.
800
800
let new_items = match self . items . checked_add ( additional) {
801
801
Some ( new_items) => new_items,
802
- None => return Err ( fallability . capacity_overflow ( ) ) ,
802
+ None => return Err ( fallibility . capacity_overflow ( ) ) ,
803
803
} ;
804
804
let full_capacity = bucket_mask_to_capacity ( self . bucket_mask ) ;
805
805
if new_items <= full_capacity / 2 {
@@ -813,7 +813,7 @@ impl<T, A: AllocRef + Clone> RawTable<T, A> {
813
813
self . resize (
814
814
usize:: max ( new_items, full_capacity + 1 ) ,
815
815
hasher,
816
- fallability ,
816
+ fallibility ,
817
817
)
818
818
}
819
819
}
@@ -923,14 +923,14 @@ impl<T, A: AllocRef + Clone> RawTable<T, A> {
923
923
& mut self ,
924
924
capacity : usize ,
925
925
hasher : impl Fn ( & T ) -> u64 ,
926
- fallability : Fallibility ,
926
+ fallibility : Fallibility ,
927
927
) -> Result < ( ) , TryReserveError > {
928
928
unsafe {
929
929
debug_assert ! ( self . items <= capacity) ;
930
930
931
931
// Allocate and initialize the new table.
932
932
let mut new_table =
933
- Self :: fallible_with_capacity ( self . alloc . clone ( ) , capacity, fallability ) ?;
933
+ Self :: fallible_with_capacity ( self . alloc . clone ( ) , capacity, fallibility ) ?;
934
934
new_table. growth_left -= self . items ;
935
935
new_table. items = self . items ;
936
936
0 commit comments