@@ -1072,11 +1072,13 @@ where
1072
1072
}
1073
1073
1074
1074
// When dropped, copies from `src` into `dest`.
1075
+ #[ cfg( not( no_global_oom_handling) ) ]
1075
1076
struct InsertionHole < T > {
1076
1077
src : * const T ,
1077
1078
dest : * mut T ,
1078
1079
}
1079
1080
1081
+ #[ cfg( not( no_global_oom_handling) ) ]
1080
1082
impl < T > Drop for InsertionHole < T > {
1081
1083
fn drop ( & mut self ) {
1082
1084
unsafe {
@@ -1398,6 +1400,7 @@ impl<T: IsCopyMarker> IsCopy for T {
1398
1400
}
1399
1401
1400
1402
#[ inline]
1403
+ #[ cfg( not( no_global_oom_handling) ) ]
1401
1404
fn qualifies_for_branchless_sort < T > ( ) -> bool {
1402
1405
// This is a heuristic, and as such it will guess wrong from time to time. The two parts broken
1403
1406
// down:
@@ -1416,6 +1419,7 @@ fn qualifies_for_branchless_sort<T>() -> bool {
1416
1419
1417
1420
/// Swap two values in array pointed to by a_ptr and b_ptr if b is less than a.
1418
1421
#[ inline]
1422
+ #[ cfg( not( no_global_oom_handling) ) ]
1419
1423
unsafe fn branchless_swap < T > ( a_ptr : * mut T , b_ptr : * mut T , should_swap : bool ) {
1420
1424
// This is a branchless version of swap if.
1421
1425
// The equivalent code with a branch would be:
@@ -1443,6 +1447,7 @@ unsafe fn branchless_swap<T>(a_ptr: *mut T, b_ptr: *mut T, should_swap: bool) {
1443
1447
1444
1448
/// Swap two values in array pointed to by a_ptr and b_ptr if b is less than a.
1445
1449
#[ inline]
1450
+ #[ cfg( not( no_global_oom_handling) ) ]
1446
1451
unsafe fn swap_if_less < T , F > ( arr_ptr : * mut T , a : usize , b : usize , is_less : & mut F )
1447
1452
where
1448
1453
F : FnMut ( & T , & T ) -> bool ,
@@ -1470,6 +1475,7 @@ where
1470
1475
/// Comparing and swapping anything but adjacent elements will yield a non stable sort.
1471
1476
/// So this must be fundamental building block for stable sorting networks.
1472
1477
#[ inline]
1478
+ #[ cfg( not( no_global_oom_handling) ) ]
1473
1479
unsafe fn swap_next_if_less < T , F > ( arr_ptr : * mut T , is_less : & mut F )
1474
1480
where
1475
1481
F : FnMut ( & T , & T ) -> bool ,
0 commit comments