@@ -2259,8 +2259,8 @@ pub fn trans_item(ccx: &CrateContext, item: &hir::Item) {
2259
2259
// compilation unit that references the item, so it will still get
2260
2260
// translated everywhere it's needed.
2261
2261
for ( ref ccx, is_origin) in ccx. maybe_iter ( !from_external && trans_everywhere) {
2262
- let empty_substs = ccx. empty_substs_for_node_id ( item. id ) ;
2263
2262
let def_id = tcx. map . local_def_id ( item. id ) ;
2263
+ let empty_substs = ccx. empty_substs_for_def_id ( def_id) ;
2264
2264
let llfn = Callee :: def ( ccx, def_id, empty_substs) . reify ( ccx) . val ;
2265
2265
trans_fn ( ccx, & decl, & body, llfn, empty_substs, item. id ) ;
2266
2266
set_global_section ( ccx, llfn, item) ;
@@ -2298,8 +2298,8 @@ pub fn trans_item(ccx: &CrateContext, item: &hir::Item) {
2298
2298
if sig. generics . ty_params . is_empty ( ) {
2299
2299
let trans_everywhere = attr:: requests_inline ( & impl_item. attrs ) ;
2300
2300
for ( ref ccx, is_origin) in ccx. maybe_iter ( trans_everywhere) {
2301
- let empty_substs = ccx. empty_substs_for_node_id ( impl_item. id ) ;
2302
2301
let def_id = tcx. map . local_def_id ( impl_item. id ) ;
2302
+ let empty_substs = ccx. empty_substs_for_def_id ( def_id) ;
2303
2303
let llfn = Callee :: def ( ccx, def_id, empty_substs) . reify ( ccx) . val ;
2304
2304
trans_fn ( ccx, & sig. decl , body, llfn, empty_substs, impl_item. id ) ;
2305
2305
update_linkage ( ccx, llfn, Some ( impl_item. id ) ,
0 commit comments