-
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 toolsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.T-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.
Description
Location
In the documentation for the following functions:
I noted some trait impls where they might want to be added (such as the Extend
trait impls on Vec
), but I'm unsure if it makes sense for the "Panics" notes to be added to them.
Summary
These should be marked with the following:
# Panics
Panics if the new capacity exceeds `isize::MAX` bytes.
as they all, in one way or another, call Vec.reserve()
, which itself will panic if the new capacity exceeds isize::MAX
bytes.
Because other functions that call Vec.reserve()
(such as Vec.push()
or Vec::with_capacity()
) are marked with this "Panics" note, not marking these could result in confusion - namely, the user might think that these functions somehow allow bypassing the isize::MAX
byte limit.
qsantos
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 toolsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.T-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.