@@ -6,7 +6,7 @@ mod topologic_sort;
6
6
7
7
use std:: time:: Duration ;
8
8
9
- use hir:: db:: DefDatabase ;
9
+ use hir:: { db:: DefDatabase , Symbol } ;
10
10
use itertools:: Itertools ;
11
11
12
12
use crate :: {
@@ -22,7 +22,7 @@ use crate::{
22
22
#[ derive( Debug ) ]
23
23
pub struct ParallelPrimeCachesProgress {
24
24
/// the crates that we are currently priming.
25
- pub crates_currently_indexing : Vec < String > ,
25
+ pub crates_currently_indexing : Vec < Symbol > ,
26
26
/// the total number of crates we want to prime.
27
27
pub crates_total : usize ,
28
28
/// the total number of crates that have finished priming
@@ -49,7 +49,7 @@ pub fn parallel_prime_caches(
49
49
} ;
50
50
51
51
enum ParallelPrimeCacheWorkerProgress {
52
- BeginCrate { crate_id : CrateId , crate_name : String } ,
52
+ BeginCrate { crate_id : CrateId , crate_name : Symbol } ,
53
53
EndCrate { crate_id : CrateId } ,
54
54
}
55
55
@@ -112,7 +112,11 @@ pub fn parallel_prime_caches(
112
112
113
113
for crate_id in & mut crates_to_prime {
114
114
let krate = & graph[ crate_id] ;
115
- let name = krate. display_name . as_deref ( ) . unwrap_or_default ( ) . to_owned ( ) ;
115
+ let name = krate
116
+ . display_name
117
+ . as_deref ( )
118
+ . cloned ( )
119
+ . unwrap_or_else ( || Symbol :: integer ( crate_id. into_raw ( ) . into_u32 ( ) as usize ) ) ;
116
120
if krate. origin . is_lang ( ) {
117
121
additional_phases. push ( ( crate_id, name. clone ( ) , PrimingPhase :: ImportMap ) ) ;
118
122
} else if krate. origin . is_local ( ) {
@@ -195,7 +199,6 @@ pub fn parallel_prime_caches(
195
199
}
196
200
ParallelPrimeCacheWorkerProgress :: EndCrate { crate_id } => {
197
201
crates_currently_indexing. swap_remove ( & crate_id) ;
198
- crates_to_prime. mark_done ( crate_id) ;
199
202
crates_done += 1 ;
200
203
}
201
204
} ;
0 commit comments