String methods do not acknowladge isize::MAX limit like Vec methods do
Opened this issue · 3 comments
lolbinarycat commented
Location (URL)
https://doc.rust-lang.org/nightly/std/string/struct.String.html#method.reserve
Summary
All the Vec methods that allocate give a disclaimer about how Rust allocations can't exceed isize::MAX bytes, however, (most) String methods that allocate do not have the same disclaimer.
reserve and reserve_exact are the worst here, as they actually have the wrong disclaimer, claiming the limit is usize::MAX instead!
hanna-kruppe commented
Oh, wow, the "reserve panics if the new capacity overflows usize" claim dates back to when the type was still called uint 🙃
leftmostcat commented
I'd like to work on this.
lolbinarycat commented
@leftmostcat cc me in the PR.