Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 8d1c20a

Browse files
committed
Remove return value from emit_stashed_diagnostics.
It's never used.
1 parent 0d53135 commit 8d1c20a

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

compiler/rustc_errors/src/lib.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ impl DiagCtxt {
708708
}
709709

710710
/// Emit all stashed diagnostics.
711-
pub fn emit_stashed_diagnostics(&self) -> Option<ErrorGuaranteed> {
711+
pub fn emit_stashed_diagnostics(&self) {
712712
self.inner.borrow_mut().emit_stashed_diagnostics()
713713
}
714714

@@ -1216,9 +1216,8 @@ impl DiagCtxt {
12161216
// `DiagCtxtInner::foo`.
12171217
impl DiagCtxtInner {
12181218
/// Emit all stashed diagnostics.
1219-
fn emit_stashed_diagnostics(&mut self) -> Option<ErrorGuaranteed> {
1219+
fn emit_stashed_diagnostics(&mut self) {
12201220
let has_errors = self.has_errors();
1221-
let mut reported = None;
12221221
for (_, diag) in std::mem::take(&mut self.stashed_diagnostics).into_iter() {
12231222
// Decrement the count tracking the stash; emitting will increment it.
12241223
if diag.is_error() {
@@ -1235,10 +1234,8 @@ impl DiagCtxtInner {
12351234
continue;
12361235
}
12371236
}
1238-
let reported_this = self.emit_diagnostic(diag);
1239-
reported = reported.or(reported_this);
1237+
self.emit_diagnostic(diag);
12401238
}
1241-
reported
12421239
}
12431240

12441241
fn emit_diagnostic(&mut self, mut diagnostic: Diagnostic) -> Option<ErrorGuaranteed> {

compiler/rustc_session/src/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ impl Session {
315315
pub fn compile_status(&self) -> Result<(), ErrorGuaranteed> {
316316
// We must include lint errors here.
317317
if let Some(reported) = self.dcx().has_errors_or_lint_errors() {
318-
let _ = self.dcx().emit_stashed_diagnostics();
318+
self.dcx().emit_stashed_diagnostics();
319319
Err(reported)
320320
} else {
321321
Ok(())

0 commit comments

Comments
 (0)