This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-15
lines changed
compiler/rustc_metadata/src/rmeta Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments