Skip to content

Commit 2e6bea5

Browse files
committed
Inline and remove DiagnosticBuilder::into_diagnostic.
It now has a single call site.
1 parent 5fd824d commit 2e6bea5

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

compiler/rustc_errors/src/diagnostic_builder.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,8 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
255255
/// Stashes diagnostic for possible later improvement in a different,
256256
/// later stage of the compiler. The diagnostic can be accessed with
257257
/// the provided `span` and `key` through [`DiagCtxt::steal_diagnostic()`].
258-
pub fn stash(self, span: Span, key: StashKey) {
259-
self.dcx.stash_diagnostic(span, key, self.into_diagnostic());
260-
}
261-
262-
/// Converts the builder to a `Diagnostic` for later emission.
263-
pub fn into_diagnostic(mut self) -> Diagnostic {
264-
self.take_diag()
258+
pub fn stash(mut self, span: Span, key: StashKey) {
259+
self.dcx.stash_diagnostic(span, key, self.take_diag());
265260
}
266261

267262
/// Delay emission of this diagnostic as a bug.

0 commit comments

Comments
 (0)