@@ -839,10 +839,10 @@ pub const unsafe fn transmute_unchecked<Src, Dst>(src: Src) -> Dst;
839
839
/// If the actual type neither requires drop glue nor implements
840
840
/// `Copy`, then the return value of this function is unspecified.
841
841
///
842
- /// Note that, unlike most intrinsics, this is safe to call;
843
- /// it does not require an `unsafe` block.
844
- /// Therefore, implementations must not require the user to uphold
845
- /// any safety invariants .
842
+ /// Note that, unlike most intrinsics, this can only be called at compile-time
843
+ /// as backends do not have an implementation for it. The only caller (its
844
+ /// stable counterpart), wraps this intrinsic call in a `const` block so that
845
+ /// backends only see an evaluated constant .
846
846
///
847
847
/// The stabilized version of this intrinsic is [`mem::needs_drop`](crate::mem::needs_drop).
848
848
#[ rustc_intrinsic_const_stable_indirect]
@@ -2655,10 +2655,10 @@ pub const fn align_of<T>() -> usize;
2655
2655
/// Returns the number of variants of the type `T` cast to a `usize`;
2656
2656
/// if `T` has no variants, returns `0`. Uninhabited variants will be counted.
2657
2657
///
2658
- /// Note that, unlike most intrinsics, this is safe to call;
2659
- /// it does not require an `unsafe` block.
2660
- /// Therefore, implementations must not require the user to uphold
2661
- /// any safety invariants .
2658
+ /// Note that, unlike most intrinsics, this can only be called at compile-time
2659
+ /// as backends do not have an implementation for it. The only caller (its
2660
+ /// stable counterpart), wraps this intrinsic call in a `const` block so that
2661
+ /// backends only see an evaluated constant .
2662
2662
///
2663
2663
/// The to-be-stabilized version of this intrinsic is [`crate::mem::variant_count`].
2664
2664
#[ rustc_nounwind]
@@ -2694,10 +2694,10 @@ pub const unsafe fn align_of_val<T: ?Sized>(ptr: *const T) -> usize;
2694
2694
2695
2695
/// Gets a static string slice containing the name of a type.
2696
2696
///
2697
- /// Note that, unlike most intrinsics, this is safe to call;
2698
- /// it does not require an `unsafe` block.
2699
- /// Therefore, implementations must not require the user to uphold
2700
- /// any safety invariants .
2697
+ /// Note that, unlike most intrinsics, this can only be called at compile-time
2698
+ /// as backends do not have an implementation for it. The only caller (its
2699
+ /// stable counterpart), wraps this intrinsic call in a `const` block so that
2700
+ /// backends only see an evaluated constant .
2701
2701
///
2702
2702
/// The stabilized version of this intrinsic is [`core::any::type_name`].
2703
2703
#[ rustc_nounwind]
@@ -2709,10 +2709,10 @@ pub const fn type_name<T: ?Sized>() -> &'static str;
2709
2709
/// function will return the same value for a type regardless of whichever
2710
2710
/// crate it is invoked in.
2711
2711
///
2712
- /// Note that, unlike most intrinsics, this is safe to call;
2713
- /// it does not require an `unsafe` block.
2714
- /// Therefore, implementations must not require the user to uphold
2715
- /// any safety invariants .
2712
+ /// Note that, unlike most intrinsics, this can only be called at compile-time
2713
+ /// as backends do not have an implementation for it. The only caller (its
2714
+ /// stable counterpart), wraps this intrinsic call in a `const` block so that
2715
+ /// backends only see an evaluated constant .
2716
2716
///
2717
2717
/// The stabilized version of this intrinsic is [`core::any::TypeId::of`].
2718
2718
#[ rustc_nounwind]
0 commit comments