-Z macro-backtrace
is a rustc
flag, not a cargo
flag. You should be able to pass it to rustc
using cargo +nightly rustc -- -Z macro-backtrace
. (The +nightly
in the command line is optional if you already switched to the nightly compiler as the default.)
Alternatively, you can set the RUSTFLAGS
environment variable:
export RUSTFLAGS="-Z macro-backtrace"