Skip to content

Commit d3de0c4

Browse files
committed
Avoid computing the dep_graph twice in the linker query
1 parent c95dd55 commit d3de0c4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: compiler/rustc_interface/src/queries.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,9 @@ impl<'tcx> Queries<'tcx> {
318318
let sess = self.session().clone();
319319
let codegen_backend = self.codegen_backend().clone();
320320

321-
let dep_graph = self.dep_graph()?.peek().clone();
322-
let (crate_hash, prepare_outputs) = self
323-
.global_ctxt()?
324-
.enter(|tcx| (tcx.crate_hash(LOCAL_CRATE), tcx.output_filenames(()).clone()));
321+
let (crate_hash, prepare_outputs, dep_graph) = self.global_ctxt()?.enter(|tcx| {
322+
(tcx.crate_hash(LOCAL_CRATE), tcx.output_filenames(()).clone(), tcx.dep_graph.clone())
323+
});
325324
let ongoing_codegen = self.ongoing_codegen()?.take();
326325

327326
Ok(Linker {

0 commit comments

Comments
 (0)