@@ -960,39 +960,45 @@ pub const unsafe fn assume(b: bool) {
960
960
}
961
961
}
962
962
963
- extern "rust-intrinsic" {
964
- /// Hints to the compiler that branch condition is likely to be true.
965
- /// Returns the value passed to it.
966
- ///
967
- /// Any use other than with `if` statements will probably not have an effect.
968
- ///
969
- /// Note that, unlike most intrinsics, this is safe to call;
970
- /// it does not require an `unsafe` block.
971
- /// Therefore, implementations must not require the user to uphold
972
- /// any safety invariants.
973
- ///
974
- /// This intrinsic does not have a stable counterpart.
975
- #[ rustc_const_unstable( feature = "const_likely" , issue = "none" ) ]
976
- #[ rustc_safe_intrinsic]
977
- #[ rustc_nounwind]
978
- pub fn likely ( b : bool ) -> bool ;
963
+ /// Hints to the compiler that branch condition is likely to be true.
964
+ /// Returns the value passed to it.
965
+ ///
966
+ /// Any use other than with `if` statements will probably not have an effect.
967
+ ///
968
+ /// Note that, unlike most intrinsics, this is safe to call;
969
+ /// it does not require an `unsafe` block.
970
+ /// Therefore, implementations must not require the user to uphold
971
+ /// any safety invariants.
972
+ ///
973
+ /// This intrinsic does not have a stable counterpart.
974
+ #[ rustc_const_unstable( feature = "const_likely" , issue = "none" ) ]
975
+ #[ unstable( feature = "core_intrinsics" , issue = "none" ) ]
976
+ #[ cfg_attr( not( bootstrap) , rustc_intrinsic) ]
977
+ #[ rustc_nounwind]
978
+ pub const fn likely ( b : bool ) -> bool {
979
+ b
980
+ }
979
981
980
- /// Hints to the compiler that branch condition is likely to be false.
981
- /// Returns the value passed to it.
982
- ///
983
- /// Any use other than with `if` statements will probably not have an effect.
984
- ///
985
- /// Note that, unlike most intrinsics, this is safe to call;
986
- /// it does not require an `unsafe` block.
987
- /// Therefore, implementations must not require the user to uphold
988
- /// any safety invariants.
989
- ///
990
- /// This intrinsic does not have a stable counterpart.
991
- #[ rustc_const_unstable( feature = "const_likely" , issue = "none" ) ]
992
- #[ rustc_safe_intrinsic]
993
- #[ rustc_nounwind]
994
- pub fn unlikely ( b : bool ) -> bool ;
982
+ /// Hints to the compiler that branch condition is likely to be false.
983
+ /// Returns the value passed to it.
984
+ ///
985
+ /// Any use other than with `if` statements will probably not have an effect.
986
+ ///
987
+ /// Note that, unlike most intrinsics, this is safe to call;
988
+ /// it does not require an `unsafe` block.
989
+ /// Therefore, implementations must not require the user to uphold
990
+ /// any safety invariants.
991
+ ///
992
+ /// This intrinsic does not have a stable counterpart.
993
+ #[ rustc_const_unstable( feature = "const_likely" , issue = "none" ) ]
994
+ #[ unstable( feature = "core_intrinsics" , issue = "none" ) ]
995
+ #[ cfg_attr( not( bootstrap) , rustc_intrinsic) ]
996
+ #[ rustc_nounwind]
997
+ pub const fn unlikely ( b : bool ) -> bool {
998
+ b
999
+ }
995
1000
1001
+ extern "rust-intrinsic" {
996
1002
/// Executes a breakpoint trap, for inspection by a debugger.
997
1003
///
998
1004
/// This intrinsic does not have a stable counterpart.
0 commit comments