@@ -6,7 +6,7 @@ mod topologic_sort;
66
77use std:: time:: Duration ;
88
9- use hir:: db:: DefDatabase ;
9+ use hir:: { db:: DefDatabase , Symbol } ;
1010use itertools:: Itertools ;
1111
1212use crate :: {
@@ -22,7 +22,7 @@ use crate::{
2222#[ derive( Debug ) ]
2323pub struct ParallelPrimeCachesProgress {
2424 /// the crates that we are currently priming.
25- pub crates_currently_indexing : Vec < String > ,
25+ pub crates_currently_indexing : Vec < Symbol > ,
2626 /// the total number of crates we want to prime.
2727 pub crates_total : usize ,
2828 /// the total number of crates that have finished priming
@@ -49,7 +49,7 @@ pub fn parallel_prime_caches(
4949 } ;
5050
5151 enum ParallelPrimeCacheWorkerProgress {
52- BeginCrate { crate_id : CrateId , crate_name : String } ,
52+ BeginCrate { crate_id : CrateId , crate_name : Symbol } ,
5353 EndCrate { crate_id : CrateId } ,
5454 }
5555
@@ -112,7 +112,11 @@ pub fn parallel_prime_caches(
112112
113113 for crate_id in & mut crates_to_prime {
114114 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 ) ) ;
116120 if krate. origin . is_lang ( ) {
117121 additional_phases. push ( ( crate_id, name. clone ( ) , PrimingPhase :: ImportMap ) ) ;
118122 } else if krate. origin . is_local ( ) {
@@ -195,7 +199,6 @@ pub fn parallel_prime_caches(
195199 }
196200 ParallelPrimeCacheWorkerProgress :: EndCrate { crate_id } => {
197201 crates_currently_indexing. swap_remove ( & crate_id) ;
198- crates_to_prime. mark_done ( crate_id) ;
199202 crates_done += 1 ;
200203 }
201204 } ;
0 commit comments