@@ -177,6 +177,10 @@ impl MoveData {
177
177
self . paths [ * index] . loan_path
178
178
}
179
179
180
+ fn path_parent ( & self , index : MovePathIndex ) -> MovePathIndex {
181
+ self . paths [ * index] . parent
182
+ }
183
+
180
184
fn path < ' a > ( & ' a self , index : MovePathIndex ) -> & ' a MovePath {
181
185
//! Type safe indexing operator
182
186
& self . paths [ * index]
@@ -194,7 +198,7 @@ impl MoveData {
194
198
195
199
fn is_var_path ( & self , index : MovePathIndex ) -> bool {
196
200
//! True if `index` refers to a variable
197
- self . path ( index) . parent == InvalidMovePathIndex
201
+ self . path_parent ( index) == InvalidMovePathIndex
198
202
}
199
203
200
204
pub fn move_path ( & mut self ,
@@ -232,7 +236,7 @@ impl MoveData {
232
236
let parent_index = self . move_path ( tcx, base) ;
233
237
let index = MovePathIndex ( self . paths . len ( ) ) ;
234
238
235
- let next_sibling = self . path ( parent_index) . first_child ;
239
+ let next_sibling = self . path_first_child ( parent_index) ;
236
240
self . mut_path ( parent_index) . first_child = index;
237
241
238
242
self . paths . push ( MovePath {
@@ -422,7 +426,7 @@ impl MoveData {
422
426
if !f ( p) {
423
427
return false ;
424
428
}
425
- p = self . path ( p) . parent ;
429
+ p = self . path_parent ( p) ;
426
430
}
427
431
return true ;
428
432
}
0 commit comments