Change:
| (ProjectionElem::Index(..), ProjectionElem::ConstantIndex { .. }) | (ProjectionElem::Index(..), ProjectionElem::Subslice { .. }) | (ProjectionElem::ConstantIndex { .. }, ProjectionElem::Index(..)) <del> | (ProjectionElem::ConstantIndex { .. }, ProjectionElem::ConstantIndex { .. }) | (ProjectionElem::ConstantIndex { .. }, ProjectionElem::Subslice { .. }) | (ProjectionElem::Subslice { .. }, ProjectionElem::Index(..)) | (ProjectionElem::Subslice { .. }, ProjectionElem::ConstantIndex { .. }) | (ProjectionElem::Subslice { .. }, ProjectionElem::Subslice { .. }) => { </del> <ins> | (ProjectionElem::Subslice { .. }, ProjectionElem::Index(..)) => { </ins> // Array indexes (`a[0]` vs. `a[i]`). These can either be disjoint // (if the indexes differ) or equal (if they are the same), so this // is the recursive case that gives "equal *or* disjoint" its meaning. <del> // // Note that by construction, MIR at borrowck can't subdivide // `Subslice` accesses (e.g. `a[2..3][i]` will never be present) - they // are only present in slice patterns, and we "merge together" nested // slice patterns. That means we don't have to think about these. It's // probably a good idea to assert this somewhere, but I'm too lazy. // // FIXME(#8636) we might want to return Disjoint if // both projections are constant and disjoint. debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY"); </del> <ins> debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-INDEX"); </ins> Overlap::EqualOrDisjoint } <ins> (ProjectionElem::ConstantIndex { offset: o1, min_length: _, from_end: false }, ProjectionElem::ConstantIndex { offset: o2, min_length: _, from_end: false }) | (ProjectionElem::ConstantIndex { offset: o1, min_length: _, from_end: true }, ProjectionElem::ConstantIndex { offset: o2, min_length: _, from_end: true }) => { if o1 == o2 { debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX"); Overlap::EqualOrDisjoint } else { debug!("place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX"); Overlap::Disjoint } } (ProjectionElem::ConstantIndex { offset: offset_from_begin, min_length: min_length1, from_end: false }, ProjectionElem::ConstantIndex { offset: offset_from_end, min_length: min_length2, from_end: true }) | (ProjectionElem::ConstantIndex { offset: offset_from_end, min_length: min_length1, from_end: true }, ProjectionElem::ConstantIndex { 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 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 } else { debug!("place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX-FE"); Overlap::Disjoint } } (ProjectionElem::ConstantIndex { offset, min_length: _, from_end: false }, ProjectionElem::Subslice {from, .. }) | (ProjectionElem::Subslice {from, .. }, ProjectionElem::ConstantIndex { offset, min_length: _, from_end: false }) => { if offset >= from { debug!( "place_element_conflict: DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX-SUBSLICE"); Overlap::EqualOrDisjoint } else { debug!("place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX-SUBSLICE"); Overlap::Disjoint } } (ProjectionElem::ConstantIndex { offset, min_length: _, from_end: true }, ProjectionElem::Subslice {from: _, to }) | (ProjectionElem::Subslice {from: _, to }, ProjectionElem::ConstantIndex { offset, min_length: _, from_end: true }) => { if offset > to { debug!("place_element_conflict:  DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX-SUBSLICE-FE"); Overlap::EqualOrDisjoint } else { debug!("place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX-SUBSLICE-FE"); Overlap::Disjoint } } (ProjectionElem::Subslice { .. }, ProjectionElem::Subslice { .. }) => { debug!("place_element_conflict: DISJOINT-OR-EQ-ARRAY-SUBSLICES"); Overlap::EqualOrDisjoint } </ins> (ProjectionElem::Deref, _) | (ProjectionElem::Field(..), _) | (ProjectionElem::Index(..), _)

Discussion:
I believe the following should work, since and are disjoint, and is just taking a slice into (this would mean that is inaccessible while the result of is kept around): Changing it to (and removing the ):
Generally, multiple in a vector pattern should be allowable:
cc me
An interesting subquestion is whether we also want this to be allowed: In other words, whether the borrow checker should know about and attempt to reason about the disjointness of borrows into a vec beyond the scope of an individual pattern match.
Depending on how we do the implementation, it's likely that both patterns would "just work".
Triage: Nothing has changed here, at least as it pertains to , would be pretty cool if it worked.
This limitation doesn't have anything to do with slice patterns. It is even well-documented as .
I don't think it is the same, e.g. for the first example in the issue, an binding in a slice pattern is actually binding by reference (it has type or , not ), and the second one is completely unrelated.
Updated code: See also:
should be closed after MIR borrowck will be by default