@@ -6,10 +6,9 @@ mod input;
66mod change;
77pub mod fixture;
88
9- use std:: { hash :: BuildHasherDefault , panic, sync:: Arc } ;
9+ use std:: { panic, sync:: Arc } ;
1010
11- use indexmap:: IndexSet ;
12- use rustc_hash:: FxHasher ;
11+ use rustc_hash:: FxHashSet ;
1312use syntax:: { ast, Parse , SourceFile , TextRange , TextSize } ;
1413
1514pub use crate :: {
@@ -60,10 +59,7 @@ pub trait FileLoader {
6059 /// Text of the file.
6160 fn file_text ( & self , file_id : FileId ) -> Arc < str > ;
6261 fn resolve_path ( & self , path : AnchoredPath < ' _ > ) -> Option < FileId > ;
63- fn relevant_crates (
64- & self ,
65- file_id : FileId ,
66- ) -> Arc < IndexSet < CrateId , BuildHasherDefault < FxHasher > > > ;
62+ fn relevant_crates ( & self , file_id : FileId ) -> Arc < FxHashSet < CrateId > > ;
6763}
6864
6965/// Database which stores all significant input facts: source code and project
@@ -103,16 +99,10 @@ pub trait SourceDatabaseExt: SourceDatabase {
10399 #[ salsa:: input]
104100 fn source_root ( & self , id : SourceRootId ) -> Arc < SourceRoot > ;
105101
106- fn source_root_crates (
107- & self ,
108- id : SourceRootId ,
109- ) -> Arc < IndexSet < CrateId , BuildHasherDefault < FxHasher > > > ;
102+ fn source_root_crates ( & self , id : SourceRootId ) -> Arc < FxHashSet < CrateId > > ;
110103}
111104
112- fn source_root_crates (
113- db : & dyn SourceDatabaseExt ,
114- id : SourceRootId ,
115- ) -> Arc < IndexSet < CrateId , BuildHasherDefault < FxHasher > > > {
105+ fn source_root_crates ( db : & dyn SourceDatabaseExt , id : SourceRootId ) -> Arc < FxHashSet < CrateId > > {
116106 let graph = db. crate_graph ( ) ;
117107 let res = graph
118108 . iter ( )
@@ -138,10 +128,7 @@ impl<T: SourceDatabaseExt> FileLoader for FileLoaderDelegate<&'_ T> {
138128 source_root. resolve_path ( path)
139129 }
140130
141- fn relevant_crates (
142- & self ,
143- file_id : FileId ,
144- ) -> Arc < IndexSet < CrateId , BuildHasherDefault < FxHasher > > > {
131+ fn relevant_crates ( & self , file_id : FileId ) -> Arc < FxHashSet < CrateId > > {
145132 let _p = profile:: span ( "relevant_crates" ) ;
146133 let source_root = self . 0 . file_source_root ( file_id) ;
147134 self . 0 . source_root_crates ( source_root)
0 commit comments