rust/library/core/src/slice
Michael Goulet 68b390ae2a
Rollup merge of #104672 - Voultapher:unify-sort-modules, r=thomcc
Unify stable and unstable sort implementations in same core module

This moves the stable sort implementation to the core::slice::sort module. By virtue of being in core it can't access `Vec`. The two `Vec` used by merge sort, `buf` and `runs`, are modelled as custom types that implement the very limited required `Vec` interface with the help of provided allocation and free functions. This is done to allow future re-use of functions and logic between stable and unstable sort. Such as `insert_head`.

This is in preparation of #100856 and #104116. It only moves code, it *doesn't* change any of the sort related logic. This unlocks the ability to share `insert_head`, `insert_tail`, `swap_if_less` `merge` and more.

Tagging ````@Mark-Simulacrum```` I hope this allows progress on #100856, by moving `merge_sort` here I hope future changes will be easier to review.
2023-01-20 21:33:21 -05:00
..
iter replace manual ptr arithmetic with ptr_sub 2023-01-15 17:38:05 +01:00
ascii.rs EscapeAscii is not an ExactSizeIterator 2022-07-29 00:35:38 +00:00
cmp.rs make memcmp return a value of c_int_width instead of i32 2022-04-02 17:21:08 -07:00
index.rs Adjust inlining attributes around panic_immediate_abort 2022-11-29 09:24:01 -05:00
iter.rs replace manual ptr arithmetic with ptr_sub 2023-01-15 17:38:05 +01:00
memchr.rs Rollup merge of #100823 - WaffleLapkin:less_offsets, r=scottmcm 2022-09-24 14:29:52 +02:00
mod.rs Rollup merge of #104672 - Voultapher:unify-sort-modules, r=thomcc 2023-01-20 21:33:21 -05:00
raw.rs Print the precondition we violated, and visible through output capture 2022-10-26 22:09:17 -04:00
rotate.rs Make ZST checks in core/alloc more readable 2022-09-22 23:12:29 -07:00
sort.rs Rollup merge of #104672 - Voultapher:unify-sort-modules, r=thomcc 2023-01-20 21:33:21 -05:00
specialize.rs Remove size_of == 1 case from fill specialization. 2021-08-09 19:25:28 +02:00