@@ -790,7 +790,7 @@ extern "rust-intrinsic" {
790
790
/// uninitialized at that point in the control flow.
791
791
///
792
792
/// This intrinsic should not be used outside of the compiler.
793
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
793
+ #[ rustc_safe_intrinsic]
794
794
pub fn rustc_peek < T > ( _: T ) -> T ;
795
795
796
796
/// Aborts the execution of the process.
@@ -808,7 +808,7 @@ extern "rust-intrinsic" {
808
808
/// On Unix, the
809
809
/// process will probably terminate with a signal like `SIGABRT`, `SIGILL`, `SIGTRAP`, `SIGSEGV` or
810
810
/// `SIGBUS`. The precise behaviour is not guaranteed and not stable.
811
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
811
+ #[ rustc_safe_intrinsic]
812
812
pub fn abort ( ) -> !;
813
813
814
814
/// Informs the optimizer that this point in the code is not reachable,
@@ -847,7 +847,7 @@ extern "rust-intrinsic" {
847
847
///
848
848
/// This intrinsic does not have a stable counterpart.
849
849
#[ rustc_const_unstable( feature = "const_likely" , issue = "none" ) ]
850
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
850
+ #[ rustc_safe_intrinsic]
851
851
pub fn likely ( b : bool ) -> bool ;
852
852
853
853
/// Hints to the compiler that branch condition is likely to be false.
@@ -862,7 +862,7 @@ extern "rust-intrinsic" {
862
862
///
863
863
/// This intrinsic does not have a stable counterpart.
864
864
#[ rustc_const_unstable( feature = "const_likely" , issue = "none" ) ]
865
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
865
+ #[ rustc_safe_intrinsic]
866
866
pub fn unlikely ( b : bool ) -> bool ;
867
867
868
868
/// Executes a breakpoint trap, for inspection by a debugger.
@@ -882,7 +882,7 @@ extern "rust-intrinsic" {
882
882
///
883
883
/// The stabilized version of this intrinsic is [`core::mem::size_of`].
884
884
#[ rustc_const_stable( feature = "const_size_of" , since = "1.40.0" ) ]
885
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
885
+ #[ rustc_safe_intrinsic]
886
886
pub fn size_of < T > ( ) -> usize ;
887
887
888
888
/// The minimum alignment of a type.
@@ -894,7 +894,7 @@ extern "rust-intrinsic" {
894
894
///
895
895
/// The stabilized version of this intrinsic is [`core::mem::align_of`].
896
896
#[ rustc_const_stable( feature = "const_min_align_of" , since = "1.40.0" ) ]
897
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
897
+ #[ rustc_safe_intrinsic]
898
898
pub fn min_align_of < T > ( ) -> usize ;
899
899
/// The preferred alignment of a type.
900
900
///
@@ -923,7 +923,7 @@ extern "rust-intrinsic" {
923
923
///
924
924
/// The stabilized version of this intrinsic is [`core::any::type_name`].
925
925
#[ rustc_const_unstable( feature = "const_type_name" , issue = "63084" ) ]
926
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
926
+ #[ rustc_safe_intrinsic]
927
927
pub fn type_name < T : ?Sized > ( ) -> & ' static str ;
928
928
929
929
/// Gets an identifier which is globally unique to the specified type. This
@@ -937,31 +937,31 @@ extern "rust-intrinsic" {
937
937
///
938
938
/// The stabilized version of this intrinsic is [`core::any::TypeId::of`].
939
939
#[ rustc_const_unstable( feature = "const_type_id" , issue = "77125" ) ]
940
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
940
+ #[ rustc_safe_intrinsic]
941
941
pub fn type_id < T : ?Sized + ' static > ( ) -> u64 ;
942
942
943
943
/// A guard for unsafe functions that cannot ever be executed if `T` is uninhabited:
944
944
/// This will statically either panic, or do nothing.
945
945
///
946
946
/// This intrinsic does not have a stable counterpart.
947
947
#[ rustc_const_stable( feature = "const_assert_type" , since = "1.59.0" ) ]
948
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
948
+ #[ rustc_safe_intrinsic]
949
949
pub fn assert_inhabited < T > ( ) ;
950
950
951
951
/// A guard for unsafe functions that cannot ever be executed if `T` does not permit
952
952
/// zero-initialization: This will statically either panic, or do nothing.
953
953
///
954
954
/// This intrinsic does not have a stable counterpart.
955
955
#[ rustc_const_unstable( feature = "const_assert_type2" , issue = "none" ) ]
956
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
956
+ #[ rustc_safe_intrinsic]
957
957
pub fn assert_zero_valid < T > ( ) ;
958
958
959
959
/// A guard for unsafe functions that cannot ever be executed if `T` has invalid
960
960
/// bit patterns: This will statically either panic, or do nothing.
961
961
///
962
962
/// This intrinsic does not have a stable counterpart.
963
963
#[ rustc_const_unstable( feature = "const_assert_type2" , issue = "none" ) ]
964
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
964
+ #[ rustc_safe_intrinsic]
965
965
pub fn assert_uninit_valid < T > ( ) ;
966
966
967
967
/// Gets a reference to a static `Location` indicating where it was called.
@@ -973,7 +973,7 @@ extern "rust-intrinsic" {
973
973
///
974
974
/// Consider using [`core::panic::Location::caller`] instead.
975
975
#[ rustc_const_unstable( feature = "const_caller_location" , issue = "76156" ) ]
976
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
976
+ #[ rustc_safe_intrinsic]
977
977
pub fn caller_location ( ) -> & ' static crate :: panic:: Location < ' static > ;
978
978
979
979
/// Moves a value out of scope without running drop glue.
@@ -986,7 +986,7 @@ extern "rust-intrinsic" {
986
986
/// Therefore, implementations must not require the user to uphold
987
987
/// any safety invariants.
988
988
#[ rustc_const_unstable( feature = "const_intrinsic_forget" , issue = "none" ) ]
989
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
989
+ #[ rustc_safe_intrinsic]
990
990
pub fn forget < T : ?Sized > ( _: T ) ;
991
991
992
992
/// Reinterprets the bits of a value of one type as another type.
@@ -1266,7 +1266,7 @@ extern "rust-intrinsic" {
1266
1266
///
1267
1267
/// The stabilized version of this intrinsic is [`mem::needs_drop`](crate::mem::needs_drop).
1268
1268
#[ rustc_const_stable( feature = "const_needs_drop" , since = "1.40.0" ) ]
1269
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1269
+ #[ rustc_safe_intrinsic]
1270
1270
pub fn needs_drop < T : ?Sized > ( ) -> bool ;
1271
1271
1272
1272
/// Calculates the offset from a pointer.
@@ -1311,7 +1311,7 @@ extern "rust-intrinsic" {
1311
1311
/// any safety invariants.
1312
1312
///
1313
1313
/// Consider using [`pointer::mask`] instead.
1314
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1314
+ #[ rustc_safe_intrinsic]
1315
1315
pub fn ptr_mask < T > ( ptr : * const T , mask : usize ) -> * const T ;
1316
1316
1317
1317
/// Equivalent to the appropriate `llvm.memcpy.p0i8.0i8.*` intrinsic, with
@@ -1503,7 +1503,7 @@ extern "rust-intrinsic" {
1503
1503
///
1504
1504
/// The stabilized version of this intrinsic is
1505
1505
/// [`f32::min`]
1506
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1506
+ #[ rustc_safe_intrinsic]
1507
1507
pub fn minnumf32 ( x : f32 , y : f32 ) -> f32 ;
1508
1508
/// Returns the minimum of two `f64` values.
1509
1509
///
@@ -1514,7 +1514,7 @@ extern "rust-intrinsic" {
1514
1514
///
1515
1515
/// The stabilized version of this intrinsic is
1516
1516
/// [`f64::min`]
1517
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1517
+ #[ rustc_safe_intrinsic]
1518
1518
pub fn minnumf64 ( x : f64 , y : f64 ) -> f64 ;
1519
1519
/// Returns the maximum of two `f32` values.
1520
1520
///
@@ -1525,7 +1525,7 @@ extern "rust-intrinsic" {
1525
1525
///
1526
1526
/// The stabilized version of this intrinsic is
1527
1527
/// [`f32::max`]
1528
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1528
+ #[ rustc_safe_intrinsic]
1529
1529
pub fn maxnumf32 ( x : f32 , y : f32 ) -> f32 ;
1530
1530
/// Returns the maximum of two `f64` values.
1531
1531
///
@@ -1536,7 +1536,7 @@ extern "rust-intrinsic" {
1536
1536
///
1537
1537
/// The stabilized version of this intrinsic is
1538
1538
/// [`f64::max`]
1539
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1539
+ #[ rustc_safe_intrinsic]
1540
1540
pub fn maxnumf64 ( x : f64 , y : f64 ) -> f64 ;
1541
1541
1542
1542
/// Copies the sign from `y` to `x` for `f32` values.
@@ -1657,7 +1657,7 @@ extern "rust-intrinsic" {
1657
1657
/// primitives via the `count_ones` method. For example,
1658
1658
/// [`u32::count_ones`]
1659
1659
#[ rustc_const_stable( feature = "const_ctpop" , since = "1.40.0" ) ]
1660
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1660
+ #[ rustc_safe_intrinsic]
1661
1661
pub fn ctpop < T : Copy > ( x : T ) -> T ;
1662
1662
1663
1663
/// Returns the number of leading unset bits (zeroes) in an integer type `T`.
@@ -1695,7 +1695,7 @@ extern "rust-intrinsic" {
1695
1695
/// assert_eq!(num_leading, 16);
1696
1696
/// ```
1697
1697
#[ rustc_const_stable( feature = "const_ctlz" , since = "1.40.0" ) ]
1698
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1698
+ #[ rustc_safe_intrinsic]
1699
1699
pub fn ctlz < T : Copy > ( x : T ) -> T ;
1700
1700
1701
1701
/// Like `ctlz`, but extra-unsafe as it returns `undef` when
@@ -1752,7 +1752,7 @@ extern "rust-intrinsic" {
1752
1752
/// assert_eq!(num_trailing, 16);
1753
1753
/// ```
1754
1754
#[ rustc_const_stable( feature = "const_cttz" , since = "1.40.0" ) ]
1755
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1755
+ #[ rustc_safe_intrinsic]
1756
1756
pub fn cttz < T : Copy > ( x : T ) -> T ;
1757
1757
1758
1758
/// Like `cttz`, but extra-unsafe as it returns `undef` when
@@ -1785,7 +1785,7 @@ extern "rust-intrinsic" {
1785
1785
/// primitives via the `swap_bytes` method. For example,
1786
1786
/// [`u32::swap_bytes`]
1787
1787
#[ rustc_const_stable( feature = "const_bswap" , since = "1.40.0" ) ]
1788
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1788
+ #[ rustc_safe_intrinsic]
1789
1789
pub fn bswap < T : Copy > ( x : T ) -> T ;
1790
1790
1791
1791
/// Reverses the bits in an integer type `T`.
@@ -1799,7 +1799,7 @@ extern "rust-intrinsic" {
1799
1799
/// primitives via the `reverse_bits` method. For example,
1800
1800
/// [`u32::reverse_bits`]
1801
1801
#[ rustc_const_stable( feature = "const_bitreverse" , since = "1.40.0" ) ]
1802
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1802
+ #[ rustc_safe_intrinsic]
1803
1803
pub fn bitreverse < T : Copy > ( x : T ) -> T ;
1804
1804
1805
1805
/// Performs checked integer addition.
@@ -1813,7 +1813,7 @@ extern "rust-intrinsic" {
1813
1813
/// primitives via the `overflowing_add` method. For example,
1814
1814
/// [`u32::overflowing_add`]
1815
1815
#[ rustc_const_stable( feature = "const_int_overflow" , since = "1.40.0" ) ]
1816
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1816
+ #[ rustc_safe_intrinsic]
1817
1817
pub fn add_with_overflow < T : Copy > ( x : T , y : T ) -> ( T , bool ) ;
1818
1818
1819
1819
/// Performs checked integer subtraction
@@ -1827,7 +1827,7 @@ extern "rust-intrinsic" {
1827
1827
/// primitives via the `overflowing_sub` method. For example,
1828
1828
/// [`u32::overflowing_sub`]
1829
1829
#[ rustc_const_stable( feature = "const_int_overflow" , since = "1.40.0" ) ]
1830
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1830
+ #[ rustc_safe_intrinsic]
1831
1831
pub fn sub_with_overflow < T : Copy > ( x : T , y : T ) -> ( T , bool ) ;
1832
1832
1833
1833
/// Performs checked integer multiplication
@@ -1841,7 +1841,7 @@ extern "rust-intrinsic" {
1841
1841
/// primitives via the `overflowing_mul` method. For example,
1842
1842
/// [`u32::overflowing_mul`]
1843
1843
#[ rustc_const_stable( feature = "const_int_overflow" , since = "1.40.0" ) ]
1844
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1844
+ #[ rustc_safe_intrinsic]
1845
1845
pub fn mul_with_overflow < T : Copy > ( x : T , y : T ) -> ( T , bool ) ;
1846
1846
1847
1847
/// Performs an exact division, resulting in undefined behavior where
@@ -1916,7 +1916,7 @@ extern "rust-intrinsic" {
1916
1916
/// primitives via the `rotate_left` method. For example,
1917
1917
/// [`u32::rotate_left`]
1918
1918
#[ rustc_const_stable( feature = "const_int_rotate" , since = "1.40.0" ) ]
1919
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1919
+ #[ rustc_safe_intrinsic]
1920
1920
pub fn rotate_left < T : Copy > ( x : T , y : T ) -> T ;
1921
1921
1922
1922
/// Performs rotate right.
@@ -1930,7 +1930,7 @@ extern "rust-intrinsic" {
1930
1930
/// primitives via the `rotate_right` method. For example,
1931
1931
/// [`u32::rotate_right`]
1932
1932
#[ rustc_const_stable( feature = "const_int_rotate" , since = "1.40.0" ) ]
1933
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1933
+ #[ rustc_safe_intrinsic]
1934
1934
pub fn rotate_right < T : Copy > ( x : T , y : T ) -> T ;
1935
1935
1936
1936
/// Returns (a + b) mod 2<sup>N</sup>, where N is the width of T in bits.
@@ -1944,7 +1944,7 @@ extern "rust-intrinsic" {
1944
1944
/// primitives via the `wrapping_add` method. For example,
1945
1945
/// [`u32::wrapping_add`]
1946
1946
#[ rustc_const_stable( feature = "const_int_wrapping" , since = "1.40.0" ) ]
1947
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1947
+ #[ rustc_safe_intrinsic]
1948
1948
pub fn wrapping_add < T : Copy > ( a : T , b : T ) -> T ;
1949
1949
/// Returns (a - b) mod 2<sup>N</sup>, where N is the width of T in bits.
1950
1950
///
@@ -1957,7 +1957,7 @@ extern "rust-intrinsic" {
1957
1957
/// primitives via the `wrapping_sub` method. For example,
1958
1958
/// [`u32::wrapping_sub`]
1959
1959
#[ rustc_const_stable( feature = "const_int_wrapping" , since = "1.40.0" ) ]
1960
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1960
+ #[ rustc_safe_intrinsic]
1961
1961
pub fn wrapping_sub < T : Copy > ( a : T , b : T ) -> T ;
1962
1962
/// Returns (a * b) mod 2<sup>N</sup>, where N is the width of T in bits.
1963
1963
///
@@ -1970,7 +1970,7 @@ extern "rust-intrinsic" {
1970
1970
/// primitives via the `wrapping_mul` method. For example,
1971
1971
/// [`u32::wrapping_mul`]
1972
1972
#[ rustc_const_stable( feature = "const_int_wrapping" , since = "1.40.0" ) ]
1973
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1973
+ #[ rustc_safe_intrinsic]
1974
1974
pub fn wrapping_mul < T : Copy > ( a : T , b : T ) -> T ;
1975
1975
1976
1976
/// Computes `a + b`, saturating at numeric bounds.
@@ -1984,7 +1984,7 @@ extern "rust-intrinsic" {
1984
1984
/// primitives via the `saturating_add` method. For example,
1985
1985
/// [`u32::saturating_add`]
1986
1986
#[ rustc_const_stable( feature = "const_int_saturating" , since = "1.40.0" ) ]
1987
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
1987
+ #[ rustc_safe_intrinsic]
1988
1988
pub fn saturating_add < T : Copy > ( a : T , b : T ) -> T ;
1989
1989
/// Computes `a - b`, saturating at numeric bounds.
1990
1990
///
@@ -1997,7 +1997,7 @@ extern "rust-intrinsic" {
1997
1997
/// primitives via the `saturating_sub` method. For example,
1998
1998
/// [`u32::saturating_sub`]
1999
1999
#[ rustc_const_stable( feature = "const_int_saturating" , since = "1.40.0" ) ]
2000
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
2000
+ #[ rustc_safe_intrinsic]
2001
2001
pub fn saturating_sub < T : Copy > ( a : T , b : T ) -> T ;
2002
2002
2003
2003
/// Returns the value of the discriminant for the variant in 'v';
@@ -2010,7 +2010,7 @@ extern "rust-intrinsic" {
2010
2010
///
2011
2011
/// The stabilized version of this intrinsic is [`core::mem::discriminant`].
2012
2012
#[ rustc_const_unstable( feature = "const_discriminant" , issue = "69821" ) ]
2013
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
2013
+ #[ rustc_safe_intrinsic]
2014
2014
pub fn discriminant_value < T > ( v : & T ) -> <T as DiscriminantKind >:: Discriminant ;
2015
2015
2016
2016
/// Returns the number of variants of the type `T` cast to a `usize`;
@@ -2023,7 +2023,7 @@ extern "rust-intrinsic" {
2023
2023
///
2024
2024
/// The to-be-stabilized version of this intrinsic is [`mem::variant_count`].
2025
2025
#[ rustc_const_unstable( feature = "variant_count" , issue = "73662" ) ]
2026
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
2026
+ #[ rustc_safe_intrinsic]
2027
2027
pub fn variant_count < T > ( ) -> usize ;
2028
2028
2029
2029
/// Rust's "try catch" construct which invokes the function pointer `try_fn`
@@ -2057,7 +2057,7 @@ extern "rust-intrinsic" {
2057
2057
/// Therefore, implementations must not require the user to uphold
2058
2058
/// any safety invariants.
2059
2059
#[ rustc_const_unstable( feature = "const_raw_ptr_comparison" , issue = "53020" ) ]
2060
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
2060
+ #[ rustc_safe_intrinsic]
2061
2061
pub fn ptr_guaranteed_cmp < T > ( ptr : * const T , other : * const T ) -> u8 ;
2062
2062
2063
2063
/// Allocates a block of memory at compile time.
@@ -2108,7 +2108,7 @@ extern "rust-intrinsic" {
2108
2108
///
2109
2109
/// [`std::hint::black_box`]: crate::hint::black_box
2110
2110
#[ rustc_const_unstable( feature = "const_black_box" , issue = "none" ) ]
2111
- #[ cfg_attr ( not ( bootstrap ) , rustc_safe_intrinsic) ]
2111
+ #[ rustc_safe_intrinsic]
2112
2112
pub fn black_box < T > ( dummy : T ) -> T ;
2113
2113
2114
2114
/// `ptr` must point to a vtable.
0 commit comments