derive_more
derive_more copied to clipboard
Optionally have trait methods use `track_caller` to push panic information to the caller
Hopefully the issue title is fairly self-explanatory. Is this a desirable feature? This could take the form of an optional track_caller feature.
For which derives are you interested in this specifically?
Specifically, the operator traits (add, mul, etc.). I've got a client type that often experiences overflows in those operators, and no ability to unwind the stack on my target platform, so I end up with panic messages that point to the middle of the derive code rather than the use location.
Ah, okay yeah that does seem annoying. I think for operators it indeed makes sense to add track_caller. Could you send a PR for that?
To clarify I don't think this needs to be an optional feature, but can simply be done always for add and mul derives.
I'm not too familiar with the codebase, is there some specific location that's best to start implementing this?
Thanks so much for implementing this! This will make debugging fixed-point ops on embedded platforms without stack traces infinitely easier!