Skip to content

Commit a71cc4c

Browse files
committed
Place conflict functions take Local by value
1 parent b181835 commit a71cc4c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/librustc_mir/borrow_check/places_conflict.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ fn place_components_conflict<'tcx>(
119119
// and either equal or disjoint.
120120
// - If we did run out of access, the borrow can access a part of it.
121121

122-
let borrow_local = &borrow_place.local;
122+
let borrow_local = borrow_place.local;
123123
let access_local = access_place.local;
124124

125-
match place_base_conflict(borrow_local, access_local) {
125+
match place_base_conflict(borrow_local, *access_local) {
126126
Overlap::Arbitrary => {
127127
bug!("Two base can't return Arbitrary");
128128
}
@@ -208,7 +208,7 @@ fn place_components_conflict<'tcx>(
208208
// access cares about.
209209

210210
let proj_base = &borrow_place.projection[..access_place.projection.len() + i];
211-
let base_ty = Place::ty_from(borrow_local, proj_base, body, tcx).ty;
211+
let base_ty = Place::ty_from(&borrow_local, proj_base, body, tcx).ty;
212212

213213
match (elem, &base_ty.kind, access) {
214214
(_, _, Shallow(Some(ArtificialField::ArrayLength)))
@@ -293,7 +293,7 @@ fn place_components_conflict<'tcx>(
293293
// Given that the bases of `elem1` and `elem2` are always either equal
294294
// or disjoint (and have the same type!), return the overlap situation
295295
// between `elem1` and `elem2`.
296-
fn place_base_conflict(l1: &Local, l2: &Local) -> Overlap {
296+
fn place_base_conflict(l1: Local, l2: Local) -> Overlap {
297297
if l1 == l2 {
298298
// the same local - base case, equal
299299
debug!("place_element_conflict: DISJOINT-OR-EQ-LOCAL");
@@ -311,7 +311,7 @@ fn place_base_conflict(l1: &Local, l2: &Local) -> Overlap {
311311
fn place_projection_conflict<'tcx>(
312312
tcx: TyCtxt<'tcx>,
313313
body: &Body<'tcx>,
314-
pi1_local: &Local,
314+
pi1_local: Local,
315315
pi1_proj_base: &[PlaceElem<'tcx>],
316316
pi1_elem: &PlaceElem<'tcx>,
317317
pi2_elem: &PlaceElem<'tcx>,
@@ -329,7 +329,7 @@ fn place_projection_conflict<'tcx>(
329329
debug!("place_element_conflict: DISJOINT-OR-EQ-FIELD");
330330
Overlap::EqualOrDisjoint
331331
} else {
332-
let ty = Place::ty_from(pi1_local, pi1_proj_base, body, tcx).ty;
332+
let ty = Place::ty_from(&pi1_local, pi1_proj_base, body, tcx).ty;
333333
match ty.kind {
334334
ty::Adt(def, _) if def.is_union() => {
335335
// Different fields of a union, we are basically stuck.

0 commit comments

Comments
 (0)