@@ -332,12 +332,8 @@ impl<T: ?Sized> NonNull<T> {
332
332
/// This is a [Strict Provenance][crate::ptr#strict-provenance] API.
333
333
#[ must_use]
334
334
#[ inline]
335
- <<<<<<< HEAD
336
- #[ stable ( feature = "strict_provenance" , since = "CURRENT_RUSTC_VERSION" ) ]
337
- #[ ensures( |result| result. get( ) == self . as_ptr( ) as * const ( ) as usize) ]
338
- =======
339
335
#[ stable( feature = "strict_provenance" , since = "1.84.0" ) ]
340
- >>>>>>> 9 c1e515a1356d2d232f1823051c3dc7bd948b534
336
+ # [ ensures ( |result| result . get ( ) == self . as_ptr ( ) as * const ( ) as usize ) ]
341
337
pub fn addr ( self ) -> NonZero < usize > {
342
338
// SAFETY: The pointer is guaranteed by the type to be non-null,
343
339
// meaning that the address will be non-zero.
@@ -365,12 +361,8 @@ impl<T: ?Sized> NonNull<T> {
365
361
/// This is a [Strict Provenance][crate::ptr#strict-provenance] API.
366
362
#[ must_use]
367
363
#[ inline]
368
- <<<<<<< HEAD
369
- #[ stable ( feature = "strict_provenance" , since = "CURRENT_RUSTC_VERSION" ) ]
370
- #[ ensures ( |result: & Self | !result. as_ptr ( ) . is_null( ) && result. addr( ) == addr) ]
371
- =======
372
364
#[ stable( feature = "strict_provenance" , since = "1.84.0" ) ]
373
- >>>>>>> 9 c1e515a1356d2d232f1823051c3dc7bd948b534
365
+ # [ ensures ( |result : & Self | !result . as_ptr ( ) . is_null ( ) && result . addr ( ) == addr ) ]
374
366
pub fn with_addr ( self , addr : NonZero < usize > ) -> Self {
375
367
// SAFETY: The result of `ptr::from::with_addr` is non-null because `addr` is guaranteed to be non-zero.
376
368
unsafe { NonNull :: new_unchecked ( self . as_ptr ( ) . with_addr ( addr. get ( ) ) as * mut _ ) }
@@ -384,12 +376,8 @@ impl<T: ?Sized> NonNull<T> {
384
376
/// This is a [Strict Provenance][crate::ptr#strict-provenance] API.
385
377
#[ must_use]
386
378
#[ inline]
387
- <<<<<<< HEAD
388
- #[ stable ( feature = "strict_provenance" , since = "CURRENT_RUSTC_VERSION" ) ]
389
- #[ ensures ( |result: & Self | !result. as_ptr( ) . is_null( ) ) ]
390
- =======
391
379
#[ stable( feature = "strict_provenance" , since = "1.84.0" ) ]
392
- >>>>>>> 9 c1e515a1356d2d232f1823051c3dc7bd948b534
380
+ # [ ensures ( |result : & Self | !result . as_ptr ( ) . is_null ( ) ) ]
393
381
pub fn map_addr ( self , f : impl FnOnce ( NonZero < usize > ) -> NonZero < usize > ) -> Self {
394
382
self . with_addr ( f ( self . addr ( ) ) )
395
383
}
@@ -745,16 +733,12 @@ impl<T: ?Sized> NonNull<T> {
745
733
#[ must_use = "returns a new pointer rather than modifying its argument" ]
746
734
#[ stable( feature = "non_null_convenience" , since = "1.80.0" ) ]
747
735
#[ rustc_const_stable( feature = "non_null_convenience" , since = "1.80.0" ) ]
748
- <<<<<<< HEAD
749
- #[ cfg_attr( bootstrap, rustc_allow_const_fn_unstable( unchecked_neg) ) ]
750
736
#[ requires(
751
737
count. checked_mul( core:: mem:: size_of:: <T >( ) ) . is_some( ) &&
752
738
count * core:: mem:: size_of:: <T >( ) <= isize :: MAX as usize &&
753
- kani :: mem :: same_allocation( self . as_ptr( ) , self . as_ptr( ) . wrapping_sub( count) )
739
+ ub_checks :: same_allocation( self . as_ptr( ) , self . as_ptr( ) . wrapping_sub( count) )
754
740
) ]
755
741
#[ ensures( |result: & NonNull <T >| result. as_ptr( ) == self . as_ptr( ) . offset( -( count as isize ) ) ) ]
756
- =======
757
- >>>>>>> 9 c1e515a1356d2d232f1823051c3dc7bd948b534
758
742
pub const unsafe fn sub ( self , count : usize ) -> Self
759
743
where
760
744
T : Sized ,
@@ -1322,14 +1306,10 @@ impl<T: ?Sized> NonNull<T> {
1322
1306
/// [`ptr::swap`]: crate::ptr::swap()
1323
1307
#[ inline( always) ]
1324
1308
#[ stable( feature = "non_null_convenience" , since = "1.80.0" ) ]
1325
- <<<<<<< HEAD
1326
- #[ rustc_const_unstable ( feature = "const_swap" , issue = "83163" ) ]
1309
+ #[ rustc_const_stable( feature = "const_swap" , since = "1.85.0" ) ]
1327
1310
#[ cfg_attr( kani, kani:: modifies( self . as_ptr( ) , with. as_ptr( ) ) ) ]
1328
1311
#[ requires( ub_checks:: can_dereference( self . as_ptr( ) ) && ub_checks:: can_write( self . as_ptr( ) ) ) ]
1329
1312
#[ requires( ub_checks:: can_dereference( with. as_ptr( ) ) && ub_checks:: can_write( with. as_ptr( ) ) ) ]
1330
- =======
1331
- #[ rustc_const_stable ( feature = "const_swap" , since = "1.85.0" ) ]
1332
- >>>>>>> 9 c1e515a1356d2d232f1823051c3dc7bd948b534
1333
1313
pub const unsafe fn swap ( self , with : NonNull < T > )
1334
1314
where
1335
1315
T : Sized ,
0 commit comments