@@ -14,11 +14,10 @@ use rustc_middle::thir::*;
1414use rustc_middle:: ty:: adjustment:: {
1515 Adjust , Adjustment , AutoBorrow , AutoBorrowMutability , PointerCast ,
1616} ;
17- use rustc_middle:: ty:: subst:: { InternalSubsts , SubstsRef } ;
17+ use rustc_middle:: ty:: subst:: InternalSubsts ;
1818use rustc_middle:: ty:: {
1919 self , AdtKind , InlineConstSubsts , InlineConstSubstsParts , ScalarInt , Ty , UpvarSubsts , UserType ,
2020} ;
21- use rustc_span:: def_id:: DefId ;
2221use rustc_span:: Span ;
2322use rustc_target:: abi:: VariantIdx ;
2423
@@ -806,23 +805,25 @@ impl<'tcx> Cx<'tcx> {
806805 & mut self ,
807806 expr : & hir:: Expr < ' _ > ,
808807 span : Span ,
809- overloaded_callee : Option < ( DefId , SubstsRef < ' tcx > ) > ,
808+ overloaded_callee : Option < Ty < ' tcx > > ,
810809 ) -> Expr < ' tcx > {
811810 let temp_lifetime =
812811 self . rvalue_scopes . temporary_scope ( self . region_scope_tree , expr. hir_id . local_id ) ;
813- let ( def_id , substs , user_ty) = match overloaded_callee {
814- Some ( ( def_id , substs ) ) => ( def_id , substs , None ) ,
812+ let ( ty , user_ty) = match overloaded_callee {
813+ Some ( fn_def ) => ( fn_def , None ) ,
815814 None => {
816815 let ( kind, def_id) =
817816 self . typeck_results ( ) . type_dependent_def ( expr. hir_id ) . unwrap_or_else ( || {
818817 span_bug ! ( expr. span, "no type-dependent def for method callee" )
819818 } ) ;
820819 let user_ty = self . user_substs_applied_to_res ( expr. hir_id , Res :: Def ( kind, def_id) ) ;
821820 debug ! ( "method_callee: user_ty={:?}" , user_ty) ;
822- ( def_id, self . typeck_results ( ) . node_substs ( expr. hir_id ) , user_ty)
821+ (
822+ self . tcx ( ) . mk_fn_def ( def_id, self . typeck_results ( ) . node_substs ( expr. hir_id ) ) ,
823+ user_ty,
824+ )
823825 }
824826 } ;
825- let ty = self . tcx ( ) . mk_fn_def ( def_id, substs) ;
826827 Expr { temp_lifetime, ty, span, kind : ExprKind :: ZstLiteral { user_ty } }
827828 }
828829
@@ -957,7 +958,7 @@ impl<'tcx> Cx<'tcx> {
957958 & mut self ,
958959 expr : & ' tcx hir:: Expr < ' tcx > ,
959960 place_ty : Ty < ' tcx > ,
960- overloaded_callee : Option < ( DefId , SubstsRef < ' tcx > ) > ,
961+ overloaded_callee : Option < Ty < ' tcx > > ,
961962 args : Box < [ ExprId ] > ,
962963 span : Span ,
963964 ) -> ExprKind < ' tcx > {
0 commit comments