3 ms·
But that backtrace doesn't actually tell you what function the error occurred in. The function stack would be this (discarding everything outside of my code):
by Measter 6y ago
But that backtrace doesn't actually tell you what function the error occurred in. The function stack would be this (discarding everything outside of my code):
1: ImageData::verify_and_update - src\main.rs:104
2: run - src\main.rs:653
3: main - src\main.rs:673
That's why the backtrace is worthless here. It doesn't actually tell you where you were in the chain of function calls. In this case, it's relatively simple, so just knowing the line does help. But in a more complex application you could end up in a scenario where a function is called in multiple places, with different call stacks, and you don't know how you even got there because things were inlined and the backtrace doesn't tell you.
- jcelerier 6y agoI don't know how rust's error libraries work but I definitely don't have this issue in C++ - the top of the backtrace is pretty much always where the error is