Skip to content

String methods do not acknowladge isize::MAX limit like Vec methods do #148598

@lolbinarycat

Description

@lolbinarycat

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!

Metadata

Metadata

Assignees

Labels

A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-strArea: str and StringE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.P-mediumMedium priorityT-libsRelevant to the library team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions