@@ -11,7 +11,7 @@ use rustc_hir::def_id::{CrateNum, DefIndex, LOCAL_CRATE};
11
11
use rustc_index:: vec:: IndexVec ;
12
12
use rustc_session:: { CrateDisambiguator , Session } ;
13
13
use rustc_span:: source_map:: SourceMap ;
14
- use rustc_span:: Span ;
14
+ use rustc_span:: { Span , Symbol } ;
15
15
use std:: iter:: repeat;
16
16
use syntax:: ast:: NodeId ;
17
17
98
98
( sig, full)
99
99
}
100
100
101
+ fn upstream_crates ( cstore : & dyn CrateStore ) -> Vec < ( Symbol , Fingerprint , Svh ) > {
102
+ let mut upstream_crates: Vec < _ > = cstore
103
+ . crates_untracked ( )
104
+ . iter ( )
105
+ . map ( |& cnum| {
106
+ let name = cstore. crate_name_untracked ( cnum) ;
107
+ let disambiguator = cstore. crate_disambiguator_untracked ( cnum) . to_fingerprint ( ) ;
108
+ let hash = cstore. crate_hash_untracked ( cnum) ;
109
+ ( name, disambiguator, hash)
110
+ } )
111
+ . collect ( ) ;
112
+ upstream_crates. sort_unstable_by_key ( |& ( name, dis, _) | ( name. as_str ( ) , dis) ) ;
113
+ upstream_crates
114
+ }
115
+
101
116
impl < ' a , ' hir > NodeCollector < ' a , ' hir > {
102
117
pub ( super ) fn root (
103
118
sess : & ' a Session ,
@@ -190,18 +205,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
190
205
} ,
191
206
) ;
192
207
193
- let mut upstream_crates: Vec < _ > = cstore
194
- . crates_untracked ( )
195
- . iter ( )
196
- . map ( |& cnum| {
197
- let name = cstore. crate_name_untracked ( cnum) ;
198
- let disambiguator = cstore. crate_disambiguator_untracked ( cnum) . to_fingerprint ( ) ;
199
- let hash = cstore. crate_hash_untracked ( cnum) ;
200
- ( name, disambiguator, hash)
201
- } )
202
- . collect ( ) ;
203
-
204
- upstream_crates. sort_unstable_by_key ( |& ( name, dis, _) | ( name. as_str ( ) , dis) ) ;
208
+ let upstream_crates = upstream_crates ( cstore) ;
205
209
206
210
// We hash the final, remapped names of all local source files so we
207
211
// don't have to include the path prefix remapping commandline args.
0 commit comments