@@ -14,11 +14,10 @@ use rustc_middle::thir::*;
14
14
use rustc_middle:: ty:: adjustment:: {
15
15
Adjust , Adjustment , AutoBorrow , AutoBorrowMutability , PointerCast ,
16
16
} ;
17
- use rustc_middle:: ty:: subst:: { InternalSubsts , SubstsRef } ;
17
+ use rustc_middle:: ty:: subst:: InternalSubsts ;
18
18
use rustc_middle:: ty:: {
19
19
self , AdtKind , InlineConstSubsts , InlineConstSubstsParts , ScalarInt , Ty , UpvarSubsts , UserType ,
20
20
} ;
21
- use rustc_span:: def_id:: DefId ;
22
21
use rustc_span:: Span ;
23
22
use rustc_target:: abi:: VariantIdx ;
24
23
@@ -806,23 +805,25 @@ impl<'tcx> Cx<'tcx> {
806
805
& mut self ,
807
806
expr : & hir:: Expr < ' _ > ,
808
807
span : Span ,
809
- overloaded_callee : Option < ( DefId , SubstsRef < ' tcx > ) > ,
808
+ overloaded_callee : Option < Ty < ' tcx > > ,
810
809
) -> Expr < ' tcx > {
811
810
let temp_lifetime =
812
811
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 ) ,
815
814
None => {
816
815
let ( kind, def_id) =
817
816
self . typeck_results ( ) . type_dependent_def ( expr. hir_id ) . unwrap_or_else ( || {
818
817
span_bug ! ( expr. span, "no type-dependent def for method callee" )
819
818
} ) ;
820
819
let user_ty = self . user_substs_applied_to_res ( expr. hir_id , Res :: Def ( kind, def_id) ) ;
821
820
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
+ )
823
825
}
824
826
} ;
825
- let ty = self . tcx ( ) . mk_fn_def ( def_id, substs) ;
826
827
Expr { temp_lifetime, ty, span, kind : ExprKind :: ZstLiteral { user_ty } }
827
828
}
828
829
@@ -957,7 +958,7 @@ impl<'tcx> Cx<'tcx> {
957
958
& mut self ,
958
959
expr : & ' tcx hir:: Expr < ' tcx > ,
959
960
place_ty : Ty < ' tcx > ,
960
- overloaded_callee : Option < ( DefId , SubstsRef < ' tcx > ) > ,
961
+ overloaded_callee : Option < Ty < ' tcx > > ,
961
962
args : Box < [ ExprId ] > ,
962
963
span : Span ,
963
964
) -> ExprKind < ' tcx > {
0 commit comments