@@ -444,7 +444,9 @@ impl<'tcx> Inliner<'tcx> {
444
444
work_list. push ( target) ;
445
445
446
446
// If the place doesn't actually need dropping, treat it like a regular goto.
447
- let ty = callsite. callee . subst_mir ( self . tcx , & place. ty ( callee_body, tcx) . ty ) ;
447
+ let ty = callsite
448
+ . callee
449
+ . subst_mir ( self . tcx , ty:: EarlyBinder ( & place. ty ( callee_body, tcx) . ty ) ) ;
448
450
if ty. needs_drop ( tcx, self . param_env ) && let UnwindAction :: Cleanup ( unwind) = unwind {
449
451
work_list. push ( unwind) ;
450
452
}
@@ -788,7 +790,9 @@ impl<'tcx> Visitor<'tcx> for CostChecker<'_, 'tcx> {
788
790
match terminator. kind {
789
791
TerminatorKind :: Drop { ref place, unwind, .. } => {
790
792
// If the place doesn't actually need dropping, treat it like a regular goto.
791
- let ty = self . instance . subst_mir ( tcx, & place. ty ( self . callee_body , tcx) . ty ) ;
793
+ let ty = self
794
+ . instance
795
+ . subst_mir ( tcx, ty:: EarlyBinder ( & place. ty ( self . callee_body , tcx) . ty ) ) ;
792
796
if ty. needs_drop ( tcx, self . param_env ) {
793
797
self . cost += CALL_PENALTY ;
794
798
if let UnwindAction :: Cleanup ( _) = unwind {
@@ -799,7 +803,7 @@ impl<'tcx> Visitor<'tcx> for CostChecker<'_, 'tcx> {
799
803
}
800
804
}
801
805
TerminatorKind :: Call { func : Operand :: Constant ( ref f) , unwind, .. } => {
802
- let fn_ty = self . instance . subst_mir ( tcx, & f. literal . ty ( ) ) ;
806
+ let fn_ty = self . instance . subst_mir ( tcx, ty :: EarlyBinder ( & f. literal . ty ( ) ) ) ;
803
807
self . cost += if let ty:: FnDef ( def_id, _) = * fn_ty. kind ( ) && tcx. is_intrinsic ( def_id) {
804
808
// Don't give intrinsics the extra penalty for calls
805
809
INSTR_COST
0 commit comments