Skip to content

Commit 1f3dfb4

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 deeccff commit 1f3dfb4

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

compiler/rustc_errors/src/diagnostic_builder.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,6 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
273273
G::emit_producing_guarantee(&mut self)
274274
}
275275

276-
/// Emit the diagnostic without consuming it. `emit` should be preferred.
277-
#[track_caller]
278-
pub fn emit_without_consuming(&mut self) -> G::EmitResult {
279-
G::emit_producing_guarantee(self)
280-
}
281-
282276
/// Emit the diagnostic unless `delay` is true,
283277
/// in which case the emission will be delayed as a bug.
284278
///
@@ -380,7 +374,7 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
380374
#[track_caller]
381375
pub fn delay_as_bug_without_consuming(&mut self) -> G::EmitResult {
382376
self.downgrade_to_delayed_bug();
383-
self.emit_without_consuming()
377+
G::emit_producing_guarantee(self)
384378
}
385379

386380
forward!((span_label, span_label_mv)(span: Span, label: impl Into<SubdiagnosticMessage>));

0 commit comments

Comments
 (0)