Skip to content

Commit 96392dc

Browse files
committed
Finish dep graph encoding before finalizing the session and fix free_global_ctxt timing
1 parent b919f15 commit 96392dc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

compiler/rustc_interface/src/queries.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -360,16 +360,18 @@ impl Compiler {
360360
}
361361

362362
self.sess.time("serialize_dep_graph", || gcx.enter(rustc_incremental::save_dep_graph));
363-
queries.dep_graph_serialized_tx.send(()).ok();
364363
}
365364

366-
// The timer's lifetime spans the dropping of `queries`, which contains
367-
// the global context.
368-
_timer = Some(self.sess.timer("free_global_ctxt"));
365+
// Finish the dep graph encoding before we signal `dep_graph_serialized`.
369366
if let Err((path, error)) = queries.finish() {
370367
self.sess.dcx().emit_fatal(errors::FailedWritingFile { path: &path, error });
371368
}
372369

370+
queries.dep_graph_serialized_tx.send(()).ok();
371+
372+
// The timer's lifetime spans the dropping of `queries`, which contains
373+
// the global context.
374+
_timer = Some(self.sess.timer("free_global_ctxt"));
373375
ret
374376
}
375377
}

0 commit comments

Comments
 (0)