rust-lang / rust-lang/rust

compiletest seems to be generating its own macro backtrace diagnostics?

Open
#132,644 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-compiletest C-bug E-needs-investigation T-bootstrap
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

What on earth is going on here

https://github.com/rust-lang/rust/blob/096277e989d6de11c3077472fc05778e261e7b8e/src/tools/compiletest/src/json.rs#L305-L321

@BoxyUwU found out that compiletest seemingly emits diagnostics that are not in rustc's diagnostics. Like

error[E0425]: cannot find value `ident` in this scope
  --> $DIR/const_arg_trivial_macro_expansion-1.rs:11:9
   |
LL |         ident
   |         ^^^^^ not found in this scope
...
LL |     fn array_0() -> [(); unbraced_unbraced_ident!()] { loop {} }
   |                          -------------------------- in this macro invocation
   |
   = note: this error originates in the macro `unbraced_ident` which comes from the expansion of the macro `unbraced_unbraced_ident` (in Nightly builds, run with -Z macro-backtrace for more info)

Image

like, compiletest is generating its own macro backtrace diagnostics or something funny like that?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/tools/compiletest/src/json.rs lines 305-321 and the const_arg_trivial_macro_expansion-1.rs diagnostic shown in the issue. Compare compiletest's emitted output with rustc's diagnostics to determine whether the macro-backtrace text is generated or reformatted by compiletest. Done means identifying the source of the extra diagnostic and documenting or fixing the discrepancy.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.