Feature gate: #![feature(vec_as_non_null)]
This is a tracking issue for Vec::as_non_null()
See also #157345 for a similar feature.
Public API
impl<T, A: Allocator> Vec<T, A> { pub const fn as_non_null(&mut self) -> NonNull<T> { .... } }
Steps / History
(Remember to update the S-tracking-* label when checking boxes.)
- ACP:
Vec::as_non_null()method libs-team#440 - Implementation:
- Add
Vec::as_non_null#130624- The above implementation added the method to the
box_vec_non_nullfeature, at the tracking issue Tracking Issue forbox_vec_non_null#130364
- The above implementation added the method to the
- This method has
#[rustc_as_ptr]added to it, and is split out of thebox_vec_non_nullfeature into its own feature (this tracking issue): Partially stabilizebox_vec_non_null#157226
- Add
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- Confirm whether we want a
&selfor&mut selfargument.- See previous discussion at #t-opsem > Should `slice/Vec::as_non_null`take `&self` or `&mut self`? and Libs-API Meeting 2026-06-09