Closed josephlr closed 2 months ago
Also see:
src/seq/index.rs:225
, 288rand_core/src/le.rs
The reference uses
std::panic::Location::caller
. Is it worth doing this too for better error messages?
I think that's mostly if we wanted to print out the location, or use the location for something else. If we are just panicking anyway, I think just using #[track_caller] is fine, that's what libstd does for things like .unwrap().
BTW, I was hoping you'd give #1424 a review — not sure if you missed the comment there?
BTW, I was hoping you'd give #1424 a review — not sure if you missed the comment there?
Whoops, I did miss that. Ill try to take a look sometime this week.
Fixes #1437
This makes it easier to diagnose problems when the preconditions of these methods are not met.
I think I found most of the cases where we can panic based on bad user input. Let me know if I missed any.
We don't use
#[track_caller]
for the panics originating from failing to initializedthread_rng
as this is more of a "global" problem than a "local" problem.