Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message gives a (depreciated/unimplemented) -Z flag #49535

Open
shingtaklam1324 opened this issue Mar 31, 2018 · 8 comments
Open

Error message gives a (depreciated/unimplemented) -Z flag #49535

shingtaklam1324 opened this issue Mar 31, 2018 · 8 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. D-confusing Diagnostics: Confusing error or lint that should be reworked. T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@shingtaklam1324
Copy link

Currently, when a macro fails, it gives this error:

note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

However, when running this:

cargo run -Z external-macro-backtrace

This error is given:

error: unknown `-Z` flag specified: external-macro-backtrace

version: 1.26.0-nightly (2018-03-19)

@steffengy
Copy link
Contributor

cargo run -Z affects cargo nightly flags, while external-macro-backtrace is a rustc flag.

You can pass it to rustc with cargo rustc -- -Z external-macro-backtrace, which only compiles your package.

Alternatively you can use the RUSTFLAGS environmental variable,
which will pass it to all compiler invocations
(including all dependencies, which you might not want in this case).

@shingtaklam1324
Copy link
Author

I see, but it might still make sense to say that in the error message, to diaambiguate

@GuillaumeGomez
Copy link
Member

cc @rust-lang/cargo

@pietroalbini pietroalbini added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. labels Apr 6, 2018
@estebank estebank added the D-confusing Diagnostics: Confusing error or lint that should be reworked. label Dec 20, 2019
@philip-peterson
Copy link

I was encountering this issue and tried cargo rustc -- -Z external-macro-backtrace but it yields:

error: unknown debugging option: `external-macro-backtrace`

@ehuss
Copy link
Contributor

ehuss commented Jul 5, 2020

It has been renamed to -Zmacro-backtrace.

@philip-peterson
Copy link

OK, maybe this ticket can update the help text as well because it still references external-macro-backtrace.

@xobs
Copy link
Contributor

xobs commented Aug 14, 2020

It looks like the text has been fixed (as of 2020-07-11).

It would be really nice if the compiler told you to specify rustc instead of build, however. I discovered this issue because the error does say "run with -Z macro-backtrace for more info", and if you do as it says and add "-Z macro-backtrace" it produces the error described in this issue.

The error should be changed to say that you need to pass that as a rustc flag, but I'm not sure the best way to pass rustc flags.

@ratijas
Copy link
Contributor

ratijas commented Sep 6, 2020

Same here, except that in my case it's -Z macro-backtrace instead of -Z external-macro-backtrace. I don't see how it is fixed in rustc 1.48.0-nightly (d006f5734 2020-08-28). I know I'm just repeating things already stated here in this thread, but still I'd like to draw stuff's attention to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. D-confusing Diagnostics: Confusing error or lint that should be reworked. T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

9 participants