rust/library
Chris Denton f1d0b9c645
Rollup merge of #139726 - Amanieu:select_unpredictable_hint, r=dtolnay
Move `select_unpredictable` to the `hint` module

There has been considerable discussion in both the ACP (rust-lang/libs-team#468) and tracking issue (#133962) about whether the `bool::select_unpredictable` method should be in `core::hint` instead.

I believe this is the right move for the following reasons:
- The documentation explicitly says that it is a hint, not a codegen guarantee.
- `bool` doesn't have a corresponding `select` method, and I don't think we should be adding one.
- This shouldn't be something that people reach for with auto-completion unless they specifically understand the interactions with branch prediction. Using conditional moves can easily make code *slower* by preventing the CPU from speculating past the condition due to the data dependency.
- Although currently `core::hint` only contains no-ops, this isn't a hard rule (for example `unreachable_unchecked` is a bit of a gray area). The documentation only status that the module contains "hints to compiler that affects how code should be emitted or optimized". This is consistent with what `select_unpredictable` does.
2025-04-13 11:48:20 +00:00
..
alloc Fix typo in documentation 2025-04-12 22:26:38 +08:00
alloctests Add missing black_box in String benchmarks 2025-04-09 13:06:10 +03:00
backtrace@9d2c34e7e6 Update backtrace 2025-02-13 14:32:50 -08:00
core Rollup merge of #139726 - Amanieu:select_unpredictable_hint, r=dtolnay 2025-04-13 11:48:20 +00:00
coretests Auto merge of #137412 - scottmcm:redo-swap, r=cuviper 2025-04-10 20:19:11 +00:00
panic_abort Migrate panic_abort to Rust 2024 2025-03-11 09:46:34 -07:00
panic_unwind update cfgs 2025-04-09 12:29:59 +01:00
portable-simd Merge commit 'c14f2fc3eb69c164d8bf8d36d91ebd60bd5261e6' into sync-from-portable-simd-2025-03-19 2025-03-19 00:58:47 -04:00
proc_macro update cfgs 2025-04-09 12:29:59 +01:00
profiler_builtins Fix profiler_builtins build script to handle full path to profiler lib 2025-04-11 16:57:38 +02:00
rtstartup Revert changes for rtstartup 2025-03-10 21:23:31 +08: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 Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07: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 #139710 - thaliaarchi:move-args-pal, r=joboet 2025-04-13 11:48:19 +00:00
stdarch@9426bb5658 Update stdarch 2025-03-06 11:11:55 -08:00
sysroot Migrate the sysroot crate to Rust 2024 2025-03-11 09:46:35 -07:00
test libtest: Pass the test's panic payload as Option instead of Result 2025-04-08 13:28:05 +10:00
unwind Rollup merge of #137621 - Berrysoft:cygwin-std, r=joboet 2025-03-17 05:47:49 -04:00
windows_targets Migrate windows-targets to Rust 2024 2025-03-11 09:46:35 -07:00
Cargo.lock Rollup merge of #139605 - oyvindln:update_miniz_oxide_0_8, r=Mark-Simulacrum 2025-04-13 11:48:17 +00:00
Cargo.toml Add opt-level = "s" for more std symbolication crates 2025-04-01 20:50:19 +00:00