Skip to content

The -Z external-macro-backtrace message will appear in the stable channel #46167

Closed
@kennytm

Description

@kennytm

Since #45545 is merged, when an error happens in an external macro, rustc will suggest the user to supply the unstable flag -Z external-macro-backtrace to see the detailed backtrace:

error[E0282]: type annotations needed
  --> $DIR/cannot_infer_local_or_vec.rs:12:13
   |
12 |     let x = vec![];
   |         -   ^^^^^^ cannot infer type for `T`
   |         |
   |         consider giving `x` a type
   |
   = note: this error originates in a macro outside of the current crate (run with -Z external-macro-backtrace for more info)

error: aborting due to previous error

The problem is that -Z flags cannot be used in beta/stable, so the suggestion will be wrong. The question would be:

  • Should we explicitly specify the flag is only available in nightly, e.g. (in nightly, run with -Z external-macro-backtrace for more info)
  • Or should we just hide the message in the stable channel?
    • If we do so, how should we manage the affected UI test files?

See #45545 (comment) for detail.

cc @durka

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions