File tree 1 file changed +7
-5
lines changed
compiler/rustc_interface/src
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -347,6 +347,11 @@ impl Compiler {
347
347
let queries = Queries :: new ( self ) ;
348
348
let ret = f ( & queries) ;
349
349
350
+ // Finish the dep graph encoding before we call `save_dep_graph`.
351
+ if let Err ( ( path, error) ) = queries. finish ( ) {
352
+ self . sess . dcx ( ) . emit_fatal ( errors:: FailedWritingFile { path : & path, error } ) ;
353
+ }
354
+
350
355
// NOTE: intentionally does not compute the global context if it hasn't been built yet,
351
356
// since that likely means there was a parse error.
352
357
if let Some ( Ok ( gcx) ) = & mut * queries. gcx . result . borrow_mut ( ) {
@@ -360,16 +365,13 @@ impl Compiler {
360
365
}
361
366
362
367
self . sess . time ( "serialize_dep_graph" , || gcx. enter ( rustc_incremental:: save_dep_graph) ) ;
363
- queries. dep_graph_serialized_tx . send ( ( ) ) . ok ( ) ;
364
368
}
365
369
370
+ queries. dep_graph_serialized_tx . send ( ( ) ) . ok ( ) ;
371
+
366
372
// The timer's lifetime spans the dropping of `queries`, which contains
367
373
// the global context.
368
374
_timer = Some ( self . sess . timer ( "free_global_ctxt" ) ) ;
369
- if let Err ( ( path, error) ) = queries. finish ( ) {
370
- self . sess . dcx ( ) . emit_fatal ( errors:: FailedWritingFile { path : & path, error } ) ;
371
- }
372
-
373
375
ret
374
376
}
375
377
}
You can’t perform that action at this time.
0 commit comments