rust/tests
Jonathan Brouwer 27d6b3c9b7
Rollup merge of #151576 - tgross35:stabilize-cold-path, r=jhpratt
Stabilize `core::hint::cold_path`

`cold_path` has been around unstably for a while and is a rather useful tool to have. It does what it is supposed to and there are no known remaining issues, so stabilize it here (including const).

Newly stable API:

```rust
// in core::hint
pub const fn cold_path();
```

I have opted to exclude `likely` and `unlikely` for now since they have had some concerns about ease of use that `cold_path` doesn't suffer from. `cold_path` is also significantly more flexible; in addition to working with boolean `if` conditions, it can be used in `match` arms, `if let`, closures, and other control flow blocks. `likely` and `unlikely` are also possible to implement in user code via `cold_path`, if desired.

Closes: https://github.com/rust-lang/rust/issues/136873 (tracking issue)

---

There has been some design and implementation work for making `#[cold]` function in more places, such as `if` arms, `match` arms, and closure bodies. Considering a stable `cold_path` will cover all of these usecases, it does not seem worth pursuing a more powerful `#[cold]` as an alternative way to do the same thing. If the lang team agrees, then:

Closes: https://github.com/rust-lang/rust/issues/26179
Closes: https://github.com/rust-lang/rust/pull/120193
2026-02-07 13:06:35 +01:00
..
assembly-llvm Move bigint helper tracking issues 2026-02-02 18:45:26 -05:00
auxiliary Rollup merge of #150368 - minicore-ordering, r=workingjubilee 2026-01-11 09:56:38 +01:00
build-std/configurations Test that -Zbuild-std=core works on a variety of profiles 2026-01-14 20:39:12 -05:00
codegen-llvm Rollup merge of #151576 - tgross35:stabilize-cold-path, r=jhpratt 2026-02-07 13:06:35 +01:00
codegen-units address review comments; fix CI 2026-01-01 19:17:11 -05:00
coverage coverage: Add a test case for a previously-unknown span mismatch 2026-02-03 22:53:38 +11:00
coverage-run-rustdoc
crashes Reorganize tests that no longer crash 2026-02-06 14:44:04 +09:00
debuginfo Auto merge of #150843 - fmease:dyn-ace, r=BoxyUwU 2026-01-22 01:56:41 +00:00
incremental Port rustc_clean to attribute parser 2026-02-04 20:58:02 +00:00
mir-opt Auto merge of #151622 - scottmcm:elide-more-transmutes, r=cjgillot 2026-01-31 20:42:37 +00:00
pretty Update uitests 2026-01-19 21:50:29 +01:00
run-make Disable the run-make/translation test for now 2026-02-07 10:30:42 +01:00
run-make-cargo Update cargo submodule 2026-01-30 19:15:24 -05:00
rustdoc-gui Remove the 4 failing tests from rustdoc-gui 2026-02-06 01:13:41 +01:00
rustdoc-html resolve: Mark items under ambigous imports as exported 2026-01-27 16:24:53 +03:00
rustdoc-js Auto merge of #149370 - Zalathar:rollup-6fkk5x4, r=Zalathar 2025-11-27 07:30:25 +00:00
rustdoc-js-std Explicitly export core and std macros 2026-01-13 08:47:48 +01:00
rustdoc-json resolve: Mark items under ambigous imports as exported 2026-01-27 16:24:53 +03:00
rustdoc-ui Fix existing messages in stderrs 2026-02-07 09:13:42 +01:00
ui Rollup merge of #150522 - pitaj:stabilize-new-rangeinclusive, r=tgross35 2026-02-07 13:06:34 +01:00
ui-fulldeps Convert to inline diagnostics in rustc_parse 2026-02-07 10:30:40 +01:00
COMPILER_TESTS.md