Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
The Rust crate backtrace-on-stack-overflow helps printing the stack backtrace when your Rust program encounters stack overflow issues.
-
Add backtrace-on-stack-overflow as a dependency into your project.
cargo add backtrace-on-stack-overflow
-
Add the line
unsafe { backtrace_on_stack_overflow::enable() };
into the beginning of your main function.fn main() { unsafe { backtrace_on_stack_overflow::enable() }; /* your code ... */ }
-
Run your project again.