@@ -6,10 +6,9 @@ mod input;
6
6
mod change;
7
7
pub mod fixture;
8
8
9
- use std:: { hash :: BuildHasherDefault , panic, sync:: Arc } ;
9
+ use std:: { panic, sync:: Arc } ;
10
10
11
- use indexmap:: IndexSet ;
12
- use rustc_hash:: FxHasher ;
11
+ use rustc_hash:: FxHashSet ;
13
12
use syntax:: { ast, Parse , SourceFile , TextRange , TextSize } ;
14
13
15
14
pub use crate :: {
@@ -60,10 +59,7 @@ pub trait FileLoader {
60
59
/// Text of the file.
61
60
fn file_text ( & self , file_id : FileId ) -> Arc < str > ;
62
61
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 > > ;
67
63
}
68
64
69
65
/// Database which stores all significant input facts: source code and project
@@ -103,16 +99,10 @@ pub trait SourceDatabaseExt: SourceDatabase {
103
99
#[ salsa:: input]
104
100
fn source_root ( & self , id : SourceRootId ) -> Arc < SourceRoot > ;
105
101
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 > > ;
110
103
}
111
104
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 > > {
116
106
let graph = db. crate_graph ( ) ;
117
107
let res = graph
118
108
. iter ( )
@@ -138,10 +128,7 @@ impl<T: SourceDatabaseExt> FileLoader for FileLoaderDelegate<&'_ T> {
138
128
source_root. resolve_path ( path)
139
129
}
140
130
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 > > {
145
132
let _p = profile:: span ( "relevant_crates" ) ;
146
133
let source_root = self . 0 . file_source_root ( file_id) ;
147
134
self . 0 . source_root_crates ( source_root)
0 commit comments