@@ -17,7 +17,7 @@ use rustc::mir::{Projection, ProjectionElem};
17
17
use rustc:: ty:: { self , TyCtxt } ;
18
18
use std:: cmp:: max;
19
19
20
- pub ( super ) fn places_conflict < ' gcx , ' tcx > (
20
+ pub ( super ) fn borrow_conflicts_with_place < ' gcx , ' tcx > (
21
21
tcx : TyCtxt < ' _ , ' gcx , ' tcx > ,
22
22
mir : & Mir < ' tcx > ,
23
23
borrow_place : & Place < ' tcx > ,
@@ -26,7 +26,7 @@ pub(super) fn places_conflict<'gcx, 'tcx>(
26
26
access : AccessDepth ,
27
27
) -> bool {
28
28
debug ! (
29
- "places_conflict ({:?},{:?},{:?})" ,
29
+ "borrow_conflicts_with_place ({:?},{:?},{:?})" ,
30
30
borrow_place, access_place, access
31
31
) ;
32
32
@@ -104,10 +104,10 @@ fn place_components_conflict<'gcx, 'tcx>(
104
104
loop {
105
105
// loop invariant: borrow_c is always either equal to access_c or disjoint from it.
106
106
if let Some ( borrow_c) = borrow_components. next ( ) {
107
- debug ! ( "places_conflict : borrow_c = {:?}" , borrow_c) ;
107
+ debug ! ( "borrow_conflicts_with_place : borrow_c = {:?}" , borrow_c) ;
108
108
109
109
if let Some ( access_c) = access_components. next ( ) {
110
- debug ! ( "places_conflict : access_c = {:?}" , access_c) ;
110
+ debug ! ( "borrow_conflicts_with_place : access_c = {:?}" , access_c) ;
111
111
112
112
// Borrow and access path both have more components.
113
113
//
@@ -136,7 +136,7 @@ fn place_components_conflict<'gcx, 'tcx>(
136
136
// idea, at least for now, so just give up and
137
137
// report a conflict. This is unsafe code anyway so
138
138
// the user could always use raw pointers.
139
- debug ! ( "places_conflict : arbitrary -> conflict" ) ;
139
+ debug ! ( "borrow_conflicts_with_place : arbitrary -> conflict" ) ;
140
140
return true ;
141
141
}
142
142
Overlap :: EqualOrDisjoint => {
@@ -145,7 +145,7 @@ fn place_components_conflict<'gcx, 'tcx>(
145
145
Overlap :: Disjoint => {
146
146
// We have proven the borrow disjoint - further
147
147
// projections will remain disjoint.
148
- debug ! ( "places_conflict : disjoint" ) ;
148
+ debug ! ( "borrow_conflicts_with_place : disjoint" ) ;
149
149
return false ;
150
150
}
151
151
}
@@ -177,15 +177,15 @@ fn place_components_conflict<'gcx, 'tcx>(
177
177
//
178
178
// e.g. a (mutable) borrow of `a[5]` while we read the
179
179
// array length of `a`.
180
- debug ! ( "places_conflict : implicit field" ) ;
180
+ debug ! ( "borrow_conflicts_with_place : implicit field" ) ;
181
181
return false ;
182
182
}
183
183
184
184
( ProjectionElem :: Deref , _, Shallow ( None ) ) => {
185
185
// e.g. a borrow of `*x.y` while we shallowly access `x.y` or some
186
186
// prefix thereof - the shallow access can't touch anything behind
187
187
// the pointer.
188
- debug ! ( "places_conflict : shallow access behind ptr" ) ;
188
+ debug ! ( "borrow_conflicts_with_place : shallow access behind ptr" ) ;
189
189
return false ;
190
190
}
191
191
( ProjectionElem :: Deref , ty:: Ref ( _, _, hir:: MutImmutable ) , _) => {
@@ -195,7 +195,7 @@ fn place_components_conflict<'gcx, 'tcx>(
195
195
( ProjectionElem :: Deref , ty:: Ref ( _, _, hir:: MutMutable ) , AccessDepth :: Drop ) => {
196
196
// Values behind a mutatble reference are not access either by Dropping a
197
197
// value, or by StorageDead
198
- debug ! ( "places_conflict : drop access behind ptr" ) ;
198
+ debug ! ( "borrow_conflicts_with_place : drop access behind ptr" ) ;
199
199
return false ;
200
200
}
201
201
@@ -236,10 +236,10 @@ fn place_components_conflict<'gcx, 'tcx>(
236
236
// that the borrow can access a *part* of our place that
237
237
// our access cares about, so we still have a conflict.
238
238
if borrow_kind == BorrowKind :: Shallow && access_components. next ( ) . is_some ( ) {
239
- debug ! ( "places_conflict : shallow borrow" ) ;
239
+ debug ! ( "borrow_conflicts_with_place : shallow borrow" ) ;
240
240
return false ;
241
241
} else {
242
- debug ! ( "places_conflict : full borrow, CONFLICT" ) ;
242
+ debug ! ( "borrow_conflicts_with_place : full borrow, CONFLICT" ) ;
243
243
return true ;
244
244
}
245
245
}
@@ -253,7 +253,7 @@ fn place_components_conflict<'gcx, 'tcx>(
253
253
///
254
254
/// NB: This particular impl strategy is not the most obvious. It was
255
255
/// chosen because it makes a measurable difference to NLL
256
- /// performance, as this code (`places_conflict `) is somewhat hot.
256
+ /// performance, as this code (`borrow_conflicts_with_place `) is somewhat hot.
257
257
struct PlaceComponents < ' p , ' tcx : ' p > {
258
258
component : & ' p Place < ' tcx > ,
259
259
next : Option < & ' p PlaceComponents < ' p , ' tcx > > ,
0 commit comments