rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.9k stars 12.78k forks source link

compiletest seems to be generating its own macro backtrace diagnostics? #132644

Open jieyouxu opened 3 weeks ago

jieyouxu commented 3 weeks ago

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?

jieyouxu commented 3 weeks ago

(I bet this is very load-bearing and is relied upon by many thousands of tests)