Skip to content

Commit 5d89c56

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 1d79751 commit 5d89c56

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
@@ -277,12 +277,6 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
277277
G::emit_producing_guarantee(&mut self)
278278
}
279279

280-
/// Emit the diagnostic without consuming it. `emit` should be preferred.
281-
#[track_caller]
282-
pub fn emit_without_consuming(&mut self) -> G::EmitResult {
283-
G::emit_producing_guarantee(self)
284-
}
285-
286280
/// Emit the diagnostic unless `delay` is true,
287281
/// in which case the emission will be delayed as a bug.
288282
///
@@ -384,7 +378,7 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
384378
#[track_caller]
385379
pub fn delay_as_bug_without_consuming(&mut self) -> G::EmitResult {
386380
self.downgrade_to_delayed_bug();
387-
self.emit_without_consuming()
381+
G::emit_producing_guarantee(self)
388382
}
389383

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

0 commit comments

Comments
 (0)