Tracking Issue for `borrowed_buf_init`
Open
Nobody has claimed this yet.
C-tracking-issue
S-tracking-unimplemented
T-libs
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Feature gate: #![feature(borrowed_buf_init)]
This is a tracking issue for borrowed_buf_init
Public API
impl<'data, T> BorrowedBuf<'data, T> {
pub fn is_init(&self) -> bool;
}
impl<'data, T: Copy> BorrowedBuf<'data, T> {
pub unsafe fn set_init(&mut self) -> &mut Self;
}
impl<'a, T: Copy> BorrowedCursor<'a, T> {
pub fn is_init(&self) -> bool;
pub unsafe fn set_init(&mut self);
pub fn advance_checked(&mut self, n: usize) -> &mut Self;
}
impl<'a> BorrowedCursor<'a, u8> {
pub fn ensure_init(&mut self) -> &mut [u8];
}
Steps / History
- Implementation on the preexisting tracking issues: https://github.com/rust-lang/rust/issues/78485, https://github.com/rust-lang/rust/issues/117693
- Make
ensure_initgeneric overT: Default: #160432 - Final comment period (FCP)^1
- Stabilization PR
Unresolved Questions
- Can the bounds for
ensure_initbe weakened toT: Default? Or should we have API more similar to[T: Clone]::fill(&mut self, value: T)/[T]::fill_with<F: FnMut() -> T>(&mut self, f: F)?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the listed BorrowedBuf and BorrowedCursor API and issue #160432 first, then review the feature-lifecycle stabilization guidance linked in the tracking issue. Done means resolving the ensure_init bounds question, completing the final comment period, and producing the stabilization PR.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100