-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Vec::drain() doesn't document any guarantees on order #135710
Copy link
Copy link
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.
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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Location
rustlib/src/rust/library/alloc/src/vec/mod.rsonpub fn drain<R>(&mut self, range: R) -> Drain<'_, T, A>, line2603in stable1.84.0 (9fc6b4312 2025-01-07)Summary
"returning all removed elements as an iterator" remains ambiguous on the order of the elements.
I assume
drainwill continue to yield the items in the range order so could this be a documented guarantee?