Rollup merge of #111004 - clubby789:migrate-mir-transform, r=oli-obk
Migrate `mir_transform` to translatable diagnostics cc #100717
This commit is contained in:
commit
68594142b1
16 changed files with 470 additions and 200 deletions
|
@ -571,6 +571,14 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
|
|||
Some((diagnostic, handler))
|
||||
}
|
||||
|
||||
/// Retrieves the [`Handler`] if available
|
||||
pub fn handler(&self) -> Option<&Handler> {
|
||||
match self.inner.state {
|
||||
DiagnosticBuilderState::Emittable(handler) => Some(handler),
|
||||
DiagnosticBuilderState::AlreadyEmittedOrDuringCancellation => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Buffers the diagnostic for later emission,
|
||||
/// unless handler has disabled such buffering.
|
||||
pub fn buffer(self, buffered_diagnostics: &mut Vec<Diagnostic>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue