Skip to content

Documentation for the RUST_BACKTRACE environment variable is superficial and hard to find #148695

@miikkas

Description

@miikkas

Summary

When panicking a Rust-made binary, for example with:

echo 'fn main() { panic!(); }' | rustc - && ./rust_out

The 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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-backtraceArea: BacktracesA-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions