3 ms·
I'd love it if some Rust insiders could comment on how Rust might implement the stack trace feature (assuming they did decide to implement it). Perhaps a trait
by charlieflowers 11y ago
I'd love it if some Rust insiders could comment on how Rust might implement the stack trace feature (assuming they did decide to implement it). Perhaps a trait such as "GeneratesStacktrace" that can be implemented with "Derives"? And the stack trace is only available in a Debug build when you compile with the appropriate flags?
- kibwen 11y agoI've barely given it any thought, but one approach would just be to modify the try! macro to dump a backtrace to stderr when an Err is encountered in debug mode. The backtrace itself could be generated the same way that they're generated for C++.