Skip to content

Commit 1880cdb

Browse files
committed
removing some parallelism
1 parent 366a1b5 commit 1880cdb

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

compiler/rustc_metadata/src/rmeta/encoder.rs

+7-15
Original file line numberDiff line numberDiff line change
@@ -2193,21 +2193,13 @@ pub fn encode_metadata(tcx: TyCtxt<'_>, path: &Path) {
21932193
// there's no need to do dep-graph tracking for any of it.
21942194
tcx.dep_graph.assert_ignored();
21952195

2196-
join(
2197-
|| encode_metadata_impl(tcx, path),
2198-
|| {
2199-
if tcx.sess.threads() == 1 {
2200-
return;
2201-
}
2202-
// Prefetch some queries used by metadata encoding.
2203-
// This is not necessary for correctness, but is only done for performance reasons.
2204-
// It can be removed if it turns out to cause trouble or be detrimental to performance.
2205-
join(|| prefetch_mir(tcx), || tcx.exported_symbols(LOCAL_CRATE));
2206-
},
2207-
);
2208-
}
2209-
2210-
fn encode_metadata_impl(tcx: TyCtxt<'_>, path: &Path) {
2196+
if tcx.sess.threads() != 1 {
2197+
// Prefetch some queries used by metadata encoding.
2198+
// This is not necessary for correctness, but is only done for performance reasons.
2199+
// It can be removed if it turns out to cause trouble or be detrimental to performance.
2200+
join(|| prefetch_mir(tcx), || tcx.exported_symbols(LOCAL_CRATE));
2201+
}
2202+
22112203
let mut encoder = opaque::FileEncoder::new(path)
22122204
.unwrap_or_else(|err| tcx.sess.emit_fatal(FailCreateFileEncoder { err }));
22132205
encoder.emit_raw_bytes(METADATA_HEADER);

0 commit comments

Comments
 (0)