about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJiri Bobek <jiri.bobek@gmail.com>2025-01-20 16:16:46 +0100
committerJiri Bobek <jiri.bobek@gmail.com>2025-01-20 16:16:46 +0100
commitcb2efaf5bcec1017f475604e21bf87e7d893e438 (patch)
tree96343b1f176ceff0331bca35222f1fc149cce479
parentc656f879c9ade927e56bdbe27a1c7d213ca75df8 (diff)
downloadrust-cb2efaf5bcec1017f475604e21bf87e7d893e438.tar.gz
rust-cb2efaf5bcec1017f475604e21bf87e7d893e438.zip
1. Removed 'rustc_nounwind' 2. Rewording of comments
-rw-r--r--library/core/src/hint.rs17
1 files changed, 6 insertions, 11 deletions
diff --git a/library/core/src/hint.rs b/library/core/src/hint.rs
index 6db19d3184c..951b9bfd97c 100644
--- a/library/core/src/hint.rs
+++ b/library/core/src/hint.rs
@@ -517,8 +517,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
@@ -549,8 +549,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");
@@ -560,7 +559,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)
@@ -571,8 +569,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
@@ -603,8 +601,7 @@ 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");
@@ -612,7 +609,6 @@ pub const fn likely(b: bool) -> bool {
 /// }
 /// ```
 #[unstable(feature = "likely_unlikely", issue = "26179")]
-#[rustc_nounwind]
 #[inline(always)]
 pub const fn unlikely(b: bool) -> bool {
     crate::intrinsics::unlikely(b)
@@ -646,7 +642,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()