@@ -797,7 +797,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
797797 Control :: Continue
798798 }
799799
800- ( Read ( kind) , BorrowKind :: Unique ) | ( Read ( kind) , BorrowKind :: Mut ) => {
800+ ( Read ( kind) , BorrowKind :: Unique ) | ( Read ( kind) , BorrowKind :: Mut { .. } ) => {
801801 // Reading from mere reservations of mutable-borrows is OK.
802802 if this. tcx . sess . two_phase_borrows ( ) && index. is_reservation ( )
803803 {
@@ -828,7 +828,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
828828 }
829829
830830 ( Reservation ( kind) , BorrowKind :: Unique )
831- | ( Reservation ( kind) , BorrowKind :: Mut )
831+ | ( Reservation ( kind) , BorrowKind :: Mut { .. } )
832832 | ( Activation ( kind, _) , _)
833833 | ( Write ( kind) , _) => {
834834 match rw {
@@ -945,7 +945,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
945945 Rvalue :: Ref ( _ /*rgn*/ , bk, ref place) => {
946946 let access_kind = match bk {
947947 BorrowKind :: Shared => ( Deep , Read ( ReadKind :: Borrow ( bk) ) ) ,
948- BorrowKind :: Unique | BorrowKind :: Mut => {
948+ BorrowKind :: Unique | BorrowKind :: Mut { .. } => {
949949 let wk = WriteKind :: MutableBorrow ( bk) ;
950950 if self . tcx . sess . two_phase_borrows ( ) {
951951 ( Deep , Reservation ( wk) )
@@ -1196,7 +1196,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
11961196 // mutable borrow before we check it.
11971197 match borrow. kind {
11981198 BorrowKind :: Shared => return ,
1199- BorrowKind :: Unique | BorrowKind :: Mut => { }
1199+ BorrowKind :: Unique | BorrowKind :: Mut { .. } => { }
12001200 }
12011201
12021202 self . access_place (
@@ -1467,8 +1467,8 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
14671467 span_bug ! ( span, "&unique borrow for {:?} should not fail" , place) ;
14681468 }
14691469 }
1470- Reservation ( WriteKind :: MutableBorrow ( BorrowKind :: Mut ) )
1471- | Write ( WriteKind :: MutableBorrow ( BorrowKind :: Mut ) ) => if let Err ( place_err) =
1470+ Reservation ( WriteKind :: MutableBorrow ( BorrowKind :: Mut { .. } ) )
1471+ | Write ( WriteKind :: MutableBorrow ( BorrowKind :: Mut { .. } ) ) => if let Err ( place_err) =
14721472 self . is_mutable ( place, is_local_mutation_allowed)
14731473 {
14741474 error_reported = true ;
@@ -1532,7 +1532,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
15321532 Activation ( ..) => { } // permission checks are done at Reservation point.
15331533
15341534 Read ( ReadKind :: Borrow ( BorrowKind :: Unique ) )
1535- | Read ( ReadKind :: Borrow ( BorrowKind :: Mut ) )
1535+ | Read ( ReadKind :: Borrow ( BorrowKind :: Mut { .. } ) )
15361536 | Read ( ReadKind :: Borrow ( BorrowKind :: Shared ) )
15371537 | Read ( ReadKind :: Copy ) => { } // Access authorized
15381538 }
0 commit comments