-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-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
Location
rustlib/src/rust/library/alloc/src/vec/mod.rs
on pub fn drain<R>(&mut self, range: R) -> Drain<'_, T, A>
, line 2603
in stable 1.84.0 (9fc6b4312 2025-01-07)
Summary
/// Removes the specified range from the vector in bulk, returning all
/// removed elements as an iterator. If the iterator is dropped before
/// being fully consumed, it drops the remaining removed elements.
"returning all removed elements as an iterator" remains ambiguous on the order of the elements.
I assume drain
will continue to yield the items in the range order so could this be a documented guarantee?
ProgramCrafter
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-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.