Skip to content

Commit ba3a447

Browse files
committed
Improve the ICE message for invalid nullary intrinsic calls
1 parent 741831c commit ba3a447

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

core/src/intrinsics/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2728,6 +2728,11 @@ pub unsafe fn vtable_align(ptr: *const ()) -> usize;
27282728
/// More specifically, this is the offset in bytes between successive
27292729
/// items of the same type, including alignment padding.
27302730
///
2731+
/// Note that, unlike most intrinsics, this can only be called at compile-time
2732+
/// as backends do not have an implementation for it. The only caller (its
2733+
/// stable counterpart) wraps this intrinsic call in a `const` block so that
2734+
/// backends only see an evaluated constant.
2735+
///
27312736
/// The stabilized version of this intrinsic is [`core::mem::size_of`].
27322737
#[rustc_nounwind]
27332738
#[unstable(feature = "core_intrinsics", issue = "none")]
@@ -2742,6 +2747,11 @@ pub const fn size_of<T>() -> usize;
27422747
/// Therefore, implementations must not require the user to uphold
27432748
/// any safety invariants.
27442749
///
2750+
/// Note that, unlike most intrinsics, this can only be called at compile-time
2751+
/// as backends do not have an implementation for it. The only caller (its
2752+
/// stable counterpart) wraps this intrinsic call in a `const` block so that
2753+
/// backends only see an evaluated constant.
2754+
///
27452755
/// The stabilized version of this intrinsic is [`core::mem::align_of`].
27462756
#[rustc_nounwind]
27472757
#[unstable(feature = "core_intrinsics", issue = "none")]

0 commit comments

Comments
 (0)