File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -2790,7 +2790,7 @@ impl<T: ?Sized> Unique<T> {
2790
2790
}
2791
2791
2792
2792
/// Acquires the underlying `*mut` pointer.
2793
- pub fn as_ptr ( self ) -> * mut T {
2793
+ pub const fn as_ptr ( self ) -> * mut T {
2794
2794
self . pointer as * mut T
2795
2795
}
2796
2796
@@ -2903,7 +2903,7 @@ impl<T: Sized> NonNull<T> {
2903
2903
/// some other means.
2904
2904
#[ stable( feature = "nonnull" , since = "1.25.0" ) ]
2905
2905
#[ inline]
2906
- pub fn dangling ( ) -> Self {
2906
+ pub const fn dangling ( ) -> Self {
2907
2907
unsafe {
2908
2908
let ptr = mem:: align_of :: < T > ( ) as * mut T ;
2909
2909
NonNull :: new_unchecked ( ptr)
@@ -2966,7 +2966,7 @@ impl<T: ?Sized> NonNull<T> {
2966
2966
/// Cast to a pointer of another type
2967
2967
#[ stable( feature = "nonnull_cast" , since = "1.27.0" ) ]
2968
2968
#[ inline]
2969
- pub fn cast < U > ( self ) -> NonNull < U > {
2969
+ pub const fn cast < U > ( self ) -> NonNull < U > {
2970
2970
unsafe {
2971
2971
NonNull :: new_unchecked ( self . as_ptr ( ) as * mut U )
2972
2972
}
You can’t perform that action at this time.
0 commit comments