@@ -348,7 +348,7 @@ fn collect_items_rec<'a, 'tcx: 'a>(scx: &SharedCrateContext<'a, 'tcx>,
348
348
let mir = errors:: expect ( scx. sess ( ) . diagnostic ( ) , scx. get_mir ( def_id) ,
349
349
|| format ! ( "Could not find MIR for static: {:?}" , def_id) ) ;
350
350
351
- let empty_substs = scx. tcx ( ) . mk_substs ( Substs :: empty ( ) ) ;
351
+ let empty_substs = scx. empty_substs_for_def_id ( def_id ) ;
352
352
let mut visitor = MirNeighborCollector {
353
353
scx : scx,
354
354
mir : & mir,
@@ -496,10 +496,11 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> {
496
496
. unwrap_or_else ( |e| self . scx . sess ( ) . fatal ( & e) ) ;
497
497
498
498
assert ! ( can_have_local_instance( self . scx. tcx( ) , exchange_malloc_fn_def_id) ) ;
499
+ let empty_substs = self . scx . empty_substs_for_def_id ( exchange_malloc_fn_def_id) ;
499
500
let exchange_malloc_fn_trans_item =
500
501
create_fn_trans_item ( self . scx . tcx ( ) ,
501
502
exchange_malloc_fn_def_id,
502
- self . scx . tcx ( ) . mk_substs ( Substs :: empty ( ) ) ,
503
+ empty_substs ,
503
504
self . param_substs ) ;
504
505
505
506
self . output . push ( exchange_malloc_fn_trans_item) ;
@@ -679,10 +680,11 @@ fn find_drop_glue_neighbors<'a, 'tcx>(scx: &SharedCrateContext<'a, 'tcx>,
679
680
. unwrap_or_else ( |e| scx. sess ( ) . fatal ( & e) ) ;
680
681
681
682
assert ! ( can_have_local_instance( scx. tcx( ) , exchange_free_fn_def_id) ) ;
683
+ let fn_substs = scx. empty_substs_for_def_id ( exchange_free_fn_def_id) ;
682
684
let exchange_free_fn_trans_item =
683
685
create_fn_trans_item ( scx. tcx ( ) ,
684
686
exchange_free_fn_def_id,
685
- scx . tcx ( ) . mk_substs ( Substs :: empty ( ) ) ,
687
+ fn_substs ,
686
688
scx. tcx ( ) . mk_substs ( Substs :: empty ( ) ) ) ;
687
689
688
690
output. push ( exchange_free_fn_trans_item) ;
@@ -1111,7 +1113,7 @@ impl<'b, 'a, 'v> hir_visit::Visitor<'v> for RootCollector<'b, 'a, 'v> {
1111
1113
debug ! ( "RootCollector: ItemFn({})" ,
1112
1114
def_id_to_string( self . scx. tcx( ) , def_id) ) ;
1113
1115
1114
- let instance = Instance :: mono ( self . scx . tcx ( ) , def_id) ;
1116
+ let instance = Instance :: mono ( self . scx , def_id) ;
1115
1117
self . output . push ( TransItem :: Fn ( instance) ) ;
1116
1118
}
1117
1119
}
@@ -1148,7 +1150,7 @@ impl<'b, 'a, 'v> hir_visit::Visitor<'v> for RootCollector<'b, 'a, 'v> {
1148
1150
debug ! ( "RootCollector: MethodImplItem({})" ,
1149
1151
def_id_to_string( self . scx. tcx( ) , def_id) ) ;
1150
1152
1151
- let instance = Instance :: mono ( self . scx . tcx ( ) , def_id) ;
1153
+ let instance = Instance :: mono ( self . scx , def_id) ;
1152
1154
self . output . push ( TransItem :: Fn ( instance) ) ;
1153
1155
}
1154
1156
}
0 commit comments