We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ad95f6 commit e8972ebCopy full SHA for e8972eb
core/src/ptr/const_ptr.rs
@@ -678,6 +678,10 @@ impl<T: ?Sized> *const T {
678
where
679
T: Sized,
680
{
681
+ // SAFETY: The comparison has no side-effects, and the intrinsic
682
+ // does this check internally in the CTFE implementation.
683
+ unsafe { assert_unsafe_precondition!(self >= origin) };
684
+
685
let pointee_size = mem::size_of::<T>();
686
assert!(0 < pointee_size && pointee_size <= isize::MAX as usize);
687
// SAFETY: the caller must uphold the safety contract for `ptr_offset_from_unsigned`.
0 commit comments