about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-07-06 06:33:38 -0400
committerGitHub <noreply@github.com>2018-07-06 06:33:38 -0400
commit6d0644c65a99505dfd1be844cebb84082a0466a3 (patch)
treea93e3c5ed509ad79a17573ea5180907c8898ed88 /src
parentf247a3e49059472a275cbe4f482b9582022e8ca4 (diff)
tweak comment
Diffstat (limited to 'src')
-rw-r--r--src/librustc_mir/borrow_check/places_conflict.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librustc_mir/borrow_check/places_conflict.rs b/src/librustc_mir/borrow_check/places_conflict.rs
index 9fbad46a238..a9eec53fd94 100644
--- a/src/librustc_mir/borrow_check/places_conflict.rs
+++ b/src/librustc_mir/borrow_check/places_conflict.rs
@@ -425,9 +425,10 @@ fn place_element_conflict<'a, 'gcx: 'tcx, 'tcx>(
                        offset: offset_from_begin, min_length: min_length2, from_end: false }) => {
                     // both patterns matched so it must be at least the greater of the two
                     let min_length = max(min_length1, min_length2);
-                    // offset_from_end can be in range [1..min_length], -1 for last and min_length
-                    // for first, min_length - offset_from_end gives minimal possible offset from
-                    // the beginning
+                    // `offset_from_end` can be in range `[1..min_length]`, 1 indicates the last
+                    // element (like -1 in Python) and `min_length` the first.
+                    // Therefore, `min_length - offset_from_end` gives the minimal possible
+                    // offset from the beginning
                     if *offset_from_begin >= min_length - offset_from_end {
                         debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX-FE");
                         Overlap::EqualOrDisjoint