Inline and remove DiagnosticBuilder::into_diagnostic
.
It now has a single call site.
This commit is contained in:
parent
5fd824de44
commit
2e6bea5968
@ -255,13 +255,8 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
|
|||||||
/// Stashes diagnostic for possible later improvement in a different,
|
/// Stashes diagnostic for possible later improvement in a different,
|
||||||
/// later stage of the compiler. The diagnostic can be accessed with
|
/// later stage of the compiler. The diagnostic can be accessed with
|
||||||
/// the provided `span` and `key` through [`DiagCtxt::steal_diagnostic()`].
|
/// the provided `span` and `key` through [`DiagCtxt::steal_diagnostic()`].
|
||||||
pub fn stash(self, span: Span, key: StashKey) {
|
pub fn stash(mut self, span: Span, key: StashKey) {
|
||||||
self.dcx.stash_diagnostic(span, key, self.into_diagnostic());
|
self.dcx.stash_diagnostic(span, key, self.take_diag());
|
||||||
}
|
|
||||||
|
|
||||||
/// Converts the builder to a `Diagnostic` for later emission.
|
|
||||||
pub fn into_diagnostic(mut self) -> Diagnostic {
|
|
||||||
self.take_diag()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Delay emission of this diagnostic as a bug.
|
/// Delay emission of this diagnostic as a bug.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user