Skip to content

Commit 58466a7

Browse files
committed
---
yaml --- r: 94716 b: refs/heads/try c: f19a9b9 h: refs/heads/master v: v3
1 parent 5249456 commit 58466a7

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: 211c6d522b727f0e29994d84a7d53bb7b0d68bcd
5+
refs/heads/try: f19a9b96004d04ae885de30cbc4f88e214a87fb8
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/middle/borrowck/move_data.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ impl MoveData {
177177
self.paths[*index].loan_path
178178
}
179179

180+
fn path_parent(&self, index: MovePathIndex) -> MovePathIndex {
181+
self.paths[*index].parent
182+
}
183+
180184
fn path<'a>(&'a self, index: MovePathIndex) -> &'a MovePath {
181185
//! Type safe indexing operator
182186
&self.paths[*index]
@@ -194,7 +198,7 @@ impl MoveData {
194198

195199
fn is_var_path(&self, index: MovePathIndex) -> bool {
196200
//! True if `index` refers to a variable
197-
self.path(index).parent == InvalidMovePathIndex
201+
self.path_parent(index) == InvalidMovePathIndex
198202
}
199203

200204
pub fn move_path(&mut self,
@@ -232,7 +236,7 @@ impl MoveData {
232236
let parent_index = self.move_path(tcx, base);
233237
let index = MovePathIndex(self.paths.len());
234238

235-
let next_sibling = self.path(parent_index).first_child;
239+
let next_sibling = self.path_first_child(parent_index);
236240
self.mut_path(parent_index).first_child = index;
237241

238242
self.paths.push(MovePath {
@@ -422,7 +426,7 @@ impl MoveData {
422426
if !f(p) {
423427
return false;
424428
}
425-
p = self.path(p).parent;
429+
p = self.path_parent(p);
426430
}
427431
return true;
428432
}

0 commit comments

Comments
 (0)