@@ -143,7 +143,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
143
143
&& sess. crt_static ( Some ( ty) )
144
144
&& !sess. target . crt_static_allows_dylibs )
145
145
{
146
- for & cnum in tcx. crates ( ( ) ) . iter ( ) {
146
+ for & cnum in tcx. used_crates ( ( ) ) . iter ( ) {
147
147
if tcx. dep_kind ( cnum) . macros_only ( ) {
148
148
continue ;
149
149
}
@@ -164,7 +164,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
164
164
// Sweep all crates for found dylibs. Add all dylibs, as well as their
165
165
// dependencies, ensuring there are no conflicts. The only valid case for a
166
166
// dependency to be relied upon twice is for both cases to rely on a dylib.
167
- for & cnum in tcx. crates ( ( ) ) . iter ( ) {
167
+ for & cnum in tcx. used_crates ( ( ) ) . iter ( ) {
168
168
if tcx. dep_kind ( cnum) . macros_only ( ) {
169
169
continue ;
170
170
}
@@ -182,7 +182,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
182
182
}
183
183
184
184
// Collect what we've got so far in the return vector.
185
- let last_crate = tcx. crates ( ( ) ) . len ( ) ;
185
+ let last_crate = tcx. used_crates ( ( ) ) . len ( ) ;
186
186
let mut ret = ( 1 ..last_crate + 1 )
187
187
. map ( |cnum| match formats. get ( & CrateNum :: new ( cnum) ) {
188
188
Some ( & RequireDynamic ) => Linkage :: Dynamic ,
@@ -196,7 +196,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
196
196
//
197
197
// If the crate hasn't been included yet and it's not actually required
198
198
// (e.g., it's an allocator) then we skip it here as well.
199
- for & cnum in tcx. crates ( ( ) ) . iter ( ) {
199
+ for & cnum in tcx. used_crates ( ( ) ) . iter ( ) {
200
200
let src = tcx. used_crate_source ( cnum) ;
201
201
if src. dylib . is_none ( )
202
202
&& !formats. contains_key ( & cnum)
@@ -284,7 +284,7 @@ fn add_library(
284
284
285
285
fn attempt_static ( tcx : TyCtxt < ' _ > , unavailable : & mut Vec < CrateNum > ) -> Option < DependencyList > {
286
286
let all_crates_available_as_rlib = tcx
287
- . crates ( ( ) )
287
+ . used_crates ( ( ) )
288
288
. iter ( )
289
289
. copied ( )
290
290
. filter_map ( |cnum| {
@@ -305,7 +305,7 @@ fn attempt_static(tcx: TyCtxt<'_>, unavailable: &mut Vec<CrateNum>) -> Option<De
305
305
// All crates are available in an rlib format, so we're just going to link
306
306
// everything in explicitly so long as it's actually required.
307
307
let mut ret = tcx
308
- . crates ( ( ) )
308
+ . used_crates ( ( ) )
309
309
. iter ( )
310
310
. map ( |& cnum| match tcx. dep_kind ( cnum) {
311
311
CrateDepKind :: Explicit => Linkage :: Static ,
0 commit comments