diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-01-09 09:26:53 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-01-10 07:40:44 +1100 |
| commit | 700a3965202f4f403956fcce744ce5ba6adf2ddb (patch) | |
| tree | 5b0dcd6166b547e1078b36f73f562fa5b1f023b1 /compiler | |
| parent | ed76b0b882d0acff9295bcd76c2b119cf83e7219 (diff) | |
| download | rust-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 'compiler')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic_builder.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/diagnostic_builder.rs b/compiler/rustc_errors/src/diagnostic_builder.rs index 1f0a10c13b7..a02909f29c4 100644 --- a/compiler/rustc_errors/src/diagnostic_builder.rs +++ b/compiler/rustc_errors/src/diagnostic_builder.rs @@ -265,7 +265,7 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> { /// Converts the builder to a `Diagnostic` for later emission, /// unless dcx has disabled such buffering. - pub fn into_diagnostic(mut self) -> Option<(Diagnostic, &'a DiagCtxt)> { + fn into_diagnostic(mut self) -> Option<(Diagnostic, &'a DiagCtxt)> { if self.dcx.inner.lock().flags.treat_err_as_bug.is_some() { self.emit(); return None; @@ -426,6 +426,10 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> { forward!((subdiagnostic, with_subdiagnostic)( subdiagnostic: impl crate::AddToDiagnostic, )); + forward!((eager_subdiagnostic, with_eager_subdiagnostic)( + dcx: &DiagCtxt, + subdiagnostic: impl crate::AddToDiagnostic, + )); } impl<G: EmissionGuarantee> Debug for DiagnosticBuilder<'_, G> { |
