File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 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> {
268268 #[ must_use]
269269 #[ inline]
270270 #[ unstable( feature = "strict_provenance" , issue = "95228" ) ]
271- pub fn addr ( self ) -> NonZeroUsize
272- where
273- T : Sized ,
274- {
271+ pub fn addr ( self ) -> NonZeroUsize {
275272 // SAFETY: The pointer is guaranteed by the type to be non-null,
276273 // meaning that the address will be non-zero.
277274 unsafe { NonZeroUsize :: new_unchecked ( self . pointer . addr ( ) ) }
@@ -286,10 +283,7 @@ impl<T: ?Sized> NonNull<T> {
286283 #[ must_use]
287284 #[ inline]
288285 #[ 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 {
293287 // SAFETY: The result of `ptr::from::with_addr` is non-null because `addr` is guaranteed to be non-zero.
294288 unsafe { NonNull :: new_unchecked ( self . pointer . with_addr ( addr. get ( ) ) as * mut _ ) }
295289 }
@@ -303,10 +297,7 @@ impl<T: ?Sized> NonNull<T> {
303297 #[ must_use]
304298 #[ inline]
305299 #[ 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 {
310301 self . with_addr ( f ( self . addr ( ) ) )
311302 }
312303
You can’t perform that action at this time.
0 commit comments