@@ -502,7 +502,7 @@ impl<T: ?Sized> NonNull<T> {
502
502
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
503
503
#[ stable( feature = "non_null_convenience" , since = "1.80.0" ) ]
504
504
#[ rustc_const_stable( feature = "non_null_convenience" , since = "1.80.0" ) ]
505
- # [ requires ( !origin . as_ptr ( ) . is_null ( ) ) ]
505
+ // TODO: add a require to check whether two pointer points to the same allocated object with `same_allocation`
506
506
#[ ensures(
507
507
|result: & isize |
508
508
* result == ( self . as_ptr( ) as * const u8 ) . offset_from( origin. as_ptr( ) as * const u8 )
@@ -584,7 +584,7 @@ impl<T: ?Sized> NonNull<T> {
584
584
#[ rustc_allow_const_fn_unstable( set_ptr_value) ]
585
585
#[ stable( feature = "non_null_convenience" , since = "1.80.0" ) ]
586
586
#[ rustc_const_stable( feature = "non_null_convenience" , since = "1.80.0" ) ]
587
- # [ requires ( ! self . as_ptr ( ) . is_null ( ) ) ]
587
+ // TODO: add a require to check whether two pointer points to the same allocated object with `same_allocation`
588
588
#[ ensures(
589
589
|result: & NonNull <T >|
590
590
( result. as_ptr( ) as * const ( ) as usize ) == ( ( self . as_ptr( ) as * const ( ) as usize ) + count)
@@ -793,7 +793,7 @@ impl<T: ?Sized> NonNull<T> {
793
793
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
794
794
#[ stable( feature = "non_null_convenience" , since = "1.80.0" ) ]
795
795
#[ rustc_const_stable( feature = "non_null_convenience" , since = "1.80.0" ) ]
796
- # [ requires ( !origin . as_ptr ( ) . is_null ( ) ) ]
796
+ // TODO: add a require to check whether two pointer points to the same allocated object with `same_allocation`
797
797
#[ ensures(
798
798
|result: & isize |
799
799
* result == ( self . as_ptr( ) as * const u8 ) . offset_from( origin. as_ptr( ) as * const u8 )
0 commit comments