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.
Location
In the documentation for the following functions:
alloc::vec::Vec.resize()alloc::vec::Vec.resize_with()I noted some trait impls where they might want to be added (such as the
Extendtrait impls onVec), 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:
as they all, in one way or another, call
Vec.reserve(), which itself will panic if the new capacity exceedsisize::MAXbytes.Because other functions that call
Vec.reserve()(such asVec.push()orVec::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 theisize::MAXbyte limit.