Skip to content

Commit d406278

Browse files
committedJan 8, 2024
Remove DiagnosticBuilder::emit_without_consuming.
A nice cleanup: it's now impossible to directly emit a `DiagnosticBuilder` without consuming it.
1 parent c733a02 commit d406278

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed
 

‎compiler/rustc_errors/src/diagnostic_builder.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,6 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
269269
G::emit_producing_guarantee(&mut self)
270270
}
271271

272-
/// Emit the diagnostic without consuming it. `emit` should be preferred.
273-
#[track_caller]
274-
pub fn emit_without_consuming(&mut self) -> G::EmitResult {
275-
G::emit_producing_guarantee(self)
276-
}
277-
278272
/// Emit the diagnostic unless `delay` is true,
279273
/// in which case the emission will be delayed as a bug.
280274
///
@@ -376,7 +370,7 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
376370
#[track_caller]
377371
pub fn delay_as_bug_without_consuming(&mut self) -> G::EmitResult {
378372
self.downgrade_to_delayed_bug();
379-
self.emit_without_consuming()
373+
G::emit_producing_guarantee(self)
380374
}
381375

382376
forward!((span_label, span_label_mv)(

0 commit comments

Comments
 (0)