File tree 1 file changed +3
-12
lines changed
1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -268,10 +268,7 @@ impl<T: ?Sized> NonNull<T> {
268
268
#[ must_use]
269
269
#[ inline]
270
270
#[ unstable( feature = "strict_provenance" , issue = "95228" ) ]
271
- pub fn addr ( self ) -> NonZeroUsize
272
- where
273
- T : Sized ,
274
- {
271
+ pub fn addr ( self ) -> NonZeroUsize {
275
272
// SAFETY: The pointer is guaranteed by the type to be non-null,
276
273
// meaning that the address will be non-zero.
277
274
unsafe { NonZeroUsize :: new_unchecked ( self . pointer . addr ( ) ) }
@@ -286,10 +283,7 @@ impl<T: ?Sized> NonNull<T> {
286
283
#[ must_use]
287
284
#[ inline]
288
285
#[ unstable( feature = "strict_provenance" , issue = "95228" ) ]
289
- pub fn with_addr ( self , addr : NonZeroUsize ) -> Self
290
- where
291
- T : Sized ,
292
- {
286
+ pub fn with_addr ( self , addr : NonZeroUsize ) -> Self {
293
287
// SAFETY: The result of `ptr::from::with_addr` is non-null because `addr` is guaranteed to be non-zero.
294
288
unsafe { NonNull :: new_unchecked ( self . pointer . with_addr ( addr. get ( ) ) as * mut _ ) }
295
289
}
@@ -303,10 +297,7 @@ impl<T: ?Sized> NonNull<T> {
303
297
#[ must_use]
304
298
#[ inline]
305
299
#[ unstable( feature = "strict_provenance" , issue = "95228" ) ]
306
- pub fn map_addr ( self , f : impl FnOnce ( NonZeroUsize ) -> NonZeroUsize ) -> Self
307
- where
308
- T : Sized ,
309
- {
300
+ pub fn map_addr ( self , f : impl FnOnce ( NonZeroUsize ) -> NonZeroUsize ) -> Self {
310
301
self . with_addr ( f ( self . addr ( ) ) )
311
302
}
312
303
You can’t perform that action at this time.
0 commit comments