@@ -45,15 +45,14 @@ pub trait Delegate<'tcx> {
45
45
place_with_id : & PlaceWithHirId < ' tcx > ,
46
46
diag_expr_id : hir:: HirId ,
47
47
bk : ty:: BorrowKind ,
48
- is_autoref : bool ,
49
48
) ;
50
49
51
50
/// The value found at `place` is being copied.
52
51
/// `diag_expr_id` is the id used for diagnostics (see `consume` for more details).
53
52
fn copy ( & mut self , place_with_id : & PlaceWithHirId < ' tcx > , diag_expr_id : hir:: HirId ) {
54
53
// In most cases, copying data from `x` is equivalent to doing `*&x`, so by default
55
54
// 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 )
57
56
}
58
57
59
58
/// The path at `assignee_place` is being assigned to.
@@ -184,7 +183,7 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
184
183
debug ! ( "borrow_expr(expr={:?}, bk={:?})" , expr, bk) ;
185
184
186
185
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) ;
188
187
189
188
self . walk_expr ( expr)
190
189
}
@@ -567,7 +566,7 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
567
566
// this is an autoref of `x`.
568
567
adjustment:: Adjust :: Deref ( Some ( ref deref) ) => {
569
568
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) ;
571
570
}
572
571
573
572
adjustment:: Adjust :: Borrow ( ref autoref) => {
@@ -599,19 +598,13 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
599
598
base_place,
600
599
base_place. hir_id ,
601
600
ty:: BorrowKind :: from_mutbl ( m. into ( ) ) ,
602
- true ,
603
601
) ;
604
602
}
605
603
606
604
adjustment:: AutoBorrow :: RawPtr ( m) => {
607
605
debug ! ( "walk_autoref: expr.hir_id={} base_place={:?}" , expr. hir_id, base_place) ;
608
606
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) ) ;
615
608
}
616
609
}
617
610
}
@@ -684,7 +677,7 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
684
677
match bm {
685
678
ty:: BindByReference ( m) => {
686
679
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) ;
688
681
}
689
682
ty:: BindByValue ( ..) => {
690
683
debug!( "walk_pat binding consuming pat" ) ;
@@ -814,7 +807,6 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
814
807
& place_with_id,
815
808
place_with_id. hir_id ,
816
809
upvar_borrow,
817
- false ,
818
810
) ;
819
811
}
820
812
}
0 commit comments