Feature gate: #![feature(pointer_try_cast_aligned)]
This is a tracking issue for adding the convenience method try_cast_aligned to *const T, *mut T and NonNull<T>.
impl<T: ?Sized> *const T {
pub fn try_cast_aligned<U: Sized>(self) -> Option<*const U>;
}
impl<T: ?Sized> *mut T {
pub fn try_cast_aligned<U: Sized>(self) -> Option<*mut U>;
}
impl<T: ?Sized> NonNull<T> {
pub fn try_cast_aligned<U: Sized>(self) -> Option<NonNull<U>>;
}
Steps / History
Unresolved Questions
None yet.
Feature gate:
#![feature(pointer_try_cast_aligned)]This is a tracking issue for adding the convenience method
try_cast_alignedto*const T,*mut TandNonNull<T>.Steps / History
ptr::is_aligned_for::<U>libs-team#588ptr::try_cast_alignedandNonNull::try_cast_aligned. #141222ptr::try_cast_aligned#154170Unresolved Questions
None yet.