Skip to content

Commit a13d879

Browse files
committed
Remove DiagnosticBuilder::emit_without_consuming.
A nice cleanup: it's now impossible to directly emit a `DiagnosticBuilder` without consuming it. (`DiagnosticBuilder::delay_as_bug_without_consuming` still exists, though.)
1 parent e1a2bbc commit a13d879

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
@@ -262,12 +262,6 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
262262
G::emit_producing_guarantee(&mut self)
263263
}
264264

265-
/// Emit the diagnostic without consuming it. `emit` should be preferred.
266-
#[track_caller]
267-
pub fn emit_without_consuming(&mut self) -> G::EmitResult {
268-
G::emit_producing_guarantee(self)
269-
}
270-
271265
/// Emit the diagnostic unless `delay` is true,
272266
/// in which case the emission will be delayed as a bug.
273267
///
@@ -369,7 +363,7 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
369363
#[track_caller]
370364
pub fn delay_as_bug_without_consuming(&mut self) -> G::EmitResult {
371365
self.downgrade_to_delayed_bug();
372-
self.emit_without_consuming()
366+
G::emit_producing_guarantee(self)
373367
}
374368

375369
forward!((span_label, span_label_mv)(

0 commit comments

Comments
 (0)