Skip to content

Commit

Permalink
tweak comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis authored Jul 6, 2018
1 parent f247a3e commit 6d0644c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/librustc_mir/borrow_check/places_conflict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6d0644c

Please sign in to comment.