Skip to content

Commit 6d0644c

Browse files
authored
tweak comment
1 parent f247a3e commit 6d0644c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustc_mir/borrow_check/places_conflict.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,10 @@ fn place_element_conflict<'a, 'gcx: 'tcx, 'tcx>(
425425
offset: offset_from_begin, min_length: min_length2, from_end: false }) => {
426426
// both patterns matched so it must be at least the greater of the two
427427
let min_length = max(min_length1, min_length2);
428-
// offset_from_end can be in range [1..min_length], -1 for last and min_length
429-
// for first, min_length - offset_from_end gives minimal possible offset from
430-
// the beginning
428+
// `offset_from_end` can be in range `[1..min_length]`, 1 indicates the last
429+
// element (like -1 in Python) and `min_length` the first.
430+
// Therefore, `min_length - offset_from_end` gives the minimal possible
431+
// offset from the beginning
431432
if *offset_from_begin >= min_length - offset_from_end {
432433
debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX-FE");
433434
Overlap::EqualOrDisjoint

0 commit comments

Comments
 (0)