Skip to content

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

@jieyouxu

Description

@jieyouxu

What on earth is going on here

fn push_backtrace(
expected_errors: &mut Vec<Error>,
expansion: &DiagnosticSpanMacroExpansion,
file_name: &str,
) {
if Path::new(&expansion.span.file_name) == Path::new(&file_name) {
expected_errors.push(Error {
line_num: expansion.span.line_start,
kind: Some(ErrorKind::Note),
msg: format!("in this expansion of {}", expansion.macro_decl_name),
});
}
if let Some(previous_expansion) = &expansion.span.expansion {
push_backtrace(expected_errors, previous_expansion, file_name);
}
}

@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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-compiletestArea: The compiletest test runnerC-bugCategory: This is a bug.E-needs-investigationCall for participation: This issues needs some investigation to determine current statusT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions