]> git.lizzy.rs Git - rust.git/commitdiff
Improve comments.
authorDavid Wood <david@davidtw.co>
Wed, 4 Jul 2018 20:48:25 +0000 (21:48 +0100)
committerDavid Wood <david@davidtw.co>
Wed, 4 Jul 2018 20:48:25 +0000 (21:48 +0100)
src/librustc_mir/borrow_check/borrow_set.rs

index a427b9dd5b7d5cfd2aff142a1f0ea9a001d47b68..e9e0c5c36135322c7594209307c627ec4cae2df8 100644 (file)
@@ -237,8 +237,9 @@ fn visit_place(
                             TwoPhaseActivation::NotActivated
                         }
                         _ => {
-                            // Double check: We should have found an activation for every pending
-                            // activation.
+                            // Double check: This borrow is indeed a two-phase borrow (that is,
+                            // we are 'transitioning' from `NotActivated` to `ActivatedAt`) and
+                            // we've not found any other activations (checked above).
                             assert_eq!(
                                 borrow_data.activation_location,
                                 TwoPhaseActivation::NotActivated,
@@ -330,7 +331,8 @@ fn insert_as_pending_if_two_phase(
             );
         };
 
-        // Consider the borrow not activated.
+        // Consider the borrow not activated to start. When we find an activation, we'll update
+        // this field.
         let borrow_data = &mut self.idx_vec[borrow_index];
         borrow_data.activation_location = TwoPhaseActivation::NotActivated;