rust/library/core/src
Matthias Krüger 3a3352386c
Rollup merge of #130832 - RalfJung:sort-cfg-mess, r=workingjubilee
fix some cfg logic around optimize_for_size and 16-bit targets

Fixes https://github.com/rust-lang/rust/issues/130818.
Fixes https://github.com/rust-lang/rust/issues/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`
2024-09-25 20:11:00 +02: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 Add 'must_use' attribute to 'char::len_utf8' and 'char::len_utf16'; 2024-09-25 10:42:43 +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 fix some cfg logic around optimize_for_size and 16-bit targets 2024-09-25 15:21:08 +02: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