Skip to content

Commit f700cf3

Browse files
committed
librustc: Extract first_move from the move data into an accessor
1 parent f19a9b9 commit f700cf3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/librustc/middle/borrowck/move_data.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ impl MoveData {
181181
self.paths[*index].parent
182182
}
183183

184+
fn path_first_move(&self, index: MovePathIndex) -> MoveIndex {
185+
self.paths[*index].first_move
186+
}
187+
184188
fn path<'a>(&'a self, index: MovePathIndex) -> &'a MovePath {
185189
//! Type safe indexing operator
186190
&self.paths[*index]
@@ -319,7 +323,7 @@ impl MoveData {
319323
let path_index = self.move_path(tcx, lp);
320324
let move_index = MoveIndex(self.moves.len());
321325

322-
let next_move = self.path(path_index).first_move;
326+
let next_move = self.path_first_move(path_index);
323327
self.mut_path(path_index).first_move = move_index;
324328

325329
self.moves.push(Move {
@@ -456,7 +460,7 @@ impl MoveData {
456460
-> bool {
457461
let mut ret = true;
458462
self.each_extending_path(index0, |index| {
459-
let mut p = self.path(index).first_move;
463+
let mut p = self.path_first_move(index);
460464
while p != InvalidMoveIndex {
461465
if !f(p) {
462466
ret = false;

0 commit comments

Comments
 (0)