@@ -45,15 +45,14 @@ pub trait Delegate<'tcx> {
4545 place_with_id : & PlaceWithHirId < ' tcx > ,
4646 diag_expr_id : hir:: HirId ,
4747 bk : ty:: BorrowKind ,
48- is_autoref : bool ,
4948 ) ;
5049
5150 /// The value found at `place` is being copied.
5251 /// `diag_expr_id` is the id used for diagnostics (see `consume` for more details).
5352 fn copy ( & mut self , place_with_id : & PlaceWithHirId < ' tcx > , diag_expr_id : hir:: HirId ) {
5453 // In most cases, copying data from `x` is equivalent to doing `*&x`, so by default
5554 // we treat a copy of `x` as a borrow of `x`.
56- self . borrow ( place_with_id, diag_expr_id, ty:: BorrowKind :: ImmBorrow , false )
55+ self . borrow ( place_with_id, diag_expr_id, ty:: BorrowKind :: ImmBorrow )
5756 }
5857
5958 /// The path at `assignee_place` is being assigned to.
@@ -184,7 +183,7 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
184183 debug ! ( "borrow_expr(expr={:?}, bk={:?})" , expr, bk) ;
185184
186185 let place_with_id = return_if_err ! ( self . mc. cat_expr( expr) ) ;
187- self . delegate . borrow ( & place_with_id, place_with_id. hir_id , bk, false ) ;
186+ self . delegate . borrow ( & place_with_id, place_with_id. hir_id , bk) ;
188187
189188 self . walk_expr ( expr)
190189 }
@@ -567,7 +566,7 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
567566 // this is an autoref of `x`.
568567 adjustment:: Adjust :: Deref ( Some ( ref deref) ) => {
569568 let bk = ty:: BorrowKind :: from_mutbl ( deref. mutbl ) ;
570- self . delegate . borrow ( & place_with_id, place_with_id. hir_id , bk, true ) ;
569+ self . delegate . borrow ( & place_with_id, place_with_id. hir_id , bk) ;
571570 }
572571
573572 adjustment:: Adjust :: Borrow ( ref autoref) => {
@@ -599,19 +598,13 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
599598 base_place,
600599 base_place. hir_id ,
601600 ty:: BorrowKind :: from_mutbl ( m. into ( ) ) ,
602- true ,
603601 ) ;
604602 }
605603
606604 adjustment:: AutoBorrow :: RawPtr ( m) => {
607605 debug ! ( "walk_autoref: expr.hir_id={} base_place={:?}" , expr. hir_id, base_place) ;
608606
609- self . delegate . borrow (
610- base_place,
611- base_place. hir_id ,
612- ty:: BorrowKind :: from_mutbl ( m) ,
613- true ,
614- ) ;
607+ self . delegate . borrow ( base_place, base_place. hir_id , ty:: BorrowKind :: from_mutbl ( m) ) ;
615608 }
616609 }
617610 }
@@ -684,7 +677,7 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
684677 match bm {
685678 ty:: BindByReference ( m) => {
686679 let bk = ty:: BorrowKind :: from_mutbl( m) ;
687- delegate. borrow( place, discr_place. hir_id, bk, false ) ;
680+ delegate. borrow( place, discr_place. hir_id, bk) ;
688681 }
689682 ty:: BindByValue ( ..) => {
690683 debug!( "walk_pat binding consuming pat" ) ;
@@ -814,7 +807,6 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
814807 & place_with_id,
815808 place_with_id. hir_id ,
816809 upvar_borrow,
817- false ,
818810 ) ;
819811 }
820812 }
0 commit comments