Skip to content

Commit 658ed79

Browse files
committed
Add some doc to each_borrow_involving_path iteration function.
1 parent ced5a70 commit 658ed79

File tree

1 file changed

+12
-0
lines changed
  • src/librustc_mir/borrow_check

1 file changed

+12
-0
lines changed

src/librustc_mir/borrow_check/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,6 +1796,18 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
17961796
unreachable!("iter::repeat returned None")
17971797
}
17981798

1799+
/// This function iterates over all of the current borrows
1800+
/// (represented by 1-bits in `flow_state.borrows`) that conflict
1801+
/// with an access to a place, invoking the `op` callback for each
1802+
/// one.
1803+
///
1804+
/// "Current borrow" here means a borrow that reaches the point in
1805+
/// the control-flow where the access occurs.
1806+
///
1807+
/// The borrow's phase is represented by the ReserveOrActivateIndex
1808+
/// passed to the callback: one can call `is_reservation()` and
1809+
/// `is_activation()` to determine what phase the borrow is
1810+
/// currently in, when such distinction matters.
17991811
fn each_borrow_involving_path<F>(
18001812
&mut self,
18011813
_context: Context,

0 commit comments

Comments
 (0)