about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-01-05 15:25:14 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-01-08 16:06:53 +1100
commitd406278180f1cd7792f50be890658f2739c621fb (patch)
treee6963bc02dccddfdf4bdabd392d18dcf86c8b14d
parentc733a0216d55977e51a26ead6f2446668f006e02 (diff)
downloadrust-d406278180f1cd7792f50be890658f2739c621fb.tar.gz
rust-d406278180f1cd7792f50be890658f2739c621fb.zip
Remove `DiagnosticBuilder::emit_without_consuming`.
A nice cleanup: it's now impossible to directly emit a
`DiagnosticBuilder` without consuming it.
-rw-r--r--compiler/rustc_errors/src/diagnostic_builder.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/compiler/rustc_errors/src/diagnostic_builder.rs b/compiler/rustc_errors/src/diagnostic_builder.rs
index dcbf60e4847..eb081df040a 100644
--- a/compiler/rustc_errors/src/diagnostic_builder.rs
+++ b/compiler/rustc_errors/src/diagnostic_builder.rs
@@ -269,12 +269,6 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
         G::emit_producing_guarantee(&mut self)
     }
 
-    /// Emit the diagnostic without consuming it. `emit` should be preferred.
-    #[track_caller]
-    pub fn emit_without_consuming(&mut self) -> G::EmitResult {
-        G::emit_producing_guarantee(self)
-    }
-
     /// Emit the diagnostic unless `delay` is true,
     /// in which case the emission will be delayed as a bug.
     ///
@@ -376,7 +370,7 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
     #[track_caller]
     pub fn delay_as_bug_without_consuming(&mut self) -> G::EmitResult {
         self.downgrade_to_delayed_bug();
-        self.emit_without_consuming()
+        G::emit_producing_guarantee(self)
     }
 
     forward!((span_label, span_label_mv)(