about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-01-09 09:26:53 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-01-10 07:40:44 +1100
commit700a3965202f4f403956fcce744ce5ba6adf2ddb (patch)
tree5b0dcd6166b547e1078b36f73f562fa5b1f023b1 /src
parented76b0b882d0acff9295bcd76c2b119cf83e7219 (diff)
downloadrust-700a3965202f4f403956fcce744ce5ba6adf2ddb.tar.gz
rust-700a3965202f4f403956fcce744ce5ba6adf2ddb.zip
Add missing `DiagnosticBuilder::eager_diagnostic` method.
This lets us avoid the use of `DiagnosticBuilder::into_diagnostic` in
miri, when then means that `DiagnosticBuilder::into_diagnostic` can
become private, being now only used by `stash` and `buffer`.
Diffstat (limited to 'src')
-rw-r--r--src/tools/miri/src/diagnostics.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/tools/miri/src/diagnostics.rs b/src/tools/miri/src/diagnostics.rs
index d3d4490f302..819d2018a15 100644
--- a/src/tools/miri/src/diagnostics.rs
+++ b/src/tools/miri/src/diagnostics.rs
@@ -499,14 +499,12 @@ pub fn report_msg<'tcx>(
         err.note(if extra_span { "BACKTRACE (of the first span):" } else { "BACKTRACE:" });
     }
 
-    let (mut err, handler) = err.into_diagnostic().unwrap();
-
     // Add backtrace
     for (idx, frame_info) in stacktrace.iter().enumerate() {
         let is_local = machine.is_local(frame_info);
         // No span for non-local frames and the first frame (which is the error site).
         if is_local && idx > 0 {
-            err.eager_subdiagnostic(handler, frame_info.as_note(machine.tcx));
+            err.eager_subdiagnostic(err.dcx, frame_info.as_note(machine.tcx));
         } else {
             let sm = sess.source_map();
             let span = sm.span_to_embeddable_string(frame_info.span);
@@ -514,7 +512,7 @@ pub fn report_msg<'tcx>(
         }
     }
 
-    handler.emit_diagnostic(err);
+    err.emit();
 }
 
 impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {