Skip to content

Commit 3560122

Browse files
committed
Streamline Queries::linker.
1 parent 4770d91 commit 3560122

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

compiler/rustc_interface/src/queries.rs

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -236,25 +236,19 @@ impl<'tcx> Queries<'tcx> {
236236
}
237237

238238
pub fn linker(&'tcx self, ongoing_codegen: Box<dyn Any>) -> Result<Linker> {
239-
let sess = self.session().clone();
240-
let codegen_backend = self.codegen_backend().clone();
241-
242-
let (crate_hash, prepare_outputs, dep_graph) = self.global_ctxt()?.enter(|tcx| {
243-
(
244-
if tcx.needs_crate_hash() { Some(tcx.crate_hash(LOCAL_CRATE)) } else { None },
245-
tcx.output_filenames(()).clone(),
246-
tcx.dep_graph.clone(),
247-
)
248-
});
249-
250-
Ok(Linker {
251-
sess,
252-
codegen_backend,
253-
254-
dep_graph,
255-
prepare_outputs,
256-
crate_hash,
257-
ongoing_codegen,
239+
self.global_ctxt()?.enter(|tcx| {
240+
Ok(Linker {
241+
sess: self.session().clone(),
242+
codegen_backend: self.codegen_backend().clone(),
243+
dep_graph: tcx.dep_graph.clone(),
244+
prepare_outputs: tcx.output_filenames(()).clone(),
245+
crate_hash: if tcx.needs_crate_hash() {
246+
Some(tcx.crate_hash(LOCAL_CRATE))
247+
} else {
248+
None
249+
},
250+
ongoing_codegen,
251+
})
258252
})
259253
}
260254
}

0 commit comments

Comments
 (0)