-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Open
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-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(vec_recycle)]
This is a tracking issue for the Vec::recycle method, which allows reusing a Vec in a loop even if the lifetime unification would otherwise disallow it.
Public API
// in alloc::vec
#![feature(transmutability)]
#![feature(trait_alias)]
use std::mem::{Assume, MaybeUninit, TransmuteFrom};
/// Implemented if the size and alignment `T` and `Self` are both equal.
trait Recyclable<T> =
for<'a> TransmuteFrom<&'a MaybeUninit<T>, { Assume::SAFETY }>
where
T: for<'a> TransmuteFrom<&'a MaybeUninit<Self>, { Assume::SAFETY }>;
impl<T> Vec<T> {
#[feature(vec_recycle)]
pub fn recycle<U>(self) -> Vec<U> where U: Recyclable<T>;
}Steps / History
- ACP: Vec::recycle libs-team#674
- Implementation: #...
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.
Footnotes
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-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.