@@ -132,7 +132,7 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
132132 if let Some ( v) = attempt_static ( tcx) {
133133 return v;
134134 }
135- for cnum in sess . cstore . crates ( ) {
135+ for & cnum in tcx . crates ( ) . iter ( ) {
136136 if tcx. dep_kind ( cnum) . macros_only ( ) { continue }
137137 let src = tcx. used_crate_source ( cnum) ;
138138 if src. rlib . is_some ( ) { continue }
@@ -165,7 +165,7 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
165165 // Sweep all crates for found dylibs. Add all dylibs, as well as their
166166 // dependencies, ensuring there are no conflicts. The only valid case for a
167167 // 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 ( ) {
169169 if tcx. dep_kind ( cnum) . macros_only ( ) { continue }
170170 let name = tcx. crate_name ( cnum) ;
171171 let src = tcx. used_crate_source ( cnum) ;
@@ -181,7 +181,7 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
181181 }
182182
183183 // 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 ( ) ;
185185 let mut ret = ( 1 ..last_crate+1 ) . map ( |cnum| {
186186 match formats. get ( & CrateNum :: new ( cnum) ) {
187187 Some ( & RequireDynamic ) => Linkage :: Dynamic ,
@@ -195,7 +195,7 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
195195 //
196196 // If the crate hasn't been included yet and it's not actually required
197197 // (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 ( ) {
199199 let src = tcx. used_crate_source ( cnum) ;
200200 if src. dylib . is_none ( ) &&
201201 !formats. contains_key ( & cnum) &&
@@ -281,7 +281,7 @@ fn attempt_static<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> Option<DependencyLis
281281
282282 // All crates are available in an rlib format, so we're just going to link
283283 // 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 ( ) ;
285285 let mut ret = ( 1 ..last_crate+1 ) . map ( |cnum| {
286286 if tcx. dep_kind ( CrateNum :: new ( cnum) ) == DepKind :: Explicit {
287287 Linkage :: Static
0 commit comments