1111use super :: { probe, MethodCallee } ;
1212
1313use astconv:: AstConv ;
14- use check:: { FnCtxt , LvalueOp , callee, Needs } ;
14+ use check:: { FnCtxt , PlaceOp , callee, Needs } ;
1515use hir:: def_id:: DefId ;
1616use rustc:: ty:: subst:: Substs ;
1717use rustc:: traits;
@@ -438,7 +438,7 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> {
438438 debug ! ( "convert_lvalue_derefs_to_mutable: i={} expr={:?}" , i, expr) ;
439439
440440 // Fix up the autoderefs. Autorefs can only occur immediately preceding
441- // overloaded lvalue ops, and will be fixed by them in order to get
441+ // overloaded place ops, and will be fixed by them in order to get
442442 // the correct region.
443443 let mut source = self . node_ty ( expr. hir_id ) ;
444444 // Do not mutate adjustments in place, but rather take them,
@@ -470,53 +470,53 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> {
470470 match expr. node {
471471 hir:: ExprIndex ( ref base_expr, ref index_expr) => {
472472 let index_expr_ty = self . node_ty ( index_expr. hir_id ) ;
473- self . convert_lvalue_op_to_mutable (
474- LvalueOp :: Index , expr, base_expr, & [ index_expr_ty] ) ;
473+ self . convert_place_op_to_mutable (
474+ PlaceOp :: Index , expr, base_expr, & [ index_expr_ty] ) ;
475475 }
476476 hir:: ExprUnary ( hir:: UnDeref , ref base_expr) => {
477- self . convert_lvalue_op_to_mutable (
478- LvalueOp :: Deref , expr, base_expr, & [ ] ) ;
477+ self . convert_place_op_to_mutable (
478+ PlaceOp :: Deref , expr, base_expr, & [ ] ) ;
479479 }
480480 _ => { }
481481 }
482482 }
483483 }
484484
485- fn convert_lvalue_op_to_mutable ( & self ,
486- op : LvalueOp ,
485+ fn convert_place_op_to_mutable ( & self ,
486+ op : PlaceOp ,
487487 expr : & hir:: Expr ,
488488 base_expr : & hir:: Expr ,
489489 arg_tys : & [ Ty < ' tcx > ] )
490490 {
491- debug ! ( "convert_lvalue_op_to_mutable ({:?}, {:?}, {:?}, {:?})" ,
491+ debug ! ( "convert_place_op_to_mutable ({:?}, {:?}, {:?}, {:?})" ,
492492 op, expr, base_expr, arg_tys) ;
493493 if !self . tables . borrow ( ) . is_method_call ( expr) {
494- debug ! ( "convert_lvalue_op_to_mutable - builtin, nothing to do" ) ;
494+ debug ! ( "convert_place_op_to_mutable - builtin, nothing to do" ) ;
495495 return
496496 }
497497
498498 let base_ty = self . tables . borrow ( ) . expr_adjustments ( base_expr) . last ( )
499499 . map_or_else ( || self . node_ty ( expr. hir_id ) , |adj| adj. target ) ;
500500 let base_ty = self . resolve_type_vars_if_possible ( & base_ty) ;
501501
502- // Need to deref because overloaded lvalue ops take self by-reference.
502+ // Need to deref because overloaded place ops take self by-reference.
503503 let base_ty = base_ty. builtin_deref ( false )
504- . expect ( "lvalue op takes something that is not a ref" )
504+ . expect ( "place op takes something that is not a ref" )
505505 . ty ;
506506
507- let method = self . try_overloaded_lvalue_op (
507+ let method = self . try_overloaded_place_op (
508508 expr. span , base_ty, arg_tys, Needs :: MutPlace , op) ;
509509 let method = match method {
510510 Some ( ok) => self . register_infer_ok_obligations ( ok) ,
511511 None => return self . tcx . sess . delay_span_bug ( expr. span , "re-trying op failed" )
512512 } ;
513- debug ! ( "convert_lvalue_op_to_mutable : method={:?}" , method) ;
513+ debug ! ( "convert_place_op_to_mutable : method={:?}" , method) ;
514514 self . write_method_call ( expr. hir_id , method) ;
515515
516516 let ( region, mutbl) = if let ty:: TyRef ( r, mt) = method. sig . inputs ( ) [ 0 ] . sty {
517517 ( r, mt. mutbl )
518518 } else {
519- span_bug ! ( expr. span, "input to lvalue op is not a ref?" ) ;
519+ span_bug ! ( expr. span, "input to place op is not a ref?" ) ;
520520 } ;
521521
522522 // Convert the autoref in the base expr to mutable with the correct
@@ -529,7 +529,7 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> {
529529 let mut source = base_expr_ty;
530530 for adjustment in & mut adjustments[ ..] {
531531 if let Adjust :: Borrow ( AutoBorrow :: Ref ( ..) ) = adjustment. kind {
532- debug ! ( "convert_lvalue_op_to_mutable : converting autoref {:?}" , adjustment) ;
532+ debug ! ( "convert_place_op_to_mutable : converting autoref {:?}" , adjustment) ;
533533 adjustment. kind = Adjust :: Borrow ( AutoBorrow :: Ref ( region, mutbl) ) ;
534534 adjustment. target = self . tcx . mk_ref ( region, ty:: TypeAndMut {
535535 ty : source,
0 commit comments