@@ -139,8 +139,8 @@ impl<T: Sized> NonNull<T> {
139
139
#[ must_use]
140
140
#[ unstable( feature = "ptr_as_uninit" , issue = "75402" ) ]
141
141
#[ rustc_const_unstable( feature = "ptr_as_uninit" , issue = "75402" ) ]
142
- #[ requires( ub_checks:: can_dereference( self . as_ptr( ) ) ) ] // Ensure the pointer is valid to create a reference.
143
- #[ ensures( |result: &&MaybeUninit <T >| core:: ptr:: eq( * result, self . cast( ) . as_ptr( ) ) ) ] // Ensure returned reference points to the correct memory location.
142
+ #[ requires( ub_checks:: can_dereference( self . as_ptr( ) ) ) ] // Ensure the pointer is valid to create a reference.
143
+ #[ ensures( |result: &&MaybeUninit <T >| core:: ptr:: eq( * result, self . cast( ) . as_ptr( ) ) ) ] // Ensure returned reference points to the correct memory location.
144
144
pub const unsafe fn as_uninit_ref < ' a > ( self ) -> & ' a MaybeUninit < T > {
145
145
// SAFETY: the caller must guarantee that `self` meets all the
146
146
// requirements for a reference.
@@ -165,8 +165,8 @@ impl<T: Sized> NonNull<T> {
165
165
#[ must_use]
166
166
#[ unstable( feature = "ptr_as_uninit" , issue = "75402" ) ]
167
167
#[ rustc_const_unstable( feature = "ptr_as_uninit" , issue = "75402" ) ]
168
- #[ requires( ub_checks:: can_dereference( self . as_ptr( ) ) ) ] // Ensure pointer is valid to create a mutable reference.
169
- #[ ensures( |result: &&mut MaybeUninit <T >| core:: ptr:: eq( * result, self . cast( ) . as_ptr( ) ) ) ] // Ensure the returned reference points to the correct memory.
168
+ #[ requires( ub_checks:: can_dereference( self . as_ptr( ) ) ) ] // Ensure pointer is valid to create a mutable reference.
169
+ #[ ensures( |result: &&mut MaybeUninit <T >| core:: ptr:: eq( * result, self . cast( ) . as_ptr( ) ) ) ] // Ensure the returned reference points to the correct memory.
170
170
pub const unsafe fn as_uninit_mut < ' a > ( self ) -> & ' a mut MaybeUninit < T > {
171
171
// SAFETY: the caller must guarantee that `self` meets all the
172
172
// requirements for a reference.
0 commit comments