1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// The code here has been copied from
// https://github.com/rust-lang/rust/blob/d25910eaeb3eab25d3bbf9b9815e6d215c202d1f/library/core/src/intrinsics/mod.rs
//
// https://github.com/rust-lang/rust/blob/d25910eaeb3eab25d3bbf9b9815e6d215c202d1f/REUSE.toml indicates
// SPDX-FileCopyrightText = "The Rust Project Developers (see https://thanks.rust-lang.org)"
// SPDX-License-Identifier = "MIT or Apache-2.0"
//! As a workaround to their [stabilization in the standard library](https://github.com/rust-lang/rust/issues/136873) remaining perma-open,
//! this crate provides the `cold_path`, `likely`, and `unlikely` hints
//! built on the `#[cold]` annotation as copied and pasted from the standard library source.
/// Hints to the compiler that current code path is cold.
pub const
/// Hints to the compiler that branch condition is likely to be true.
/// Returns the value passed to it.
pub const
/// Hints to the compiler that branch condition is likely to be false.
/// Returns the value passed to it.
pub const