Feature gate: #![feature(ptr_const_cast)]
This is a tracking issue for methods on pointers for casting constness without changing the type
Public API
impl<T: ?Sized> *const T {
pub fn as_mut(self) -> *mut T;
}
impl<T: ?Sized> *mut T {
pub fn as_const(self) -> *const T;
}
Steps / History
Unresolved Questions
*mut T also already has as_mut() which does something different and has a different signature, adding a mehod of the same name to *const T could be confusing, so maybe a better name should be used. cast_const/cast_mut was suggested. Resolved to use cast_*
Feature gate:
#![feature(ptr_const_cast)]This is a tracking issue for methods on pointers for casting constness without changing the type
Public API
Steps / History
Unresolved Questions
Resolved to use*mut Talso already hasas_mut()which does something different and has a different signature, adding a mehod of the same name to*const Tcould be confusing, so maybe a better name should be used.cast_const/cast_mutwas suggested.cast_*