@@ -84,8 +84,7 @@ impl<'a,'tcx> ConfirmContext<'a,'tcx> {
84
84
self . enforce_illegal_method_limitations ( & pick) ;
85
85
86
86
// Create substitutions for the method's type parameters.
87
- let ( rcvr_substs, method_origin) =
88
- self . fresh_receiver_substs ( self_ty, & pick) ;
87
+ let rcvr_substs = self . fresh_receiver_substs ( self_ty, & pick) ;
89
88
let ( method_types, method_regions) =
90
89
self . instantiate_method_substs ( & pick, supplied_method_types) ;
91
90
let all_substs = rcvr_substs. with_method ( method_types, method_regions) ;
@@ -112,7 +111,6 @@ impl<'a,'tcx> ConfirmContext<'a,'tcx> {
112
111
} ) ) ;
113
112
let callee = ty:: MethodCallee {
114
113
def_id : pick. item . def_id ( ) ,
115
- origin : method_origin,
116
114
ty : fty,
117
115
substs : self . tcx ( ) . mk_substs ( all_substs)
118
116
} ;
@@ -193,16 +191,14 @@ impl<'a,'tcx> ConfirmContext<'a,'tcx> {
193
191
fn fresh_receiver_substs ( & mut self ,
194
192
self_ty : Ty < ' tcx > ,
195
193
pick : & probe:: Pick < ' tcx > )
196
- -> ( subst:: Substs < ' tcx > , ty :: MethodOrigin )
194
+ -> subst:: Substs < ' tcx >
197
195
{
198
196
match pick. kind {
199
197
probe:: InherentImplPick => {
200
198
let impl_def_id = pick. item . container ( ) . id ( ) ;
201
199
assert ! ( self . tcx( ) . impl_trait_ref( impl_def_id) . is_none( ) ,
202
200
"impl {:?} is not an inherent impl" , impl_def_id) ;
203
- let impl_polytype = check:: impl_self_ty ( self . fcx , self . span , impl_def_id) ;
204
-
205
- ( impl_polytype. substs , ty:: MethodOrigin :: Inherent )
201
+ check:: impl_self_ty ( self . fcx , self . span , impl_def_id) . substs
206
202
}
207
203
208
204
probe:: ObjectPick => {
@@ -228,9 +224,7 @@ impl<'a,'tcx> ConfirmContext<'a,'tcx> {
228
224
original_poly_trait_ref,
229
225
upcast_trait_ref,
230
226
trait_def_id) ;
231
- let substs = upcast_trait_ref. substs . clone ( ) ;
232
-
233
- ( substs, ty:: MethodOrigin :: Trait )
227
+ upcast_trait_ref. substs . clone ( )
234
228
} )
235
229
}
236
230
@@ -250,8 +244,7 @@ impl<'a,'tcx> ConfirmContext<'a,'tcx> {
250
244
self . span ,
251
245
& impl_polytype. substs ,
252
246
& self . tcx ( ) . impl_trait_ref ( impl_def_id) . unwrap ( ) ) ;
253
- let substs = impl_trait_ref. substs . clone ( ) ;
254
- ( substs, ty:: MethodOrigin :: Trait )
247
+ impl_trait_ref. substs . clone ( )
255
248
}
256
249
257
250
probe:: TraitPick => {
@@ -263,19 +256,15 @@ impl<'a,'tcx> ConfirmContext<'a,'tcx> {
263
256
// the process we will unify the transformed-self-type
264
257
// of the method with the actual type in order to
265
258
// unify some of these variables.
266
- let substs = self . infcx ( ) . fresh_substs_for_trait ( self . span ,
267
- & trait_def. generics ,
268
- self . infcx ( ) . next_ty_var ( ) ) ;
269
-
270
- ( substs, ty:: MethodOrigin :: Trait )
259
+ self . infcx ( ) . fresh_substs_for_trait ( self . span ,
260
+ & trait_def. generics ,
261
+ self . infcx ( ) . next_ty_var ( ) )
271
262
}
272
263
273
264
probe:: WhereClausePick ( ref poly_trait_ref) => {
274
265
// Where clauses can have bound regions in them. We need to instantiate
275
266
// those to convert from a poly-trait-ref to a trait-ref.
276
- let trait_ref = self . replace_late_bound_regions_with_fresh_var ( & * poly_trait_ref) ;
277
- let substs = trait_ref. substs . clone ( ) ;
278
- ( substs, ty:: MethodOrigin :: Trait )
267
+ self . replace_late_bound_regions_with_fresh_var ( & * poly_trait_ref) . substs . clone ( )
279
268
}
280
269
}
281
270
}
0 commit comments