Skip to content

Make it easy to use external-macro-backtrace #6049

@dhardy

Description

@dhardy

Yes, stupid title, for a stupid issue. I know it was decided a while back not to support pass-through of unknown options to Rustc, which implies that Rustc options should be replicated in Cargo.

Currently, one must switch to the nightly compiler then can:

  1. RUSTFLAGS="-Z external-macro-backtrace" cargo test
    This works (in Bash), but requires all dependencies to be recompiled (unnecessarily since the option is only required for the failing crate, generally the final one).
  2. Run cargo test -v, copy the failing command and append -Z external-macro-backtrace
    This works but is tedious.

There are two ways to solve this:

  1. Enable the switch by default, everywhere (in nightly compilers). This would of course have to be a Rust decision not a Cargo one. See: show macro backtrace with -Z flag rust#45545
  2. Add a Cargo switch to add the appropriate Rustc switch (possibly only to the last binary).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustflagsArea: rustflagsS-propose-closeStatus: A team member has nominated this for closing, pending further input from the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions