@@ -149,7 +149,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
149149 // If some lookup succeeded, install method in table
150150 let input_ty = self . next_ty_var ( base_expr. span ) ;
151151 let method =
152- self . try_overloaded_place_op ( expr. span , self_ty, & [ input_ty] , PlaceOp :: Index ) ;
152+ self . try_overloaded_place_op ( expr. span , self_ty, Some ( input_ty) , PlaceOp :: Index ) ;
153153
154154 if let Some ( result) = method {
155155 debug ! ( "try_index_step: success, using overloaded indexing" ) ;
@@ -189,7 +189,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
189189 & self ,
190190 span : Span ,
191191 base_ty : Ty < ' tcx > ,
192- arg_tys : & [ Ty < ' tcx > ] ,
192+ opt_rhs_ty : Option < Ty < ' tcx > > ,
193193 op : PlaceOp ,
194194 ) -> Option < InferOk < ' tcx , MethodCallee < ' tcx > > > {
195195 debug ! ( "try_overloaded_place_op({:?},{:?},{:?})" , span, base_ty, op) ;
@@ -207,15 +207,15 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
207207 Ident :: with_dummy_span ( imm_op) ,
208208 imm_tr,
209209 base_ty,
210- Some ( arg_tys ) ,
210+ opt_rhs_ty ,
211211 )
212212 }
213213
214214 fn try_mutable_overloaded_place_op (
215215 & self ,
216216 span : Span ,
217217 base_ty : Ty < ' tcx > ,
218- arg_tys : & [ Ty < ' tcx > ] ,
218+ opt_rhs_ty : Option < Ty < ' tcx > > ,
219219 op : PlaceOp ,
220220 ) -> Option < InferOk < ' tcx , MethodCallee < ' tcx > > > {
221221 debug ! ( "try_mutable_overloaded_place_op({:?},{:?},{:?})" , span, base_ty, op) ;
@@ -233,7 +233,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
233233 Ident :: with_dummy_span ( mut_op) ,
234234 mut_tr,
235235 base_ty,
236- Some ( arg_tys ) ,
236+ opt_rhs_ty ,
237237 )
238238 }
239239
@@ -284,7 +284,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
284284 && let Some ( ok) = self . try_mutable_overloaded_place_op (
285285 expr. span ,
286286 source,
287- & [ ] ,
287+ None ,
288288 PlaceOp :: Deref ,
289289 )
290290 {
@@ -359,8 +359,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
359359 Some ( self . typeck_results . borrow ( ) . node_args ( expr. hir_id ) . type_at ( 1 ) )
360360 }
361361 } ;
362- let arg_tys = arg_ty. as_slice ( ) ;
363- let method = self . try_mutable_overloaded_place_op ( expr. span , base_ty, arg_tys, op) ;
362+ let method = self . try_mutable_overloaded_place_op ( expr. span , base_ty, arg_ty, op) ;
364363 let method = match method {
365364 Some ( ok) => self . register_infer_ok_obligations ( ok) ,
366365 // Couldn't find the mutable variant of the place op, keep the
0 commit comments