File tree 4 files changed +18
-1
lines changed
librustc_incremental/persist
4 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -310,6 +310,9 @@ impl Session {
310
310
pub fn has_errors ( & self ) -> bool {
311
311
self . diagnostic ( ) . has_errors ( )
312
312
}
313
+ pub fn has_errors_or_delayed_span_bugs ( & self ) -> bool {
314
+ self . diagnostic ( ) . has_errors_or_delayed_span_bugs ( )
315
+ }
313
316
pub fn abort_if_errors ( & self ) {
314
317
self . diagnostic ( ) . abort_if_errors ( ) ;
315
318
}
Original file line number Diff line number Diff line change @@ -704,6 +704,9 @@ impl Handler {
704
704
pub fn has_errors ( & self ) -> bool {
705
705
self . inner . borrow ( ) . has_errors ( )
706
706
}
707
+ pub fn has_errors_or_delayed_span_bugs ( & self ) -> bool {
708
+ self . inner . borrow ( ) . has_errors_or_delayed_span_bugs ( )
709
+ }
707
710
708
711
pub fn print_error_count ( & self , registry : & Registry ) {
709
712
self . inner . borrow_mut ( ) . print_error_count ( registry)
@@ -862,6 +865,9 @@ impl HandlerInner {
862
865
fn has_errors ( & self ) -> bool {
863
866
self . err_count ( ) > 0
864
867
}
868
+ fn has_errors_or_delayed_span_bugs ( & self ) -> bool {
869
+ self . has_errors ( ) || !self . delayed_span_bugs . is_empty ( )
870
+ }
865
871
866
872
fn abort_if_errors_and_should_abort ( & mut self ) {
867
873
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) {
307
307
308
308
let incr_comp_session_dir: PathBuf = sess. incr_comp_session_dir ( ) . clone ( ) ;
309
309
310
- if sess. has_errors ( ) {
310
+ if sess. has_errors_or_delayed_span_bugs ( ) {
311
311
// If there have been any errors during compilation, we don't want to
312
312
// publish this session directory. Rather, we'll just delete it.
313
313
Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ pub fn save_dep_graph(tcx: TyCtxt<'_>) {
22
22
if sess. opts . incremental . is_none ( ) {
23
23
return ;
24
24
}
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
+ }
25
29
26
30
let query_cache_path = query_cache_path ( sess) ;
27
31
let dep_graph_path = dep_graph_path ( sess) ;
@@ -60,6 +64,10 @@ pub fn save_work_product_index(sess: &Session,
60
64
if sess. opts . incremental . is_none ( ) {
61
65
return ;
62
66
}
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
+ }
63
71
64
72
debug ! ( "save_work_product_index()" ) ;
65
73
dep_graph. assert_ignored ( ) ;
You can’t perform that action at this time.
0 commit comments