Skip to content

Commit

Permalink
1. Removed 'rustc_nounwind' 2. Rewording of comments
Browse files Browse the repository at this point in the history
  • Loading branch information
x17jiri authored and gitbot committed Feb 20, 2025
1 parent 2721b88 commit def732c
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions core/src/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,8 @@ pub const fn must_use<T>(value: T) -> T {
///
/// It can be used with `if` or boolean `match` expressions.
///
/// When used outside of a branch condition, it may still work if there is a branch close by, but
/// it is not guaranteed to have any effect.
/// When used outside of a branch condition, it may still influence a nearby branch, but
/// probably will not have any effect.
///
/// It can also be applied to parts of expressions, such as `likely(a) && unlikely(b)`, or to
/// compound expressions, such as `likely(a && b)`. When applied to compound expressions, it has
Expand Down Expand Up @@ -635,8 +635,7 @@ pub const fn must_use<T>(value: T) -> T {
/// false => println!("this branch is unlikely to be taken"),
/// }
///
/// // Use outside of a branch condition. This may still work if there is a branch close by,
/// // but it is not guaranteed to have any effect
/// // Use outside of a branch condition may still influence a nearby branch
/// let cond = likely(x != 0);
/// if cond {
/// println!("this branch is likely to be taken");
Expand All @@ -646,7 +645,6 @@ pub const fn must_use<T>(value: T) -> T {
///
///
#[unstable(feature = "likely_unlikely", issue = "26179")]
#[rustc_nounwind]
#[inline(always)]
pub const fn likely(b: bool) -> bool {
crate::intrinsics::likely(b)
Expand All @@ -657,8 +655,8 @@ pub const fn likely(b: bool) -> bool {
///
/// It can be used with `if` or boolean `match` expressions.
///
/// When used outside of a branch condition, it may still work if there is a branch close by, but
/// it is not guaranteed to have any effect.
/// When used outside of a branch condition, it may still influence a nearby branch, but
/// probably will not have any effect.
///
/// It can also be applied to parts of expressions, such as `likely(a) && unlikely(b)`, or to
/// compound expressions, such as `unlikely(a && b)`. When applied to compound expressions, it has
Expand Down Expand Up @@ -689,16 +687,14 @@ pub const fn likely(b: bool) -> bool {
/// false => println!("this branch is likely to be taken"),
/// }
///
/// // Use outside of a branch condition. This may still work if there is a branch close by,
/// // but it is not guaranteed to have any effect
/// // Use outside of a branch condition may still influence a nearby branch
/// let cond = unlikely(x != 0);
/// if cond {
/// println!("this branch is likely to be taken");
/// }
/// }
/// ```
#[unstable(feature = "likely_unlikely", issue = "26179")]
#[rustc_nounwind]
#[inline(always)]
pub const fn unlikely(b: bool) -> bool {
crate::intrinsics::unlikely(b)
Expand Down Expand Up @@ -732,7 +728,6 @@ pub const fn unlikely(b: bool) -> bool {
/// }
/// ```
#[unstable(feature = "cold_path", issue = "26179")]
#[rustc_nounwind]
#[inline(always)]
pub const fn cold_path() {
crate::intrinsics::cold_path()
Expand Down

0 comments on commit def732c

Please sign in to comment.