@@ -97,7 +97,7 @@ mod merging;
97
97
98
98
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
99
99
use rustc_data_structures:: sync;
100
- use rustc_hir:: def_id:: { CrateNum , DefIdSet , LOCAL_CRATE } ;
100
+ use rustc_hir:: def_id:: DefIdSet ;
101
101
use rustc_middle:: mir:: mono:: MonoItem ;
102
102
use rustc_middle:: mir:: mono:: { CodegenUnit , Linkage } ;
103
103
use rustc_middle:: ty:: print:: with_no_trimmed_paths;
@@ -311,10 +311,8 @@ where
311
311
312
312
fn collect_and_partition_mono_items < ' tcx > (
313
313
tcx : TyCtxt < ' tcx > ,
314
- cnum : CrateNum ,
314
+ ( ) : ( ) ,
315
315
) -> ( & ' tcx DefIdSet , & ' tcx [ CodegenUnit < ' tcx > ] ) {
316
- assert_eq ! ( cnum, LOCAL_CRATE ) ;
317
-
318
316
let collection_mode = match tcx. sess . opts . debugging_opts . print_mono_items {
319
317
Some ( ref s) => {
320
318
let mode_string = s. to_lowercase ( ) ;
@@ -426,8 +424,8 @@ fn collect_and_partition_mono_items<'tcx>(
426
424
( tcx. arena . alloc ( mono_items) , codegen_units)
427
425
}
428
426
429
- fn codegened_and_inlined_items < ' tcx > ( tcx : TyCtxt < ' tcx > , cnum : CrateNum ) -> & ' tcx DefIdSet {
430
- let ( items, cgus) = tcx. collect_and_partition_mono_items ( cnum ) ;
427
+ fn codegened_and_inlined_items < ' tcx > ( tcx : TyCtxt < ' tcx > , ( ) : ( ) ) -> & ' tcx DefIdSet {
428
+ let ( items, cgus) = tcx. collect_and_partition_mono_items ( ( ) ) ;
431
429
let mut visited = DefIdSet :: default ( ) ;
432
430
let mut result = items. clone ( ) ;
433
431
@@ -455,12 +453,12 @@ pub fn provide(providers: &mut Providers) {
455
453
providers. codegened_and_inlined_items = codegened_and_inlined_items;
456
454
457
455
providers. is_codegened_item = |tcx, def_id| {
458
- let ( all_mono_items, _) = tcx. collect_and_partition_mono_items ( LOCAL_CRATE ) ;
456
+ let ( all_mono_items, _) = tcx. collect_and_partition_mono_items ( ( ) ) ;
459
457
all_mono_items. contains ( & def_id)
460
458
} ;
461
459
462
460
providers. codegen_unit = |tcx, name| {
463
- let ( _, all) = tcx. collect_and_partition_mono_items ( LOCAL_CRATE ) ;
461
+ let ( _, all) = tcx. collect_and_partition_mono_items ( ( ) ) ;
464
462
all. iter ( )
465
463
. find ( |cgu| cgu. name ( ) == name)
466
464
. unwrap_or_else ( || panic ! ( "failed to find cgu with name {:?}" , name) )
0 commit comments