Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #130832 - RalfJung:sort-cfg-mess, r=workingjubilee
fix some cfg logic around optimize_for_size and 16-bit targets Fixes #130818. Fixes #129910. There are still some warnings when building on a 16bit target: ``` warning: struct `AlignedStorage` is never constructed --> /home/r/src/rust/rustc.2/library/core/src/slice/sort/stable/mod.rs:135:8 | 135 | struct AlignedStorage<T, const N: usize> { | ^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: associated items `new` and `as_uninit_slice_mut` are never used --> /home/r/src/rust/rustc.2/library/core/src/slice/sort/stable/mod.rs:141:8 | 140 | impl<T, const N: usize> AlignedStorage<T, N> { | -------------------------------------------- associated items in this implementation 141 | fn new() -> Self { | ^^^ ... 145 | fn as_uninit_slice_mut(&mut self) -> &mut [MaybeUninit<T>] { | ^^^^^^^^^^^^^^^^^^^ warning: function `quicksort` is never used --> /home/r/src/rust/rustc.2/library/core/src/slice/sort/unstable/quicksort.rs:19:15 | 19 | pub(crate) fn quicksort<'a, T, F>( | ^^^^^^^^^ warning: `core` (lib) generated 3 warnings ``` However, the cfg stuff here is sufficiently messy that I didn't want to touch more of it. I think all `feature = "optimize_for_size"` should become `any(feature = "optimize_for_size", target_pointer_width = "16")` but I am not entirely certain. Warnings are fine, Miri will just ignore them. Cc `@Voultapher`
- Loading branch information