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