Description
openedon Jan 4, 2021
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
- Implementation of
ptr::copy
andptr::copy_nonoverlapping
asconst fn
: Make copy[_nonoverlapping] const #79684- Link to this issue in feature gate: const_intrinsic_copy - Add Reference to tracking issue #80699
- Also constify
copy_to
,copy_from
and friends : Constifycopy
related functions #83091 - Final commenting period (FCP)
- Stabilization PR: Stabilize
const_intrinsic_copy
#97276 - De-stabilization PR: revert stabilization of const_intrinsic_copy #117905
- TODO: new stabilization PR, once Tracking issue for
&mut T
in const contexts (const_mut_refs) #57349 is stable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment