bitvec icon indicating copy to clipboard operation
bitvec copied to clipboard

Use #[track_caller] attribute

Open nazar-pc opened this issue 2 years ago • 2 comments
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.

nazar-pc avatar May 05 '23 02:05 nazar-pc

A change adding #[track_caller] got merged a few weeks ago. This should be resolved by the next release.

connorskees avatar Jun 15 '23 02:06 connorskees

Actually I've opened https://github.com/ferrilab/bitvec/pull/230 after running into another crash without the attribute.

connorskees avatar Jun 15 '23 03:06 connorskees