@@ -144,7 +144,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
144144 && sess. crt_static ( Some ( ty) )
145145 && !sess. target . crt_static_allows_dylibs )
146146 {
147- for & cnum in tcx. used_crates ( ( ) ) . iter ( ) {
147+ for & cnum in tcx. crates ( ( ) ) . iter ( ) {
148148 if tcx. dep_kind ( cnum) . macros_only ( ) {
149149 continue ;
150150 }
@@ -165,7 +165,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
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 tcx. used_crates ( ( ) ) . iter ( ) {
168+ for & cnum in tcx. crates ( ( ) ) . iter ( ) {
169169 if tcx. dep_kind ( cnum) . macros_only ( ) {
170170 continue ;
171171 }
@@ -183,7 +183,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
183183 }
184184
185185 // Collect what we've got so far in the return vector.
186- let last_crate = tcx. used_crates ( ( ) ) . len ( ) ;
186+ let last_crate = tcx. crates ( ( ) ) . len ( ) ;
187187 let mut ret = ( 1 ..last_crate + 1 )
188188 . map ( |cnum| match formats. get ( & CrateNum :: new ( cnum) ) {
189189 Some ( & RequireDynamic ) => Linkage :: Dynamic ,
@@ -197,7 +197,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
197197 //
198198 // If the crate hasn't been included yet and it's not actually required
199199 // (e.g., it's an allocator) then we skip it here as well.
200- for & cnum in tcx. used_crates ( ( ) ) . iter ( ) {
200+ for & cnum in tcx. crates ( ( ) ) . iter ( ) {
201201 let src = tcx. used_crate_source ( cnum) ;
202202 if src. dylib . is_none ( )
203203 && !formats. contains_key ( & cnum)
@@ -285,7 +285,7 @@ fn add_library(
285285
286286fn attempt_static ( tcx : TyCtxt < ' _ > , unavailable : & mut Vec < CrateNum > ) -> Option < DependencyList > {
287287 let all_crates_available_as_rlib = tcx
288- . used_crates ( ( ) )
288+ . crates ( ( ) )
289289 . iter ( )
290290 . copied ( )
291291 . filter_map ( |cnum| {
@@ -306,7 +306,7 @@ fn attempt_static(tcx: TyCtxt<'_>, unavailable: &mut Vec<CrateNum>) -> Option<De
306306 // All crates are available in an rlib format, so we're just going to link
307307 // everything in explicitly so long as it's actually required.
308308 let mut ret = tcx
309- . used_crates ( ( ) )
309+ . crates ( ( ) )
310310 . iter ( )
311311 . map ( |& cnum| match tcx. dep_kind ( cnum) {
312312 CrateDepKind :: Explicit => Linkage :: Static ,
0 commit comments