File tree 2 files changed +8
-16
lines changed
2 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -2193,21 +2193,13 @@ pub fn encode_metadata(tcx: TyCtxt<'_>, path: &Path) {
2193
2193
// there's no need to do dep-graph tracking for any of it.
2194
2194
tcx. dep_graph . assert_ignored ( ) ;
2195
2195
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
+
2211
2203
let mut encoder = opaque:: FileEncoder :: new ( path)
2212
2204
. unwrap_or_else ( |err| tcx. sess . emit_fatal ( FailCreateFileEncoder { err } ) ) ;
2213
2205
encoder. emit_raw_bytes ( METADATA_HEADER ) ;
Original file line number Diff line number Diff line change @@ -1897,7 +1897,7 @@ written to standard error output)"),
1897
1897
/// in the future. Note that -Zthreads=0 is the way to get
1898
1898
/// the num_cpus behavior.
1899
1899
#[ rustc_lint_opt_deny_field_access( "use `Session::threads` instead of this field" ) ]
1900
- threads: usize = ( 1 , parse_threads, [ UNTRACKED ] ,
1900
+ threads: usize = ( 8 , parse_threads, [ UNTRACKED ] ,
1901
1901
"use a thread pool with N threads" ) ,
1902
1902
time_llvm_passes: bool = ( false , parse_bool, [ UNTRACKED ] ,
1903
1903
"measure time of each LLVM pass (default: no)" ) ,
You can’t perform that action at this time.
0 commit comments