@@ -98,27 +98,29 @@ impl<'a,'tcx> ConfirmContext<'a,'tcx> {
98
98
let InstantiatedMethodSig {
99
99
method_sig, all_substs, method_predicates
100
100
} = self . instantiate_method_sig ( & pick, all_substs) ;
101
+ let all_substs = self . tcx ( ) . mk_substs ( all_substs) ;
101
102
let method_self_ty = method_sig. inputs [ 0 ] ;
102
103
103
104
// Unify the (adjusted) self type with what the method expects.
104
105
self . unify_receivers ( self_ty, method_self_ty) ;
105
106
106
107
// Create the method type
108
+ let def_id = pick. item . def_id ( ) ;
107
109
let method_ty = pick. item . as_opt_method ( ) . unwrap ( ) ;
108
- let fty = self . tcx ( ) . mk_fn_ptr ( ty:: BareFnTy {
110
+ let fty = self . tcx ( ) . mk_fn_def ( def_id , all_substs , ty:: BareFnTy {
109
111
sig : ty:: Binder ( method_sig) ,
110
112
unsafety : method_ty. fty . unsafety ,
111
113
abi : method_ty. fty . abi . clone ( ) ,
112
114
} ) ;
113
115
114
116
// Add any trait/regions obligations specified on the method's type parameters.
115
- self . add_obligations ( fty, & all_substs, & method_predicates) ;
117
+ self . add_obligations ( fty, all_substs, & method_predicates) ;
116
118
117
119
// Create the final `MethodCallee`.
118
120
let callee = ty:: MethodCallee {
119
- def_id : pick . item . def_id ( ) ,
121
+ def_id : def_id,
120
122
ty : fty,
121
- substs : self . tcx ( ) . mk_substs ( all_substs)
123
+ substs : all_substs
122
124
} ;
123
125
// If this is an `&mut self` method, bias the receiver
124
126
// expression towards mutability (this will switch
@@ -457,7 +459,7 @@ impl<'a,'tcx> ConfirmContext<'a,'tcx> {
457
459
fn fixup_derefs_on_method_receiver_if_necessary ( & self ,
458
460
method_callee : & ty:: MethodCallee ) {
459
461
let sig = match method_callee. ty . sty {
460
- ty:: TyFnPtr ( ref f) => f. sig . clone ( ) ,
462
+ ty:: TyFnDef ( _ , _ , ref f) => f. sig . clone ( ) ,
461
463
_ => return ,
462
464
} ;
463
465
0 commit comments