-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(ptr_from_ref)]
This is a tracking issue for ptr::from_{ref,mut}
: methods to turn references into raw pointers without using as
casts. We have methods to avoid almost all as casts around raw pointer handling, except for the initial cast from reference to raw pointer. These new methods close that gap. They also ensure that the pointee type T
remains the same, without one having to repeat that type for the cast.
Public API
pub fn from_ref<T: ?Sized>(r: &T) -> *const T;
pub fn from_mut<T: ?Sized>(r: &mut T) -> *mut T;
Steps / History
- Implementation: add ptr::from_{ref,mut} #104977
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.
Footnotes
DianaNites, SUPERCILEX, KisaragiEffective, tgross35 and briansmithDianaNites, SUPERCILEX, rodrimati1992 and joboetDianaNites, SUPERCILEX and briansmith
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.