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 {
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`.
12171217impl 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 > {
Original file line number Diff line number Diff 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 ( ( ) )
You can’t perform that action at this time.
0 commit comments