@@ -658,8 +658,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
658
658
let debugger_visualizers =
659
659
stat ! ( "debugger-visualizers" , || self . encode_debugger_visualizers( ) ) ;
660
660
661
- // Encode exported symbols info. This is prefetched in `encode_metadata` so we encode
662
- // this as late as possible to give the prefetching as much time as possible to complete.
661
+ // Encode exported symbols info. This is prefetched in `encode_metadata`.
663
662
let exported_symbols = stat ! ( "exported-symbols" , || {
664
663
self . encode_exported_symbols( tcx. exported_symbols( LOCAL_CRATE ) )
665
664
} ) ;
@@ -2193,21 +2192,13 @@ pub fn encode_metadata(tcx: TyCtxt<'_>, path: &Path) {
2193
2192
// there's no need to do dep-graph tracking for any of it.
2194
2193
tcx. dep_graph . assert_ignored ( ) ;
2195
2194
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
- }
2195
+ if tcx. sess . threads ( ) != 1 {
2196
+ // Prefetch some queries used by metadata encoding.
2197
+ // This is not necessary for correctness, but is only done for performance reasons.
2198
+ // It can be removed if it turns out to cause trouble or be detrimental to performance.
2199
+ join ( || prefetch_mir ( tcx) , || tcx. exported_symbols ( LOCAL_CRATE ) ) ;
2200
+ }
2209
2201
2210
- fn encode_metadata_impl ( tcx : TyCtxt < ' _ > , path : & Path ) {
2211
2202
let mut encoder = opaque:: FileEncoder :: new ( path)
2212
2203
. unwrap_or_else ( |err| tcx. sess . emit_fatal ( FailCreateFileEncoder { err } ) ) ;
2213
2204
encoder. emit_raw_bytes ( METADATA_HEADER ) ;
0 commit comments