Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use #[track_caller] attribute #223

Open
nazar-pc opened this issue May 5, 2023 · 2 comments
Open

Use #[track_caller] attribute #223

nazar-pc opened this issue May 5, 2023 · 2 comments

Comments

@nazar-pc
Copy link

nazar-pc commented May 5, 2023

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.

@connorskees
Copy link
Contributor

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

@connorskees
Copy link
Contributor

Actually I've opened #230 after running into another crash without the attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants