@@ -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 : ShallowOrDeep ,
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 ) , _) => {
@@ -194,7 +194,7 @@ fn place_components_conflict<'gcx, 'tcx>(
194
194
// I'm not sure why we are tracking these borrows - shared
195
195
// references can *always* be aliased, which means the
196
196
// permission check already account for this borrow.
197
- debug ! ( "places_conflict : behind a shared ref" ) ;
197
+ debug ! ( "borrow_conflicts_with_place : behind a shared ref" ) ;
198
198
return false ;
199
199
}
200
200
@@ -226,10 +226,10 @@ fn place_components_conflict<'gcx, 'tcx>(
226
226
// that the borrow can access a *part* of our place that
227
227
// our access cares about, so we still have a conflict.
228
228
if borrow_kind == BorrowKind :: Shallow && access_components. next ( ) . is_some ( ) {
229
- debug ! ( "places_conflict : shallow borrow" ) ;
229
+ debug ! ( "borrow_conflicts_with_place : shallow borrow" ) ;
230
230
return false ;
231
231
} else {
232
- debug ! ( "places_conflict : full borrow, CONFLICT" ) ;
232
+ debug ! ( "borrow_conflicts_with_place : full borrow, CONFLICT" ) ;
233
233
return true ;
234
234
}
235
235
}
@@ -243,7 +243,7 @@ fn place_components_conflict<'gcx, 'tcx>(
243
243
///
244
244
/// NB: This particular impl strategy is not the most obvious. It was
245
245
/// chosen because it makes a measurable difference to NLL
246
- /// performance, as this code (`places_conflict `) is somewhat hot.
246
+ /// performance, as this code (`borrow_conflicts_with_place `) is somewhat hot.
247
247
struct PlaceComponents < ' p , ' tcx : ' p > {
248
248
component : & ' p Place < ' tcx > ,
249
249
next : Option < & ' p PlaceComponents < ' p , ' tcx > > ,
0 commit comments