@@ -288,7 +288,8 @@ pub fn partition<'a, 'tcx, I>(scx: &SharedCrateContext<'a, 'tcx>,
288
288
// translation items have to go into each codegen unit. These additional
289
289
// translation items can be drop-glue, functions from external crates, and
290
290
// local functions the definition of which is marked with #[inline].
291
- let post_inlining = place_inlined_translation_items ( initial_partitioning,
291
+ let post_inlining = place_inlined_translation_items ( scx,
292
+ initial_partitioning,
292
293
inlining_map) ;
293
294
294
295
debug_dump ( tcx, "POST INLINING:" , post_inlining. 0 . iter ( ) ) ;
@@ -320,7 +321,7 @@ fn place_root_translation_items<'a, 'tcx, I>(scx: &SharedCrateContext<'a, 'tcx>,
320
321
let mut codegen_units = FnvHashMap ( ) ;
321
322
322
323
for trans_item in trans_items {
323
- let is_root = !trans_item. is_instantiated_only_on_demand ( ) ;
324
+ let is_root = !trans_item. is_instantiated_only_on_demand ( tcx ) ;
324
325
325
326
if is_root {
326
327
let characteristic_def_id = characteristic_def_id_of_trans_item ( scx, trans_item) ;
@@ -416,9 +417,11 @@ fn merge_codegen_units<'tcx>(initial_partitioning: &mut PreInliningPartitioning<
416
417
}
417
418
}
418
419
419
- fn place_inlined_translation_items < ' tcx > ( initial_partitioning : PreInliningPartitioning < ' tcx > ,
420
- inlining_map : & InliningMap < ' tcx > )
421
- -> PostInliningPartitioning < ' tcx > {
420
+ fn place_inlined_translation_items < ' a , ' tcx > ( scx : & SharedCrateContext < ' a , ' tcx > ,
421
+ initial_partitioning : PreInliningPartitioning < ' tcx > ,
422
+ inlining_map : & InliningMap < ' tcx > )
423
+ -> PostInliningPartitioning < ' tcx > {
424
+ let tcx = scx. tcx ( ) ;
422
425
let mut new_partitioning = Vec :: new ( ) ;
423
426
424
427
for codegen_unit in & initial_partitioning. codegen_units [ ..] {
@@ -454,7 +457,7 @@ fn place_inlined_translation_items<'tcx>(initial_partitioning: PreInliningPartit
454
457
// reliably in that case.
455
458
new_codegen_unit. items . insert ( trans_item, llvm:: InternalLinkage ) ;
456
459
} else {
457
- assert ! ( trans_item. is_instantiated_only_on_demand( ) ) ;
460
+ assert ! ( trans_item. is_instantiated_only_on_demand( tcx ) ) ;
458
461
// We can't be sure if this will also be instantiated
459
462
// somewhere else, so we add an instance here with
460
463
// InternalLinkage so we don't get any conflicts.
0 commit comments