@@ -732,10 +732,19 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
732
732
( sd, place_span. 0 ) ,
733
733
flow_state,
734
734
|this, index, borrow| match ( rw, borrow. kind ) {
735
- // Obviously an activation is compatible with its own reservation;
736
- // so don't check if they interfere.
737
- ( Activation ( _, activating) , _) if index. is_reservation ( ) &&
738
- activating == index. borrow_index ( ) => Control :: Continue ,
735
+ // Obviously an activation is compatible with its own
736
+ // reservation (or even prior activating uses of same
737
+ // borrow); so don't check if they interfere.
738
+ //
739
+ // NOTE: *reservations* do conflict with themselves;
740
+ // thus aren't injecting unsoundenss w/ this check.)
741
+ ( Activation ( _, activating) , _) if activating == index. borrow_index ( ) =>
742
+ {
743
+ debug ! ( "check_access_for_conflict place_span: {:?} sd: {:?} rw: {:?} \
744
+ skipping {:?} b/c activation of same borrow_index: {:?}",
745
+ place_span, sd, rw, ( index, borrow) , index. borrow_index( ) ) ;
746
+ Control :: Continue
747
+ }
739
748
740
749
( Read ( _) , BorrowKind :: Shared ) |
741
750
( Reservation ( ..) , BorrowKind :: Shared ) => Control :: Continue ,
@@ -1086,8 +1095,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
1086
1095
let domain = flow_state. borrows . operator ( ) ;
1087
1096
let data = domain. borrows ( ) ;
1088
1097
flow_state. borrows . each_gen_bit ( |gen| {
1089
- if gen. is_activation ( ) && // must be activation,
1090
- !flow_state. borrows . contains ( & gen) // and newly generated.
1098
+ if gen. is_activation ( )
1091
1099
{
1092
1100
let borrow_index = gen. borrow_index ( ) ;
1093
1101
let borrow = & data[ borrow_index] ;
0 commit comments