Skip to content

Commit 8bcf01e

Browse files
authored
Rollup merge of #121085 - davidtwco:always-eager-diagnostics, r=nnethercote
errors: only eagerly translate subdiagnostics Subdiagnostics don't need to be lazily translated, they can always be eagerly translated. Eager translation is slightly more complex as we need to have a `DiagCtxt` available to perform the translation, which involves slightly more threading of that context. This slight increase in complexity should enable later simplifications - like passing `DiagCtxt` into `AddToDiagnostic` and moving Fluent messages into the diagnostic structs rather than having them in separate files (working on that was what led to this change). r? ```@nnethercote```
2 parents 31ab634 + 062e1e5 commit 8bcf01e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ pub fn report_msg<'tcx>(
505505
let is_local = machine.is_local(frame_info);
506506
// No span for non-local frames and the first frame (which is the error site).
507507
if is_local && idx > 0 {
508-
err.eager_subdiagnostic(err.dcx, frame_info.as_note(machine.tcx));
508+
err.subdiagnostic(err.dcx, frame_info.as_note(machine.tcx));
509509
} else {
510510
let sm = sess.source_map();
511511
let span = sm.span_to_embeddable_string(frame_info.span);

0 commit comments

Comments
 (0)