Skip to content

Backtrace does not include file and line number on non-Linux platforms #24346

Closed
@kornelski

Description

@kornelski

When a Rust program run with RUST_BACKTRACE=1 panics it outputs backtrace which only has function names (with noisy hashes), but doesn't include file names and line numbers.

 RUST_BACKTRACE=1 cargo run --verbose --example test

12: 0x1088db5d9 - main::hed092b4e13c9cca7Iaa

During development (not necessarily in release builds), I'd prefer something like:

12: 0x1088db5d9 - main() at test.rs:10

Sometimes line numbers are very important, e.g. if the panic is some generic out-of-bounds assertion, and the function uses vectors and slices in many places, just the name is not enough to pinpoint the offending expression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-androidOperating system: AndroidO-macosOperating system: macOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions