Our current MSRV is 1.46, which introduced track_caller which can be used to make panic messages better.
We should ensure that all methods that can panic when misused are annotated with #[track_caller] so the panic message includes the file/line where the user called the Tokio method instead of showing the file/line inside the Tokio source. If the panic is a few calls deep in Tokio, then I believe each internal method needs its own #[track_caller]
One example where this should be done: Handle::current(), but there probably are others.
Ideally, we also add tests that verify the behavior.
Our current MSRV is 1.46, which introduced track_caller which can be used to make panic messages better.
We should ensure that all methods that can panic when misused are annotated with
#[track_caller]so the panic message includes the file/line where the user called the Tokio method instead of showing the file/line inside the Tokio source. If the panic is a few calls deep in Tokio, then I believe each internal method needs its own#[track_caller]One example where this should be done:
Handle::current(), but there probably are others.Ideally, we also add tests that verify the behavior.