File tree Expand file tree Collapse file tree 4 files changed +18
-1
lines changed
librustc_incremental/persist Expand file tree Collapse file tree 4 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -312,6 +312,9 @@ impl Session {
312312 pub fn has_errors ( & self ) -> bool {
313313 self . diagnostic ( ) . has_errors ( )
314314 }
315+ pub fn has_errors_or_delayed_span_bugs ( & self ) -> bool {
316+ self . diagnostic ( ) . has_errors_or_delayed_span_bugs ( )
317+ }
315318 pub fn abort_if_errors ( & self ) {
316319 self . diagnostic ( ) . abort_if_errors ( ) ;
317320 }
Original file line number Diff line number Diff line change @@ -704,6 +704,9 @@ impl Handler {
704704 pub fn has_errors ( & self ) -> bool {
705705 self . inner . borrow ( ) . has_errors ( )
706706 }
707+ pub fn has_errors_or_delayed_span_bugs ( & self ) -> bool {
708+ self . inner . borrow ( ) . has_errors_or_delayed_span_bugs ( )
709+ }
707710
708711 pub fn print_error_count ( & self , registry : & Registry ) {
709712 self . inner . borrow_mut ( ) . print_error_count ( registry)
@@ -862,6 +865,9 @@ impl HandlerInner {
862865 fn has_errors ( & self ) -> bool {
863866 self . err_count ( ) > 0
864867 }
868+ fn has_errors_or_delayed_span_bugs ( & self ) -> bool {
869+ self . has_errors ( ) || !self . delayed_span_bugs . is_empty ( )
870+ }
865871
866872 fn abort_if_errors_and_should_abort ( & mut self ) {
867873 self . emit_stashed_diagnostics ( ) ;
Original file line number Diff line number Diff line change @@ -307,7 +307,7 @@ pub fn finalize_session_directory(sess: &Session, svh: Svh) {
307307
308308 let incr_comp_session_dir: PathBuf = sess. incr_comp_session_dir ( ) . clone ( ) ;
309309
310- if sess. has_errors ( ) {
310+ if sess. has_errors_or_delayed_span_bugs ( ) {
311311 // If there have been any errors during compilation, we don't want to
312312 // publish this session directory. Rather, we'll just delete it.
313313
Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ pub fn save_dep_graph(tcx: TyCtxt<'_>) {
2222 if sess. opts . incremental . is_none ( ) {
2323 return ;
2424 }
25+ // This is going to be deleted in finalize_session_directory, so let's not create it
26+ if sess. has_errors_or_delayed_span_bugs ( ) {
27+ return ;
28+ }
2529
2630 let query_cache_path = query_cache_path ( sess) ;
2731 let dep_graph_path = dep_graph_path ( sess) ;
@@ -60,6 +64,10 @@ pub fn save_work_product_index(sess: &Session,
6064 if sess. opts . incremental . is_none ( ) {
6165 return ;
6266 }
67+ // This is going to be deleted in finalize_session_directory, so let's not create it
68+ if sess. has_errors_or_delayed_span_bugs ( ) {
69+ return ;
70+ }
6371
6472 debug ! ( "save_work_product_index()" ) ;
6573 dep_graph. assert_ignored ( ) ;
You can’t perform that action at this time.
0 commit comments