File tree 2 files changed +4
-4
lines changed
crates/rust-analyzer/src/cli
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -150,8 +150,8 @@ xflags::xflags! {
150
150
optional --disable-proc-macros
151
151
/// Run the proc-macro-srv binary at the specified path.
152
152
optional --proc-macro-srv path: PathBuf
153
- /// Run cache priming in parallel .
154
- optional --parallel
153
+ /// The number of threads to use. Defaults to the number of physical cores .
154
+ optional --num-threads num_threads : usize
155
155
}
156
156
157
157
cmd ssr {
@@ -299,7 +299,7 @@ pub struct PrimeCaches {
299
299
pub disable_build_scripts : bool ,
300
300
pub disable_proc_macros : bool ,
301
301
pub proc_macro_srv : Option < PathBuf > ,
302
- pub parallel : bool ,
302
+ pub num_threads : Option < usize > ,
303
303
}
304
304
305
305
#[ derive( Debug ) ]
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ impl flags::PrimeCaches {
52
52
elapsed. memory. allocated. megabytes( ) as u64
53
53
) ;
54
54
55
- let threads = if self . parallel { num_cpus:: get ( ) } else { 1 } ;
55
+ let threads = self . num_threads . unwrap_or_else ( num_cpus:: get_physical ) ;
56
56
ide_db:: prime_caches:: parallel_prime_caches ( & db, threads, & |_| ( ) ) ;
57
57
58
58
let elapsed = stop_watch. elapsed ( ) ;
You can’t perform that action at this time.
0 commit comments