Feature gate: #![feature(const_intrinsic_copy)]
This is a tracking issue for making the functions ptr::copy and ptr::copy_nonoverlapping as well as some related functions const fn.
Public API
mod ptr {
pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize);
}
impl *const T {
pub const unsafe fn copy_to(self, dest: *mut T, count: usize);
pub const unsafe fn copy_to_nonoverlapping(self, dest: *mut T, count: usize);
}
impl *mut T {
pub const unsafe fn copy_to(self, dest: *mut T, count: usize);
pub const unsafe fn copy_to_nonoverlapping(self, dest: *mut T, count: usize);
pub const unsafe fn copy_from(self, src: *const T, count: usize);
pub const unsafe fn copy_from_nonoverlapping(self, src: *const T, count: usize);
}
Steps / History
Feature gate:
#![feature(const_intrinsic_copy)]This is a tracking issue for making the functions
ptr::copyandptr::copy_nonoverlappingas well as some related functionsconst fn.Public API
Steps / History
ptr::copyandptr::copy_nonoverlappingasconst fn: Make copy[_nonoverlapping] const #79684copy_to,copy_fromand friends : Constifycopyrelated functions #83091const_intrinsic_copy#97276&mut Tin const contexts (const_mut_refs) #57349 is stable