bitvec
bitvec copied to clipboard
Use #[track_caller] attribute
trafficstars
I sometimes get panics like this:
thread 'tests::test_verify_fn' panicked at 'range ..22 out of bounds: 10', .../.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitvec-1.0.1/src/slice/api.rs:2702:1
It is not very helpful error because it doesn't show where error happened in my code (which is the most likely cause of such errors).
Rust has #[track_caller] that can make error point to the code that user of the library wrote instead and it would be a significant improvement for developer experience.
A change adding #[track_caller] got merged a few weeks ago. This should be resolved by the next release.
Actually I've opened https://github.com/ferrilab/bitvec/pull/230 after running into another crash without the attribute.