This is a tracking issue for the MaybeDangling type, as described by this RFC.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
- Implement the RFC (looking for someone who's willing to do this :)
- Finish the RFC, have it accepted
- Adjust documentation (see instructions on rustc-dev-guide)
- Formatting for new syntax has been added to the Style Guide (nightly-style-procedure)
- Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions
- What are the exact validity requirements of
MaybeDanglingreferences? - Does
MaybeDangling<&[mut] T>make any requirements about the pointer's provenance? unsafe-code-guidelines#605 - Is there a better name? Another way to describe this type, apt for some of its usecases, is as "suppressing the implicit move constructor that some Rust types have".
- Should it implement all the same traits as
ManuallyDrop(Deref,PartialEq, etc)? Should we make it less of a footgun by making it harder to accidentally access dangling references?
(also, see RFC)