rust/library/core/src
bors 363ae41883 Auto merge of #129587 - Voultapher:opt-for-size-variants-of-sort-impls, r=cuviper
Add `optimize_for_size` variants for stable and unstable sort as well as select_nth_unstable

- Stable sort uses a simple merge-sort that re-uses the existing - rather gnarly - merge function.
- Unstable sort jumps directly to the branchless heapsort fallback.
- select_nth_unstable jumps directly to the median_of_medians fallback, which is augmented with a custom tiny smallsort and partition impl.

Some code is duplicated but de-duplication would bring it's own problems. For example `swap_if_less` is critical for performance, if the sorting networks don't inline it perf drops drastically, however `#[inline(always)]` is also a poor fit, if the provided comparison function is huge, it gives the compiler an out to only instantiate `swap_if_less` once and call it. Another aspect that would suffer when making `swap_if_less` pub, is having to cfg out dozens of functions in in smallsort module.

Part of https://github.com/rust-lang/rust/issues/125612

r​? `@Kobzol`
2024-09-24 18:48:08 +00:00
..
alloc Take more advantage of the isize::MAX limit in Layout 2024-09-17 20:05:57 -07:00
array Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
ascii Use assert_unsafe_precondition! in AsciiChar::digit_unchecked 2024-08-21 16:26:35 -04:00
async_iter Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
cell Rollup merge of #130476 - workingjubilee:more-lazy-methods-take-2, r=Amanieu 2024-09-18 14:32:26 -07:00
char Rollup merge of #130713 - bjoernager:const-char-make-ascii, r=Noratrieb 2024-09-23 06:45:35 +02:00
clone CloneToUninit: use a private specialization trait 2024-07-29 20:44:43 +03:00
cmp Use generic NonZero everywhere in core. 2024-02-22 15:17:33 +01:00
convert Fix doc nits 2024-07-26 13:26:33 +01:00
ffi Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
fmt Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
future Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
hash Reformat use declarations. 2024-07-29 08:26:52 +10:00
intrinsics simd_shuffle: require index argument to be a vector 2024-09-14 14:43:24 +02:00
io Fix doc nits 2024-07-26 13:26:33 +01:00
iter Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
macros Fixed more typos in library/core 2024-08-31 14:57:38 +09:00
mem run x.py fmt 2024-09-18 20:49:53 -07:00
net Rollup merge of #128641 - Konippi:standardize-duplicate-processes-in-parser, r=scottmcm 2024-09-01 03:58:03 +02:00
num Rollup merge of #130713 - bjoernager:const-char-make-ascii, r=Noratrieb 2024-09-23 06:45:35 +02:00
ops Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
panic Auto merge of #129491 - StackOverflowExcept1on:master, r=m-ou-se 2024-09-18 11:57:31 +00:00
prelude Avoid comments that describe multiple use items. 2024-07-17 08:02:46 +10:00
ptr stabilize const_intrinsic_copy 2024-09-23 22:12:54 +02:00
range Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
slice Auto merge of #129587 - Voultapher:opt-for-size-variants-of-sort-impls, r=cuviper 2024-09-24 18:48:08 +00:00
str Mark and implement 'make_ascii_uppercase' and 'make_ascii_lowercase' in '[u8]' and 'str' as const; 2024-09-24 08:50:40 +02:00
sync compiler_fence documentation: emphasize synchronization, not reordering 2024-09-01 16:58:44 +02:00
task Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
unicode Rollup merge of #130101 - RalfJung:const-cleanup, r=fee1-dead 2024-09-12 19:03:41 +02:00
any.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
arch.rs Rollup merge of #130146 - folkertdev:bootstrap-naked-asm, r=Amanieu 2024-09-09 19:20:38 -07:00
ascii.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
asserting.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
bool.rs [Clippy] Swap filter_map_bool_then to use diagnostic item instead of path 2024-09-19 13:13:42 +01:00
borrow.rs Suggest borrowing on fn argument that is impl AsRef 2024-05-09 23:25:31 +00:00
cell.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
clone.rs update cfgs 2024-09-05 17:24:01 +01:00
cmp.rs Remove uneeded PartialOrd bound in cmp::Ord::clamp 2024-09-17 21:16:12 +02:00
default.rs update cfgs 2024-09-05 17:24:01 +01:00
error.md Mention core's PanicInfo in error.md. 2024-06-11 15:47:00 +02:00
error.rs Remove cfg(test) from library/core 2024-08-25 20:04:26 -04:00
escape.rs Remove feature(effects) from the standard library 2024-06-21 09:23:24 +00:00
hint.rs add extra linebreaks so rustdoc can identify the first sentence 2024-09-01 14:22:50 -07:00
internal_macros.rs Fix doc nits 2024-07-26 13:26:33 +01:00
intrinsics.rs stabilize const_intrinsic_copy 2024-09-23 22:12:54 +02:00
lib.miri.rs add 'x.py miri', and make it work for 'library/{core,alloc,std}' 2024-04-03 20:27:20 +02:00
lib.rs Auto merge of #130738 - bjoernager:const-make-ascii, r=jhpratt 2024-09-24 08:52:12 +00:00
marker.rs Auto merge of #129941 - BoxyUwU:bump-boostrap, r=albertlarsan68 2024-09-07 20:37:30 +00:00
option.rs make unstable Result::flatten a const fn 2024-09-22 08:40:25 +02:00
panic.rs simplify abort_unwind 2024-09-15 14:27:24 -04:00
panicking.rs Auto merge of #129491 - StackOverflowExcept1on:master, r=m-ou-se 2024-09-18 11:57:31 +00:00
pat.rs Add tracking issue to core-pattern-type 2024-08-07 20:43:05 -04:00
pin.rs update cfgs 2024-09-05 17:24:01 +01:00
primitive.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
primitive_docs.rs ABI compatibility: mention Result guarantee 2024-09-21 09:17:31 +02:00
random.rs random: add tracking issue, address other comments 2024-09-23 10:36:16 +02:00
range.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
result.rs make unstable Result::flatten a const fn 2024-09-22 08:40:25 +02:00
time.rs add FIXME(const-hack) 2024-09-08 23:08:40 +02:00
tuple.rs update cfgs 2024-09-05 17:24:01 +01:00
ub_checks.rs Change assert_unsafe_precondition docs to refer to check_language_ub 2024-08-21 17:35:54 -04:00
unit.rs Import the 2021 prelude in the core crate 2024-03-25 13:12:06 -07:00