Skip to content

Commit f90eada

Browse files
committed
Improve comments.
1 parent aeb1682 commit f90eada

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/librustc_mir/borrow_check/borrow_set.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,9 @@ impl<'a, 'gcx, 'tcx> Visitor<'tcx> for GatherBorrows<'a, 'gcx, 'tcx> {
237237
TwoPhaseActivation::NotActivated
238238
}
239239
_ => {
240-
// Double check: We should have found an activation for every pending
241-
// activation.
240+
// Double check: This borrow is indeed a two-phase borrow (that is,
241+
// we are 'transitioning' from `NotActivated` to `ActivatedAt`) and
242+
// we've not found any other activations (checked above).
242243
assert_eq!(
243244
borrow_data.activation_location,
244245
TwoPhaseActivation::NotActivated,
@@ -330,7 +331,8 @@ impl<'a, 'gcx, 'tcx> GatherBorrows<'a, 'gcx, 'tcx> {
330331
);
331332
};
332333

333-
// Consider the borrow not activated.
334+
// Consider the borrow not activated to start. When we find an activation, we'll update
335+
// this field.
334336
let borrow_data = &mut self.idx_vec[borrow_index];
335337
borrow_data.activation_location = TwoPhaseActivation::NotActivated;
336338

0 commit comments

Comments
 (0)