You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: library/core/src/ptr/non_null.rs
+6-7Lines changed: 6 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -875,8 +875,8 @@ impl<T: ?Sized> NonNull<T> {
875
875
#[cfg_attr(miri, track_caller)]// even without panics, this helps for Miri backtraces
876
876
#[stable(feature = "non_null_convenience", since = "1.80.0")]
877
877
#[rustc_const_stable(feature = "non_null_convenience", since = "1.80.0")]
878
-
#[requires(self.pointer.is_aligned() && ub_checks::can_dereference(self.pointer))]// TODO: is can_dereference the best API to check if self is valid for read?
879
-
#[ensures(|result| self.pointer.is_aligned())]//unsafe { *result == *self.pointer } can't be used due to unsized and lack of PartialEq implementation, moved to harness
#[ensures(|result| self.pointer.is_aligned())]//unsafe { *result == *self.pointer } can't be used due to unsized and lack of PartialEq implementation, moved to harness
0 commit comments