about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-02-02 13:05:00 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-02-02 14:35:51 +1100
commit2e6bea59688ae65ca7c94ec4f31eb969ac8a9a6e (patch)
tree0f3ba5f61ecc377c95c36d1f672ab425dc7c060e /compiler/rustc_errors/src
parent5fd824de449575d3de21f3a6a25104d708665664 (diff)
downloadrust-2e6bea59688ae65ca7c94ec4f31eb969ac8a9a6e.tar.gz
rust-2e6bea59688ae65ca7c94ec4f31eb969ac8a9a6e.zip
Inline and remove `DiagnosticBuilder::into_diagnostic`.
It now has a single call site.
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/diagnostic_builder.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/compiler/rustc_errors/src/diagnostic_builder.rs b/compiler/rustc_errors/src/diagnostic_builder.rs
index 8bfb1816486..faff7f0b526 100644
--- a/compiler/rustc_errors/src/diagnostic_builder.rs
+++ b/compiler/rustc_errors/src/diagnostic_builder.rs
@@ -255,13 +255,8 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
     /// Stashes diagnostic for possible later improvement in a different,
     /// later stage of the compiler. The diagnostic can be accessed with
     /// the provided `span` and `key` through [`DiagCtxt::steal_diagnostic()`].
-    pub fn stash(self, span: Span, key: StashKey) {
-        self.dcx.stash_diagnostic(span, key, self.into_diagnostic());
-    }
-
-    /// Converts the builder to a `Diagnostic` for later emission.
-    pub fn into_diagnostic(mut self) -> Diagnostic {
-        self.take_diag()
+    pub fn stash(mut self, span: Span, key: StashKey) {
+        self.dcx.stash_diagnostic(span, key, self.take_diag());
     }
 
     /// Delay emission of this diagnostic as a bug.