Skip to content

Commit

Permalink
Remove DiagnosticBuilder::emit_without_consuming.
Browse files Browse the repository at this point in the history
A nice cleanup: it's now impossible to directly emit a
`DiagnosticBuilder` without consuming it.
  • Loading branch information
nnethercote committed Jan 8, 2024
1 parent c733a02 commit d406278
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions compiler/rustc_errors/src/diagnostic_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -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)(
Expand Down

0 comments on commit d406278

Please sign in to comment.