Closed
Description
Feature gate: #![feature(const_ptr_write)]
This is a tracking issue for making the functions ptr::write
and ptr::write_unaligned
, and the same methods on *mut T
, const fn
.
Public API
mod ptr {
pub const unsafe fn write<T>(dst: *mut T, src: T);
pub const unsafe fn write_unaligned<T>(dst: *mut T, src: T);
pub const unsafe fn write_bytes<T>(dst: *mut T, val: u8, count: usize);
}
impl<T> *mut T {
pub const unsafe fn write(self, val: T);
pub const unsafe fn write_unaligned(self, val: T);
pub const unsafe fn write_bytes(self, val: u8, count: usize);
}
impl <T> NonNull<T> {
pub const unsafe fn write(self, val: T);
pub const unsafe fn write_unaligned(self, val: T);
pub const unsafe fn write_bytes(self, val: u8, count: usize);
}
Steps / History
- Implementation: Make ptr::write const #81167
- Reverted: Make copy/copy_nonoverlapping fn's again #86003
- Re-constified: Revert revert of constness in #86003 #86295
-
core::intrinsics::write_bytes
akaptr::write_bytes
- Makeintrinsics::write_bytes
const #90081 -
(*mut T)::write_bytes
- Make(*mut T)::write_bytes
const
#91824 - blocked on Tracking issue for
&mut T
in const contexts (const_mut_refs) #57349 -
NonNull
methods stabilized,const
ness moved to this gate Stabilizenon_null_convenience
#124498 - Final commenting period (FCP)
- Stabilization PR
Related
- const_ptr_read Tracking Issue for const_ptr_read #80377
Unresolved Questions
- None yet.