This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -708,7 +708,7 @@ impl DiagCtxt {
708
708
}
709
709
710
710
/// Emit all stashed diagnostics.
711
- pub fn emit_stashed_diagnostics ( & self ) -> Option < ErrorGuaranteed > {
711
+ pub fn emit_stashed_diagnostics ( & self ) {
712
712
self . inner . borrow_mut ( ) . emit_stashed_diagnostics ( )
713
713
}
714
714
@@ -1216,9 +1216,8 @@ impl DiagCtxt {
1216
1216
// `DiagCtxtInner::foo`.
1217
1217
impl DiagCtxtInner {
1218
1218
/// Emit all stashed diagnostics.
1219
- fn emit_stashed_diagnostics ( & mut self ) -> Option < ErrorGuaranteed > {
1219
+ fn emit_stashed_diagnostics ( & mut self ) {
1220
1220
let has_errors = self . has_errors ( ) ;
1221
- let mut reported = None ;
1222
1221
for ( _, diag) in std:: mem:: take ( & mut self . stashed_diagnostics ) . into_iter ( ) {
1223
1222
// Decrement the count tracking the stash; emitting will increment it.
1224
1223
if diag. is_error ( ) {
@@ -1235,10 +1234,8 @@ impl DiagCtxtInner {
1235
1234
continue ;
1236
1235
}
1237
1236
}
1238
- let reported_this = self . emit_diagnostic ( diag) ;
1239
- reported = reported. or ( reported_this) ;
1237
+ self . emit_diagnostic ( diag) ;
1240
1238
}
1241
- reported
1242
1239
}
1243
1240
1244
1241
fn emit_diagnostic ( & mut self , mut diagnostic : Diagnostic ) -> Option < ErrorGuaranteed > {
Original file line number Diff line number Diff line change @@ -315,7 +315,7 @@ impl Session {
315
315
pub fn compile_status ( & self ) -> Result < ( ) , ErrorGuaranteed > {
316
316
// We must include lint errors here.
317
317
if let Some ( reported) = self . dcx ( ) . has_errors_or_lint_errors ( ) {
318
- let _ = self . dcx ( ) . emit_stashed_diagnostics ( ) ;
318
+ self . dcx ( ) . emit_stashed_diagnostics ( ) ;
319
319
Err ( reported)
320
320
} else {
321
321
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments