Commit graph

2 commits

Author SHA1 Message Date
Trevor Gross
2e365985be 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:

    // 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.
2026-01-26 13:43:06 -06:00
Guillaume Gomez
a27f3e3fd1 Rename tests/codegen into tests/codegen-llvm 2025-07-22 14:28:48 +02:00
Renamed from tests/codegen/hint/cold_path.rs (Browse further)