@@ -144,7 +144,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
144
144
&& sess. crt_static ( Some ( ty) )
145
145
&& !sess. target . crt_static_allows_dylibs )
146
146
{
147
- for & cnum in tcx. used_crates ( ( ) ) . iter ( ) {
147
+ for & cnum in tcx. crates ( ( ) ) . iter ( ) {
148
148
if tcx. dep_kind ( cnum) . macros_only ( ) {
149
149
continue ;
150
150
}
@@ -165,7 +165,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
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 tcx. used_crates ( ( ) ) . iter ( ) {
168
+ for & cnum in tcx. crates ( ( ) ) . iter ( ) {
169
169
if tcx. dep_kind ( cnum) . macros_only ( ) {
170
170
continue ;
171
171
}
@@ -183,7 +183,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
183
183
}
184
184
185
185
// 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 ( ) ;
187
187
let mut ret = ( 1 ..last_crate + 1 )
188
188
. map ( |cnum| match formats. get ( & CrateNum :: new ( cnum) ) {
189
189
Some ( & RequireDynamic ) => Linkage :: Dynamic ,
@@ -197,7 +197,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
197
197
//
198
198
// If the crate hasn't been included yet and it's not actually required
199
199
// (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 ( ) {
201
201
let src = tcx. used_crate_source ( cnum) ;
202
202
if src. dylib . is_none ( )
203
203
&& !formats. contains_key ( & cnum)
@@ -285,7 +285,7 @@ fn add_library(
285
285
286
286
fn attempt_static ( tcx : TyCtxt < ' _ > , unavailable : & mut Vec < CrateNum > ) -> Option < DependencyList > {
287
287
let all_crates_available_as_rlib = tcx
288
- . used_crates ( ( ) )
288
+ . crates ( ( ) )
289
289
. iter ( )
290
290
. copied ( )
291
291
. filter_map ( |cnum| {
@@ -306,7 +306,7 @@ fn attempt_static(tcx: TyCtxt<'_>, unavailable: &mut Vec<CrateNum>) -> Option<De
306
306
// All crates are available in an rlib format, so we're just going to link
307
307
// everything in explicitly so long as it's actually required.
308
308
let mut ret = tcx
309
- . used_crates ( ( ) )
309
+ . crates ( ( ) )
310
310
. iter ( )
311
311
. map ( |& cnum| match tcx. dep_kind ( cnum) {
312
312
CrateDepKind :: Explicit => Linkage :: Static ,
0 commit comments