Skip to content

Commit 67754b5

Browse files
committed
ptr::try_cast_aligned: remove forgotten const
1 parent 35b2bfd commit 67754b5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

library/core/src/ptr/const_ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl<T: ?Sized> *const T {
8888
#[must_use = "this returns the result of the operation, \
8989
without modifying the original"]
9090
#[inline(always)]
91-
pub const fn try_cast_aligned<U>(self) -> Option<*const U> {
91+
pub fn try_cast_aligned<U>(self) -> Option<*const U> {
9292
if self.is_aligned_to(align_of::<U>()) { Some(self.cast()) } else { None }
9393
}
9494

library/core/src/ptr/mut_ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl<T: ?Sized> *mut T {
7070
#[must_use = "this returns the result of the operation, \
7171
without modifying the original"]
7272
#[inline(always)]
73-
pub const fn try_cast_aligned<U>(self) -> Option<*mut U> {
73+
pub fn try_cast_aligned<U>(self) -> Option<*mut U> {
7474
if self.is_aligned_to(align_of::<U>()) { Some(self.cast()) } else { None }
7575
}
7676

library/core/src/ptr/non_null.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ impl<T: ?Sized> NonNull<T> {
511511
#[must_use = "this returns the result of the operation, \
512512
without modifying the original"]
513513
#[inline(always)]
514-
pub const fn try_cast_aligned<U>(self) -> Option<NonNull<U>> {
514+
pub fn try_cast_aligned<U>(self) -> Option<NonNull<U>> {
515515
if self.is_aligned_to(align_of::<U>()) { Some(self.cast()) } else { None }
516516
}
517517

0 commit comments

Comments
 (0)