@@ -788,6 +788,7 @@ extern "rust-intrinsic" {
788788 /// uninitialized at that point in the control flow.
789789 ///
790790 /// This intrinsic should not be used outside of the compiler.
791+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
791792 pub fn rustc_peek < T > ( _: T ) -> T ;
792793
793794 /// Aborts the execution of the process.
@@ -805,6 +806,7 @@ extern "rust-intrinsic" {
805806 /// On Unix, the
806807 /// process will probably terminate with a signal like `SIGABRT`, `SIGILL`, `SIGTRAP`, `SIGSEGV` or
807808 /// `SIGBUS`. The precise behaviour is not guaranteed and not stable.
809+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
808810 pub fn abort ( ) -> !;
809811
810812 /// Informs the optimizer that this point in the code is not reachable,
@@ -843,6 +845,7 @@ extern "rust-intrinsic" {
843845 ///
844846 /// This intrinsic does not have a stable counterpart.
845847 #[ rustc_const_unstable( feature = "const_likely" , issue = "none" ) ]
848+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
846849 pub fn likely ( b : bool ) -> bool ;
847850
848851 /// Hints to the compiler that branch condition is likely to be false.
@@ -857,6 +860,7 @@ extern "rust-intrinsic" {
857860 ///
858861 /// This intrinsic does not have a stable counterpart.
859862 #[ rustc_const_unstable( feature = "const_likely" , issue = "none" ) ]
863+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
860864 pub fn unlikely ( b : bool ) -> bool ;
861865
862866 /// Executes a breakpoint trap, for inspection by a debugger.
@@ -876,6 +880,7 @@ extern "rust-intrinsic" {
876880 ///
877881 /// The stabilized version of this intrinsic is [`core::mem::size_of`].
878882 #[ rustc_const_stable( feature = "const_size_of" , since = "1.40.0" ) ]
883+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
879884 pub fn size_of < T > ( ) -> usize ;
880885
881886 /// The minimum alignment of a type.
@@ -887,6 +892,7 @@ extern "rust-intrinsic" {
887892 ///
888893 /// The stabilized version of this intrinsic is [`core::mem::align_of`].
889894 #[ rustc_const_stable( feature = "const_min_align_of" , since = "1.40.0" ) ]
895+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
890896 pub fn min_align_of < T > ( ) -> usize ;
891897 /// The preferred alignment of a type.
892898 ///
@@ -915,6 +921,7 @@ extern "rust-intrinsic" {
915921 ///
916922 /// The stabilized version of this intrinsic is [`core::any::type_name`].
917923 #[ rustc_const_unstable( feature = "const_type_name" , issue = "63084" ) ]
924+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
918925 pub fn type_name < T : ?Sized > ( ) -> & ' static str ;
919926
920927 /// Gets an identifier which is globally unique to the specified type. This
@@ -928,27 +935,31 @@ extern "rust-intrinsic" {
928935 ///
929936 /// The stabilized version of this intrinsic is [`core::any::TypeId::of`].
930937 #[ rustc_const_unstable( feature = "const_type_id" , issue = "77125" ) ]
938+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
931939 pub fn type_id < T : ?Sized + ' static > ( ) -> u64 ;
932940
933941 /// A guard for unsafe functions that cannot ever be executed if `T` is uninhabited:
934942 /// This will statically either panic, or do nothing.
935943 ///
936944 /// This intrinsic does not have a stable counterpart.
937945 #[ rustc_const_stable( feature = "const_assert_type" , since = "1.59.0" ) ]
946+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
938947 pub fn assert_inhabited < T > ( ) ;
939948
940949 /// A guard for unsafe functions that cannot ever be executed if `T` does not permit
941950 /// zero-initialization: This will statically either panic, or do nothing.
942951 ///
943952 /// This intrinsic does not have a stable counterpart.
944953 #[ rustc_const_unstable( feature = "const_assert_type2" , issue = "none" ) ]
954+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
945955 pub fn assert_zero_valid < T > ( ) ;
946956
947957 /// A guard for unsafe functions that cannot ever be executed if `T` has invalid
948958 /// bit patterns: This will statically either panic, or do nothing.
949959 ///
950960 /// This intrinsic does not have a stable counterpart.
951961 #[ rustc_const_unstable( feature = "const_assert_type2" , issue = "none" ) ]
962+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
952963 pub fn assert_uninit_valid < T > ( ) ;
953964
954965 /// Gets a reference to a static `Location` indicating where it was called.
@@ -960,6 +971,7 @@ extern "rust-intrinsic" {
960971 ///
961972 /// Consider using [`core::panic::Location::caller`] instead.
962973 #[ rustc_const_unstable( feature = "const_caller_location" , issue = "76156" ) ]
974+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
963975 pub fn caller_location ( ) -> & ' static crate :: panic:: Location < ' static > ;
964976
965977 /// Moves a value out of scope without running drop glue.
@@ -972,6 +984,7 @@ extern "rust-intrinsic" {
972984 /// Therefore, implementations must not require the user to uphold
973985 /// any safety invariants.
974986 #[ rustc_const_unstable( feature = "const_intrinsic_forget" , issue = "none" ) ]
987+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
975988 pub fn forget < T : ?Sized > ( _: T ) ;
976989
977990 /// Reinterprets the bits of a value of one type as another type.
@@ -1251,6 +1264,7 @@ extern "rust-intrinsic" {
12511264 ///
12521265 /// The stabilized version of this intrinsic is [`mem::needs_drop`](crate::mem::needs_drop).
12531266 #[ rustc_const_stable( feature = "const_needs_drop" , since = "1.40.0" ) ]
1267+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
12541268 pub fn needs_drop < T : ?Sized > ( ) -> bool ;
12551269
12561270 /// Calculates the offset from a pointer.
@@ -1295,6 +1309,7 @@ extern "rust-intrinsic" {
12951309 /// any safety invariants.
12961310 ///
12971311 /// Consider using [`pointer::mask`] instead.
1312+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
12981313 pub fn ptr_mask < T > ( ptr : * const T , mask : usize ) -> * const T ;
12991314
13001315 /// Equivalent to the appropriate `llvm.memcpy.p0i8.0i8.*` intrinsic, with
@@ -1486,6 +1501,7 @@ extern "rust-intrinsic" {
14861501 ///
14871502 /// The stabilized version of this intrinsic is
14881503 /// [`f32::min`]
1504+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
14891505 pub fn minnumf32 ( x : f32 , y : f32 ) -> f32 ;
14901506 /// Returns the minimum of two `f64` values.
14911507 ///
@@ -1496,6 +1512,7 @@ extern "rust-intrinsic" {
14961512 ///
14971513 /// The stabilized version of this intrinsic is
14981514 /// [`f64::min`]
1515+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
14991516 pub fn minnumf64 ( x : f64 , y : f64 ) -> f64 ;
15001517 /// Returns the maximum of two `f32` values.
15011518 ///
@@ -1506,6 +1523,7 @@ extern "rust-intrinsic" {
15061523 ///
15071524 /// The stabilized version of this intrinsic is
15081525 /// [`f32::max`]
1526+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
15091527 pub fn maxnumf32 ( x : f32 , y : f32 ) -> f32 ;
15101528 /// Returns the maximum of two `f64` values.
15111529 ///
@@ -1516,6 +1534,7 @@ extern "rust-intrinsic" {
15161534 ///
15171535 /// The stabilized version of this intrinsic is
15181536 /// [`f64::max`]
1537+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
15191538 pub fn maxnumf64 ( x : f64 , y : f64 ) -> f64 ;
15201539
15211540 /// Copies the sign from `y` to `x` for `f32` values.
@@ -1636,6 +1655,7 @@ extern "rust-intrinsic" {
16361655 /// primitives via the `count_ones` method. For example,
16371656 /// [`u32::count_ones`]
16381657 #[ rustc_const_stable( feature = "const_ctpop" , since = "1.40.0" ) ]
1658+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
16391659 pub fn ctpop < T : Copy > ( x : T ) -> T ;
16401660
16411661 /// Returns the number of leading unset bits (zeroes) in an integer type `T`.
@@ -1673,6 +1693,7 @@ extern "rust-intrinsic" {
16731693 /// assert_eq!(num_leading, 16);
16741694 /// ```
16751695 #[ rustc_const_stable( feature = "const_ctlz" , since = "1.40.0" ) ]
1696+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
16761697 pub fn ctlz < T : Copy > ( x : T ) -> T ;
16771698
16781699 /// Like `ctlz`, but extra-unsafe as it returns `undef` when
@@ -1729,6 +1750,7 @@ extern "rust-intrinsic" {
17291750 /// assert_eq!(num_trailing, 16);
17301751 /// ```
17311752 #[ rustc_const_stable( feature = "const_cttz" , since = "1.40.0" ) ]
1753+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
17321754 pub fn cttz < T : Copy > ( x : T ) -> T ;
17331755
17341756 /// Like `cttz`, but extra-unsafe as it returns `undef` when
@@ -1761,6 +1783,7 @@ extern "rust-intrinsic" {
17611783 /// primitives via the `swap_bytes` method. For example,
17621784 /// [`u32::swap_bytes`]
17631785 #[ rustc_const_stable( feature = "const_bswap" , since = "1.40.0" ) ]
1786+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
17641787 pub fn bswap < T : Copy > ( x : T ) -> T ;
17651788
17661789 /// Reverses the bits in an integer type `T`.
@@ -1774,6 +1797,7 @@ extern "rust-intrinsic" {
17741797 /// primitives via the `reverse_bits` method. For example,
17751798 /// [`u32::reverse_bits`]
17761799 #[ rustc_const_stable( feature = "const_bitreverse" , since = "1.40.0" ) ]
1800+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
17771801 pub fn bitreverse < T : Copy > ( x : T ) -> T ;
17781802
17791803 /// Performs checked integer addition.
@@ -1787,6 +1811,7 @@ extern "rust-intrinsic" {
17871811 /// primitives via the `overflowing_add` method. For example,
17881812 /// [`u32::overflowing_add`]
17891813 #[ rustc_const_stable( feature = "const_int_overflow" , since = "1.40.0" ) ]
1814+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
17901815 pub fn add_with_overflow < T : Copy > ( x : T , y : T ) -> ( T , bool ) ;
17911816
17921817 /// Performs checked integer subtraction
@@ -1800,6 +1825,7 @@ extern "rust-intrinsic" {
18001825 /// primitives via the `overflowing_sub` method. For example,
18011826 /// [`u32::overflowing_sub`]
18021827 #[ rustc_const_stable( feature = "const_int_overflow" , since = "1.40.0" ) ]
1828+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
18031829 pub fn sub_with_overflow < T : Copy > ( x : T , y : T ) -> ( T , bool ) ;
18041830
18051831 /// Performs checked integer multiplication
@@ -1813,6 +1839,7 @@ extern "rust-intrinsic" {
18131839 /// primitives via the `overflowing_mul` method. For example,
18141840 /// [`u32::overflowing_mul`]
18151841 #[ rustc_const_stable( feature = "const_int_overflow" , since = "1.40.0" ) ]
1842+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
18161843 pub fn mul_with_overflow < T : Copy > ( x : T , y : T ) -> ( T , bool ) ;
18171844
18181845 /// Performs an exact division, resulting in undefined behavior where
@@ -1887,6 +1914,7 @@ extern "rust-intrinsic" {
18871914 /// primitives via the `rotate_left` method. For example,
18881915 /// [`u32::rotate_left`]
18891916 #[ rustc_const_stable( feature = "const_int_rotate" , since = "1.40.0" ) ]
1917+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
18901918 pub fn rotate_left < T : Copy > ( x : T , y : T ) -> T ;
18911919
18921920 /// Performs rotate right.
@@ -1900,6 +1928,7 @@ extern "rust-intrinsic" {
19001928 /// primitives via the `rotate_right` method. For example,
19011929 /// [`u32::rotate_right`]
19021930 #[ rustc_const_stable( feature = "const_int_rotate" , since = "1.40.0" ) ]
1931+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
19031932 pub fn rotate_right < T : Copy > ( x : T , y : T ) -> T ;
19041933
19051934 /// Returns (a + b) mod 2<sup>N</sup>, where N is the width of T in bits.
@@ -1913,6 +1942,7 @@ extern "rust-intrinsic" {
19131942 /// primitives via the `wrapping_add` method. For example,
19141943 /// [`u32::wrapping_add`]
19151944 #[ rustc_const_stable( feature = "const_int_wrapping" , since = "1.40.0" ) ]
1945+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
19161946 pub fn wrapping_add < T : Copy > ( a : T , b : T ) -> T ;
19171947 /// Returns (a - b) mod 2<sup>N</sup>, where N is the width of T in bits.
19181948 ///
@@ -1925,6 +1955,7 @@ extern "rust-intrinsic" {
19251955 /// primitives via the `wrapping_sub` method. For example,
19261956 /// [`u32::wrapping_sub`]
19271957 #[ rustc_const_stable( feature = "const_int_wrapping" , since = "1.40.0" ) ]
1958+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
19281959 pub fn wrapping_sub < T : Copy > ( a : T , b : T ) -> T ;
19291960 /// Returns (a * b) mod 2<sup>N</sup>, where N is the width of T in bits.
19301961 ///
@@ -1937,6 +1968,7 @@ extern "rust-intrinsic" {
19371968 /// primitives via the `wrapping_mul` method. For example,
19381969 /// [`u32::wrapping_mul`]
19391970 #[ rustc_const_stable( feature = "const_int_wrapping" , since = "1.40.0" ) ]
1971+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
19401972 pub fn wrapping_mul < T : Copy > ( a : T , b : T ) -> T ;
19411973
19421974 /// Computes `a + b`, saturating at numeric bounds.
@@ -1950,6 +1982,7 @@ extern "rust-intrinsic" {
19501982 /// primitives via the `saturating_add` method. For example,
19511983 /// [`u32::saturating_add`]
19521984 #[ rustc_const_stable( feature = "const_int_saturating" , since = "1.40.0" ) ]
1985+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
19531986 pub fn saturating_add < T : Copy > ( a : T , b : T ) -> T ;
19541987 /// Computes `a - b`, saturating at numeric bounds.
19551988 ///
@@ -1962,6 +1995,7 @@ extern "rust-intrinsic" {
19621995 /// primitives via the `saturating_sub` method. For example,
19631996 /// [`u32::saturating_sub`]
19641997 #[ rustc_const_stable( feature = "const_int_saturating" , since = "1.40.0" ) ]
1998+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
19651999 pub fn saturating_sub < T : Copy > ( a : T , b : T ) -> T ;
19662000
19672001 /// Returns the value of the discriminant for the variant in 'v';
@@ -1974,6 +2008,7 @@ extern "rust-intrinsic" {
19742008 ///
19752009 /// The stabilized version of this intrinsic is [`core::mem::discriminant`].
19762010 #[ rustc_const_unstable( feature = "const_discriminant" , issue = "69821" ) ]
2011+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
19772012 pub fn discriminant_value < T > ( v : & T ) -> <T as DiscriminantKind >:: Discriminant ;
19782013
19792014 /// Returns the number of variants of the type `T` cast to a `usize`;
@@ -1986,6 +2021,7 @@ extern "rust-intrinsic" {
19862021 ///
19872022 /// The to-be-stabilized version of this intrinsic is [`mem::variant_count`].
19882023 #[ rustc_const_unstable( feature = "variant_count" , issue = "73662" ) ]
2024+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
19892025 pub fn variant_count < T > ( ) -> usize ;
19902026
19912027 /// Rust's "try catch" construct which invokes the function pointer `try_fn`
@@ -2019,6 +2055,7 @@ extern "rust-intrinsic" {
20192055 /// Therefore, implementations must not require the user to uphold
20202056 /// any safety invariants.
20212057 #[ rustc_const_unstable( feature = "const_raw_ptr_comparison" , issue = "53020" ) ]
2058+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
20222059 pub fn ptr_guaranteed_cmp < T > ( ptr : * const T , other : * const T ) -> u8 ;
20232060
20242061 /// Allocates a block of memory at compile time.
@@ -2069,6 +2106,7 @@ extern "rust-intrinsic" {
20692106 ///
20702107 /// [`std::hint::black_box`]: crate::hint::black_box
20712108 #[ rustc_const_unstable( feature = "const_black_box" , issue = "none" ) ]
2109+ #[ cfg_attr( not( bootstrap) , rustc_safe_intrinsic) ]
20722110 pub fn black_box < T > ( dummy : T ) -> T ;
20732111
20742112 /// `ptr` must point to a vtable.
0 commit comments