@@ -132,7 +132,7 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
132
132
if let Some ( v) = attempt_static ( tcx) {
133
133
return v;
134
134
}
135
- for cnum in sess . cstore . crates ( ) {
135
+ for & cnum in tcx . crates ( ) . iter ( ) {
136
136
if tcx. dep_kind ( cnum) . macros_only ( ) { continue }
137
137
let src = tcx. used_crate_source ( cnum) ;
138
138
if src. rlib . is_some ( ) { continue }
@@ -165,7 +165,7 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
165
165
// Sweep all crates for found dylibs. Add all dylibs, as well as their
166
166
// dependencies, ensuring there are no conflicts. The only valid case for a
167
167
// dependency to be relied upon twice is for both cases to rely on a dylib.
168
- for cnum in sess . cstore . crates ( ) {
168
+ for & cnum in tcx . crates ( ) . iter ( ) {
169
169
if tcx. dep_kind ( cnum) . macros_only ( ) { continue }
170
170
let name = tcx. crate_name ( cnum) ;
171
171
let src = tcx. used_crate_source ( cnum) ;
@@ -181,7 +181,7 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
181
181
}
182
182
183
183
// Collect what we've got so far in the return vector.
184
- let last_crate = sess . cstore . crates ( ) . len ( ) ;
184
+ let last_crate = tcx . crates ( ) . len ( ) ;
185
185
let mut ret = ( 1 ..last_crate+1 ) . map ( |cnum| {
186
186
match formats. get ( & CrateNum :: new ( cnum) ) {
187
187
Some ( & RequireDynamic ) => Linkage :: Dynamic ,
@@ -195,7 +195,7 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
195
195
//
196
196
// If the crate hasn't been included yet and it's not actually required
197
197
// (e.g. it's an allocator) then we skip it here as well.
198
- for cnum in sess . cstore . crates ( ) {
198
+ for & cnum in tcx . crates ( ) . iter ( ) {
199
199
let src = tcx. used_crate_source ( cnum) ;
200
200
if src. dylib . is_none ( ) &&
201
201
!formats. contains_key ( & cnum) &&
@@ -281,7 +281,7 @@ fn attempt_static<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> Option<DependencyLis
281
281
282
282
// All crates are available in an rlib format, so we're just going to link
283
283
// everything in explicitly so long as it's actually required.
284
- let last_crate = sess . cstore . crates ( ) . len ( ) ;
284
+ let last_crate = tcx . crates ( ) . len ( ) ;
285
285
let mut ret = ( 1 ..last_crate+1 ) . map ( |cnum| {
286
286
if tcx. dep_kind ( CrateNum :: new ( cnum) ) == DepKind :: Explicit {
287
287
Linkage :: Static
0 commit comments