-
Notifications
You must be signed in to change notification settings - Fork 432
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
Annotate functions with #[track_caller] #1437
Comments
The main issue here is that we don't have I'll update the description to reflect this. In the meantime, you can debug such panics by doing what the error message suggests: passing
We probably won't do this as it would be very disruptive to all users of |
If you prefer to get a |
Summary
Hi, I suggest that code should error at the line that is written by developer not in the crate itself when rand fails.
Details
What I mean is:
4th line will fail as we all know, because there is no random number can be produced between them. But problem is when this line fails we get error from inside of the crate not the line itself.
This makes code hard to debug. You may say can't you see there is a problem, yes I can, but while using variables inside loops or something like that, it's really hard. Especially if there are more rand line then one. It's hard to find which line fails. Only way to find where it's fails is debugging as far as I know.
Motivation
I think for friendliness about Rust ecosystem especially for compile errors. This errors should raise on the precise line.
Alternatives
as an alternative =
may return option so developer can handle errors.
The text was updated successfully, but these errors were encountered: