-
Notifications
You must be signed in to change notification settings - Fork 14k
Description
Summary
When panicking a Rust-made binary, for example with:
echo 'fn main() { panic!(); }' | rustc - && ./rust_outThe crash message advices to use RUST_BACKTRACE for getting the backtrace:
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Or following the advice, further help for getting a verbose backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Getting this info from the compiled binary is great, but it would be good to have the information
available in the web documentation as well. Currently, it is both a bit hard to locate from the
official documentation resources and not very thorough.
Some official documentation that does mention RUST_BACKTRACE:
- The best documentation currently lives in The Rust Programming Language book.
- Some details can be found in the standard library documentation, although you
need to use an external search engine for that. - The Rust Unstable Book currently says that the environment variable has no
documentation, and therefore is likely internal to the compiler and not meant for general use.
I think it would be useful to have public documentation for at least the same things that the binary
says. A brief mention in the Rust Reference about the generated binary's traceback
capabilities' availability under certain circumstances would not seem out-of-place to me.
@rustbot label +A-backtrace