rust-decimal
rust-decimal copied to clipboard
`track_caller`
It would be useful if operations that can panic were marked with #[track_caller] to make it easier to find the location of e.g. division-by-0 errors.
So it looks like the purpose of this function is to give the first guess at to where to attribute a panic to when not printing a full callstack.
https://doc.rust-lang.org/reference/attributes/codegen.html#examples
If I understand this correctly, then the work is to:
- Identify internal functions that call
panicand add the#[track_caller]attribute to them - Recursively identify all functions that call functions that have the
#[track_caller]and add the#[track_caller]attribute to them
And that should be it.