How to find Vec indexing in source code?

I'm debugging a out-of-bound indexing panic in a Rust library. There is no stack trace as it was not enabled. And I'm not able to reproduce the panic yet. I also tried Miri cargo miri test but didn't find issues.

Just wondering, is there a tool to help list all Vec indexing in a source code file? I wanted to review them one by one.

Enable the clippy lint indexing_slicing. E.g., to skip all lints except indexing:

cargo clippy -- -A clippy::all -W clippy::indexing_slicing
1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.