Skip to content

Commit 062e1e5

Browse files
committed
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). Signed-off-by: David Wood <[email protected]>
1 parent 4232e7f commit 062e1e5

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
@@ -504,7 +504,7 @@ pub fn report_msg<'tcx>(
504504
let is_local = machine.is_local(frame_info);
505505
// No span for non-local frames and the first frame (which is the error site).
506506
if is_local && idx > 0 {
507-
err.eager_subdiagnostic(err.dcx, frame_info.as_note(machine.tcx));
507+
err.subdiagnostic(err.dcx, frame_info.as_note(machine.tcx));
508508
} else {
509509
let sm = sess.source_map();
510510
let span = sm.span_to_embeddable_string(frame_info.span);

0 commit comments

Comments
 (0)