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.
Location
Any
try_reservemethods of container types (12 in Rust 1,62.1, including duplicated ones inalloc), and maybe correspondingtry_reserve_exactmethods.std::collections::BinaryHeap::try_reserve[_exact]std::collections::VecDeque::try_reserve[_exact]std::collections::HashMap::try_reservestd::collections::HashSet::try_reservestd::ffi::OsString::try_reserve[_exact]std::path::PathBuf::try_reserve[_exact]std::string::String::try_reserve[_exact]std::vec::Vec::try_reserve[_exact]alloc.Summary
Documentations for
try_reservedescribes "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.