Improve panic messages for Vec methods #70524
Labels
A-collections
Area: `std::collection`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
I've spotted, that
remove()
panic message could've provided details on what values led to this panic, instead of mentioning condition only. Generally speaking this and some otherassert!
s in Vec could've been more detailed. If it's okay to step in, I'd like to offer my help.In case of
remove
I'd suggest calling this insteadI find this more informative than
assertion failed: index < len
Candidates for improval:
aforementioned
remove
:rust/src/liballoc/vec.rs
Line 1034 in 5f13820
insert
:rust/src/liballoc/vec.rs
Line 994 in 5f13820
drain
:rust/src/liballoc/vec.rs
Lines 1292 to 1293 in 5f13820
split_off
:rust/src/liballoc/vec.rs
Line 1383 in 5f13820
The text was updated successfully, but these errors were encountered: