Tracking Issue for [*const T|*mut T]::with_metadata_of · Issue #75091 · rust-lang/rust (original) (raw)
Feature gate: #![feature(set_ptr_value)]
Public API
impl<T: ?Sized> *mut T { pub fn with_metadata_of<U: ?Sized>(self, val: *const U) -> *mut U; }
impl<T: ?Sized> *const T { pub fn with_metadata_of<U: ?Sized>(self, val: *const U) -> *const U; }
Steps / History
- Implementation: adds [*mut|*const] ptr::set_ptr_value #74774
- Change type and add
#[must_use]
: Requested changes to [*mut T|*const T]::set_ptr_value #75407 - Reverse argument order and rename to
with_metadata_of
: Refactor set_ptr_value as with_metadata_of #95249 - Const argument for mutable with_metadata_of: Adjust argument type for mutable with_metadata_of (#75091) #103346
- Final commenting period (FCP)
- Stabilization PR
Unresolved Questions
- Correct argument type --
*mut ()
?*mut u8
?*mut Opaque
? - Is this even needed/useful given that there now also is Tracking Issue for pointer metadata APIs #81513?