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`.
This commit is contained in:
parent
ed76b0b882
commit
700a396520
2 changed files with 7 additions and 5 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue