diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-06 17:13:32 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-07 09:54:59 +1100 |
| commit | 8d1c20a539b72abdbe1ede872f19e0a1a6f34be4 (patch) | |
| tree | 5c147557dabb6bbf428996f63e791712d4e51fa3 | |
| parent | 0d531351e848ad69a03c704d40985c9003847427 (diff) | |
| download | rust-8d1c20a539b72abdbe1ede872f19e0a1a6f34be4.tar.gz rust-8d1c20a539b72abdbe1ede872f19e0a1a6f34be4.zip | |
Remove return value from `emit_stashed_diagnostics`.
It's never used.
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 9 | ||||
| -rw-r--r-- | compiler/rustc_session/src/session.rs | 2 |
2 files changed, 4 insertions, 7 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index a4112d717d0..7c62e3aa422 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -708,7 +708,7 @@ impl DiagCtxt { } /// Emit all stashed diagnostics. - pub fn emit_stashed_diagnostics(&self) -> Option<ErrorGuaranteed> { + pub fn emit_stashed_diagnostics(&self) { self.inner.borrow_mut().emit_stashed_diagnostics() } @@ -1216,9 +1216,8 @@ impl DiagCtxt { // `DiagCtxtInner::foo`. impl DiagCtxtInner { /// Emit all stashed diagnostics. - fn emit_stashed_diagnostics(&mut self) -> Option<ErrorGuaranteed> { + fn emit_stashed_diagnostics(&mut self) { let has_errors = self.has_errors(); - let mut reported = None; for (_, diag) in std::mem::take(&mut self.stashed_diagnostics).into_iter() { // Decrement the count tracking the stash; emitting will increment it. if diag.is_error() { @@ -1235,10 +1234,8 @@ impl DiagCtxtInner { continue; } } - let reported_this = self.emit_diagnostic(diag); - reported = reported.or(reported_this); + self.emit_diagnostic(diag); } - reported } fn emit_diagnostic(&mut self, mut diagnostic: Diagnostic) -> Option<ErrorGuaranteed> { diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index f6af5a4f87e..ec14385f40c 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -315,7 +315,7 @@ impl Session { pub fn compile_status(&self) -> Result<(), ErrorGuaranteed> { // We must include lint errors here. if let Some(reported) = self.dcx().has_errors_or_lint_errors() { - let _ = self.dcx().emit_stashed_diagnostics(); + self.dcx().emit_stashed_diagnostics(); Err(reported) } else { Ok(()) |
