-
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-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Description
Location
Any try_reserve
methods of container types (12 in Rust 1,62.1, including duplicated ones in alloc
), and maybe corresponding try_reserve_exact
methods.
std::collections::BinaryHeap::try_reserve[_exact]
std::collections::VecDeque::try_reserve[_exact]
std::collections::HashMap::try_reserve
std::collections::HashSet::try_reserve
std::ffi::OsString::try_reserve[_exact]
std::path::PathBuf::try_reserve[_exact]
std::string::String::try_reserve[_exact]
std::vec::Vec::try_reserve[_exact]
- ... and corresponding methods in
alloc
.
Summary
Documentations for try_reserve
describes "If the capacity overflows, or the allocator reports a failure, then an error is returned.".
However, it does not give any guarantees about whether the content is preserved or not on that error.
This guarantee (or absence of the guarantee) should be explicitly described.
8573, jdahlstrom, kpreid, kazzix14 and U007D
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-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.