Skip to content

Commit 096b844

Browse files
committed
Remove forward for downgrade_to_delayed_bug.
It's not used, and doesn't quite fit the general pattern. Also, `Diagnostic::downgrade_to_delayed_bug` doesn't need to return `&mut Self` for the same reason.
1 parent 5fe5d5d commit 096b844

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

compiler/rustc_errors/src/diagnostic.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,15 +311,13 @@ impl Diagnostic {
311311
/// In the meantime, though, callsites are required to deal with the "bug"
312312
/// locally in whichever way makes the most sense.
313313
#[track_caller]
314-
pub fn downgrade_to_delayed_bug(&mut self) -> &mut Self {
314+
pub fn downgrade_to_delayed_bug(&mut self) {
315315
assert!(
316316
self.is_error(),
317317
"downgrade_to_delayed_bug: cannot downgrade {:?} to DelayedBug: not an error",
318318
self.level
319319
);
320320
self.level = Level::DelayedBug;
321-
322-
self
323321
}
324322

325323
/// Adds a span/label to be included in the resulting snippet.

compiler/rustc_errors/src/diagnostic_builder.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -356,11 +356,6 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> {
356356
self.emit()
357357
}
358358

359-
forward!(
360-
#[track_caller]
361-
pub fn downgrade_to_delayed_bug(&mut self,) -> &mut Self
362-
);
363-
364359
forward!(
365360
/// Appends a labeled span to the diagnostic.
366361
///

0 commit comments

Comments
 (0)