Report the actual item that evaluation failed for

This commit is contained in:
Oli Scherer
2025-06-04 08:12:54 +00:00
parent 792fc2b033
commit 64172481da
4 changed files with 6 additions and 4 deletions

View File

@@ -454,11 +454,12 @@ fn report_eval_error<'tcx>(
// FIXME(oli-obk): figure out how to use structured diagnostics again.
diag.code(E0080);
diag.span_label(span, crate::fluent_generated::const_eval_error);
diag.arg("instance", instance);
diag.arg("error_kind", kind);
for frame in frames {
diag.subdiagnostic(frame);
}
// Add after the frame rendering above, as it adds its own `instance` args.
diag.arg("instance", instance);
diag.arg("error_kind", kind);
},
)
}