rust/library
Matthias Krüger 061bd28cee
Rollup merge of #143554 - okaneco:const_slice_rotate, r=Amanieu,tgross35
slice: Mark `rotate_left`, `rotate_right` unstably const

Tracking issue rust-lang/rust#143812

- Add the const unstable `const_slice_rotate` feature
- Mark `<[T]>::rotate_left` and `<[T]>::rotate_right` as const unstable

The internal rotate functions use [`<*mut T>::replace`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.replace) and [`ptr::swap_nonoverlapping`](https://doc.rust-lang.org/stable/core/ptr/fn.swap_nonoverlapping.html) which were const-stabilized in 1.88.

Two changes were needed in the `rotate.rs` module to make these functions const:
1. A usage of `cmp::min` was replaced with a local function implementation of [`Ord::min`](https://doc.rust-lang.org/1.88.0/src/core/cmp.rs.html#1048-1053).
2. A `for start in 1..gcd` loop was changed to a while loop with an increment variable.

This needs libs-api approval and cc-ing const-eval.
2025-07-13 15:15:58 +02:00
..
alloc Auto merge of #134628 - estebank:const-default, r=oli-obk 2025-07-08 14:04:40 +00:00
alloctests Add test for int_format_into feature 2025-07-03 18:57:16 +02:00
backtrace@b65ab935fb Update the backtrace submodule 2025-06-16 07:00:13 +00:00
compiler-builtins Rollup merge of #143660 - cuviper:lib-doc-false, r=tgross35 2025-07-10 20:28:50 +02:00
core Rollup merge of #143554 - okaneco:const_slice_rotate, r=Amanieu,tgross35 2025-07-13 15:15:58 +02:00
coretests Auto merge of #143721 - tgross35:rollup-sjdfp6r, r=tgross35 2025-07-10 10:08:08 +00:00
panic_abort Use the in-tree compiler-builtins 2025-06-08 02:36:58 +00:00
panic_unwind Win: Use exceptions with empty data for SEH panic exception copies 2025-07-08 22:07:42 +02:00
portable-simd use div_ceil instead of manual logic 2025-07-05 10:55:42 +02:00
proc_macro Rollup merge of #141996 - Daniel-Aaron-Bloom:dollar_crate, r=petrochenkov 2025-07-10 03:23:52 -04:00
profiler_builtins Fix profiler_builtins build script to handle full path to profiler lib 2025-04-11 16:57:38 +02:00
rtstartup Update cfg(bootstrap) 2025-07-01 10:55:49 -07:00
rustc-std-workspace-alloc Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
rustc-std-workspace-core make compiler_builtins a private dependency 2025-06-30 20:27:10 -04:00
rustc-std-workspace-std Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
std Rollup merge of #143776 - no1wudi:fix, r=tgross35 2025-07-13 07:21:19 +02:00
stdarch Prepare for merging from rust-lang/rust 2025-07-08 16:18:46 +02:00
sysroot Rollup merge of #143660 - cuviper:lib-doc-false, r=tgross35 2025-07-10 20:28:50 +02:00
test Add new test_main_with_exit_callback public function in libtest to allow a callback to be called before exiting 2025-05-06 18:17:48 +02:00
unwind Upgrade the standard library unwinding version 2025-06-11 20:05:06 +00:00
windows_targets Fix backtrace for cygwin 2025-05-07 13:08:19 +08:00
Cargo.lock Auto merge of #140999 - hkBst:update-escaper, r=nnethercote 2025-06-25 01:03:30 +00:00
Cargo.toml Auto merge of #140999 - hkBst:update-escaper, r=nnethercote 2025-06-25 01:03:30 +00:00